diff --git a/README.md b/README.md index 470e79c..4259f95 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The flow of this game is managed using Javascript. The main chunks of business l - `cd` into that directory and run `npm install` - Use `gulp serve` to start a local webserver which will make the site available at http://localhost:8080/. Cross origin errors prevent this project from being accessed in the browser with the `file://` protocol. - If you're interested in modifying the code, use the `gulp dev` task to serve the site on http://localhost:8080/ and trigger automatic builds and reloads of the page when changes are detected in the `src` directory. - - If you want to manually cut a build of the JS, the default gulp task will transpile to ES5 and browserify everything into a single `duckhunt.js` file in the `dist` folder. The default task also constructs new image and audio sprite sheets and their respecitve manifests. + - If you want to manually cut a build of the JS, the default gulp task will transpile to ES5 and browserify everything into a single `main.js` file in the `dist` folder. The default task also constructs new image and audio sprite sheets and their respecitve manifests. ## Bugs Please report bugs as [issues](https://github.com/MattSurabian/DuckHunt-JS/issues). diff --git a/dist/audio.json b/dist/audio.json index 099c1d9..77498a9 100644 --- a/dist/audio.json +++ b/dist/audio.json @@ -1,5 +1,5 @@ { - "urls": [ + "src": [ "audio.ogg", "audio.mp3" ], diff --git a/dist/audio.ogg b/dist/audio.ogg index c8feeda..47f044c 100644 Binary files a/dist/audio.ogg and b/dist/audio.ogg differ diff --git a/dist/duckhunt.js b/dist/duckhunt.js index 2190491..e50984d 100644 --- a/dist/duckhunt.js +++ b/dist/duckhunt.js @@ -1,20341 +1,43527 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= arr.length) { - callback(); - } - } - } - }; - async.forEach = async.each; +Object.defineProperty(exports, 'Transform', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Transform).default; + } +}); - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; +var _TransformStatic = __webpack_require__(238); - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; +Object.defineProperty(exports, 'TransformStatic', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TransformStatic).default; + } +}); - var _eachLimit = function (limit) { +var _TransformBase = __webpack_require__(125); - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; +Object.defineProperty(exports, 'TransformBase', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TransformBase).default; + } +}); - (function replenish () { - if (completed >= arr.length) { - return callback(); - } +var _Sprite = __webpack_require__(129); - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; +Object.defineProperty(exports, 'Sprite', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Sprite).default; + } +}); +var _CanvasSpriteRenderer = __webpack_require__(549); - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; +Object.defineProperty(exports, 'CanvasSpriteRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasSpriteRenderer).default; + } +}); +var _CanvasTinter = __webpack_require__(130); - var _asyncMap = function (eachfn, arr, iterator, callback) { - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - if (!callback) { - eachfn(arr, function (x, callback) { - iterator(x.value, function (err) { - callback(err); - }); - }); - } else { - var results = []; - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; +Object.defineProperty(exports, 'CanvasTinter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasTinter).default; + } +}); - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; +var _SpriteRenderer = __webpack_require__(551); - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; +Object.defineProperty(exports, 'SpriteRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_SpriteRenderer).default; + } +}); - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; +var _Text = __webpack_require__(553); - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; +Object.defineProperty(exports, 'Text', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Text).default; + } +}); - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); +var _TextStyle = __webpack_require__(248); - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); +Object.defineProperty(exports, 'TextStyle', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TextStyle).default; + } +}); - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; +var _Graphics = __webpack_require__(521); - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; +Object.defineProperty(exports, 'Graphics', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Graphics).default; + } +}); - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; +var _GraphicsData = __webpack_require__(239); - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - var remainingTasks = keys.length - if (!remainingTasks) { - return callback(); - } +Object.defineProperty(exports, 'GraphicsData', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_GraphicsData).default; + } +}); - var results = {}; +var _GraphicsRenderer = __webpack_require__(524); - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - remainingTasks-- - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; +Object.defineProperty(exports, 'GraphicsRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_GraphicsRenderer).default; + } +}); - addListener(function () { - if (!remainingTasks) { - var theCallback = callback; - // prevent final callback from calling itself if it errors - callback = function () {}; +var _CanvasGraphicsRenderer = __webpack_require__(522); - theCallback(null, results); - } - }); +Object.defineProperty(exports, 'CanvasGraphicsRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasGraphicsRenderer).default; + } +}); - _each(keys, function (k) { - var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.setImmediate(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; +var _Texture = __webpack_require__(57); - async.retry = function(times, task, callback) { - var DEFAULT_TIMES = 5; - var attempts = []; - // Use defaults if times not passed - if (typeof times === 'function') { - callback = task; - task = times; - times = DEFAULT_TIMES; - } - // Make sure times is a number - times = parseInt(times, 10) || DEFAULT_TIMES; - var wrappedTask = function(wrappedCallback, wrappedResults) { - var retryAttempt = function(task, finalAttempt) { - return function(seriesCallback) { - task(function(err, result){ - seriesCallback(!err || finalAttempt, {err: err, result: result}); - }, wrappedResults); - }; - }; - while (times) { - attempts.push(retryAttempt(task, !(times-=1))); - } - async.series(attempts, function(done, data){ - data = data[data.length - 1]; - (wrappedCallback || callback)(data.err, data.result); - }); - } - // If a callback is passed, run this as a controll flow - return callback ? wrappedTask() : wrappedTask - }; +Object.defineProperty(exports, 'Texture', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Texture).default; + } +}); - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!_isArray(tasks)) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.setImmediate(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; +var _BaseTexture = __webpack_require__(56); - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; +Object.defineProperty(exports, 'BaseTexture', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BaseTexture).default; + } +}); - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; +var _RenderTexture = __webpack_require__(131); - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; +Object.defineProperty(exports, 'RenderTexture', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_RenderTexture).default; + } +}); - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; +var _BaseRenderTexture = __webpack_require__(249); - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; +Object.defineProperty(exports, 'BaseRenderTexture', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BaseRenderTexture).default; + } +}); - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); +var _VideoBaseTexture = __webpack_require__(251); - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; +Object.defineProperty(exports, 'VideoBaseTexture', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_VideoBaseTexture).default; + } +}); - async.doWhilst = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (test.apply(null, args)) { - async.doWhilst(iterator, test, callback); - } - else { - callback(); - } - }); - }; +var _TextureUvs = __webpack_require__(250); - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; +Object.defineProperty(exports, 'TextureUvs', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TextureUvs).default; + } +}); - async.doUntil = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (!test.apply(null, args)) { - async.doUntil(iterator, test, callback); - } - else { - callback(); - } - }); - }; +var _CanvasRenderTarget = __webpack_require__(243); - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } +Object.defineProperty(exports, 'CanvasRenderTarget', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasRenderTarget).default; + } +}); - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } +var _Shader = __webpack_require__(52); - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - started: false, - paused: false, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - kill: function () { - q.drain = null; - q.tasks = []; - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (!q.paused && workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(next); - worker(task.data, cb); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - }, - idle: function() { - return q.tasks.length + workers === 0; - }, - pause: function () { - if (q.paused === true) { return; } - q.paused = true; - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - // Need to call q.process once per concurrent - // worker to preserve full concurrency after pause - for (var w = 1; w <= q.concurrency; w++) { - async.setImmediate(q.process); - } - } - }; - return q; - }; +Object.defineProperty(exports, 'Shader', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Shader).default; + } +}); - async.priorityQueue = function (worker, concurrency) { +var _WebGLManager = __webpack_require__(55); - function _compareTasks(a, b){ - return a.priority - b.priority; - }; +Object.defineProperty(exports, 'WebGLManager', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_WebGLManager).default; + } +}); - function _binarySearch(sequence, item, compare) { - var beg = -1, - end = sequence.length - 1; - while (beg < end) { - var mid = beg + ((end - beg + 1) >>> 1); - if (compare(item, sequence[mid]) >= 0) { - beg = mid; - } else { - end = mid - 1; - } - } - return beg; - } +var _ObjectRenderer = __webpack_require__(83); - function _insert(q, data, priority, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - priority: priority, - callback: typeof callback === 'function' ? callback : null - }; +Object.defineProperty(exports, 'ObjectRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_ObjectRenderer).default; + } +}); - q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); +var _RenderTarget = __webpack_require__(84); - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } +Object.defineProperty(exports, 'RenderTarget', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_RenderTarget).default; + } +}); - // Start with a normal queue - var q = async.queue(worker, concurrency); +var _Quad = __webpack_require__(247); - // Override push to accept second parameter representing priority - q.push = function (data, priority, callback) { - _insert(q, data, priority, callback); - }; +Object.defineProperty(exports, 'Quad', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Quad).default; + } +}); - // Remove unshift function - delete q.unshift; +var _SpriteMaskFilter = __webpack_require__(246); - return q; - }; +Object.defineProperty(exports, 'SpriteMaskFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_SpriteMaskFilter).default; + } +}); - async.cargo = function (worker, payload) { - var working = false, - tasks = []; +var _Filter = __webpack_require__(245); - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - drained: true, - push: function (data, callback) { - if (!_isArray(data)) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - cargo.drained = false; - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.setImmediate(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain && !cargo.drained) cargo.drain(); - cargo.drained = true; - return; - } +Object.defineProperty(exports, 'Filter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Filter).default; + } +}); - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0, tasks.length); +var _Application = __webpack_require__(520); - var ds = _map(ts, function (task) { - return task.data; - }); +Object.defineProperty(exports, 'Application', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Application).default; + } +}); - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; +var _autoDetectRenderer = __webpack_require__(235); - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); +Object.defineProperty(exports, 'autoDetectRenderer', { + enumerable: true, + get: function get() { + return _autoDetectRenderer.autoDetectRenderer; + } +}); - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ +var _utils = __webpack_require__(5); - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - async.nextTick(function () { - callback.apply(null, memo[key]); - }); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; +var utils = _interopRequireWildcard(_utils); - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; +var _ticker = __webpack_require__(253); - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; +var ticker = _interopRequireWildcard(_ticker); - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; +var _settings = __webpack_require__(10); - async.seq = function (/* functions... */) { - var fns = arguments; - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; +var _settings2 = _interopRequireDefault(_settings); - async.compose = function (/* functions... */) { - return async.seq.apply(null, Array.prototype.reverse.call(arguments)); - }; +var _CanvasRenderer = __webpack_require__(54); - var _applyEach = function (eachfn, fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return eachfn(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - return go.apply(this, args); - } - else { - return go; - } - }; - async.applyEach = doParallel(_applyEach); - async.applyEachSeries = doSeries(_applyEach); +var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); - async.forever = function (fn, callback) { - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - fn(next); - } - next(); - }; +var _WebGLRenderer = __webpack_require__(82); - // Node.js - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // AMD / RequireJS - else if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // included directly via - * - * - * - * - * - * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back". - * @param {!Array.} dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"] - * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition. - * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object) - */ - Definition = function(ns, dependencies, func, global) { - this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses - _defLookup[ns] = this; - this.gsClass = null; - this.func = func; - var _classes = []; - this.check = function(init) { - var i = dependencies.length, - missing = i, - cur, a, n, cl, hasModule; - while (--i > -1) { - if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) { - _classes[i] = cur.gsClass; - missing--; - } else if (init) { - cur.sc.push(this); - } - } - if (missing === 0 && func) { - a = ("com.greensock." + ns).split("."); - n = a.pop(); - cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes); + return BaseTexture; +}(_eventemitter2.default); - //exports to multiple environments - if (global) { - _globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) - hasModule = (typeof(module) !== "undefined" && module.exports); - if (!hasModule && typeof(define) === "function" && define.amd){ //AMD - define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; }); - } else if (ns === moduleName && hasModule){ //node - module.exports = cl; - } - } - for (i = 0; i < this.sc.length; i++) { - this.sc[i].check(); - } - } - }; - this.check(true); - }, +exports.default = BaseTexture; +//# sourceMappingURL=BaseTexture.js.map - //used to create Definition instances (which basically registers a class that has dependencies). - _gsDefine = window._gsDefine = function(ns, dependencies, func, global) { - return new Definition(ns, dependencies, func, global); - }, +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { - //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class). - _class = gs._class = function(ns, func, global) { - func = func || function() {}; - _gsDefine(ns, [], function(){ return func; }, global); - return func; - }; +"use strict"; - _gsDefine.globals = _globals; +exports.__esModule = true; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/* - * ---------------------------------------------------------------- - * Ease - * ---------------------------------------------------------------- - */ - var _baseParams = [0, 0, 1, 1], - _blankArray = [], - Ease = _class("easing.Ease", function(func, extraParams, type, power) { - this._func = func; - this._type = type || 0; - this._power = power || 0; - this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams; - }, true), - _easeMap = Ease.map = {}, - _easeReg = Ease.register = function(ease, names, types, create) { - var na = names.split(","), - i = na.length, - ta = (types || "easeIn,easeOut,easeInOut").split(","), - e, name, j, type; - while (--i > -1) { - name = na[i]; - e = create ? _class("easing."+name, null, true) : gs.easing[name] || {}; - j = ta.length; - while (--j > -1) { - type = ta[j]; - _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease(); - } - } - }; +var _BaseTexture = __webpack_require__(56); - p = Ease.prototype; - p._calcEnd = false; - p.getRatio = function(p) { - if (this._func) { - this._params[0] = p; - return this._func.apply(null, this._params); - } - var t = this._type, - pw = this._power, - r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2; - if (pw === 1) { - r *= r; - } else if (pw === 2) { - r *= r * r; - } else if (pw === 3) { - r *= r * r * r; - } else if (pw === 4) { - r *= r * r * r * r; - } - return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2); - }; +var _BaseTexture2 = _interopRequireDefault(_BaseTexture); - //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut) - a = ["Linear","Quad","Cubic","Quart","Quint,Strong"]; - i = a.length; - while (--i > -1) { - p = a[i]+",Power"+i; - _easeReg(new Ease(null,null,1,i), p, "easeOut", true); - _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : "")); - _easeReg(new Ease(null,null,3,i), p, "easeInOut"); - } - _easeMap.linear = gs.easing.Linear.easeIn; - _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks +var _VideoBaseTexture = __webpack_require__(251); +var _VideoBaseTexture2 = _interopRequireDefault(_VideoBaseTexture); -/* - * ---------------------------------------------------------------- - * EventDispatcher - * ---------------------------------------------------------------- - */ - var EventDispatcher = _class("events.EventDispatcher", function(target) { - this._listeners = {}; - this._eventTarget = target || this; - }); - p = EventDispatcher.prototype; +var _TextureUvs = __webpack_require__(250); - p.addEventListener = function(type, callback, scope, useParam, priority) { - priority = priority || 0; - var list = this._listeners[type], - index = 0, - listener, i; - if (list == null) { - this._listeners[type] = list = []; - } - i = list.length; - while (--i > -1) { - listener = list[i]; - if (listener.c === callback && listener.s === scope) { - list.splice(i, 1); - } else if (index === 0 && listener.pr < priority) { - index = i + 1; - } - } - list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority}); - if (this === _ticker && !_tickerActive) { - _ticker.wake(); - } - }; +var _TextureUvs2 = _interopRequireDefault(_TextureUvs); - p.removeEventListener = function(type, callback) { - var list = this._listeners[type], i; - if (list) { - i = list.length; - while (--i > -1) { - if (list[i].c === callback) { - list.splice(i, 1); - return; - } - } - } - }; +var _eventemitter = __webpack_require__(24); - p.dispatchEvent = function(type) { - var list = this._listeners[type], - i, t, listener; - if (list) { - i = list.length; - t = this._eventTarget; - while (--i > -1) { - listener = list[i]; - if (listener) { - if (listener.up) { - listener.c.call(listener.s || t, {type:type, target:t}); - } else { - listener.c.call(listener.s || t); - } - } - } - } - }; +var _eventemitter2 = _interopRequireDefault(_eventemitter); +var _math = __webpack_require__(7); -/* - * ---------------------------------------------------------------- - * Ticker - * ---------------------------------------------------------------- +var _utils = __webpack_require__(5); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * A texture stores the information that represents an image or part of an image. It cannot be added + * to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided + * then the whole image is used. + * + * You can directly create a texture from an image and then reuse it multiple times like this : + * + * ```js + * let texture = PIXI.Texture.fromImage('assets/image.png'); + * let sprite1 = new PIXI.Sprite(texture); + * let sprite2 = new PIXI.Sprite(texture); + * ``` + * + * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing. + * You can check for this by checking the sprite's _textureID property. + * ```js + * var texture = PIXI.Texture.fromImage('assets/image.svg'); + * var sprite1 = new PIXI.Sprite(texture); + * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file + * ``` + * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068. + * + * @class + * @extends EventEmitter + * @memberof PIXI */ - var _reqAnimFrame = window.requestAnimationFrame, - _cancelAnimFrame = window.cancelAnimationFrame, - _getTime = Date.now || function() {return new Date().getTime();}, - _lastUpdate = _getTime(); +var Texture = function (_EventEmitter) { + _inherits(Texture, _EventEmitter); - //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. - a = ["ms","moz","webkit","o"]; - i = a.length; - while (--i > -1 && !_reqAnimFrame) { - _reqAnimFrame = window[a[i] + "RequestAnimationFrame"]; - _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"]; - } + /** + * @param {PIXI.BaseTexture} baseTexture - The base texture source to create the texture from + * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show + * @param {PIXI.Rectangle} [orig] - The area of original texture + * @param {PIXI.Rectangle} [trim] - Trimmed rectangle of original texture + * @param {number} [rotate] - indicates how the texture was rotated by texture packer. See {@link PIXI.GroupD8} + */ + function Texture(baseTexture, frame, orig, trim, rotate) { + _classCallCheck(this, Texture); - _class("Ticker", function(fps, useRAF) { - var _self = this, - _startTime = _getTime(), - _useRAF = (useRAF !== false && _reqAnimFrame) ? "auto" : false, - _lagThreshold = 500, - _adjustedLag = 33, - _tickWord = "tick", //helps reduce gc burden - _fps, _req, _id, _gap, _nextTime, - _tick = function(manual) { - var elapsed = _getTime() - _lastUpdate, - overlap, dispatch; - if (elapsed > _lagThreshold) { - _startTime += elapsed - _adjustedLag; - } - _lastUpdate += elapsed; - _self.time = (_lastUpdate - _startTime) / 1000; - overlap = _self.time - _nextTime; - if (!_fps || overlap > 0 || manual === true) { - _self.frame++; - _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); - dispatch = true; - } - if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. - _id = _req(_tick); - } - if (dispatch) { - _self.dispatchEvent(_tickWord); - } - }; + /** + * Does this Texture have any frame data assigned to it? + * + * @member {boolean} + */ + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - EventDispatcher.call(_self); - _self.time = _self.frame = 0; - _self.tick = function() { - _tick(true); - }; + _this.noFrame = false; - _self.lagSmoothing = function(threshold, adjustedLag) { - _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited - _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0); - }; + if (!frame) { + _this.noFrame = true; + frame = new _math.Rectangle(0, 0, 1, 1); + } - _self.sleep = function() { - if (_id == null) { - return; - } - if (!_useRAF || !_cancelAnimFrame) { - clearTimeout(_id); - } else { - _cancelAnimFrame(_id); - } - _req = _emptyFunc; - _id = null; - if (_self === _ticker) { - _tickerActive = false; - } - }; + if (baseTexture instanceof Texture) { + baseTexture = baseTexture.baseTexture; + } - _self.wake = function(seamless) { - if (_id !== null) { - _self.sleep(); - } else if (seamless) { - _startTime += -_lastUpdate + (_lastUpdate = _getTime()); - } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout(). - _lastUpdate = _getTime() - _lagThreshold + 5; - } - _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame; - if (_self === _ticker) { - _tickerActive = true; - } - _tick(2); - }; + /** + * The base texture that this texture uses. + * + * @member {PIXI.BaseTexture} + */ + _this.baseTexture = baseTexture; - _self.fps = function(value) { - if (!arguments.length) { - return _fps; - } - _fps = value; - _gap = 1 / (_fps || 60); - _nextTime = this.time + _gap; - _self.wake(); - }; + /** + * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, + * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) + * + * @member {PIXI.Rectangle} + */ + _this._frame = frame; - _self.useRAF = function(value) { - if (!arguments.length) { - return _useRAF; - } - _self.sleep(); - _useRAF = value; - _self.fps(_fps); - }; - _self.fps(fps); + /** + * This is the trimmed area of original texture, before it was put in atlas + * + * @member {PIXI.Rectangle} + */ + _this.trim = trim; - //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition. - setTimeout(function() { - if (_useRAF === "auto" && _self.frame < 5 && document.visibilityState !== "hidden") { - _self.useRAF(false); - } - }, 1500); - }); + /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * + * @member {boolean} + */ + _this.valid = false; - p = gs.Ticker.prototype = new gs.events.EventDispatcher(); - p.constructor = gs.Ticker; + /** + * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) + * + * @member {boolean} + */ + _this.requiresUpdate = false; + /** + * The WebGL UV data cache. + * + * @member {PIXI.TextureUvs} + * @private + */ + _this._uvs = null; -/* - * ---------------------------------------------------------------- - * Animation - * ---------------------------------------------------------------- - */ - var Animation = _class("core.Animation", function(duration, vars) { - this.vars = vars = vars || {}; - this._duration = this._totalDuration = duration || 0; - this._delay = Number(vars.delay) || 0; - this._timeScale = 1; - this._active = (vars.immediateRender === true); - this.data = vars.data; - this._reversed = (vars.reversed === true); + /** + * This is the area of original texture, before it was put in atlas + * + * @member {PIXI.Rectangle} + */ + _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1); - if (!_rootTimeline) { - return; - } - if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. - _ticker.wake(); - } + _this._rotate = Number(rotate || 0); - var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline; - tl.add(this, tl._time); + if (rotate === true) { + // this is old texturepacker legacy, some games/libraries are passing "true" for rotated textures + _this._rotate = 2; + } else if (_this._rotate % 2 !== 0) { + throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually'); + } - if (this.vars.paused) { - this.paused(true); - } - }); + if (baseTexture.hasLoaded) { + if (_this.noFrame) { + frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); - _ticker = Animation.ticker = new gs.Ticker(); - p = Animation.prototype; - p._dirty = p._gc = p._initted = p._paused = false; - p._totalTime = p._time = 0; - p._rawPrevTime = -1; - p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; - p._paused = false; + // if there is no frame we should monitor for any base texture changes.. + baseTexture.on('update', _this.onBaseTextureUpdated, _this); + } + _this.frame = frame; + } else { + baseTexture.once('loaded', _this.onBaseTextureLoaded, _this); + } + /** + * Fired when the texture is updated. This happens if the frame or the baseTexture is updated. + * + * @event update + * @memberof PIXI.Texture# + * @protected + */ - //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. - var _checkTimeout = function() { - if (_tickerActive && _getTime() - _lastUpdate > 2000) { - _ticker.wake(); - } - setTimeout(_checkTimeout, 2000); - }; - _checkTimeout(); + _this._updateID = 0; + /** + * Extra field for extra plugins. May contain clamp settings and some matrices + * @type {Object} + */ + _this.transform = null; + return _this; + } - p.play = function(from, suppressEvents) { - if (from != null) { - this.seek(from, suppressEvents); - } - return this.reversed(false).paused(false); - }; + /** + * Updates this texture on the gpu. + * + */ - p.pause = function(atTime, suppressEvents) { - if (atTime != null) { - this.seek(atTime, suppressEvents); - } - return this.paused(true); - }; - p.resume = function(from, suppressEvents) { - if (from != null) { - this.seek(from, suppressEvents); - } - return this.paused(false); - }; + Texture.prototype.update = function update() { + this.baseTexture.update(); + }; - p.seek = function(time, suppressEvents) { - return this.totalTime(Number(time), suppressEvents !== false); - }; + /** + * Called when the base texture is loaded + * + * @private + * @param {PIXI.BaseTexture} baseTexture - The base texture. + */ - p.restart = function(includeDelay, suppressEvents) { - return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true); - }; - p.reverse = function(from, suppressEvents) { - if (from != null) { - this.seek((from || this.totalDuration()), suppressEvents); - } - return this.reversed(true).paused(false); - }; + Texture.prototype.onBaseTextureLoaded = function onBaseTextureLoaded(baseTexture) { + this._updateID++; - p.render = function(time, suppressEvents, force) { - //stub - we override this method in subclasses. - }; + // TODO this code looks confusing.. boo to abusing getters and setters! + if (this.noFrame) { + this.frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); + } else { + this.frame = this._frame; + } - p.invalidate = function() { - this._time = this._totalTime = 0; - this._initted = this._gc = false; - this._rawPrevTime = -1; - if (this._gc || !this.timeline) { - this._enabled(true); - } - return this; - }; + this.baseTexture.on('update', this.onBaseTextureUpdated, this); + this.emit('update', this); + }; - p.isActive = function() { - var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active. - startTime = this._startTime, - rawTime; - return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime()) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale)); - }; + /** + * Called when the base texture is updated + * + * @private + * @param {PIXI.BaseTexture} baseTexture - The base texture. + */ - p._enabled = function (enabled, ignoreTimeline) { - if (!_tickerActive) { - _ticker.wake(); - } - this._gc = !enabled; - this._active = this.isActive(); - if (ignoreTimeline !== true) { - if (enabled && !this.timeline) { - this._timeline.add(this, this._startTime - this._delay); - } else if (!enabled && this.timeline) { - this._timeline._remove(this, true); - } - } - return false; - }; + Texture.prototype.onBaseTextureUpdated = function onBaseTextureUpdated(baseTexture) { + this._updateID++; - p._kill = function(vars, target) { - return this._enabled(false, false); - }; + this._frame.width = baseTexture.width; + this._frame.height = baseTexture.height; - p.kill = function(vars, target) { - this._kill(vars, target); - return this; - }; + this.emit('update', this); + }; - p._uncache = function(includeSelf) { - var tween = includeSelf ? this : this.timeline; - while (tween) { - tween._dirty = true; - tween = tween.timeline; - } - return this; - }; + /** + * Destroys this texture + * + * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well + */ - p._swapSelfInParams = function(params) { - var i = params.length, - copy = params.concat(); - while (--i > -1) { - if (params[i] === "{self}") { - copy[i] = this; - } - } - return copy; - }; - p._callback = function(type) { - var v = this.vars; - v[type].apply(v[type + "Scope"] || v.callbackScope || this, v[type + "Params"] || _blankArray); - }; + Texture.prototype.destroy = function destroy(destroyBase) { + if (this.baseTexture) { + if (destroyBase) { + // delete the texture if it exists in the texture cache.. + // this only needs to be removed if the base texture is actually destroyed too.. + if (_utils.TextureCache[this.baseTexture.imageUrl]) { + delete _utils.TextureCache[this.baseTexture.imageUrl]; + } -//----Animation getters/setters -------------------------------------------------------- + this.baseTexture.destroy(); + } - p.eventCallback = function(type, callback, params, scope) { - if ((type || "").substr(0,2) === "on") { - var v = this.vars; - if (arguments.length === 1) { - return v[type]; - } - if (callback == null) { - delete v[type]; - } else { - v[type] = callback; - v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params; - v[type + "Scope"] = scope; - } - if (type === "onUpdate") { - this._onUpdate = callback; - } - } - return this; - }; + this.baseTexture.off('update', this.onBaseTextureUpdated, this); + this.baseTexture.off('loaded', this.onBaseTextureLoaded, this); - p.delay = function(value) { - if (!arguments.length) { - return this._delay; - } - if (this._timeline.smoothChildTiming) { - this.startTime( this._startTime + value - this._delay ); - } - this._delay = value; - return this; - }; + this.baseTexture = null; + } - p.duration = function(value) { - if (!arguments.length) { - this._dirty = false; - return this._duration; - } - this._duration = this._totalDuration = value; - this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration. - if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) { - this.totalTime(this._totalTime * (value / this._duration), true); - } - return this; - }; + this._frame = null; + this._uvs = null; + this.trim = null; + this.orig = null; - p.totalDuration = function(value) { - this._dirty = false; - return (!arguments.length) ? this._totalDuration : this.duration(value); - }; + this.valid = false; - p.time = function(value, suppressEvents) { - if (!arguments.length) { - return this._time; - } - if (this._dirty) { - this.totalDuration(); - } - return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents); - }; + this.off('dispose', this.dispose, this); + this.off('update', this.update, this); + }; - p.totalTime = function(time, suppressEvents, uncapped) { - if (!_tickerActive) { - _ticker.wake(); - } - if (!arguments.length) { - return this._totalTime; - } - if (this._timeline) { - if (time < 0 && !uncapped) { - time += this.totalDuration(); - } - if (this._timeline.smoothChildTiming) { - if (this._dirty) { - this.totalDuration(); - } - var totalDuration = this._totalDuration, - tl = this._timeline; - if (time > totalDuration && !uncapped) { - time = totalDuration; - } - this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale); - if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here. - this._uncache(false); - } - //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed. - if (tl._timeline) { - while (tl._timeline) { - if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) { - tl.totalTime(tl._totalTime, true); - } - tl = tl._timeline; - } - } - } - if (this._gc) { - this._enabled(true, false); - } - if (this._totalTime !== time || this._duration === 0) { - if (_lazyTweens.length) { - _lazyRender(); - } - this.render(time, suppressEvents, false); - if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render. - _lazyRender(); - } - } - } - return this; - }; + /** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} The new texture + */ - p.progress = p.totalProgress = function(value, suppressEvents) { - var duration = this.duration(); - return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents); - }; - p.startTime = function(value) { - if (!arguments.length) { - return this._startTime; - } - if (value !== this._startTime) { - this._startTime = value; - if (this.timeline) if (this.timeline._sortChildren) { - this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. - } - } - return this; - }; + Texture.prototype.clone = function clone() { + return new Texture(this.baseTexture, this.frame, this.orig, this.trim, this.rotate); + }; - p.endTime = function(includeRepeats) { - return this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale; - }; + /** + * Updates the internal WebGL UV cache. + * + * @protected + */ - p.timeScale = function(value) { - if (!arguments.length) { - return this._timeScale; - } - value = value || _tinyNum; //can't allow zero because it'll throw the math off - if (this._timeline && this._timeline.smoothChildTiming) { - var pauseTime = this._pauseTime, - t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime(); - this._startTime = t - ((t - this._startTime) * this._timeScale / value); - } - this._timeScale = value; - return this._uncache(false); - }; - p.reversed = function(value) { - if (!arguments.length) { - return this._reversed; - } - if (value != this._reversed) { - this._reversed = value; - this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true); - } - return this; - }; + Texture.prototype._updateUvs = function _updateUvs() { + if (!this._uvs) { + this._uvs = new _TextureUvs2.default(); + } - p.paused = function(value) { - if (!arguments.length) { - return this._paused; - } - var tl = this._timeline, - raw, elapsed; - if (value != this._paused) if (tl) { - if (!_tickerActive && !value) { - _ticker.wake(); - } - raw = tl.rawTime(); - elapsed = raw - this._pauseTime; - if (!value && tl.smoothChildTiming) { - this._startTime += elapsed; - this._uncache(false); - } - this._pauseTime = value ? raw : null; - this._paused = value; - this._active = this.isActive(); - if (!value && elapsed !== 0 && this._initted && this.duration()) { - raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale; - this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render. - } - } - if (this._gc && !value) { - this._enabled(true, false); - } - return this; - }; + this._uvs.set(this._frame, this.baseTexture, this.rotate); + this._updateID++; + }; -/* - * ---------------------------------------------------------------- - * SimpleTimeline - * ---------------------------------------------------------------- - */ - var SimpleTimeline = _class("core.SimpleTimeline", function(vars) { - Animation.call(this, 0, vars); - this.autoRemoveChildren = this.smoothChildTiming = true; - }); + /** + * Helper function that creates a Texture object from the given image url. + * If the image is not in the texture cache it will be created and loaded. + * + * @static + * @param {string} imageUrl - The image url of the texture + * @param {boolean} [crossorigin] - Whether requests should be treated as crossorigin + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [sourceScale=(auto)] - Scale for the original image, used with SVG images. + * @return {PIXI.Texture} The newly created texture + */ - p = SimpleTimeline.prototype = new Animation(); - p.constructor = SimpleTimeline; - p.kill()._gc = false; - p._first = p._last = p._recent = null; - p._sortChildren = false; - p.add = p.insert = function(child, position, align, stagger) { - var prevTween, st; - child._startTime = Number(position || 0) + child._delay; - if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order). - child._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale); - } - if (child.timeline) { - child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one. - } - child.timeline = child._timeline = this; - if (child._gc) { - child._enabled(true, true); - } - prevTween = this._last; - if (this._sortChildren) { - st = child._startTime; - while (prevTween && prevTween._startTime > st) { - prevTween = prevTween._prev; - } - } - if (prevTween) { - child._next = prevTween._next; - prevTween._next = child; - } else { - child._next = this._first; - this._first = child; - } - if (child._next) { - child._next._prev = child; - } else { - this._last = child; - } - child._prev = prevTween; - this._recent = child; - if (this._timeline) { - this._uncache(true); - } - return this; - }; + Texture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) { + var texture = _utils.TextureCache[imageUrl]; - p._remove = function(tween, skipDisable) { - if (tween.timeline === this) { - if (!skipDisable) { - tween._enabled(false, true); - } + if (!texture) { + texture = new Texture(_BaseTexture2.default.fromImage(imageUrl, crossorigin, scaleMode, sourceScale)); + _utils.TextureCache[imageUrl] = texture; + } - if (tween._prev) { - tween._prev._next = tween._next; - } else if (this._first === tween) { - this._first = tween._next; - } - if (tween._next) { - tween._next._prev = tween._prev; - } else if (this._last === tween) { - this._last = tween._prev; - } - tween._next = tween._prev = tween.timeline = null; - if (tween === this._recent) { - this._recent = this._last; - } + return texture; + }; - if (this._timeline) { - this._uncache(true); - } - } - return this; - }; + /** + * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId + * The frame ids are created when a Texture packer file has been loaded + * + * @static + * @param {string} frameId - The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture + */ - p.render = function(time, suppressEvents, force) { - var tween = this._first, - next; - this._totalTime = this._time = this._rawPrevTime = time; - while (tween) { - next = tween._next; //record it here because the value could change after rendering... - if (tween._active || (time >= tween._startTime && !tween._paused)) { - if (!tween._reversed) { - tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); - } else { - tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); - } - } - tween = next; - } - }; - p.rawTime = function() { - if (!_tickerActive) { - _ticker.wake(); - } - return this._totalTime; - }; + Texture.fromFrame = function fromFrame(frameId) { + var texture = _utils.TextureCache[frameId]; -/* - * ---------------------------------------------------------------- - * TweenLite - * ---------------------------------------------------------------- - */ - var TweenLite = _class("TweenLite", function(target, duration, vars) { - Animation.call(this, duration, vars); - this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) + if (!texture) { + throw new Error('The frameId "' + frameId + '" does not exist in the texture cache'); + } - if (target == null) { - throw "Cannot tween a null target."; - } + return texture; + }; - this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; + /** + * Helper function that creates a new Texture based on the given canvas element. + * + * @static + * @param {HTMLCanvasElement} canvas - The canvas element source of the texture + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture + */ - var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))), - overwrite = this.vars.overwrite, - i, targ, targets; - this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite]; + Texture.fromCanvas = function fromCanvas(canvas, scaleMode) { + return new Texture(_BaseTexture2.default.fromCanvas(canvas, scaleMode)); + }; - if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") { - this._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() - this._propLookup = []; - this._siblings = []; - for (i = 0; i < targets.length; i++) { - targ = targets[i]; - if (!targ) { - targets.splice(i--, 1); - continue; - } else if (typeof(targ) === "string") { - targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings - if (typeof(targ) === "string") { - targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case) - } - continue; - } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself. - targets.splice(i--, 1); - this._targets = targets = targets.concat(_slice(targ)); - continue; - } - this._siblings[i] = _register(targ, this, false); - if (overwrite === 1) if (this._siblings[i].length > 1) { - _applyOverwrite(targ, this, null, 1, this._siblings[i]); - } - } + this.resize(width, height); + } - } else { - this._propLookup = {}; - this._siblings = _register(target, this, false); - if (overwrite === 1) if (this._siblings.length > 1) { - _applyOverwrite(target, this, null, 1, this._siblings); - } - } - if (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) { - this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render) - this.render(-this._delay); - } - }, true), - _isSelector = function(v) { - return (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check "nodeType" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox. - }, - _autoCSS = function(vars, target) { - var css = {}, - p; - for (p in vars) { - if (!_reservedProps[p] && (!(p in target) || p === "transform" || p === "x" || p === "y" || p === "width" || p === "height" || p === "className" || p === "border") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: elements contain read-only "x" and "y" properties. We should also prioritize editing css width/height rather than the element's properties. - css[p] = vars[p]; - delete vars[p]; - } - } - vars.css = css; - }; + /** + * Clears the filter texture. + * + * @param {number[]} [clearColor=this.clearColor] - Array of [r,g,b,a] to clear the framebuffer + */ - p = TweenLite.prototype = new Animation(); - p.constructor = TweenLite; - p.kill()._gc = false; -//----TweenLite defaults, overwrite management, and root updates ---------------------------------------------------- + RenderTarget.prototype.clear = function clear(clearColor) { + var cc = clearColor || this.clearColor; - p.ratio = 0; - p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; - p._notifyPluginsOfEnabled = p._lazy = false; + this.frameBuffer.clear(cc[0], cc[1], cc[2], cc[3]); // r,g,b,a); + }; - TweenLite.version = "1.18.2"; - TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); - TweenLite.defaultOverwrite = "auto"; - TweenLite.ticker = _ticker; - TweenLite.autoSleep = 120; - TweenLite.lagSmoothing = function(threshold, adjustedLag) { - _ticker.lagSmoothing(threshold, adjustedLag); - }; + /** + * Binds the stencil buffer. + * + */ - TweenLite.selector = window.$ || window.jQuery || function(e) { - var selector = window.$ || window.jQuery; - if (selector) { - TweenLite.selector = selector; - return selector(e); - } - return (typeof(document) === "undefined") ? e : (document.querySelectorAll ? document.querySelectorAll(e) : document.getElementById((e.charAt(0) === "#") ? e.substr(1) : e)); - }; - var _lazyTweens = [], - _lazyLookup = {}, - _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig, - //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig, - _setRatio = function(v) { - var pt = this._firstPT, - min = 0.000001, - val; - while (pt) { - val = !pt.blob ? pt.c * v + pt.s : v ? this.join("") : this.start; - if (pt.r) { - val = Math.round(val); - } else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser - val = 0; - } - if (!pt.f) { - pt.t[pt.p] = val; - } else if (pt.fp) { - pt.t[pt.p](pt.fp, val); - } else { - pt.t[pt.p](val); - } - pt = pt._next; - } - }, - //compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, "rgb(0,0,0)" and "rgb(100,50,0)" would become ["rgb(", 0, ",", 50, ",0)"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a "start" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join("")). - _blobDif = function(start, end, filter, pt) { - var a = [start, end], - charIndex = 0, - s = "", - color = 0, - startNums, endNums, num, i, l, nonNumbers, currentNum; - a.start = start; - if (filter) { - filter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values. - start = a[0]; - end = a[1]; - } - a.length = 0; - startNums = start.match(_numbersExp) || []; - endNums = end.match(_numbersExp) || []; - if (pt) { - pt._next = null; - pt.blob = 1; - a._firstPT = pt; //apply last in the linked list (which means inserting it first) - } - l = endNums.length; - for (i = 0; i < l; i++) { - currentNum = endNums[i]; - nonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex); - s += (nonNumbers || !i) ? nonNumbers : ","; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case. - charIndex += nonNumbers.length; - if (color) { //sense rgba() values and round them. - color = (color + 1) % 5; - } else if (nonNumbers.substr(-5) === "rgba(") { - color = 1; - } - if (currentNum === startNums[i] || startNums.length <= i) { - s += currentNum; - } else { - if (s) { - a.push(s); - s = ""; - } - num = parseFloat(startNums[i]); - a.push(num); - a._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === "=") ? parseInt(currentNum.charAt(0) + "1", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, r:(color && color < 4)}; - //note: we don't set _prev because we'll never need to remove individual PropTweens from this list. - } - charIndex += currentNum.length; - } - s += end.substr(charIndex); - if (s) { - a.push(s); - } - a.setRatio = _setRatio; - return a; - }, - //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example. - _addPropTween = function(target, prop, start, end, overwriteProp, round, funcParam, stringFilter) { - var s = (start === "get") ? target[prop] : start, - type = typeof(target[prop]), - isRelative = (typeof(end) === "string" && end.charAt(1) === "="), - pt = {t:target, p:prop, s:s, f:(type === "function"), pg:0, n:overwriteProp || prop, r:round, pr:0, c:isRelative ? parseInt(end.charAt(0) + "1", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0}, - blob, getterName; - if (type !== "number") { - if (type === "function" && start === "get") { - getterName = ((prop.indexOf("set") || typeof(target["get" + prop.substr(3)]) !== "function") ? prop : "get" + prop.substr(3)); - pt.s = s = funcParam ? target[getterName](funcParam) : target[getterName](); - } - if (typeof(s) === "string" && (funcParam || isNaN(s))) { - //a blob (string that has multiple numbers in it) - pt.fp = funcParam; - blob = _blobDif(s, end, stringFilter || TweenLite.defaultStringFilter, pt); - pt = {t:blob, p:"setRatio", s:0, c:1, f:2, pg:0, n:overwriteProp || prop, pr:0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example. - } else if (!isRelative) { - pt.s = parseFloat(s); - pt.c = (parseFloat(end) - pt.s) || 0; - } - } - if (pt.c) { //only add it to the linked list if there's a change. - if ((pt._next = this._firstPT)) { - pt._next._prev = pt; - } - this._firstPT = pt; - return pt; - } - }, - _internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object. - _plugins = TweenLite._plugins = {}, - _tweenLookup = _internals.tweenLookup = {}, - _tweenLookupNum = 0, - _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1}, - _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0}, - _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(), - _rootTimeline = Animation._rootTimeline = new SimpleTimeline(), - _nextGCFrame = 30, - _lazyRender = _internals.lazyRender = function() { - var i = _lazyTweens.length, - tween; - _lazyLookup = {}; - while (--i > -1) { - tween = _lazyTweens[i]; - if (tween && tween._lazy !== false) { - tween.render(tween._lazy[0], tween._lazy[1], true); - tween._lazy = false; - } - } - _lazyTweens.length = 0; - }; + RenderTarget.prototype.attachStencilBuffer = function attachStencilBuffer() { + // TODO check if stencil is done? + /** + * The stencil buffer is used for masking in pixi + * lets create one and then add attach it to the framebuffer.. + */ + if (!this.root) { + this.frameBuffer.enableStencil(); + } + }; - _rootTimeline._startTime = _ticker.time; - _rootFramesTimeline._startTime = _ticker.frame; - _rootTimeline._active = _rootFramesTimeline._active = true; - setTimeout(_lazyRender, 1); //on some mobile devices, there isn't a "tick" before code runs which means any lazy renders wouldn't run before the next official "tick". + /** + * Sets the frame of the render target. + * + * @param {Rectangle} destinationFrame - The destination frame. + * @param {Rectangle} sourceFrame - The source frame. + */ - Animation._updateRoot = TweenLite.render = function() { - var i, a, p; - if (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again. - _lazyRender(); - } - _rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false); - _rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false); - if (_lazyTweens.length) { - _lazyRender(); - } - if (_ticker.frame >= _nextGCFrame) { //dump garbage every 120 frames or whatever the user sets TweenLite.autoSleep to - _nextGCFrame = _ticker.frame + (parseInt(TweenLite.autoSleep, 10) || 120); - for (p in _tweenLookup) { - a = _tweenLookup[p].tweens; - i = a.length; - while (--i > -1) { - if (a[i]._gc) { - a.splice(i, 1); - } - } - if (a.length === 0) { - delete _tweenLookup[p]; - } - } - //if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly - p = _rootTimeline._first; - if (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) { - while (p && p._paused) { - p = p._next; - } - if (!p) { - _ticker.sleep(); - } - } - } - }; - _ticker.addEventListener("tick", Animation._updateRoot); + RenderTarget.prototype.setFrame = function setFrame(destinationFrame, sourceFrame) { + this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame; + this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame; + }; - var _register = function(target, tween, scrub) { - var id = target._gsTweenID, a, i; - if (!_tweenLookup[id || (target._gsTweenID = id = "t" + (_tweenLookupNum++))]) { - _tweenLookup[id] = {target:target, tweens:[]}; - } - if (tween) { - a = _tweenLookup[id].tweens; - a[(i = a.length)] = tween; - if (scrub) { - while (--i > -1) { - if (a[i] === tween) { - a.splice(i, 1); - } - } - } - } - return _tweenLookup[id].tweens; - }, - _onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) { - var func = overwrittenTween.vars.onOverwrite, r1, r2; - if (func) { - r1 = func(overwrittenTween, overwritingTween, target, killedProps); - } - func = TweenLite.onOverwrite; - if (func) { - r2 = func(overwrittenTween, overwritingTween, target, killedProps); - } - return (r1 !== false && r2 !== false); - }, - _applyOverwrite = function(target, tween, props, mode, siblings) { - var i, changed, curTween, l; - if (mode === 1 || mode >= 4) { - l = siblings.length; - for (i = 0; i < l; i++) { - if ((curTween = siblings[i]) !== tween) { - if (!curTween._gc) { - if (curTween._kill(null, target, tween)) { - changed = true; - } - } - } else if (mode === 5) { - break; - } - } - return changed; - } - //NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example) - var startTime = tween._startTime + _tinyNum, - overlaps = [], - oCount = 0, - zeroDur = (tween._duration === 0), - globalStart; - i = siblings.length; - while (--i > -1) { - if ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) { - //ignore - } else if (curTween._timeline !== tween._timeline) { - globalStart = globalStart || _checkOverlap(tween, 0, zeroDur); - if (_checkOverlap(curTween, globalStart, zeroDur) === 0) { - overlaps[oCount++] = curTween; - } - } else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) { - overlaps[oCount++] = curTween; - } - } + /** + * Binds the buffers and initialises the viewport. + * + */ - i = oCount; - while (--i > -1) { - curTween = overlaps[i]; - if (mode === 2) if (curTween._kill(props, target, tween)) { - changed = true; - } - if (mode !== 2 || (!curTween._firstPT && curTween._initted)) { - if (mode !== 2 && !_onOverwrite(curTween, tween)) { - continue; - } - if (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween. - changed = true; - } - } - } - return changed; - }, - _checkOverlap = function(tween, reference, zeroDur) { - var tl = tween._timeline, - ts = tl._timeScale, - t = tween._startTime; - while (tl._timeline) { - t += tl._startTime; - ts *= tl._timeScale; - if (tl._paused) { - return -100; - } - tl = tl._timeline; - } - t /= ts; - return (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum; - }; + RenderTarget.prototype.activate = function activate() { + // TOOD refactor usage of frame.. + var gl = this.gl; -//---- TweenLite instance methods ----------------------------------------------------------------------------- + // make sure the texture is unbound! + this.frameBuffer.bind(); - p._init = function() { - var v = this.vars, - op = this._overwrittenProps, - dur = this._duration, - immediate = !!v.immediateRender, - ease = v.ease, - i, initPlugins, pt, p, startVars; - if (v.startAt) { - if (this._startAt) { - this._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change. - this._startAt.kill(); - } - startVars = {}; - for (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from); - startVars[p] = v.startAt[p]; - } - startVars.overwrite = false; - startVars.immediateRender = true; - startVars.lazy = (immediate && v.lazy !== false); - startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop). - this._startAt = TweenLite.to(this.target, 0, startVars); - if (immediate) { - if (this._time > 0) { - this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). - } else if (dur !== 0) { - return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting. - } - } - } else if (v.runBackwards && dur !== 0) { - //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards) - if (this._startAt) { - this._startAt.render(-1, true); - this._startAt.kill(); - this._startAt = null; - } else { - if (this._time !== 0) { //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0 - immediate = false; - } - pt = {}; - for (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through. - if (!_reservedProps[p] || p === "autoCSS") { - pt[p] = v[p]; - } - } - pt.overwrite = 0; - pt.data = "isFromStart"; //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in. - pt.lazy = (immediate && v.lazy !== false); - pt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after) - this._startAt = TweenLite.to(this.target, 0, pt); - if (!immediate) { - this._startAt._init(); //ensures that the initial values are recorded - this._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween. - if (this.vars.immediateRender) { - this._startAt = null; - } - } else if (this._time === 0) { - return; - } - } - } - this._ease = ease = (!ease) ? TweenLite.defaultEase : (ease instanceof Ease) ? ease : (typeof(ease) === "function") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase; - if (v.easeParams instanceof Array && ease.config) { - this._ease = ease.config.apply(ease, v.easeParams); - } - this._easeType = this._ease._type; - this._easePower = this._ease._power; - this._firstPT = null; + this.calculateProjection(this.destinationFrame, this.sourceFrame); - if (this._targets) { - i = this._targets.length; - while (--i > -1) { - if ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null)) ) { - initPlugins = true; - } - } - } else { - initPlugins = this._initProps(this.target, this._propLookup, this._siblings, op); - } + if (this.transform) { + this.projectionMatrix.append(this.transform); + } - if (initPlugins) { - TweenLite._onPluginEvent("_onInitAllProps", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite - } - if (op) if (!this._firstPT) if (typeof(this.target) !== "function") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live. - this._enabled(false, false); - } - if (v.runBackwards) { - pt = this._firstPT; - while (pt) { - pt.s += pt.c; - pt.c = -pt.c; - pt = pt._next; - } - } - this._onUpdate = v.onUpdate; - this._initted = true; - }; + // TODO add a check as them may be the same! + if (this.destinationFrame !== this.sourceFrame) { + gl.enable(gl.SCISSOR_TEST); + gl.scissor(this.destinationFrame.x | 0, this.destinationFrame.y | 0, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0); + } else { + gl.disable(gl.SCISSOR_TEST); + } - p._initProps = function(target, propLookup, siblings, overwrittenProps) { - var p, i, initPlugins, plugin, pt, v; - if (target == null) { - return false; - } + // TODO - does not need to be updated all the time?? + gl.viewport(this.destinationFrame.x | 0, this.destinationFrame.y | 0, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0); + }; + + /** + * Updates the projection matrix based on a projection frame (which is a rectangle) + * + * @param {Rectangle} destinationFrame - The destination frame. + * @param {Rectangle} sourceFrame - The source frame. + */ + + + RenderTarget.prototype.calculateProjection = function calculateProjection(destinationFrame, sourceFrame) { + var pm = this.projectionMatrix; + + sourceFrame = sourceFrame || destinationFrame; + + pm.identity(); + + // TODO: make dest scale source + if (!this.root) { + pm.a = 1 / destinationFrame.width * 2; + pm.d = 1 / destinationFrame.height * 2; + + pm.tx = -1 - sourceFrame.x * pm.a; + pm.ty = -1 - sourceFrame.y * pm.d; + } else { + pm.a = 1 / destinationFrame.width * 2; + pm.d = -1 / destinationFrame.height * 2; + + pm.tx = -1 - sourceFrame.x * pm.a; + pm.ty = 1 - sourceFrame.y * pm.d; + } + }; + + /** + * Resizes the texture to the specified width and height + * + * @param {number} width - the new width of the texture + * @param {number} height - the new height of the texture + */ + + + RenderTarget.prototype.resize = function resize(width, height) { + width = width | 0; + height = height | 0; + + if (this.size.width === width && this.size.height === height) { + return; + } + + this.size.width = width; + this.size.height = height; + + this.defaultFrame.width = width; + this.defaultFrame.height = height; + + this.frameBuffer.resize(width * this.resolution, height * this.resolution); + + var projectionFrame = this.frame || this.size; + + this.calculateProjection(projectionFrame); + }; + + /** + * Destroys the render target. + * + */ + + + RenderTarget.prototype.destroy = function destroy() { + this.frameBuffer.destroy(); + + this.frameBuffer = null; + this.texture = null; + }; + + return RenderTarget; +}(); + +exports.default = RenderTarget; +//# sourceMappingURL=RenderTarget.js.map + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +exports.__esModule = true; +exports.loader = exports.prepare = exports.particles = exports.mesh = exports.loaders = exports.interaction = exports.filters = exports.extras = exports.extract = exports.accessibility = undefined; + +var _polyfill = __webpack_require__(589); + +Object.keys(_polyfill).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _polyfill[key]; + } + }); +}); + +var _deprecation = __webpack_require__(558); + +Object.keys(_deprecation).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _deprecation[key]; + } + }); +}); + +var _core = __webpack_require__(0); + +Object.keys(_core).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _core[key]; + } + }); +}); + +var _accessibility = __webpack_require__(519); + +var accessibility = _interopRequireWildcard(_accessibility); + +var _extract = __webpack_require__(560); + +var extract = _interopRequireWildcard(_extract); + +var _extras = __webpack_require__(133); + +var extras = _interopRequireWildcard(_extras); + +var _filters = __webpack_require__(260); + +var filters = _interopRequireWildcard(_filters); + +var _interaction = __webpack_require__(577); + +var interaction = _interopRequireWildcard(_interaction); + +var _loaders = __webpack_require__(264); + +var loaders = _interopRequireWildcard(_loaders); + +var _mesh = __webpack_require__(268); + +var mesh = _interopRequireWildcard(_mesh); + +var _particles = __webpack_require__(269); + +var particles = _interopRequireWildcard(_particles); + +var _prepare = __webpack_require__(270); + +var prepare = _interopRequireWildcard(_prepare); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +// import polyfills. Done as an export to make sure polyfills are imported first +exports.accessibility = accessibility; +exports.extract = extract; +exports.extras = extras; +exports.filters = filters; +exports.interaction = interaction; +exports.loaders = loaders; +exports.mesh = mesh; +exports.particles = particles; +exports.prepare = prepare; + +/** + * A premade instance of the loader that can be used to load resources. + * + * @name loader + * @memberof PIXI + * @property {PIXI.loaders.Loader} + */ + + +// export libs + + +// export core + +var loader = loaders && loaders.Loader ? new loaders.Loader() : null; // check is there in case user excludes loader lib + +exports.loader = loader; + +// Always export pixi globally. + +global.PIXI = exports; // eslint-disable-line +//# sourceMappingURL=index.js.map +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Bit twiddling hacks for JavaScript. + * + * Author: Mikola Lysenko + * + * Ported from Stanford bit twiddling hack library: + * http://graphics.stanford.edu/~seander/bithacks.html + */ + + "use restrict"; + +//Number of bits in an integer +var INT_BITS = 32; + +//Constants +exports.INT_BITS = INT_BITS; +exports.INT_MAX = 0x7fffffff; +exports.INT_MIN = -1<<(INT_BITS-1); + +//Returns -1, 0, +1 depending on sign of x +exports.sign = function(v) { + return (v > 0) - (v < 0); +} + +//Computes absolute value of integer +exports.abs = function(v) { + var mask = v >> (INT_BITS-1); + return (v ^ mask) - mask; +} + +//Computes minimum of integers x and y +exports.min = function(x, y) { + return y ^ ((x ^ y) & -(x < y)); +} + +//Computes maximum of integers x and y +exports.max = function(x, y) { + return x ^ ((x ^ y) & -(x < y)); +} + +//Checks if a number is a power of two +exports.isPow2 = function(v) { + return !(v & (v-1)) && (!!v); +} + +//Computes log base 2 of v +exports.log2 = function(v) { + var r, shift; + r = (v > 0xFFFF) << 4; v >>>= r; + shift = (v > 0xFF ) << 3; v >>>= shift; r |= shift; + shift = (v > 0xF ) << 2; v >>>= shift; r |= shift; + shift = (v > 0x3 ) << 1; v >>>= shift; r |= shift; + return r | (v >> 1); +} + +//Computes log base 10 of v +exports.log10 = function(v) { + return (v >= 1000000000) ? 9 : (v >= 100000000) ? 8 : (v >= 10000000) ? 7 : + (v >= 1000000) ? 6 : (v >= 100000) ? 5 : (v >= 10000) ? 4 : + (v >= 1000) ? 3 : (v >= 100) ? 2 : (v >= 10) ? 1 : 0; +} + +//Counts number of bits +exports.popCount = function(v) { + v = v - ((v >>> 1) & 0x55555555); + v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); + return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24; +} + +//Counts number of trailing zeros +function countTrailingZeros(v) { + var c = 32; + v &= -v; + if (v) c--; + if (v & 0x0000FFFF) c -= 16; + if (v & 0x00FF00FF) c -= 8; + if (v & 0x0F0F0F0F) c -= 4; + if (v & 0x33333333) c -= 2; + if (v & 0x55555555) c -= 1; + return c; +} +exports.countTrailingZeros = countTrailingZeros; + +//Rounds to next power of 2 +exports.nextPow2 = function(v) { + v += v === 0; + --v; + v |= v >>> 1; + v |= v >>> 2; + v |= v >>> 4; + v |= v >>> 8; + v |= v >>> 16; + return v + 1; +} + +//Rounds down to previous power of 2 +exports.prevPow2 = function(v) { + v |= v >>> 1; + v |= v >>> 2; + v |= v >>> 4; + v |= v >>> 8; + v |= v >>> 16; + return v - (v>>>1); +} + +//Computes parity of word +exports.parity = function(v) { + v ^= v >>> 16; + v ^= v >>> 8; + v ^= v >>> 4; + v &= 0xf; + return (0x6996 >>> v) & 1; +} + +var REVERSE_TABLE = new Array(256); + +(function(tab) { + for(var i=0; i<256; ++i) { + var v = i, r = i, s = 7; + for (v >>>= 1; v; v >>>= 1) { + r <<= 1; + r |= v & 1; + --s; + } + tab[i] = (r << s) & 0xff; + } +})(REVERSE_TABLE); + +//Reverse bits in a 32 bit word +exports.reverse = function(v) { + return (REVERSE_TABLE[ v & 0xff] << 24) | + (REVERSE_TABLE[(v >>> 8) & 0xff] << 16) | + (REVERSE_TABLE[(v >>> 16) & 0xff] << 8) | + REVERSE_TABLE[(v >>> 24) & 0xff]; +} + +//Interleave bits of 2 coordinates with 16 bits. Useful for fast quadtree codes +exports.interleave2 = function(x, y) { + x &= 0xFFFF; + x = (x | (x << 8)) & 0x00FF00FF; + x = (x | (x << 4)) & 0x0F0F0F0F; + x = (x | (x << 2)) & 0x33333333; + x = (x | (x << 1)) & 0x55555555; + + y &= 0xFFFF; + y = (y | (y << 8)) & 0x00FF00FF; + y = (y | (y << 4)) & 0x0F0F0F0F; + y = (y | (y << 2)) & 0x33333333; + y = (y | (y << 1)) & 0x55555555; + + return x | (y << 1); +} + +//Extracts the nth interleaved component +exports.deinterleave2 = function(v, n) { + v = (v >>> n) & 0x55555555; + v = (v | (v >>> 1)) & 0x33333333; + v = (v | (v >>> 2)) & 0x0F0F0F0F; + v = (v | (v >>> 4)) & 0x00FF00FF; + v = (v | (v >>> 16)) & 0x000FFFF; + return (v << 16) >> 16; +} + + +//Interleave bits of 3 coordinates, each with 10 bits. Useful for fast octree codes +exports.interleave3 = function(x, y, z) { + x &= 0x3FF; + x = (x | (x<<16)) & 4278190335; + x = (x | (x<<8)) & 251719695; + x = (x | (x<<4)) & 3272356035; + x = (x | (x<<2)) & 1227133513; + + y &= 0x3FF; + y = (y | (y<<16)) & 4278190335; + y = (y | (y<<8)) & 251719695; + y = (y | (y<<4)) & 3272356035; + y = (y | (y<<2)) & 1227133513; + x |= (y << 1); + + z &= 0x3FF; + z = (z | (z<<16)) & 4278190335; + z = (z | (z<<8)) & 251719695; + z = (z | (z<<4)) & 3272356035; + z = (z | (z<<2)) & 1227133513; + + return x | (z << 2); +} + +//Extracts nth interleaved component of a 3-tuple +exports.deinterleave3 = function(v, n) { + v = (v >>> n) & 1227133513; + v = (v | (v>>>2)) & 3272356035; + v = (v | (v>>>4)) & 251719695; + v = (v | (v>>>8)) & 4278190335; + v = (v | (v>>>16)) & 0x3FF; + return (v<<22)>>22; +} + +//Computes next combination in colexicographic order (this is mistakenly called nextPermutation on the bit twiddling hacks page) +exports.nextCombination = function(v) { + var t = v | (v - 1); + return (t + 1) | (((~t & -~t) - 1) >>> (countTrailingZeros(v) + 1)); +} + + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * howler.js v2.0.2 + * howlerjs.com + * + * (c) 2013-2016, James Simpson of GoldFire Studios + * goldfirestudios.com + * + * MIT License + */ + +(function() { + + 'use strict'; + + /** Global Methods **/ + /***************************************************************************/ + + /** + * Create the global controller. All contained methods and properties apply + * to all sounds that are currently playing or will be in the future. + */ + var HowlerGlobal = function() { + this.init(); + }; + HowlerGlobal.prototype = { + /** + * Initialize the global Howler object. + * @return {Howler} + */ + init: function() { + var self = this || Howler; + + // Internal properties. + self._codecs = {}; + self._howls = []; + self._muted = false; + self._volume = 1; + self._canPlayEvent = 'canplaythrough'; + self._navigator = (typeof window !== 'undefined' && window.navigator) ? window.navigator : null; + + // Public properties. + self.masterGain = null; + self.noAudio = false; + self.usingWebAudio = true; + self.autoSuspend = true; + self.ctx = null; + + // Set to false to disable the auto iOS enabler. + self.mobileAutoEnable = true; + + // Setup the various state values for global tracking. + self._setup(); + + return self; + }, + + /** + * Get/set the global volume for all sounds. + * @param {Float} vol Volume from 0.0 to 1.0. + * @return {Howler/Float} Returns self or current volume. + */ + volume: function(vol) { + var self = this || Howler; + vol = parseFloat(vol); + + // If we don't have an AudioContext created yet, run the setup. + if (!self.ctx) { + setupAudioContext(); + } + + if (typeof vol !== 'undefined' && vol >= 0 && vol <= 1) { + self._volume = vol; + + // Don't update any of the nodes if we are muted. + if (self._muted) { + return self; + } + + // When using Web Audio, we just need to adjust the master gain. + if (self.usingWebAudio) { + self.masterGain.gain.value = vol; + } + + // Loop through and change volume for all HTML5 audio nodes. + for (var i=0; i=0; i--) { + self._howls[i].unload(); + } + + // Create a new AudioContext to make sure it is fully reset. + if (self.usingWebAudio && self.ctx && typeof self.ctx.close !== 'undefined') { + self.ctx.close(); + self.ctx = null; + setupAudioContext(); + } + + return self; + }, + + /** + * Check for codec support of specific extension. + * @param {String} ext Audio file extention. + * @return {Boolean} + */ + codecs: function(ext) { + return (this || Howler)._codecs[ext.replace(/^x-/, '')]; + }, + + /** + * Setup various state values for global tracking. + * @return {Howler} + */ + _setup: function() { + var self = this || Howler; + + // Keeps track of the suspend/resume state of the AudioContext. + self.state = self.ctx ? self.ctx.state || 'running' : 'running'; + + // Automatically begin the 30-second suspend process + self._autoSuspend(); + + // Check if audio is available. + if (!self.usingWebAudio) { + // No audio is available on this system if noAudio is set to true. + if (typeof Audio !== 'undefined') { + try { + var test = new Audio(); + + // Check if the canplaythrough event is available. + if (typeof test.oncanplaythrough === 'undefined') { + self._canPlayEvent = 'canplay'; + } + } catch(e) { + self.noAudio = true; + } + } else { + self.noAudio = true; + } + } + + // Test to make sure audio isn't disabled in Internet Explorer. + try { + var test = new Audio(); + if (test.muted) { + self.noAudio = true; + } + } catch (e) {} + + // Check for supported codecs. + if (!self.noAudio) { + self._setupCodecs(); + } + + return self; + }, + + /** + * Check for browser support for various codecs and cache the results. + * @return {Howler} + */ + _setupCodecs: function() { + var self = this || Howler; + var audioTest = null; + + // Must wrap in a try/catch because IE11 in server mode throws an error. + try { + audioTest = (typeof Audio !== 'undefined') ? new Audio() : null; + } catch (err) { + return self; + } + + if (!audioTest || typeof audioTest.canPlayType !== 'function') { + return self; + } + + var mpegTest = audioTest.canPlayType('audio/mpeg;').replace(/^no$/, ''); + + // Opera version <33 has mixed MP3 support, so we need to check for and block it. + var checkOpera = self._navigator && self._navigator.userAgent.match(/OPR\/([0-6].)/g); + var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33); + + self._codecs = { + mp3: !!(!isOldOpera && (mpegTest || audioTest.canPlayType('audio/mp3;').replace(/^no$/, ''))), + mpeg: !!mpegTest, + opus: !!audioTest.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ''), + ogg: !!audioTest.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ''), + oga: !!audioTest.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ''), + wav: !!audioTest.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ''), + aac: !!audioTest.canPlayType('audio/aac;').replace(/^no$/, ''), + caf: !!audioTest.canPlayType('audio/x-caf;').replace(/^no$/, ''), + m4a: !!(audioTest.canPlayType('audio/x-m4a;') || audioTest.canPlayType('audio/m4a;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''), + mp4: !!(audioTest.canPlayType('audio/x-mp4;') || audioTest.canPlayType('audio/mp4;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''), + weba: !!audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ''), + webm: !!audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ''), + dolby: !!audioTest.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ''), + flac: !!(audioTest.canPlayType('audio/x-flac;') || audioTest.canPlayType('audio/flac;')).replace(/^no$/, '') + }; + + return self; + }, + + /** + * Mobile browsers will only allow audio to be played after a user interaction. + * Attempt to automatically unlock audio on the first user interaction. + * Concept from: http://paulbakaus.com/tutorials/html5/web-audio-on-ios/ + * @return {Howler} + */ + _enableMobileAudio: function() { + var self = this || Howler; + + // Only run this on mobile devices if audio isn't already eanbled. + var isMobile = /iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi/i.test(self._navigator && self._navigator.userAgent); + var isTouch = !!(('ontouchend' in window) || (self._navigator && self._navigator.maxTouchPoints > 0) || (self._navigator && self._navigator.msMaxTouchPoints > 0)); + if (self._mobileEnabled || !self.ctx || (!isMobile && !isTouch)) { + return; + } + + self._mobileEnabled = false; + + // Some mobile devices/platforms have distortion issues when opening/closing tabs and/or web views. + // Bugs in the browser (especially Mobile Safari) can cause the sampleRate to change from 44100 to 48000. + // By calling Howler.unload(), we create a new AudioContext with the correct sampleRate. + if (!self._mobileUnloaded && self.ctx.sampleRate !== 44100) { + self._mobileUnloaded = true; + self.unload(); + } + + // Scratch buffer for enabling iOS to dispose of web audio buffers correctly, as per: + // http://stackoverflow.com/questions/24119684 + self._scratchBuffer = self.ctx.createBuffer(1, 1, 22050); + + // Call this method on touch start to create and play a buffer, + // then check if the audio actually played to determine if + // audio has now been unlocked on iOS, Android, etc. + var unlock = function() { + // Create an empty buffer. + var source = self.ctx.createBufferSource(); + source.buffer = self._scratchBuffer; + source.connect(self.ctx.destination); + + // Play the empty buffer. + if (typeof source.start === 'undefined') { + source.noteOn(0); + } else { + source.start(0); + } + + // Setup a timeout to check that we are unlocked on the next event loop. + source.onended = function() { + source.disconnect(0); + + // Update the unlocked state and prevent this check from happening again. + self._mobileEnabled = true; + self.mobileAutoEnable = false; + + // Remove the touch start listener. + document.removeEventListener('touchend', unlock, true); + }; + }; + + // Setup a touch start listener to attempt an unlock in. + document.addEventListener('touchend', unlock, true); + + return self; + }, + + /** + * Automatically suspend the Web Audio AudioContext after no sound has played for 30 seconds. + * This saves processing/energy and fixes various browser-specific bugs with audio getting stuck. + * @return {Howler} + */ + _autoSuspend: function() { + var self = this; + + if (!self.autoSuspend || !self.ctx || typeof self.ctx.suspend === 'undefined' || !Howler.usingWebAudio) { + return; + } + + // Check if any sounds are playing. + for (var i=0; i 0 ? sound._seek : self._sprite[sprite][0] / 1000); + var duration = Math.max(0, ((self._sprite[sprite][0] + self._sprite[sprite][1]) / 1000) - seek); + var timeout = (duration * 1000) / Math.abs(sound._rate); + + // Update the parameters of the sound + sound._paused = false; + sound._ended = false; + sound._sprite = sprite; + sound._seek = seek; + sound._start = self._sprite[sprite][0] / 1000; + sound._stop = (self._sprite[sprite][0] + self._sprite[sprite][1]) / 1000; + sound._loop = !!(sound._loop || self._sprite[sprite][2]); + + // Begin the actual playback. + var node = sound._node; + if (self._webAudio) { + // Fire this when the sound is ready to play to begin Web Audio playback. + var playWebAudio = function() { + self._refreshBuffer(sound); + + // Setup the playback params. + var vol = (sound._muted || self._muted) ? 0 : sound._volume; + node.gain.setValueAtTime(vol, Howler.ctx.currentTime); + sound._playStart = Howler.ctx.currentTime; + + // Play the sound using the supported method. + if (typeof node.bufferSource.start === 'undefined') { + sound._loop ? node.bufferSource.noteGrainOn(0, seek, 86400) : node.bufferSource.noteGrainOn(0, seek, duration); + } else { + sound._loop ? node.bufferSource.start(0, seek, 86400) : node.bufferSource.start(0, seek, duration); + } + + // Start a new timer if none is present. + if (timeout !== Infinity) { + self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout); + } + + if (!internal) { + setTimeout(function() { + self._emit('play', sound._id); + }, 0); + } + }; + + var isRunning = (Howler.state === 'running'); + if (self._state === 'loaded' && isRunning) { + playWebAudio(); + } else { + // Wait for the audio to load and then begin playback. + self.once(isRunning ? 'load' : 'resume', playWebAudio, isRunning ? sound._id : null); + + // Cancel the end timer. + self._clearTimer(sound._id); + } + } else { + // Fire this when the sound is ready to play to begin HTML5 Audio playback. + var playHtml5 = function() { + node.currentTime = seek; + node.muted = sound._muted || self._muted || Howler._muted || node.muted; + node.volume = sound._volume * Howler.volume(); + node.playbackRate = sound._rate; + + setTimeout(function() { + node.play(); + + // Setup the new end timer. + if (timeout !== Infinity) { + self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout); + } + + if (!internal) { + self._emit('play', sound._id); + } + }, 0); + }; + + // Play immediately if ready, or wait for the 'canplaythrough'e vent. + var loadedNoReadyState = (self._state === 'loaded' && (window && window.ejecta || !node.readyState && Howler._navigator.isCocoonJS)); + if (node.readyState === 4 || loadedNoReadyState) { + playHtml5(); + } else { + var listener = function() { + // Begin playback. + playHtml5(); + + // Clear this listener. + node.removeEventListener(Howler._canPlayEvent, listener, false); + }; + node.addEventListener(Howler._canPlayEvent, listener, false); + + // Cancel the end timer. + self._clearTimer(sound._id); + } + } + + return sound._id; + }, + + /** + * Pause playback and save current position. + * @param {Number} id The sound ID (empty to pause all in group). + * @return {Howl} + */ + pause: function(id) { + var self = this; + + // If the sound hasn't loaded, add it to the load queue to pause when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'pause', + action: function() { + self.pause(id); + } + }); + + return self; + } + + // If no id is passed, get all ID's to be paused. + var ids = self._getSoundIds(id); + + for (var i=0; i Returns the group's volume value. + * volume(id) -> Returns the sound id's current volume. + * volume(vol) -> Sets the volume of all sounds in this Howl group. + * volume(vol, id) -> Sets the volume of passed sound id. + * @return {Howl/Number} Returns self or current volume. + */ + volume: function() { + var self = this; + var args = arguments; + var vol, id; + + // Determine the values based on arguments. + if (args.length === 0) { + // Return the value of the groups' volume. + return self._volume; + } else if (args.length === 1 || args.length === 2 && typeof args[1] === 'undefined') { + // First check if this is an ID, and if not, assume it is a new volume. + var ids = self._getSoundIds(); + var index = ids.indexOf(args[0]); + if (index >= 0) { + id = parseInt(args[0], 10); + } else { + vol = parseFloat(args[0]); + } + } else if (args.length >= 2) { + vol = parseFloat(args[0]); + id = parseInt(args[1], 10); + } + + // Update the volume or return the current volume. + var sound; + if (typeof vol !== 'undefined' && vol >= 0 && vol <= 1) { + // If the sound hasn't loaded, add it to the load queue to change volume when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'volume', + action: function() { + self.volume.apply(self, args); + } + }); + + return self; + } + + // Set the group volume. + if (typeof id === 'undefined') { + self._volume = vol; + } + + // Update one or all volumes. + id = self._getSoundIds(id); + for (var i=0; i to ? 'out' : 'in'; + var steps = diff / 0.01; + var stepLen = (steps > 0) ? len / steps : len; + + // Since browsers clamp timeouts to 4ms, we need to clamp our steps to that too. + if (stepLen < 4) { + steps = Math.ceil(steps / (4 / stepLen)); + stepLen = 4; + } + + // If the sound hasn't loaded, add it to the load queue to fade when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'fade', + action: function() { + self.fade(from, to, len, id); + } + }); + + return self; + } + + // Set the volume to the start position. + self.volume(from, id); + + // Fade the volume of one or all sounds. + var ids = self._getSoundIds(id); + for (var i=0; i 0) { + vol += (dir === 'in' ? 0.01 : -0.01); + } + + // Make sure the volume is in the right bounds. + vol = Math.max(0, vol); + vol = Math.min(1, vol); + + // Round to within 2 decimal points. + vol = Math.round(vol * 100) / 100; + + // Change the volume. + if (self._webAudio) { + if (typeof id === 'undefined') { + self._volume = vol; + } + + sound._volume = vol; + } else { + self.volume(vol, soundId, true); + } + + // When the fade is complete, stop it and fire event. + if (vol === to) { + clearInterval(sound._interval); + sound._interval = null; + self.volume(vol, soundId); + self._emit('fade', soundId); + } + }.bind(self, ids[i], sound), stepLen); + } + } + + return self; + }, + + /** + * Internal method that stops the currently playing fade when + * a new fade starts, volume is changed or the sound is stopped. + * @param {Number} id The sound id. + * @return {Howl} + */ + _stopFade: function(id) { + var self = this; + var sound = self._soundById(id); + + if (sound && sound._interval) { + if (self._webAudio) { + sound._node.gain.cancelScheduledValues(Howler.ctx.currentTime); + } + + clearInterval(sound._interval); + sound._interval = null; + self._emit('fade', id); + } + + return self; + }, + + /** + * Get/set the loop parameter on a sound. This method can optionally take 0, 1 or 2 arguments. + * loop() -> Returns the group's loop value. + * loop(id) -> Returns the sound id's loop value. + * loop(loop) -> Sets the loop value for all sounds in this Howl group. + * loop(loop, id) -> Sets the loop value of passed sound id. + * @return {Howl/Boolean} Returns self or current loop value. + */ + loop: function() { + var self = this; + var args = arguments; + var loop, id, sound; + + // Determine the values for loop and id. + if (args.length === 0) { + // Return the grou's loop value. + return self._loop; + } else if (args.length === 1) { + if (typeof args[0] === 'boolean') { + loop = args[0]; + self._loop = loop; + } else { + // Return this sound's loop value. + sound = self._soundById(parseInt(args[0], 10)); + return sound ? sound._loop : false; + } + } else if (args.length === 2) { + loop = args[0]; + id = parseInt(args[1], 10); + } + + // If no id is passed, get all ID's to be looped. + var ids = self._getSoundIds(id); + for (var i=0; i Returns the first sound node's current playback rate. + * rate(id) -> Returns the sound id's current playback rate. + * rate(rate) -> Sets the playback rate of all sounds in this Howl group. + * rate(rate, id) -> Sets the playback rate of passed sound id. + * @return {Howl/Number} Returns self or the current playback rate. + */ + rate: function() { + var self = this; + var args = arguments; + var rate, id; + + // Determine the values based on arguments. + if (args.length === 0) { + // We will simply return the current rate of the first node. + id = self._sounds[0]._id; + } else if (args.length === 1) { + // First check if this is an ID, and if not, assume it is a new rate value. + var ids = self._getSoundIds(); + var index = ids.indexOf(args[0]); + if (index >= 0) { + id = parseInt(args[0], 10); + } else { + rate = parseFloat(args[0]); + } + } else if (args.length === 2) { + rate = parseFloat(args[0]); + id = parseInt(args[1], 10); + } + + // Update the playback rate or return the current value. + var sound; + if (typeof rate === 'number') { + // If the sound hasn't loaded, add it to the load queue to change playback rate when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'rate', + action: function() { + self.rate.apply(self, args); + } + }); + + return self; + } + + // Set the group rate. + if (typeof id === 'undefined') { + self._rate = rate; + } + + // Update one or all volumes. + id = self._getSoundIds(id); + for (var i=0; i Returns the first sound node's current seek position. + * seek(id) -> Returns the sound id's current seek position. + * seek(seek) -> Sets the seek position of the first sound node. + * seek(seek, id) -> Sets the seek position of passed sound id. + * @return {Howl/Number} Returns self or the current seek position. + */ + seek: function() { + var self = this; + var args = arguments; + var seek, id; + + // Determine the values based on arguments. + if (args.length === 0) { + // We will simply return the current position of the first node. + id = self._sounds[0]._id; + } else if (args.length === 1) { + // First check if this is an ID, and if not, assume it is a new seek position. + var ids = self._getSoundIds(); + var index = ids.indexOf(args[0]); + if (index >= 0) { + id = parseInt(args[0], 10); + } else { + id = self._sounds[0]._id; + seek = parseFloat(args[0]); + } + } else if (args.length === 2) { + seek = parseFloat(args[0]); + id = parseInt(args[1], 10); + } + + // If there is no ID, bail out. + if (typeof id === 'undefined') { + return self; + } + + // If the sound hasn't loaded, add it to the load queue to seek when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'seek', + action: function() { + self.seek.apply(self, args); + } + }); + + return self; + } + + // Get the sound. + var sound = self._soundById(id); + + if (sound) { + if (typeof seek === 'number' && seek >= 0) { + // Pause the sound and update position for restarting playback. + var playing = self.playing(id); + if (playing) { + self.pause(id, true); + } + + // Move the position of the track and cancel timer. + sound._seek = seek; + sound._ended = false; + self._clearTimer(id); + + // Restart the playback if the sound was playing. + if (playing) { + self.play(id, true); + } + + // Update the seek position for HTML5 Audio. + if (!self._webAudio && sound._node) { + sound._node.currentTime = seek; + } + + self._emit('seek', id); + } else { + if (self._webAudio) { + var realTime = self.playing(id) ? Howler.ctx.currentTime - sound._playStart : 0; + var rateSeek = sound._rateSeek ? sound._rateSeek - sound._seek : 0; + return sound._seek + (rateSeek + realTime * Math.abs(sound._rate)); + } else { + return sound._node.currentTime; + } + } + } + + return self; + }, + + /** + * Check if a specific sound is currently playing or not (if id is provided), or check if at least one of the sounds in the group is playing or not. + * @param {Number} id The sound id to check. If none is passed, the whole sound group is checked. + * @return {Boolean} True if playing and false if not. + */ + playing: function(id) { + var self = this; + + // Check the passed sound ID (if any). + if (typeof id === 'number') { + var sound = self._soundById(id); + return sound ? !sound._paused : false; + } + + // Otherwise, loop through all sounds and check if any are playing. + for (var i=0; i= 0) { + Howler._howls.splice(index, 1); + } + } + + // Delete this sound from the cache (if no other Howl is using it). + var remCache = true; + for (i=0; i=0; i--) { + if (!events[i].id || events[i].id === id || event === 'load') { + setTimeout(function(fn) { + fn.call(this, id, msg); + }.bind(self, events[i].fn), 0); + + // If this event was setup with `once`, remove it. + if (events[i].once) { + self.off(event, events[i].fn, events[i].id); + } + } + } + + return self; + }, + + /** + * Queue of actions initiated before the sound has loaded. + * These will be called in sequence, with the next only firing + * after the previous has finished executing (even if async like play). + * @return {Howl} + */ + _loadQueue: function() { + var self = this; + + if (self._queue.length > 0) { + var task = self._queue[0]; + + // don't move onto the next task until this one is done + self.once(task.event, function() { + self._queue.shift(); + self._loadQueue(); + }); + + task.action(); + } + + return self; + }, + + /** + * Fired when playback ends at the end of the duration. + * @param {Sound} sound The sound object to work with. + * @return {Howl} + */ + _ended: function(sound) { + var self = this; + var sprite = sound._sprite; + + // Should this sound loop? + var loop = !!(sound._loop || self._sprite[sprite][2]); + + // Fire the ended event. + self._emit('end', sound._id); + + // Restart the playback for HTML5 Audio loop. + if (!self._webAudio && loop) { + self.stop(sound._id, true).play(sound._id); + } + + // Restart this timer if on a Web Audio loop. + if (self._webAudio && loop) { + self._emit('play', sound._id); + sound._seek = sound._start || 0; + sound._rateSeek = 0; + sound._playStart = Howler.ctx.currentTime; + + var timeout = ((sound._stop - sound._start) * 1000) / Math.abs(sound._rate); + self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout); + } + + // Mark the node as paused. + if (self._webAudio && !loop) { + sound._paused = true; + sound._ended = true; + sound._seek = sound._start || 0; + sound._rateSeek = 0; + self._clearTimer(sound._id); + + // Clean up the buffer source. + self._cleanBuffer(sound._node); + + // Attempt to auto-suspend AudioContext if no sounds are still playing. + Howler._autoSuspend(); + } + + // When using a sprite, end the track. + if (!self._webAudio && !loop) { + self.stop(sound._id); + } + + return self; + }, + + /** + * Clear the end timer for a sound playback. + * @param {Number} id The sound ID. + * @return {Howl} + */ + _clearTimer: function(id) { + var self = this; + + if (self._endTimers[id]) { + clearTimeout(self._endTimers[id]); + delete self._endTimers[id]; + } + + return self; + }, + + /** + * Return the sound identified by this ID, or return null. + * @param {Number} id Sound ID + * @return {Object} Sound object or null. + */ + _soundById: function(id) { + var self = this; + + // Loop through all sounds and find the one with this ID. + for (var i=0; i=0; i--) { + if (cnt <= limit) { + return; + } + + if (self._sounds[i]._ended) { + // Disconnect the audio source when using Web Audio. + if (self._webAudio && self._sounds[i]._node) { + self._sounds[i]._node.disconnect(0); + } + + // Remove sounds until we have the pool size. + self._sounds.splice(i, 1); + cnt--; + } + } + }, + + /** + * Get all ID's from the sounds pool. + * @param {Number} id Only return one ID if one is passed. + * @return {Array} Array of IDs. + */ + _getSoundIds: function(id) { + var self = this; + + if (typeof id === 'undefined') { + var ids = []; + for (var i=0; i 0) { + cache[self._src] = buffer; + loadSound(self, buffer); + } + }, function() { + self._emit('loaderror', null, 'Decoding audio data failed.'); + }); + }; + + /** + * Sound is now loaded, so finish setting everything up and fire the loaded event. + * @param {Howl} self + * @param {Object} buffer The decoded buffer sound source. + */ + var loadSound = function(self, buffer) { + // Set the duration. + if (buffer && !self._duration) { + self._duration = buffer.duration; + } + + // Setup a sprite if none is defined. + if (Object.keys(self._sprite).length === 0) { + self._sprite = {__default: [0, self._duration * 1000]}; + } + + // Fire the loaded event. + if (self._state !== 'loaded') { + self._state = 'loaded'; + self._emit('load'); + self._loadQueue(); + } + }; + + /** + * Setup the audio context when available, or switch to HTML5 Audio mode. + */ + var setupAudioContext = function() { + // Check if we are using Web Audio and setup the AudioContext if we are. + try { + if (typeof AudioContext !== 'undefined') { + Howler.ctx = new AudioContext(); + } else if (typeof webkitAudioContext !== 'undefined') { + Howler.ctx = new webkitAudioContext(); + } else { + Howler.usingWebAudio = false; + } + } catch(e) { + Howler.usingWebAudio = false; + } + + // Check if a webview is being used on iOS8 or earlier (rather than the browser). + // If it is, disable Web Audio as it causes crashing. + var iOS = (/iP(hone|od|ad)/.test(Howler._navigator && Howler._navigator.platform)); + var appVersion = Howler._navigator && Howler._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); + var version = appVersion ? parseInt(appVersion[1], 10) : null; + if (iOS && version && version < 9) { + var safari = /safari/.test(Howler._navigator && Howler._navigator.userAgent.toLowerCase()); + if (Howler._navigator && Howler._navigator.standalone && !safari || Howler._navigator && !Howler._navigator.standalone && !safari) { + Howler.usingWebAudio = false; + } + } + + // Create and expose the master GainNode when using Web Audio (useful for plugins or advanced usage). + if (Howler.usingWebAudio) { + Howler.masterGain = (typeof Howler.ctx.createGain === 'undefined') ? Howler.ctx.createGainNode() : Howler.ctx.createGain(); + Howler.masterGain.gain.value = 1; + Howler.masterGain.connect(Howler.ctx.destination); + } + + // Re-run the setup on Howler. + Howler._setup(); + }; + + // Add support for AMD (Asynchronous Module Definition) libraries such as require.js. + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { + return { + Howler: Howler, + Howl: Howl + }; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + + // Add support for CommonJS libraries such as browserify. + if (true) { + exports.Howler = Howler; + exports.Howl = Howl; + } + + // Define globally in case AMD is not available or unused. + if (typeof window !== 'undefined') { + window.HowlerGlobal = HowlerGlobal; + window.Howler = Howler; + window.Howl = Howl; + window.Sound = Sound; + } else if (typeof global !== 'undefined') { // Add to global in Node.js (for testing, etc). + global.HowlerGlobal = HowlerGlobal; + global.Howler = Howler; + global.Howl = Howl; + global.Sound = Sound; + } +})(); + + +/*! + * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. + * + * howler.js v2.0.2 + * howlerjs.com + * + * (c) 2013-2016, James Simpson of GoldFire Studios + * goldfirestudios.com + * + * MIT License + */ + +(function() { + + 'use strict'; + + // Setup default properties. + HowlerGlobal.prototype._pos = [0, 0, 0]; + HowlerGlobal.prototype._orientation = [0, 0, -1, 0, 1, 0]; + + /** Global Methods **/ + /***************************************************************************/ + + /** + * Helper method to update the stereo panning position of all current Howls. + * Future Howls will not use this value unless explicitly set. + * @param {Number} pan A value of -1.0 is all the way left and 1.0 is all the way right. + * @return {Howler/Number} Self or current stereo panning value. + */ + HowlerGlobal.prototype.stereo = function(pan) { + var self = this; + + // Stop right here if not using Web Audio. + if (!self.ctx || !self.ctx.listener) { + return self; + } + + // Loop through all Howls and update their stereo panning. + for (var i=self._howls.length-1; i>=0; i--) { + self._howls[i].stereo(pan); + } + + return self; + }; + + /** + * Get/set the position of the listener in 3D cartesian space. Sounds using + * 3D position will be relative to the listener's position. + * @param {Number} x The x-position of the listener. + * @param {Number} y The y-position of the listener. + * @param {Number} z The z-position of the listener. + * @return {Howler/Array} Self or current listener position. + */ + HowlerGlobal.prototype.pos = function(x, y, z) { + var self = this; + + // Stop right here if not using Web Audio. + if (!self.ctx || !self.ctx.listener) { + return self; + } + + // Set the defaults for optional 'y' & 'z'. + y = (typeof y !== 'number') ? self._pos[1] : y; + z = (typeof z !== 'number') ? self._pos[2] : z; + + if (typeof x === 'number') { + self._pos = [x, y, z]; + self.ctx.listener.setPosition(self._pos[0], self._pos[1], self._pos[2]); + } else { + return self._pos; + } + + return self; + }; + + /** + * Get/set the direction the listener is pointing in the 3D cartesian space. + * A front and up vector must be provided. The front is the direction the + * face of the listener is pointing, and up is the direction the top of the + * listener is pointing. Thus, these values are expected to be at right angles + * from each other. + * @param {Number} x The x-orientation of the listener. + * @param {Number} y The y-orientation of the listener. + * @param {Number} z The z-orientation of the listener. + * @param {Number} xUp The x-orientation of the top of the listener. + * @param {Number} yUp The y-orientation of the top of the listener. + * @param {Number} zUp The z-orientation of the top of the listener. + * @return {Howler/Array} Returns self or the current orientation vectors. + */ + HowlerGlobal.prototype.orientation = function(x, y, z, xUp, yUp, zUp) { + var self = this; + + // Stop right here if not using Web Audio. + if (!self.ctx || !self.ctx.listener) { + return self; + } + + // Set the defaults for optional 'y' & 'z'. + var or = self._orientation; + y = (typeof y !== 'number') ? or[1] : y; + z = (typeof z !== 'number') ? or[2] : z; + xUp = (typeof xUp !== 'number') ? or[3] : xUp; + yUp = (typeof yUp !== 'number') ? or[4] : yUp; + zUp = (typeof zUp !== 'number') ? or[5] : zUp; + + if (typeof x === 'number') { + self._orientation = [x, y, z, xUp, yUp, zUp]; + self.ctx.listener.setOrientation(x, y, z, xUp, yUp, zUp); + } else { + return or; + } + + return self; + }; + + /** Group Methods **/ + /***************************************************************************/ + + /** + * Add new properties to the core init. + * @param {Function} _super Core init method. + * @return {Howl} + */ + Howl.prototype.init = (function(_super) { + return function(o) { + var self = this; + + // Setup user-defined default properties. + self._orientation = o.orientation || [1, 0, 0]; + self._stereo = o.stereo || null; + self._pos = o.pos || null; + self._pannerAttr = { + coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : 360, + coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : 360, + coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : 0, + distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : 'inverse', + maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : 10000, + panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : 'HRTF', + refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : 1, + rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : 1 + }; + + // Setup event listeners. + self._onstereo = o.onstereo ? [{fn: o.onstereo}] : []; + self._onpos = o.onpos ? [{fn: o.onpos}] : []; + self._onorientation = o.onorientation ? [{fn: o.onorientation}] : []; + + // Complete initilization with howler.js core's init function. + return _super.call(this, o); + }; + })(Howl.prototype.init); + + /** + * Get/set the stereo panning of the audio source for this sound or all in the group. + * @param {Number} pan A value of -1.0 is all the way left and 1.0 is all the way right. + * @param {Number} id (optional) The sound ID. If none is passed, all in group will be updated. + * @return {Howl/Number} Returns self or the current stereo panning value. + */ + Howl.prototype.stereo = function(pan, id) { + var self = this; + + // Stop right here if not using Web Audio. + if (!self._webAudio) { + return self; + } + + // If the sound hasn't loaded, add it to the load queue to change stereo pan when capable. + if (self._state !== 'loaded') { + self._queue.push({ + event: 'stereo', + action: function() { + self.stereo(pan, id); + } + }); + + return self; + } + + // Check for PannerStereoNode support and fallback to PannerNode if it doesn't exist. + var pannerType = (typeof Howler.ctx.createStereoPanner === 'undefined') ? 'spatial' : 'stereo'; + + // Setup the group's stereo panning if no ID is passed. + if (typeof id === 'undefined') { + // Return the group's stereo panning if no parameters are passed. + if (typeof pan === 'number') { + self._stereo = pan; + self._pos = [pan, 0, 0]; + } else { + return self._stereo; + } + } + + // Change the streo panning of one or all sounds in group. + var ids = self._getSoundIds(id); + for (var i=0; i Returns the group's values. + * pannerAttr(id) -> Returns the sound id's values. + * pannerAttr(o) -> Set's the values of all sounds in this Howl group. + * pannerAttr(o, id) -> Set's the values of passed sound id. + * + * Attributes: + * coneInnerAngle - (360 by default) There will be no volume reduction inside this angle. + * coneOuterAngle - (360 by default) The volume will be reduced to a constant value of + * `coneOuterGain` outside this angle. + * coneOuterGain - (0 by default) The amount of volume reduction outside of `coneOuterAngle`. + * distanceModel - ('inverse' by default) Determines algorithm to use to reduce volume as audio moves + * away from listener. Can be `linear`, `inverse` or `exponential`. + * maxDistance - (10000 by default) Volume won't reduce between source/listener beyond this distance. + * panningModel - ('HRTF' by default) Determines which spatialization algorithm is used to position audio. + * Can be `HRTF` or `equalpower`. + * refDistance - (1 by default) A reference distance for reducing volume as the source + * moves away from the listener. + * rolloffFactor - (1 by default) How quickly the volume reduces as source moves from listener. + * + * @return {Howl/Object} Returns self or current panner attributes. + */ + Howl.prototype.pannerAttr = function() { + var self = this; + var args = arguments; + var o, id, sound; + + // Stop right here if not using Web Audio. + if (!self._webAudio) { + return self; + } + + // Determine the values based on arguments. + if (args.length === 0) { + // Return the group's panner attribute values. + return self._pannerAttr; + } else if (args.length === 1) { + if (typeof args[0] === 'object') { + o = args[0]; + + // Set the grou's panner attribute values. + if (typeof id === 'undefined') { + self._pannerAttr = { + coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : self._coneInnerAngle, + coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : self._coneOuterAngle, + coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : self._coneOuterGain, + distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : self._distanceModel, + maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : self._maxDistance, + panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : self._panningModel, + refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : self._refDistance, + rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : self._rolloffFactor + }; + } + } else { + // Return this sound's panner attribute values. + sound = self._soundById(parseInt(args[0], 10)); + return sound ? sound._pannerAttr : self._pannerAttr; + } + } else if (args.length === 2) { + o = args[0]; + id = parseInt(args[1], 10); + } + + // Update the values of the specified sounds. + var ids = self._getSoundIds(id); + for (var i=0; i= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +var createBaseFor = __webpack_require__(175); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseForRight = __webpack_require__(152), + keys = __webpack_require__(9); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(63), + isFunction = __webpack_require__(36); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +var Stack = __webpack_require__(62), + assignMergeValue = __webpack_require__(146), + baseFor = __webpack_require__(98), + baseMergeDeep = __webpack_require__(312), + isObject = __webpack_require__(6), + keysIn = __webpack_require__(13); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports) { + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(141); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +var apply = __webpack_require__(11), + arrayMap = __webpack_require__(12), + baseIteratee = __webpack_require__(3), + baseRest = __webpack_require__(4), + baseUnary = __webpack_require__(68), + flatRest = __webpack_require__(32); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ +function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(153), + getSymbolsIn = __webpack_require__(188), + keysIn = __webpack_require__(13); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +var metaMap = __webpack_require__(194), + noop = __webpack_require__(216); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(63), + stubArray = __webpack_require__(120); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(1), + isSymbol = __webpack_require__(46); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports) { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseSetToString = __webpack_require__(319), + shortOut = __webpack_require__(201); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +var copyObject = __webpack_require__(19), + createAssigner = __webpack_require__(42), + keysIn = __webpack_require__(13); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGet = __webpack_require__(41); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseHasIn = __webpack_require__(302), + hasPath = __webpack_require__(189); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(26), + getPrototype = __webpack_require__(72), + isObjectLike = __webpack_require__(21); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports) { + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ +function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; +} + +module.exports = negate; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + 'assign': __webpack_require__(395), + 'assignIn': __webpack_require__(205), + 'assignInWith': __webpack_require__(112), + 'assignWith': __webpack_require__(396), + 'at': __webpack_require__(397), + 'create': __webpack_require__(405), + 'defaults': __webpack_require__(409), + 'defaultsDeep': __webpack_require__(410), + 'entries': __webpack_require__(415), + 'entriesIn': __webpack_require__(416), + 'extend': __webpack_require__(418), + 'extendWith': __webpack_require__(419), + 'findKey': __webpack_require__(423), + 'findLastKey': __webpack_require__(426), + 'forIn': __webpack_require__(434), + 'forInRight': __webpack_require__(435), + 'forOwn': __webpack_require__(436), + 'forOwnRight': __webpack_require__(437), + 'functions': __webpack_require__(439), + 'functionsIn': __webpack_require__(440), + 'get': __webpack_require__(114), + 'has': __webpack_require__(442), + 'hasIn': __webpack_require__(115), + 'invert': __webpack_require__(445), + 'invertBy': __webpack_require__(446), + 'invoke': __webpack_require__(447), + 'keys': __webpack_require__(9), + 'keysIn': __webpack_require__(13), + 'mapKeys': __webpack_require__(453), + 'mapValues': __webpack_require__(454), + 'merge': __webpack_require__(457), + 'mergeWith': __webpack_require__(215), + 'omit': __webpack_require__(464), + 'omitBy': __webpack_require__(465), + 'pick': __webpack_require__(474), + 'pickBy': __webpack_require__(218), + 'result': __webpack_require__(484), + 'set': __webpack_require__(487), + 'setWith': __webpack_require__(488), + 'toPairs': __webpack_require__(221), + 'toPairsIn': __webpack_require__(222), + 'transform': __webpack_require__(501), + 'unset': __webpack_require__(504), + 'update': __webpack_require__(505), + 'updateWith': __webpack_require__(506), + 'values': __webpack_require__(51), + 'valuesIn': __webpack_require__(507) +}; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToString = __webpack_require__(324); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + 'attempt': __webpack_require__(398), + 'bindAll': __webpack_require__(399), + 'cond': __webpack_require__(402), + 'conforms': __webpack_require__(403), + 'constant': __webpack_require__(113), + 'defaultTo': __webpack_require__(408), + 'flow': __webpack_require__(432), + 'flowRight': __webpack_require__(433), + 'identity': __webpack_require__(29), + 'iteratee': __webpack_require__(451), + 'matches': __webpack_require__(455), + 'matchesProperty': __webpack_require__(456), + 'method': __webpack_require__(458), + 'methodOf': __webpack_require__(459), + 'mixin': __webpack_require__(460), + 'noop': __webpack_require__(216), + 'nthArg': __webpack_require__(462), + 'over': __webpack_require__(468), + 'overEvery': __webpack_require__(470), + 'overSome': __webpack_require__(471), + 'property': __webpack_require__(219), + 'propertyOf': __webpack_require__(475), + 'range': __webpack_require__(477), + 'rangeRight': __webpack_require__(478), + 'stubArray': __webpack_require__(120), + 'stubFalse': __webpack_require__(220), + 'stubObject': __webpack_require__(494), + 'stubString': __webpack_require__(495), + 'stubTrue': __webpack_require__(496), + 'times': __webpack_require__(498), + 'toPath': __webpack_require__(499), + 'uniqueId': __webpack_require__(503) +}; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports) { + + + +var mapSize = function(gl, type) +{ + if(!GL_TABLE) + { + var typeNames = Object.keys(GL_TO_GLSL_TYPES); + + GL_TABLE = {}; + + for(var i = 0; i < typeNames.length; ++i) + { + var tn = typeNames[i]; + GL_TABLE[ gl[tn] ] = GL_TO_GLSL_TYPES[tn]; + } + } + + return GL_TABLE[type]; +}; + +var GL_TABLE = null; + +var GL_TO_GLSL_TYPES = { + 'FLOAT': 'float', + 'FLOAT_VEC2': 'vec2', + 'FLOAT_VEC3': 'vec3', + 'FLOAT_VEC4': 'vec4', + + 'INT': 'int', + 'INT_VEC2': 'ivec2', + 'INT_VEC3': 'ivec3', + 'INT_VEC4': 'ivec4', + + 'BOOL': 'bool', + 'BOOL_VEC2': 'bvec2', + 'BOOL_VEC3': 'bvec3', + 'BOOL_VEC4': 'bvec4', + + 'FLOAT_MAT2': 'mat2', + 'FLOAT_MAT3': 'mat3', + 'FLOAT_MAT4': 'mat4', + + 'SAMPLER_2D': 'sampler2D' +}; + +module.exports = mapSize; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _math = __webpack_require__(7); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * 'Builder' pattern for bounds rectangles + * Axis-Aligned Bounding Box + * It is not a shape! Its mutable thing, no 'EMPTY' or that kind of problems + * + * @class + * @memberof PIXI + */ +var Bounds = function () { + /** + * + */ + function Bounds() { + _classCallCheck(this, Bounds); + + /** + * @member {number} + * @default 0 + */ + this.minX = Infinity; + + /** + * @member {number} + * @default 0 + */ + this.minY = Infinity; + + /** + * @member {number} + * @default 0 + */ + this.maxX = -Infinity; + + /** + * @member {number} + * @default 0 + */ + this.maxY = -Infinity; + + this.rect = null; + } + + /** + * Checks if bounds are empty. + * + * @return {boolean} True if empty. + */ + + + Bounds.prototype.isEmpty = function isEmpty() { + return this.minX > this.maxX || this.minY > this.maxY; + }; + + /** + * Clears the bounds and resets. + * + */ + + + Bounds.prototype.clear = function clear() { + this.updateID++; + + this.minX = Infinity; + this.minY = Infinity; + this.maxX = -Infinity; + this.maxY = -Infinity; + }; + + /** + * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle + * It is not guaranteed that it will return tempRect + * + * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty + * @returns {PIXI.Rectangle} A rectangle of the bounds + */ + + + Bounds.prototype.getRectangle = function getRectangle(rect) { + if (this.minX > this.maxX || this.minY > this.maxY) { + return _math.Rectangle.EMPTY; + } + + rect = rect || new _math.Rectangle(0, 0, 1, 1); + + rect.x = this.minX; + rect.y = this.minY; + rect.width = this.maxX - this.minX; + rect.height = this.maxY - this.minY; + + return rect; + }; + + /** + * This function should be inlined when its possible. + * + * @param {PIXI.Point} point - The point to add. + */ + + + Bounds.prototype.addPoint = function addPoint(point) { + this.minX = Math.min(this.minX, point.x); + this.maxX = Math.max(this.maxX, point.x); + this.minY = Math.min(this.minY, point.y); + this.maxY = Math.max(this.maxY, point.y); + }; + + /** + * Adds a quad, not transformed + * + * @param {Float32Array} vertices - The verts to add. + */ + + + Bounds.prototype.addQuad = function addQuad(vertices) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + var x = vertices[0]; + var y = vertices[1]; + + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = vertices[2]; + y = vertices[3]; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = vertices[4]; + y = vertices[5]; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = vertices[6]; + y = vertices[7]; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + + /** + * Adds sprite frame, transformed. + * + * @param {PIXI.TransformBase} transform - TODO + * @param {number} x0 - TODO + * @param {number} y0 - TODO + * @param {number} x1 - TODO + * @param {number} y1 - TODO + */ + + + Bounds.prototype.addFrame = function addFrame(transform, x0, y0, x1, y1) { + var matrix = transform.worldTransform; + var a = matrix.a; + var b = matrix.b; + var c = matrix.c; + var d = matrix.d; + var tx = matrix.tx; + var ty = matrix.ty; + + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + var x = a * x0 + c * y0 + tx; + var y = b * x0 + d * y0 + ty; + + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = a * x1 + c * y0 + tx; + y = b * x1 + d * y0 + ty; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = a * x0 + c * y1 + tx; + y = b * x0 + d * y1 + ty; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + x = a * x1 + c * y1 + tx; + y = b * x1 + d * y1 + ty; + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + + /** + * Add an array of vertices + * + * @param {PIXI.TransformBase} transform - TODO + * @param {Float32Array} vertices - TODO + * @param {number} beginOffset - TODO + * @param {number} endOffset - TODO + */ + + + Bounds.prototype.addVertices = function addVertices(transform, vertices, beginOffset, endOffset) { + var matrix = transform.worldTransform; + var a = matrix.a; + var b = matrix.b; + var c = matrix.c; + var d = matrix.d; + var tx = matrix.tx; + var ty = matrix.ty; + + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + for (var i = beginOffset; i < endOffset; i += 2) { + var rawX = vertices[i]; + var rawY = vertices[i + 1]; + var x = a * rawX + c * rawY + tx; + var y = d * rawY + b * rawX + ty; + + minX = x < minX ? x : minX; + minY = y < minY ? y : minY; + maxX = x > maxX ? x : maxX; + maxY = y > maxY ? y : maxY; + } + + this.minX = minX; + this.minY = minY; + this.maxX = maxX; + this.maxY = maxY; + }; + + /** + * Adds other Bounds + * + * @param {PIXI.Bounds} bounds - TODO + */ + + + Bounds.prototype.addBounds = function addBounds(bounds) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + this.minX = bounds.minX < minX ? bounds.minX : minX; + this.minY = bounds.minY < minY ? bounds.minY : minY; + this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX; + this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY; + }; + + /** + * Adds other Bounds, masked with Bounds + * + * @param {PIXI.Bounds} bounds - TODO + * @param {PIXI.Bounds} mask - TODO + */ + + + Bounds.prototype.addBoundsMask = function addBoundsMask(bounds, mask) { + var _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX; + var _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY; + var _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX; + var _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY; + + if (_minX <= _maxX && _minY <= _maxY) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + this.minX = _minX < minX ? _minX : minX; + this.minY = _minY < minY ? _minY : minY; + this.maxX = _maxX > maxX ? _maxX : maxX; + this.maxY = _maxY > maxY ? _maxY : maxY; + } + }; + + /** + * Adds other Bounds, masked with Rectangle + * + * @param {PIXI.Bounds} bounds - TODO + * @param {PIXI.Rectangle} area - TODO + */ + + + Bounds.prototype.addBoundsArea = function addBoundsArea(bounds, area) { + var _minX = bounds.minX > area.x ? bounds.minX : area.x; + var _minY = bounds.minY > area.y ? bounds.minY : area.y; + var _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : area.x + area.width; + var _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : area.y + area.height; + + if (_minX <= _maxX && _minY <= _maxY) { + var minX = this.minX; + var minY = this.minY; + var maxX = this.maxX; + var maxY = this.maxY; + + this.minX = _minX < minX ? _minX : minX; + this.minY = _minY < minY ? _minY : minY; + this.maxX = _maxX > maxX ? _maxX : maxX; + this.maxY = _maxY > maxY ? _maxY : maxY; + } + }; + + return Bounds; +}(); + +exports.default = Bounds; +//# sourceMappingURL=Bounds.js.map + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _math = __webpack_require__(7); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Generic class to deal with traditional 2D matrix transforms + * + * @class + * @memberof PIXI + */ +var TransformBase = function () { + /** + * + */ + function TransformBase() { + _classCallCheck(this, TransformBase); + + /** + * The global matrix transform. It can be swapped temporarily by some functions like getLocalBounds() + * + * @member {PIXI.Matrix} + */ + this.worldTransform = new _math.Matrix(); + + /** + * The local matrix transform + * + * @member {PIXI.Matrix} + */ + this.localTransform = new _math.Matrix(); + + this._worldID = 0; + this._parentID = 0; + } + + /** + * TransformBase does not have decomposition, so this function wont do anything + */ + + + TransformBase.prototype.updateLocalTransform = function updateLocalTransform() {} + // empty + + + /** + * Updates the values of the object and applies the parent's transform. + * + * @param {PIXI.TransformBase} parentTransform - The transform of the parent of this object + */ + ; + + TransformBase.prototype.updateTransform = function updateTransform(parentTransform) { + var pt = parentTransform.worldTransform; + var wt = this.worldTransform; + var lt = this.localTransform; + + // concat the parent matrix with the objects transform. + wt.a = lt.a * pt.a + lt.b * pt.c; + wt.b = lt.a * pt.b + lt.b * pt.d; + wt.c = lt.c * pt.a + lt.d * pt.c; + wt.d = lt.c * pt.b + lt.d * pt.d; + wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx; + wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty; + + this._worldID++; + }; + + return TransformBase; +}(); + +/** + * Updates the values of the object and applies the parent's transform. + * @param parentTransform {PIXI.Transform} The transform of the parent of this object + * + */ + + +exports.default = TransformBase; +TransformBase.prototype.updateWorldTransform = TransformBase.prototype.updateTransform; + +TransformBase.IDENTITY = new TransformBase(); +//# sourceMappingURL=TransformBase.js.map + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Point = __webpack_require__(127); + +var _Point2 = _interopRequireDefault(_Point); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * The pixi Matrix class as an object, which makes it a lot faster, + * here is a representation of it : + * | a | b | tx| + * | c | d | ty| + * | 0 | 0 | 1 | + * + * @class + * @memberof PIXI + */ +var Matrix = function () { + /** + * + */ + function Matrix() { + _classCallCheck(this, Matrix); + + /** + * @member {number} + * @default 1 + */ + this.a = 1; + + /** + * @member {number} + * @default 0 + */ + this.b = 0; + + /** + * @member {number} + * @default 0 + */ + this.c = 0; + + /** + * @member {number} + * @default 1 + */ + this.d = 1; + + /** + * @member {number} + * @default 0 + */ + this.tx = 0; + + /** + * @member {number} + * @default 0 + */ + this.ty = 0; + + this.array = null; + } + + /** + * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: + * + * a = array[0] + * b = array[1] + * c = array[3] + * d = array[4] + * tx = array[2] + * ty = array[5] + * + * @param {number[]} array - The array that the matrix will be populated from. + */ + + + Matrix.prototype.fromArray = function fromArray(array) { + this.a = array[0]; + this.b = array[1]; + this.c = array[3]; + this.d = array[4]; + this.tx = array[2]; + this.ty = array[5]; + }; + + /** + * sets the matrix properties + * + * @param {number} a - Matrix component + * @param {number} b - Matrix component + * @param {number} c - Matrix component + * @param {number} d - Matrix component + * @param {number} tx - Matrix component + * @param {number} ty - Matrix component + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.set = function set(a, b, c, d, tx, ty) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + + return this; + }; + + /** + * Creates an array from the current Matrix object. + * + * @param {boolean} transpose - Whether we need to transpose the matrix or not + * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out + * @return {number[]} the newly created array which contains the matrix + */ + + + Matrix.prototype.toArray = function toArray(transpose, out) { + if (!this.array) { + this.array = new Float32Array(9); + } + + var array = out || this.array; + + if (transpose) { + array[0] = this.a; + array[1] = this.b; + array[2] = 0; + array[3] = this.c; + array[4] = this.d; + array[5] = 0; + array[6] = this.tx; + array[7] = this.ty; + array[8] = 1; + } else { + array[0] = this.a; + array[1] = this.c; + array[2] = this.tx; + array[3] = this.b; + array[4] = this.d; + array[5] = this.ty; + array[6] = 0; + array[7] = 0; + array[8] = 1; + } + + return array; + }; + + /** + * Get a new position with the current transformation applied. + * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) + * + * @param {PIXI.Point} pos - The origin + * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, transformed through this matrix + */ + + + Matrix.prototype.apply = function apply(pos, newPos) { + newPos = newPos || new _Point2.default(); + + var x = pos.x; + var y = pos.y; + + newPos.x = this.a * x + this.c * y + this.tx; + newPos.y = this.b * x + this.d * y + this.ty; + + return newPos; + }; + + /** + * Get a new position with the inverse of the current transformation applied. + * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) + * + * @param {PIXI.Point} pos - The origin + * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) + * @return {PIXI.Point} The new point, inverse-transformed through this matrix + */ + + + Matrix.prototype.applyInverse = function applyInverse(pos, newPos) { + newPos = newPos || new _Point2.default(); + + var id = 1 / (this.a * this.d + this.c * -this.b); + + var x = pos.x; + var y = pos.y; + + newPos.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id; + newPos.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id; + + return newPos; + }; + + /** + * Translates the matrix on the x and y. + * + * @param {number} x How much to translate x by + * @param {number} y How much to translate y by + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.translate = function translate(x, y) { + this.tx += x; + this.ty += y; + + return this; + }; + + /** + * Applies a scale transformation to the matrix. + * + * @param {number} x The amount to scale horizontally + * @param {number} y The amount to scale vertically + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.scale = function scale(x, y) { + this.a *= x; + this.d *= y; + this.c *= x; + this.b *= y; + this.tx *= x; + this.ty *= y; + + return this; + }; + + /** + * Applies a rotation transformation to the matrix. + * + * @param {number} angle - The angle in radians. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.rotate = function rotate(angle) { + var cos = Math.cos(angle); + var sin = Math.sin(angle); + + var a1 = this.a; + var c1 = this.c; + var tx1 = this.tx; + + this.a = a1 * cos - this.b * sin; + this.b = a1 * sin + this.b * cos; + this.c = c1 * cos - this.d * sin; + this.d = c1 * sin + this.d * cos; + this.tx = tx1 * cos - this.ty * sin; + this.ty = tx1 * sin + this.ty * cos; + + return this; + }; + + /** + * Appends the given Matrix to this Matrix. + * + * @param {PIXI.Matrix} matrix - The matrix to append. + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.append = function append(matrix) { + var a1 = this.a; + var b1 = this.b; + var c1 = this.c; + var d1 = this.d; + + this.a = matrix.a * a1 + matrix.b * c1; + this.b = matrix.a * b1 + matrix.b * d1; + this.c = matrix.c * a1 + matrix.d * c1; + this.d = matrix.c * b1 + matrix.d * d1; + + this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; + this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; + + return this; + }; + + /** + * Sets the matrix based on all the available properties + * + * @param {number} x - Position on the x axis + * @param {number} y - Position on the y axis + * @param {number} pivotX - Pivot on the x axis + * @param {number} pivotY - Pivot on the y axis + * @param {number} scaleX - Scale on the x axis + * @param {number} scaleY - Scale on the y axis + * @param {number} rotation - Rotation in radians + * @param {number} skewX - Skew on the x axis + * @param {number} skewY - Skew on the y axis + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.setTransform = function setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { + var sr = Math.sin(rotation); + var cr = Math.cos(rotation); + var cy = Math.cos(skewY); + var sy = Math.sin(skewY); + var nsx = -Math.sin(skewX); + var cx = Math.cos(skewX); + + var a = cr * scaleX; + var b = sr * scaleX; + var c = -sr * scaleY; + var d = cr * scaleY; + + this.a = cy * a + sy * c; + this.b = cy * b + sy * d; + this.c = nsx * a + cx * c; + this.d = nsx * b + cx * d; + + this.tx = x + (pivotX * a + pivotY * c); + this.ty = y + (pivotX * b + pivotY * d); + + return this; + }; + + /** + * Prepends the given Matrix to this Matrix. + * + * @param {PIXI.Matrix} matrix - The matrix to prepend + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.prepend = function prepend(matrix) { + var tx1 = this.tx; + + if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) { + var a1 = this.a; + var c1 = this.c; + + this.a = a1 * matrix.a + this.b * matrix.c; + this.b = a1 * matrix.b + this.b * matrix.d; + this.c = c1 * matrix.a + this.d * matrix.c; + this.d = c1 * matrix.b + this.d * matrix.d; + } + + this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx; + this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty; + + return this; + }; + + /** + * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. + * + * @param {PIXI.Transform|PIXI.TransformStatic} transform - The transform to apply the properties to. + * @return {PIXI.Transform|PIXI.TransformStatic} The transform with the newly applied properties + */ + + + Matrix.prototype.decompose = function decompose(transform) { + // sort out rotation / skew.. + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + + var skewX = -Math.atan2(-c, d); + var skewY = Math.atan2(b, a); + + var delta = Math.abs(skewX + skewY); + + if (delta < 0.00001) { + transform.rotation = skewY; + + if (a < 0 && d >= 0) { + transform.rotation += transform.rotation <= 0 ? Math.PI : -Math.PI; + } + + transform.skew.x = transform.skew.y = 0; + } else { + transform.skew.x = skewX; + transform.skew.y = skewY; + } + + // next set scale + transform.scale.x = Math.sqrt(a * a + b * b); + transform.scale.y = Math.sqrt(c * c + d * d); + + // next set position + transform.position.x = this.tx; + transform.position.y = this.ty; + + return transform; + }; + + /** + * Inverts this matrix + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.invert = function invert() { + var a1 = this.a; + var b1 = this.b; + var c1 = this.c; + var d1 = this.d; + var tx1 = this.tx; + var n = a1 * d1 - b1 * c1; + + this.a = d1 / n; + this.b = -b1 / n; + this.c = -c1 / n; + this.d = a1 / n; + this.tx = (c1 * this.ty - d1 * tx1) / n; + this.ty = -(a1 * this.ty - b1 * tx1) / n; + + return this; + }; + + /** + * Resets this Matix to an identity (default) matrix. + * + * @return {PIXI.Matrix} This matrix. Good for chaining method calls. + */ + + + Matrix.prototype.identity = function identity() { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.tx = 0; + this.ty = 0; + + return this; + }; + + /** + * Creates a new Matrix object with the same values as this one. + * + * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls. + */ + + + Matrix.prototype.clone = function clone() { + var matrix = new Matrix(); + + matrix.a = this.a; + matrix.b = this.b; + matrix.c = this.c; + matrix.d = this.d; + matrix.tx = this.tx; + matrix.ty = this.ty; + + return matrix; + }; + + /** + * Changes the values of the given matrix to be the same as the ones in this matrix + * + * @param {PIXI.Matrix} matrix - The matrix to copy from. + * @return {PIXI.Matrix} The matrix given in parameter with its values updated. + */ + + + Matrix.prototype.copy = function copy(matrix) { + matrix.a = this.a; + matrix.b = this.b; + matrix.c = this.c; + matrix.d = this.d; + matrix.tx = this.tx; + matrix.ty = this.ty; + + return matrix; + }; + + /** + * A default (identity) matrix + * + * @static + * @const + */ + + + _createClass(Matrix, null, [{ + key: 'IDENTITY', + get: function get() { + return new Matrix(); + } + + /** + * A temp matrix + * + * @static + * @const + */ + + }, { + key: 'TEMP_MATRIX', + get: function get() { + return new Matrix(); + } + }]); + + return Matrix; +}(); + +exports.default = Matrix; +//# sourceMappingURL=Matrix.js.map + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * The Point object represents a location in a two-dimensional coordinate system, where x represents + * the horizontal axis and y represents the vertical axis. + * + * @class + * @memberof PIXI + */ +var Point = function () { + /** + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=0] - position of the point on the y axis + */ + function Point() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Point); + + /** + * @member {number} + * @default 0 + */ + this.x = x; + + /** + * @member {number} + * @default 0 + */ + this.y = y; + } + + /** + * Creates a clone of this point + * + * @return {PIXI.Point} a copy of the point + */ + + + Point.prototype.clone = function clone() { + return new Point(this.x, this.y); + }; + + /** + * Copies x and y from the given point + * + * @param {PIXI.Point} p - The point to copy. + */ + + + Point.prototype.copy = function copy(p) { + this.set(p.x, p.y); + }; + + /** + * Returns true if the given point is equal to this point + * + * @param {PIXI.Point} p - The point to check + * @returns {boolean} Whether the given point equal to this point + */ + + + Point.prototype.equals = function equals(p) { + return p.x === this.x && p.y === this.y; + }; + + /** + * Sets the point to a new x and y position. + * If y is omitted, both x and y will be set to x. + * + * @param {number} [x=0] - position of the point on the x axis + * @param {number} [y=0] - position of the point on the y axis + */ + + + Point.prototype.set = function set(x, y) { + this.x = x || 0; + this.y = y || (y !== 0 ? this.x : 0); + }; + + return Point; +}(); + +exports.default = Point; +//# sourceMappingURL=Point.js.map + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _const = __webpack_require__(2); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Rectangle object is an area defined by its position, as indicated by its top-left corner + * point (x, y) and by its width and its height. + * + * @class + * @memberof PIXI + */ +var Rectangle = function () { + /** + * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle + * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle + * @param {number} [width=0] - The overall width of this rectangle + * @param {number} [height=0] - The overall height of this rectangle + */ + function Rectangle() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + _classCallCheck(this, Rectangle); + + /** + * @member {number} + * @default 0 + */ + this.x = x; + + /** + * @member {number} + * @default 0 + */ + this.y = y; + + /** + * @member {number} + * @default 0 + */ + this.width = width; + + /** + * @member {number} + * @default 0 + */ + this.height = height; + + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.RECT + * @see PIXI.SHAPES + */ + this.type = _const.SHAPES.RECT; + } + + /** + * returns the left edge of the rectangle + * + * @member {number} + */ + + + /** + * Creates a clone of this Rectangle + * + * @return {PIXI.Rectangle} a copy of the rectangle + */ + Rectangle.prototype.clone = function clone() { + return new Rectangle(this.x, this.y, this.width, this.height); + }; + + /** + * Copies another rectangle to this one. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to copy. + * @return {PIXI.Rectangle} Returns itself. + */ + + + Rectangle.prototype.copy = function copy(rectangle) { + this.x = rectangle.x; + this.y = rectangle.y; + this.width = rectangle.width; + this.height = rectangle.height; + + return this; + }; + + /** + * Checks whether the x and y coordinates given are contained within this Rectangle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Rectangle + */ + + + Rectangle.prototype.contains = function contains(x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; + } + + if (x >= this.x && x < this.x + this.width) { + if (y >= this.y && y < this.y + this.height) { + return true; + } + } + + return false; + }; + + /** + * Pads the rectangle making it grow in all directions. + * + * @param {number} paddingX - The horizontal padding amount. + * @param {number} paddingY - The vertical padding amount. + */ + + + Rectangle.prototype.pad = function pad(paddingX, paddingY) { + paddingX = paddingX || 0; + paddingY = paddingY || (paddingY !== 0 ? paddingX : 0); + + this.x -= paddingX; + this.y -= paddingY; + + this.width += paddingX * 2; + this.height += paddingY * 2; + }; + + /** + * Fits this rectangle around the passed one. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to fit. + */ + + + Rectangle.prototype.fit = function fit(rectangle) { + if (this.x < rectangle.x) { + this.width += this.x; + if (this.width < 0) { + this.width = 0; + } + + this.x = rectangle.x; + } + + if (this.y < rectangle.y) { + this.height += this.y; + if (this.height < 0) { + this.height = 0; + } + this.y = rectangle.y; + } + + if (this.x + this.width > rectangle.x + rectangle.width) { + this.width = rectangle.width - this.x; + if (this.width < 0) { + this.width = 0; + } + } + + if (this.y + this.height > rectangle.y + rectangle.height) { + this.height = rectangle.height - this.y; + if (this.height < 0) { + this.height = 0; + } + } + }; + + /** + * Enlarges this rectangle to include the passed rectangle. + * + * @param {PIXI.Rectangle} rectangle - The rectangle to include. + */ + + + Rectangle.prototype.enlarge = function enlarge(rectangle) { + var x1 = Math.min(this.x, rectangle.x); + var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width); + var y1 = Math.min(this.y, rectangle.y); + var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height); + + this.x = x1; + this.width = x2 - x1; + this.y = y1; + this.height = y2 - y1; + }; + + _createClass(Rectangle, [{ + key: 'left', + get: function get() { + return this.x; + } + + /** + * returns the right edge of the rectangle + * + * @member {number} + */ + + }, { + key: 'right', + get: function get() { + return this.x + this.width; + } + + /** + * returns the top edge of the rectangle + * + * @member {number} + */ + + }, { + key: 'top', + get: function get() { + return this.y; + } + + /** + * returns the bottom edge of the rectangle + * + * @member {number} + */ + + }, { + key: 'bottom', + get: function get() { + return this.y + this.height; + } + + /** + * A constant empty rectangle. + * + * @static + * @constant + */ + + }], [{ + key: 'EMPTY', + get: function get() { + return new Rectangle(0, 0, 0, 0); + } + }]); + + return Rectangle; +}(); + +exports.default = Rectangle; +//# sourceMappingURL=Rectangle.js.map + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _math = __webpack_require__(7); + +var _utils = __webpack_require__(5); + +var _const = __webpack_require__(2); + +var _Texture = __webpack_require__(57); + +var _Texture2 = _interopRequireDefault(_Texture); + +var _Container2 = __webpack_require__(53); + +var _Container3 = _interopRequireDefault(_Container2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var tempPoint = new _math.Point(); + +/** + * The Sprite object is the base for all textured objects that are rendered to the screen + * + * A sprite can be created directly from an image like this: + * + * ```js + * let sprite = new PIXI.Sprite.fromImage('assets/image.png'); + * ``` + * + * @class + * @extends PIXI.Container + * @memberof PIXI + */ + +var Sprite = function (_Container) { + _inherits(Sprite, _Container); + + /** + * @param {PIXI.Texture} texture - The texture for this sprite + */ + function Sprite(texture) { + _classCallCheck(this, Sprite); + + /** + * The anchor sets the origin point of the texture. + * The default is 0,0 this means the texture's origin is the top left + * Setting the anchor to 0.5,0.5 means the texture's origin is centered + * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner + * + * @member {PIXI.ObservablePoint} + * @private + */ + var _this = _possibleConstructorReturn(this, _Container.call(this)); + + _this._anchor = new _math.ObservablePoint(_this._onAnchorUpdate, _this); + + /** + * The texture that the sprite is using + * + * @private + * @member {PIXI.Texture} + */ + _this._texture = null; + + /** + * The width of the sprite (this is initially set by the texture) + * + * @private + * @member {number} + */ + _this._width = 0; + + /** + * The height of the sprite (this is initially set by the texture) + * + * @private + * @member {number} + */ + _this._height = 0; + + /** + * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect. + * + * @private + * @member {number} + * @default 0xFFFFFF + */ + _this._tint = null; + _this._tintRGB = null; + _this.tint = 0xFFFFFF; + + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + _this.blendMode = _const.BLEND_MODES.NORMAL; + + /** + * The shader that will be used to render the sprite. Set to null to remove a current shader. + * + * @member {PIXI.Filter|PIXI.Shader} + */ + _this.shader = null; + + /** + * An internal cached value of the tint. + * + * @private + * @member {number} + * @default 0xFFFFFF + */ + _this.cachedTint = 0xFFFFFF; + + // call texture setter + _this.texture = texture || _Texture2.default.EMPTY; + + /** + * this is used to store the vertex data of the sprite (basically a quad) + * + * @private + * @member {Float32Array} + */ + _this.vertexData = new Float32Array(8); + + /** + * This is used to calculate the bounds of the object IF it is a trimmed sprite + * + * @private + * @member {Float32Array} + */ + _this.vertexTrimmedData = null; + + _this._transformID = -1; + _this._textureID = -1; + + _this._transformTrimmedID = -1; + _this._textureTrimmedID = -1; + + /** + * Plugin that is responsible for rendering this element. + * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods. + * + * @member {string} + * @default 'sprite' + */ + _this.pluginName = 'sprite'; + return _this; + } + + /** + * When the texture is updated, this event will fire to update the scale and frame + * + * @private + */ + + + Sprite.prototype._onTextureUpdate = function _onTextureUpdate() { + this._textureID = -1; + this._textureTrimmedID = -1; + + // so if _width is 0 then width was not set.. + if (this._width) { + this.scale.x = (0, _utils.sign)(this.scale.x) * this._width / this.texture.orig.width; + } + + if (this._height) { + this.scale.y = (0, _utils.sign)(this.scale.y) * this._height / this.texture.orig.height; + } + }; + + /** + * Called when the anchor position updates. + * + * @private + */ + + + Sprite.prototype._onAnchorUpdate = function _onAnchorUpdate() { + this._transformID = -1; + this._transformTrimmedID = -1; + }; + + /** + * calculates worldTransform * vertices, store it in vertexData + */ + + + Sprite.prototype.calculateVertices = function calculateVertices() { + if (this._transformID === this.transform._worldID && this._textureID === this._texture._updateID) { + return; + } + + this._transformID = this.transform._worldID; + this._textureID = this._texture._updateID; + + // set the vertex data + + var texture = this._texture; + var wt = this.transform.worldTransform; + var a = wt.a; + var b = wt.b; + var c = wt.c; + var d = wt.d; + var tx = wt.tx; + var ty = wt.ty; + var vertexData = this.vertexData; + var trim = texture.trim; + var orig = texture.orig; + var anchor = this._anchor; + + var w0 = 0; + var w1 = 0; + var h0 = 0; + var h1 = 0; + + if (trim) { + // if the sprite is trimmed and is not a tilingsprite then we need to add the extra + // space before transforming the sprite coords. + w1 = trim.x - anchor._x * orig.width; + w0 = w1 + trim.width; + + h1 = trim.y - anchor._y * orig.height; + h0 = h1 + trim.height; + } else { + w0 = orig.width * (1 - anchor._x); + w1 = orig.width * -anchor._x; + + h0 = orig.height * (1 - anchor._y); + h1 = orig.height * -anchor._y; + } + + // xy + vertexData[0] = a * w1 + c * h1 + tx; + vertexData[1] = d * h1 + b * w1 + ty; + + // xy + vertexData[2] = a * w0 + c * h1 + tx; + vertexData[3] = d * h1 + b * w0 + ty; + + // xy + vertexData[4] = a * w0 + c * h0 + tx; + vertexData[5] = d * h0 + b * w0 + ty; + + // xy + vertexData[6] = a * w1 + c * h0 + tx; + vertexData[7] = d * h0 + b * w1 + ty; + }; + + /** + * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData + * This is used to ensure that the true width and height of a trimmed texture is respected + */ + + + Sprite.prototype.calculateTrimmedVertices = function calculateTrimmedVertices() { + if (!this.vertexTrimmedData) { + this.vertexTrimmedData = new Float32Array(8); + } else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) { + return; + } + + this._transformTrimmedID = this.transform._worldID; + this._textureTrimmedID = this._texture._updateID; + + // lets do some special trim code! + var texture = this._texture; + var vertexData = this.vertexTrimmedData; + var orig = texture.orig; + var anchor = this._anchor; + + // lets calculate the new untrimmed bounds.. + var wt = this.transform.worldTransform; + var a = wt.a; + var b = wt.b; + var c = wt.c; + var d = wt.d; + var tx = wt.tx; + var ty = wt.ty; + + var w0 = orig.width * (1 - anchor._x); + var w1 = orig.width * -anchor._x; + + var h0 = orig.height * (1 - anchor._y); + var h1 = orig.height * -anchor._y; + + // xy + vertexData[0] = a * w1 + c * h1 + tx; + vertexData[1] = d * h1 + b * w1 + ty; + + // xy + vertexData[2] = a * w0 + c * h1 + tx; + vertexData[3] = d * h1 + b * w0 + ty; + + // xy + vertexData[4] = a * w0 + c * h0 + tx; + vertexData[5] = d * h0 + b * w0 + ty; + + // xy + vertexData[6] = a * w1 + c * h0 + tx; + vertexData[7] = d * h0 + b * w1 + ty; + }; + + /** + * + * Renders the object using the WebGL renderer + * + * @private + * @param {PIXI.WebGLRenderer} renderer - The webgl renderer to use. + */ + + + Sprite.prototype._renderWebGL = function _renderWebGL(renderer) { + this.calculateVertices(); + + renderer.setObjectRenderer(renderer.plugins[this.pluginName]); + renderer.plugins[this.pluginName].render(this); + }; + + /** + * Renders the object using the Canvas renderer + * + * @private + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + + + Sprite.prototype._renderCanvas = function _renderCanvas(renderer) { + renderer.plugins[this.pluginName].render(this); + }; + + /** + * Updates the bounds of the sprite. + * + * @private + */ + + + Sprite.prototype._calculateBounds = function _calculateBounds() { + var trim = this._texture.trim; + var orig = this._texture.orig; + + // First lets check to see if the current texture has a trim.. + if (!trim || trim.width === orig.width && trim.height === orig.height) { + // no trim! lets use the usual calculations.. + this.calculateVertices(); + this._bounds.addQuad(this.vertexData); + } else { + // lets calculate a special trimmed bounds... + this.calculateTrimmedVertices(); + this._bounds.addQuad(this.vertexTrimmedData); + } + }; + + /** + * Gets the local bounds of the sprite object. + * + * @param {Rectangle} rect - The output rectangle. + * @return {Rectangle} The bounds. + */ + + + Sprite.prototype.getLocalBounds = function getLocalBounds(rect) { + // we can do a fast local bounds if the sprite has no children! + if (this.children.length === 0) { + this._bounds.minX = this._texture.orig.width * -this._anchor._x; + this._bounds.minY = this._texture.orig.height * -this._anchor._y; + this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x); + this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._x); + + if (!rect) { + if (!this._localBoundsRect) { + this._localBoundsRect = new _math.Rectangle(); + } + + rect = this._localBoundsRect; + } + + return this._bounds.getRectangle(rect); + } + + return _Container.prototype.getLocalBounds.call(this, rect); + }; + + /** + * Tests if a point is inside this sprite + * + * @param {PIXI.Point} point - the point to test + * @return {boolean} the result of the test + */ + + + Sprite.prototype.containsPoint = function containsPoint(point) { + this.worldTransform.applyInverse(point, tempPoint); + + var width = this._texture.orig.width; + var height = this._texture.orig.height; + var x1 = -width * this.anchor.x; + var y1 = 0; + + if (tempPoint.x > x1 && tempPoint.x < x1 + width) { + y1 = -height * this.anchor.y; + + if (tempPoint.y > y1 && tempPoint.y < y1 + height) { + return true; + } + } + + return false; + }; + + /** + * Destroys this sprite and optionally its texture and children + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well + */ + + + Sprite.prototype.destroy = function destroy(options) { + _Container.prototype.destroy.call(this, options); + + this._anchor = null; + + var destroyTexture = typeof options === 'boolean' ? options : options && options.texture; + + if (destroyTexture) { + var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture; + + this._texture.destroy(!!destroyBaseTexture); + } + + this._texture = null; + this.shader = null; + }; + + // some helper functions.. + + /** + * Helper function that creates a new sprite based on the source you provide. + * The source can be - frame id, image url, video url, canvas element, video element, base texture + * + * @static + * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @return {PIXI.Texture} The newly created texture + */ + + + Sprite.from = function from(source) { + return new Sprite(_Texture2.default.from(source)); + }; + + /** + * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId + * The frame ids are created when a Texture packer file has been loaded + * + * @static + * @param {string} frameId - The frame Id of the texture in the cache + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the frameId + */ + + + Sprite.fromFrame = function fromFrame(frameId) { + var texture = _utils.TextureCache[frameId]; + + if (!texture) { + throw new Error('The frameId "' + frameId + '" does not exist in the texture cache'); + } + + return new Sprite(texture); + }; + + /** + * Helper function that creates a sprite that will contain a texture based on an image url + * If the image is not in the texture cache it will be loaded + * + * @static + * @param {string} imageId - The image url of the texture + * @param {boolean} [crossorigin=(auto)] - if you want to specify the cross-origin parameter + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode, + * see {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Sprite} A new Sprite using a texture from the texture cache matching the image id + */ + + + Sprite.fromImage = function fromImage(imageId, crossorigin, scaleMode) { + return new Sprite(_Texture2.default.fromImage(imageId, crossorigin, scaleMode)); + }; + + /** + * The width of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + + + _createClass(Sprite, [{ + key: 'width', + get: function get() { + return Math.abs(this.scale.x) * this._texture.orig.width; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + var s = (0, _utils.sign)(this.scale.x) || 1; + + this.scale.x = s * value / this._texture.orig.width; + this._width = value; + } + + /** + * The height of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + + }, { + key: 'height', + get: function get() { + return Math.abs(this.scale.y) * this._texture.orig.height; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + var s = (0, _utils.sign)(this.scale.y) || 1; + + this.scale.y = s * value / this._texture.orig.height; + this._height = value; + } + + /** + * The anchor sets the origin point of the texture. + * The default is 0,0 this means the texture's origin is the top left + * Setting the anchor to 0.5,0.5 means the texture's origin is centered + * Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner + * + * @member {PIXI.ObservablePoint} + */ + + }, { + key: 'anchor', + get: function get() { + return this._anchor; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this._anchor.copy(value); + } + + /** + * The tint applied to the sprite. This is a hex value. A value of + * 0xFFFFFF will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + + }, { + key: 'tint', + get: function get() { + return this._tint; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this._tint = value; + this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); + } + + /** + * The texture that the sprite is using + * + * @member {PIXI.Texture} + */ + + }, { + key: 'texture', + get: function get() { + return this._texture; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + if (this._texture === value) { + return; + } + + this._texture = value; + this.cachedTint = 0xFFFFFF; + + this._textureID = -1; + this._textureTrimmedID = -1; + + if (value) { + // wait for the texture to load + if (value.baseTexture.hasLoaded) { + this._onTextureUpdate(); + } else { + value.once('update', this._onTextureUpdate, this); + } + } + } + }]); + + return Sprite; +}(_Container3.default); + +exports.default = Sprite; +//# sourceMappingURL=Sprite.js.map + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _utils = __webpack_require__(5); + +var _canUseNewCanvasBlendModes = __webpack_require__(244); + +var _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Utility methods for Sprite/Texture tinting. + * + * @class + * @memberof PIXI + */ +var CanvasTinter = { + /** + * Basically this method just needs a sprite and a color and tints the sprite with the given color. + * + * @memberof PIXI.CanvasTinter + * @param {PIXI.Sprite} sprite - the sprite to tint + * @param {number} color - the color to use to tint the sprite with + * @return {HTMLCanvasElement} The tinted canvas + */ + getTintedTexture: function getTintedTexture(sprite, color) { + var texture = sprite.texture; + + color = CanvasTinter.roundColor(color); + + var stringColor = '#' + ('00000' + (color | 0).toString(16)).substr(-6); + + texture.tintCache = texture.tintCache || {}; + + if (texture.tintCache[stringColor]) { + return texture.tintCache[stringColor]; + } + + // clone texture.. + var canvas = CanvasTinter.canvas || document.createElement('canvas'); + + // CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); + CanvasTinter.tintMethod(texture, color, canvas); + + if (CanvasTinter.convertTintToImage) { + // is this better? + var tintImage = new Image(); + + tintImage.src = canvas.toDataURL(); + + texture.tintCache[stringColor] = tintImage; + } else { + texture.tintCache[stringColor] = canvas; + // if we are not converting the texture to an image then we need to lose the reference to the canvas + CanvasTinter.canvas = null; + } + + return canvas; + }, + + /** + * Tint a texture using the 'multiply' operation. + * + * @memberof PIXI.CanvasTinter + * @param {PIXI.Texture} texture - the texture to tint + * @param {number} color - the color to use to tint the sprite with + * @param {HTMLCanvasElement} canvas - the current canvas + */ + tintWithMultiply: function tintWithMultiply(texture, color, canvas) { + var context = canvas.getContext('2d'); + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; + + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution; + crop.height *= resolution; + + canvas.width = crop.width; + canvas.height = crop.height; + + context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6); + + context.fillRect(0, 0, crop.width, crop.height); + + context.globalCompositeOperation = 'multiply'; + + context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + + context.globalCompositeOperation = 'destination-atop'; + + context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + }, + + /** + * Tint a texture using the 'overlay' operation. + * + * @memberof PIXI.CanvasTinter + * @param {PIXI.Texture} texture - the texture to tint + * @param {number} color - the color to use to tint the sprite with + * @param {HTMLCanvasElement} canvas - the current canvas + */ + tintWithOverlay: function tintWithOverlay(texture, color, canvas) { + var context = canvas.getContext('2d'); + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; + + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution; + crop.height *= resolution; + + canvas.width = crop.width; + canvas.height = crop.height; + + context.globalCompositeOperation = 'copy'; + context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6); + context.fillRect(0, 0, crop.width, crop.height); + + context.globalCompositeOperation = 'destination-atop'; + context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + + // context.globalCompositeOperation = 'copy'; + }, + + + /** + * Tint a texture pixel per pixel. + * + * @memberof PIXI.CanvasTinter + * @param {PIXI.Texture} texture - the texture to tint + * @param {number} color - the color to use to tint the sprite with + * @param {HTMLCanvasElement} canvas - the current canvas + */ + tintWithPerPixel: function tintWithPerPixel(texture, color, canvas) { + var context = canvas.getContext('2d'); + var crop = texture._frame.clone(); + var resolution = texture.baseTexture.resolution; + + crop.x *= resolution; + crop.y *= resolution; + crop.width *= resolution; + crop.height *= resolution; + + canvas.width = crop.width; + canvas.height = crop.height; + + context.globalCompositeOperation = 'copy'; + context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + + var rgbValues = (0, _utils.hex2rgb)(color); + var r = rgbValues[0]; + var g = rgbValues[1]; + var b = rgbValues[2]; + + var pixelData = context.getImageData(0, 0, crop.width, crop.height); + + var pixels = pixelData.data; + + for (var i = 0; i < pixels.length; i += 4) { + pixels[i + 0] *= r; + pixels[i + 1] *= g; + pixels[i + 2] *= b; + } + + context.putImageData(pixelData, 0, 0); + }, + + /** + * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel. + * + * @memberof PIXI.CanvasTinter + * @param {number} color - the color to round, should be a hex color + * @return {number} The rounded color. + */ + roundColor: function roundColor(color) { + var step = CanvasTinter.cacheStepsPerColorChannel; + + var rgbValues = (0, _utils.hex2rgb)(color); + + rgbValues[0] = Math.min(255, rgbValues[0] / step * step); + rgbValues[1] = Math.min(255, rgbValues[1] / step * step); + rgbValues[2] = Math.min(255, rgbValues[2] / step * step); + + return (0, _utils.rgb2hex)(rgbValues); + }, + + /** + * Number of steps which will be used as a cap when rounding colors. + * + * @memberof PIXI.CanvasTinter + * @type {number} + */ + cacheStepsPerColorChannel: 8, + + /** + * Tint cache boolean flag. + * + * @memberof PIXI.CanvasTinter + * @type {boolean} + */ + convertTintToImage: false, + + /** + * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method. + * + * @memberof PIXI.CanvasTinter + * @type {boolean} + */ + canUseMultiply: (0, _canUseNewCanvasBlendModes2.default)(), + + /** + * The tinting method that will be used. + * + * @memberof PIXI.CanvasTinter + * @type {tintMethodFunctionType} + */ + tintMethod: 0 +}; + +CanvasTinter.tintMethod = CanvasTinter.canUseMultiply ? CanvasTinter.tintWithMultiply : CanvasTinter.tintWithPerPixel; + +/** + * The tintMethod type. + * + * @memberof PIXI.CanvasTinter + * @callback tintMethodFunctionType + * @param texture {PIXI.Texture} the texture to tint + * @param color {number} the color to use to tint the sprite with + * @param canvas {HTMLCanvasElement} the current canvas + */ + +exports.default = CanvasTinter; +//# sourceMappingURL=CanvasTinter.js.map + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _BaseRenderTexture = __webpack_require__(249); + +var _BaseRenderTexture2 = _interopRequireDefault(_BaseRenderTexture); + +var _Texture2 = __webpack_require__(57); + +var _Texture3 = _interopRequireDefault(_Texture2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. + * + * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded + * otherwise black rectangles will be drawn instead. + * + * A RenderTexture takes a snapshot of any Display Object given to its render method. For example: + * + * ```js + * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 }); + * let renderTexture = PIXI.RenderTexture.create(800, 600); + * let sprite = PIXI.Sprite.fromImage("spinObj_01.png"); + * + * sprite.position.x = 800/2; + * sprite.position.y = 600/2; + * sprite.anchor.x = 0.5; + * sprite.anchor.y = 0.5; + * + * renderer.render(sprite, renderTexture); + * ``` + * + * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0 + * you can clear the transform + * + * ```js + * + * sprite.setTransform() + * + * let renderTexture = new PIXI.RenderTexture.create(100, 100); + * + * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture + * ``` + * + * @class + * @extends PIXI.Texture + * @memberof PIXI + */ +var RenderTexture = function (_Texture) { + _inherits(RenderTexture, _Texture); + + /** + * @param {PIXI.BaseRenderTexture} baseRenderTexture - The renderer used for this RenderTexture + * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show + */ + function RenderTexture(baseRenderTexture, frame) { + _classCallCheck(this, RenderTexture); + + // support for legacy.. + var _legacyRenderer = null; + + if (!(baseRenderTexture instanceof _BaseRenderTexture2.default)) { + /* eslint-disable prefer-rest-params, no-console */ + var width = arguments[1]; + var height = arguments[2]; + var scaleMode = arguments[3] || 0; + var resolution = arguments[4] || 1; + + // we have an old render texture.. + console.warn('Please use RenderTexture.create(' + width + ', ' + height + ') instead of the ctor directly.'); + _legacyRenderer = arguments[0]; + /* eslint-enable prefer-rest-params, no-console */ + + frame = null; + baseRenderTexture = new _BaseRenderTexture2.default(width, height, scaleMode, resolution); + } + + /** + * The base texture object that this texture uses + * + * @member {BaseTexture} + */ + + var _this = _possibleConstructorReturn(this, _Texture.call(this, baseRenderTexture, frame)); + + _this.legacyRenderer = _legacyRenderer; + + /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * + * @member {boolean} + */ + _this.valid = true; + + _this._updateUvs(); + return _this; + } + + /** + * Resizes the RenderTexture. + * + * @param {number} width - The width to resize to. + * @param {number} height - The height to resize to. + * @param {boolean} doNotResizeBaseTexture - Should the baseTexture.width and height values be resized as well? + */ + + + RenderTexture.prototype.resize = function resize(width, height, doNotResizeBaseTexture) { + // TODO - could be not required.. + this.valid = width > 0 && height > 0; + + this._frame.width = this.orig.width = width; + this._frame.height = this.orig.height = height; + + if (!doNotResizeBaseTexture) { + this.baseTexture.resize(width, height); + } + + this._updateUvs(); + }; + + /** + * A short hand way of creating a render texture. + * + * @param {number} [width=100] - The width of the render texture + * @param {number} [height=100] - The height of the render texture + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated + * @return {PIXI.RenderTexture} The new render texture + */ + + + RenderTexture.create = function create(width, height, scaleMode, resolution) { + return new RenderTexture(new _BaseRenderTexture2.default(width, height, scaleMode, resolution)); + }; + + return RenderTexture; +}(_Texture3.default); + +exports.default = RenderTexture; +//# sourceMappingURL=RenderTexture.js.map + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = createIndicesForQuads; +/** + * Generic Mask Stack data structure + * + * @memberof PIXI + * @function createIndicesForQuads + * @private + * @param {number} size - Number of quads + * @return {Uint16Array} indices + */ +function createIndicesForQuads(size) { + // the total number of indices in our array, there are 6 points per quad. + + var totalIndices = size * 6; + + var indices = new Uint16Array(totalIndices); + + // fill the indices with the quads to draw + for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) { + indices[i + 0] = j + 0; + indices[i + 1] = j + 1; + indices[i + 2] = j + 2; + indices[i + 3] = j + 0; + indices[i + 4] = j + 2; + indices[i + 5] = j + 3; + } + + return indices; +} +//# sourceMappingURL=createIndicesForQuads.js.map + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.BitmapText = exports.TilingSpriteRenderer = exports.TilingSprite = exports.AnimatedSprite = exports.TextureTransform = undefined; + +var _TextureTransform = __webpack_require__(254); + +Object.defineProperty(exports, 'TextureTransform', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TextureTransform).default; + } +}); + +var _AnimatedSprite = __webpack_require__(562); + +Object.defineProperty(exports, 'AnimatedSprite', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_AnimatedSprite).default; + } +}); + +var _TilingSprite = __webpack_require__(564); + +Object.defineProperty(exports, 'TilingSprite', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TilingSprite).default; + } +}); + +var _TilingSpriteRenderer = __webpack_require__(568); + +Object.defineProperty(exports, 'TilingSpriteRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TilingSpriteRenderer).default; + } +}); + +var _BitmapText = __webpack_require__(563); + +Object.defineProperty(exports, 'BitmapText', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BitmapText).default; + } +}); + +__webpack_require__(565); + +__webpack_require__(566); + +__webpack_require__(567); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// imported for side effect of extending the prototype only, contains no exports +//# sourceMappingURL=index.js.map + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _core = __webpack_require__(0); + +var core = _interopRequireWildcard(_core); + +var _CountLimiter = __webpack_require__(271); + +var _CountLimiter2 = _interopRequireDefault(_CountLimiter); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var SharedTicker = core.ticker.shared; + +/** + * Default number of uploads per frame using prepare plugin. + * + * @static + * @memberof PIXI.settings + * @name UPLOADS_PER_FRAME + * @type {number} + * @default 4 + */ +core.settings.UPLOADS_PER_FRAME = 4; + +/** + * The prepare manager provides functionality to upload content to the GPU. BasePrepare handles + * basic queuing functionality and is extended by {@link PIXI.prepare.WebGLPrepare} and {@link PIXI.prepare.CanvasPrepare} + * to provide preparation capabilities specific to their respective renderers. + * + * @abstract + * @class + * @memberof PIXI + */ + +var BasePrepare = function () { + /** + * @param {PIXI.SystemRenderer} renderer - A reference to the current renderer + */ + function BasePrepare(renderer) { + var _this = this; + + _classCallCheck(this, BasePrepare); + + /** + * The limiter to be used to control how quickly items are prepared. + * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter} + */ + this.limiter = new _CountLimiter2.default(core.settings.UPLOADS_PER_FRAME); + + /** + * Reference to the renderer. + * @type {PIXI.SystemRenderer} + * @protected + */ + this.renderer = renderer; + + /** + * The only real difference between CanvasPrepare and WebGLPrepare is what they pass + * to upload hooks. That different parameter is stored here. + * @type {PIXI.prepare.CanvasPrepare|PIXI.WebGLRenderer} + * @protected + */ + this.uploadHookHelper = null; + + /** + * Collection of items to uploads at once. + * @type {Array<*>} + * @private + */ + this.queue = []; + + /** + * Collection of additional hooks for finding assets. + * @type {Array} + * @private + */ + this.addHooks = []; + + /** + * Collection of additional hooks for processing assets. + * @type {Array} + * @private + */ + this.uploadHooks = []; + + /** + * Callback to call after completed. + * @type {Array} + * @private + */ + this.completes = []; + + /** + * If prepare is ticking (running). + * @type {boolean} + * @private + */ + this.ticking = false; + + /** + * 'bound' call for prepareItems(). + * @type {Function} + * @private + */ + this.delayedTick = function () { + // unlikely, but in case we were destroyed between tick() and delayedTick() + if (!_this.queue) { + return; + } + _this.prepareItems(); + }; + + this.register(findText, drawText); + this.register(findTextStyle, calculateTextStyle); + } + + /** + * Upload all the textures and graphics to the GPU. + * + * @param {Function|PIXI.DisplayObject|PIXI.Container} item - Either + * the container or display object to search for items to upload or + * the callback function, if items have been added using `prepare.add`. + * @param {Function} [done] - Optional callback when all queued uploads have completed + */ + + + BasePrepare.prototype.upload = function upload(item, done) { + if (typeof item === 'function') { + done = item; + item = null; + } + + // If a display object, search for items + // that we could upload + if (item) { + this.add(item); + } + + // Get the items for upload from the display + if (this.queue.length) { + if (done) { + this.completes.push(done); + } + + if (!this.ticking) { + this.ticking = true; + SharedTicker.addOnce(this.tick, this); + } + } else if (done) { + done(); + } + }; + + /** + * Handle tick update + * + * @private + */ + + + BasePrepare.prototype.tick = function tick() { + setTimeout(this.delayedTick, 0); + }; + + /** + * Actually prepare items. This is handled outside of the tick because it will take a while + * and we do NOT want to block the current animation frame from rendering. + * + * @private + */ + + + BasePrepare.prototype.prepareItems = function prepareItems() { + this.limiter.beginFrame(); + // Upload the graphics + while (this.queue.length && this.limiter.allowedToUpload()) { + var item = this.queue[0]; + var uploaded = false; + + for (var i = 0, len = this.uploadHooks.length; i < len; i++) { + if (this.uploadHooks[i](this.uploadHookHelper, item)) { + this.queue.shift(); + uploaded = true; + break; + } + } + + if (!uploaded) { + this.queue.shift(); + } + } + + // We're finished + if (!this.queue.length) { + this.ticking = false; + + var completes = this.completes.slice(0); + + this.completes.length = 0; + + for (var _i = 0, _len = completes.length; _i < _len; _i++) { + completes[_i](); + } + } else { + // if we are not finished, on the next rAF do this again + SharedTicker.addOnce(this.tick, this); + } + }; + + /** + * Adds hooks for finding and uploading items. + * + * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array` + function must return `true` if it was able to add item to the queue. + * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. + */ + + + BasePrepare.prototype.register = function register(addHook, uploadHook) { + if (addHook) { + this.addHooks.push(addHook); + } + + if (uploadHook) { + this.uploadHooks.push(uploadHook); + } + + return this; + }; + + /** + * Manually add an item to the uploading queue. + * + * @param {PIXI.DisplayObject|PIXI.Container|*} item - Object to add to the queue + * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. + */ + + + BasePrepare.prototype.add = function add(item) { + // Add additional hooks for finding elements on special + // types of objects that + for (var i = 0, len = this.addHooks.length; i < len; i++) { + if (this.addHooks[i](item, this.queue)) { + break; + } + } + + // Get childen recursively + if (item instanceof core.Container) { + for (var _i2 = item.children.length - 1; _i2 >= 0; _i2--) { + this.add(item.children[_i2]); + } + } + + return this; + }; + + /** + * Destroys the plugin, don't use after this. + * + */ + + + BasePrepare.prototype.destroy = function destroy() { + if (this.ticking) { + SharedTicker.remove(this.tick, this); + } + this.ticking = false; + this.addHooks = null; + this.uploadHooks = null; + this.renderer = null; + this.completes = null; + this.queue = null; + this.limiter = null; + this.uploadHookHelper = null; + }; + + return BasePrepare; +}(); + +/** + * Built-in hook to draw PIXI.Text to its texture. + * + * @private + * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler + * @param {PIXI.DisplayObject} item - Item to check + * @return {boolean} If item was uploaded. + */ + + +exports.default = BasePrepare; +function drawText(helper, item) { + if (item instanceof core.Text) { + // updating text will return early if it is not dirty + item.updateText(true); + + return true; + } + + return false; +} + +/** + * Built-in hook to calculate a text style for a PIXI.Text object. + * + * @private + * @param {PIXI.WebGLRenderer|PIXI.CanvasPrepare} helper - Not used by this upload handler + * @param {PIXI.DisplayObject} item - Item to check + * @return {boolean} If item was uploaded. + */ +function calculateTextStyle(helper, item) { + if (item instanceof core.TextStyle) { + var font = core.Text.getFontStyle(item); + + if (!core.Text.fontPropertiesCache[font]) { + core.Text.calculateFontProperties(font); + } + + return true; + } + + return false; +} + +/** + * Built-in hook to find Text objects. + * + * @private + * @param {PIXI.DisplayObject} item - Display object to check + * @param {Array<*>} queue - Collection of items to upload + * @return {boolean} if a PIXI.Text object was found. + */ +function findText(item, queue) { + if (item instanceof core.Text) { + // push the text style to prepare it - this can be really expensive + if (queue.indexOf(item.style) === -1) { + queue.push(item.style); + } + // also push the text object so that we can render it (to canvas/texture) if needed + if (queue.indexOf(item) === -1) { + queue.push(item); + } + // also push the Text's texture for upload to GPU + var texture = item._texture.baseTexture; + + if (queue.indexOf(texture) === -1) { + queue.push(texture); + } + + return true; + } + + return false; +} + +/** + * Built-in hook to find TextStyle objects. + * + * @private + * @param {PIXI.TextStyle} item - Display object to check + * @param {Array<*>} queue - Collection of items to upload + * @return {boolean} if a PIXI.TextStyle object was found. + */ +function findTextStyle(item, queue) { + if (item instanceof core.TextStyle) { + if (queue.indexOf(item) === -1) { + queue.push(item); + } + + return true; + } + + return false; +} +//# sourceMappingURL=BasePrepare.js.map + +/***/ }), +/* 135 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parseUri = __webpack_require__(224); + +var _parseUri2 = _interopRequireDefault(_parseUri); + +var _miniSignals = __webpack_require__(223); + +var _miniSignals2 = _interopRequireDefault(_miniSignals); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// tests is CORS is supported in XHR, if not we need to use XDR +var useXdr = !!(window.XDomainRequest && !('withCredentials' in new XMLHttpRequest())); +var tempAnchor = null; + +// some status constants +var STATUS_NONE = 0; +var STATUS_OK = 200; +var STATUS_EMPTY = 204; + +// noop +function _noop() {} /* empty */ + +/** + * Manages the state and loading of a resource and all child resources. + * + * @class + */ + +var Resource = function () { + /** + * Sets the load type to be used for a specific extension. + * + * @static + * @param {string} extname - The extension to set the type for, e.g. "png" or "fnt" + * @param {Resource.LOAD_TYPE} loadType - The load type to set it to. + */ + Resource.setExtensionLoadType = function setExtensionLoadType(extname, loadType) { + setExtMap(Resource._loadTypeMap, extname, loadType); + }; + + /** + * Sets the load type to be used for a specific extension. + * + * @static + * @param {string} extname - The extension to set the type for, e.g. "png" or "fnt" + * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to. + */ + + + Resource.setExtensionXhrType = function setExtensionXhrType(extname, xhrType) { + setExtMap(Resource._xhrTypeMap, extname, xhrType); + }; + + /** + * @param {string} name - The name of the resource to load. + * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass + * an array of sources. + * @param {object} [options] - The options for the load. + * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to + * determine automatically. + * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource + * be loaded? + * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How + * should the data being loaded be interpreted when using XHR? + * @param {object} [options.metadata] - Extra configuration for middleware and the Resource object. + * @param {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [options.metadata.loadElement=null] - The + * element to use for loading, instead of creating one. + * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This + * is useful if you want to pass in a `loadElement` that you already added load sources to. + */ + + + function Resource(name, url, options) { + _classCallCheck(this, Resource); + + if (typeof name !== 'string' || typeof url !== 'string') { + throw new Error('Both name and url are required for constructing a resource.'); + } + + options = options || {}; + + /** + * The state flags of this resource. + * + * @member {number} + */ + this._flags = 0; + + // set data url flag, needs to be set early for some _determineX checks to work. + this._setFlag(Resource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0); + + /** + * The name of this resource. + * + * @member {string} + * @readonly + */ + this.name = name; + + /** + * The url used to load this resource. + * + * @member {string} + * @readonly + */ + this.url = url; + + /** + * The data that was loaded by the resource. + * + * @member {any} + */ + this.data = null; + + /** + * Is this request cross-origin? If unset, determined automatically. + * + * @member {string} + */ + this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin; + + /** + * The method of loading to use for this resource. + * + * @member {Resource.LOAD_TYPE} + */ + this.loadType = options.loadType || this._determineLoadType(); + + /** + * The type used to load the resource via XHR. If unset, determined automatically. + * + * @member {string} + */ + this.xhrType = options.xhrType; + + /** + * Extra info for middleware, and controlling specifics about how the resource loads. + * + * Note that if you pass in a `loadElement`, the Resource class takes ownership of it. + * Meaning it will modify it as it sees fit. + * + * @member {object} + * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The + * element to use for loading, instead of creating one. + * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This + * is useful if you want to pass in a `loadElement` that you already added load sources + * to. + */ + this.metadata = options.metadata || {}; + + /** + * The error that occurred while loading (if any). + * + * @member {Error} + * @readonly + */ + this.error = null; + + /** + * The XHR object that was used to load this resource. This is only set + * when `loadType` is `Resource.LOAD_TYPE.XHR`. + * + * @member {XMLHttpRequest} + * @readonly + */ + this.xhr = null; + + /** + * The child resources this resource owns. + * + * @member {Resource[]} + * @readonly + */ + this.children = []; + + /** + * The resource type. + * + * @member {Resource.TYPE} + * @readonly + */ + this.type = Resource.TYPE.UNKNOWN; + + /** + * The progress chunk owned by this resource. + * + * @member {number} + * @readonly + */ + this.progressChunk = 0; + + /** + * The `dequeue` method that will be used a storage place for the async queue dequeue method + * used privately by the loader. + * + * @private + * @member {function} + */ + this._dequeue = _noop; + + /** + * Used a storage place for the on load binding used privately by the loader. + * + * @private + * @member {function} + */ + this._onLoadBinding = null; + + /** + * The `complete` function bound to this resource's context. + * + * @private + * @member {function} + */ + this._boundComplete = this.complete.bind(this); + + /** + * The `_onError` function bound to this resource's context. + * + * @private + * @member {function} + */ + this._boundOnError = this._onError.bind(this); + + /** + * The `_onProgress` function bound to this resource's context. + * + * @private + * @member {function} + */ + this._boundOnProgress = this._onProgress.bind(this); + + // xhr callbacks + this._boundXhrOnError = this._xhrOnError.bind(this); + this._boundXhrOnAbort = this._xhrOnAbort.bind(this); + this._boundXhrOnLoad = this._xhrOnLoad.bind(this); + this._boundXdrOnTimeout = this._xdrOnTimeout.bind(this); + + /** + * Dispatched when the resource beings to load. + * + * The callback looks like {@link Resource.OnStartSignal}. + * + * @member {Signal} + */ + this.onStart = new _miniSignals2.default(); + + /** + * Dispatched each time progress of this resource load updates. + * Not all resources types and loader systems can support this event + * so sometimes it may not be available. If the resource + * is being loaded on a modern browser, using XHR, and the remote server + * properly sets Content-Length headers, then this will be available. + * + * The callback looks like {@link Resource.OnProgressSignal}. + * + * @member {Signal} + */ + this.onProgress = new _miniSignals2.default(); + + /** + * Dispatched once this resource has loaded, if there was an error it will + * be in the `error` property. + * + * The callback looks like {@link Resource.OnCompleteSignal}. + * + * @member {Signal} + */ + this.onComplete = new _miniSignals2.default(); + + /** + * Dispatched after this resource has had all the *after* middleware run on it. + * + * The callback looks like {@link Resource.OnCompleteSignal}. + * + * @member {Signal} + */ + this.onAfterMiddleware = new _miniSignals2.default(); + + /** + * When the resource starts to load. + * + * @memberof Resource + * @callback OnStartSignal + * @param {Resource} resource - The resource that the event happened on. + */ + + /** + * When the resource reports loading progress. + * + * @memberof Resource + * @callback OnProgressSignal + * @param {Resource} resource - The resource that the event happened on. + * @param {number} percentage - The progress of the load in the range [0, 1]. + */ + + /** + * When the resource finishes loading. + * + * @memberof Resource + * @callback OnCompleteSignal + * @param {Resource} resource - The resource that the event happened on. + */ + } + + /** + * Stores whether or not this url is a data url. + * + * @member {boolean} + * @readonly + */ + + + /** + * Marks the resource as complete. + * + */ + Resource.prototype.complete = function complete() { + // TODO: Clean this up in a wrapper or something...gross.... + if (this.data && this.data.removeEventListener) { + this.data.removeEventListener('error', this._boundOnError, false); + this.data.removeEventListener('load', this._boundComplete, false); + this.data.removeEventListener('progress', this._boundOnProgress, false); + this.data.removeEventListener('canplaythrough', this._boundComplete, false); + } + + if (this.xhr) { + if (this.xhr.removeEventListener) { + this.xhr.removeEventListener('error', this._boundXhrOnError, false); + this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false); + this.xhr.removeEventListener('progress', this._boundOnProgress, false); + this.xhr.removeEventListener('load', this._boundXhrOnLoad, false); + } else { + this.xhr.onerror = null; + this.xhr.ontimeout = null; + this.xhr.onprogress = null; + this.xhr.onload = null; + } + } + + if (this.isComplete) { + throw new Error('Complete called again for an already completed resource.'); + } + + this._setFlag(Resource.STATUS_FLAGS.COMPLETE, true); + this._setFlag(Resource.STATUS_FLAGS.LOADING, false); + + this.onComplete.dispatch(this); + }; + + /** + * Aborts the loading of this resource, with an optional message. + * + * @param {string} message - The message to use for the error + */ + + + Resource.prototype.abort = function abort(message) { + // abort can be called multiple times, ignore subsequent calls. + if (this.error) { + return; + } + + // store error + this.error = new Error(message); + + // abort the actual loading + if (this.xhr) { + this.xhr.abort(); + } else if (this.xdr) { + this.xdr.abort(); + } else if (this.data) { + // single source + if (this.data.src) { + this.data.src = Resource.EMPTY_GIF; + } + // multi-source + else { + while (this.data.firstChild) { + this.data.removeChild(this.data.firstChild); + } + } + } + + // done now. + this.complete(); + }; + + /** + * Kicks off loading of this resource. This method is asynchronous. + * + * @param {function} [cb] - Optional callback to call once the resource is loaded. + */ + + + Resource.prototype.load = function load(cb) { + var _this = this; + + if (this.isLoading) { + return; + } + + if (this.isComplete) { + if (cb) { + setTimeout(function () { + return cb(_this); + }, 1); + } + + return; + } else if (cb) { + this.onComplete.once(cb); + } + + this._setFlag(Resource.STATUS_FLAGS.LOADING, true); + + this.onStart.dispatch(this); + + // if unset, determine the value + if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') { + this.crossOrigin = this._determineCrossOrigin(this.url); + } + + switch (this.loadType) { + case Resource.LOAD_TYPE.IMAGE: + this.type = Resource.TYPE.IMAGE; + this._loadElement('image'); + break; + + case Resource.LOAD_TYPE.AUDIO: + this.type = Resource.TYPE.AUDIO; + this._loadSourceElement('audio'); + break; + + case Resource.LOAD_TYPE.VIDEO: + this.type = Resource.TYPE.VIDEO; + this._loadSourceElement('video'); + break; + + case Resource.LOAD_TYPE.XHR: + /* falls through */ + default: + if (useXdr && this.crossOrigin) { + this._loadXdr(); + } else { + this._loadXhr(); + } + break; + } + }; + + /** + * Checks if the flag is set. + * + * @private + * @param {number} flag - The flag to check. + * @return {boolean} True if the flag is set. + */ + + + Resource.prototype._hasFlag = function _hasFlag(flag) { + return !!(this._flags & flag); + }; + + /** + * (Un)Sets the flag. + * + * @private + * @param {number} flag - The flag to (un)set. + * @param {boolean} value - Whether to set or (un)set the flag. + */ + + + Resource.prototype._setFlag = function _setFlag(flag, value) { + this._flags = value ? this._flags | flag : this._flags & ~flag; + }; + + /** + * Loads this resources using an element that has a single source, + * like an HTMLImageElement. + * + * @private + * @param {string} type - The type of element to use. + */ + + + Resource.prototype._loadElement = function _loadElement(type) { + if (this.metadata.loadElement) { + this.data = this.metadata.loadElement; + } else if (type === 'image' && typeof window.Image !== 'undefined') { + this.data = new Image(); + } else { + this.data = document.createElement(type); + } + + if (this.crossOrigin) { + this.data.crossOrigin = this.crossOrigin; + } + + if (!this.metadata.skipSource) { + this.data.src = this.url; + } + + this.data.addEventListener('error', this._boundOnError, false); + this.data.addEventListener('load', this._boundComplete, false); + this.data.addEventListener('progress', this._boundOnProgress, false); + }; + + /** + * Loads this resources using an element that has multiple sources, + * like an HTMLAudioElement or HTMLVideoElement. + * + * @private + * @param {string} type - The type of element to use. + */ + + + Resource.prototype._loadSourceElement = function _loadSourceElement(type) { + if (this.metadata.loadElement) { + this.data = this.metadata.loadElement; + } else if (type === 'audio' && typeof window.Audio !== 'undefined') { + this.data = new Audio(); + } else { + this.data = document.createElement(type); + } + + if (this.data === null) { + this.abort('Unsupported element: ' + type); + + return; + } + + if (!this.metadata.skipSource) { + // support for CocoonJS Canvas+ runtime, lacks document.createElement('source') + if (navigator.isCocoonJS) { + this.data.src = Array.isArray(this.url) ? this.url[0] : this.url; + } else if (Array.isArray(this.url)) { + for (var i = 0; i < this.url.length; ++i) { + this.data.appendChild(this._createSource(type, this.url[i])); + } + } else { + this.data.appendChild(this._createSource(type, this.url)); + } + } + + this.data.addEventListener('error', this._boundOnError, false); + this.data.addEventListener('load', this._boundComplete, false); + this.data.addEventListener('progress', this._boundOnProgress, false); + this.data.addEventListener('canplaythrough', this._boundComplete, false); + + this.data.load(); + }; + + /** + * Loads this resources using an XMLHttpRequest. + * + * @private + */ + + + Resource.prototype._loadXhr = function _loadXhr() { + // if unset, determine the value + if (typeof this.xhrType !== 'string') { + this.xhrType = this._determineXhrType(); + } + + var xhr = this.xhr = new XMLHttpRequest(); + + // set the request type and url + xhr.open('GET', this.url, true); + + // load json as text and parse it ourselves. We do this because some browsers + // *cough* safari *cough* can't deal with it. + if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) { + xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT; + } else { + xhr.responseType = this.xhrType; + } + + xhr.addEventListener('error', this._boundXhrOnError, false); + xhr.addEventListener('abort', this._boundXhrOnAbort, false); + xhr.addEventListener('progress', this._boundOnProgress, false); + xhr.addEventListener('load', this._boundXhrOnLoad, false); + + xhr.send(); + }; + + /** + * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross). + * + * @private + */ + + + Resource.prototype._loadXdr = function _loadXdr() { + // if unset, determine the value + if (typeof this.xhrType !== 'string') { + this.xhrType = this._determineXhrType(); + } + + var xdr = this.xhr = new XDomainRequest(); + + // XDomainRequest has a few quirks. Occasionally it will abort requests + // A way to avoid this is to make sure ALL callbacks are set even if not used + // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9 + xdr.timeout = 5000; + + xdr.onerror = this._boundXhrOnError; + xdr.ontimeout = this._boundXdrOnTimeout; + xdr.onprogress = this._boundOnProgress; + xdr.onload = this._boundXhrOnLoad; + + xdr.open('GET', this.url, true); + + // Note: The xdr.send() call is wrapped in a timeout to prevent an + // issue with the interface where some requests are lost if multiple + // XDomainRequests are being sent at the same time. + // Some info here: https://github.com/photonstorm/phaser/issues/1248 + setTimeout(function () { + return xdr.send(); + }, 1); + }; + + /** + * Creates a source used in loading via an element. + * + * @private + * @param {string} type - The element type (video or audio). + * @param {string} url - The source URL to load from. + * @param {string} [mime] - The mime type of the video + * @return {HTMLSourceElement} The source element. + */ + + + Resource.prototype._createSource = function _createSource(type, url, mime) { + if (!mime) { + mime = type + '/' + url.substr(url.lastIndexOf('.') + 1); + } + + var source = document.createElement('source'); + + source.src = url; + source.type = mime; + + return source; + }; + + /** + * Called if a load errors out. + * + * @param {Event} event - The error event from the element that emits it. + * @private + */ + + + Resource.prototype._onError = function _onError(event) { + this.abort('Failed to load element using: ' + event.target.nodeName); + }; + + /** + * Called if a load progress event fires for xhr/xdr. + * + * @private + * @param {XMLHttpRequestProgressEvent|Event} event - Progress event. + */ + + + Resource.prototype._onProgress = function _onProgress(event) { + if (event && event.lengthComputable) { + this.onProgress.dispatch(this, event.loaded / event.total); + } + }; + + /** + * Called if an error event fires for xhr/xdr. + * + * @private + * @param {XMLHttpRequestErrorEvent|Event} event - Error event. + */ + + + Resource.prototype._xhrOnError = function _xhrOnError() { + var xhr = this.xhr; + + this.abort(reqType(xhr) + ' Request failed. Status: ' + xhr.status + ', text: "' + xhr.statusText + '"'); + }; + + /** + * Called if an abort event fires for xhr. + * + * @private + * @param {XMLHttpRequestAbortEvent} event - Abort Event + */ + + + Resource.prototype._xhrOnAbort = function _xhrOnAbort() { + this.abort(reqType(this.xhr) + ' Request was aborted by the user.'); + }; + + /** + * Called if a timeout event fires for xdr. + * + * @private + * @param {Event} event - Timeout event. + */ + + + Resource.prototype._xdrOnTimeout = function _xdrOnTimeout() { + this.abort(reqType(this.xhr) + ' Request timed out.'); + }; + + /** + * Called when data successfully loads from an xhr/xdr request. + * + * @private + * @param {XMLHttpRequestLoadEvent|Event} event - Load event + */ + + + Resource.prototype._xhrOnLoad = function _xhrOnLoad() { + var xhr = this.xhr; + var status = typeof xhr.status === 'undefined' ? xhr.status : STATUS_OK; // XDR has no `.status`, assume 200. + + // status can be 0 when using the `file://` protocol so we also check if a response is set + if (status === STATUS_OK || status === STATUS_EMPTY || status === STATUS_NONE && xhr.responseText.length > 0) { + // if text, just return it + if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) { + this.data = xhr.responseText; + this.type = Resource.TYPE.TEXT; + } + // if json, parse into json object + else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) { + try { + this.data = JSON.parse(xhr.responseText); + this.type = Resource.TYPE.JSON; + } catch (e) { + this.abort('Error trying to parse loaded json: ' + e); + + return; + } + } + // if xml, parse into an xml document or div element + else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) { + try { + if (window.DOMParser) { + var domparser = new DOMParser(); + + this.data = domparser.parseFromString(xhr.responseText, 'text/xml'); + } else { + var div = document.createElement('div'); + + div.innerHTML = xhr.responseText; + + this.data = div; + } + + this.type = Resource.TYPE.XML; + } catch (e) { + this.abort('Error trying to parse loaded xml: ' + e); + + return; + } + } + // other types just return the response + else { + this.data = xhr.response || xhr.responseText; + } + } else { + this.abort('[' + xhr.status + '] ' + xhr.statusText + ': ' + xhr.responseURL); + + return; + } + + this.complete(); + }; + + /** + * Sets the `crossOrigin` property for this resource based on if the url + * for this resource is cross-origin. If crossOrigin was manually set, this + * function does nothing. + * + * @private + * @param {string} url - The url to test. + * @param {object} [loc=window.location] - The location object to test against. + * @return {string} The crossOrigin value to use (or empty string for none). + */ + + + Resource.prototype._determineCrossOrigin = function _determineCrossOrigin(url, loc) { + // data: and javascript: urls are considered same-origin + if (url.indexOf('data:') === 0) { + return ''; + } + + // default is window.location + loc = loc || window.location; + + if (!tempAnchor) { + tempAnchor = document.createElement('a'); + } + + // let the browser determine the full href for the url of this resource and then + // parse with the node url lib, we can't use the properties of the anchor element + // because they don't work in IE9 :( + tempAnchor.href = url; + url = (0, _parseUri2.default)(tempAnchor.href, { strictMode: true }); + + var samePort = !url.port && loc.port === '' || url.port === loc.port; + var protocol = url.protocol ? url.protocol + ':' : ''; + + // if cross origin + if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) { + return 'anonymous'; + } + + return ''; + }; + + /** + * Determines the responseType of an XHR request based on the extension of the + * resource being loaded. + * + * @private + * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use. + */ + + + Resource.prototype._determineXhrType = function _determineXhrType() { + return Resource._xhrTypeMap[this._getExtension()] || Resource.XHR_RESPONSE_TYPE.TEXT; + }; + + /** + * Determines the loadType of a resource based on the extension of the + * resource being loaded. + * + * @private + * @return {Resource.LOAD_TYPE} The loadType to use. + */ + + + Resource.prototype._determineLoadType = function _determineLoadType() { + return Resource._loadTypeMap[this._getExtension()] || Resource.LOAD_TYPE.XHR; + }; + + /** + * Extracts the extension (sans '.') of the file being loaded by the resource. + * + * @private + * @return {string} The extension. + */ + + + Resource.prototype._getExtension = function _getExtension() { + var url = this.url; + var ext = ''; + + if (this.isDataUrl) { + var slashIndex = url.indexOf('/'); + + ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex)); + } else { + var queryStart = url.indexOf('?'); + + if (queryStart !== -1) { + url = url.substring(0, queryStart); + } + + ext = url.substring(url.lastIndexOf('.') + 1); + } + + return ext.toLowerCase(); + }; + + /** + * Determines the mime type of an XHR request based on the responseType of + * resource being loaded. + * + * @private + * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for. + * @return {string} The mime type to use. + */ + + + Resource.prototype._getMimeFromXhrType = function _getMimeFromXhrType(type) { + switch (type) { + case Resource.XHR_RESPONSE_TYPE.BUFFER: + return 'application/octet-binary'; + + case Resource.XHR_RESPONSE_TYPE.BLOB: + return 'application/blob'; + + case Resource.XHR_RESPONSE_TYPE.DOCUMENT: + return 'application/xml'; + + case Resource.XHR_RESPONSE_TYPE.JSON: + return 'application/json'; + + case Resource.XHR_RESPONSE_TYPE.DEFAULT: + case Resource.XHR_RESPONSE_TYPE.TEXT: + /* falls through */ + default: + return 'text/plain'; + + } + }; + + _createClass(Resource, [{ + key: 'isDataUrl', + get: function get() { + return this._hasFlag(Resource.STATUS_FLAGS.DATA_URL); + } + + /** + * Describes if this resource has finished loading. Is true when the resource has completely + * loaded. + * + * @member {boolean} + * @readonly + */ + + }, { + key: 'isComplete', + get: function get() { + return this._hasFlag(Resource.STATUS_FLAGS.COMPLETE); + } + + /** + * Describes if this resource is currently loading. Is true when the resource starts loading, + * and is false again when complete. + * + * @member {boolean} + * @readonly + */ + + }, { + key: 'isLoading', + get: function get() { + return this._hasFlag(Resource.STATUS_FLAGS.LOADING); + } + }]); + + return Resource; +}(); + +/** + * The types of resources a resource could represent. + * + * @static + * @readonly + * @enum {number} + */ + + +exports.default = Resource; +Resource.STATUS_FLAGS = { + NONE: 0, + DATA_URL: 1 << 0, + COMPLETE: 1 << 1, + LOADING: 1 << 2 +}; + +/** + * The types of resources a resource could represent. + * + * @static + * @readonly + * @enum {number} + */ +Resource.TYPE = { + UNKNOWN: 0, + JSON: 1, + XML: 2, + IMAGE: 3, + AUDIO: 4, + VIDEO: 5, + TEXT: 6 +}; + +/** + * The types of loading a resource can use. + * + * @static + * @readonly + * @enum {number} + */ +Resource.LOAD_TYPE = { + /** Uses XMLHttpRequest to load the resource. */ + XHR: 1, + /** Uses an `Image` object to load the resource. */ + IMAGE: 2, + /** Uses an `Audio` object to load the resource. */ + AUDIO: 3, + /** Uses a `Video` object to load the resource. */ + VIDEO: 4 +}; + +/** + * The XHR ready states, used internally. + * + * @static + * @readonly + * @enum {string} + */ +Resource.XHR_RESPONSE_TYPE = { + /** string */ + DEFAULT: 'text', + /** ArrayBuffer */ + BUFFER: 'arraybuffer', + /** Blob */ + BLOB: 'blob', + /** Document */ + DOCUMENT: 'document', + /** Object */ + JSON: 'json', + /** String */ + TEXT: 'text' +}; + +Resource._loadTypeMap = { + // images + gif: Resource.LOAD_TYPE.IMAGE, + png: Resource.LOAD_TYPE.IMAGE, + bmp: Resource.LOAD_TYPE.IMAGE, + jpg: Resource.LOAD_TYPE.IMAGE, + jpeg: Resource.LOAD_TYPE.IMAGE, + tif: Resource.LOAD_TYPE.IMAGE, + tiff: Resource.LOAD_TYPE.IMAGE, + webp: Resource.LOAD_TYPE.IMAGE, + tga: Resource.LOAD_TYPE.IMAGE, + svg: Resource.LOAD_TYPE.IMAGE, + 'svg+xml': Resource.LOAD_TYPE.IMAGE, // for SVG data urls + + // audio + mp3: Resource.LOAD_TYPE.AUDIO, + ogg: Resource.LOAD_TYPE.AUDIO, + wav: Resource.LOAD_TYPE.AUDIO, + + // videos + mp4: Resource.LOAD_TYPE.VIDEO, + webm: Resource.LOAD_TYPE.VIDEO +}; + +Resource._xhrTypeMap = { + // xml + xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + html: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + + // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component. + // Since it is way less likely for people to be loading TypeScript files instead of Tiled files, + // this should probably be fine. + tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT, + + // images + gif: Resource.XHR_RESPONSE_TYPE.BLOB, + png: Resource.XHR_RESPONSE_TYPE.BLOB, + bmp: Resource.XHR_RESPONSE_TYPE.BLOB, + jpg: Resource.XHR_RESPONSE_TYPE.BLOB, + jpeg: Resource.XHR_RESPONSE_TYPE.BLOB, + tif: Resource.XHR_RESPONSE_TYPE.BLOB, + tiff: Resource.XHR_RESPONSE_TYPE.BLOB, + webp: Resource.XHR_RESPONSE_TYPE.BLOB, + tga: Resource.XHR_RESPONSE_TYPE.BLOB, + + // json + json: Resource.XHR_RESPONSE_TYPE.JSON, + + // text + text: Resource.XHR_RESPONSE_TYPE.TEXT, + txt: Resource.XHR_RESPONSE_TYPE.TEXT, + + // fonts + ttf: Resource.XHR_RESPONSE_TYPE.BUFFER, + otf: Resource.XHR_RESPONSE_TYPE.BUFFER +}; + +// We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif +Resource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='; + +/** + * Quick helper to set a value on one of the extension maps. Ensures there is no + * dot at the start of the extension. + * + * @ignore + * @param {object} map - The map to set on. + * @param {string} extname - The extension (or key) to set. + * @param {number} val - The value to set. + */ +function setExtMap(map, extname, val) { + if (extname && extname.indexOf('.') === 0) { + extname = extname.substring(1); + } + + if (!extname) { + return; + } + + map[extname] = val; +} + +/** + * Quick helper to get string xhr type. + * + * @ignore + * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check. + * @return {string} The type. + */ +function reqType(xhr) { + return xhr.toString().replace('object ', ''); +} +//# sourceMappingURL=Resource.js.map + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +module.exports.pointDistance = function (point1, point2) { + return Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2)); +}; + +module.exports.directionOfTravel = function (pointStart, pointEnd) { + let direction = ''; + + //positive means down + const rise = pointEnd.y - pointStart.y; + //positive means right + const run = pointEnd.x - pointStart.x; + + if (run < 1 && rise < 1) { + direction = 'top-left'; + } else if (run < 1 && rise > 1) { + direction = 'bottom-left'; + } else if (run > 1 && rise < 1) { + direction = 'top-right'; + } else if (run > 1 && rise > 1) { + direction = 'bottom-right'; + } + + if (run !== 0 && Math.abs(rise / run) < 0.3) { + if (run > 1) { + direction = 'right'; + } else { + direction = 'left'; + } + } + + return direction; +}; + +/***/ }), +/* 138 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pixi_js__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_pixi_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_pixi_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_gsap__ = __webpack_require__(140); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_gsap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_gsap__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_collection__ = __webpack_require__(208); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_collection___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_collection__); + + + + +class Character extends __WEBPACK_IMPORTED_MODULE_0_pixi_js__["extras"].AnimatedSprite { + /** + * Character Constructor + * @param {String} spriteId The leading id of this Character's resources in the spritesheet + * @param {String} spritesheet The object property to ask PIXI's resource loader for + * @param {{name:String, animationSpeed:Number}[]} states The states that can be found in the spritesheet for the + * given sprite id. + */ + constructor(spriteId, spritesheet, states) { + const gameTextures = __WEBPACK_IMPORTED_MODULE_0_pixi_js__["loader"].resources[spritesheet].textures; + for (const textureKey in gameTextures) { + if (!gameTextures.hasOwnProperty(textureKey) || textureKey.indexOf(spriteId) === -1) { + continue; + } + + const parts = textureKey.split('/'); + parts.length -= 1; //truncate to remove media file + + const state = parts.join('/').replace(spriteId + '/', ''); + + // Only add textures if the state is supported by the class + const stateObj = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_lodash_collection__["find"])(states, { name: state }); + console.dir(stateObj); + if (!stateObj) { + continue; + } + + if (stateObj.hasOwnProperty('textures')) { + stateObj.textures.push(gameTextures[textureKey]); + } else { + Object.defineProperty(stateObj, 'textures', { + value: [gameTextures[textureKey]], + writable: true, + enumerable: true, + configurable: true + }); + } + } + + super(states[0].textures); + this.states = states; + this.animationSpeed = this.states[0].animationSpeed; + this.timeline = new __WEBPACK_IMPORTED_MODULE_1_gsap__["TimelineLite"]({ + autoRemoveChildren: true + }); + return this; + } + + /** + * stopAndClearTimeline + * Helper method that stops any existing animation where it is, and removes all other animations + * that are scheduled to run in the Character's timeline. + * @returns {Character} + */ + stopAndClearTimeline() { + this.timeline.pause(); + const timelineItem = this.timeline.getChildren(); + for (let i = 0; i < timelineItem.length; i++) { + timelineItem[i].kill(); + } + this.timeline.play(); + return this; + } + + /** + * isActive + * Helper method that determines whether the Character's timeline is active + * @returns {Boolean} + */ + isActive() { + return this.timeline.isActive(); + } + + /** + * addToTimeline + * Adds any valid item to the timeline, typically this will be a function or a tween + * @param {Function|PIXI.Tween} item + * @returns {Character} + */ + addToTimeline(item) { + this.timeline.add(item); + return this; + } + + /** + * state - setter + * Helper method that sets the state on the character and adjusts the object's texture if possible + * @param {String} value Name of the state to set on the character which should match a texture + * specified in the spritesheet + * @throws {Error} In order for a state to be set, a texture must be specified in the spritesheet + */ + set state(value) { + const stateObj = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_lodash_collection__["find"])(this.states, { name: value }); + if (!stateObj) { + throw new Error('The requested state (' + value + ') is not availble for this Character.'); + } + this.stateVal = value; + this._textures = stateObj.textures; + this.animationSpeed = stateObj.animationSpeed; + this.loop = stateObj.hasOwnProperty('loop') ? stateObj.loop : true; + this.play(); + } + + /** + * state - get + * Helper methods that returns the existin + * @returns {String} + */ + get state() { + return this.stateVal ? this.stateVal : ''; + } + +} + +/* harmony default export */ __webpack_exports__["a"] = Character; + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = earcut; + +function earcut(data, holeIndices, dim) { + + dim = dim || 2; + + var hasHoles = holeIndices && holeIndices.length, + outerLen = hasHoles ? holeIndices[0] * dim : data.length, + outerNode = linkedList(data, 0, outerLen, dim, true), + triangles = []; + + if (!outerNode) return triangles; + + var minX, minY, maxX, maxY, x, y, size; + + if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); + + // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox + if (data.length > 80 * dim) { + minX = maxX = data[0]; + minY = maxY = data[1]; + + for (var i = dim; i < outerLen; i += dim) { + x = data[i]; + y = data[i + 1]; + if (x < minX) minX = x; + if (y < minY) minY = y; + if (x > maxX) maxX = x; + if (y > maxY) maxY = y; + } + + // minX, minY and size are later used to transform coords into integers for z-order calculation + size = Math.max(maxX - minX, maxY - minY); + } + + earcutLinked(outerNode, triangles, dim, minX, minY, size); + + return triangles; +} + +// create a circular doubly linked list from polygon points in the specified winding order +function linkedList(data, start, end, dim, clockwise) { + var i, last; + + if (clockwise === (signedArea(data, start, end, dim) > 0)) { + for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last); + } else { + for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last); + } + + if (last && equals(last, last.next)) { + removeNode(last); + last = last.next; + } + + return last; +} + +// eliminate colinear or duplicate points +function filterPoints(start, end) { + if (!start) return start; + if (!end) end = start; + + var p = start, + again; + do { + again = false; + + if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { + removeNode(p); + p = end = p.prev; + if (p === p.next) return null; + again = true; + + } else { + p = p.next; + } + } while (again || p !== end); + + return end; +} + +// main ear slicing loop which triangulates a polygon (given as a linked list) +function earcutLinked(ear, triangles, dim, minX, minY, size, pass) { + if (!ear) return; + + // interlink polygon nodes in z-order + if (!pass && size) indexCurve(ear, minX, minY, size); + + var stop = ear, + prev, next; + + // iterate through ears, slicing them one by one + while (ear.prev !== ear.next) { + prev = ear.prev; + next = ear.next; + + if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) { + // cut off the triangle + triangles.push(prev.i / dim); + triangles.push(ear.i / dim); + triangles.push(next.i / dim); + + removeNode(ear); + + // skipping the next vertice leads to less sliver triangles + ear = next.next; + stop = next.next; + + continue; + } + + ear = next; + + // if we looped through the whole remaining polygon and can't find any more ears + if (ear === stop) { + // try filtering points and slicing again + if (!pass) { + earcutLinked(filterPoints(ear), triangles, dim, minX, minY, size, 1); + + // if this didn't work, try curing all small self-intersections locally + } else if (pass === 1) { + ear = cureLocalIntersections(ear, triangles, dim); + earcutLinked(ear, triangles, dim, minX, minY, size, 2); + + // as a last resort, try splitting the remaining polygon into two + } else if (pass === 2) { + splitEarcut(ear, triangles, dim, minX, minY, size); + } + + break; + } + } +} + +// check whether a polygon node forms a valid ear with adjacent nodes +function isEar(ear) { + var a = ear.prev, + b = ear, + c = ear.next; + + if (area(a, b, c) >= 0) return false; // reflex, can't be an ear + + // now make sure we don't have other points inside the potential ear + var p = ear.next.next; + + while (p !== ear.prev) { + if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.next; + } + + return true; +} + +function isEarHashed(ear, minX, minY, size) { + var a = ear.prev, + b = ear, + c = ear.next; + + if (area(a, b, c) >= 0) return false; // reflex, can't be an ear + + // triangle bbox; min & max are calculated like this for speed + var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x), + minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y), + maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x), + maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y); + + // z-order range for the current triangle bbox; + var minZ = zOrder(minTX, minTY, minX, minY, size), + maxZ = zOrder(maxTX, maxTY, minX, minY, size); + + // first look for points inside the triangle in increasing z-order + var p = ear.nextZ; + + while (p && p.z <= maxZ) { + if (p !== ear.prev && p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.nextZ; + } + + // then look for points in decreasing z-order + p = ear.prevZ; + + while (p && p.z >= minZ) { + if (p !== ear.prev && p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.prevZ; + } + + return true; +} + +// go through all polygon nodes and cure small local self-intersections +function cureLocalIntersections(start, triangles, dim) { + var p = start; + do { + var a = p.prev, + b = p.next.next; + + if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { + + triangles.push(a.i / dim); + triangles.push(p.i / dim); + triangles.push(b.i / dim); + + // remove two nodes involved + removeNode(p); + removeNode(p.next); + + p = start = b; + } + p = p.next; + } while (p !== start); + + return p; +} + +// try splitting polygon into two and triangulate them independently +function splitEarcut(start, triangles, dim, minX, minY, size) { + // look for a valid diagonal that divides the polygon into two + var a = start; + do { + var b = a.next.next; + while (b !== a.prev) { + if (a.i !== b.i && isValidDiagonal(a, b)) { + // split the polygon in two by the diagonal + var c = splitPolygon(a, b); + + // filter colinear points around the cuts + a = filterPoints(a, a.next); + c = filterPoints(c, c.next); + + // run earcut on each half + earcutLinked(a, triangles, dim, minX, minY, size); + earcutLinked(c, triangles, dim, minX, minY, size); + return; + } + b = b.next; + } + a = a.next; + } while (a !== start); +} + +// link every hole into the outer loop, producing a single-ring polygon without holes +function eliminateHoles(data, holeIndices, outerNode, dim) { + var queue = [], + i, len, start, end, list; + + for (i = 0, len = holeIndices.length; i < len; i++) { + start = holeIndices[i] * dim; + end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + list = linkedList(data, start, end, dim, false); + if (list === list.next) list.steiner = true; + queue.push(getLeftmost(list)); + } + + queue.sort(compareX); + + // process holes from left to right + for (i = 0; i < queue.length; i++) { + eliminateHole(queue[i], outerNode); + outerNode = filterPoints(outerNode, outerNode.next); + } + + return outerNode; +} + +function compareX(a, b) { + return a.x - b.x; +} + +// find a bridge between vertices that connects hole with an outer ring and and link it +function eliminateHole(hole, outerNode) { + outerNode = findHoleBridge(hole, outerNode); + if (outerNode) { + var b = splitPolygon(outerNode, hole); + filterPoints(b, b.next); + } +} + +// David Eberly's algorithm for finding a bridge between hole and outer polygon +function findHoleBridge(hole, outerNode) { + var p = outerNode, + hx = hole.x, + hy = hole.y, + qx = -Infinity, + m; + + // find a segment intersected by a ray from the hole's leftmost point to the left; + // segment's endpoint with lesser x will be potential connection point + do { + if (hy <= p.y && hy >= p.next.y) { + var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); + if (x <= hx && x > qx) { + qx = x; + if (x === hx) { + if (hy === p.y) return p; + if (hy === p.next.y) return p.next; + } + m = p.x < p.next.x ? p : p.next; + } + } + p = p.next; + } while (p !== outerNode); + + if (!m) return null; + + if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint + + // look for points inside the triangle of hole point, segment intersection and endpoint; + // if there are no points found, we have a valid connection; + // otherwise choose the point of the minimum angle with the ray as connection point + + var stop = m, + mx = m.x, + my = m.y, + tanMin = Infinity, + tan; + + p = m.next; + + while (p !== stop) { + if (hx >= p.x && p.x >= mx && + pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { + + tan = Math.abs(hy - p.y) / (hx - p.x); // tangential + + if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) { + m = p; + tanMin = tan; + } + } + + p = p.next; + } + + return m; +} + +// interlink polygon nodes in z-order +function indexCurve(start, minX, minY, size) { + var p = start; + do { + if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size); + p.prevZ = p.prev; + p.nextZ = p.next; + p = p.next; + } while (p !== start); + + p.prevZ.nextZ = null; + p.prevZ = null; + + sortLinked(p); +} + +// Simon Tatham's linked list merge sort algorithm +// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html +function sortLinked(list) { + var i, p, q, e, tail, numMerges, pSize, qSize, + inSize = 1; + + do { + p = list; + list = null; + tail = null; + numMerges = 0; + + while (p) { + numMerges++; + q = p; + pSize = 0; + for (i = 0; i < inSize; i++) { + pSize++; + q = q.nextZ; + if (!q) break; + } + + qSize = inSize; + + while (pSize > 0 || (qSize > 0 && q)) { + + if (pSize === 0) { + e = q; + q = q.nextZ; + qSize--; + } else if (qSize === 0 || !q) { + e = p; + p = p.nextZ; + pSize--; + } else if (p.z <= q.z) { + e = p; + p = p.nextZ; + pSize--; + } else { + e = q; + q = q.nextZ; + qSize--; + } + + if (tail) tail.nextZ = e; + else list = e; + + e.prevZ = tail; + tail = e; + } + + p = q; + } + + tail.nextZ = null; + inSize *= 2; + + } while (numMerges > 1); + + return list; +} + +// z-order of a point given coords and size of the data bounding box +function zOrder(x, y, minX, minY, size) { + // coords are transformed into non-negative 15-bit integer range + x = 32767 * (x - minX) / size; + y = 32767 * (y - minY) / size; + + x = (x | (x << 8)) & 0x00FF00FF; + x = (x | (x << 4)) & 0x0F0F0F0F; + x = (x | (x << 2)) & 0x33333333; + x = (x | (x << 1)) & 0x55555555; + + y = (y | (y << 8)) & 0x00FF00FF; + y = (y | (y << 4)) & 0x0F0F0F0F; + y = (y | (y << 2)) & 0x33333333; + y = (y | (y << 1)) & 0x55555555; + + return x | (y << 1); +} + +// find the leftmost node of a polygon ring +function getLeftmost(start) { + var p = start, + leftmost = start; + do { + if (p.x < leftmost.x) leftmost = p; + p = p.next; + } while (p !== start); + + return leftmost; +} + +// check if a point lies within a convex triangle +function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { + return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && + (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && + (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0; +} + +// check if a diagonal between two polygon nodes is valid (lies in polygon interior) +function isValidDiagonal(a, b) { + return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && + locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b); +} + +// signed area of a triangle +function area(p, q, r) { + return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); +} + +// check if two points are equal +function equals(p1, p2) { + return p1.x === p2.x && p1.y === p2.y; +} + +// check if two segments intersect +function intersects(p1, q1, p2, q2) { + if ((equals(p1, q1) && equals(p2, q2)) || + (equals(p1, q2) && equals(p2, q1))) return true; + return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && + area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0; +} + +// check if a polygon diagonal intersects any polygon segments +function intersectsPolygon(a, b) { + var p = a; + do { + if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && + intersects(p, p.next, a, b)) return true; + p = p.next; + } while (p !== a); + + return false; +} + +// check if a polygon diagonal is locally inside the polygon +function locallyInside(a, b) { + return area(a.prev, a, a.next) < 0 ? + area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : + area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; +} + +// check if the middle point of a polygon diagonal is inside the polygon +function middleInside(a, b) { + var p = a, + inside = false, + px = (a.x + b.x) / 2, + py = (a.y + b.y) / 2; + do { + if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) + inside = !inside; + p = p.next; + } while (p !== a); + + return inside; +} + +// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; +// if one belongs to the outer ring and another to a hole, it merges it into a single ring +function splitPolygon(a, b) { + var a2 = new Node(a.i, a.x, a.y), + b2 = new Node(b.i, b.x, b.y), + an = a.next, + bp = b.prev; + + a.next = b; + b.prev = a; + + a2.next = an; + an.prev = a2; + + b2.next = a2; + a2.prev = b2; + + bp.next = b2; + b2.prev = bp; + + return b2; +} + +// create a node and optionally link it with previous one (in a circular doubly linked list) +function insertNode(i, x, y, last) { + var p = new Node(i, x, y); + + if (!last) { + p.prev = p; + p.next = p; + + } else { + p.next = last.next; + p.prev = last; + last.next.prev = p; + last.next = p; + } + return p; +} + +function removeNode(p) { + p.next.prev = p.prev; + p.prev.next = p.next; + + if (p.prevZ) p.prevZ.nextZ = p.nextZ; + if (p.nextZ) p.nextZ.prevZ = p.prevZ; +} + +function Node(i, x, y) { + // vertice index in coordinates array + this.i = i; + + // vertex coordinates + this.x = x; + this.y = y; + + // previous and next vertice nodes in a polygon ring + this.prev = null; + this.next = null; + + // z-order curve value + this.z = null; + + // previous and next nodes in z-order + this.prevZ = null; + this.nextZ = null; + + // indicates whether this is a steiner point + this.steiner = false; +} + +// return a percentage difference between the polygon area and its triangulation area; +// used to verify correctness of triangulation +earcut.deviation = function (data, holeIndices, dim, triangles) { + var hasHoles = holeIndices && holeIndices.length; + var outerLen = hasHoles ? holeIndices[0] * dim : data.length; + + var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); + if (hasHoles) { + for (var i = 0, len = holeIndices.length; i < len; i++) { + var start = holeIndices[i] * dim; + var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + polygonArea -= Math.abs(signedArea(data, start, end, dim)); + } + } + + var trianglesArea = 0; + for (i = 0; i < triangles.length; i += 3) { + var a = triangles[i] * dim; + var b = triangles[i + 1] * dim; + var c = triangles[i + 2] * dim; + trianglesArea += Math.abs( + (data[a] - data[c]) * (data[b + 1] - data[a + 1]) - + (data[a] - data[b]) * (data[c + 1] - data[a + 1])); + } + + return polygonArea === 0 && trianglesArea === 0 ? 0 : + Math.abs((trianglesArea - polygonArea) / polygonArea); +}; + +function signedArea(data, start, end, dim) { + var sum = 0; + for (var i = start, j = end - dim; i < end; i += dim) { + sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); + j = i; + } + return sum; +} + +// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts +earcut.flatten = function (data) { + var dim = data[0][0].length, + result = {vertices: [], holes: [], dimensions: dim}, + holeIndex = 0; + + for (var i = 0; i < data.length; i++) { + for (var j = 0; j < data[i].length; j++) { + for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]); + } + if (i > 0) { + holeIndex += data[i - 1].length; + result.holes.push(holeIndex); + } + } + return result; +}; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * VERSION: 1.19.1 + * DATE: 2017-01-17 + * UPDATES AND DOCS AT: http://greensock.com + * + * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin + * + * @license Copyright (c) 2008-2017, GreenSock. All rights reserved. + * This work is subject to the terms at http://greensock.com/standard-license or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + **/ +var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node +(_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { + + "use strict"; + + _gsScope._gsDefine("TweenMax", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i]) : val[i % val.length]; + } + delete vars.cycle; + }, + TweenMax = function(target, duration, vars) { + TweenLite.call(this, target, duration, vars); + this._cycle = 0; + this._yoyo = (this.vars.yoyo === true); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. + this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _tinyNum = 0.0000000001, + TweenLiteInternals = TweenLite._internals, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), + _blankArray = []; + + TweenMax.version = "1.19.1"; + p.constructor = TweenMax; + p.kill()._gc = false; + TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; + TweenMax.getTweensOf = TweenLite.getTweensOf; + TweenMax.lagSmoothing = TweenLite.lagSmoothing; + TweenMax.ticker = TweenLite.ticker; + TweenMax.render = TweenLite.render; + + p.invalidate = function() { + this._yoyo = (this.vars.yoyo === true); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TweenLite.prototype.invalidate.call(this); + }; + + p.updateTo = function(vars, resetDuration) { + var curRatio = this.ratio, + immediate = this.vars.immediateRender || vars.immediateRender, + p; + if (resetDuration && this._startTime < this._timeline._time) { + this._startTime = this._timeline._time; + this._uncache(false); + if (this._gc) { + this._enabled(true, false); + } else { + this._timeline.insert(this, this._startTime - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. + } + } + for (p in vars) { + this.vars[p] = vars[p]; + } + if (this._initted || immediate) { + if (resetDuration) { + this._initted = false; + if (immediate) { + this.render(0, true, true); + } + } else { + if (this._gc) { + this._enabled(true, false); + } + if (this._notifyPluginsOfEnabled && this._firstPT) { + TweenLite._onPluginEvent("_onDisable", this); //in case a plugin like MotionBlur must perform some cleanup tasks + } + if (this._time / this._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards. + var prevTime = this._totalTime; + this.render(0, true, false); + this._initted = false; + this.render(prevTime, true, false); + } else { + this._initted = false; + this._init(); + if (this._time > 0 || immediate) { + var inv = 1 / (1 - curRatio), + pt = this._firstPT, endValue; + while (pt) { + endValue = pt.s + pt.c; + pt.c *= inv; + pt.s = endValue - pt.c; + pt = pt._next; + } + } + } + } + } + return this; + }; + + p.render = function(time, suppressEvents, force) { + if (!this._initted) if (this._duration === 0 && this.vars.repeat) { //zero duration tweens that render immediately have render() called from TweenLite's constructor, before TweenMax's constructor has finished setting _repeat, _repeatDelay, and _yoyo which are critical in determining totalDuration() so we need to call invalidate() which is a low-kb way to get those set properly. + this.invalidate(); + } + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + prevTime = this._time, + prevTotalTime = this._totalTime, + prevCycle = this._cycle, + duration = this._duration, + prevRawPrevTime = this._rawPrevTime, + isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime; + if (time >= totalDur - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts. + this._totalTime = totalDur; + this._cycle = this._repeat; + if (this._yoyo && (this._cycle & 1) !== 0) { + this._time = 0; + this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0; + } else { + this._time = duration; + this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1; + } + if (!this._reversed) { + isComplete = true; + callback = "onComplete"; + force = (force || this._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + } + if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. + time = 0; + } + if (prevRawPrevTime < 0 || (time <= 0 && time >= -0.0000001) || (prevRawPrevTime === _tinyNum && this.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. + force = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + + } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0. + this._totalTime = this._time = this._cycle = 0; + this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0; + if (prevTotalTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. + if (prevRawPrevTime >= 0) { + force = true; + } + this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + } + } + if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. + force = true; + } + } else { + this._totalTime = this._time = time; + if (this._repeat !== 0) { + cycleDuration = duration + this._repeatDelay; + this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!) + if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration && prevTotalTime <= time) { + this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + this._time = this._totalTime - (this._cycle * cycleDuration); + if (this._yoyo) if ((this._cycle & 1) !== 0) { + this._time = duration - this._time; + } + if (this._time > duration) { + this._time = duration; + } else if (this._time < 0) { + this._time = 0; + } + } + + if (this._easeType) { + r = this._time / duration; + type = this._easeType; + pow = this._easePower; + if (type === 1 || (type === 3 && r >= 0.5)) { + r = 1 - r; + } + if (type === 3) { + r *= 2; + } + if (pow === 1) { + r *= r; + } else if (pow === 2) { + r *= r * r; + } else if (pow === 3) { + r *= r * r * r; + } else if (pow === 4) { + r *= r * r * r * r; + } + + if (type === 1) { + this.ratio = 1 - r; + } else if (type === 2) { + this.ratio = r; + } else if (this._time / duration < 0.5) { + this.ratio = r / 2; + } else { + this.ratio = 1 - (r / 2); + } + + } else { + this.ratio = this._ease.getRatio(this._time / duration); + } + + } + + if (prevTime === this._time && !force && prevCycle === this._cycle) { + if (prevTotalTime !== this._totalTime) if (this._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + this._callback("onUpdate"); + } + return; + } else if (!this._initted) { + this._init(); + if (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. + return; + } else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) { //we stick it in the queue for rendering at the very end of the tick - this is a performance optimization because browsers invalidate styles and force a recalculation if you read, write, and then read style data (so it's better to read/read/read/write/write/write than read/write/read/write/read/write). The down side, of course, is that usually you WANT things to render immediately because you may have code running right after that which depends on the change. Like imagine running TweenLite.set(...) and then immediately after that, creating a nother tween that animates the same property to another value; the starting values of that 2nd tween wouldn't be accurate if lazy is true. + this._time = prevTime; + this._totalTime = prevTotalTime; + this._rawPrevTime = prevRawPrevTime; + this._cycle = prevCycle; + TweenLiteInternals.lazyTweens.push(this); + this._lazy = [time, suppressEvents]; + return; + } + //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. + if (this._time && !isComplete) { + this.ratio = this._ease.getRatio(this._time / duration); + } else if (isComplete && this._ease._calcEnd) { + this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1); + } + } + if (this._lazy !== false) { + this._lazy = false; + } + + if (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) { + this._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. + } + if (prevTotalTime === 0) { + if (this._initted === 2 && time > 0) { + //this.invalidate(); + this._init(); //will just apply overwriting since _initted of (2) means it was a from() tween that had immediateRender:true + } + if (this._startAt) { + if (time >= 0) { + this._startAt.render(time, suppressEvents, force); + } else if (!callback) { + callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. + } + } + if (this.vars.onStart) if (this._totalTime !== 0 || duration === 0) if (!suppressEvents) { + this._callback("onStart"); + } + } + + pt = this._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](pt.c * this.ratio + pt.s); + } else { + pt.t[pt.p] = pt.c * this.ratio + pt.s; + } + pt = pt._next; + } + + if (this._onUpdate) { + if (time < 0) if (this._startAt && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + this._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. + } + if (!suppressEvents) if (this._totalTime !== prevTotalTime || callback) { + this._callback("onUpdate"); + } + } + if (this._cycle !== prevCycle) if (!suppressEvents) if (!this._gc) if (this.vars.onRepeat) { + this._callback("onRepeat"); + } + if (callback) if (!this._gc || force) { //check gc because there's a chance that kill() could be called in an onUpdate + if (time < 0 && this._startAt && !this._onUpdate && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. + this._startAt.render(time, suppressEvents, force); + } + if (isComplete) { + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents && this.vars[callback]) { + this._callback(callback); + } + if (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless. + this._rawPrevTime = 0; + } + } + }; + +//---- STATIC FUNCTIONS ----------------------------------------------------------------------------------------------------------- + + TweenMax.to = function(target, duration, vars) { + return new TweenMax(target, duration, vars); + }; + + TweenMax.from = function(target, duration, vars) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return new TweenMax(target, duration, vars); + }; + + TweenMax.fromTo = function(target, duration, fromVars, toVars) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return new TweenMax(target, duration, toVars); + }; + + TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + stagger = stagger || 0; + var delay = 0, + a = [], + finalComplete = function() { + if (vars.onComplete) { + vars.onComplete.apply(vars.onCompleteScope || this, arguments); + } + onCompleteAll.apply(onCompleteAllScope || vars.callbackScope || this, onCompleteAllParams || _blankArray); + }, + cycle = vars.cycle, + fromCycle = (vars.startAt && vars.startAt.cycle), + l, copy, i, p; + if (!_isArray(targets)) { + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + if (_isSelector(targets)) { + targets = _slice(targets); + } + } + targets = targets || []; + if (stagger < 0) { + targets = _slice(targets); + targets.reverse(); + stagger *= -1; + } + l = targets.length - 1; + for (i = 0; i <= l; i++) { + copy = {}; + for (p in vars) { + copy[p] = vars[p]; + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + if (fromCycle) { + fromCycle = copy.startAt = {}; + for (p in vars.startAt) { + fromCycle[p] = vars.startAt[p]; + } + _applyCycle(copy.startAt, targets, i); + } + copy.delay = delay + (copy.delay || 0); + if (i === l && onCompleteAll) { + copy.onComplete = finalComplete; + } + a[i] = new TweenMax(targets[i], duration, copy); + delay += stagger; + } + return a; + }; + + TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.runBackwards = true; + vars.immediateRender = (vars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) { + return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, useFrames:useFrames, overwrite:0}); + }; + + TweenMax.set = function(target, vars) { + return new TweenMax(target, 0, vars); + }; + + TweenMax.isTweening = function(target) { + return (TweenLite.getTweensOf(target, true).length > 0); + }; + + var _getChildrenOf = function(timeline, includeTimelines) { + var a = [], + cnt = 0, + tween = timeline._first; + while (tween) { + if (tween instanceof TweenLite) { + a[cnt++] = tween; + } else { + if (includeTimelines) { + a[cnt++] = tween; + } + a = a.concat(_getChildrenOf(tween, includeTimelines)); + cnt = a.length; + } + tween = tween._next; + } + return a; + }, + getAllTweens = TweenMax.getAllTweens = function(includeTimelines) { + return _getChildrenOf(Animation._rootTimeline, includeTimelines).concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) ); + }; + + TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) { + if (tweens == null) { + tweens = true; + } + if (delayedCalls == null) { + delayedCalls = true; + } + var a = getAllTweens((timelines != false)), + l = a.length, + allTrue = (tweens && delayedCalls && timelines), + isDC, tween, i; + for (i = 0; i < l; i++) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + if (complete) { + tween.totalTime(tween._reversed ? 0 : tween.totalDuration()); + } else { + tween._enabled(false, false); + } + } + } + }; + + TweenMax.killChildTweensOf = function(parent, complete) { + if (parent == null) { + return; + } + var tl = TweenLiteInternals.tweenLookup, + a, curParent, p, i, l; + if (typeof(parent) === "string") { + parent = TweenLite.selector(parent) || parent; + } + if (_isSelector(parent)) { + parent = _slice(parent); + } + if (_isArray(parent)) { + i = parent.length; + while (--i > -1) { + TweenMax.killChildTweensOf(parent[i], complete); + } + return; + } + a = []; + for (p in tl) { + curParent = tl[p].target.parentNode; + while (curParent) { + if (curParent === parent) { + a = a.concat(tl[p].tweens); + } + curParent = curParent.parentNode; + } + } + l = a.length; + for (i = 0; i < l; i++) { + if (complete) { + a[i].totalTime(a[i].totalDuration()); + } + a[i]._enabled(false, false); + } + }; + + var _changePause = function(pause, tweens, delayedCalls, timelines) { + tweens = (tweens !== false); + delayedCalls = (delayedCalls !== false); + timelines = (timelines !== false); + var a = getAllTweens(timelines), + allTrue = (tweens && delayedCalls && timelines), + i = a.length, + isDC, tween; + while (--i > -1) { + tween = a[i]; + if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { + tween.paused(pause); + } + } + }; + + TweenMax.pauseAll = function(tweens, delayedCalls, timelines) { + _changePause(true, tweens, delayedCalls, timelines); + }; + + TweenMax.resumeAll = function(tweens, delayedCalls, timelines) { + _changePause(false, tweens, delayedCalls, timelines); + }; + + TweenMax.globalTimeScale = function(value) { + var tl = Animation._rootTimeline, + t = TweenLite.ticker.time; + if (!arguments.length) { + return tl._timeScale; + } + value = value || _tinyNum; //can't allow zero because it'll throw the math off + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl = Animation._rootFramesTimeline; + t = TweenLite.ticker.frame; + tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); + tl._timeScale = Animation._rootTimeline._timeScale = value; + return value; + }; + + +//---- GETTERS / SETTERS ---------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + if (value > this._duration) { + value = this._duration; + } + if (this._yoyo && (this._cycle & 1) !== 0) { + value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay)); + } else if (this._repeat !== 0) { + value += this._cycle * (this._duration + this._repeatDelay); + } + return this.totalTime(value, suppressEvents); + }; + + p.duration = function(value) { + if (!arguments.length) { + return this._duration; //don't set _dirty = false because there could be repeats that haven't been factored into the _totalDuration yet. Otherwise, if you create a repeated TweenMax and then immediately check its duration(), it would cache the value and the totalDuration would not be correct, thus repeats wouldn't take effect. + } + return Animation.prototype.duration.call(this, value); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + //instead of Infinity, we use 999999999999 so that we can accommodate reverses + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + this._dirty = false; + } + return this._totalDuration; + } + return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) ); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + + return TweenMax; + + }, true); + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineLite + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { + + var TimelineLite = function(vars) { + SimpleTimeline.call(this, vars); + this._labels = {}; + this.autoRemoveChildren = (this.vars.autoRemoveChildren === true); + this.smoothChildTiming = (this.vars.smoothChildTiming === true); + this._sortChildren = true; + this._onUpdate = this.vars.onUpdate; + var v = this.vars, + val, p; + for (p in v) { + val = v[p]; + if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { + v[p] = this._swapSelfInParams(val); + } + } + if (_isArray(v.tweens)) { + this.add(v.tweens, 0, v.align, v.stagger); + } + }, + _tinyNum = 0.0000000001, + TweenLiteInternals = TweenLite._internals, + _internals = TimelineLite._internals = {}, + _isSelector = TweenLiteInternals.isSelector, + _isArray = TweenLiteInternals.isArray, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _copy = function(vars) { + var copy = {}, p; + for (p in vars) { + copy[p] = vars[p]; + } + return copy; + }, + _applyCycle = function(vars, targets, i) { + var alt = vars.cycle, + p, val; + for (p in alt) { + val = alt[p]; + vars[p] = (typeof(val) === "function") ? val(i, targets[i]) : val[i % val.length]; + } + delete vars.cycle; + }, + _pauseCallback = _internals.pauseCallback = function() {}, + _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])); + return b; + }, + p = TimelineLite.prototype = new SimpleTimeline(); + + TimelineLite.version = "1.19.1"; + p.constructor = TimelineLite; + p.kill()._gc = p._forcingPlayhead = p._hasPause = false; + + /* might use later... + //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. + function localToGlobal(time, animation) { + while (animation) { + time = (time / animation._timeScale) + animation._startTime; + animation = animation.timeline; + } + return time; + } + + //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales + function globalToLocal(time, animation) { + var scale = 1; + time -= localToGlobal(0, animation); + while (animation) { + scale *= animation._timeScale; + animation = animation.timeline; + } + return time * scale; + } + */ + + p.to = function(target, duration, vars, position) { + var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; + return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); + }; + + p.from = function(target, duration, vars, position) { + return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, vars), position); + }; + + p.fromTo = function(target, duration, fromVars, toVars, position) { + var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; + return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); + }; + + p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), + cycle = vars.cycle, + copy, i; + if (typeof(targets) === "string") { + targets = TweenLite.selector(targets) || targets; + } + targets = targets || []; + if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array. + targets = _slice(targets); + } + stagger = stagger || 0; + if (stagger < 0) { + targets = _slice(targets); + targets.reverse(); + stagger *= -1; + } + for (i = 0; i < targets.length; i++) { + copy = _copy(vars); + if (copy.startAt) { + copy.startAt = _copy(copy.startAt); + if (copy.startAt.cycle) { + _applyCycle(copy.startAt, targets, i); + } + } + if (cycle) { + _applyCycle(copy, targets, i); + if (copy.duration != null) { + duration = copy.duration; + delete copy.duration; + } + } + tl.to(targets[i], duration, copy, i * stagger); + } + return this.add(tl, position); + }; + + p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + vars.immediateRender = (vars.immediateRender != false); + vars.runBackwards = true; + return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { + toVars.startAt = fromVars; + toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); + return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); + }; + + p.call = function(callback, params, scope, position) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.set = function(target, vars, position) { + position = this._parseTimeOrLabel(position, 0, true); + if (vars.immediateRender == null) { + vars.immediateRender = (position === this._time && !this._paused); + } + return this.add( new TweenLite(target, 0, vars), position); + }; + + TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { + vars = vars || {}; + if (vars.smoothChildTiming == null) { + vars.smoothChildTiming = true; + } + var tl = new TimelineLite(vars), + root = tl._timeline, + tween, next; + if (ignoreDelayedCalls == null) { + ignoreDelayedCalls = true; + } + root._remove(tl, true); + tl._startTime = 0; + tl._rawPrevTime = tl._time = tl._totalTime = root._time; + tween = root._first; + while (tween) { + next = tween._next; + if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { + tl.add(tween, tween._startTime - tween._delay); + } + tween = next; + } + root.add(tl, 0); + return tl; + }; + + p.add = function(value, position, align, stagger) { + var curTime, l, i, child, tl, beforeRawTime; + if (typeof(position) !== "number") { + position = this._parseTimeOrLabel(position, 0, true, value); + } + if (!(value instanceof Animation)) { + if ((value instanceof Array) || (value && value.push && _isArray(value))) { + align = align || "normal"; + stagger = stagger || 0; + curTime = position; + l = value.length; + for (i = 0; i < l; i++) { + if (_isArray(child = value[i])) { + child = new TimelineLite({tweens:child}); + } + this.add(child, curTime); + if (typeof(child) !== "string" && typeof(child) !== "function") { + if (align === "sequence") { + curTime = child._startTime + (child.totalDuration() / child._timeScale); + } else if (align === "start") { + child._startTime -= child.delay(); + } + } + curTime += stagger; + } + return this._uncache(true); + } else if (typeof(value) === "string") { + return this.addLabel(value, position); + } else if (typeof(value) === "function") { + value = TweenLite.delayedCall(0, value); + } else { + throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); + } + } + + SimpleTimeline.prototype.add.call(this, value, position); + + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. + if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) { + //in case any of the ancestors had completed but should now be enabled... + tl = this; + beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. + while (tl._timeline) { + if (beforeRawTime && tl._timeline.smoothChildTiming) { + tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. + } else if (tl._gc) { + tl._enabled(true, false); + } + tl = tl._timeline; + } + } + + return this; + }; + + p.remove = function(value) { + if (value instanceof Animation) { + this._remove(value, false); + var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. + value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. + return this; + } else if (value instanceof Array || (value && value.push && _isArray(value))) { + var i = value.length; + while (--i > -1) { + this.remove(value[i]); + } + return this; + } else if (typeof(value) === "string") { + return this.removeLabel(value); + } + return this.kill(null, value); + }; + + p._remove = function(tween, skipDisable) { + SimpleTimeline.prototype._remove.call(this, tween, skipDisable); + var last = this._last; + if (!last) { + this._time = this._totalTime = this._duration = this._totalDuration = 0; + } else if (this._time > this.duration()) { + this._time = this._duration; + this._totalTime = this._totalDuration; + } + return this; + }; + + p.append = function(value, offsetOrLabel) { + return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); + }; + + p.insert = p.insertMultiple = function(value, position, align, stagger) { + return this.add(value, position || 0, align, stagger); + }; + + p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { + return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); + }; + + p.addLabel = function(label, position) { + this._labels[label] = this._parseTimeOrLabel(position); + return this; + }; + + p.addPause = function(position, callback, params, scope) { + var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); + t.vars.onComplete = t.vars.onReverseComplete = callback; + t.data = "isPause"; + this._hasPause = true; + return this.add(t, position); + }; + + p.removeLabel = function(label) { + delete this._labels[label]; + return this; + }; + + p.getLabelTime = function(label) { + return (this._labels[label] != null) ? this._labels[label] : -1; + }; + + p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { + var i; + //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). + if (ignore instanceof Animation && ignore.timeline === this) { + this.remove(ignore); + } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { + i = ignore.length; + while (--i > -1) { + if (ignore[i] instanceof Animation && ignore[i].timeline === this) { + this.remove(ignore[i]); + } + } + } + if (typeof(offsetOrLabel) === "string") { + return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent); + } + offsetOrLabel = offsetOrLabel || 0; + if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). + i = timeOrLabel.indexOf("="); + if (i === -1) { + if (this._labels[timeOrLabel] == null) { + return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel; + } + return this._labels[timeOrLabel] + offsetOrLabel; + } + offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); + timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration(); + } else if (timeOrLabel == null) { + timeOrLabel = this.duration(); + } + return Number(timeOrLabel) + offsetOrLabel; + }; + + p.seek = function(position, suppressEvents) { + return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); + }; + + p.stop = function() { + return this.paused(true); + }; + + p.gotoAndPlay = function(position, suppressEvents) { + return this.play(position, suppressEvents); + }; + + p.gotoAndStop = function(position, suppressEvents) { + return this.pause(position, suppressEvents); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + prevTime = this._time, + prevStart = this._startTime, + prevTimeScale = this._timeScale, + prevPaused = this._paused, + tween, isComplete, next, callback, internalForce, pauseTween, curTime; + if (time >= totalDur - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts. + this._totalTime = this._time = totalDur; + if (!this._reversed) if (!this._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!this._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (this._duration === 0) if ((time <= 0 && time >= -0.0000001) || this._rawPrevTime < 0 || this._rawPrevTime === _tinyNum) if (this._rawPrevTime !== time && this._first) { + internalForce = true; + if (this._rawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. + + } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0. + this._totalTime = this._time = 0; + if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime !== _tinyNum && (this._rawPrevTime > 0 || (time < 0 && this._rawPrevTime >= 0)))) { + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._timeline.autoRemoveChildren && this._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (this._rawPrevTime >= 0 && this._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + this._rawPrevTime = time; + } else { + this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = this._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } + } + + } else { + + if (this._hasPause && !this._forcingPlayhead && !suppressEvents) { + if (time >= prevTime) { + tween = this._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && this._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = this._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + this._time = time = pauseTween._startTime; + this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay)); + } + } + + this._totalTime = this._time = this._rawPrevTime = time; + } + if ((this._time === prevTime || !this._first) && !force && !internalForce && !pauseTween) { + return; + } else if (!this._initted) { + this._initted = true; + } + + if (!this._active) if (!this._paused && this._time !== prevTime && time > 0) { + this._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0 || !this._duration) if (!suppressEvents) { + this._callback("onStart"); + } + + curTime = this._time; + if (curTime >= prevTime) { + tween = this._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== this._time || (this._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= curTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + this.pause(); + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = this._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== this._time || (this._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > this._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + this.pause(); + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (this._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + this._callback("onUpdate"); + } + + if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents && this.vars[callback]) { + this._callback(callback); + } + } + }; + + p._hasPausedChild = function() { + var tween = this._first; + while (tween) { + if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { + return true; + } + tween = tween._next; + } + return false; + }; + + p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || -9999999999; + var a = [], + tween = this._first, + cnt = 0; + while (tween) { + if (tween._startTime < ignoreBeforeTime) { + //do nothing + } else if (tween instanceof TweenLite) { + if (tweens !== false) { + a[cnt++] = tween; + } + } else { + if (timelines !== false) { + a[cnt++] = tween; + } + if (nested !== false) { + a = a.concat(tween.getChildren(true, tweens, timelines)); + cnt = a.length; + } + } + tween = tween._next; + } + return a; + }; + + p.getTweensOf = function(target, nested) { + var disabled = this._gc, + a = [], + cnt = 0, + tweens, i; + if (disabled) { + this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. + } + tweens = TweenLite.getTweensOf(target); + i = tweens.length; + while (--i > -1) { + if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { + a[cnt++] = tweens[i]; + } + } + if (disabled) { + this._enabled(false, true); + } + return a; + }; + + p.recent = function() { + return this._recent; + }; + + p._contains = function(tween) { + var tl = tween.timeline; + while (tl) { + if (tl === this) { + return true; + } + tl = tl.timeline; + } + return false; + }; + + p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { + ignoreBeforeTime = ignoreBeforeTime || 0; + var tween = this._first, + labels = this._labels, + p; + while (tween) { + if (tween._startTime >= ignoreBeforeTime) { + tween._startTime += amount; + } + tween = tween._next; + } + if (adjustLabels) { + for (p in labels) { + if (labels[p] >= ignoreBeforeTime) { + labels[p] += amount; + } + } + } + return this._uncache(true); + }; + + p._kill = function(vars, target) { + if (!vars && !target) { + return this._enabled(false, false); + } + var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), + i = tweens.length, + changed = false; + while (--i > -1) { + if (tweens[i]._kill(vars, target)) { + changed = true; + } + } + return changed; + }; + + p.clear = function(labels) { + var tweens = this.getChildren(false, true, true), + i = tweens.length; + this._time = this._totalTime = 0; + while (--i > -1) { + tweens[i]._enabled(false, false); + } + if (labels !== false) { + this._labels = {}; + } + return this._uncache(true); + }; + + p.invalidate = function() { + var tween = this._first; + while (tween) { + tween.invalidate(); + tween = tween._next; + } + return Animation.prototype.invalidate.call(this);; + }; + + p._enabled = function(enabled, ignoreTimeline) { + if (enabled === this._gc) { + var tween = this._first; + while (tween) { + tween._enabled(enabled, true); + tween = tween._next; + } + } + return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); + }; + + p.totalTime = function(time, suppressEvents, uncapped) { + this._forcingPlayhead = true; + var val = Animation.prototype.totalTime.apply(this, arguments); + this._forcingPlayhead = false; + return val; + }; + + p.duration = function(value) { + if (!arguments.length) { + if (this._dirty) { + this.totalDuration(); //just triggers recalculation + } + return this._duration; + } + if (this.duration() !== 0 && value !== 0) { + this.timeScale(this._duration / value); + } + return this; + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + var max = 0, + tween = this._last, + prevStart = 999999999999, + prev, end; + while (tween) { + prev = tween._prev; //record it here in case the tween changes position in the sequence... + if (tween._dirty) { + tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. + } + if (tween._startTime > prevStart && this._sortChildren && !tween._paused) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence + this.add(tween, tween._startTime - tween._delay); + } else { + prevStart = tween._startTime; + } + if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. + max -= tween._startTime; + if (this._timeline.smoothChildTiming) { + this._startTime += tween._startTime / this._timeScale; + } + this.shiftChildren(-tween._startTime, false, -9999999999); + prevStart = 0; + } + end = tween._startTime + (tween._totalDuration / tween._timeScale); + if (end > max) { + max = end; + } + tween = prev; + } + this._duration = this._totalDuration = max; + this._dirty = false; + } + return this._totalDuration; + } + return (value && this.totalDuration()) ? this.timeScale(this._totalDuration / value) : this; + }; + + p.paused = function(value) { + if (!value) { //if there's a pause directly at the spot from where we're unpausing, skip it. + var tween = this._first, + time = this._time; + while (tween) { + if (tween._startTime === time && tween.data === "isPause") { + tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. + } + tween = tween._next; + } + } + return Animation.prototype.paused.apply(this, arguments); + }; + + p.usesFrames = function() { + var tl = this._timeline; + while (tl._timeline) { + tl = tl._timeline; + } + return (tl === Animation._rootFramesTimeline); + }; + + p.rawTime = function(wrapRepeats) { + return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale; + }; + + return TimelineLite; + + }, true); + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * TimelineMax + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { + + var TimelineMax = function(vars) { + TimelineLite.call(this, vars); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._cycle = 0; + this._yoyo = (this.vars.yoyo === true); + this._dirty = true; + }, + _tinyNum = 0.0000000001, + TweenLiteInternals = TweenLite._internals, + _lazyTweens = TweenLiteInternals.lazyTweens, + _lazyRender = TweenLiteInternals.lazyRender, + _globals = _gsScope._gsDefine.globals, + _easeNone = new Ease(null, null, 1, 0), + p = TimelineMax.prototype = new TimelineLite(); + + p.constructor = TimelineMax; + p.kill()._gc = false; + TimelineMax.version = "1.19.1"; + + p.invalidate = function() { + this._yoyo = (this.vars.yoyo === true); + this._repeat = this.vars.repeat || 0; + this._repeatDelay = this.vars.repeatDelay || 0; + this._uncache(true); + return TimelineLite.prototype.invalidate.call(this); + }; + + p.addCallback = function(callback, position, params, scope) { + return this.add( TweenLite.delayedCall(0, callback, params, scope), position); + }; + + p.removeCallback = function(callback, position) { + if (callback) { + if (position == null) { + this._kill(null, callback); + } else { + var a = this.getTweensOf(callback, false), + i = a.length, + time = this._parseTimeOrLabel(position); + while (--i > -1) { + if (a[i]._startTime === time) { + a[i]._enabled(false, false); + } + } + } + } + return this; + }; + + p.removePause = function(position) { + return this.removeCallback(TimelineLite._internals.pauseCallback, position); + }; + + p.tweenTo = function(position, vars) { + vars = vars || {}; + var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false}, + Engine = (vars.repeat && _globals.TweenMax) || TweenLite, + duration, p, t; + for (p in vars) { + copy[p] = vars[p]; + } + copy.time = this._parseTimeOrLabel(position); + duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; + t = new Engine(this, duration, copy); + copy.onStart = function() { + t.target.paused(true); + if (t.vars.time !== t.target.time() && duration === t.duration()) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. + t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ); + } + if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. + vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. + } + }; + return t; + }; + + p.tweenFromTo = function(fromPosition, toPosition, vars) { + vars = vars || {}; + fromPosition = this._parseTimeOrLabel(fromPosition); + vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; + vars.immediateRender = (vars.immediateRender !== false); + var t = this.tweenTo(toPosition, vars); + return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); + }; + + p.render = function(time, suppressEvents, force) { + if (this._gc) { + this._enabled(true, false); + } + var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(), + dur = this._duration, + prevTime = this._time, + prevTotalTime = this._totalTime, + prevStart = this._startTime, + prevTimeScale = this._timeScale, + prevRawPrevTime = this._rawPrevTime, + prevPaused = this._paused, + prevCycle = this._cycle, + tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween, curTime; + if (time >= totalDur - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts. + if (!this._locked) { + this._totalTime = totalDur; + this._cycle = this._repeat; + } + if (!this._reversed) if (!this._hasPausedChild()) { + isComplete = true; + callback = "onComplete"; + internalForce = !!this._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. + if (this._duration === 0) if ((time <= 0 && time >= -0.0000001) || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && this._first) { + internalForce = true; + if (prevRawPrevTime > _tinyNum) { + callback = "onReverseComplete"; + } + } + } + this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (this._yoyo && (this._cycle & 1) !== 0) { + this._time = time = 0; + } else { + this._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in which case adding 0.00000001, for example, causes it to act like nothing was added. + } + + } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0. + if (!this._locked) { + this._totalTime = this._cycle = 0; + } + this._time = 0; + if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !this._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare) + callback = "onReverseComplete"; + isComplete = this._reversed; + } + if (time < 0) { + this._active = false; + if (this._timeline.autoRemoveChildren && this._reversed) { + internalForce = isComplete = true; + callback = "onReverseComplete"; + } else if (prevRawPrevTime >= 0 && this._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. + internalForce = true; + } + this._rawPrevTime = time; + } else { + this._rawPrevTime = (dur || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. + if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). + tween = this._first; + while (tween && tween._startTime === 0) { + if (!tween._duration) { + isComplete = false; + } + tween = tween._next; + } + } + time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) + if (!this._initted) { + internalForce = true; + } + } + + } else { + if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through. + internalForce = true; + } + this._time = this._rawPrevTime = time; + if (!this._locked) { + this._totalTime = time; + if (this._repeat !== 0) { + cycleDuration = dur + this._repeatDelay; + this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!) + if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration && prevTotalTime <= time) { + this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) + } + this._time = this._totalTime - (this._cycle * cycleDuration); + if (this._yoyo) if ((this._cycle & 1) !== 0) { + this._time = dur - this._time; + } + if (this._time > dur) { + this._time = dur; + time = dur + 0.0001; //to avoid occasional floating point rounding error + } else if (this._time < 0) { + this._time = time = 0; + } else { + time = this._time; + } + } + } + + if (this._hasPause && !this._forcingPlayhead && !suppressEvents && time < dur) { + time = this._time; + if (time >= prevTime || (this._repeat && prevCycle !== this._cycle)) { + tween = this._first; + while (tween && tween._startTime <= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && this._rawPrevTime === 0)) { + pauseTween = tween; + } + tween = tween._next; + } + } else { + tween = this._last; + while (tween && tween._startTime >= time && !pauseTween) { + if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { + pauseTween = tween; + } + tween = tween._prev; + } + } + if (pauseTween) { + this._time = time = pauseTween._startTime; + this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay)); + } + } + + } + + if (this._cycle !== prevCycle) if (!this._locked) { + /* + make sure children at the end/beginning of the timeline are rendered properly. If, for example, + a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which + would get transated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there + could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So + we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must + ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. + */ + var backwards = (this._yoyo && (prevCycle & 1) !== 0), + wrap = (backwards === (this._yoyo && (this._cycle & 1) !== 0)), + recTotalTime = this._totalTime, + recCycle = this._cycle, + recRawPrevTime = this._rawPrevTime, + recTime = this._time; + + this._totalTime = prevCycle * dur; + if (this._cycle < prevCycle) { + backwards = !backwards; + } else { + this._totalTime += dur; + } + this._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. + + this._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime; + this._cycle = prevCycle; + this._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() + prevTime = (backwards) ? 0 : dur; + this.render(prevTime, suppressEvents, (dur === 0)); + if (!suppressEvents) if (!this._gc) { + if (this.vars.onRepeat) { + this._cycle = recCycle; //in case the onRepeat alters the playhead or invalidates(), we shouldn't stay locked or use the previous cycle. + this._locked = false; + this._callback("onRepeat"); + } + } + if (prevTime !== this._time) { //in case there's a callback like onComplete in a nested tween/timeline that changes the playhead position, like via seek(), we should just abort. + return; + } + if (wrap) { + this._cycle = prevCycle; //if there's an onRepeat, we reverted this above, so make sure it's set properly again. We also unlocked in that scenario, so reset that too. + this._locked = true; + prevTime = (backwards) ? dur + 0.0001 : -0.0001; + this.render(prevTime, true, false); + } + this._locked = false; + if (this._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible) + return; + } + this._time = recTime; + this._totalTime = recTotalTime; + this._cycle = recCycle; + this._rawPrevTime = recRawPrevTime; + } + + if ((this._time === prevTime || !this._first) && !force && !internalForce && !pauseTween) { + if (prevTotalTime !== this._totalTime) if (this._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. + this._callback("onUpdate"); + } + return; + } else if (!this._initted) { + this._initted = true; + } + + if (!this._active) if (!this._paused && this._totalTime !== prevTotalTime && time > 0) { + this._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. + } + + if (prevTotalTime === 0) if (this.vars.onStart) if (this._totalTime !== 0 || !this._totalDuration) if (!suppressEvents) { + this._callback("onStart"); + } + + curTime = this._time; + if (curTime >= prevTime) { + tween = this._first; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (curTime !== this._time || (this._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + this.pause(); + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } else { + tween = this._last; + while (tween) { + next = tween._prev; //record it here because the value could change after rendering... + if (curTime !== this._time || (this._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete + break; + } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { + if (pauseTween === tween) { + pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. + while (pauseTween && pauseTween.endTime() > this._time) { + pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); + pauseTween = pauseTween._prev; + } + pauseTween = null; + this.pause(); + } + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + } + + if (this._onUpdate) if (!suppressEvents) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. + _lazyRender(); + } + this._callback("onUpdate"); + } + if (callback) if (!this._locked) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate + if (isComplete) { + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. + _lazyRender(); + } + if (this._timeline.autoRemoveChildren) { + this._enabled(false, false); + } + this._active = false; + } + if (!suppressEvents && this.vars[callback]) { + this._callback(callback); + } + } + }; + + p.getActive = function(nested, tweens, timelines) { + if (nested == null) { + nested = true; + } + if (tweens == null) { + tweens = true; + } + if (timelines == null) { + timelines = false; + } + var a = [], + all = this.getChildren(nested, tweens, timelines), + cnt = 0, + l = all.length, + i, tween; + for (i = 0; i < l; i++) { + tween = all[i]; + if (tween.isActive()) { + a[cnt++] = tween; + } + } + return a; + }; + + + p.getLabelAfter = function(time) { + if (!time) if (time !== 0) { //faster than isNan() + time = this._time; + } + var labels = this.getLabelsArray(), + l = labels.length, + i; + for (i = 0; i < l; i++) { + if (labels[i].time > time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelBefore = function(time) { + if (time == null) { + time = this._time; + } + var labels = this.getLabelsArray(), + i = labels.length; + while (--i > -1) { + if (labels[i].time < time) { + return labels[i].name; + } + } + return null; + }; + + p.getLabelsArray = function() { + var a = [], + cnt = 0, + p; + for (p in this._labels) { + a[cnt++] = {time:this._labels[p], name:p}; + } + a.sort(function(a,b) { + return a.time - b.time; + }); + return a; + }; + + p.invalidate = function() { + this._locked = false; //unlock and set cycle in case invalidate() is called from inside an onRepeat + return TimelineLite.prototype.invalidate.call(this); + }; + + +//---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- + + p.progress = function(value, suppressEvents) { + return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + }; + + p.totalProgress = function(value, suppressEvents) { + return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); + }; + + p.totalDuration = function(value) { + if (!arguments.length) { + if (this._dirty) { + TimelineLite.prototype.totalDuration.call(this); //just forces refresh + //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. + this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); + } + return this._totalDuration; + } + return (this._repeat === -1 || !value) ? this : this.timeScale( this.totalDuration() / value ); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + if (value > this._duration) { + value = this._duration; + } + if (this._yoyo && (this._cycle & 1) !== 0) { + value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay)); + } else if (this._repeat !== 0) { + value += this._cycle * (this._duration + this._repeatDelay); + } + return this.totalTime(value, suppressEvents); + }; + + p.repeat = function(value) { + if (!arguments.length) { + return this._repeat; + } + this._repeat = value; + return this._uncache(true); + }; + + p.repeatDelay = function(value) { + if (!arguments.length) { + return this._repeatDelay; + } + this._repeatDelay = value; + return this._uncache(true); + }; + + p.yoyo = function(value) { + if (!arguments.length) { + return this._yoyo; + } + this._yoyo = value; + return this; + }; + + p.currentLabel = function(value) { + if (!arguments.length) { + return this.getLabelBefore(this._time + 0.00000001); + } + return this.seek(value, true); + }; + + return TimelineMax; + + }, true); + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * BezierPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var _RAD2DEG = 180 / Math.PI, + _r1 = [], + _r2 = [], + _r3 = [], + _corProps = {}, + _globals = _gsScope._gsDefine.globals, + Segment = function(a, b, c, d) { + if (c === d) { //if c and d match, the final autoRotate value could lock at -90 degrees, so differentiate them slightly. + c = d - (d - b) / 1000000; + } + if (a === b) { //if a and b match, the starting autoRotate value could lock at -90 degrees, so differentiate them slightly. + b = a + (c - a) / 1000000; + } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.da = d - a; + this.ca = c - a; + this.ba = b - a; + }, + _correlate = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,", + cubicToQuadratic = function(a, b, c, d) { + var q1 = {a:a}, + q2 = {}, + q3 = {}, + q4 = {c:d}, + mab = (a + b) / 2, + mbc = (b + c) / 2, + mcd = (c + d) / 2, + mabc = (mab + mbc) / 2, + mbcd = (mbc + mcd) / 2, + m8 = (mbcd - mabc) / 8; + q1.b = mab + (a - mab) / 4; + q2.b = mabc + m8; + q1.c = q2.a = (q1.b + q2.b) / 2; + q2.c = q3.a = (mabc + mbcd) / 2; + q3.b = mbcd - m8; + q4.b = mcd + (d - mcd) / 4; + q3.c = q4.a = (q3.b + q4.b) / 2; + return [q1, q2, q3, q4]; + }, + _calculateControlPoints = function(a, curviness, quad, basic, correlate) { + var l = a.length - 1, + ii = 0, + cp1 = a[0].a, + i, p1, p2, p3, seg, m1, m2, mm, cp2, qb, r1, r2, tl; + for (i = 0; i < l; i++) { + seg = a[ii]; + p1 = seg.a; + p2 = seg.d; + p3 = a[ii+1].d; + + if (correlate) { + r1 = _r1[i]; + r2 = _r2[i]; + tl = ((r2 + r1) * curviness * 0.25) / (basic ? 0.5 : _r3[i] || 0.5); + m1 = p2 - (p2 - p1) * (basic ? curviness * 0.5 : (r1 !== 0 ? tl / r1 : 0)); + m2 = p2 + (p3 - p2) * (basic ? curviness * 0.5 : (r2 !== 0 ? tl / r2 : 0)); + mm = p2 - (m1 + (((m2 - m1) * ((r1 * 3 / (r1 + r2)) + 0.5) / 4) || 0)); + } else { + m1 = p2 - (p2 - p1) * curviness * 0.5; + m2 = p2 + (p3 - p2) * curviness * 0.5; + mm = p2 - (m1 + m2) / 2; + } + m1 += mm; + m2 += mm; + + seg.c = cp2 = m1; + if (i !== 0) { + seg.b = cp1; + } else { + seg.b = cp1 = seg.a + (seg.c - seg.a) * 0.6; //instead of placing b on a exactly, we move it inline with c so that if the user specifies an ease like Back.easeIn or Elastic.easeIn which goes BEYOND the beginning, it will do so smoothly. + } + + seg.da = p2 - p1; + seg.ca = cp2 - p1; + seg.ba = cp1 - p1; + + if (quad) { + qb = cubicToQuadratic(p1, cp1, cp2, p2); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + ii += 4; + } else { + ii++; + } + + cp1 = m2; + } + seg = a[ii]; + seg.b = cp1; + seg.c = cp1 + (seg.d - cp1) * 0.4; //instead of placing c on d exactly, we move it inline with b so that if the user specifies an ease like Back.easeOut or Elastic.easeOut which goes BEYOND the end, it will do so smoothly. + seg.da = seg.d - seg.a; + seg.ca = seg.c - seg.a; + seg.ba = cp1 - seg.a; + if (quad) { + qb = cubicToQuadratic(seg.a, cp1, seg.c, seg.d); + a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); + } + }, + _parseAnchors = function(values, p, correlate, prepend) { + var a = [], + l, i, p1, p2, p3, tmp; + if (prepend) { + values = [prepend].concat(values); + i = values.length; + while (--i > -1) { + if (typeof( (tmp = values[i][p]) ) === "string") if (tmp.charAt(1) === "=") { + values[i][p] = prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)); //accommodate relative values. Do it inline instead of breaking it out into a function for speed reasons + } + } + } + l = values.length - 2; + if (l < 0) { + a[0] = new Segment(values[0][p], 0, 0, values[(l < -1) ? 0 : 1][p]); + return a; + } + for (i = 0; i < l; i++) { + p1 = values[i][p]; + p2 = values[i+1][p]; + a[i] = new Segment(p1, 0, 0, p2); + if (correlate) { + p3 = values[i+2][p]; + _r1[i] = (_r1[i] || 0) + (p2 - p1) * (p2 - p1); + _r2[i] = (_r2[i] || 0) + (p3 - p2) * (p3 - p2); + } + } + a[i] = new Segment(values[i][p], 0, 0, values[i+1][p]); + return a; + }, + bezierThrough = function(values, curviness, quadratic, basic, correlate, prepend) { + var obj = {}, + props = [], + first = prepend || values[0], + i, p, a, j, r, l, seamless, last; + correlate = (typeof(correlate) === "string") ? ","+correlate+"," : _correlate; + if (curviness == null) { + curviness = 1; + } + for (p in values[0]) { + props.push(p); + } + //check to see if the last and first values are identical (well, within 0.05). If so, make seamless by appending the second element to the very end of the values array and the 2nd-to-last element to the very beginning (we'll remove those segments later) + if (values.length > 1) { + last = values[values.length - 1]; + seamless = true; + i = props.length; + while (--i > -1) { + p = props[i]; + if (Math.abs(first[p] - last[p]) > 0.05) { //build in a tolerance of +/-0.05 to accommodate rounding errors. + seamless = false; + break; + } + } + if (seamless) { + values = values.concat(); //duplicate the array to avoid contaminating the original which the user may be reusing for other tweens + if (prepend) { + values.unshift(prepend); + } + values.push(values[1]); + prepend = values[values.length - 3]; + } + } + _r1.length = _r2.length = _r3.length = 0; + i = props.length; + while (--i > -1) { + p = props[i]; + _corProps[p] = (correlate.indexOf(","+p+",") !== -1); + obj[p] = _parseAnchors(values, p, _corProps[p], prepend); + } + i = _r1.length; + while (--i > -1) { + _r1[i] = Math.sqrt(_r1[i]); + _r2[i] = Math.sqrt(_r2[i]); + } + if (!basic) { + i = props.length; + while (--i > -1) { + if (_corProps[p]) { + a = obj[props[i]]; + l = a.length - 1; + for (j = 0; j < l; j++) { + r = (a[j+1].da / _r2[j] + a[j].da / _r1[j]) || 0; + _r3[j] = (_r3[j] || 0) + r * r; + } + } + } + i = _r3.length; + while (--i > -1) { + _r3[i] = Math.sqrt(_r3[i]); + } + } + i = props.length; + j = quadratic ? 4 : 1; + while (--i > -1) { + p = props[i]; + a = obj[p]; + _calculateControlPoints(a, curviness, quadratic, basic, _corProps[p]); //this method requires that _parseAnchors() and _setSegmentRatios() ran first so that _r1, _r2, and _r3 values are populated for all properties + if (seamless) { + a.splice(0, j); + a.splice(a.length - j, j); + } + } + return obj; + }, + _parseBezierData = function(values, type, prepend) { + type = type || "soft"; + var obj = {}, + inc = (type === "cubic") ? 3 : 2, + soft = (type === "soft"), + props = [], + a, b, c, d, cur, i, j, l, p, cnt, tmp; + if (soft && prepend) { + values = [prepend].concat(values); + } + if (values == null || values.length < inc + 1) { throw "invalid Bezier data"; } + for (p in values[0]) { + props.push(p); + } + i = props.length; + while (--i > -1) { + p = props[i]; + obj[p] = cur = []; + cnt = 0; + l = values.length; + for (j = 0; j < l; j++) { + a = (prepend == null) ? values[j][p] : (typeof( (tmp = values[j][p]) ) === "string" && tmp.charAt(1) === "=") ? prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)) : Number(tmp); + if (soft) if (j > 1) if (j < l - 1) { + cur[cnt++] = (a + cur[cnt-2]) / 2; + } + cur[cnt++] = a; + } + l = cnt - inc + 1; + cnt = 0; + for (j = 0; j < l; j += inc) { + a = cur[j]; + b = cur[j+1]; + c = cur[j+2]; + d = (inc === 2) ? 0 : cur[j+3]; + cur[cnt++] = tmp = (inc === 3) ? new Segment(a, b, c, d) : new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + } + cur.length = cnt; + } + return obj; + }, + _addCubicLengths = function(a, steps, resolution) { + var inc = 1 / resolution, + j = a.length, + d, d1, s, da, ca, ba, p, i, inv, bez, index; + while (--j > -1) { + bez = a[j]; + s = bez.a; + da = bez.d - s; + ca = bez.c - s; + ba = bez.b - s; + d = d1 = 0; + for (i = 1; i <= resolution; i++) { + p = inc * i; + inv = 1 - p; + d = d1 - (d1 = (p * p * da + 3 * inv * (p * ca + inv * ba)) * p); + index = j * resolution + i - 1; + steps[index] = (steps[index] || 0) + d * d; + } + } + }, + _parseLengthData = function(obj, resolution) { + resolution = resolution >> 0 || 6; + var a = [], + lengths = [], + d = 0, + total = 0, + threshold = resolution - 1, + segments = [], + curLS = [], //current length segments array + p, i, l, index; + for (p in obj) { + _addCubicLengths(obj[p], a, resolution); + } + l = a.length; + for (i = 0; i < l; i++) { + d += Math.sqrt(a[i]); + index = i % resolution; + curLS[index] = d; + if (index === threshold) { + total += d; + index = (i / resolution) >> 0; + segments[index] = curLS; + lengths[index] = total; + d = 0; + curLS = []; + } + } + return {length:total, lengths:lengths, segments:segments}; + }, + + + + BezierPlugin = _gsScope._gsDefine.plugin({ + propName: "bezier", + priority: -1, + version: "1.3.7", + API: 2, + global:true, + + //gets called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, vars, tween) { + this._target = target; + if (vars instanceof Array) { + vars = {values:vars}; + } + this._func = {}; + this._mod = {}; + this._props = []; + this._timeRes = (vars.timeResolution == null) ? 6 : parseInt(vars.timeResolution, 10); + var values = vars.values || [], + first = {}, + second = values[0], + autoRotate = vars.autoRotate || tween.vars.orientToBezier, + p, isFunc, i, j, prepend; + + this._autoRotate = autoRotate ? (autoRotate instanceof Array) ? autoRotate : [["x","y","rotation",((autoRotate === true) ? 0 : Number(autoRotate) || 0)]] : null; + for (p in second) { + this._props.push(p); + } + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + + this._overwriteProps.push(p); + isFunc = this._func[p] = (typeof(target[p]) === "function"); + first[p] = (!isFunc) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ](); + if (!prepend) if (first[p] !== values[0][p]) { + prepend = first; + } + } + this._beziers = (vars.type !== "cubic" && vars.type !== "quadratic" && vars.type !== "soft") ? bezierThrough(values, isNaN(vars.curviness) ? 1 : vars.curviness, false, (vars.type === "thruBasic"), vars.correlate, prepend) : _parseBezierData(values, vars.type, first); + this._segCount = this._beziers[p].length; + + if (this._timeRes) { + var ld = _parseLengthData(this._beziers, this._timeRes); + this._length = ld.length; + this._lengths = ld.lengths; + this._segments = ld.segments; + this._l1 = this._li = this._s1 = this._si = 0; + this._l2 = this._lengths[0]; + this._curSeg = this._segments[0]; + this._s2 = this._curSeg[0]; + this._prec = 1 / this._curSeg.length; + } + + if ((autoRotate = this._autoRotate)) { + this._initialRotations = []; + if (!(autoRotate[0] instanceof Array)) { + this._autoRotate = autoRotate = [autoRotate]; + } + i = autoRotate.length; + while (--i > -1) { + for (j = 0; j < 3; j++) { + p = autoRotate[i][j]; + this._func[p] = (typeof(target[p]) === "function") ? target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ] : false; + } + p = autoRotate[i][2]; + this._initialRotations[i] = (this._func[p] ? this._func[p].call(this._target) : this._target[p]) || 0; + this._overwriteProps.push(p); + } + } + this._startRatio = tween.vars.runBackwards ? 1 : 0; //we determine the starting ratio when the tween inits which is always 0 unless the tween has runBackwards:true (indicating it's a from() tween) in which case it's 1. + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(v) { + var segments = this._segCount, + func = this._func, + target = this._target, + notStart = (v !== this._startRatio), + curIndex, inv, i, p, b, t, val, l, lengths, curSeg; + if (!this._timeRes) { + curIndex = (v < 0) ? 0 : (v >= 1) ? segments - 1 : (segments * v) >> 0; + t = (v - (curIndex * (1 / segments))) * segments; + } else { + lengths = this._lengths; + curSeg = this._curSeg; + v *= this._length; + i = this._li; + //find the appropriate segment (if the currently cached one isn't correct) + if (v > this._l2 && i < segments - 1) { + l = segments - 1; + while (i < l && (this._l2 = lengths[++i]) <= v) { } + this._l1 = lengths[i-1]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s2 = curSeg[(this._s1 = this._si = 0)]; + } else if (v < this._l1 && i > 0) { + while (i > 0 && (this._l1 = lengths[--i]) >= v) { } + if (i === 0 && v < this._l1) { + this._l1 = 0; + } else { + i++; + } + this._l2 = lengths[i]; + this._li = i; + this._curSeg = curSeg = this._segments[i]; + this._s1 = curSeg[(this._si = curSeg.length - 1) - 1] || 0; + this._s2 = curSeg[this._si]; + } + curIndex = i; + //now find the appropriate sub-segment (we split it into the number of pieces that was defined by "precision" and measured each one) + v -= this._l1; + i = this._si; + if (v > this._s2 && i < curSeg.length - 1) { + l = curSeg.length - 1; + while (i < l && (this._s2 = curSeg[++i]) <= v) { } + this._s1 = curSeg[i-1]; + this._si = i; + } else if (v < this._s1 && i > 0) { + while (i > 0 && (this._s1 = curSeg[--i]) >= v) { } + if (i === 0 && v < this._s1) { + this._s1 = 0; + } else { + i++; + } + this._s2 = curSeg[i]; + this._si = i; + } + t = ((i + (v - this._s1) / (this._s2 - this._s1)) * this._prec) || 0; + } + inv = 1 - t; + + i = this._props.length; + while (--i > -1) { + p = this._props[i]; + b = this._beziers[p][curIndex]; + val = (t * t * b.da + 3 * inv * (t * b.ca + inv * b.ba)) * t + b.a; + if (this._mod[p]) { + val = this._mod[p](val, target); + } + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + + if (this._autoRotate) { + var ar = this._autoRotate, + b2, x1, y1, x2, y2, add, conv; + i = ar.length; + while (--i > -1) { + p = ar[i][2]; + add = ar[i][3] || 0; + conv = (ar[i][4] === true) ? 1 : _RAD2DEG; + b = this._beziers[ar[i][0]]; + b2 = this._beziers[ar[i][1]]; + + if (b && b2) { //in case one of the properties got overwritten. + b = b[curIndex]; + b2 = b2[curIndex]; + + x1 = b.a + (b.b - b.a) * t; + x2 = b.b + (b.c - b.b) * t; + x1 += (x2 - x1) * t; + x2 += ((b.c + (b.d - b.c) * t) - x2) * t; + + y1 = b2.a + (b2.b - b2.a) * t; + y2 = b2.b + (b2.c - b2.b) * t; + y1 += (y2 - y1) * t; + y2 += ((b2.c + (b2.d - b2.c) * t) - y2) * t; + + val = notStart ? Math.atan2(y2 - y1, x2 - x1) * conv + add : this._initialRotations[i]; + + if (this._mod[p]) { + val = this._mod[p](val, target); //for modProps + } + + if (func[p]) { + target[p](val); + } else { + target[p] = val; + } + } + } + } + } + }), + p = BezierPlugin.prototype; + + + BezierPlugin.bezierThrough = bezierThrough; + BezierPlugin.cubicToQuadratic = cubicToQuadratic; + BezierPlugin._autoCSS = true; //indicates that this plugin can be inserted into the "css" object using the autoCSS feature of TweenLite + BezierPlugin.quadraticToCubic = function(a, b, c) { + return new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); + }; + + BezierPlugin._cssRegister = function() { + var CSSPlugin = _globals.CSSPlugin; + if (!CSSPlugin) { + return; + } + var _internals = CSSPlugin._internals, + _parseToProxy = _internals._parseToProxy, + _setPluginRatio = _internals._setPluginRatio, + CSSPropTween = _internals.CSSPropTween; + _internals._registerComplexSpecialProp("bezier", {parser:function(t, e, prop, cssp, pt, plugin) { + if (e instanceof Array) { + e = {values:e}; + } + plugin = new BezierPlugin(); + var values = e.values, + l = values.length - 1, + pluginValues = [], + v = {}, + i, p, data; + if (l < 0) { + return pt; + } + for (i = 0; i <= l; i++) { + data = _parseToProxy(t, values[i], cssp, pt, plugin, (l !== i)); + pluginValues[i] = data.end; + } + for (p in e) { + v[p] = e[p]; //duplicate the vars object because we need to alter some things which would cause problems if the user plans to reuse the same vars object for another tween. + } + v.values = pluginValues; + pt = new CSSPropTween(t, "bezier", 0, 0, data.pt, 2); + pt.data = data; + pt.plugin = plugin; + pt.setRatio = _setPluginRatio; + if (v.autoRotate === 0) { + v.autoRotate = true; + } + if (v.autoRotate && !(v.autoRotate instanceof Array)) { + i = (v.autoRotate === true) ? 0 : Number(v.autoRotate); + v.autoRotate = (data.end.left != null) ? [["left","top","rotation",i,false]] : (data.end.x != null) ? [["x","y","rotation",i,false]] : false; + } + if (v.autoRotate) { + if (!cssp._transform) { + cssp._enableTransforms(false); + } + data.autoRotate = cssp._target._gsTransform; + data.proxy.rotation = data.autoRotate.rotation || 0; + cssp._overwriteProps.push("rotation"); + } + plugin._onInitTween(data.proxy, v, cssp._tween); + return pt; + }}); + }; + + p._mod = function(lookup) { + var op = this._overwriteProps, + i = op.length, + val; + while (--i > -1) { + val = lookup[op[i]]; + if (val && typeof(val) === "function") { + this._mod[op[i]] = val; + } + } + }; + + p._kill = function(lookup) { + var a = this._props, + p, i; + for (p in this._beziers) { + if (p in lookup) { + delete this._beziers[p]; + delete this._func[p]; + i = a.length; + while (--i > -1) { + if (a[i] === p) { + a.splice(i, 1); + } + } + } + } + a = this._autoRotate; + if (a) { + i = a.length; + while (--i > -1) { + if (lookup[a[i][2]]) { + a.splice(i, 1); + } + } + } + return this._super._kill.call(this, lookup); + }; + + }()); + + + + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * CSSPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) { + + /** @constructor **/ + var CSSPlugin = function() { + TweenPlugin.call(this, "css"); + this._overwriteProps.length = 0; + this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) + }, + _globals = _gsScope._gsDefine.globals, + _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. + _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance + _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter + _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. + _specialProps = {}, + p = CSSPlugin.prototype = new TweenPlugin("css"); + + p.constructor = CSSPlugin; + CSSPlugin.version = "1.19.1"; + CSSPlugin.API = 2; + CSSPlugin.defaultTransformPerspective = 0; + CSSPlugin.defaultSkewType = "compensated"; + CSSPlugin.defaultSmoothOrigin = true; + p = "px"; //we'll reuse the "p" variable to keep file size down + CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""}; + + + var _numExp = /(?:\-|\.|\b)(\d|\.|e\-)+/g, + _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g, + _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" + _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and += + _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g, + _opacityExp = /opacity *= *([^)]*)/i, + _opacityValExp = /opacity:([^;]*)/i, + _alphaFilterExp = /alpha\(opacity *=.+?\)/i, + _rgbhslExp = /^(rgb|hsl)/, + _capsExp = /([A-Z])/g, + _camelExp = /-([a-z])/gi, + _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage) + _camelFunc = function(s, g) { return g.toUpperCase(); }, + _horizExp = /(?:Left|Right|Width)/i, + _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, + _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, + _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis + _complexExp = /[\s,\(]/i, //for testing a string to find if it has a space, comma, or open parenthesis (clues that it's a complex value) + _DEG2RAD = Math.PI / 180, + _RAD2DEG = 180 / Math.PI, + _forcePT = {}, + _dummyElement = {style:{}}, + _doc = _gsScope.document || {createElement: function() {return _dummyElement;}}, + _createElement = function(type, ns) { + return _doc.createElementNS ? _doc.createElementNS(ns || "http://www.w3.org/1999/xhtml", type) : _doc.createElement(type); + }, + _tempDiv = _createElement("div"), + _tempImg = _createElement("img"), + _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins + _agent = (_gsScope.navigator || {}).userAgent || "", + _autoRound, + _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance). + + _isSafari, + _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element. + _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!) + _ieVers, + _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version. + var i = _agent.indexOf("Android"), + a = _createElement("a"); + _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || parseFloat(_agent.substr(i+8, 2)) > 3)); + _isSafariLT6 = (_isSafari && (parseFloat(_agent.substr(_agent.indexOf("Version/")+8, 2)) < 6)); + _isFirefox = (_agent.indexOf("Firefox") !== -1); + if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) { + _ieVers = parseFloat( RegExp.$1 ); + } + if (!a) { + return false; + } + a.style.cssText = "top:1px;opacity:.55;"; + return /^0.55/.test(a.style.opacity); + }()), + _getIEOpacity = function(v) { + return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1); + }, + _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE. + if (_gsScope.console) { + console.log(s); + } + }, + _target, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + _index, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params + + _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-" + _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz". + + // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all) + _checkPropPrefix = function(p, e) { + e = e || _tempDiv; + var s = e.style, + a, i; + if (s[p] !== undefined) { + return p; + } + p = p.charAt(0).toUpperCase() + p.substr(1); + a = ["O","Moz","ms","Ms","Webkit"]; + i = 5; + while (--i > -1 && s[a[i]+p] === undefined) { } + if (i >= 0) { + _prefix = (i === 3) ? "ms" : a[i]; + _prefixCSS = "-" + _prefix.toLowerCase() + "-"; + return _prefix + p; + } + return null; + }, + + _getComputedStyle = _doc.defaultView ? _doc.defaultView.getComputedStyle : function() {}, + + /** + * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do: + * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left"); + * + * @param {!Object} t Target element whose style property you want to query + * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.) + * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call. + * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value. + * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto". + * @return {?string} The current property value + */ + _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) { + var rv; + if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here. + return _getIEOpacity(t); + } + if (!calc && t.style[p]) { + rv = t.style[p]; + } else if ((cs = cs || _getComputedStyle(t))) { + rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); + } else if (t.currentStyle) { + rv = t.currentStyle[p]; + } + return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv; + }, + + /** + * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number. + * @param {!Object} t Target element + * @param {!string} p Property name (like "left", "top", "marginLeft", etc.) + * @param {!number} v Value + * @param {string=} sfx Suffix (like "px" or "%" or "em") + * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect. + * @return {number} value in pixels + */ + _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { + if (sfx === "px" || !sfx) { return v; } + if (sfx === "auto" || !v) { return 0; } + var horiz = _horizExp.test(p), + node = t, + style = _tempDiv.style, + neg = (v < 0), + precise = (v === 1), + pix, cache, time; + if (neg) { + v = -v; + } + if (precise) { + v *= 100; + } + if (sfx === "%" && p.indexOf("border") !== -1) { + pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); + } else { + style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; + if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { + node = t.parentNode || _doc.body; + cache = node._gsCache; + time = TweenLite.ticker.frame; + if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) + return cache.width * v / 100; + } + style[(horiz ? "width" : "height")] = v + sfx; + } else { + style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx; + } + node.appendChild(_tempDiv); + pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]); + node.removeChild(_tempDiv); + if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) { + cache = node._gsCache = node._gsCache || {}; + cache.time = time; + cache.width = pix / v * 100; + } + if (pix === 0 && !recurse) { + pix = _convertToPixels(t, p, v, sfx, true); + } + } + if (precise) { + pix /= 100; + } + return neg ? -pix : pix; + }, + _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop + if (_getStyle(t, "position", cs) !== "absolute") { return 0; } + var dim = ((p === "left") ? "Left" : "Top"), + v = _getStyle(t, "margin" + dim, cs); + return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0); + }, + + // @private returns at object containing ALL of the style properties in camelCase and their associated values. + _getAllStyles = function(t, cs) { + var s = {}, + i, tr, p; + if ((cs = cs || _getComputedStyle(t, null))) { + if ((i = cs.length)) { + while (--i > -1) { + p = cs[i]; + if (p.indexOf("-transform") === -1 || _transformPropCSS === p) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[p.replace(_camelExp, _camelFunc)] = cs.getPropertyValue(p); + } + } + } else { //some browsers behave differently - cs.length is always 0, so we must do a for...in loop. + for (i in cs) { + if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. + s[i] = cs[i]; + } + } + } + } else if ((cs = t.currentStyle || t.style)) { + for (i in cs) { + if (typeof(i) === "string" && s[i] === undefined) { + s[i.replace(_camelExp, _camelFunc)] = cs[i]; + } + } + } + if (!_supportsOpacity) { + s.opacity = _getIEOpacity(t); + } + tr = _getTransform(t, cs, false); + s.rotation = tr.rotation; + s.skewX = tr.skewX; + s.scaleX = tr.scaleX; + s.scaleY = tr.scaleY; + s.x = tr.x; + s.y = tr.y; + if (_supports3D) { + s.z = tr.z; + s.rotationX = tr.rotationX; + s.rotationY = tr.rotationY; + s.scaleZ = tr.scaleZ; + } + if (s.filters) { + delete s.filters; + } + return s; + }, + + // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object containing only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details. + _cssDif = function(t, s1, s2, vars, forceLookup) { + var difs = {}, + style = t.style, + val, p, mpt; + for (p in s2) { + if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") { + difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween. + if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes. + mpt = new MiniPropTween(style, p, style[p], mpt); + } + } + } + if (vars) { + for (p in vars) { //copy properties (except className) + if (p !== "className") { + difs[p] = vars[p]; + } + } + } + return {difs:difs, firstMPT:mpt}; + }, + _dimensions = {width:["Left","Right"], height:["Top","Bottom"]}, + _margins = ["marginLeft","marginRight","marginTop","marginBottom"], + + /** + * @private Gets the width or height of an element + * @param {!Object} t Target element + * @param {!string} p Property name ("width" or "height") + * @param {Object=} cs Computed style object (if one exists). Just a speed optimization. + * @return {number} Dimension (in pixels) + */ + _getDimension = function(t, p, cs) { + if ((t.nodeName + "").toLowerCase() === "svg") { //Chrome no longer supports offsetWidth/offsetHeight on SVG elements. + return (cs || _getComputedStyle(t))[p] || 0; + } else if (t.getCTM && _isSVG(t)) { + return t.getBBox()[p] || 0; + } + var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight), + a = _dimensions[p], + i = a.length; + cs = cs || _getComputedStyle(t, null); + while (--i > -1) { + v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0; + v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0; + } + return v; + }, + + // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value) + _parsePosition = function(v, recObj) { + if (v === "contain" || v === "auto" || v === "auto auto") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto". + return v + " "; + } + if (v == null || v === "") { + v = "0 0"; + } + var a = v.split(" "), + x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0], + y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1], + i; + if (a.length > 3 && !recObj) { //multiple positions + a = v.split(", ").join(",").split(","); + v = []; + for (i = 0; i < a.length; i++) { + v.push(_parsePosition(a[i])); + } + return v.join(","); + } + if (y == null) { + y = (x === "center") ? "50%" : "0"; + } else if (y === "center") { + y = "50%"; + } + if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it could be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative. + x = "50%"; + } + v = x + " " + y + ((a.length > 2) ? " " + a[2] : ""); + if (recObj) { + recObj.oxp = (x.indexOf("%") !== -1); + recObj.oyp = (y.indexOf("%") !== -1); + recObj.oxr = (x.charAt(1) === "="); + recObj.oyr = (y.charAt(1) === "="); + recObj.ox = parseFloat(x.replace(_NaNExp, "")); + recObj.oy = parseFloat(y.replace(_NaNExp, "")); + recObj.v = v; + } + return recObj || v; + }, + + /** + * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!) + * @param {(number|string)} e End value which is typically a string, but could be a number + * @param {(number|string)} b Beginning value which is typically a string but could be a number + * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized) + */ + _parseChange = function(e, b) { + if (typeof(e) === "function") { + e = e(_index, _target); + } + return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : (parseFloat(e) - parseFloat(b)) || 0; + }, + + /** + * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @return {number} Parsed value + */ + _parseVal = function(v, d) { + if (typeof(v) === "function") { + v = v(_index, _target); + } + return (v == null) ? d : (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * parseFloat(v.substr(2)) + d : parseFloat(v) || 0; + }, + + /** + * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly. + * @param {Object} v Value to be parsed + * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) + * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY" + * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation. + * @return {number} parsed angle in radians + */ + _parseAngle = function(v, d, p, directionalEnd) { + var min = 0.000001, + cap, split, dif, result, isRelative; + if (typeof(v) === "function") { + v = v(_index, _target); + } + if (v == null) { + result = d; + } else if (typeof(v) === "number") { + result = v; + } else { + cap = 360; + split = v.split("_"); + isRelative = (v.charAt(1) === "="); + dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d); + if (split.length) { + if (directionalEnd) { + directionalEnd[p] = d + dif; + } + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + result = d + dif; + } + if (result < min && result > -min) { + result = 0; + } + return result; + }, + + _colorLookup = {aqua:[0,255,255], + lime:[0,255,0], + silver:[192,192,192], + black:[0,0,0], + maroon:[128,0,0], + teal:[0,128,128], + blue:[0,0,255], + navy:[0,0,128], + white:[255,255,255], + fuchsia:[255,0,255], + olive:[128,128,0], + yellow:[255,255,0], + orange:[255,165,0], + gray:[128,128,128], + purple:[128,0,128], + green:[0,128,0], + red:[255,0,0], + pink:[255,192,203], + cyan:[0,255,255], + transparent:[255,255,255,0]}, + + _hue = function(h, m1, m2) { + h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h; + return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0; + }, + + /** + * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers). + * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc. + * @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba() + * @return {Array.} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true. + */ + _parseColor = CSSPlugin.parseColor = function(v, toHSL) { + var a, r, g, b, h, s, l, max, min, d, wasHSL; + if (!v) { + a = _colorLookup.black; + } else if (typeof(v) === "number") { + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else { + if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value. + v = v.substr(0, v.length - 1); + } + if (_colorLookup[v]) { + a = _colorLookup[v]; + } else if (v.charAt(0) === "#") { + if (v.length === 4) { //for shorthand like #9F0 + r = v.charAt(1); + g = v.charAt(2); + b = v.charAt(3); + v = "#" + r + r + g + g + b + b; + } + v = parseInt(v.substr(1), 16); + a = [v >> 16, (v >> 8) & 255, v & 255]; + } else if (v.substr(0, 3) === "hsl") { + a = wasHSL = v.match(_numExp); + if (!toHSL) { + h = (Number(a[0]) % 360) / 360; + s = Number(a[1]) / 100; + l = Number(a[2]) / 100; + g = (l <= 0.5) ? l * (s + 1) : l + s - l * s; + r = l * 2 - g; + if (a.length > 3) { + a[3] = Number(v[3]); + } + a[0] = _hue(h + 1 / 3, r, g); + a[1] = _hue(h, r, g); + a[2] = _hue(h - 1 / 3, r, g); + } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place. + return v.match(_relNumExp); + } + } else { + a = v.match(_numExp) || _colorLookup.transparent; + } + a[0] = Number(a[0]); + a[1] = Number(a[1]); + a[2] = Number(a[2]); + if (a.length > 3) { + a[3] = Number(a[3]); + } + } + if (toHSL && !wasHSL) { + r = a[0] / 255; + g = a[1] / 255; + b = a[2] / 255; + max = Math.max(r, g, b); + min = Math.min(r, g, b); + l = (max + min) / 2; + if (max === min) { + h = s = 0; + } else { + d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4; + h *= 60; + } + a[0] = (h + 0.5) | 0; + a[1] = (s * 100 + 0.5) | 0; + a[2] = (l * 100 + 0.5) | 0; + } + return a; + }, + _formatColors = function(s, toHSL) { + var colors = s.match(_colorExp) || [], + charIndex = 0, + parsed = colors.length ? "" : s, + i, color, temp; + for (i = 0; i < colors.length; i++) { + color = colors[i]; + temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); + charIndex += temp.length + color.length; + color = _parseColor(color, toHSL); + if (color.length === 3) { + color.push(1); + } + parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.join(",")) + ")"; + } + return parsed + s.substr(charIndex); + }, + _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc. + + for (p in _colorLookup) { + _colorExp += "|" + p + "\\b"; + } + _colorExp = new RegExp(_colorExp+")", "gi"); + + CSSPlugin.colorStringFilter = function(a) { + var combined = a[0] + a[1], + toHSL; + if (_colorExp.test(combined)) { + toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); + a[0] = _formatColors(a[0], toHSL); + a[1] = _formatColors(a[1], toHSL); + } + _colorExp.lastIndex = 0; + }; + + if (!TweenLite.defaultStringFilter) { + TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter; + } + + /** + * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned. + * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned. + * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't. + * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc. + * @return {Function} formatter function + */ + var _getFormatter = function(dflt, clr, collapsible, multi) { + if (dflt == null) { + return function(v) {return v;}; + } + var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "", + dVals = dflt.split(dColor).join("").match(_valuesExp) || [], + pfx = dflt.substr(0, dflt.indexOf(dVals[0])), + sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "", + delim = (dflt.indexOf(" ") !== -1) ? " " : ",", + numVals = dVals.length, + dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "", + formatter; + if (!numVals) { + return function(v) {return v;}; + } + if (clr) { + formatter = function(v) { + var color, vals, i, a; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + color = (v.match(_colorExp) || [dColor])[0]; + vals = v.split(color).join("").match(_valuesExp) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : ""); + }; + return formatter; + + } + formatter = function(v) { + var vals, a, i; + if (typeof(v) === "number") { + v += dSfx; + } else if (multi && _commasOutsideParenExp.test(v)) { + a = v.replace(_commasOutsideParenExp, "|").split("|"); + for (i = 0; i < a.length; i++) { + a[i] = formatter(a[i]); + } + return a.join(","); + } + vals = v.match(_valuesExp) || []; + i = vals.length; + if (numVals > i--) { + while (++i < numVals) { + vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; + } + } + return pfx + vals.join(delim) + sfx; + }; + return formatter; + }, + + /** + * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges. + * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft" + * @return {Function} a formatter function + */ + _getEdgeParser = function(props) { + props = props.split(","); + return function(t, e, p, cssp, pt, plugin, vars) { + var a = (e + "").split(" "), + i; + vars = {}; + for (i = 0; i < 4; i++) { + vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)]; + } + return cssp.parse(t, vars, pt, plugin); + }; + }, + + // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color. + _setPluginRatio = _internals._setPluginRatio = function(v) { + this.plugin.setRatio(v); + var d = this.data, + proxy = d.proxy, + mpt = d.firstMPT, + min = 0.000001, + val, pt, i, str, p; + while (mpt) { + val = proxy[mpt.v]; + if (mpt.r) { + val = Math.round(val); + } else if (val < min && val > -min) { + val = 0; + } + mpt.t[mpt.p] = val; + mpt = mpt._next; + } + if (d.autoRotate) { + d.autoRotate.rotation = d.mod ? d.mod(proxy.rotation, this.t) : proxy.rotation; //special case for ModifyPlugin to hook into an auto-rotating bezier + } + //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method. Same for "b" at the beginning. + if (v === 1 || v === 0) { + mpt = d.firstMPT; + p = (v === 1) ? "e" : "b"; + while (mpt) { + pt = mpt.t; + if (!pt.type) { + pt[p] = pt.s + pt.xs0; + } else if (pt.type === 1) { + str = pt.xs0 + pt.s + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt[p] = str; + } + mpt = mpt._next; + } + } + }, + + /** + * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value. + * @param {!Object} t target object whose property we're tweening (often a CSSPropTween) + * @param {!string} p property name + * @param {(number|string|object)} v value + * @param {MiniPropTween=} next next MiniPropTween in the linked list + * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer + */ + MiniPropTween = function(t, p, v, next, r) { + this.t = t; + this.p = p; + this.v = v; + this.r = r; + if (next) { + next._prev = this; + this._next = next; + } + }, + + /** + * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be rounded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element. + * This method returns an object that has the following properties: + * - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin. This is what we feed to the external _onInitTween() as the target + * - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values + * - firstMPT: the first MiniPropTween in the linked list + * - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter. + * @param {!Object} t target object to be tweened + * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed + * @param {!CSSPlugin} cssp The CSSPlugin instance + * @param {CSSPropTween=} pt the next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values + * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter. + * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions) + */ + _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) { + var bpt = pt, + start = {}, + end = {}, + transform = cssp._transform, + oldForce = _forcePT, + i, p, xp, mpt, firstPT; + cssp._transform = null; + _forcePT = vars; + pt = firstPT = cssp.parse(t, vars, pt, plugin); + _forcePT = oldForce; + //break off from the linked list so the new ones are isolated. + if (shallow) { + cssp._transform = transform; + if (bpt) { + bpt._prev = null; + if (bpt._prev) { + bpt._prev._next = null; + } + } + } + while (pt && pt !== bpt) { + if (pt.type <= 1) { + p = pt.p; + end[p] = pt.s + pt.c; + start[p] = pt.s; + if (!shallow) { + mpt = new MiniPropTween(pt, "s", p, mpt, pt.r); + pt.c = 0; + } + if (pt.type === 1) { + i = pt.l; + while (--i > 0) { + xp = "xn" + i; + p = pt.p + "_" + xp; + end[p] = pt.data[xp]; + start[p] = pt[xp]; + if (!shallow) { + mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]); + } + } + } + } + pt = pt._next; + } + return {proxy:start, end:end, firstMPT:mpt, pt:firstPT}; + }, + + + + /** + * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory. + * CSSPropTweens have the following optional properties as well (not defined through the constructor): + * - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc. + * - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list) + * - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subtweens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request. + * - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target. + * - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible. + * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything. + * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width". + * @param {number} s Starting numeric value + * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95. + * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it. + * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update. + * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip" + * @param {boolean=} r If true, the value(s) should be rounded + * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0. + * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues. + * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues. + */ + CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) { + this.t = t; //target + this.p = p; //property + this.s = s; //starting value + this.c = c; //change value + this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at) + if (!(t instanceof CSSPropTween)) { + _overwriteProps.push(this.n); + } + this.r = r; //round (boolean) + this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work + if (pr) { + this.pr = pr; + _hasPriority = true; + } + this.b = (b === undefined) ? s : b; + this.e = (e === undefined) ? s + c : e; + if (next) { + this._next = next; + next._prev = this; + } + }, + + _addNonTweeningNumericPT = function(target, prop, start, end, next, overwriteProp) { //cleans up some code redundancies and helps minification. Just a fast way to add a NUMERIC non-tweening CSSPropTween + var pt = new CSSPropTween(target, prop, start, end - start, next, -1, overwriteProp); + pt.b = start; + pt.e = pt.xs0 = end; + return pt; + }, + + /** + * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example: + * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt); + * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio(). + * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method. + * + * @param {!Object} t Target whose property will be tweened + * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow") + * @param {string} b Beginning value + * @param {string} e Ending value + * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization) + * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match + * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this). + * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0. + * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300} + * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call. + */ + _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) { + //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e); + b = b || dflt || ""; + if (typeof(e) === "function") { + e = e(_index, _target); + } + pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e); + e += ""; //ensures it's a string + if (clrs && _colorExp.test(e + b)) { //if colors are found, normalize the formatting to rgba() or hsla(). + e = [b, e]; + CSSPlugin.colorStringFilter(e); + b = e[0]; + e = e[1]; + } + var ba = b.split(", ").join(",").split(" "), //beginning array + ea = e.split(", ").join(",").split(" "), //ending array + l = ba.length, + autoRound = (_autoRound !== false), + i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL; + if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) { + ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); + l = ba.length; + } + if (l !== ea.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + ba = (dflt || "").split(" "); + l = ba.length; + } + pt.plugin = plugin; + pt.setRatio = setRatio; + _colorExp.lastIndex = 0; + for (i = 0; i < l; i++) { + bv = ba[i]; + ev = ea[i]; + bn = parseFloat(bv); + //if the value begins with a number (most common). It's fine if it has a suffix like px + if (bn || bn === 0) { + pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1), true); + + //if the value is a color + } else if (clrs && _colorExp.test(bv)) { + str = ev.indexOf(")") + 1; + str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it. + useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); + bv = _parseColor(bv, useHSL); + ev = _parseColor(ev, useHSL); + hasAlpha = (bv.length + ev.length > 6); + if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color + pt["xs" + pt.l] += pt.l ? " transparent" : "transparent"; + pt.e = pt.e.split(ea[i]).join("transparent"); + } else { + if (!_supportsOpacity) { //old versions of IE don't support rgba(). + hasAlpha = false; + } + if (useHSL) { + pt.appendXtra((hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) + .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) + .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); + } else { + pt.appendXtra((hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true) + .appendXtra("", bv[1], ev[1] - bv[1], ",", true) + .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), true); + } + + if (hasAlpha) { + bv = (bv.length < 4) ? 1 : bv[3]; + pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false); + } + } + _colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results. + + } else { + bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array + + //if no number is found, treat it as a non-tweening value and just append the string to the current xs. + if (!bnums) { + pt["xs" + pt.l] += (pt.l || pt["xs" + pt.l]) ? " " + ev : ev; + + //loop through all the numbers that are found and construct the extra values on the pt. + } else { + enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5 + if (!enums || enums.length !== bnums.length) { + //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); + return pt; + } + ni = 0; + for (xi = 0; xi < bnums.length; xi++) { + cv = bnums[xi]; + temp = bv.indexOf(cv, ni); + pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px"), (xi === 0)); + ni = temp + cv.length; + } + pt["xs" + pt.l] += bv.substr(ni); + } + } + } + //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly. + if (e.indexOf("=") !== -1) if (pt.data) { + str = pt.xs0 + pt.data.s; + for (i = 1; i < pt.l; i++) { + str += pt["xs" + i] + pt.data["xn" + i]; + } + pt.e = str + pt["xs" + i]; + } + if (!pt.l) { + pt.type = -1; + pt.xs0 = pt.e; + } + return pt.xfirst || pt; + }, + i = 9; + + + p = CSSPropTween.prototype; + p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc. + while (--i > 0) { + p["xn" + i] = 0; + p["xs" + i] = ""; + } + p.xs0 = ""; + p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null; + + + /** + * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this: + * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)" + * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method). + * @param {string=} pfx Prefix (if any) + * @param {!number} s Starting value + * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95. + * @param {string=} sfx Suffix (if any) + * @param {boolean=} r Round (if true). + * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space. + * @return {CSSPropTween} returns itself so that multiple methods can be chained together. + */ + p.appendXtra = function(pfx, s, c, sfx, r, pad) { + var pt = this, + l = pt.l; + pt["xs" + l] += (pad && (l || pt["xs" + l])) ? " " + pfx : pfx || ""; + if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value! + pt["xs" + l] += s + (sfx || ""); + return pt; + } + pt.l++; + pt.type = pt.setRatio ? 2 : 1; + pt["xs" + pt.l] = sfx || ""; + if (l > 0) { + pt.data["xn" + l] = s + c; + pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method) + pt["xn" + l] = s; + if (!pt.plugin) { + pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr); + pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly. + } + return pt; + } + pt.data = {s:s + c}; + pt.rxp = {}; + pt.s = s; + pt.c = c; + pt.r = r; + return pt; + }; + + /** + * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly. + * @param {!string} p Property name (like "boxShadow" or "throwProps") + * @param {Object=} options An object containing any of the following configuration options: + * - defaultValue: the default value + * - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker) + * - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.) + * - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O) + * - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc. + * - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0. + * - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out. + * - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc. + * - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default). + */ + var SpecialProp = function(p, options) { + options = options || {}; + this.p = options.prefix ? _checkPropPrefix(p) || p : p; + _specialProps[p] = _specialProps[this.p] = this; + this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi); + if (options.parser) { + this.parse = options.parser; + } + this.clrs = options.color; + this.multi = options.multi; + this.keyword = options.keyword; + this.dflt = options.defaultValue; + this.pr = options.priority || 0; + }, + + //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin. + _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) { + if (typeof(options) !== "object") { + options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin + } + var a = p.split(","), + d = options.defaultValue, + i, temp; + defaults = defaults || [d]; + for (i = 0; i < a.length; i++) { + options.prefix = (i === 0 && options.prefix); + options.defaultValue = defaults[i] || d; + temp = new SpecialProp(a[i], options); + } + }, + + //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file. + _registerPluginProp = _internals._registerPluginProp = function(p) { + if (!_specialProps[p]) { + var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin"; + _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var pluginClass = _globals.com.greensock.plugins[pluginName]; + if (!pluginClass) { + _log("Error: " + pluginName + " js file not loaded."); + return pt; + } + pluginClass._cssRegister(); + return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars); + }}); + } + }; + + + p = SpecialProp.prototype; + + /** + * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxShadow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list) + * @param {!Object} t target element + * @param {(string|number|object)} b beginning value + * @param {(string|number|object)} e ending (destination) value + * @param {CSSPropTween=} pt next CSSPropTween in the linked list + * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here. + * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here. + * @return {CSSPropTween=} First CSSPropTween in the linked list + */ + p.parseComplex = function(t, b, e, pt, plugin, setRatio) { + var kwd = this.keyword, + i, ba, ea, l, bi, ei; + //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example) + if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) { + ba = b.replace(_commasOutsideParenExp, "|").split("|"); + ea = e.replace(_commasOutsideParenExp, "|").split("|"); + } else if (kwd) { + ba = [b]; + ea = [e]; + } + if (ea) { + l = (ea.length > ba.length) ? ea.length : ba.length; + for (i = 0; i < l; i++) { + b = ba[i] = ba[i] || this.dflt; + e = ea[i] = ea[i] || this.dflt; + if (kwd) { + bi = b.indexOf(kwd); + ei = e.indexOf(kwd); + if (bi !== ei) { + if (ei === -1) { //if the keyword isn't in the end value, remove it from the beginning one. + ba[i] = ba[i].split(kwd).join(""); + } else if (bi === -1) { //if the keyword isn't in the beginning, add it. + ba[i] += " " + kwd; + } + } + } + } + b = ba.join(", "); + e = ea.join(", "); + } + return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio); + }; + + /** + * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call: + * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this); + * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that). + * @param {!Object} t Target object whose property is being tweened + * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object). + * @param {!string} p Property name + * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween. + * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it) + * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance. + * @param {Object=} vars Original vars object that contains the data for parsing. + * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call. + */ + p.parse = function(t, e, p, cssp, pt, plugin, vars) { + return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin); + }; + + /** + * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters: + * 1) Target object whose property should be tweened (typically a DOM element) + * 2) The end/destination value (could be a string, number, object, or whatever you want) + * 3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration) + * + * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example: + * + * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) { + * var start = target.style.width; + * return function(ratio) { + * target.style.width = (start + value * ratio) + "px"; + * console.log("set width to " + target.style.width); + * } + * }, 0); + * + * Then, when I do this tween, it will trigger my special property: + * + * TweenLite.to(element, 1, {css:{myCustomProp:100}}); + * + * In the example, of course, we're just changing the width, but you can do anything you want. + * + * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}}) + * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function. + * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones. + */ + CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) { + _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) { + var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority); + rv.plugin = plugin; + rv.setRatio = onInitTween(t, e, cssp._tween, p); + return rv; + }, priority:priority}); + }; + + + + + + + //transform-related methods and properties + CSSPlugin.useSVGTransformAttr = true; //Safari and Firefox both have some rendering bugs when applying CSS transforms to SVG elements, so default to using the "transform" attribute instead (users can override this). + var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent").split(","), + _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform. + _transformPropCSS = _prefixCSS + "transform", + _transformOriginProp = _checkPropPrefix("transformOrigin"), + _supports3D = (_checkPropPrefix("perspective") !== null), + Transform = _internals.Transform = function() { + this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0; + this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto"; + }, + _SVGElement = _gsScope.SVGElement, + _useSVGTransformAttr, + //Some browsers (like Firefox and IE) don't honor transform-origin properly in SVG elements, so we need to manually adjust the matrix accordingly. We feature detect here rather than always doing the conversion for certain browsers because they may fix the problem at some point in the future. + + _createSVG = function(type, container, attributes) { + var element = _doc.createElementNS("http://www.w3.org/2000/svg", type), + reg = /([a-z])([A-Z])/g, + p; + for (p in attributes) { + element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]); + } + container.appendChild(element); + return element; + }, + _docElement = _doc.documentElement || {}, + _forceSVGTransformAttr = (function() { + //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element + var force = _ieVers || (/Android/i.test(_agent) && !_gsScope.chrome), + svg, rect, width; + if (_doc.createElementNS && !force) { //IE8 and earlier doesn't support SVG anyway + svg = _createSVG("svg", _docElement); + rect = _createSVG("rect", svg, {width:100, height:50, x:100}); + width = rect.getBoundingClientRect().width; + rect.style[_transformOriginProp] = "50% 50%"; + rect.style[_transformProp] = "scaleX(0.5)"; + force = (width === rect.getBoundingClientRect().width && !(_isFirefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D). + _docElement.removeChild(svg); + } + return force; + })(), + _parseSVGOrigin = function(e, local, decoratee, absolute, smoothOrigin, skipRecord) { + var tm = e._gsTransform, + m = _getMatrix(e, true), + v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld; + if (tm) { + xOriginOld = tm.xOrigin; //record the original values before we alter them. + yOriginOld = tm.yOrigin; + } + if (!absolute || (v = absolute.split(" ")).length < 2) { + b = e.getBBox(); + if (b.x === 0 && b.y === 0 && b.width + b.height === 0) { //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case. + b = {x: parseFloat(e.hasAttribute("x") ? e.getAttribute("x") : e.hasAttribute("cx") ? e.getAttribute("cx") : 0) || 0, y: parseFloat(e.hasAttribute("y") ? e.getAttribute("y") : e.hasAttribute("cy") ? e.getAttribute("cy") : 0) || 0, width:0, height:0}; + } + local = _parsePosition(local).split(" "); + v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x, + (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y]; + } + decoratee.xOrigin = xOrigin = parseFloat(v[0]); + decoratee.yOrigin = yOrigin = parseFloat(v[1]); + if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas. + a = m[0]; + b = m[1]; + c = m[2]; + d = m[3]; + tx = m[4]; + ty = m[5]; + determinant = (a * d - b * c); + if (determinant) { //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero. + x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant); + y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant); + xOrigin = decoratee.xOrigin = v[0] = x; + yOrigin = decoratee.yOrigin = v[1] = y; + } + } + if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly + if (skipRecord) { + decoratee.xOffset = tm.xOffset; + decoratee.yOffset = tm.yOffset; + tm = decoratee; + } + if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) { + x = xOrigin - xOriginOld; + y = yOrigin - yOriginOld; + //originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility. + //tm.x -= x - (x * m[0] + y * m[2]); + //tm.y -= y - (x * m[1] + y * m[3]); + tm.xOffset += (x * m[0] + y * m[2]) - x; + tm.yOffset += (x * m[1] + y * m[3]) - y; + } else { + tm.xOffset = tm.yOffset = 0; + } + } + if (!skipRecord) { + e.setAttribute("data-svg-origin", v.join(" ")); + } + }, + _getBBoxHack = function(swapIfPossible) { //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a element and/or . We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it). + var svg = _createElement("svg", this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), + oldParent = this.parentNode, + oldSibling = this.nextSibling, + oldCSS = this.style.cssText, + bbox; + _docElement.appendChild(svg); + svg.appendChild(this); + this.style.display = "block"; + if (swapIfPossible) { + try { + bbox = this.getBBox(); + this._originalGetBBox = this.getBBox; + this.getBBox = _getBBoxHack; + } catch (e) { } + } else if (this._originalGetBBox) { + bbox = this._originalGetBBox(); + } + if (oldSibling) { + oldParent.insertBefore(this, oldSibling); + } else { + oldParent.appendChild(this); + } + _docElement.removeChild(svg); + this.style.cssText = oldCSS; + return bbox; + }, + _getBBox = function(e) { + try { + return e.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a or ). https://bugzilla.mozilla.org/show_bug.cgi?id=612118 + } catch (error) { + return _getBBoxHack.call(e, true); + } + }, + _isSVG = function(e) { //reports if the element is an SVG on which getBBox() actually works + return !!(_SVGElement && e.getCTM && _getBBox(e) && (!e.parentNode || e.ownerSVGElement)); + }, + _identity2DMatrix = [1,0,0,1,0,0], + _getMatrix = function(e, force2D) { + var tm = e._gsTransform || new Transform(), + rnd = 100000, + style = e.style, + isDefault, s, m, n, dec, none; + if (_transformProp) { + s = _getStyle(e, _transformPropCSS, null, true); + } else if (e.currentStyle) { + //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix. + s = e.currentStyle.filter.match(_ieGetMatrixExp); + s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; + } + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (isDefault && _transformProp && ((none = (_getComputedStyle(e).display === "none")) || !e.parentNode)) { + if (none) { //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". + n = style.display; + style.display = "block"; + } + if (!e.parentNode) { + dec = 1; //flag + _docElement.appendChild(e); + } + s = _getStyle(e, _transformPropCSS, null, true); + isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); + if (n) { + style.display = n; + } else if (none) { + _removeProp(style, "display"); + } + if (dec) { + _docElement.removeChild(e); + } + } + if (tm.svg || (e.getCTM && _isSVG(e))) { + if (isDefault && (style[_transformProp] + "").indexOf("matrix") !== -1) { //some browsers (like Chrome 40) don't correctly report transforms that are applied inline on an SVG element (they don't get included in the computed style), so we double-check here and accept matrix values + s = style[_transformProp]; + isDefault = 0; + } + m = e.getAttribute("transform"); + if (isDefault && m) { + if (m.indexOf("matrix") !== -1) { //just in case there's a "transform" value specified as an attribute instead of CSS style. Accept either a matrix() or simple translate() value though. + s = m; + isDefault = 0; + } else if (m.indexOf("translate") !== -1) { + s = "matrix(1,0,0,1," + m.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",") + ")"; + isDefault = 0; + } + } + } + if (isDefault) { + return _identity2DMatrix; + } + //split the matrix values out into an array (m for matrix) + m = (s || "").match(_numExp) || []; + i = m.length; + while (--i > -1) { + n = Number(m[i]); + m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example). + } + return (force2D && m.length > 6) ? [m[0], m[1], m[4], m[5], m[12], m[13]] : m; + }, + + /** + * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10. + * @param {!Object} t target element + * @param {Object=} cs computed style object (optional) + * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...} + * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style) + * @return {object} object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...} + */ + _getTransform = _internals.getTransform = function(t, cs, rec, parse) { + if (t._gsTransform && rec && !parse) { + return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things. + } + var tm = rec ? t._gsTransform || new Transform() : new Transform(), + invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent. + min = 0.00002, + rnd = 100000, + zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0, + defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0, + m, i, scaleX, scaleY, rotation, skewX; + + tm.svg = !!(t.getCTM && _isSVG(t)); + if (tm.svg) { + _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, cs, false, "50% 50%") + "", tm, t.getAttribute("data-svg-origin")); + _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr; + } + m = _getMatrix(t); + if (m !== _identity2DMatrix) { + + if (m.length === 16) { + //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values) + var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3], + a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7], + a13 = m[8], a23 = m[9], a33 = m[10], + a14 = m[12], a24 = m[13], a34 = m[14], + a43 = m[11], + angle = Math.atan2(a32, a33), + t1, t2, t3, t4, cos, sin; + + //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari + if (tm.zOrigin) { + a34 = -tm.zOrigin; + a14 = a13*a34-m[12]; + a24 = a23*a34-m[13]; + a34 = a33*a34+tm.zOrigin-m[14]; + } + tm.rotationX = angle * _RAD2DEG; + //rotationX + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + t3 = a32*cos+a33*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a32*-sin+a33*cos; + a43 = a42*-sin+a43*cos; + a12 = t1; + a22 = t2; + a32 = t3; + } + //rotationY + angle = Math.atan2(-a31, a33); + tm.rotationY = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + t1 = a11*cos-a13*sin; + t2 = a21*cos-a23*sin; + t3 = a31*cos-a33*sin; + a23 = a21*sin+a23*cos; + a33 = a31*sin+a33*cos; + a43 = a41*sin+a43*cos; + a11 = t1; + a21 = t2; + a31 = t3; + } + //rotationZ + angle = Math.atan2(a21, a11); + tm.rotation = angle * _RAD2DEG; + if (angle) { + cos = Math.cos(-angle); + sin = Math.sin(-angle); + a11 = a11*cos+a12*sin; + t2 = a21*cos+a22*sin; + a22 = a21*-sin+a22*cos; + a32 = a31*-sin+a32*cos; + a21 = t2; + } + + if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. + tm.rotationX = tm.rotation = 0; + tm.rotationY = 180 - tm.rotationY; + } + + tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd; + tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd; + tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd; + if (tm.rotationX || tm.rotationY) { + tm.skewX = 0; + } else { + tm.skewX = (a12 || a22) ? Math.atan2(a12, a22) * _RAD2DEG + tm.rotation : tm.skewX || 0; + if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { + if (invX) { + tm.scaleX *= -1; + tm.skewX += (tm.rotation <= 0) ? 180 : -180; + tm.rotation += (tm.rotation <= 0) ? 180 : -180; + } else { + tm.scaleY *= -1; + tm.skewX += (tm.skewX <= 0) ? 180 : -180; + } + } + } + tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; + tm.x = a14; + tm.y = a24; + tm.z = a34; + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a11 - tm.yOrigin * a12); + tm.y -= tm.yOrigin - (tm.yOrigin * a21 - tm.xOrigin * a22); + } + + } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY))) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those. + var k = (m.length >= 6), + a = k ? m[0] : 1, + b = m[1] || 0, + c = m[2] || 0, + d = k ? m[3] : 1; + tm.x = m[4] || 0; + tm.y = m[5] || 0; + scaleX = Math.sqrt(a * a + b * b); + scaleY = Math.sqrt(d * d + c * c); + rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). + skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; + if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { + if (invX) { + scaleX *= -1; + skewX += (rotation <= 0) ? 180 : -180; + rotation += (rotation <= 0) ? 180 : -180; + } else { + scaleY *= -1; + skewX += (skewX <= 0) ? 180 : -180; + } + } + tm.scaleX = scaleX; + tm.scaleY = scaleY; + tm.rotation = rotation; + tm.skewX = skewX; + if (_supports3D) { + tm.rotationX = tm.rotationY = tm.z = 0; + tm.perspective = defaultTransformPerspective; + tm.scaleZ = 1; + } + if (tm.svg) { + tm.x -= tm.xOrigin - (tm.xOrigin * a + tm.yOrigin * c); + tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); + } + } + tm.zOrigin = zOrigin; + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. + for (i in tm) { + if (tm[i] < min) if (tm[i] > -min) { + tm[i] = 0; + } + } + } + //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective+ ", origin: "+ tm.xOrigin+ ","+ tm.yOrigin); + if (rec) { + t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method) + if (tm.svg) { //if we're supposed to apply transforms to the SVG element's "transform" attribute, make sure there aren't any CSS transforms applied or they'll override the attribute ones. Also clear the transform attribute if we're using CSS, just to be clean. + if (_useSVGTransformAttr && t.style[_transformProp]) { + TweenLite.delayedCall(0.001, function(){ //if we apply this right away (before anything has rendered), we risk there being no transforms for a brief moment and it also interferes with adjusting the transformOrigin in a tween with immediateRender:true (it'd try reading the matrix and it wouldn't have the appropriate data in place because we just removed it). + _removeProp(t.style, _transformProp); + }); + } else if (!_useSVGTransformAttr && t.getAttribute("transform")) { + TweenLite.delayedCall(0.001, function(){ + t.removeAttribute("transform"); + }); + } + } + } + return tm; + }, + + //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms) + _setIETransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + ang = -t.rotation * _DEG2RAD, + skew = ang + t.skewX * _DEG2RAD, + rnd = 100000, + a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd, + b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd, + c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd, + d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd, + style = this.t.style, + cs = this.t.currentStyle, + filters, val; + if (!cs) { + return; + } + val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted) + b = -c; + c = -val; + filters = cs.filter; + style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight + var w = this.t.offsetWidth, + h = this.t.offsetHeight, + clip = (cs.position !== "absolute"), + m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d, + ox = t.x + (w * t.xPercent / 100), + oy = t.y + (h * t.yPercent / 100), + dx, dy; + + //if transformOrigin is being used, adjust the offset x and y + if (t.ox != null) { + dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2; + dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2; + ox += dx - (dx * a + dy * b); + oy += dy - (dx * c + dy * d); + } + + if (!clip) { + m += ", sizingMethod='auto expand')"; + } else { + dx = (w / 2); + dy = (h / 2); + //translate to ensure that transformations occur around the correct origin (default is center). + m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")"; + } + if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) { + style.filter = filters.replace(_ieSetMatrixExp, m); + } else { + style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha. + } + + //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance. + if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) { + style.removeAttribute("filter"); + } + + //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration). + if (!clip) { + var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom + marg, prop, dif; + dx = t.ieOffsetX || 0; + dy = t.ieOffsetY || 0; + t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox); + t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy); + for (i = 0; i < 4; i++) { + prop = _margins[i]; + marg = cs[prop]; + //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes) + val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0; + if (val !== t[prop]) { + dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible. + } else { + dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY; + } + style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px"; + } + } + }, + + /* translates a super small decimal to a string WITHOUT scientific notation + _safeDecimal = function(n) { + var s = (n < 0 ? -n : n) + "", + a = s.split("e-"); + return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join(""); + }, + */ + + _setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) { + var t = this.data, //refers to the element's _gsTransform object + style = this.t.style, + angle = t.rotation, + rotationX = t.rotationX, + rotationY = t.rotationY, + sx = t.scaleX, + sy = t.scaleY, + sz = t.scaleZ, + x = t.x, + y = t.y, + z = t.z, + isSVG = t.svg, + perspective = t.perspective, + force3D = t.force3D, + skewY = t.skewY, + skewX = t.skewX, + t1, a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, + zOrigin, min, cos, sin, t2, transform, comma, zero, skew, rnd; + if (skewY) { //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees. + skewX += skewY; + angle += skewY; + } + + //check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true) + if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX && sz === 1) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween. + + //2D + if (angle || skewX || isSVG) { + angle *= _DEG2RAD; + skew = skewX * _DEG2RAD; + rnd = 100000; + a11 = Math.cos(angle) * sx; + a21 = Math.sin(angle) * sx; + a12 = Math.sin(angle - skew) * -sy; + a22 = Math.cos(angle - skew) * sy; + if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan(skew - skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a12 *= t1; + a22 *= t1; + if (skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + if (isSVG) { + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + if (_useSVGTransformAttr && (t.xPercent || t.yPercent)) { //The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the matrix to simulate it. + min = this.t.getBBox(); + x += t.xPercent * 0.01 * min.width; + y += t.yPercent * 0.01 * min.height; + } + min = 0.000001; + if (x < min) if (x > -min) { + x = 0; + } + if (y < min) if (y > -min) { + y = 0; + } + } + transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")"; + if (isSVG && _useSVGTransformAttr) { + this.t.setAttribute("transform", "matrix(" + transform); + } else { + //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places. + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform; + } + } else { + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")"; + } + return; + + } + if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue. + min = 0.0001; + if (sx < min && sx > -min) { + sx = sz = 0.00002; + } + if (sy < min && sy > -min) { + sy = sz = 0.00002; + } + if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z). + perspective = 0; + } + } + if (angle || skewX) { + angle *= _DEG2RAD; + cos = a11 = Math.cos(angle); + sin = a21 = Math.sin(angle); + if (skewX) { + angle -= skewX * _DEG2RAD; + cos = Math.cos(angle); + sin = Math.sin(angle); + if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does + t1 = Math.tan((skewX - skewY) * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + cos *= t1; + sin *= t1; + if (t.skewY) { + t1 = Math.tan(skewY * _DEG2RAD); + t1 = Math.sqrt(1 + t1 * t1); + a11 *= t1; + a21 *= t1; + } + } + } + a12 = -sin; + a22 = cos; + + } else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster... + style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : ""); + return; + } else { + a11 = a22 = 1; + a12 = a21 = 0; + } + // KEY INDEX AFFECTS + // a11 0 rotation, rotationY, scaleX + // a21 1 rotation, rotationY, scaleX + // a31 2 rotationY, scaleX + // a41 3 rotationY, scaleX + // a12 4 rotation, skewX, rotationX, scaleY + // a22 5 rotation, skewX, rotationX, scaleY + // a32 6 rotationX, scaleY + // a42 7 rotationX, scaleY + // a13 8 rotationY, rotationX, scaleZ + // a23 9 rotationY, rotationX, scaleZ + // a33 10 rotationY, rotationX, scaleZ + // a43 11 rotationY, rotationX, perspective, scaleZ + // a14 12 x, zOrigin, svgOrigin + // a24 13 y, zOrigin, svgOrigin + // a34 14 z, zOrigin + // a44 15 + // rotation: Math.atan2(a21, a11) + // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11)) + // rotationX: Math.atan2(a32, a33) + a33 = 1; + a13 = a23 = a31 = a32 = a41 = a42 = 0; + a43 = (perspective) ? -1 / perspective : 0; + zOrigin = t.zOrigin; + min = 0.000001; //threshold below which browsers use scientific notation which won't work. + comma = ","; + zero = "0"; + angle = rotationY * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + a31 = -sin; + a41 = a43*-sin; + a13 = a11*sin; + a23 = a21*sin; + a33 = cos; + a43 *= cos; + a11 *= cos; + a21 *= cos; + } + angle = rotationX * _DEG2RAD; + if (angle) { + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a12*cos+a13*sin; + t2 = a22*cos+a23*sin; + a32 = a33*sin; + a42 = a43*sin; + a13 = a12*-sin+a13*cos; + a23 = a22*-sin+a23*cos; + a33 = a33*cos; + a43 = a43*cos; + a12 = t1; + a22 = t2; + } + if (sz !== 1) { + a13*=sz; + a23*=sz; + a33*=sz; + a43*=sz; + } + if (sy !== 1) { + a12*=sy; + a22*=sy; + a32*=sy; + a42*=sy; + } + if (sx !== 1) { + a11*=sx; + a21*=sx; + a31*=sx; + a41*=sx; + } + + if (zOrigin || isSVG) { + if (zOrigin) { + x += a13*-zOrigin; + y += a23*-zOrigin; + z += a33*-zOrigin+zOrigin; + } + if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually + x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; + y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; + } + if (x < min && x > -min) { + x = zero; + } + if (y < min && y > -min) { + y = zero; + } + if (z < min && z > -min) { + z = 0; //don't use string because we calculate perspective later and need the number. + } + } + + //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall: + transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d("); + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + if (rotationX || rotationY || sz !== 1) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations) + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + } else { + transform += ",0,0,0,0,1,0,"; + } + transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")"; + + style[_transformProp] = transform; + }; + + p = Transform.prototype; + p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = p.xOffset = p.yOffset = 0; + p.scaleX = p.scaleY = p.scaleZ = 1; + + _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {parser:function(t, e, parsingProp, cssp, pt, plugin, vars) { + if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it. + cssp._lastParsedTransform = vars; + var scaleFunc = (vars.scale && typeof(vars.scale) === "function") ? vars.scale : 0, //if there's a function-based "scale" value, swap in the resulting numeric value temporarily. Otherwise, if it's called for both scaleX and scaleY independently, they may not match (like if the function uses Math.random()). + swapFunc; + if (typeof(vars[parsingProp]) === "function") { //whatever property triggers the initial parsing might be a function-based value in which case it already got called in parse(), thus we don't want to call it again in here. The most efficient way to avoid this is to temporarily swap the value directly into the vars object, and then after we do all our parsing in this function, we'll swap it back again. + swapFunc = vars[parsingProp]; + vars[parsingProp] = e; + } + if (scaleFunc) { + vars.scale = scaleFunc(_index, t); + } + var originalGSTransform = t._gsTransform, + style = t.style, + min = 0.000001, + i = _transformProps.length, + v = vars, + endRotations = {}, + transformOriginString = "transformOrigin", + m1 = _getTransform(t, _cs, true, v.parseTransform), + orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform), + m2, copy, has3D, hasChange, dr, x, y, matrix, p; + cssp._transform = m1; + if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" + copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. + copy[_transformProp] = orig; + copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly. + copy.position = "absolute"; + _doc.body.appendChild(_tempDiv); + m2 = _getTransform(_tempDiv, null, false); + if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here... + x = m1.xOrigin; + y = m1.yOrigin; + m2.x -= m1.xOffset; + m2.y -= m1.yOffset; + if (v.transformOrigin || v.svgOrigin) { //if this tween is altering the origin, we must factor that in here. The actual work of recording the transformOrigin values and setting up the PropTween is done later (still inside this function) so we cannot leave the changes intact here - we only want to update the x/y accordingly. + orig = {}; + _parseSVGOrigin(t, _parsePosition(v.transformOrigin), orig, v.svgOrigin, v.smoothOrigin, true); + x = orig.xOrigin; + y = orig.yOrigin; + m2.x -= orig.xOffset - m1.xOffset; + m2.y -= orig.yOffset - m1.yOffset; + } + if (x || y) { + matrix = _getMatrix(_tempDiv, true); + m2.x -= x - (x * matrix[0] + y * matrix[2]); + m2.y -= y - (x * matrix[1] + y * matrix[3]); + } + } + _doc.body.removeChild(_tempDiv); + if (!m2.perspective) { + m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case. + } + if (v.xPercent != null) { + m2.xPercent = _parseVal(v.xPercent, m1.xPercent); + } + if (v.yPercent != null) { + m2.yPercent = _parseVal(v.yPercent, m1.yPercent); + } + } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object) + m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX), + scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY), + scaleZ:_parseVal(v.scaleZ, m1.scaleZ), + x:_parseVal(v.x, m1.x), + y:_parseVal(v.y, m1.y), + z:_parseVal(v.z, m1.z), + xPercent:_parseVal(v.xPercent, m1.xPercent), + yPercent:_parseVal(v.yPercent, m1.yPercent), + perspective:_parseVal(v.transformPerspective, m1.perspective)}; + dr = v.directionalRotation; + if (dr != null) { + if (typeof(dr) === "object") { + for (copy in dr) { + v[copy] = dr[copy]; + } + } else { + v.rotation = dr; + } + } + if (typeof(v.x) === "string" && v.x.indexOf("%") !== -1) { + m2.x = 0; + m2.xPercent = _parseVal(v.x, m1.xPercent); + } + if (typeof(v.y) === "string" && v.y.indexOf("%") !== -1) { + m2.y = 0; + m2.yPercent = _parseVal(v.y, m1.yPercent); + } + + m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : ("rotationZ" in v) ? v.rotationZ : m1.rotation, m1.rotation, "rotation", endRotations); + if (_supports3D) { + m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations); + m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations); + } + m2.skewX = _parseAngle(v.skewX, m1.skewX); + m2.skewY = _parseAngle(v.skewY, m1.skewY); + } + if (_supports3D && v.force3D != null) { + m1.force3D = v.force3D; + hasChange = true; + } + + m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; + + has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); + if (!has3D && v.scale != null) { + m2.scaleZ = 1; //no need to tween scaleZ. + } + + while (--i > -1) { + p = _transformProps[i]; + orig = m2[p] - m1[p]; + if (orig > min || orig < -min || v[p] != null || _forcePT[p] != null) { + hasChange = true; + pt = new CSSPropTween(m1, p, m1[p], orig, pt); + if (p in endRotations) { + pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested + } + pt.xs0 = 0; //ensures the value stays numeric in setRatio() + pt.plugin = plugin; + cssp._overwriteProps.push(pt.n); + } + } + + orig = v.transformOrigin; + if (m1.svg && (orig || v.svgOrigin)) { + x = m1.xOffset; //when we change the origin, in order to prevent things from jumping we adjust the x/y so we must record those here so that we can create PropTweens for them and flip them at the same time as the origin + y = m1.yOffset; + _parseSVGOrigin(t, _parsePosition(orig), m2, v.svgOrigin, v.smoothOrigin); + pt = _addNonTweeningNumericPT(m1, "xOrigin", (originalGSTransform ? m1 : m2).xOrigin, m2.xOrigin, pt, transformOriginString); //note: if there wasn't a transformOrigin defined yet, just start with the destination one; it's wasteful otherwise, and it causes problems with fromTo() tweens. For example, TweenLite.to("#wheel", 3, {rotation:180, transformOrigin:"50% 50%", delay:1}); TweenLite.fromTo("#wheel", 3, {scale:0.5, transformOrigin:"50% 50%"}, {scale:1, delay:2}); would cause a jump when the from values revert at the beginning of the 2nd tween. + pt = _addNonTweeningNumericPT(m1, "yOrigin", (originalGSTransform ? m1 : m2).yOrigin, m2.yOrigin, pt, transformOriginString); + if (x !== m1.xOffset || y !== m1.yOffset) { + pt = _addNonTweeningNumericPT(m1, "xOffset", (originalGSTransform ? x : m1.xOffset), m1.xOffset, pt, transformOriginString); + pt = _addNonTweeningNumericPT(m1, "yOffset", (originalGSTransform ? y : m1.yOffset), m1.yOffset, pt, transformOriginString); + } + orig = "0px 0px"; //certain browsers (like firefox) completely botch transform-origin, so we must remove it to prevent it from contaminating transforms. We manage it ourselves with xOrigin and yOrigin + } + if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly). + if (_transformProp) { + hasChange = true; + p = _transformOriginProp; + orig = (orig || _getStyle(t, p, _cs, false, "50% 50%")) + ""; //cast as string to avoid errors + pt = new CSSPropTween(style, p, 0, 0, pt, -1, transformOriginString); + pt.b = style[p]; + pt.plugin = plugin; + if (_supports3D) { + copy = m1.zOrigin; + orig = orig.split(" "); + m1.zOrigin = ((orig.length > 2 && !(copy !== 0 && orig[2] === "0px")) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method. + pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)! + pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here) + pt.b = copy; + pt.xs0 = pt.e = m1.zOrigin; + } else { + pt.xs0 = pt.e = orig; + } + + //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp). + } else { + _parsePosition(orig + "", m1); + } + } + if (hasChange) { + cssp._transformType = (!(m1.svg && _useSVGTransformAttr) && (has3D || this._transformType === 3)) ? 3 : 2; //quicker than calling cssp._enableTransforms(); + } + if (swapFunc) { + vars[parsingProp] = swapFunc; + } + if (scaleFunc) { + vars.scale = scaleFunc; + } + return pt; + }, prefix:true}); + + _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"}); + + _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + e = this.format(e); + var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"], + style = t.style, + ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em; + w = parseFloat(t.offsetWidth); + h = parseFloat(t.offsetHeight); + ea1 = e.split(" "); + for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis! + if (this.p.indexOf("border")) { //older browsers used a prefix + props[i] = _checkPropPrefix(props[i]); + } + bs = bs2 = _getStyle(t, props[i], _cs, false, "0px"); + if (bs.indexOf(" ") !== -1) { + bs2 = bs.split(" "); + bs = bs2[0]; + bs2 = bs2[1]; + } + es = es2 = ea1[i]; + bn = parseFloat(bs); + bsfx = bs.substr((bn + "").length); + rel = (es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0)+"1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || ""; + } else { + en = parseFloat(es); + esfx = es.substr((en + "").length); + } + if (esfx === "") { + esfx = _suffixMap[p] || bsfx; + } + if (esfx !== bsfx) { + hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent. + vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number + if (esfx === "%") { + bs = (hn / w * 100) + "%"; + bs2 = (vn / h * 100) + "%"; + } else if (esfx === "em") { + em = _convertToPixels(t, "borderLeft", 1, "em"); + bs = (hn / em) + "em"; + bs2 = (vn / em) + "em"; + } else { + bs = hn + "px"; + bs2 = vn + "px"; + } + if (rel) { + es = (parseFloat(bs) + en) + esfx; + es2 = (parseFloat(bs2) + en) + esfx; + } + } + pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt); + } + return pt; + }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)}); + _registerComplexSpecialProp("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { + return _parseComplex(t.style, p, this.format(_getStyle(t, p, _cs, false, "0px 0px")), this.format(e), false, "0px", pt); + }, prefix:true, formatter:_getFormatter("0px 0px", false, true)}); + _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) { + var bp = "background-position", + cs = (_cs || _getComputedStyle(t, null)), + bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase + es = this.format(e), + ba, ea, i, pct, overlap, src; + if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1) && es.split(",").length < 2) { + src = _getStyle(t, "backgroundImage").replace(_urlExp, ""); + if (src && src !== "none") { + ba = bs.split(" "); + ea = es.split(" "); + _tempImg.setAttribute("src", src); //set the temp IMG's src to the background-image so that we can measure its width/height + i = 2; + while (--i > -1) { + bs = ba[i]; + pct = (bs.indexOf("%") !== -1); + if (pct !== (ea[i].indexOf("%") !== -1)) { + overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height; + ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%"; + } + } + bs = ba.join(" "); + } + } + return this.parseComplex(t.style, bs, es, pt, plugin); + }, formatter:_parsePosition}); + _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:function(v) { + v += ""; //ensure it's a string + return _parsePosition(v.indexOf(" ") === -1 ? v + " " + v : v); //if set to something like "100% 100%", Safari typically reports the computed style as just "100%" (no 2nd value), but we should ensure that there are two values, so copy the first one. Otherwise, it'd be interpreted as "100% 0" (wrong). + }}); + _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true}); + _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true}); + _registerComplexSpecialProp("transformStyle", {prefix:true}); + _registerComplexSpecialProp("backfaceVisibility", {prefix:true}); + _registerComplexSpecialProp("userSelect", {prefix:true}); + _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")}); + _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")}); + _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){ + var b, cs, delim; + if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited. + cs = t.currentStyle; + delim = _ieVers < 8 ? " " : ","; + b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")"; + e = this.format(e).split(",").join(delim); + } else { + b = this.format(_getStyle(t, this.p, _cs, false, this.dflt)); + e = this.format(e); + } + return this.parseComplex(t.style, b, e, pt, plugin); + }}); + _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true}); + _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them) + _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) { + var bw = _getStyle(t, "borderTopWidth", _cs, false, "0px"), + end = this.format(e).split(" "), + esfx = end[0].replace(_suffixExp, ""); + if (esfx !== "px") { //if we're animating to a non-px value, we need to convert the beginning width to that unit. + bw = (parseFloat(bw) / _convertToPixels(t, "borderTopWidth", 1, esfx)) + esfx; + } + return this.parseComplex(t.style, this.format(bw + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), end.join(" "), pt, plugin); + }, color:true, formatter:function(v) { + var a = v.split(" "); + return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0]; + }}); + _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline). + _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) { + var s = t.style, + prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat"; + return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e); + }}); + + //opacity-related + var _setIEOpacityRatio = function(v) { + var t = this.t, //refers to the element's style property + filters = t.filter || _getStyle(this.data, "filter") || "", + val = (this.s + this.c * v) | 0, + skip; + if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters. + if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) { + t.removeAttribute("filter"); + skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check. + } else { + t.filter = filters.replace(_alphaFilterExp, ""); + skip = true; + } + } + if (!skip) { + if (this.xn1) { + t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame. + } + if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues + if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween) + t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly. + } + } else { + t.filter = filters.replace(_opacityExp, "opacity=" + val); + } + } + }; + _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) { + var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")), + style = t.style, + isAutoAlpha = (p === "autoAlpha"); + if (typeof(e) === "string" && e.charAt(1) === "=") { + e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b; + } + if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience) + b = 0; + } + if (_supportsOpacity) { + pt = new CSSPropTween(style, "opacity", b, e - b, pt); + } else { + pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt); + pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug. + style.zoom = 1; //helps correct an IE issue. + pt.type = 2; + pt.b = "alpha(opacity=" + pt.s + ")"; + pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")"; + pt.data = t; + pt.plugin = plugin; + pt.setRatio = _setIEOpacityRatio; + } + if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier + pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); + pt.xs0 = "inherit"; + cssp._overwriteProps.push(pt.n); + cssp._overwriteProps.push(p); + } + return pt; + }}); + + + var _removeProp = function(s, p) { + if (p) { + if (s.removeProperty) { + if (p.substr(0,2) === "ms" || p.substr(0,6) === "webkit") { //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example) + p = "-" + p; + } + s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); + } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()" + s.removeAttribute(p); + } + } + }, + _setClassNameRatio = function(v) { + this.t._gsClassPT = this; + if (v === 1 || v === 0) { + this.t.setAttribute("class", (v === 0) ? this.b : this.e); + var mpt = this.data, //first MiniPropTween + s = this.t.style; + while (mpt) { + if (!mpt.v) { + _removeProp(s, mpt.p); + } else { + s[mpt.p] = mpt.v; + } + mpt = mpt._next; + } + if (v === 1 && this.t._gsClassPT === this) { + this.t._gsClassPT = null; + } + } else if (this.t.getAttribute("class") !== this.e) { + this.t.setAttribute("class", this.e); + } + }; + _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) { + var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable. + cssText = t.style.cssText, + difData, bs, cnpt, cnptLookup, mpt; + pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClassNameRatio; + pt.pr = -11; + _hasPriority = true; + pt.b = b; + bs = _getAllStyles(t, _cs); + //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfering that were there just for class-specific values) + cnpt = t._gsClassPT; + if (cnpt) { + cnptLookup = {}; + mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned. + while (mpt) { + cnptLookup[mpt.p] = 1; + mpt = mpt._next; + } + cnpt.setRatio(1); + } + t._gsClassPT = pt; + pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("(?:\\s|^)" + e.substr(2) + "(?![\\w-])"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : ""); + t.setAttribute("class", pt.e); + difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup); + t.setAttribute("class", b); + pt.data = difData.firstMPT; + t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). + pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself) + return pt; + }}); + + + var _setClearPropsRatio = function(v) { + if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in). + var s = this.t.style, + transformParse = _specialProps.transform.parse, + a, p, i, clearTransform, transform; + if (this.e === "all") { + s.cssText = ""; + clearTransform = true; + } else { + a = this.e.split(" ").join("").split(","); + i = a.length; + while (--i > -1) { + p = a[i]; + if (_specialProps[p]) { + if (_specialProps[p].parse === transformParse) { + clearTransform = true; + } else { + p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow" + } + } + _removeProp(s, p); + } + } + if (clearTransform) { + _removeProp(s, _transformProp); + transform = this.t._gsTransform; + if (transform) { + if (transform.svg) { + this.t.removeAttribute("data-svg-origin"); + this.t.removeAttribute("transform"); + } + delete this.t._gsTransform; + } + } + + } + }; + _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) { + pt = new CSSPropTween(t, p, 0, 0, pt, 2); + pt.setRatio = _setClearPropsRatio; + pt.e = e; + pt.pr = -10; + pt.data = cssp._tween; + _hasPriority = true; + return pt; + }}); + + p = "bezier,throwProps,physicsProps,physics2D".split(","); + i = p.length; + while (i--) { + _registerPluginProp(p[i]); + } + + + + + + + + + p = CSSPlugin.prototype; + p._firstPT = p._lastParsedTransform = p._transform = null; + + //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc. + p._onInitTween = function(target, vars, tween, index) { + if (!target.nodeType) { //css is only for dom elements + return false; + } + this._target = _target = target; + this._tween = tween; + this._vars = vars; + _index = index; + _autoRound = vars.autoRound; + _hasPriority = false; + _suffixMap = vars.suffixMap || CSSPlugin.suffixMap; + _cs = _getComputedStyle(target, ""); + _overwriteProps = this._overwriteProps; + var style = target.style, + v, pt, pt2, first, last, next, zIndex, tpt, threeD; + if (_reqSafariFix) if (style.zIndex === "") { + v = _getStyle(target, "zIndex", _cs); + if (v === "auto" || v === "") { + //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive. + this._addLazySet(style, "zIndex", 0); + } + } + + if (typeof(vars) === "string") { + first = style.cssText; + v = _getAllStyles(target, _cs); + style.cssText = first + ";" + vars; + v = _cssDif(target, v, _getAllStyles(target)).difs; + if (!_supportsOpacity && _opacityValExp.test(vars)) { + v.opacity = parseFloat( RegExp.$1 ); + } + vars = v; + style.cssText = first; + } + + if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work. + this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars); + } else { + this._firstPT = pt = this.parse(target, vars, null); + } + + if (this._transformType) { + threeD = (this._transformType === 3); + if (!_transformProp) { + style.zoom = 1; //helps correct an IE issue. + } else if (_isSafari) { + _reqSafariFix = true; + //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random). + if (style.zIndex === "") { + zIndex = _getStyle(target, "zIndex", _cs); + if (zIndex === "auto" || zIndex === "") { + this._addLazySet(style, "zIndex", 0); + } + } + //Setting WebkitBackfaceVisibility corrects 3 bugs: + // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update. + // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. + // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug. + //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween. + if (_isSafariLT6) { + this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden")); + } + } + pt2 = pt; + while (pt2 && pt2._next) { + pt2 = pt2._next; + } + tpt = new CSSPropTween(target, "transform", 0, 0, null, 2); + this._linkCSSP(tpt, null, pt2); + tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio; + tpt.data = this._transform || _getTransform(target, _cs, true); + tpt.tween = tween; + tpt.pr = -1; //ensures that the transforms get applied after the components are updated. + _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here. + } + + if (_hasPriority) { + //reorders the linked list in order of pr (priority) + while (pt) { + next = pt._next; + pt2 = first; + while (pt2 && pt2.pr > pt.pr) { + pt2 = pt2._next; + } + if ((pt._prev = pt2 ? pt2._prev : last)) { + pt._prev._next = pt; + } else { + first = pt; + } + if ((pt._next = pt2)) { + pt2._prev = pt; + } else { + last = pt; + } + pt = next; + } + this._firstPT = first; + } + return true; + }; + + + p.parse = function(target, vars, pt, plugin) { + var style = target.style, + p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel; + for (p in vars) { + es = vars[p]; //ending value string + if (typeof(es) === "function") { + es = es(_index, _target); + } + sp = _specialProps[p]; //SpecialProp lookup. + if (sp) { + pt = sp.parse(target, es, p, this, pt, plugin, vars); + + } else { + bs = _getStyle(target, p, _cs) + ""; + isStr = (typeof(es) === "string"); + if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor: + if (!isStr) { + es = _parseColor(es); + es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")"; + } + pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin); + + } else if (isStr && _complexExp.test(es)) { + pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin); + + } else { + bn = parseFloat(bs); + bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case. + + if (bs === "" || bs === "auto") { + if (p === "width" || p === "height") { + bn = _getDimension(target, p, _cs); + bsfx = "px"; + } else if (p === "left" || p === "top") { + bn = _calculateOffset(target, p, _cs); + bsfx = "px"; + } else { + bn = (p !== "opacity") ? 0 : 1; + bsfx = ""; + } + } + + rel = (isStr && es.charAt(1) === "="); + if (rel) { + en = parseInt(es.charAt(0) + "1", 10); + es = es.substr(2); + en *= parseFloat(es); + esfx = es.replace(_suffixExp, ""); + } else { + en = parseFloat(es); + esfx = isStr ? es.replace(_suffixExp, "") : ""; + } + + if (esfx === "") { + esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix. + } + + es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. + + //if the beginning/ending suffixes don't match, normalize them... + if (bsfx !== esfx) if (esfx !== "") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! + bn = _convertToPixels(target, p, bn, bsfx); + if (esfx === "%") { + bn /= _convertToPixels(target, p, 100, "%") / 100; + if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens. + bs = bn + "%"; + } + + } else if (esfx === "em" || esfx === "rem" || esfx === "vw" || esfx === "vh") { + bn /= _convertToPixels(target, p, 1, esfx); + + //otherwise convert to pixels. + } else if (esfx !== "px") { + en = _convertToPixels(target, p, en, esfx); + esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too. + } + if (rel) if (en || en === 0) { + es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here. + } + } + + if (rel) { + en += bn; + } + + if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly. + pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es); + pt.xs0 = esfx; + //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0); + } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) { + _log("invalid " + p + " tween value: " + vars[p]); + } else { + pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es); + pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween. + //DEBUG: _log("non-tweening value "+p+": "+pt.xs0); + } + } + } + if (plugin) if (pt && !pt.plugin) { + pt.plugin = plugin; + } + } + return pt; + }; + + + //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1. + p.setRatio = function(v) { + var pt = this._firstPT, + min = 0.000001, + val, str, i; + //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards). + if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) { + while (pt) { + if (pt.type !== 2) { + if (pt.r && pt.type !== -1) { + val = Math.round(pt.s + pt.c); + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + } else { + pt.t[pt.p] = pt.e; + } + } else { + pt.setRatio(v); + } + pt = pt._next; + } + + } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) { + while (pt) { + val = pt.c * v + pt.s; + if (pt.r) { + val = Math.round(val); + } else if (val < min) if (val > -min) { + val = 0; + } + if (!pt.type) { + pt.t[pt.p] = val + pt.xs0; + } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" + i = pt.l; + if (i === 2) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2; + } else if (i === 3) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3; + } else if (i === 4) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4; + } else if (i === 5) { + pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5; + } else { + str = pt.xs0 + val + pt.xs1; + for (i = 1; i < pt.l; i++) { + str += pt["xn"+i] + pt["xs"+(i+1)]; + } + pt.t[pt.p] = str; + } + + } else if (pt.type === -1) { //non-tweening value + pt.t[pt.p] = pt.xs0; + + } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc. + pt.setRatio(v); + } + pt = pt._next; + } + + //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever). + } else { + while (pt) { + if (pt.type !== 2) { + pt.t[pt.p] = pt.b; + } else { + pt.setRatio(v); + } + pt = pt._next; + } + } + }; + + /** + * @private + * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called. + * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked + * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call + * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin + * doesn't have any transform-related properties of its own. You can call this method as many times as you + * want and it won't create duplicate CSSPropTweens. + * + * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster) + */ + p._enableTransforms = function(threeD) { + this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values. + this._transformType = (!(this._transform.svg && _useSVGTransformAttr) && (threeD || this._transformType === 3)) ? 3 : 2; + }; + + var lazySet = function(v) { + this.t[this.p] = this.e; + this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop. + }; + /** @private Gives us a way to set a value on the first render (and only the first render). **/ + p._addLazySet = function(t, p, v) { + var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2); + pt.e = v; + pt.setRatio = lazySet; + pt.data = this; + }; + + /** @private **/ + p._linkCSSP = function(pt, next, prev, remove) { + if (pt) { + if (next) { + next._prev = pt; + } + if (pt._next) { + pt._next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = pt._next; + } else if (this._firstPT === pt) { + this._firstPT = pt._next; + remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) + } + if (prev) { + prev._next = pt; + } else if (!remove && this._firstPT === null) { + this._firstPT = pt; + } + pt._next = next; + pt._prev = prev; + } + return pt; + }; + + p._mod = function(lookup) { + var pt = this._firstPT; + while (pt) { + if (typeof(lookup[pt.p]) === "function" && lookup[pt.p] === Math.round) { //only gets called by RoundPropsPlugin (ModifyPlugin manages all the rendering internally for CSSPlugin properties that need modification). Remember, we handle rounding a bit differently in this plugin for performance reasons, leveraging "r" as an indicator that the value should be rounded internally.. + pt.r = 1; + } + pt = pt._next; + } + }; + + //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property. + p._kill = function(lookup) { + var copy = lookup, + pt, p, xfirst; + if (lookup.autoAlpha || lookup.alpha) { + copy = {}; + for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere. + copy[p] = lookup[p]; + } + copy.opacity = 1; + if (copy.autoAlpha) { + copy.visibility = 1; + } + } + if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst". + xfirst = pt.xfirst; + if (xfirst && xfirst._prev) { + this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev + } else if (xfirst === this._firstPT) { + this._firstPT = pt._next; + } + if (pt._next) { + this._linkCSSP(pt._next, pt._next._next, xfirst._prev); + } + this._classNamePT = null; + } + pt = this._firstPT; + while (pt) { + if (pt.plugin && pt.plugin !== p && pt.plugin._kill) { //for plugins that are registered with CSSPlugin, we should notify them of the kill. + pt.plugin._kill(lookup); + p = pt.plugin; + } + pt = pt._next; + } + return TweenPlugin.prototype._kill.call(this, copy); + }; + + + + //used by cascadeTo() for gathering all the style properties of each child element into an array for comparison. + var _getChildStyles = function(e, props, targets) { + var children, i, child, type; + if (e.slice) { + i = e.length; + while (--i > -1) { + _getChildStyles(e[i], props, targets); + } + return; + } + children = e.childNodes; + i = children.length; + while (--i > -1) { + child = children[i]; + type = child.type; + if (child.style) { + props.push(_getAllStyles(child)); + if (targets) { + targets.push(child); + } + } + if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) { + _getChildStyles(child, props, targets); + } + } + }; + + /** + * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite + * and then compares the style properties of all the target's child elements at the tween's start and end, and + * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting + * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is + * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens + * is because it creates entirely new tweens that may have completely different targets than the original tween, + * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API + * and it would create other problems. For example: + * - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted) + * - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others. + * - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed. + * + * @param {Object} target object to be tweened + * @param {number} Duration in seconds (or frames for frames-based tweens) + * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone} + * @return {Array} An array of TweenLite instances + */ + CSSPlugin.cascadeTo = function(target, duration, vars) { + var tween = TweenLite.to(target, duration, vars), + results = [tween], + b = [], + e = [], + targets = [], + _reservedProps = TweenLite._internals.reservedProps, + i, difs, p, from; + target = tween._targets || tween.target; + _getChildStyles(target, b, targets); + tween.render(duration, true, true); + _getChildStyles(target, e); + tween.render(0, true, true); + tween._enabled(true); + i = targets.length; + while (--i > -1) { + difs = _cssDif(targets[i], b[i], e[i]); + if (difs.firstMPT) { + difs = difs.difs; + for (p in vars) { + if (_reservedProps[p]) { + difs[p] = vars[p]; + } + } + from = {}; + for (p in difs) { + from[p] = b[i][p]; + } + results.push(TweenLite.fromTo(targets[i], duration, from, difs)); + } + } + return results; + }; + + TweenPlugin.activate([CSSPlugin]); + return CSSPlugin; + + }, true); + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * RoundPropsPlugin + * ---------------------------------------------------------------- + */ + (function() { + + var RoundPropsPlugin = _gsScope._gsDefine.plugin({ + propName: "roundProps", + version: "1.6.0", + priority: -1, + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween) { + this._tween = tween; + return true; + } + + }), + _roundLinkedList = function(node) { + while (node) { + if (!node.f && !node.blob) { + node.m = Math.round; + } + node = node._next; + } + }, + p = RoundPropsPlugin.prototype; + + p._onInitAllProps = function() { + var tween = this._tween, + rp = (tween.vars.roundProps.join) ? tween.vars.roundProps : tween.vars.roundProps.split(","), + i = rp.length, + lookup = {}, + rpt = tween._propLookup.roundProps, + prop, pt, next; + while (--i > -1) { + lookup[rp[i]] = Math.round; + } + i = rp.length; + while (--i > -1) { + prop = rp[i]; + pt = tween._firstPT; + while (pt) { + next = pt._next; //record here, because it may get removed + if (pt.pg) { + pt.t._mod(lookup); + } else if (pt.n === prop) { + if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values) + _roundLinkedList(pt.t._firstPT); + } else { + this._add(pt.t, prop, pt.s, pt.c); + //remove from linked list + if (next) { + next._prev = pt._prev; + } + if (pt._prev) { + pt._prev._next = next; + } else if (tween._firstPT === pt) { + tween._firstPT = next; + } + pt._next = pt._prev = null; + tween._propLookup[prop] = rpt; + } + } + pt = next; + } + } + return false; + }; + + p._add = function(target, p, s, c) { + this._addTween(target, p, s, s + c, p, Math.round); + this._overwriteProps.push(p); + }; + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * AttrPlugin + * ---------------------------------------------------------------- + */ + + (function() { + + _gsScope._gsDefine.plugin({ + propName: "attr", + API: 2, + version: "0.6.0", + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + var p, end; + if (typeof(target.setAttribute) !== "function") { + return false; + } + for (p in value) { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + this._addTween(target, "setAttribute", target.getAttribute(p) + "", end + "", p, false, p); + this._overwriteProps.push(p); + } + return true; + } + + }); + + }()); + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * DirectionalRotationPlugin + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine.plugin({ + propName: "directionalRotation", + version: "0.3.0", + API: 2, + + //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. + init: function(target, value, tween, index) { + if (typeof(value) !== "object") { + value = {rotation:value}; + } + this.finals = {}; + var cap = (value.useRadians === true) ? Math.PI * 2 : 360, + min = 0.000001, + p, v, start, end, dif, split; + for (p in value) { + if (p !== "useRadians") { + end = value[p]; + if (typeof(end) === "function") { + end = end(index, target); + } + split = (end + "").split("_"); + v = split[0]; + start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() ); + end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0; + dif = end - start; + if (split.length) { + v = split.join("_"); + if (v.indexOf("short") !== -1) { + dif = dif % cap; + if (dif !== dif % (cap / 2)) { + dif = (dif < 0) ? dif + cap : dif - cap; + } + } + if (v.indexOf("_cw") !== -1 && dif < 0) { + dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } else if (v.indexOf("ccw") !== -1 && dif > 0) { + dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; + } + } + if (dif > min || dif < -min) { + this._addTween(target, p, start, start + dif, p); + this._overwriteProps.push(p); + } + } + } + return true; + }, + + //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) + set: function(ratio) { + var pt; + if (ratio !== 1) { + this._super.setRatio.call(this, ratio); + } else { + pt = this._firstPT; + while (pt) { + if (pt.f) { + pt.t[pt.p](this.finals[pt.p]); + } else { + pt.t[pt.p] = this.finals[pt.p]; + } + pt = pt._next; + } + } + } + + })._autoCSS = true; + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * EasePack + * ---------------------------------------------------------------- + */ + _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) { + + var w = (_gsScope.GreenSockGlobals || _gsScope), + gs = w.com.greensock, + _2PI = Math.PI * 2, + _HALF_PI = Math.PI / 2, + _class = gs._class, + _create = function(n, f) { + var C = _class("easing." + n, function(){}, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + return C; + }, + _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist. + _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) { + var C = _class("easing."+name, { + easeOut:new EaseOut(), + easeIn:new EaseIn(), + easeInOut:new EaseInOut() + }, true); + _easeReg(C, name); + return C; + }, + EasePoint = function(time, value, next) { + this.t = time; + this.v = value; + if (next) { + this.next = next; + next.prev = this; + this.c = next.v - value; + this.gap = next.t - time; + } + }, + + //Back + _createBack = function(n, f) { + var C = _class("easing." + n, function(overshoot) { + this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158; + this._p2 = this._p1 * 1.525; + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(overshoot) { + return new C(overshoot); + }; + return C; + }, + + Back = _wrap("Back", + _createBack("BackOut", function(p) { + return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1); + }), + _createBack("BackIn", function(p) { + return p * p * ((this._p1 + 1) * p - this._p1); + }), + _createBack("BackInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2); + }) + ), + + + //SlowMo + SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) { + power = (power || power === 0) ? power : 0.7; + if (linearRatio == null) { + linearRatio = 0.7; + } else if (linearRatio > 1) { + linearRatio = 1; + } + this._p = (linearRatio !== 1) ? power : 0; + this._p1 = (1 - linearRatio) / 2; + this._p2 = linearRatio; + this._p3 = this._p1 + this._p2; + this._calcEnd = (yoyoMode === true); + }, true), + p = SlowMo.prototype = new Ease(), + SteppedEase, RoughEase, _createElastic; + + p.constructor = SlowMo; + p.getRatio = function(p) { + var r = p + (0.5 - p) * this._p; + if (p < this._p1) { + return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r); + } else if (p > this._p3) { + return this._calcEnd ? 1 - (p = (p - this._p3) / this._p1) * p : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); + } + return this._calcEnd ? 1 : r; + }; + SlowMo.ease = new SlowMo(0.7, 0.7); + + p.config = SlowMo.config = function(linearRatio, power, yoyoMode) { + return new SlowMo(linearRatio, power, yoyoMode); + }; + + + //SteppedEase + SteppedEase = _class("easing.SteppedEase", function(steps) { + steps = steps || 1; + this._p1 = 1 / steps; + this._p2 = steps + 1; + }, true); + p = SteppedEase.prototype = new Ease(); + p.constructor = SteppedEase; + p.getRatio = function(p) { + if (p < 0) { + p = 0; + } else if (p >= 1) { + p = 0.999999999; + } + return ((this._p2 * p) >> 0) * this._p1; + }; + p.config = SteppedEase.config = function(steps) { + return new SteppedEase(steps); + }; + + + //RoughEase + RoughEase = _class("easing.RoughEase", function(vars) { + vars = vars || {}; + var taper = vars.taper || "none", + a = [], + cnt = 0, + points = (vars.points || 20) | 0, + i = points, + randomize = (vars.randomize !== false), + clamp = (vars.clamp === true), + template = (vars.template instanceof Ease) ? vars.template : null, + strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4, + x, y, bump, invX, obj, pnt; + while (--i > -1) { + x = randomize ? Math.random() : (1 / points) * i; + y = template ? template.getRatio(x) : x; + if (taper === "none") { + bump = strength; + } else if (taper === "out") { + invX = 1 - x; + bump = invX * invX * strength; + } else if (taper === "in") { + bump = x * x * strength; + } else if (x < 0.5) { //"both" (start) + invX = x * 2; + bump = invX * invX * 0.5 * strength; + } else { //"both" (end) + invX = (1 - x) * 2; + bump = invX * invX * 0.5 * strength; + } + if (randomize) { + y += (Math.random() * bump) - (bump * 0.5); + } else if (i % 2) { + y += bump * 0.5; + } else { + y -= bump * 0.5; + } + if (clamp) { + if (y > 1) { + y = 1; + } else if (y < 0) { + y = 0; + } + } + a[cnt++] = {x:x, y:y}; + } + a.sort(function(a, b) { + return a.x - b.x; + }); + + pnt = new EasePoint(1, 1, null); + i = points; + while (--i > -1) { + obj = a[i]; + pnt = new EasePoint(obj.x, obj.y, pnt); + } + + this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next); + }, true); + p = RoughEase.prototype = new Ease(); + p.constructor = RoughEase; + p.getRatio = function(p) { + var pnt = this._prev; + if (p > pnt.t) { + while (pnt.next && p >= pnt.t) { + pnt = pnt.next; + } + pnt = pnt.prev; + } else { + while (pnt.prev && p <= pnt.t) { + pnt = pnt.prev; + } + } + this._prev = pnt; + return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c); + }; + p.config = function(vars) { + return new RoughEase(vars); + }; + RoughEase.ease = new RoughEase(); + + + //Bounce + _wrap("Bounce", + _create("BounceOut", function(p) { + if (p < 1 / 2.75) { + return 7.5625 * p * p; + } else if (p < 2 / 2.75) { + return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } + return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + }), + _create("BounceIn", function(p) { + if ((p = 1 - p) < 1 / 2.75) { + return 1 - (7.5625 * p * p); + } else if (p < 2 / 2.75) { + return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75); + } else if (p < 2.5 / 2.75) { + return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375); + } + return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375); + }), + _create("BounceInOut", function(p) { + var invert = (p < 0.5); + if (invert) { + p = 1 - (p * 2); + } else { + p = (p * 2) - 1; + } + if (p < 1 / 2.75) { + p = 7.5625 * p * p; + } else if (p < 2 / 2.75) { + p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; + } else if (p < 2.5 / 2.75) { + p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; + } else { + p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; + } + return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5; + }) + ); + + + //CIRC + _wrap("Circ", + _create("CircOut", function(p) { + return Math.sqrt(1 - (p = p - 1) * p); + }), + _create("CircIn", function(p) { + return -(Math.sqrt(1 - (p * p)) - 1); + }), + _create("CircInOut", function(p) { + return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1); + }) + ); + + + //Elastic + _createElastic = function(n, f, def) { + var C = _class("easing." + n, function(amplitude, period) { + this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1. + this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1); + this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0); + this._p2 = _2PI / this._p2; //precalculate to optimize + }, true), + p = C.prototype = new Ease(); + p.constructor = C; + p.getRatio = f; + p.config = function(amplitude, period) { + return new C(amplitude, period); + }; + return C; + }; + _wrap("Elastic", + _createElastic("ElasticOut", function(p) { + return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1; + }, 0.3), + _createElastic("ElasticIn", function(p) { + return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 )); + }, 0.3), + _createElastic("ElasticInOut", function(p) { + return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1; + }, 0.45) + ); + + + //Expo + _wrap("Expo", + _create("ExpoOut", function(p) { + return 1 - Math.pow(2, -10 * p); + }), + _create("ExpoIn", function(p) { + return Math.pow(2, 10 * (p - 1)) - 0.001; + }), + _create("ExpoInOut", function(p) { + return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + }) + ); + + + //Sine + _wrap("Sine", + _create("SineOut", function(p) { + return Math.sin(p * _HALF_PI); + }), + _create("SineIn", function(p) { + return -Math.cos(p * _HALF_PI) + 1; + }), + _create("SineInOut", function(p) { + return -0.5 * (Math.cos(Math.PI * p) - 1); + }) + ); + + _class("easing.EaseLookup", { + find:function(s) { + return Ease.map[s]; + } + }, true); + + //register the non-standard eases + _easeReg(w.SlowMo, "SlowMo", "ease,"); + _easeReg(RoughEase, "RoughEase", "ease,"); + _easeReg(SteppedEase, "SteppedEase", "ease,"); + + return Back; + + }, true); + + +}); + +if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case TweenLite was already loaded separately. + + + + + + + + + + + +/* + * ---------------------------------------------------------------- + * Base classes like TweenLite, SimpleTimeline, Ease, Ticker, etc. + * ---------------------------------------------------------------- + */ +(function(window, moduleName) { + + "use strict"; + var _exports = {}, + _doc = window.document, + _globals = window.GreenSockGlobals = window.GreenSockGlobals || window; + if (_globals.TweenLite) { + return; //in case the core set of classes is already loaded, don't instantiate twice. + } + var _namespace = function(ns) { + var a = ns.split("."), + p = _globals, i; + for (i = 0; i < a.length; i++) { + p[a[i]] = p = p[a[i]] || {}; + } + return p; + }, + gs = _namespace("com.greensock"), + _tinyNum = 0.0000000001, + _slice = function(a) { //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + var b = [], + l = a.length, + i; + for (i = 0; i !== l; b.push(a[i++])) {} + return b; + }, + _emptyFunc = function() {}, + _isArray = (function() { //works around issues in iframe environments where the Array global isn't shared, thus if the object originates in a different window/iframe, "(obj instanceof Array)" will evaluate false. We added some speed optimizations to avoid Object.prototype.toString.call() unless it's absolutely necessary because it's VERY slow (like 20x slower) + var toString = Object.prototype.toString, + array = toString.call([]); + return function(obj) { + return obj != null && (obj instanceof Array || (typeof(obj) === "object" && !!obj.push && toString.call(obj) === array)); + }; + }()), + a, i, p, _ticker, _tickerActive, + _defLookup = {}, + + /** + * @constructor + * Defines a GreenSock class, optionally with an array of dependencies that must be instantiated first and passed into the definition. + * This allows users to load GreenSock JS files in any order even if they have interdependencies (like CSSPlugin extends TweenPlugin which is + * inside TweenLite.js, but if CSSPlugin is loaded first, it should wait to run its code until TweenLite.js loads and instantiates TweenPlugin + * and then pass TweenPlugin to CSSPlugin's definition). This is all done automatically and internally. + * + * Every definition will be added to a "com.greensock" global object (typically window, but if a window.GreenSockGlobals object is found, + * it will go there as of v1.7). For example, TweenLite will be found at window.com.greensock.TweenLite and since it's a global class that should be available anywhere, + * it is ALSO referenced at window.TweenLite. However some classes aren't considered global, like the base com.greensock.core.Animation class, so + * those will only be at the package like window.com.greensock.core.Animation. Again, if you define a GreenSockGlobals object on the window, everything + * gets tucked neatly inside there instead of on the window directly. This allows you to do advanced things like load multiple versions of GreenSock + * files and put them into distinct objects (imagine a banner ad uses a newer version but the main site uses an older one). In that case, you could + * sandbox the banner one like: + * + * + * + * + * + * + * + * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back". + * @param {!Array.} dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"] + * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition. + * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object) + */ + Definition = function(ns, dependencies, func, global) { + this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses + _defLookup[ns] = this; + this.gsClass = null; + this.func = func; + var _classes = []; + this.check = function(init) { + var i = dependencies.length, + missing = i, + cur, a, n, cl, hasModule; + while (--i > -1) { + if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) { + _classes[i] = cur.gsClass; + missing--; + } else if (init) { + cur.sc.push(this); + } + } + if (missing === 0 && func) { + a = ("com.greensock." + ns).split("."); + n = a.pop(); + cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes); + + //exports to multiple environments + if (global) { + _globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) + hasModule = (typeof(module) !== "undefined" && module.exports); + if (!hasModule && "function" === "function" && __webpack_require__(603)){ //AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return cl; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (hasModule){ //node + if (ns === moduleName) { + module.exports = _exports[moduleName] = cl; + for (i in _exports) { + cl[i] = _exports[i]; + } + } else if (_exports[moduleName]) { + _exports[moduleName][n] = cl; + } + } + } + for (i = 0; i < this.sc.length; i++) { + this.sc[i].check(); + } + } + }; + this.check(true); + }, + + //used to create Definition instances (which basically registers a class that has dependencies). + _gsDefine = window._gsDefine = function(ns, dependencies, func, global) { + return new Definition(ns, dependencies, func, global); + }, + + //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class). + _class = gs._class = function(ns, func, global) { + func = func || function() {}; + _gsDefine(ns, [], function(){ return func; }, global); + return func; + }; + + _gsDefine.globals = _globals; + + + +/* + * ---------------------------------------------------------------- + * Ease + * ---------------------------------------------------------------- + */ + var _baseParams = [0, 0, 1, 1], + _blankArray = [], + Ease = _class("easing.Ease", function(func, extraParams, type, power) { + this._func = func; + this._type = type || 0; + this._power = power || 0; + this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams; + }, true), + _easeMap = Ease.map = {}, + _easeReg = Ease.register = function(ease, names, types, create) { + var na = names.split(","), + i = na.length, + ta = (types || "easeIn,easeOut,easeInOut").split(","), + e, name, j, type; + while (--i > -1) { + name = na[i]; + e = create ? _class("easing."+name, null, true) : gs.easing[name] || {}; + j = ta.length; + while (--j > -1) { + type = ta[j]; + _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease(); + } + } + }; + + p = Ease.prototype; + p._calcEnd = false; + p.getRatio = function(p) { + if (this._func) { + this._params[0] = p; + return this._func.apply(null, this._params); + } + var t = this._type, + pw = this._power, + r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2; + if (pw === 1) { + r *= r; + } else if (pw === 2) { + r *= r * r; + } else if (pw === 3) { + r *= r * r * r; + } else if (pw === 4) { + r *= r * r * r * r; + } + return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2); + }; + + //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut) + a = ["Linear","Quad","Cubic","Quart","Quint,Strong"]; + i = a.length; + while (--i > -1) { + p = a[i]+",Power"+i; + _easeReg(new Ease(null,null,1,i), p, "easeOut", true); + _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : "")); + _easeReg(new Ease(null,null,3,i), p, "easeInOut"); + } + _easeMap.linear = gs.easing.Linear.easeIn; + _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks + + +/* + * ---------------------------------------------------------------- + * EventDispatcher + * ---------------------------------------------------------------- + */ + var EventDispatcher = _class("events.EventDispatcher", function(target) { + this._listeners = {}; + this._eventTarget = target || this; + }); + p = EventDispatcher.prototype; + + p.addEventListener = function(type, callback, scope, useParam, priority) { + priority = priority || 0; + var list = this._listeners[type], + index = 0, + listener, i; + if (this === _ticker && !_tickerActive) { + _ticker.wake(); + } + if (list == null) { + this._listeners[type] = list = []; + } + i = list.length; + while (--i > -1) { + listener = list[i]; + if (listener.c === callback && listener.s === scope) { + list.splice(i, 1); + } else if (index === 0 && listener.pr < priority) { + index = i + 1; + } + } + list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority}); + }; + + p.removeEventListener = function(type, callback) { + var list = this._listeners[type], i; + if (list) { + i = list.length; + while (--i > -1) { + if (list[i].c === callback) { + list.splice(i, 1); + return; + } + } + } + }; + + p.dispatchEvent = function(type) { + var list = this._listeners[type], + i, t, listener; + if (list) { + i = list.length; + if (i > 1) { + list = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip) + } + t = this._eventTarget; + while (--i > -1) { + listener = list[i]; + if (listener) { + if (listener.up) { + listener.c.call(listener.s || t, {type:type, target:t}); + } else { + listener.c.call(listener.s || t); + } + } + } + } + }; + + +/* + * ---------------------------------------------------------------- + * Ticker + * ---------------------------------------------------------------- + */ + var _reqAnimFrame = window.requestAnimationFrame, + _cancelAnimFrame = window.cancelAnimationFrame, + _getTime = Date.now || function() {return new Date().getTime();}, + _lastUpdate = _getTime(); + + //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. + a = ["ms","moz","webkit","o"]; + i = a.length; + while (--i > -1 && !_reqAnimFrame) { + _reqAnimFrame = window[a[i] + "RequestAnimationFrame"]; + _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"]; + } + + _class("Ticker", function(fps, useRAF) { + var _self = this, + _startTime = _getTime(), + _useRAF = (useRAF !== false && _reqAnimFrame) ? "auto" : false, + _lagThreshold = 500, + _adjustedLag = 33, + _tickWord = "tick", //helps reduce gc burden + _fps, _req, _id, _gap, _nextTime, + _tick = function(manual) { + var elapsed = _getTime() - _lastUpdate, + overlap, dispatch; + if (elapsed > _lagThreshold) { + _startTime += elapsed - _adjustedLag; + } + _lastUpdate += elapsed; + _self.time = (_lastUpdate - _startTime) / 1000; + overlap = _self.time - _nextTime; + if (!_fps || overlap > 0 || manual === true) { + _self.frame++; + _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); + dispatch = true; + } + if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. + _id = _req(_tick); + } + if (dispatch) { + _self.dispatchEvent(_tickWord); + } + }; + + EventDispatcher.call(_self); + _self.time = _self.frame = 0; + _self.tick = function() { + _tick(true); + }; + + _self.lagSmoothing = function(threshold, adjustedLag) { + _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited + _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0); + }; + + _self.sleep = function() { + if (_id == null) { + return; + } + if (!_useRAF || !_cancelAnimFrame) { + clearTimeout(_id); + } else { + _cancelAnimFrame(_id); + } + _req = _emptyFunc; + _id = null; + if (_self === _ticker) { + _tickerActive = false; + } + }; + + _self.wake = function(seamless) { + if (_id !== null) { + _self.sleep(); + } else if (seamless) { + _startTime += -_lastUpdate + (_lastUpdate = _getTime()); + } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout(). + _lastUpdate = _getTime() - _lagThreshold + 5; + } + _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame; + if (_self === _ticker) { + _tickerActive = true; + } + _tick(2); + }; + + _self.fps = function(value) { + if (!arguments.length) { + return _fps; + } + _fps = value; + _gap = 1 / (_fps || 60); + _nextTime = this.time + _gap; + _self.wake(); + }; + + _self.useRAF = function(value) { + if (!arguments.length) { + return _useRAF; + } + _self.sleep(); + _useRAF = value; + _self.fps(_fps); + }; + _self.fps(fps); + + //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition. + setTimeout(function() { + if (_useRAF === "auto" && _self.frame < 5 && _doc.visibilityState !== "hidden") { + _self.useRAF(false); + } + }, 1500); + }); + + p = gs.Ticker.prototype = new gs.events.EventDispatcher(); + p.constructor = gs.Ticker; + + +/* + * ---------------------------------------------------------------- + * Animation + * ---------------------------------------------------------------- + */ + var Animation = _class("core.Animation", function(duration, vars) { + this.vars = vars = vars || {}; + this._duration = this._totalDuration = duration || 0; + this._delay = Number(vars.delay) || 0; + this._timeScale = 1; + this._active = (vars.immediateRender === true); + this.data = vars.data; + this._reversed = (vars.reversed === true); + + if (!_rootTimeline) { + return; + } + if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. + _ticker.wake(); + } + + var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline; + tl.add(this, tl._time); + + if (this.vars.paused) { + this.paused(true); + } + }); + + _ticker = Animation.ticker = new gs.Ticker(); + p = Animation.prototype; + p._dirty = p._gc = p._initted = p._paused = false; + p._totalTime = p._time = 0; + p._rawPrevTime = -1; + p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; + p._paused = false; + + + //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. + var _checkTimeout = function() { + if (_tickerActive && _getTime() - _lastUpdate > 2000) { + _ticker.wake(); + } + setTimeout(_checkTimeout, 2000); + }; + _checkTimeout(); + + + p.play = function(from, suppressEvents) { + if (from != null) { + this.seek(from, suppressEvents); + } + return this.reversed(false).paused(false); + }; + + p.pause = function(atTime, suppressEvents) { + if (atTime != null) { + this.seek(atTime, suppressEvents); + } + return this.paused(true); + }; + + p.resume = function(from, suppressEvents) { + if (from != null) { + this.seek(from, suppressEvents); + } + return this.paused(false); + }; + + p.seek = function(time, suppressEvents) { + return this.totalTime(Number(time), suppressEvents !== false); + }; + + p.restart = function(includeDelay, suppressEvents) { + return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true); + }; + + p.reverse = function(from, suppressEvents) { + if (from != null) { + this.seek((from || this.totalDuration()), suppressEvents); + } + return this.reversed(true).paused(false); + }; + + p.render = function(time, suppressEvents, force) { + //stub - we override this method in subclasses. + }; + + p.invalidate = function() { + this._time = this._totalTime = 0; + this._initted = this._gc = false; + this._rawPrevTime = -1; + if (this._gc || !this.timeline) { + this._enabled(true); + } + return this; + }; + + p.isActive = function() { + var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active. + startTime = this._startTime, + rawTime; + return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale)); + }; + + p._enabled = function (enabled, ignoreTimeline) { + if (!_tickerActive) { + _ticker.wake(); + } + this._gc = !enabled; + this._active = this.isActive(); + if (ignoreTimeline !== true) { + if (enabled && !this.timeline) { + this._timeline.add(this, this._startTime - this._delay); + } else if (!enabled && this.timeline) { + this._timeline._remove(this, true); + } + } + return false; + }; + + + p._kill = function(vars, target) { + return this._enabled(false, false); + }; + + p.kill = function(vars, target) { + this._kill(vars, target); + return this; + }; + + p._uncache = function(includeSelf) { + var tween = includeSelf ? this : this.timeline; + while (tween) { + tween._dirty = true; + tween = tween.timeline; + } + return this; + }; + + p._swapSelfInParams = function(params) { + var i = params.length, + copy = params.concat(); + while (--i > -1) { + if (params[i] === "{self}") { + copy[i] = this; + } + } + return copy; + }; + + p._callback = function(type) { + var v = this.vars, + callback = v[type], + params = v[type + "Params"], + scope = v[type + "Scope"] || v.callbackScope || this, + l = params ? params.length : 0; + switch (l) { //speed optimization; call() is faster than apply() so use it when there are only a few parameters (which is by far most common). Previously we simply did var v = this.vars; v[type].apply(v[type + "Scope"] || v.callbackScope || this, v[type + "Params"] || _blankArray); + case 0: callback.call(scope); break; + case 1: callback.call(scope, params[0]); break; + case 2: callback.call(scope, params[0], params[1]); break; + default: callback.apply(scope, params); + } + }; + +//----Animation getters/setters -------------------------------------------------------- + + p.eventCallback = function(type, callback, params, scope) { + if ((type || "").substr(0,2) === "on") { + var v = this.vars; + if (arguments.length === 1) { + return v[type]; + } + if (callback == null) { + delete v[type]; + } else { + v[type] = callback; + v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params; + v[type + "Scope"] = scope; + } + if (type === "onUpdate") { + this._onUpdate = callback; + } + } + return this; + }; + + p.delay = function(value) { + if (!arguments.length) { + return this._delay; + } + if (this._timeline.smoothChildTiming) { + this.startTime( this._startTime + value - this._delay ); + } + this._delay = value; + return this; + }; + + p.duration = function(value) { + if (!arguments.length) { + this._dirty = false; + return this._duration; + } + this._duration = this._totalDuration = value; + this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration. + if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) { + this.totalTime(this._totalTime * (value / this._duration), true); + } + return this; + }; + + p.totalDuration = function(value) { + this._dirty = false; + return (!arguments.length) ? this._totalDuration : this.duration(value); + }; + + p.time = function(value, suppressEvents) { + if (!arguments.length) { + return this._time; + } + if (this._dirty) { + this.totalDuration(); + } + return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents); + }; + + p.totalTime = function(time, suppressEvents, uncapped) { + if (!_tickerActive) { + _ticker.wake(); + } + if (!arguments.length) { + return this._totalTime; + } + if (this._timeline) { + if (time < 0 && !uncapped) { + time += this.totalDuration(); + } + if (this._timeline.smoothChildTiming) { + if (this._dirty) { + this.totalDuration(); + } + var totalDuration = this._totalDuration, + tl = this._timeline; + if (time > totalDuration && !uncapped) { + time = totalDuration; + } + this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale); + if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here. + this._uncache(false); + } + //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed. + if (tl._timeline) { + while (tl._timeline) { + if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) { + tl.totalTime(tl._totalTime, true); + } + tl = tl._timeline; + } + } + } + if (this._gc) { + this._enabled(true, false); + } + if (this._totalTime !== time || this._duration === 0) { + if (_lazyTweens.length) { + _lazyRender(); + } + this.render(time, suppressEvents, false); + if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render. + _lazyRender(); + } + } + } + return this; + }; + + p.progress = p.totalProgress = function(value, suppressEvents) { + var duration = this.duration(); + return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents); + }; + + p.startTime = function(value) { + if (!arguments.length) { + return this._startTime; + } + if (value !== this._startTime) { + this._startTime = value; + if (this.timeline) if (this.timeline._sortChildren) { + this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. + } + } + return this; + }; + + p.endTime = function(includeRepeats) { + return this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale; + }; + + p.timeScale = function(value) { + if (!arguments.length) { + return this._timeScale; + } + value = value || _tinyNum; //can't allow zero because it'll throw the math off + if (this._timeline && this._timeline.smoothChildTiming) { + var pauseTime = this._pauseTime, + t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime(); + this._startTime = t - ((t - this._startTime) * this._timeScale / value); + } + this._timeScale = value; + return this._uncache(false); + }; + + p.reversed = function(value) { + if (!arguments.length) { + return this._reversed; + } + if (value != this._reversed) { + this._reversed = value; + this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true); + } + return this; + }; + + p.paused = function(value) { + if (!arguments.length) { + return this._paused; + } + var tl = this._timeline, + raw, elapsed; + if (value != this._paused) if (tl) { + if (!_tickerActive && !value) { + _ticker.wake(); + } + raw = tl.rawTime(); + elapsed = raw - this._pauseTime; + if (!value && tl.smoothChildTiming) { + this._startTime += elapsed; + this._uncache(false); + } + this._pauseTime = value ? raw : null; + this._paused = value; + this._active = this.isActive(); + if (!value && elapsed !== 0 && this._initted && this.duration()) { + raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale; + this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render. + } + } + if (this._gc && !value) { + this._enabled(true, false); + } + return this; + }; + + +/* + * ---------------------------------------------------------------- + * SimpleTimeline + * ---------------------------------------------------------------- + */ + var SimpleTimeline = _class("core.SimpleTimeline", function(vars) { + Animation.call(this, 0, vars); + this.autoRemoveChildren = this.smoothChildTiming = true; + }); + + p = SimpleTimeline.prototype = new Animation(); + p.constructor = SimpleTimeline; + p.kill()._gc = false; + p._first = p._last = p._recent = null; + p._sortChildren = false; + + p.add = p.insert = function(child, position, align, stagger) { + var prevTween, st; + child._startTime = Number(position || 0) + child._delay; + if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order). + child._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale); + } + if (child.timeline) { + child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one. + } + child.timeline = child._timeline = this; + if (child._gc) { + child._enabled(true, true); + } + prevTween = this._last; + if (this._sortChildren) { + st = child._startTime; + while (prevTween && prevTween._startTime > st) { + prevTween = prevTween._prev; + } + } + if (prevTween) { + child._next = prevTween._next; + prevTween._next = child; + } else { + child._next = this._first; + this._first = child; + } + if (child._next) { + child._next._prev = child; + } else { + this._last = child; + } + child._prev = prevTween; + this._recent = child; + if (this._timeline) { + this._uncache(true); + } + return this; + }; + + p._remove = function(tween, skipDisable) { + if (tween.timeline === this) { + if (!skipDisable) { + tween._enabled(false, true); + } + + if (tween._prev) { + tween._prev._next = tween._next; + } else if (this._first === tween) { + this._first = tween._next; + } + if (tween._next) { + tween._next._prev = tween._prev; + } else if (this._last === tween) { + this._last = tween._prev; + } + tween._next = tween._prev = tween.timeline = null; + if (tween === this._recent) { + this._recent = this._last; + } + + if (this._timeline) { + this._uncache(true); + } + } + return this; + }; + + p.render = function(time, suppressEvents, force) { + var tween = this._first, + next; + this._totalTime = this._time = this._rawPrevTime = time; + while (tween) { + next = tween._next; //record it here because the value could change after rendering... + if (tween._active || (time >= tween._startTime && !tween._paused)) { + if (!tween._reversed) { + tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); + } else { + tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); + } + } + tween = next; + } + }; + + p.rawTime = function() { + if (!_tickerActive) { + _ticker.wake(); + } + return this._totalTime; + }; + +/* + * ---------------------------------------------------------------- + * TweenLite + * ---------------------------------------------------------------- + */ + var TweenLite = _class("TweenLite", function(target, duration, vars) { + Animation.call(this, duration, vars); + this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) + + if (target == null) { + throw "Cannot tween a null target."; + } + + this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; + + var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))), + overwrite = this.vars.overwrite, + i, targ, targets; + + this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite]; + + if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") { + this._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() + this._propLookup = []; + this._siblings = []; + for (i = 0; i < targets.length; i++) { + targ = targets[i]; + if (!targ) { + targets.splice(i--, 1); + continue; + } else if (typeof(targ) === "string") { + targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings + if (typeof(targ) === "string") { + targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case) + } + continue; + } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself.\n\t\t\t\t\t\t\ttargets.splice(i--, 1);\n\t\t\t\t\t\t\tthis._targets = targets = targets.concat(_slice(targ));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._siblings[i] = _register(targ, this, false);\n\t\t\t\t\t\tif (overwrite === 1) if (this._siblings[i].length > 1) {\n\t\t\t\t\t\t\t_applyOverwrite(targ, this, null, 1, this._siblings[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tthis._propLookup = {};\n\t\t\t\t\tthis._siblings = _register(target, this, false);\n\t\t\t\t\tif (overwrite === 1) if (this._siblings.length > 1) {\n\t\t\t\t\t\t_applyOverwrite(target, this, null, 1, this._siblings);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) {\n\t\t\t\t\tthis._time = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\t\t\t\t\tthis.render(Math.min(0, -this._delay)); //in case delay is negative\n\t\t\t\t}\n\t\t\t}, true),\n\t\t\t_isSelector = function(v) {\n\t\t\t\treturn (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check \"nodeType\" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox.\n\t\t\t},\n\t\t\t_autoCSS = function(vars, target) {\n\t\t\t\tvar css = {},\n\t\t\t\t\tp;\n\t\t\t\tfor (p in vars) {\n\t\t\t\t\tif (!_reservedProps[p] && (!(p in target) || p === \"transform\" || p === \"x\" || p === \"y\" || p === \"width\" || p === \"height\" || p === \"className\" || p === \"border\") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: elements contain read-only \"x\" and \"y\" properties. We should also prioritize editing css width/height rather than the element's properties.\n\t\t\t\t\t\tcss[p] = vars[p];\n\t\t\t\t\t\tdelete vars[p];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvars.css = css;\n\t\t\t};\n\n\t\tp = TweenLite.prototype = new Animation();\n\t\tp.constructor = TweenLite;\n\t\tp.kill()._gc = false;\n\n//----TweenLite defaults, overwrite management, and root updates ----------------------------------------------------\n\n\t\tp.ratio = 0;\n\t\tp._firstPT = p._targets = p._overwrittenProps = p._startAt = null;\n\t\tp._notifyPluginsOfEnabled = p._lazy = false;\n\n\t\tTweenLite.version = \"1.19.1\";\n\t\tTweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);\n\t\tTweenLite.defaultOverwrite = \"auto\";\n\t\tTweenLite.ticker = _ticker;\n\t\tTweenLite.autoSleep = 120;\n\t\tTweenLite.lagSmoothing = function(threshold, adjustedLag) {\n\t\t\t_ticker.lagSmoothing(threshold, adjustedLag);\n\t\t};\n\n\t\tTweenLite.selector = window.$ || window.jQuery || function(e) {\n\t\t\tvar selector = window.$ || window.jQuery;\n\t\t\tif (selector) {\n\t\t\t\tTweenLite.selector = selector;\n\t\t\t\treturn selector(e);\n\t\t\t}\n\t\t\treturn (typeof(_doc) === \"undefined\") ? e : (_doc.querySelectorAll ? _doc.querySelectorAll(e) : _doc.getElementById((e.charAt(0) === \"#\") ? e.substr(1) : e));\n\t\t};\n\n\t\tvar _lazyTweens = [],\n\t\t\t_lazyLookup = {},\n\t\t\t_numbersExp = /(?:(-|-=|\\+=)?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[0-9]/ig,\n\t\t\t//_nonNumbersExp = /(?:([\\-+](?!(\\d|=)))|[^\\d\\-+=e]|(e(?![\\-+][\\d])))+/ig,\n\t\t\t_setRatio = function(v) {\n\t\t\t\tvar pt = this._firstPT,\n\t\t\t\t\tmin = 0.000001,\n\t\t\t\t\tval;\n\t\t\t\twhile (pt) {\n\t\t\t\t\tval = !pt.blob ? pt.c * v + pt.s : (v === 1) ? this.end : v ? this.join(\"\") : this.start;\n\t\t\t\t\tif (pt.m) {\n\t\t\t\t\t\tval = pt.m(val, this._target || pt.t);\n\t\t\t\t\t} else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser\n\t\t\t\t\t\tval = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (!pt.f) {\n\t\t\t\t\t\tpt.t[pt.p] = val;\n\t\t\t\t\t} else if (pt.fp) {\n\t\t\t\t\t\tpt.t[pt.p](pt.fp, val);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.t[pt.p](val);\n\t\t\t\t\t}\n\t\t\t\t\tpt = pt._next;\n\t\t\t\t}\n\t\t\t},\n\t\t\t//compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, \"rgb(0,0,0)\" and \"rgb(100,50,0)\" would become [\"rgb(\", 0, \",\", 50, \",0)\"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a \"start\" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join(\"\")).\n\t\t\t_blobDif = function(start, end, filter, pt) {\n\t\t\t\tvar a = [],\n\t\t\t\t\tcharIndex = 0,\n\t\t\t\t\ts = \"\",\n\t\t\t\t\tcolor = 0,\n\t\t\t\t\tstartNums, endNums, num, i, l, nonNumbers, currentNum;\n\t\t\t\ta.start = start;\n\t\t\t\ta.end = end;\n\t\t\t\tstart = a[0] = start + \"\"; //ensure values are strings\n\t\t\t\tend = a[1] = end + \"\";\n\t\t\t\tif (filter) {\n\t\t\t\t\tfilter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\t\t\t\t\tstart = a[0];\n\t\t\t\t\tend = a[1];\n\t\t\t\t}\n\t\t\t\ta.length = 0;\n\t\t\t\tstartNums = start.match(_numbersExp) || [];\n\t\t\t\tendNums = end.match(_numbersExp) || [];\n\t\t\t\tif (pt) {\n\t\t\t\t\tpt._next = null;\n\t\t\t\t\tpt.blob = 1;\n\t\t\t\t\ta._firstPT = a._applyPT = pt; //apply last in the linked list (which means inserting it first)\n\t\t\t\t}\n\t\t\t\tl = endNums.length;\n\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\tcurrentNum = endNums[i];\n\t\t\t\t\tnonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex);\n\t\t\t\t\ts += (nonNumbers || !i) ? nonNumbers : \",\"; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n\t\t\t\t\tcharIndex += nonNumbers.length;\n\t\t\t\t\tif (color) { //sense rgba() values and round them.\n\t\t\t\t\t\tcolor = (color + 1) % 5;\n\t\t\t\t\t} else if (nonNumbers.substr(-5) === \"rgba(\") {\n\t\t\t\t\t\tcolor = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (currentNum === startNums[i] || startNums.length <= i) {\n\t\t\t\t\t\ts += currentNum;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (s) {\n\t\t\t\t\t\t\ta.push(s);\n\t\t\t\t\t\t\ts = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnum = parseFloat(startNums[i]);\n\t\t\t\t\t\ta.push(num);\n\t\t\t\t\t\ta._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === \"=\") ? parseInt(currentNum.charAt(0) + \"1\", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, m:(color && color < 4) ? Math.round : 0};\n\t\t\t\t\t\t//note: we don't set _prev because we'll never need to remove individual PropTweens from this list.\n\t\t\t\t\t}\n\t\t\t\t\tcharIndex += currentNum.length;\n\t\t\t\t}\n\t\t\t\ts += end.substr(charIndex);\n\t\t\t\tif (s) {\n\t\t\t\t\ta.push(s);\n\t\t\t\t}\n\t\t\t\ta.setRatio = _setRatio;\n\t\t\t\treturn a;\n\t\t\t},\n\t\t\t//note: \"funcParam\" is only necessary for function-based getters/setters that require an extra parameter like getAttribute(\"width\") and setAttribute(\"width\", value). In this example, funcParam would be \"width\". Used by AttrPlugin for example.\n\t\t\t_addPropTween = function(target, prop, start, end, overwriteProp, mod, funcParam, stringFilter, index) {\n\t\t\t\tif (typeof(end) === \"function\") {\n\t\t\t\t\tend = end(index || 0, target);\n\t\t\t\t}\n\t\t\t\tvar type = typeof(target[prop]),\n\t\t\t\t\tgetterName = (type !== \"function\") ? \"\" : ((prop.indexOf(\"set\") || typeof(target[\"get\" + prop.substr(3)]) !== \"function\") ? prop : \"get\" + prop.substr(3)),\n\t\t\t\t\ts = (start !== \"get\") ? start : !getterName ? target[prop] : funcParam ? target[getterName](funcParam) : target[getterName](),\n\t\t\t\t\tisRelative = (typeof(end) === \"string\" && end.charAt(1) === \"=\"),\n\t\t\t\t\tpt = {t:target, p:prop, s:s, f:(type === \"function\"), pg:0, n:overwriteProp || prop, m:(!mod ? 0 : (typeof(mod) === \"function\") ? mod : Math.round), pr:0, c:isRelative ? parseInt(end.charAt(0) + \"1\", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0},\n\t\t\t\t\tblob;\n\n\t\t\t\tif (typeof(s) !== \"number\" || (typeof(end) !== \"number\" && !isRelative)) {\n\t\t\t\t\tif (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === \"boolean\" || typeof(end) === \"boolean\") {\n\t\t\t\t\t\t//a blob (string that has multiple numbers in it)\n\t\t\t\t\t\tpt.fp = funcParam;\n\t\t\t\t\t\tblob = _blobDif(s, (isRelative ? pt.s + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);\n\t\t\t\t\t\tpt = {t: blob, p: \"setRatio\", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //\"2\" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.s = parseFloat(s);\n\t\t\t\t\t\tif (!isRelative) {\n\t\t\t\t\t\t\tpt.c = (parseFloat(end) - pt.s) || 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pt.c) { //only add it to the linked list if there's a change.\n\t\t\t\t\tif ((pt._next = this._firstPT)) {\n\t\t\t\t\t\tpt._next._prev = pt;\n\t\t\t\t\t}\n\t\t\t\t\tthis._firstPT = pt;\n\t\t\t\t\treturn pt;\n\t\t\t\t}\n\t\t\t},\n\t\t\t_internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object.\n\t\t\t_plugins = TweenLite._plugins = {},\n\t\t\t_tweenLookup = _internals.tweenLookup = {},\n\t\t\t_tweenLookupNum = 0,\n\t\t\t_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1},\n\t\t\t_overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, \"true\":1, \"false\":0},\n\t\t\t_rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),\n\t\t\t_rootTimeline = Animation._rootTimeline = new SimpleTimeline(),\n\t\t\t_nextGCFrame = 30,\n\t\t\t_lazyRender = _internals.lazyRender = function() {\n\t\t\t\tvar i = _lazyTweens.length,\n\t\t\t\t\ttween;\n\t\t\t\t_lazyLookup = {};\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\ttween = _lazyTweens[i];\n\t\t\t\t\tif (tween && tween._lazy !== false) {\n\t\t\t\t\t\ttween.render(tween._lazy[0], tween._lazy[1], true);\n\t\t\t\t\t\ttween._lazy = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_lazyTweens.length = 0;\n\t\t\t};\n\n\t\t_rootTimeline._startTime = _ticker.time;\n\t\t_rootFramesTimeline._startTime = _ticker.frame;\n\t\t_rootTimeline._active = _rootFramesTimeline._active = true;\n\t\tsetTimeout(_lazyRender, 1); //on some mobile devices, there isn't a \"tick\" before code runs which means any lazy renders wouldn't run before the next official \"tick\".\n\n\t\tAnimation._updateRoot = TweenLite.render = function() {\n\t\t\t\tvar i, a, p;\n\t\t\t\tif (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again.\n\t\t\t\t\t_lazyRender();\n\t\t\t\t}\n\t\t\t\t_rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false);\n\t\t\t\t_rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false);\n\t\t\t\tif (_lazyTweens.length) {\n\t\t\t\t\t_lazyRender();\n\t\t\t\t}\n\t\t\t\tif (_ticker.frame >= _nextGCFrame) { //dump garbage every 120 frames or whatever the user sets TweenLite.autoSleep to\n\t\t\t\t\t_nextGCFrame = _ticker.frame + (parseInt(TweenLite.autoSleep, 10) || 120);\n\t\t\t\t\tfor (p in _tweenLookup) {\n\t\t\t\t\t\ta = _tweenLookup[p].tweens;\n\t\t\t\t\t\ti = a.length;\n\t\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\t\tif (a[i]._gc) {\n\t\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a.length === 0) {\n\t\t\t\t\t\t\tdelete _tweenLookup[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly\n\t\t\t\t\tp = _rootTimeline._first;\n\t\t\t\t\tif (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) {\n\t\t\t\t\t\twhile (p && p._paused) {\n\t\t\t\t\t\t\tp = p._next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!p) {\n\t\t\t\t\t\t\t_ticker.sleep();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t_ticker.addEventListener(\"tick\", Animation._updateRoot);\n\n\t\tvar _register = function(target, tween, scrub) {\n\t\t\t\tvar id = target._gsTweenID, a, i;\n\t\t\t\tif (!_tweenLookup[id || (target._gsTweenID = id = \"t\" + (_tweenLookupNum++))]) {\n\t\t\t\t\t_tweenLookup[id] = {target:target, tweens:[]};\n\t\t\t\t}\n\t\t\t\tif (tween) {\n\t\t\t\t\ta = _tweenLookup[id].tweens;\n\t\t\t\t\ta[(i = a.length)] = tween;\n\t\t\t\t\tif (scrub) {\n\t\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\t\tif (a[i] === tween) {\n\t\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _tweenLookup[id].tweens;\n\t\t\t},\n\t\t\t_onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) {\n\t\t\t\tvar func = overwrittenTween.vars.onOverwrite, r1, r2;\n\t\t\t\tif (func) {\n\t\t\t\t\tr1 = func(overwrittenTween, overwritingTween, target, killedProps);\n\t\t\t\t}\n\t\t\t\tfunc = TweenLite.onOverwrite;\n\t\t\t\tif (func) {\n\t\t\t\t\tr2 = func(overwrittenTween, overwritingTween, target, killedProps);\n\t\t\t\t}\n\t\t\t\treturn (r1 !== false && r2 !== false);\n\t\t\t},\n\t\t\t_applyOverwrite = function(target, tween, props, mode, siblings) {\n\t\t\t\tvar i, changed, curTween, l;\n\t\t\t\tif (mode === 1 || mode >= 4) {\n\t\t\t\t\tl = siblings.length;\n\t\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\t\tif ((curTween = siblings[i]) !== tween) {\n\t\t\t\t\t\t\tif (!curTween._gc) {\n\t\t\t\t\t\t\t\tif (curTween._kill(null, target, tween)) {\n\t\t\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (mode === 5) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn changed;\n\t\t\t\t}\n\t\t\t\t//NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example)\n\t\t\t\tvar startTime = tween._startTime + _tinyNum,\n\t\t\t\t\toverlaps = [],\n\t\t\t\t\toCount = 0,\n\t\t\t\t\tzeroDur = (tween._duration === 0),\n\t\t\t\t\tglobalStart;\n\t\t\t\ti = siblings.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) {\n\t\t\t\t\t\t//ignore\n\t\t\t\t\t} else if (curTween._timeline !== tween._timeline) {\n\t\t\t\t\t\tglobalStart = globalStart || _checkOverlap(tween, 0, zeroDur);\n\t\t\t\t\t\tif (_checkOverlap(curTween, globalStart, zeroDur) === 0) {\n\t\t\t\t\t\t\toverlaps[oCount++] = curTween;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) {\n\t\t\t\t\t\toverlaps[oCount++] = curTween;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ti = oCount;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tcurTween = overlaps[i];\n\t\t\t\t\tif (mode === 2) if (curTween._kill(props, target, tween)) {\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (mode !== 2 || (!curTween._firstPT && curTween._initted)) {\n\t\t\t\t\t\tif (mode !== 2 && !_onOverwrite(curTween, tween)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween.\n\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn changed;\n\t\t\t},\n\t\t\t_checkOverlap = function(tween, reference, zeroDur) {\n\t\t\t\tvar tl = tween._timeline,\n\t\t\t\t\tts = tl._timeScale,\n\t\t\t\t\tt = tween._startTime;\n\t\t\t\twhile (tl._timeline) {\n\t\t\t\t\tt += tl._startTime;\n\t\t\t\t\tts *= tl._timeScale;\n\t\t\t\t\tif (tl._paused) {\n\t\t\t\t\t\treturn -100;\n\t\t\t\t\t}\n\t\t\t\t\ttl = tl._timeline;\n\t\t\t\t}\n\t\t\t\tt /= ts;\n\t\t\t\treturn (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum;\n\t\t\t};\n\n\n//---- TweenLite instance methods -----------------------------------------------------------------------------\n\n\t\tp._init = function() {\n\t\t\tvar v = this.vars,\n\t\t\t\top = this._overwrittenProps,\n\t\t\t\tdur = this._duration,\n\t\t\t\timmediate = !!v.immediateRender,\n\t\t\t\tease = v.ease,\n\t\t\t\ti, initPlugins, pt, p, startVars, l;\n\t\t\tif (v.startAt) {\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tthis._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:\"+=100\"}, {x:\"-=100\"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change.\n\t\t\t\t\tthis._startAt.kill();\n\t\t\t\t}\n\t\t\t\tstartVars = {};\n\t\t\t\tfor (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from);\n\t\t\t\t\tstartVars[p] = v.startAt[p];\n\t\t\t\t}\n\t\t\t\tstartVars.overwrite = false;\n\t\t\t\tstartVars.immediateRender = true;\n\t\t\t\tstartVars.lazy = (immediate && v.lazy !== false);\n\t\t\t\tstartVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop).\n\t\t\t\tthis._startAt = TweenLite.to(this.target, 0, startVars);\n\t\t\t\tif (immediate) {\n\t\t\t\t\tif (this._time > 0) {\n\t\t\t\t\t\tthis._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()).\n\t\t\t\t\t} else if (dur !== 0) {\n\t\t\t\t\t\treturn; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (v.runBackwards && dur !== 0) {\n\t\t\t\t//from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tthis._startAt.render(-1, true);\n\t\t\t\t\tthis._startAt.kill();\n\t\t\t\t\tthis._startAt = null;\n\t\t\t\t} else {\n\t\t\t\t\tif (this._time !== 0) { //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\t\t\t\t\t\timmediate = false;\n\t\t\t\t\t}\n\t\t\t\t\tpt = {};\n\t\t\t\t\tfor (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through.\n\t\t\t\t\t\tif (!_reservedProps[p] || p === \"autoCSS\") {\n\t\t\t\t\t\t\tpt[p] = v[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpt.overwrite = 0;\n\t\t\t\t\tpt.data = \"isFromStart\"; //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n\t\t\t\t\tpt.lazy = (immediate && v.lazy !== false);\n\t\t\t\t\tpt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n\t\t\t\t\tthis._startAt = TweenLite.to(this.target, 0, pt);\n\t\t\t\t\tif (!immediate) {\n\t\t\t\t\t\tthis._startAt._init(); //ensures that the initial values are recorded\n\t\t\t\t\t\tthis._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween.\n\t\t\t\t\t\tif (this.vars.immediateRender) {\n\t\t\t\t\t\t\tthis._startAt = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this._time === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ease = ease = (!ease) ? TweenLite.defaultEase : (ease instanceof Ease) ? ease : (typeof(ease) === \"function\") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase;\n\t\t\tif (v.easeParams instanceof Array && ease.config) {\n\t\t\t\tthis._ease = ease.config.apply(ease, v.easeParams);\n\t\t\t}\n\t\t\tthis._easeType = this._ease._type;\n\t\t\tthis._easePower = this._ease._power;\n\t\t\tthis._firstPT = null;\n\n\t\t\tif (this._targets) {\n\t\t\t\tl = this._targets.length;\n\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\tif ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null), i) ) {\n\t\t\t\t\t\tinitPlugins = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinitPlugins = this._initProps(this.target, this._propLookup, this._siblings, op, 0);\n\t\t\t}\n\n\t\t\tif (initPlugins) {\n\t\t\t\tTweenLite._onPluginEvent(\"_onInitAllProps\", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite\n\t\t\t}\n\t\t\tif (op) if (!this._firstPT) if (typeof(this.target) !== \"function\") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live.\n\t\t\t\tthis._enabled(false, false);\n\t\t\t}\n\t\t\tif (v.runBackwards) {\n\t\t\t\tpt = this._firstPT;\n\t\t\t\twhile (pt) {\n\t\t\t\t\tpt.s += pt.c;\n\t\t\t\t\tpt.c = -pt.c;\n\t\t\t\t\tpt = pt._next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._onUpdate = v.onUpdate;\n\t\t\tthis._initted = true;\n\t\t};\n\n\t\tp._initProps = function(target, propLookup, siblings, overwrittenProps, index) {\n\t\t\tvar p, i, initPlugins, plugin, pt, v;\n\t\t\tif (target == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (_lazyLookup[target._gsTweenID]) {\n\t\t\t\t_lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\t\t\t}\n\n\t\t\tif (!this.vars.css) if (target.style) if (target !== window && target.nodeType) if (_plugins.css) if (this.vars.autoCSS !== false) { //it's so common to use TweenLite/Max to animate the css of DOM elements, we assume that if the target is a DOM element, that's what is intended (a convenience so that users don't have to wrap things in css:{}, although we still recommend it for a slight performance boost and better specificity). Note: we cannot check \"nodeType\" on the window inside an iframe.\n\t\t\t\t_autoCSS(this.vars, target);\n\t\t\t}\n\t\t\tfor (p in this.vars) {\n\t\t\t\tv = this.vars[p];\n\t\t\t\tif (_reservedProps[p]) {\n\t\t\t\t\tif (v) if ((v instanceof Array) || (v.push && _isArray(v))) if (v.join(\"\").indexOf(\"{self}\") !== -1) {\n\t\t\t\t\t\tthis.vars[p] = v = this._swapSelfInParams(v, this);\n\t\t\t\t\t}\n\n\t\t\t\t} else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this, index)) {\n\n\t\t\t\t\t//t - target \t\t[object]\n\t\t\t\t\t//p - property \t\t[string]\n\t\t\t\t\t//s - start\t\t\t[number]\n\t\t\t\t\t//c - change\t\t[number]\n\t\t\t\t\t//f - isFunction\t[boolean]\n\t\t\t\t\t//n - name\t\t\t[string]\n\t\t\t\t\t//pg - isPlugin \t[boolean]\n\t\t\t\t\t//pr - priority\t\t[number]\n\t\t\t\t\t//m - mod [function | 0]\n\t\t\t\t\tthis._firstPT = pt = {_next:this._firstPT, t:plugin, p:\"setRatio\", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority, m:0};\n\t\t\t\t\ti = plugin._overwriteProps.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tpropLookup[plugin._overwriteProps[i]] = this._firstPT;\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin._priority || plugin._onInitAllProps) {\n\t\t\t\t\t\tinitPlugins = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin._onDisable || plugin._onEnable) {\n\t\t\t\t\t\tthis._notifyPluginsOfEnabled = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\tpt._next._prev = pt;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tpropLookup[p] = _addPropTween.call(this, target, p, \"get\", v, p, 0, null, this.vars.stringFilter, index);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first)\n\t\t\t\treturn this._initProps(target, propLookup, siblings, overwrittenProps, index);\n\t\t\t}\n\t\t\tif (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) {\n\t\t\t\tthis._kill(propLookup, target);\n\t\t\t\treturn this._initProps(target, propLookup, siblings, overwrittenProps, index);\n\t\t\t}\n\t\t\tif (this._firstPT) if ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration)) { //zero duration tweens don't lazy render by default; everything else does.\n\t\t\t\t_lazyLookup[target._gsTweenID] = true;\n\t\t\t}\n\t\t\treturn initPlugins;\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\tvar prevTime = this._time,\n\t\t\t\tduration = this._duration,\n\t\t\t\tprevRawPrevTime = this._rawPrevTime,\n\t\t\t\tisComplete, callback, pt, rawPrevTime;\n\t\t\tif (time >= duration - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts.\n\t\t\t\tthis._totalTime = this._time = duration;\n\t\t\t\tthis.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1;\n\t\t\t\tif (!this._reversed ) {\n\t\t\t\t\tisComplete = true;\n\t\t\t\t\tcallback = \"onComplete\";\n\t\t\t\t\tforce = (force || this._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline.\n\t\t\t\t}\n\t\t\t\tif (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the \"playhead\" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's \"playhead\" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.\n\t\t\t\t\tif (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.\n\t\t\t\t\t\ttime = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (prevRawPrevTime < 0 || (time <= 0 && time >= -0.0000001) || (prevRawPrevTime === _tinyNum && this.data !== \"isPause\")) if (prevRawPrevTime !== time) { //note: when this.data is \"isPause\", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause.\n\t\t\t\t\t\tforce = true;\n\t\t\t\t\t\tif (prevRawPrevTime > _tinyNum) {\n\t\t\t\t\t\t\tcallback = \"onReverseComplete\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.\n\t\t\t\t}\n\n\t\t\t} else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.\n\t\t\t\tthis._totalTime = this._time = 0;\n\t\t\t\tthis.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;\n\t\t\t\tif (prevTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) {\n\t\t\t\t\tcallback = \"onReverseComplete\";\n\t\t\t\t\tisComplete = this._reversed;\n\t\t\t\t}\n\t\t\t\tif (time < 0) {\n\t\t\t\t\tthis._active = false;\n\t\t\t\t\tif (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the \"playhead\" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's \"playhead\" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.\n\t\t\t\t\t\tif (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && this.data === \"isPause\")) {\n\t\t\t\t\t\t\tforce = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.\n\t\t\t\t\tforce = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._totalTime = this._time = time;\n\n\t\t\t\tif (this._easeType) {\n\t\t\t\t\tvar r = time / duration, type = this._easeType, pow = this._easePower;\n\t\t\t\t\tif (type === 1 || (type === 3 && r >= 0.5)) {\n\t\t\t\t\t\tr = 1 - r;\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 3) {\n\t\t\t\t\t\tr *= 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (pow === 1) {\n\t\t\t\t\t\tr *= r;\n\t\t\t\t\t} else if (pow === 2) {\n\t\t\t\t\t\tr *= r * r;\n\t\t\t\t\t} else if (pow === 3) {\n\t\t\t\t\t\tr *= r * r * r;\n\t\t\t\t\t} else if (pow === 4) {\n\t\t\t\t\t\tr *= r * r * r * r;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (type === 1) {\n\t\t\t\t\t\tthis.ratio = 1 - r;\n\t\t\t\t\t} else if (type === 2) {\n\t\t\t\t\t\tthis.ratio = r;\n\t\t\t\t\t} else if (time / duration < 0.5) {\n\t\t\t\t\t\tthis.ratio = r / 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.ratio = 1 - (r / 2);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tthis.ratio = this._ease.getRatio(time / duration);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._time === prevTime && !force) {\n\t\t\t\treturn;\n\t\t\t} else if (!this._initted) {\n\t\t\t\tthis._init();\n\t\t\t\tif (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) {\n\t\t\t\t\tthis._time = this._totalTime = prevTime;\n\t\t\t\t\tthis._rawPrevTime = prevRawPrevTime;\n\t\t\t\t\t_lazyTweens.push(this);\n\t\t\t\t\tthis._lazy = [time, suppressEvents];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.\n\t\t\t\tif (this._time && !isComplete) {\n\t\t\t\t\tthis.ratio = this._ease.getRatio(this._time / duration);\n\t\t\t\t} else if (isComplete && this._ease._calcEnd) {\n\t\t\t\t\tthis.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._lazy !== false) { //in case a lazy render is pending, we should flush it because the new render is occurring now (imagine a lazy tween instantiating and then immediately the user calls tween.seek(tween.duration()), skipping to the end - the end render would be forced, and then if we didn't flush the lazy render, it'd fire AFTER the seek(), rendering it at the wrong time.\n\t\t\t\tthis._lazy = false;\n\t\t\t}\n\t\t\tif (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) {\n\t\t\t\tthis._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.\n\t\t\t}\n\t\t\tif (prevTime === 0) {\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tif (time >= 0) {\n\t\t\t\t\t\tthis._startAt.render(time, suppressEvents, force);\n\t\t\t\t\t} else if (!callback) {\n\t\t\t\t\t\tcallback = \"_dummyGS\"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.vars.onStart) if (this._time !== 0 || duration === 0) if (!suppressEvents) {\n\t\t\t\t\tthis._callback(\"onStart\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tpt = this._firstPT;\n\t\t\twhile (pt) {\n\t\t\t\tif (pt.f) {\n\t\t\t\t\tpt.t[pt.p](pt.c * this.ratio + pt.s);\n\t\t\t\t} else {\n\t\t\t\t\tpt.t[pt.p] = pt.c * this.ratio + pt.s;\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\n\t\t\tif (this._onUpdate) {\n\t\t\t\tif (time < 0) if (this._startAt && time !== -0.0001) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.\n\t\t\t\t\tthis._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\t\t\t\t}\n\t\t\t\tif (!suppressEvents) if (this._time !== prevTime || isComplete || force) {\n\t\t\t\t\tthis._callback(\"onUpdate\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (callback) if (!this._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate\n\t\t\t\tif (time < 0 && this._startAt && !this._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values.\n\t\t\t\t\tthis._startAt.render(time, suppressEvents, force);\n\t\t\t\t}\n\t\t\t\tif (isComplete) {\n\t\t\t\t\tif (this._timeline.autoRemoveChildren) {\n\t\t\t\t\t\tthis._enabled(false, false);\n\t\t\t\t\t}\n\t\t\t\t\tthis._active = false;\n\t\t\t\t}\n\t\t\t\tif (!suppressEvents && this.vars[callback]) {\n\t\t\t\t\tthis._callback(callback);\n\t\t\t\t}\n\t\t\t\tif (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the \"time\" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless.\n\t\t\t\t\tthis._rawPrevTime = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tp._kill = function(vars, target, overwritingTween) {\n\t\t\tif (vars === \"all\") {\n\t\t\t\tvars = null;\n\t\t\t}\n\t\t\tif (vars == null) if (target == null || target === this.target) {\n\t\t\t\tthis._lazy = false;\n\t\t\t\treturn this._enabled(false, false);\n\t\t\t}\n\t\t\ttarget = (typeof(target) !== \"string\") ? (target || this._targets || this.target) : TweenLite.selector(target) || target;\n\t\t\tvar simultaneousOverwrite = (overwritingTween && this._time && overwritingTween._startTime === this._startTime && this._timeline === overwritingTween._timeline),\n\t\t\t\ti, overwrittenProps, p, pt, propLookup, changed, killProps, record, killed;\n\t\t\tif ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== \"number\") {\n\t\t\t\ti = target.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (this._kill(vars, target[i], overwritingTween)) {\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._targets) {\n\t\t\t\t\ti = this._targets.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tif (target === this._targets[i]) {\n\t\t\t\t\t\t\tpropLookup = this._propLookup[i] || {};\n\t\t\t\t\t\t\tthis._overwrittenProps = this._overwrittenProps || [];\n\t\t\t\t\t\t\toverwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : \"all\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (target !== this.target) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tpropLookup = this._propLookup;\n\t\t\t\t\toverwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : \"all\";\n\t\t\t\t}\n\n\t\t\t\tif (propLookup) {\n\t\t\t\t\tkillProps = vars || propLookup;\n\t\t\t\t\trecord = (vars !== overwrittenProps && overwrittenProps !== \"all\" && vars !== propLookup && (typeof(vars) !== \"object\" || !vars._tempKill)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin)\n\t\t\t\t\tif (overwritingTween && (TweenLite.onOverwrite || this.vars.onOverwrite)) {\n\t\t\t\t\t\tfor (p in killProps) {\n\t\t\t\t\t\t\tif (propLookup[p]) {\n\t\t\t\t\t\t\t\tif (!killed) {\n\t\t\t\t\t\t\t\t\tkilled = [];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tkilled.push(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((killed || !vars) && !_onOverwrite(this, overwritingTween, target, killed)) { //if the onOverwrite returned false, that means the user wants to override the overwriting (cancel it).\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (p in killProps) {\n\t\t\t\t\t\tif ((pt = propLookup[p])) {\n\t\t\t\t\t\t\tif (simultaneousOverwrite) { //if another tween overwrites this one and they both start at exactly the same time, yet this tween has already rendered once (for example, at 0.001) because it's first in the queue, we should revert the values to where they were at 0 so that the starting values aren't contaminated on the overwriting tween.\n\t\t\t\t\t\t\t\tif (pt.f) {\n\t\t\t\t\t\t\t\t\tpt.t[pt.p](pt.s);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tpt.t[pt.p] = pt.s;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (pt.pg && pt.t._kill(killProps)) {\n\t\t\t\t\t\t\t\tchanged = true; //some plugins need to be notified so they can perform cleanup tasks first\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!pt.pg || pt.t._overwriteProps.length === 0) {\n\t\t\t\t\t\t\t\tif (pt._prev) {\n\t\t\t\t\t\t\t\t\tpt._prev._next = pt._next;\n\t\t\t\t\t\t\t\t} else if (pt === this._firstPT) {\n\t\t\t\t\t\t\t\t\tthis._firstPT = pt._next;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\t\t\t\tpt._next._prev = pt._prev;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpt._next = pt._prev = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdelete propLookup[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (record) {\n\t\t\t\t\t\t\toverwrittenProps[p] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._firstPT && this._initted) { //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\t\t\t\t\t\tthis._enabled(false, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn changed;\n\t\t};\n\n\t\tp.invalidate = function() {\n\t\t\tif (this._notifyPluginsOfEnabled) {\n\t\t\t\tTweenLite._onPluginEvent(\"_onDisable\", this);\n\t\t\t}\n\t\t\tthis._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null;\n\t\t\tthis._notifyPluginsOfEnabled = this._active = this._lazy = false;\n\t\t\tthis._propLookup = (this._targets) ? {} : [];\n\t\t\tAnimation.prototype.invalidate.call(this);\n\t\t\tif (this.vars.immediateRender) {\n\t\t\t\tthis._time = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\t\t\t\tthis.render(Math.min(0, -this._delay)); //in case delay is negative.\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._enabled = function(enabled, ignoreTimeline) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (enabled && this._gc) {\n\t\t\t\tvar targets = this._targets,\n\t\t\t\t\ti;\n\t\t\t\tif (targets) {\n\t\t\t\t\ti = targets.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tthis._siblings[i] = _register(targets[i], this, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._siblings = _register(this.target, this, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAnimation.prototype._enabled.call(this, enabled, ignoreTimeline);\n\t\t\tif (this._notifyPluginsOfEnabled) if (this._firstPT) {\n\t\t\t\treturn TweenLite._onPluginEvent((enabled ? \"_onEnable\" : \"_onDisable\"), this);\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\n//----TweenLite static methods -----------------------------------------------------\n\n\t\tTweenLite.to = function(target, duration, vars) {\n\t\t\treturn new TweenLite(target, duration, vars);\n\t\t};\n\n\t\tTweenLite.from = function(target, duration, vars) {\n\t\t\tvars.runBackwards = true;\n\t\t\tvars.immediateRender = (vars.immediateRender != false);\n\t\t\treturn new TweenLite(target, duration, vars);\n\t\t};\n\n\t\tTweenLite.fromTo = function(target, duration, fromVars, toVars) {\n\t\t\ttoVars.startAt = fromVars;\n\t\t\ttoVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);\n\t\t\treturn new TweenLite(target, duration, toVars);\n\t\t};\n\n\t\tTweenLite.delayedCall = function(delay, callback, params, scope, useFrames) {\n\t\t\treturn new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0});\n\t\t};\n\n\t\tTweenLite.set = function(target, vars) {\n\t\t\treturn new TweenLite(target, 0, vars);\n\t\t};\n\n\t\tTweenLite.getTweensOf = function(target, onlyActive) {\n\t\t\tif (target == null) { return []; }\n\t\t\ttarget = (typeof(target) !== \"string\") ? target : TweenLite.selector(target) || target;\n\t\t\tvar i, a, j, t;\n\t\t\tif ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== \"number\") {\n\t\t\t\ti = target.length;\n\t\t\t\ta = [];\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\ta = a.concat(TweenLite.getTweensOf(target[i], onlyActive));\n\t\t\t\t}\n\t\t\t\ti = a.length;\n\t\t\t\t//now get rid of any duplicates (tweens of arrays of objects could cause duplicates)\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tt = a[i];\n\t\t\t\t\tj = i;\n\t\t\t\t\twhile (--j > -1) {\n\t\t\t\t\t\tif (t === a[j]) {\n\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ta = _register(target).concat();\n\t\t\t\ti = a.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (a[i]._gc || (onlyActive && !a[i].isActive())) {\n\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a;\n\t\t};\n\n\t\tTweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) {\n\t\t\tif (typeof(onlyActive) === \"object\") {\n\t\t\t\tvars = onlyActive; //for backwards compatibility (before \"onlyActive\" parameter was inserted)\n\t\t\t\tonlyActive = false;\n\t\t\t}\n\t\t\tvar a = TweenLite.getTweensOf(target, onlyActive),\n\t\t\t\ti = a.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\ta[i]._kill(vars, target);\n\t\t\t}\n\t\t};\n\n\n\n/*\n * ----------------------------------------------------------------\n * TweenPlugin (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another script call before loading plugins which is easy to forget)\n * ----------------------------------------------------------------\n */\n\t\tvar TweenPlugin = _class(\"plugins.TweenPlugin\", function(props, priority) {\n\t\t\t\t\tthis._overwriteProps = (props || \"\").split(\",\");\n\t\t\t\t\tthis._propName = this._overwriteProps[0];\n\t\t\t\t\tthis._priority = priority || 0;\n\t\t\t\t\tthis._super = TweenPlugin.prototype;\n\t\t\t\t}, true);\n\n\t\tp = TweenPlugin.prototype;\n\t\tTweenPlugin.version = \"1.19.0\";\n\t\tTweenPlugin.API = 2;\n\t\tp._firstPT = null;\n\t\tp._addTween = _addPropTween;\n\t\tp.setRatio = _setRatio;\n\n\t\tp._kill = function(lookup) {\n\t\t\tvar a = this._overwriteProps,\n\t\t\t\tpt = this._firstPT,\n\t\t\t\ti;\n\t\t\tif (lookup[this._propName] != null) {\n\t\t\t\tthis._overwriteProps = [];\n\t\t\t} else {\n\t\t\t\ti = a.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (lookup[a[i]] != null) {\n\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (pt) {\n\t\t\t\tif (lookup[pt.n] != null) {\n\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\tpt._next._prev = pt._prev;\n\t\t\t\t\t}\n\t\t\t\t\tif (pt._prev) {\n\t\t\t\t\t\tpt._prev._next = pt._next;\n\t\t\t\t\t\tpt._prev = null;\n\t\t\t\t\t} else if (this._firstPT === pt) {\n\t\t\t\t\t\tthis._firstPT = pt._next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tp._mod = p._roundProps = function(lookup) {\n\t\t\tvar pt = this._firstPT,\n\t\t\t\tval;\n\t\t\twhile (pt) {\n\t\t\t\tval = lookup[this._propName] || (pt.n != null && lookup[ pt.n.split(this._propName + \"_\").join(\"\") ]);\n\t\t\t\tif (val && typeof(val) === \"function\") { //some properties that are very plugin-specific add a prefix named after the _propName plus an underscore, so we need to ignore that extra stuff here.\n\t\t\t\t\tif (pt.f === 2) {\n\t\t\t\t\t\tpt.t._applyPT.m = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.m = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t};\n\n\t\tTweenLite._onPluginEvent = function(type, tween) {\n\t\t\tvar pt = tween._firstPT,\n\t\t\t\tchanged, pt2, first, last, next;\n\t\t\tif (type === \"_onInitAllProps\") {\n\t\t\t\t//sorts the PropTween linked list in order of priority because some plugins need to render earlier/later than others, like MotionBlurPlugin applies its effects after all x/y/alpha tweens have rendered on each frame.\n\t\t\t\twhile (pt) {\n\t\t\t\t\tnext = pt._next;\n\t\t\t\t\tpt2 = first;\n\t\t\t\t\twhile (pt2 && pt2.pr > pt.pr) {\n\t\t\t\t\t\tpt2 = pt2._next;\n\t\t\t\t\t}\n\t\t\t\t\tif ((pt._prev = pt2 ? pt2._prev : last)) {\n\t\t\t\t\t\tpt._prev._next = pt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfirst = pt;\n\t\t\t\t\t}\n\t\t\t\t\tif ((pt._next = pt2)) {\n\t\t\t\t\t\tpt2._prev = pt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlast = pt;\n\t\t\t\t\t}\n\t\t\t\t\tpt = next;\n\t\t\t\t}\n\t\t\t\tpt = tween._firstPT = first;\n\t\t\t}\n\t\t\twhile (pt) {\n\t\t\t\tif (pt.pg) if (typeof(pt.t[type]) === \"function\") if (pt.t[type]()) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t\treturn changed;\n\t\t};\n\n\t\tTweenPlugin.activate = function(plugins) {\n\t\t\tvar i = plugins.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\tif (plugins[i].API === TweenPlugin.API) {\n\t\t\t\t\t_plugins[(new plugins[i]())._propName] = plugins[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t//provides a more concise way to define plugins that have no dependencies besides TweenPlugin and TweenLite, wrapping common boilerplate stuff into one function (added in 1.9.0). You don't NEED to use this to define a plugin - the old way still works and can be useful in certain (rare) situations.\n\t\t_gsDefine.plugin = function(config) {\n\t\t\tif (!config || !config.propName || !config.init || !config.API) { throw \"illegal plugin definition.\"; }\n\t\t\tvar propName = config.propName,\n\t\t\t\tpriority = config.priority || 0,\n\t\t\t\toverwriteProps = config.overwriteProps,\n\t\t\t\tmap = {init:\"_onInitTween\", set:\"setRatio\", kill:\"_kill\", round:\"_mod\", mod:\"_mod\", initAll:\"_onInitAllProps\"},\n\t\t\t\tPlugin = _class(\"plugins.\" + propName.charAt(0).toUpperCase() + propName.substr(1) + \"Plugin\",\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tTweenPlugin.call(this, propName, priority);\n\t\t\t\t\t\tthis._overwriteProps = overwriteProps || [];\n\t\t\t\t\t}, (config.global === true)),\n\t\t\t\tp = Plugin.prototype = new TweenPlugin(propName),\n\t\t\t\tprop;\n\t\t\tp.constructor = Plugin;\n\t\t\tPlugin.API = config.API;\n\t\t\tfor (prop in map) {\n\t\t\t\tif (typeof(config[prop]) === \"function\") {\n\t\t\t\t\tp[map[prop]] = config[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t\tPlugin.version = config.version;\n\t\t\tTweenPlugin.activate([Plugin]);\n\t\t\treturn Plugin;\n\t\t};\n\n\n\t\t//now run through all the dependencies discovered and if any are missing, log that to the console as a warning. This is why it's best to have TweenLite load last - it can check all the dependencies for you.\n\t\ta = window._gsQueue;\n\t\tif (a) {\n\t\t\tfor (i = 0; i < a.length; i++) {\n\t\t\t\ta[i]();\n\t\t\t}\n\t\t\tfor (p in _defLookup) {\n\t\t\t\tif (!_defLookup[p].func) {\n\t\t\t\t\twindow.console.log(\"GSAP encountered missing dependency: \" + p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated\n\n})((typeof(module) !== \"undefined\" && module.exports && typeof(global) !== \"undefined\") ? global : this || window, \"TweenMax\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/gsap/TweenMax.js\n// module id = 140\n// module chunks = 0","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Uint8Array.js\n// module id = 141\n// module chunks = 0","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_WeakMap.js\n// module id = 142\n// module chunks = 0","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayEvery.js\n// module id = 143\n// module chunks = 0","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayLikeKeys.js\n// module id = 144\n// module chunks = 0","var baseRandom = require('./_baseRandom');\n\n/**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\nfunction arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n}\n\nmodule.exports = arraySample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arraySample.js\n// module id = 145\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_assignMergeValue.js\n// module id = 146\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAssign.js\n// module id = 147\n// module chunks = 0","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseDelay.js\n// module id = 148\n// module chunks = 0","var baseForOwnRight = require('./_baseForOwnRight'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEachRight = createBaseEach(baseForOwnRight, true);\n\nmodule.exports = baseEachRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseEachRight.js\n// module id = 149\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseFilter.js\n// module id = 150\n// module chunks = 0","/**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFindKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseFindKey.js\n// module id = 151\n// module chunks = 0","var createBaseFor = require('./_createBaseFor');\n\n/**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseForRight = createBaseFor(true);\n\nmodule.exports = baseForRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseForRight.js\n// module id = 152\n// module chunks = 0","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseGetAllKeys.js\n// module id = 153\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIndexOf.js\n// module id = 154\n// module chunks = 0","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsEqual.js\n// module id = 155\n// module chunks = 0","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeys.js\n// module id = 156\n// module chunks = 0","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMap.js\n// module id = 157\n// module chunks = 0","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMatches.js\n// module id = 158\n// module chunks = 0","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMatchesProperty.js\n// module id = 159\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseOrderBy.js\n// module id = 160\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePickBy.js\n// module id = 161\n// module chunks = 0","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseProperty.js\n// module id = 162\n// module chunks = 0","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseReduce.js\n// module id = 163\n// module chunks = 0","var identity = require('./identity'),\n metaMap = require('./_metaMap');\n\n/**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nmodule.exports = baseSetData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSetData.js\n// module id = 164\n// module chunks = 0","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSlice.js\n// module id = 165\n// module chunks = 0","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseTimes.js\n// module id = 166\n// module chunks = 0","var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseUnset.js\n// module id = 167\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet');\n\n/**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n}\n\nmodule.exports = baseUpdate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseUpdate.js\n// module id = 168\n// module chunks = 0","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseValues.js\n// module id = 169\n// module chunks = 0","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneBuffer.js\n// module id = 170\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneTypedArray.js\n// module id = 171\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nmodule.exports = composeArgs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_composeArgs.js\n// module id = 172\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nmodule.exports = composeArgsRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_composeArgsRight.js\n// module id = 173\n// module chunks = 0","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBaseEach.js\n// module id = 174\n// module chunks = 0","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBaseFor.js\n// module id = 175\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n isArrayLike = require('./isArrayLike'),\n keys = require('./keys');\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createFind.js\n// module id = 176\n// module chunks = 0","var LodashWrapper = require('./_LodashWrapper'),\n flatRest = require('./_flatRest'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n isArray = require('./isArray'),\n isLaziable = require('./_isLaziable');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\nfunction createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n}\n\nmodule.exports = createFlow;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createFlow.js\n// module id = 177\n// module chunks = 0","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n countHolders = require('./_countHolders'),\n createCtor = require('./_createCtor'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n reorder = require('./_reorder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_ARY_FLAG = 128,\n WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nmodule.exports = createHybrid;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createHybrid.js\n// module id = 178\n// module chunks = 0","var baseInverter = require('./_baseInverter');\n\n/**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\nfunction createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n}\n\nmodule.exports = createInverter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createInverter.js\n// module id = 179\n// module chunks = 0","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createRange.js\n// module id = 180\n// module chunks = 0","var isLaziable = require('./_isLaziable'),\n setData = require('./_setData'),\n setWrapToString = require('./_setWrapToString');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n}\n\nmodule.exports = createRecurry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createRecurry.js\n// module id = 181\n// module chunks = 0","var baseToPairs = require('./_baseToPairs'),\n getTag = require('./_getTag'),\n mapToArray = require('./_mapToArray'),\n setToPairs = require('./_setToPairs');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n}\n\nmodule.exports = createToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createToPairs.js\n// module id = 182\n// module chunks = 0","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_defineProperty.js\n// module id = 183\n// module chunks = 0","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalArrays.js\n// module id = 184\n// module chunks = 0","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_freeGlobal.js\n// module id = 185\n// module chunks = 0","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getAllKeys.js\n// module id = 186\n// module chunks = 0","var realNames = require('./_realNames');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nmodule.exports = getFuncName;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getFuncName.js\n// module id = 187\n// module chunks = 0","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getSymbolsIn.js\n// module id = 188\n// module chunks = 0","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hasPath.js\n// module id = 189\n// module chunks = 0","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneObject.js\n// module id = 190\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n lodash = require('./wrapperLodash');\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nmodule.exports = isLaziable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isLaziable.js\n// module id = 191\n// module chunks = 0","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isStrictComparable.js\n// module id = 192\n// module chunks = 0","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_matchesStrictComparable.js\n// module id = 193\n// module chunks = 0","var WeakMap = require('./_WeakMap');\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nmodule.exports = metaMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_metaMap.js\n// module id = 194\n// module chunks = 0","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overArg.js\n// module id = 195\n// module chunks = 0","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overRest.js\n// module id = 196\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_parent.js\n// module id = 197\n// module chunks = 0","var baseSetData = require('./_baseSetData'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = shortOut(baseSetData);\n\nmodule.exports = setData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setData.js\n// module id = 198\n// module chunks = 0","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setToArray.js\n// module id = 199\n// module chunks = 0","var getWrapDetails = require('./_getWrapDetails'),\n insertWrapDetails = require('./_insertWrapDetails'),\n setToString = require('./_setToString'),\n updateWrapDetails = require('./_updateWrapDetails');\n\n/**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\nfunction setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n}\n\nmodule.exports = setWrapToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setWrapToString.js\n// module id = 200\n// module chunks = 0","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_shortOut.js\n// module id = 201\n// module chunks = 0","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stringToPath.js\n// module id = 202\n// module chunks = 0","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_toSource.js\n// module id = 203\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_ARY_FLAG = 128;\n\n/**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\nfunction ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n}\n\nmodule.exports = ary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/ary.js\n// module id = 204\n// module chunks = 0","var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nmodule.exports = assignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assignIn.js\n// module id = 205\n// module chunks = 0","var toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\nfunction before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n}\n\nmodule.exports = before;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/before.js\n// module id = 206\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\nvar bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n});\n\n// Assign default placeholders.\nbind.placeholder = {};\n\nmodule.exports = bind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bind.js\n// module id = 207\n// module chunks = 0","module.exports = {\n 'countBy': require('./countBy'),\n 'each': require('./each'),\n 'eachRight': require('./eachRight'),\n 'every': require('./every'),\n 'filter': require('./filter'),\n 'find': require('./find'),\n 'findLast': require('./findLast'),\n 'flatMap': require('./flatMap'),\n 'flatMapDeep': require('./flatMapDeep'),\n 'flatMapDepth': require('./flatMapDepth'),\n 'forEach': require('./forEach'),\n 'forEachRight': require('./forEachRight'),\n 'groupBy': require('./groupBy'),\n 'includes': require('./includes'),\n 'invokeMap': require('./invokeMap'),\n 'keyBy': require('./keyBy'),\n 'map': require('./map'),\n 'orderBy': require('./orderBy'),\n 'partition': require('./partition'),\n 'reduce': require('./reduce'),\n 'reduceRight': require('./reduceRight'),\n 'reject': require('./reject'),\n 'sample': require('./sample'),\n 'sampleSize': require('./sampleSize'),\n 'shuffle': require('./shuffle'),\n 'size': require('./size'),\n 'some': require('./some'),\n 'sortBy': require('./sortBy')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/collection.js\n// module id = 208\n// module chunks = 0","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/debounce.js\n// module id = 209\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseEach = require('./_baseEach'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forEach.js\n// module id = 210\n// module chunks = 0","var arrayEachRight = require('./_arrayEachRight'),\n baseEachRight = require('./_baseEachRight'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\nfunction forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEachRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forEachRight.js\n// module id = 211\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isString.js\n// module id = 212\n// module chunks = 0","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/last.js\n// module id = 213\n// module chunks = 0","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/memoize.js\n// module id = 214\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mergeWith.js\n// module id = 215\n// module chunks = 0","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/noop.js\n// module id = 216\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\nvar partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartial.placeholder = {};\n\nmodule.exports = partial;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partial.js\n// module id = 217\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n basePickBy = require('./_basePickBy'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nmodule.exports = pickBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/pickBy.js\n// module id = 218\n// module chunks = 0","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/property.js\n// module id = 219\n// module chunks = 0","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubFalse.js\n// module id = 220\n// module chunks = 0","var createToPairs = require('./_createToPairs'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nmodule.exports = toPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPairs.js\n// module id = 221\n// module chunks = 0","var createToPairs = require('./_createToPairs'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\nvar toPairsIn = createToPairs(keysIn);\n\nmodule.exports = toPairsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPairsIn.js\n// module id = 222\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MiniSignalBinding = (function () {\n function MiniSignalBinding(fn, once, thisArg) {\n if (once === undefined) once = false;\n\n _classCallCheck(this, MiniSignalBinding);\n\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n\n _createClass(MiniSignalBinding, [{\n key: 'detach',\n value: function detach() {\n if (this._owner === null) return false;\n this._owner.detach(this);\n return true;\n }\n }]);\n\n return MiniSignalBinding;\n})();\n\nfunction _addMiniSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n } else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n\n node._owner = self;\n\n return node;\n}\n\nvar MiniSignal = (function () {\n function MiniSignal() {\n _classCallCheck(this, MiniSignal);\n\n this._head = this._tail = undefined;\n }\n\n _createClass(MiniSignal, [{\n key: 'handlers',\n value: function handlers() {\n var exists = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\n var node = this._head;\n\n if (exists) return !!node;\n\n var ee = [];\n\n while (node) {\n ee.push(node);\n node = node._next;\n }\n\n return ee;\n }\n }, {\n key: 'has',\n value: function has(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a MiniSignalBinding object.');\n }\n\n return node._owner === this;\n }\n }, {\n key: 'dispatch',\n value: function dispatch() {\n var node = this._head;\n\n if (!node) return false;\n\n while (node) {\n if (node._once) this.detach(node);\n node._fn.apply(node._thisArg, arguments);\n node = node._next;\n }\n\n return true;\n }\n }, {\n key: 'add',\n value: function add(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, false, thisArg));\n }\n }, {\n key: 'once',\n value: function once(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, true, thisArg));\n }\n }, {\n key: 'detach',\n value: function detach(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a MiniSignalBinding object.');\n }\n if (node._owner !== this) return this;\n\n if (node._prev) node._prev._next = node._next;\n if (node._next) node._next._prev = node._prev;\n\n if (node === this._head) {\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n } else if (node === this._tail) {\n this._tail = node._prev;\n this._tail._next = null;\n }\n\n node._owner = null;\n return this;\n }\n }, {\n key: 'detachAll',\n value: function detachAll() {\n var node = this._head;\n if (!node) return this;\n\n this._head = this._tail = null;\n\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n }\n }]);\n\n return MiniSignal;\n})();\n\nMiniSignal.MiniSignalBinding = MiniSignalBinding;\n\nexports['default'] = MiniSignal;\nmodule.exports = exports['default'];\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/mini-signals/lib/mini-signals.js\n// module id = 223\n// module chunks = 0","'use strict'\n\nmodule.exports = function parseURI (str, opts) {\n opts = opts || {}\n\n var o = {\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n }\n\n var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str)\n var uri = {}\n var i = 14\n\n while (i--) uri[o.key[i]] = m[i] || ''\n\n uri[o.q.name] = {}\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2\n })\n\n return uri\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-uri/index.js\n// module id = 224\n// module chunks = 0","\n/**\n * Helper class to create a WebGL Texture\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param width {number} the width of the texture\n * @param height {number} the height of the texture\n * @param format {number} the pixel format of the texture. defaults to gl.RGBA\n * @param type {number} the gl type of the texture. defaults to gl.UNSIGNED_BYTE\n */\nvar Texture = function(gl, width, height, format, type)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\n\t/**\n\t * The WebGL texture\n\t *\n\t * @member {WebGLTexture}\n\t */\n\tthis.texture = gl.createTexture();\n\n\t/**\n\t * If mipmapping was used for this texture, enable and disable with enableMipmap()\n\t *\n\t * @member {Boolean}\n\t */\n\t// some settings..\n\tthis.mipmap = false;\n\n\n\t/**\n\t * Set to true to enable pre-multiplied alpha\n\t *\n\t * @member {Boolean}\n\t */\n\tthis.premultiplyAlpha = false;\n\n\t/**\n\t * The width of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.width = width || -1;\n\t/**\n\t * The height of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.height = height || -1;\n\n\t/**\n\t * The pixel format of the texture. defaults to gl.RGBA\n\t *\n\t * @member {Number}\n\t */\n\tthis.format = format || gl.RGBA;\n\n\t/**\n\t * The gl type of the texture. defaults to gl.UNSIGNED_BYTE\n\t *\n\t * @member {Number}\n\t */\n\tthis.type = type || gl.UNSIGNED_BYTE;\n\n\n};\n\n/**\n * Uploads this texture to the GPU\n * @param source {HTMLImageElement|ImageData|HTMLVideoElement} the source image of the texture\n */\nTexture.prototype.upload = function(source)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\tvar newWidth = source.videoWidth || source.width;\n\tvar newHeight = source.videoHeight || source.height;\n\n\tif(newHeight !== this.height || newWidth !== this.width)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);\n\t}\n\telse\n\t{\n \tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);\n\t}\n\n\t// if the source is a video, we need to use the videoWidth / videoHeight properties as width / height will be incorrect.\n\tthis.width = newWidth;\n\tthis.height = newHeight;\n\n};\n\nvar FLOATING_POINT_AVAILABLE = false;\n\n/**\n * Use a data source and uploads this texture to the GPU\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.prototype.uploadData = function(data, width, height)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tif(data instanceof Float32Array)\n\t{\n\t\tif(!FLOATING_POINT_AVAILABLE)\n\t\t{\n\t\t\tvar ext = gl.getExtension(\"OES_texture_float\");\n\n\t\t\tif(ext)\n\t\t\t{\n\t\t\t\tFLOATING_POINT_AVAILABLE = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Error('floating point textures not available');\n\t\t\t}\n\t\t}\n\n\t\tthis.type = gl.FLOAT;\n\t}\n\telse\n\t{\n\t\t// TODO support for other types\n\t\tthis.type = this.type || gl.UNSIGNED_BYTE;\n\t}\n\n\t// what type of data?\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\n\tif(width !== this.width || height !== this.height)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, this.type, data || null);\n\t}\n\telse\n\t{\n\t\tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, this.format, this.type, data || null);\n\t}\n\n\tthis.width = width;\n\tthis.height = height;\n\n\n//\ttexSubImage2D\n};\n\n/**\n * Binds the texture\n * @param location\n */\nTexture.prototype.bind = function(location)\n{\n\tvar gl = this.gl;\n\n\tif(location !== undefined)\n\t{\n\t\tgl.activeTexture(gl.TEXTURE0 + location);\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n};\n\n/**\n * Unbinds the texture\n */\nTexture.prototype.unbind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.minFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tif(this.mipmap)\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n\t}\n\telse\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n\t}\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.magFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n};\n\n/**\n * Enables mipmapping\n */\nTexture.prototype.enableMipmap = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tthis.mipmap = true;\n\n\tgl.generateMipmap(gl.TEXTURE_2D);\n};\n\n/**\n * Enables linear filtering\n */\nTexture.prototype.enableLinearScaling = function()\n{\n\tthis.minFilter(true);\n\tthis.magFilter(true);\n};\n\n/**\n * Enables nearest neighbour interpolation\n */\nTexture.prototype.enableNearestScaling = function()\n{\n\tthis.minFilter(false);\n\tthis.magFilter(false);\n};\n\n/**\n * Enables clamping on the texture so WebGL will not repeat it\n */\nTexture.prototype.enableWrapClamp = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n};\n\n/**\n * Enable tiling on the texture\n */\nTexture.prototype.enableWrapRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n};\n\nTexture.prototype.enableWrapMirrorRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT);\n};\n\n\n/**\n * Destroys this texture\n */\nTexture.prototype.destroy = function()\n{\n\tvar gl = this.gl;\n\t//TODO\n\tgl.deleteTexture(this.texture);\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param source {HTMLImageElement|ImageData} the source image of the texture\n * @param premultiplyAlpha {Boolean} If we want to use pre-multiplied alpha\n */\nTexture.fromSource = function(gl, source, premultiplyAlpha)\n{\n\tvar texture = new Texture(gl);\n\ttexture.premultiplyAlpha = premultiplyAlpha || false;\n\ttexture.upload(source);\n\n\treturn texture;\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.fromData = function(gl, data, width, height)\n{\n\t//console.log(data, width, height);\n\tvar texture = new Texture(gl);\n\ttexture.uploadData(data, width, height);\n\n\treturn texture;\n};\n\n\nmodule.exports = Texture;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLTexture.js\n// module id = 225\n// module chunks = 0","// var GL_MAP = {};\n\n/**\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param attribs {*}\n * @param state {*}\n */\nvar setVertexAttribArrays = function (gl, attribs, state)\n{\n var i;\n if(state)\n {\n var tempAttribState = state.tempAttribState,\n attribState = state.attribState;\n\n for (i = 0; i < tempAttribState.length; i++)\n {\n tempAttribState[i] = false;\n }\n\n // set the new attribs\n for (i = 0; i < attribs.length; i++)\n {\n tempAttribState[attribs[i].attribute.location] = true;\n }\n\n for (i = 0; i < attribState.length; i++)\n {\n if (attribState[i] !== tempAttribState[i])\n {\n attribState[i] = tempAttribState[i];\n\n if (state.attribState[i])\n {\n gl.enableVertexAttribArray(i);\n }\n else\n {\n gl.disableVertexAttribArray(i);\n }\n }\n }\n\n }\n else\n {\n for (i = 0; i < attribs.length; i++)\n {\n var attrib = attribs[i];\n gl.enableVertexAttribArray(attrib.attribute.location);\n }\n }\n};\n\nmodule.exports = setVertexAttribArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/setVertexAttribArrays.js\n// module id = 226\n// module chunks = 0","\n/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations\n * @return {WebGLProgram} the shader program\n */\nvar compileProgram = function(gl, vertexSrc, fragmentSrc, attributeLocations)\n{\n var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);\n var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);\n\n var program = gl.createProgram();\n\n gl.attachShader(program, glVertShader);\n gl.attachShader(program, glFragShader);\n\n // optionally, set the attributes manually for the program rather than letting WebGL decide..\n if(attributeLocations)\n {\n for(var i in attributeLocations)\n {\n gl.bindAttribLocation(program, attributeLocations[i], i);\n }\n }\n\n\n gl.linkProgram(program);\n\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n {\n console.error('Pixi.js Error: Could not initialize shader.');\n console.error('gl.VALIDATE_STATUS', gl.getProgramParameter(program, gl.VALIDATE_STATUS));\n console.error('gl.getError()', gl.getError());\n\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '')\n {\n console.warn('Pixi.js Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n\n gl.deleteProgram(program);\n program = null;\n }\n\n // clean up some shaders\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n\n return program;\n};\n\n/**\n * @private\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param type {Number} the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @return {WebGLShader} the shader\n */\nvar compileShader = function (gl, type, src)\n{\n var shader = gl.createShader(type);\n\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n console.log(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n};\n\nmodule.exports = compileProgram;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/compileProgram.js\n// module id = 227\n// module chunks = 0","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String} Type of value\n * @param size {Number}\n */\nvar defaultValue = function(type, size) \n{\n switch (type)\n {\n case 'float':\n return 0;\n\n case 'vec2': \n return new Float32Array(2 * size);\n\n case 'vec3':\n return new Float32Array(3 * size);\n\n case 'vec4': \n return new Float32Array(4 * size);\n \n case 'int':\n case 'sampler2D':\n return 0;\n\n case 'ivec2': \n return new Int32Array(2 * size);\n\n case 'ivec3':\n return new Int32Array(3 * size);\n\n case 'ivec4': \n return new Int32Array(4 * size);\n\n case 'bool': \n return false;\n\n case 'bvec2':\n\n return booleanArray( 2 * size);\n\n case 'bvec3':\n return booleanArray(3 * size);\n\n case 'bvec4':\n return booleanArray(4 * size);\n\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3': \n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n};\n\nvar booleanArray = function(size)\n{\n var array = new Array(size);\n\n for (var i = 0; i < array.length; i++) \n {\n array[i] = false;\n }\n\n return array;\n};\n\nmodule.exports = defaultValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/defaultValue.js\n// module id = 228\n// module chunks = 0","\nvar mapType = require('./mapType');\nvar mapSize = require('./mapSize');\n\n/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the attributes from\n * @return attributes {Object}\n */\nvar extractAttributes = function(gl, program)\n{\n var attributes = {};\n\n var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (var i = 0; i < totalAttributes; i++)\n {\n var attribData = gl.getActiveAttrib(program, i);\n var type = mapType(gl, attribData.type);\n\n attributes[attribData.name] = {\n type:type,\n size:mapSize(type),\n location:gl.getAttribLocation(program, attribData.name),\n //TODO - make an attribute object\n pointer: pointer\n };\n }\n\n return attributes;\n};\n\nvar pointer = function(type, normalized, stride, start){\n // console.log(this.location)\n gl.vertexAttribPointer(this.location,this.size, type || gl.FLOAT, normalized || false, stride || 0, start || 0);\n};\n\nmodule.exports = extractAttributes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/extractAttributes.js\n// module id = 229\n// module chunks = 0","var mapType = require('./mapType');\nvar defaultValue = require('./defaultValue');\n\n/**\n * Extracts the uniforms\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the uniforms from\n * @return uniforms {Object}\n */\nvar extractUniforms = function(gl, program)\n{\n\tvar uniforms = {};\n\n var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (var i = 0; i < totalUniforms; i++)\n {\n \tvar uniformData = gl.getActiveUniform(program, i);\n \tvar name = uniformData.name.replace(/\\[.*?\\]/, \"\");\n var type = mapType(gl, uniformData.type );\n\n \tuniforms[name] = {\n \t\ttype:type,\n \t\tsize:uniformData.size,\n \t\tlocation:gl.getUniformLocation(program, name),\n \t\tvalue:defaultValue(type, uniformData.size)\n \t};\n }\n\n\treturn uniforms;\n};\n\nmodule.exports = extractUniforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/extractUniforms.js\n// module id = 230\n// module chunks = 0","/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param uniforms {Array} @mat ?\n * @return attributes {Object}\n */\nvar generateUniformAccessObject = function(gl, uniformData)\n{\n // this is the object we will be sending back.\n // an object hierachy will be created for structs\n var uniforms = {data:{}};\n\n uniforms.gl = gl;\n\n var uniformKeys= Object.keys(uniformData);\n\n for (var i = 0; i < uniformKeys.length; i++)\n {\n var fullName = uniformKeys[i];\n\n var nameTokens = fullName.split('.');\n var name = nameTokens[nameTokens.length - 1];\n\n\n var uniformGroup = getUniformGroup(nameTokens, uniforms);\n\n var uniform = uniformData[fullName];\n uniformGroup.data[name] = uniform;\n\n uniformGroup.gl = gl;\n\n Object.defineProperty(uniformGroup, name, {\n get: generateGetter(name),\n set: generateSetter(name, uniform)\n });\n }\n\n return uniforms;\n};\n\nvar generateGetter = function(name)\n{\n\tvar template = getterTemplate.replace('%%', name);\n\treturn new Function(template); // jshint ignore:line\n};\n\nvar generateSetter = function(name, uniform)\n{\n var template = setterTemplate.replace(/%%/g, name);\n var setTemplate;\n\n if(uniform.size === 1)\n {\n setTemplate = GLSL_TO_SINGLE_SETTERS[uniform.type];\n }\n else\n {\n setTemplate = GLSL_TO_ARRAY_SETTERS[uniform.type];\n }\n\n if(setTemplate)\n {\n template += \"\\nthis.gl.\" + setTemplate + \";\";\n }\n\n \treturn new Function('value', template); // jshint ignore:line\n};\n\nvar getUniformGroup = function(nameTokens, uniform)\n{\n var cur = uniform;\n\n for (var i = 0; i < nameTokens.length - 1; i++)\n {\n var o = cur[nameTokens[i]] || {data:{}};\n cur[nameTokens[i]] = o;\n cur = o;\n }\n\n return cur;\n};\n\nvar getterTemplate = [\n 'return this.data.%%.value;',\n].join('\\n');\n\nvar setterTemplate = [\n 'this.data.%%.value = value;',\n 'var location = this.data.%%.location;'\n].join('\\n');\n\n\nvar GLSL_TO_SINGLE_SETTERS = {\n\n 'float': 'uniform1f(location, value)',\n\n 'vec2': 'uniform2f(location, value[0], value[1])',\n 'vec3': 'uniform3f(location, value[0], value[1], value[2])',\n 'vec4': 'uniform4f(location, value[0], value[1], value[2], value[3])',\n\n 'int': 'uniform1i(location, value)',\n 'ivec2': 'uniform2i(location, value[0], value[1])',\n 'ivec3': 'uniform3i(location, value[0], value[1], value[2])',\n 'ivec4': 'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n 'bool': 'uniform1i(location, value)',\n 'bvec2': 'uniform2i(location, value[0], value[1])',\n 'bvec3': 'uniform3i(location, value[0], value[1], value[2])',\n 'bvec4': 'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n 'mat2': 'uniformMatrix2fv(location, false, value)',\n 'mat3': 'uniformMatrix3fv(location, false, value)',\n 'mat4': 'uniformMatrix4fv(location, false, value)',\n\n 'sampler2D':'uniform1i(location, value)'\n};\n\nvar GLSL_TO_ARRAY_SETTERS = {\n\n 'float': 'uniform1fv(location, value)',\n\n 'vec2': 'uniform2fv(location, value)',\n 'vec3': 'uniform3fv(location, value)',\n 'vec4': 'uniform4fv(location, value)',\n\n 'int': 'uniform1iv(location, value)',\n 'ivec2': 'uniform2iv(location, value)',\n 'ivec3': 'uniform3iv(location, value)',\n 'ivec4': 'uniform4iv(location, value)',\n\n 'bool': 'uniform1iv(location, value)',\n 'bvec2': 'uniform2iv(location, value)',\n 'bvec3': 'uniform3iv(location, value)',\n 'bvec4': 'uniform4iv(location, value)',\n\n 'sampler2D':'uniform1iv(location, value)'\n};\n\nmodule.exports = generateUniformAccessObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/generateUniformAccessObject.js\n// module id = 231\n// module chunks = 0","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String}\n * @return {Number}\n */\nvar mapSize = function(type) \n{ \n return GLSL_TO_SIZE[type];\n};\n\n\nvar GLSL_TO_SIZE = {\n 'float': 1,\n 'vec2': 2,\n 'vec3': 3,\n 'vec4': 4,\n\n 'int': 1,\n 'ivec2': 2,\n 'ivec3': 3,\n 'ivec4': 4,\n\n 'bool': 1,\n 'bvec2': 2,\n 'bvec3': 3,\n 'bvec4': 4,\n\n 'mat2': 4,\n 'mat3': 9,\n 'mat4': 16,\n\n 'sampler2D': 1\n};\n\nmodule.exports = mapSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/mapSize.js\n// module id = 232\n// module chunks = 0","/**\n * Sets the float precision on the shader. If the precision is already present this function will do nothing\n * @param {string} src the shader source\n * @param {string} precision The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n *\n * @return {string} modified shader source\n */\nvar setPrecision = function(src, precision)\n{\n if(src.substring(0, 9) !== 'precision')\n {\n return 'precision ' + precision + ' float;\\n' + src;\n }\n\n return src;\n};\n\nmodule.exports = setPrecision;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/setPrecision.js\n// module id = 233\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.accessibility.AccessibilityManager}.\n *\n * @function accessibleTarget\n * @memberof PIXI.accessibility\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibility.accessibleTarget\n * );\n */\nexports.default = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n */\n accessible: false,\n\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {string}\n */\n accessibleTitle: null,\n\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n */\n accessibleHint: null,\n\n /**\n * @todo Needs docs.\n */\n tabIndex: 0,\n\n /**\n * @todo Needs docs.\n */\n _accessibleActive: false,\n\n /**\n * @todo Needs docs.\n */\n _accessibleDiv: false\n};\n//# sourceMappingURL=accessibleTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/accessibleTarget.js\n// module id = 234\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.autoDetectRenderer = autoDetectRenderer;\n\nvar _utils = require('./utils');\n\nvar utils = _interopRequireWildcard(_utils);\n\nvar _CanvasRenderer = require('./renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _WebGLRenderer = require('./renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\n * the browser then this function will return a canvas renderer\n *\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {number} [width=800] - the width of the renderers view\n * @param {number} [height=600] - the height of the renderers view\n * @param {object} [options] - The optional renderer parameters\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [noWebGL=false] - prevents selection of WebGL renderer, even if such is present\n * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer\n */\nfunction autoDetectRenderer() {\n var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 800;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 600;\n var options = arguments[2];\n var noWebGL = arguments[3];\n\n if (!noWebGL && utils.isWebGLSupported()) {\n return new _WebGLRenderer2.default(width, height, options);\n }\n\n return new _CanvasRenderer2.default(width, height, options);\n}\n//# sourceMappingURL=autoDetectRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/autoDetectRenderer.js\n// module id = 235\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TransformStatic = require('./TransformStatic');\n\nvar _TransformStatic2 = _interopRequireDefault(_TransformStatic);\n\nvar _Transform = require('./Transform');\n\nvar _Transform2 = _interopRequireDefault(_Transform);\n\nvar _Bounds = require('./Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _math = require('../math');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// _tempDisplayObjectParent = new DisplayObject();\n\n/**\n * The base class for all objects that are rendered on the screen.\n * This is an abstract class and should not be used on its own rather it should be extended.\n *\n * @class\n * @extends EventEmitter\n * @mixes PIXI.interaction.interactiveTarget\n * @memberof PIXI\n */\nvar DisplayObject = function (_EventEmitter) {\n _inherits(DisplayObject, _EventEmitter);\n\n /**\n *\n */\n function DisplayObject() {\n _classCallCheck(this, DisplayObject);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n var TransformClass = _settings2.default.TRANSFORM_MODE === _const.TRANSFORM_MODE.STATIC ? _TransformStatic2.default : _Transform2.default;\n\n _this.tempDisplayObjectParent = null;\n\n // TODO: need to create Transform from factory\n /**\n * World transform and local transform of this object.\n * This will become read-only later, please do not assign anything there unless you know what are you doing\n *\n * @member {PIXI.TransformBase}\n */\n _this.transform = new TransformClass();\n\n /**\n * The opacity of the object.\n *\n * @member {number}\n */\n _this.alpha = 1;\n\n /**\n * The visibility of the object. If false the object will not be drawn, and\n * the updateTransform function will not be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually\n *\n * @member {boolean}\n */\n _this.visible = true;\n\n /**\n * Can this object be rendered, if false the object will not be drawn but the updateTransform\n * methods will still be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds manually\n *\n * @member {boolean}\n */\n _this.renderable = true;\n\n /**\n * The display object container that contains this display object.\n *\n * @member {PIXI.Container}\n * @readonly\n */\n _this.parent = null;\n\n /**\n * The multiplied alpha of the displayObject\n *\n * @member {number}\n * @readonly\n */\n _this.worldAlpha = 1;\n\n /**\n * The area the filter is applied to. This is used as more of an optimisation\n * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle\n *\n * Also works as an interaction mask\n *\n * @member {PIXI.Rectangle}\n */\n _this.filterArea = null;\n\n _this._filters = null;\n _this._enabledFilters = null;\n\n /**\n * The bounds object, this is used to calculate and store the bounds of the displayObject\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._bounds = new _Bounds2.default();\n _this._boundsID = 0;\n _this._lastBoundsID = -1;\n _this._boundsRect = null;\n _this._localBoundsRect = null;\n\n /**\n * The original, cached mask of the object\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._mask = null;\n return _this;\n }\n\n /**\n * @private\n * @member {PIXI.DisplayObject}\n */\n\n\n /**\n * Updates the object transform for rendering\n *\n * TODO - Optimization pass!\n */\n DisplayObject.prototype.updateTransform = function updateTransform() {\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n this._bounds.updateID++;\n };\n\n /**\n * recursively updates transform of all objects from the root to this one\n * internal function for toLocal()\n */\n\n\n DisplayObject.prototype._recursivePostUpdateTransform = function _recursivePostUpdateTransform() {\n if (this.parent) {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n } else {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n };\n\n /**\n * Retrieves the bounds of the displayObject as a rectangle object.\n *\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @param {PIXI.Rectangle} rect - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getBounds = function getBounds(skipUpdate, rect) {\n if (!skipUpdate) {\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n\n if (this._boundsID !== this._lastBoundsID) {\n this.calculateBounds();\n }\n\n if (!rect) {\n if (!this._boundsRect) {\n this._boundsRect = new _math.Rectangle();\n }\n\n rect = this._boundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n };\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object\n *\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getLocalBounds = function getLocalBounds(rect) {\n var transformRef = this.transform;\n var parentRef = this.parent;\n\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new _math.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n var bounds = this.getBounds(false, rect);\n\n this.parent = parentRef;\n this.transform = transformRef;\n\n return bounds;\n };\n\n /**\n * Calculates the global position of the display object\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform.\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toGlobal = function toGlobal(position, point) {\n var skipUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // don't need to update the lot\n return this.worldTransform.apply(position, point);\n };\n\n /**\n * Calculates the local position of the display object relative to another point\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toLocal = function toLocal(position, from, point, skipUpdate) {\n if (from) {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // simply apply the matrix..\n return this.worldTransform.applyInverse(position, point);\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n DisplayObject.prototype.renderWebGL = function renderWebGL(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n ;\n\n DisplayObject.prototype.renderCanvas = function renderCanvas(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Set the parent Container of this DisplayObject\n *\n * @param {PIXI.Container} container - The Container to add this DisplayObject to\n * @return {PIXI.Container} The Container that this DisplayObject was added to\n */\n ;\n\n DisplayObject.prototype.setParent = function setParent(container) {\n if (!container || !container.addChild) {\n throw new Error('setParent: Argument must be a Container');\n }\n\n container.addChild(this);\n\n return container;\n };\n\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n *\n * @param {number} [x=0] - The X position\n * @param {number} [y=0] - The Y position\n * @param {number} [scaleX=1] - The X scale value\n * @param {number} [scaleY=1] - The Y scale value\n * @param {number} [rotation=0] - The rotation\n * @param {number} [skewX=0] - The X skew value\n * @param {number} [skewY=0] - The Y skew value\n * @param {number} [pivotX=0] - The X pivot value\n * @param {number} [pivotY=0] - The Y pivot value\n * @return {PIXI.DisplayObject} The DisplayObject instance\n */\n\n\n DisplayObject.prototype.setTransform = function setTransform() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var scaleX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var scaleY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var rotation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var skewX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var skewY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var pivotX = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;\n var pivotY = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 0;\n\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n\n return this;\n };\n\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy`.\n *\n */\n\n\n DisplayObject.prototype.destroy = function destroy() {\n this.removeAllListeners();\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n *\n * @member {number}\n */\n\n\n _createClass(DisplayObject, [{\n key: '_tempDisplayObjectParent',\n get: function get() {\n if (this.tempDisplayObjectParent === null) {\n this.tempDisplayObjectParent = new DisplayObject();\n }\n\n return this.tempDisplayObjectParent;\n }\n }, {\n key: 'x',\n get: function get() {\n return this.position.x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.x = value;\n }\n\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n *\n * @member {number}\n */\n\n }, {\n key: 'y',\n get: function get() {\n return this.position.y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.y = value;\n }\n\n /**\n * Current transform of the object based on world (parent) factors\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'worldTransform',\n get: function get() {\n return this.transform.worldTransform;\n }\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'localTransform',\n get: function get() {\n return this.transform.localTransform;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'position',\n get: function get() {\n return this.transform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.copy(value);\n }\n\n /**\n * The scale factor of the object.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'scale',\n get: function get() {\n return this.transform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.scale.copy(value);\n }\n\n /**\n * The pivot point of the displayObject that it rotates around\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'pivot',\n get: function get() {\n return this.transform.pivot;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.pivot.copy(value);\n }\n\n /**\n * The skew factor for the object in radians.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'skew',\n get: function get() {\n return this.transform.skew;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.skew.copy(value);\n }\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n }, {\n key: 'rotation',\n get: function get() {\n return this.transform.rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.rotation = value;\n }\n\n /**\n * Indicates if the object is globally visible.\n *\n * @member {boolean}\n * @readonly\n */\n\n }, {\n key: 'worldVisible',\n get: function get() {\n var item = this;\n\n do {\n if (!item.visible) {\n return false;\n }\n\n item = item.parent;\n } while (item);\n\n return true;\n }\n\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PIXI a regular mask must be a\n * PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it\n * utilises shape clipping. To remove a mask, set this property to null.\n *\n * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n *\n * @member {PIXI.Graphics|PIXI.Sprite}\n */\n\n }, {\n key: 'mask',\n get: function get() {\n return this._mask;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._mask) {\n this._mask.renderable = true;\n }\n\n this._mask = value;\n\n if (this._mask) {\n this._mask.renderable = false;\n }\n }\n\n /**\n * Sets the filters for the displayObject.\n * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n * To remove filters simply set this property to 'null'\n *\n * @member {PIXI.Filter[]}\n */\n\n }, {\n key: 'filters',\n get: function get() {\n return this._filters && this._filters.slice();\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._filters = value && value.slice();\n }\n }]);\n\n return DisplayObject;\n}(_eventemitter2.default);\n\n// performance increase to avoid using call.. (10x faster)\n\n\nexports.default = DisplayObject;\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n//# sourceMappingURL=DisplayObject.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/DisplayObject.js\n// module id = 236\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n * local transformation is calculated from position,scale,skew and rotation\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar Transform = function (_TransformBase) {\n _inherits(Transform, _TransformBase);\n\n /**\n *\n */\n function Transform() {\n _classCallCheck(this, Transform);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.Point}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.Point(0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.Point}\n */\n _this.scale = new _math.Point(1, 1);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.Point}\n */\n _this.pivot = new _math.Point(0, 0);\n\n /**\n * The rotation value of the object, in radians\n *\n * @member {Number}\n * @private\n */\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n return _this;\n }\n\n /**\n * Updates the skew values when the skew or rotation changes.\n *\n * @private\n */\n\n\n Transform.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n };\n\n /**\n * Updates only local matrix\n */\n\n\n Transform.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n Transform.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._worldID++;\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n Transform.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(Transform, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return Transform;\n}(_TransformBase3.default);\n\nexports.default = Transform;\n//# sourceMappingURL=Transform.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/Transform.js\n// module id = 237\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar TransformStatic = function (_TransformBase) {\n _inherits(TransformStatic, _TransformBase);\n\n /**\n *\n */\n function TransformStatic() {\n _classCallCheck(this, TransformStatic);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.scale = new _math.ObservablePoint(_this.onChange, _this, 1, 1);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.pivot = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n\n _this._localID = 0;\n _this._currentLocalID = 0;\n return _this;\n }\n\n /**\n * Called when a value changes.\n *\n * @private\n */\n\n\n TransformStatic.prototype.onChange = function onChange() {\n this._localID++;\n };\n\n /**\n * Called when skew or rotation changes\n *\n * @private\n */\n\n\n TransformStatic.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n\n this._localID++;\n };\n\n /**\n * Updates only local matrix\n */\n\n\n TransformStatic.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n TransformStatic.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._parentID = parentTransform._worldID;\n\n // update the id of the transform..\n this._worldID++;\n }\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n TransformStatic.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(TransformStatic, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return TransformStatic;\n}(_TransformBase3.default);\n\nexports.default = TransformStatic;\n//# sourceMappingURL=TransformStatic.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/TransformStatic.js\n// module id = 238\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A GraphicsData object.\n *\n * @class\n * @memberof PIXI\n */\nvar GraphicsData = function () {\n /**\n *\n * @param {number} lineWidth - the width of the line to draw\n * @param {number} lineColor - the color of the line to draw\n * @param {number} lineAlpha - the alpha of the line to draw\n * @param {number} fillColor - the color of the fill\n * @param {number} fillAlpha - the alpha of the fill\n * @param {boolean} fill - whether or not the shape is filled with a colour\n * @param {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Polygon} shape - The shape object to draw.\n */\n function GraphicsData(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) {\n _classCallCheck(this, GraphicsData);\n\n /**\n * @member {number} the width of the line to draw\n */\n this.lineWidth = lineWidth;\n\n /**\n * @member {number} the color of the line to draw\n */\n this.lineColor = lineColor;\n\n /**\n * @member {number} the alpha of the line to draw\n */\n this.lineAlpha = lineAlpha;\n\n /**\n * @member {number} cached tint of the line to draw\n */\n this._lineTint = lineColor;\n\n /**\n * @member {number} the color of the fill\n */\n this.fillColor = fillColor;\n\n /**\n * @member {number} the alpha of the fill\n */\n this.fillAlpha = fillAlpha;\n\n /**\n * @member {number} cached tint of the fill\n */\n this._fillTint = fillColor;\n\n /**\n * @member {boolean} whether or not the shape is filled with a colour\n */\n this.fill = fill;\n\n this.holes = [];\n\n /**\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} The shape object to draw.\n */\n this.shape = shape;\n\n /**\n * @member {number} The type of the shape, see the Const.Shapes file for all the existing types,\n */\n this.type = shape.type;\n }\n\n /**\n * Creates a new GraphicsData object with the same values as this one.\n *\n * @return {PIXI.GraphicsData} Cloned GraphicsData object\n */\n\n\n GraphicsData.prototype.clone = function clone() {\n return new GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.shape);\n };\n\n /**\n * Adds a hole to the shape.\n *\n * @param {PIXI.Rectangle|PIXI.Circle} shape - The shape of the hole.\n */\n\n\n GraphicsData.prototype.addHole = function addHole(shape) {\n this.holes.push(shape);\n };\n\n /**\n * Destroys the Graphics data.\n */\n\n\n GraphicsData.prototype.destroy = function destroy() {\n this.shape = null;\n this.holes = null;\n };\n\n return GraphicsData;\n}();\n\nexports.default = GraphicsData;\n//# sourceMappingURL=GraphicsData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/GraphicsData.js\n// module id = 239\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Matrix = require('./Matrix');\n\nvar _Matrix2 = _interopRequireDefault(_Matrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; // Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group of order 16\n\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\nvar tempMatrices = [];\n\nvar mul = [];\n\nfunction signum(x) {\n if (x < 0) {\n return -1;\n }\n if (x > 0) {\n return 1;\n }\n\n return 0;\n}\n\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n\n mul.push(row);\n\n for (var j = 0; j < 16; j++) {\n var _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]);\n var _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]);\n var _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]);\n var _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]);\n\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (var _i = 0; _i < 16; _i++) {\n var mat = new _Matrix2.default();\n\n mat.set(ux[_i], uy[_i], vx[_i], vy[_i], 0, 0);\n tempMatrices.push(mat);\n }\n}\n\ninit();\n\n/**\n * Implements Dihedral Group D_8, see [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html},\n * D8 is the same but with diagonals. Used for texture rotations.\n *\n * Vector xX(i), xY(i) is U-axis of sprite with rotation i\n * Vector yY(i), yY(i) is V-axis of sprite with rotation i\n * Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)\n * Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @author Ivan @ivanpopelyshev\n * @class\n * @memberof PIXI\n */\nvar GroupD8 = {\n E: 0,\n SE: 1,\n S: 2,\n SW: 3,\n W: 4,\n NW: 5,\n N: 6,\n NE: 7,\n MIRROR_VERTICAL: 8,\n MIRROR_HORIZONTAL: 12,\n uX: function uX(ind) {\n return ux[ind];\n },\n uY: function uY(ind) {\n return uy[ind];\n },\n vX: function vX(ind) {\n return vx[ind];\n },\n vY: function vY(ind) {\n return vy[ind];\n },\n inv: function inv(rotation) {\n if (rotation & 8) {\n return rotation & 15;\n }\n\n return -rotation & 7;\n },\n add: function add(rotationSecond, rotationFirst) {\n return mul[rotationSecond][rotationFirst];\n },\n sub: function sub(rotationSecond, rotationFirst) {\n return mul[rotationSecond][GroupD8.inv(rotationFirst)];\n },\n\n /**\n * Adds 180 degrees to rotation. Commutative operation.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} rotated number\n */\n rotate180: function rotate180(rotation) {\n return rotation ^ 4;\n },\n\n /**\n * I dont know why sometimes width and heights needs to be swapped. We'll fix it later.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to check.\n * @returns {boolean} Whether or not the width/height should be swapped.\n */\n isSwapWidthHeight: function isSwapWidthHeight(rotation) {\n return (rotation & 3) === 2;\n },\n\n /**\n * @memberof PIXI.GroupD8\n * @param {number} dx - TODO\n * @param {number} dy - TODO\n *\n * @return {number} TODO\n */\n byDirection: function byDirection(dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return GroupD8.S;\n }\n\n return GroupD8.N;\n } else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return GroupD8.E;\n }\n\n return GroupD8.W;\n } else if (dy > 0) {\n if (dx > 0) {\n return GroupD8.SE;\n }\n\n return GroupD8.SW;\n } else if (dx > 0) {\n return GroupD8.NE;\n }\n\n return GroupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.GroupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {number} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function matrixAppendRotationInv(matrix, rotation) {\n var tx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var ty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = tempMatrices[GroupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n }\n};\n\nexports.default = GroupD8;\n//# sourceMappingURL=GroupD8.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/GroupD8.js\n// module id = 240\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n * An observable point is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n */\nvar ObservablePoint = function () {\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope) {\n var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, ObservablePoint);\n\n this._x = x;\n this._y = y;\n\n this.cb = cb;\n this.scope = scope;\n }\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n\n\n ObservablePoint.prototype.set = function set(x, y) {\n var _x = x || 0;\n var _y = y || (y !== 0 ? _x : 0);\n\n if (this._x !== _x || this._y !== _y) {\n this._x = _x;\n this._y = _y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * Copies the data from another point\n *\n * @param {PIXI.Point|PIXI.ObservablePoint} point - point to copy from\n */\n\n\n ObservablePoint.prototype.copy = function copy(point) {\n if (this._x !== point.x || this._y !== point.y) {\n this._x = point.x;\n this._y = point.y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n\n _createClass(ObservablePoint, [{\n key: \"x\",\n get: function get() {\n return this._x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n }, {\n key: \"y\",\n get: function get() {\n return this._y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n }\n }]);\n\n return ObservablePoint;\n}();\n\nexports.default = ObservablePoint;\n//# sourceMappingURL=ObservablePoint.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/ObservablePoint.js\n// module id = 241\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _utils = require('../utils');\n\nvar _math = require('../math');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _Container = require('../display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMatrix = new _math.Matrix();\n\n/**\n * The SystemRenderer is the base for a Pixi Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.WebGLRenderer} which can be used for rendering a Pixi scene.\n *\n * @abstract\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\n\nvar SystemRenderer = function (_EventEmitter) {\n _inherits(SystemRenderer, _EventEmitter);\n\n /**\n * @param {string} system - The name of the system this renderer is for.\n * @param {number} [width=800] - the width of the canvas view\n * @param {number} [height=600] - the height of the canvas view\n * @param {object} [options] - The optional renderer parameters\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n * resolution of the renderer retina would be 2.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n */\n function SystemRenderer(system, width, height, options) {\n _classCallCheck(this, SystemRenderer);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n (0, _utils.sayHello)(system);\n\n // prepare options\n if (options) {\n for (var i in _settings2.default.RENDER_OPTIONS) {\n if (typeof options[i] === 'undefined') {\n options[i] = _settings2.default.RENDER_OPTIONS[i];\n }\n }\n } else {\n options = _settings2.default.RENDER_OPTIONS;\n }\n\n /**\n * The type of the renderer.\n *\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n /**\n * The width of the canvas view\n *\n * @member {number}\n * @default 800\n */\n _this.width = width || 800;\n\n /**\n * The height of the canvas view\n *\n * @member {number}\n * @default 600\n */\n _this.height = height || 600;\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.view = options.view || document.createElement('canvas');\n\n /**\n * The resolution / device pixel ratio of the renderer\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = options.resolution || _settings2.default.RESOLUTION;\n\n /**\n * Whether the render view is transparent\n *\n * @member {boolean}\n */\n _this.transparent = options.transparent;\n\n /**\n * Whether the render view should be resized automatically\n *\n * @member {boolean}\n */\n _this.autoResize = options.autoResize || false;\n\n /**\n * Tracks the blend modes useful for this renderer.\n *\n * @member {object}\n */\n _this.blendModes = null;\n\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n *\n * @member {boolean}\n */\n _this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent Pixi will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example if\n * your game has a canvas filling background image you often don't need this set.\n *\n * @member {boolean}\n * @default\n */\n _this.clearBeforeRender = options.clearBeforeRender;\n\n /**\n * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Handy for crisp pixel art and speed on legacy devices.\n *\n * @member {boolean}\n */\n _this.roundPixels = options.roundPixels;\n\n /**\n * The background color as a number.\n *\n * @member {number}\n * @private\n */\n _this._backgroundColor = 0x000000;\n\n /**\n * The background color as an [R, G, B] array.\n *\n * @member {number[]}\n * @private\n */\n _this._backgroundColorRgba = [0, 0, 0, 0];\n\n /**\n * The background color as a string.\n *\n * @member {string}\n * @private\n */\n _this._backgroundColorString = '#000000';\n\n _this.backgroundColor = options.backgroundColor || _this._backgroundColor; // run bg color setter\n\n /**\n * This temporary display object used as the parent of the currently being rendered item\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._tempDisplayObjectParent = new _Container2.default();\n\n /**\n * The last root object that the renderer tried to render.\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._lastObjectRendered = _this._tempDisplayObjectParent;\n return _this;\n }\n\n /**\n * Resizes the canvas view to the specified width and height\n *\n * @param {number} width - the new width of the canvas view\n * @param {number} height - the new height of the canvas view\n */\n\n\n SystemRenderer.prototype.resize = function resize(width, height) {\n this.width = width * this.resolution;\n this.height = height * this.resolution;\n\n this.view.width = this.width;\n this.view.height = this.height;\n\n if (this.autoResize) {\n this.view.style.width = this.width / this.resolution + 'px';\n this.view.style.height = this.height / this.resolution + 'px';\n }\n };\n\n /**\n * Useful function that returns a texture of the display object that can then be used to create sprites\n * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.\n *\n * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from\n * @param {number} scaleMode - Should be one of the scaleMode consts\n * @param {number} resolution - The resolution / device pixel ratio of the texture being generated\n * @return {PIXI.Texture} a texture of the graphics object\n */\n\n\n SystemRenderer.prototype.generateTexture = function generateTexture(displayObject, scaleMode, resolution) {\n var bounds = displayObject.getLocalBounds();\n\n var renderTexture = _RenderTexture2.default.create(bounds.width | 0, bounds.height | 0, scaleMode, resolution);\n\n tempMatrix.tx = -bounds.x;\n tempMatrix.ty = -bounds.y;\n\n this.render(displayObject, renderTexture, false, tempMatrix, true);\n\n return renderTexture;\n };\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n *\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n */\n\n\n SystemRenderer.prototype.destroy = function destroy(removeView) {\n if (removeView && this.view.parentNode) {\n this.view.parentNode.removeChild(this.view);\n }\n\n this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n this.width = 0;\n this.height = 0;\n\n this.view = null;\n\n this.resolution = 0;\n\n this.transparent = false;\n\n this.autoResize = false;\n\n this.blendModes = null;\n\n this.preserveDrawingBuffer = false;\n this.clearBeforeRender = false;\n\n this.roundPixels = false;\n\n this._backgroundColor = 0;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n\n this.backgroundColor = 0;\n this._tempDisplayObjectParent = null;\n this._lastObjectRendered = null;\n };\n\n /**\n * The background color to fill if not transparent\n *\n * @member {number}\n */\n\n\n _createClass(SystemRenderer, [{\n key: 'backgroundColor',\n get: function get() {\n return this._backgroundColor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._backgroundColor = value;\n this._backgroundColorString = (0, _utils.hex2string)(value);\n (0, _utils.hex2rgb)(value, this._backgroundColorRgba);\n }\n }]);\n\n return SystemRenderer;\n}(_eventemitter2.default);\n\nexports.default = SystemRenderer;\n//# sourceMappingURL=SystemRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/SystemRenderer.js\n// module id = 242\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RESOLUTION = _settings2.default.RESOLUTION;\n\n/**\n * Creates a Canvas element of the given size.\n *\n * @class\n * @memberof PIXI\n */\n\nvar CanvasRenderTarget = function () {\n /**\n * @param {number} width - the width for the newly created canvas\n * @param {number} height - the height for the newly created canvas\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the canvas\n */\n function CanvasRenderTarget(width, height, resolution) {\n _classCallCheck(this, CanvasRenderTarget);\n\n /**\n * The Canvas object that belongs to this CanvasRenderTarget.\n *\n * @member {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas');\n\n /**\n * A CanvasRenderingContext2D object representing a two-dimensional rendering context.\n *\n * @member {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d');\n\n this.resolution = resolution || RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n *\n * @private\n */\n\n\n CanvasRenderTarget.prototype.clear = function clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n };\n\n /**\n * Resizes the canvas to the specified width and height.\n *\n * @param {number} width - the new width of the canvas\n * @param {number} height - the new height of the canvas\n */\n\n\n CanvasRenderTarget.prototype.resize = function resize(width, height) {\n this.canvas.width = width * this.resolution;\n this.canvas.height = height * this.resolution;\n };\n\n /**\n * Destroys this canvas.\n *\n */\n\n\n CanvasRenderTarget.prototype.destroy = function destroy() {\n this.context = null;\n this.canvas = null;\n };\n\n /**\n * The width of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n\n _createClass(CanvasRenderTarget, [{\n key: 'width',\n get: function get() {\n return this.canvas.width;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.width = val;\n }\n\n /**\n * The height of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.canvas.height;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.height = val;\n }\n }]);\n\n return CanvasRenderTarget;\n}();\n\nexports.default = CanvasRenderTarget;\n//# sourceMappingURL=CanvasRenderTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/CanvasRenderTarget.js\n// module id = 243\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = canUseNewCanvasBlendModes;\n/**\n * Creates a little colored canvas\n *\n * @ignore\n * @param {string} color - The color to make the canvas\n * @return {canvas} a small canvas element\n */\nfunction createColoredCanvas(color) {\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.fillStyle = color;\n context.fillRect(0, 0, 6, 1);\n\n return canvas;\n}\n\n/**\n * Checks whether the Canvas BlendModes are supported by the current browser\n *\n * @return {boolean} whether they are supported\n */\nfunction canUseNewCanvasBlendModes() {\n if (typeof document === 'undefined') {\n return false;\n }\n\n var magenta = createColoredCanvas('#ff00ff');\n var yellow = createColoredCanvas('#ffff00');\n\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.globalCompositeOperation = 'multiply';\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n\n var imageData = context.getImageData(2, 0, 1, 1);\n\n if (!imageData) {\n return false;\n }\n\n var data = imageData.data;\n\n return data[0] === 255 && data[1] === 0 && data[2] === 0;\n}\n//# sourceMappingURL=canUseNewCanvasBlendModes.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/canUseNewCanvasBlendModes.js\n// module id = 244\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extractUniformsFromSrc = require('./extractUniformsFromSrc');\n\nvar _extractUniformsFromSrc2 = _interopRequireDefault(_extractUniformsFromSrc);\n\nvar _utils = require('../../../utils');\n\nvar _const = require('../../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SOURCE_KEY_MAP = {};\n\n// let math = require('../../../math');\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\n\nvar Filter = function () {\n /**\n * @param {string} [vertexSrc] - The source of the vertex shader.\n * @param {string} [fragmentSrc] - The source of the fragment shader.\n * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.\n */\n function Filter(vertexSrc, fragmentSrc, uniforms) {\n _classCallCheck(this, Filter);\n\n /**\n * The vertex shader.\n *\n * @member {string}\n */\n this.vertexSrc = vertexSrc || Filter.defaultVertexSrc;\n\n /**\n * The fragment shader.\n *\n * @member {string}\n */\n this.fragmentSrc = fragmentSrc || Filter.defaultFragmentSrc;\n\n this.blendMode = _const.BLEND_MODES.NORMAL;\n\n // pull out the vertex and shader uniforms if they are not specified..\n // currently this does not extract structs only default types\n this.uniformData = uniforms || (0, _extractUniformsFromSrc2.default)(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler');\n\n /**\n * An object containing the current values of custom uniforms.\n * @example Updating the value of a custom uniform\n * filter.uniforms.time = performance.now();\n *\n * @member {object}\n */\n this.uniforms = {};\n\n for (var i in this.uniformData) {\n this.uniforms[i] = this.uniformData[i].value;\n }\n\n // this is where we store shader references..\n // TODO we could cache this!\n this.glShaders = {};\n\n // used for cacheing.. sure there is a better way!\n if (!SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc]) {\n SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc] = (0, _utils.uid)();\n }\n\n this.glShaderKey = SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc];\n\n /**\n * The padding of the filter. Some filters require extra space to breath such as a blur.\n * Increasing this will add extra width and height to the bounds of the object that the\n * filter is applied to.\n *\n * @member {number}\n */\n this.padding = 4;\n\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n *\n * @member {number}\n */\n this.resolution = 1;\n\n /**\n * If enabled is true the filter is applied, if false it will not.\n *\n * @member {boolean}\n */\n this.enabled = true;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n */\n\n\n Filter.prototype.apply = function apply(filterManager, input, output, clear) {\n // --- //\n // this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(tempMatrix, window.panda );\n\n // do as you please!\n\n filterManager.applyFilter(this, input, output, clear);\n\n // or just do a regular render..\n };\n\n /**\n * The default vertex shader source\n *\n * @static\n * @constant\n */\n\n\n _createClass(Filter, null, [{\n key: 'defaultVertexSrc',\n get: function get() {\n return ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 projectionMatrix;', 'uniform mat3 filterMatrix;', 'varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;', ' vTextureCoord = aTextureCoord ;', '}'].join('\\n');\n }\n\n /**\n * The default fragment shader source\n *\n * @static\n * @constant\n */\n\n }, {\n key: 'defaultFragmentSrc',\n get: function get() {\n return ['varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'uniform sampler2D uSampler;', 'uniform sampler2D filterSampler;', 'void main(void){', ' vec4 masky = texture2D(filterSampler, vFilterCoord);', ' vec4 sample = texture2D(uSampler, vTextureCoord);', ' vec4 color;', ' if(mod(vFilterCoord.x, 1.0) > 0.5)', ' {', ' color = vec4(1.0, 0.0, 0.0, 1.0);', ' }', ' else', ' {', ' color = vec4(0.0, 1.0, 0.0, 1.0);', ' }',\n // ' gl_FragColor = vec4(mod(vFilterCoord.x, 1.5), vFilterCoord.y,0.0,1.0);',\n ' gl_FragColor = mix(sample, masky, 0.5);', ' gl_FragColor *= sample.a;', '}'].join('\\n');\n }\n }]);\n\n return Filter;\n}();\n\nexports.default = Filter;\n//# sourceMappingURL=Filter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/Filter.js\n// module id = 245\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Filter2 = require('../Filter');\n\nvar _Filter3 = _interopRequireDefault(_Filter2);\n\nvar _math = require('../../../../math');\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The SpriteMaskFilter class\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI\n */\nvar SpriteMaskFilter = function (_Filter) {\n _inherits(SpriteMaskFilter, _Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - the target sprite\n */\n function SpriteMaskFilter(sprite) {\n _classCallCheck(this, SpriteMaskFilter);\n\n var maskMatrix = new _math.Matrix();\n\n var _this = _possibleConstructorReturn(this, _Filter.call(this, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 otherMatrix;\\n\\nvarying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n}\\n', 'varying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\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\\n float clip = 1.0 - max(text.y, text.x);\\n vec4 original = texture2D(uSampler, vTextureCoord);\\n vec4 masky = texture2D(mask, vMaskCoord);\\n\\n original *= (masky.r * masky.a * alpha * clip);\\n\\n gl_FragColor = original;\\n}\\n'));\n\n sprite.renderable = false;\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n return _this;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n */\n\n\n SpriteMaskFilter.prototype.apply = function apply(filterManager, input, output) {\n var maskSprite = this.maskSprite;\n\n this.uniforms.mask = maskSprite._texture;\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite);\n this.uniforms.alpha = maskSprite.worldAlpha;\n\n filterManager.applyFilter(this, input, output);\n };\n\n return SpriteMaskFilter;\n}(_Filter3.default);\n\nexports.default = SpriteMaskFilter;\n//# sourceMappingURL=SpriteMaskFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js\n// module id = 246\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a quad\n *\n * @class\n * @memberof PIXI\n */\nvar Quad = function () {\n /**\n * @param {WebGLRenderingContext} gl - The gl context for this quad to use.\n * @param {object} state - TODO: Description\n */\n function Quad(gl, state) {\n _classCallCheck(this, Quad);\n\n /*\n * the current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of vertices\n *\n * @member {Float32Array}\n */\n this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]);\n\n /**\n * The Uvs of the quad\n *\n * @member {Float32Array}\n */\n this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n\n this.interleaved = new Float32Array(8 * 2);\n\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n /*\n * @member {Uint16Array} An array containing the indices of the vertices\n */\n this.indices = (0, _createIndicesForQuads2.default)(1);\n\n /*\n * @member {glCore.GLBuffer} The vertex buffer\n */\n this.vertexBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.interleaved, gl.STATIC_DRAW);\n\n /*\n * @member {glCore.GLBuffer} The index buffer\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n /*\n * @member {glCore.VertexArrayObject} The index buffer\n */\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, state);\n }\n\n /**\n * Initialises the vaos and uses the shader.\n *\n * @param {PIXI.Shader} shader - the shader to use\n */\n\n\n Quad.prototype.initVao = function initVao(shader) {\n this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer, shader.attributes.aVertexPosition, this.gl.FLOAT, false, 4 * 4, 0).addAttribute(this.vertexBuffer, shader.attributes.aTextureCoord, this.gl.FLOAT, false, 4 * 4, 2 * 4);\n };\n\n /**\n * Maps two Rectangle to the quad.\n *\n * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle\n * @param {PIXI.Rectangle} destinationFrame - the second rectangle\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.map = function map(targetTextureFrame, destinationFrame) {\n var x = 0; // destinationFrame.x / targetTextureFrame.width;\n var y = 0; // destinationFrame.y / targetTextureFrame.height;\n\n this.uvs[0] = x;\n this.uvs[1] = y;\n\n this.uvs[2] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[3] = y;\n\n this.uvs[4] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[5] = y + destinationFrame.height / targetTextureFrame.height;\n\n this.uvs[6] = x;\n this.uvs[7] = y + destinationFrame.height / targetTextureFrame.height;\n\n x = destinationFrame.x;\n y = destinationFrame.y;\n\n this.vertices[0] = x;\n this.vertices[1] = y;\n\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n\n return this;\n };\n\n /**\n * Binds the buffer and uploads the data\n *\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.upload = function upload() {\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n this.vertexBuffer.upload(this.interleaved);\n\n return this;\n };\n\n /**\n * Removes this quad from WebGL\n */\n\n\n Quad.prototype.destroy = function destroy() {\n var gl = this.gl;\n\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n };\n\n return Quad;\n}();\n\nexports.default = Quad;\n//# sourceMappingURL=Quad.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/Quad.js\n// module id = 247\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nvar _const = require('../const');\n\nvar _utils = require('../utils');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: '#000000',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: _const.TEXT_GRADIENT.LINEAR_VERTICAL,\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n wordWrap: false,\n wordWrapWidth: 100\n};\n\n/**\n * A TextStyle Object decorates a Text Object. It can be shared between\n * multiple Text objects. Changing the style will update all text objects using it.\n *\n * @class\n * @memberof PIXI\n */\n\nvar TextStyle = function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string} [style.dropShadowColor='#000000'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fills styles are\n * supplied, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT} for possible values\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', 800' or '900')\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Default is 'miter' (creates a sharp corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n _classCallCheck(this, TextStyle);\n\n this.styleID = 0;\n\n Object.assign(this, defaultStyle, style);\n }\n\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return {PIXI.TextStyle} New cloned TextStyle object\n */\n\n\n TextStyle.prototype.clone = function clone() {\n var clonedProperties = {};\n\n for (var key in defaultStyle) {\n clonedProperties[key] = this[key];\n }\n\n return new TextStyle(clonedProperties);\n };\n\n /**\n * Resets all properties to the defaults specified in TextStyle.prototype._default\n */\n\n\n TextStyle.prototype.reset = function reset() {\n Object.assign(this, defaultStyle);\n };\n\n _createClass(TextStyle, [{\n key: 'align',\n get: function get() {\n return this._align;\n },\n set: function set(align) {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n }\n }, {\n key: 'breakWords',\n get: function get() {\n return this._breakWords;\n },\n set: function set(breakWords) {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n }\n }, {\n key: 'dropShadow',\n get: function get() {\n return this._dropShadow;\n },\n set: function set(dropShadow) {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n }\n }, {\n key: 'dropShadowAngle',\n get: function get() {\n return this._dropShadowAngle;\n },\n set: function set(dropShadowAngle) {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n }\n }, {\n key: 'dropShadowBlur',\n get: function get() {\n return this._dropShadowBlur;\n },\n set: function set(dropShadowBlur) {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n }\n }, {\n key: 'dropShadowColor',\n get: function get() {\n return this._dropShadowColor;\n },\n set: function set(dropShadowColor) {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n }\n }, {\n key: 'dropShadowDistance',\n get: function get() {\n return this._dropShadowDistance;\n },\n set: function set(dropShadowDistance) {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n }\n }, {\n key: 'fill',\n get: function get() {\n return this._fill;\n },\n set: function set(fill) {\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n }\n }, {\n key: 'fillGradientType',\n get: function get() {\n return this._fillGradientType;\n },\n set: function set(fillGradientType) {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n }\n }, {\n key: 'fontFamily',\n get: function get() {\n return this._fontFamily;\n },\n set: function set(fontFamily) {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n }\n }, {\n key: 'fontSize',\n get: function get() {\n return this._fontSize;\n },\n set: function set(fontSize) {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n }\n }, {\n key: 'fontStyle',\n get: function get() {\n return this._fontStyle;\n },\n set: function set(fontStyle) {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n }\n }, {\n key: 'fontVariant',\n get: function get() {\n return this._fontVariant;\n },\n set: function set(fontVariant) {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n }\n }, {\n key: 'fontWeight',\n get: function get() {\n return this._fontWeight;\n },\n set: function set(fontWeight) {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n }\n }, {\n key: 'letterSpacing',\n get: function get() {\n return this._letterSpacing;\n },\n set: function set(letterSpacing) {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n }\n }, {\n key: 'lineHeight',\n get: function get() {\n return this._lineHeight;\n },\n set: function set(lineHeight) {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n }\n }, {\n key: 'lineJoin',\n get: function get() {\n return this._lineJoin;\n },\n set: function set(lineJoin) {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n }\n }, {\n key: 'miterLimit',\n get: function get() {\n return this._miterLimit;\n },\n set: function set(miterLimit) {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n }\n }, {\n key: 'padding',\n get: function get() {\n return this._padding;\n },\n set: function set(padding) {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n }\n }, {\n key: 'stroke',\n get: function get() {\n return this._stroke;\n },\n set: function set(stroke) {\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n }\n }, {\n key: 'strokeThickness',\n get: function get() {\n return this._strokeThickness;\n },\n set: function set(strokeThickness) {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n }\n }, {\n key: 'textBaseline',\n get: function get() {\n return this._textBaseline;\n },\n set: function set(textBaseline) {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n }\n }, {\n key: 'wordWrap',\n get: function get() {\n return this._wordWrap;\n },\n set: function set(wordWrap) {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n }\n }, {\n key: 'wordWrapWidth',\n get: function get() {\n return this._wordWrapWidth;\n },\n set: function set(wordWrapWidth) {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n }\n }]);\n\n return TextStyle;\n}();\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\n\n\nexports.default = TextStyle;\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return (0, _utils.hex2string)(color);\n } else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n\n return color;\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n } else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n\n return color;\n }\n}\n//# sourceMappingURL=TextStyle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/text/TextStyle.js\n// module id = 248\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar RESOLUTION = _settings2.default.RESOLUTION,\n SCALE_MODE = _settings2.default.SCALE_MODE;\n\n/**\n * A BaseRenderTexture is a special texture that allows any Pixi display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let baseRenderTexture = new PIXI.BaseRenderTexture(renderer, 800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * baseRenderTexture.render(sprite);\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture(100, 100);\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture\n * ```\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\n\nvar BaseRenderTexture = function (_BaseTexture) {\n _inherits(BaseRenderTexture, _BaseTexture);\n\n /**\n * @param {number} [width=100] - The width of the base render texture\n * @param {number} [height=100] - The height of the base render texture\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n */\n function BaseRenderTexture() {\n var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var scaleMode = arguments[2];\n var resolution = arguments[3];\n\n _classCallCheck(this, BaseRenderTexture);\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, null, scaleMode));\n\n _this.resolution = resolution || RESOLUTION;\n\n _this.width = width;\n _this.height = height;\n\n _this.realWidth = _this.width * _this.resolution;\n _this.realHeight = _this.height * _this.resolution;\n\n _this.scaleMode = scaleMode || SCALE_MODE;\n _this.hasLoaded = true;\n\n /**\n * A map of renderer IDs to webgl renderTargets\n *\n * @private\n * @member {object}\n */\n _this._glRenderTargets = {};\n\n /**\n * A reference to the canvas render target (we only need one as this can be shared across renderers)\n *\n * @private\n * @member {object}\n */\n _this._canvasRenderTarget = null;\n\n /**\n * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n *\n * @member {boolean}\n */\n _this.valid = false;\n return _this;\n }\n\n /**\n * Resizes the BaseRenderTexture.\n *\n * @param {number} width - The width to resize to.\n * @param {number} height - The height to resize to.\n */\n\n\n BaseRenderTexture.prototype.resize = function resize(width, height) {\n if (width === this.width && height === this.height) {\n return;\n }\n\n this.valid = width > 0 && height > 0;\n\n this.width = width;\n this.height = height;\n\n this.realWidth = this.width * this.resolution;\n this.realHeight = this.height * this.resolution;\n\n if (!this.valid) {\n return;\n }\n\n this.emit('update', this);\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n BaseRenderTexture.prototype.destroy = function destroy() {\n _BaseTexture.prototype.destroy.call(this, true);\n this.renderer = null;\n };\n\n return BaseRenderTexture;\n}(_BaseTexture3.default);\n\nexports.default = BaseRenderTexture;\n//# sourceMappingURL=BaseRenderTexture.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/BaseRenderTexture.js\n// module id = 249\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _GroupD = require('../math/GroupD8');\n\nvar _GroupD2 = _interopRequireDefault(_GroupD);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A standard object to store the Uvs of a texture\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar TextureUvs = function () {\n /**\n *\n */\n function TextureUvs() {\n _classCallCheck(this, TextureUvs);\n\n this.x0 = 0;\n this.y0 = 0;\n\n this.x1 = 1;\n this.y1 = 0;\n\n this.x2 = 1;\n this.y2 = 1;\n\n this.x3 = 0;\n this.y3 = 1;\n\n this.uvsUint32 = new Uint32Array(4);\n }\n\n /**\n * Sets the texture Uvs based on the given frame information.\n *\n * @private\n * @param {PIXI.Rectangle} frame - The frame of the texture\n * @param {PIXI.Rectangle} baseFrame - The base frame of the texture\n * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8}\n */\n\n\n TextureUvs.prototype.set = function set(frame, baseFrame, rotate) {\n var tw = baseFrame.width;\n var th = baseFrame.height;\n\n if (rotate) {\n // width and height div 2 div baseFrame size\n var w2 = frame.width / 2 / tw;\n var h2 = frame.height / 2 / th;\n\n // coordinates of center\n var cX = frame.x / tw + w2;\n var cY = frame.y / th + h2;\n\n rotate = _GroupD2.default.add(rotate, _GroupD2.default.NW); // NW is top-left corner\n this.x0 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y0 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y1 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x2 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y2 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x3 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y3 = cY + h2 * _GroupD2.default.uY(rotate);\n } else {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n\n this.uvsUint32[0] = (this.y0 * 65535 & 0xFFFF) << 16 | this.x0 * 65535 & 0xFFFF;\n this.uvsUint32[1] = (this.y1 * 65535 & 0xFFFF) << 16 | this.x1 * 65535 & 0xFFFF;\n this.uvsUint32[2] = (this.y2 * 65535 & 0xFFFF) << 16 | this.x2 * 65535 & 0xFFFF;\n this.uvsUint32[3] = (this.y3 * 65535 & 0xFFFF) << 16 | this.x3 * 65535 & 0xFFFF;\n };\n\n return TextureUvs;\n}();\n\nexports.default = TextureUvs;\n//# sourceMappingURL=TextureUvs.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/TextureUvs.js\n// module id = 250\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _utils = require('../utils');\n\nvar _ticker = require('../ticker');\n\nvar ticker = _interopRequireWildcard(_ticker);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A texture of a [playing] Video.\n *\n * Video base textures mimic Pixi BaseTexture.from.... method in their creation process.\n *\n * This can be used in several ways, such as:\n *\n * ```js\n * let texture = PIXI.VideoBaseTexture.fromUrl('http://mydomain.com/video.mp4');\n *\n * let texture = PIXI.VideoBaseTexture.fromUrl({ src: 'http://mydomain.com/video.mp4', mime: 'video/mp4' });\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls(['/video.webm', '/video.mp4']);\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls([\n * { src: '/video.webm', mime: 'video/webm' },\n * { src: '/video.mp4', mime: 'video/mp4' }\n * ]);\n * ```\n *\n * See the [\"deus\" demo](http://www.goodboydigital.com/pixijs/examples/deus/).\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nvar VideoBaseTexture = function (_BaseTexture) {\n _inherits(VideoBaseTexture, _BaseTexture);\n\n /**\n * @param {HTMLVideoElement} source - Video source\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n */\n function VideoBaseTexture(source, scaleMode) {\n _classCallCheck(this, VideoBaseTexture);\n\n if (!source) {\n throw new Error('No video source element specified.');\n }\n\n // hook in here to check if video is already available.\n // BaseTexture looks for a source.complete boolean, plus width & height.\n\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA) && source.width && source.height) {\n source.complete = true;\n }\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, source, scaleMode));\n\n _this.width = source.videoWidth;\n _this.height = source.videoHeight;\n\n _this._autoUpdate = true;\n _this._isAutoUpdating = false;\n\n /**\n * When set to true will automatically play videos used by this texture once\n * they are loaded. If false, it will not modify the playing state.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPlay = true;\n\n _this.update = _this.update.bind(_this);\n _this._onCanPlay = _this._onCanPlay.bind(_this);\n\n source.addEventListener('play', _this._onPlayStart.bind(_this));\n source.addEventListener('pause', _this._onPlayStop.bind(_this));\n _this.hasLoaded = false;\n _this.__loaded = false;\n\n if (!_this._isSourceReady()) {\n source.addEventListener('canplay', _this._onCanPlay);\n source.addEventListener('canplaythrough', _this._onCanPlay);\n } else {\n _this._onCanPlay();\n }\n return _this;\n }\n\n /**\n * Returns true if the underlying source is playing.\n *\n * @private\n * @return {boolean} True if playing.\n */\n\n\n VideoBaseTexture.prototype._isSourcePlaying = function _isSourcePlaying() {\n var source = this.source;\n\n return source.currentTime > 0 && source.paused === false && source.ended === false && source.readyState > 2;\n };\n\n /**\n * Returns true if the underlying source is ready for playing.\n *\n * @private\n * @return {boolean} True if ready.\n */\n\n\n VideoBaseTexture.prototype._isSourceReady = function _isSourceReady() {\n return this.source.readyState === 3 || this.source.readyState === 4;\n };\n\n /**\n * Runs the update loop when the video is ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStart = function _onPlayStart() {\n // Just in case the video has not received its can play even yet..\n if (!this.hasLoaded) {\n this._onCanPlay();\n }\n\n if (!this._isAutoUpdating && this.autoUpdate) {\n ticker.shared.add(this.update, this);\n this._isAutoUpdating = true;\n }\n };\n\n /**\n * Fired when a pause event is triggered, stops the update loop\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStop = function _onPlayStop() {\n if (this._isAutoUpdating) {\n ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n }\n };\n\n /**\n * Fired when the video is loaded and ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onCanPlay = function _onCanPlay() {\n this.hasLoaded = true;\n\n if (this.source) {\n this.source.removeEventListener('canplay', this._onCanPlay);\n this.source.removeEventListener('canplaythrough', this._onCanPlay);\n\n this.width = this.source.videoWidth;\n this.height = this.source.videoHeight;\n\n // prevent multiple loaded dispatches..\n if (!this.__loaded) {\n this.__loaded = true;\n this.emit('loaded', this);\n }\n\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n } else if (this.autoPlay) {\n this.source.play();\n }\n }\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n VideoBaseTexture.prototype.destroy = function destroy() {\n if (this._isAutoUpdating) {\n ticker.shared.remove(this.update, this);\n }\n\n if (this.source && this.source._pixiId) {\n delete _utils.BaseTextureCache[this.source._pixiId];\n delete this.source._pixiId;\n }\n\n _BaseTexture.prototype.destroy.call(this);\n };\n\n /**\n * Mimic Pixi BaseTexture.from.... method.\n *\n * @static\n * @param {HTMLVideoElement} video - Video to create texture from\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromVideo = function fromVideo(video, scaleMode) {\n if (!video._pixiId) {\n video._pixiId = 'video_' + (0, _utils.uid)();\n }\n\n var baseTexture = _utils.BaseTextureCache[video._pixiId];\n\n if (!baseTexture) {\n baseTexture = new VideoBaseTexture(video, scaleMode);\n _utils.BaseTextureCache[video._pixiId] = baseTexture;\n }\n\n return baseTexture;\n };\n\n /**\n * Helper function that creates a new BaseTexture based on the given video element.\n * This BaseTexture can then be used to create a texture\n *\n * @static\n * @param {string|object|string[]|object[]} videoSrc - The URL(s) for the video.\n * @param {string} [videoSrc.src] - One of the source urls for the video\n * @param {string} [videoSrc.mime] - The mimetype of the video (e.g. 'video/mp4'). If not specified\n * the url's extension will be used as the second part of the mime type.\n * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromUrl = function fromUrl(videoSrc, scaleMode) {\n var video = document.createElement('video');\n\n video.setAttribute('webkit-playsinline', '');\n video.setAttribute('playsinline', '');\n\n // array of objects or strings\n if (Array.isArray(videoSrc)) {\n for (var i = 0; i < videoSrc.length; ++i) {\n video.appendChild(createSource(videoSrc[i].src || videoSrc[i], videoSrc[i].mime));\n }\n }\n // single object or string\n else {\n video.appendChild(createSource(videoSrc.src || videoSrc, videoSrc.mime));\n }\n\n video.load();\n\n return VideoBaseTexture.fromVideo(video, scaleMode);\n };\n\n /**\n * Should the base texture automatically update itself, set to true by default\n *\n * @member {boolean}\n */\n\n\n _createClass(VideoBaseTexture, [{\n key: 'autoUpdate',\n get: function get() {\n return this._autoUpdate;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n\n if (!this._autoUpdate && this._isAutoUpdating) {\n ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n } else if (this._autoUpdate && !this._isAutoUpdating) {\n ticker.shared.add(this.update, this);\n this._isAutoUpdating = true;\n }\n }\n }\n }]);\n\n return VideoBaseTexture;\n}(_BaseTexture3.default);\n\nexports.default = VideoBaseTexture;\n\n\nVideoBaseTexture.fromUrls = VideoBaseTexture.fromUrl;\n\nfunction createSource(path, type) {\n if (!type) {\n type = 'video/' + path.substr(path.lastIndexOf('.') + 1);\n }\n\n var source = document.createElement('source');\n\n source.src = path;\n source.type = type;\n\n return source;\n}\n//# sourceMappingURL=VideoBaseTexture.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/VideoBaseTexture.js\n// module id = 251\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Internal event used by composed emitter\nvar TICK = 'tick';\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n * This class is composed around an EventEmitter object to add listeners\n * meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary,\n * e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI.ticker\n */\n\nvar Ticker = function () {\n /**\n *\n */\n function Ticker() {\n var _this = this;\n\n _classCallCheck(this, Ticker);\n\n /**\n * Internal emitter used to fire 'tick' event\n * @private\n */\n this._emitter = new _eventemitter2.default();\n\n /**\n * Internal current frame request ID\n * @private\n */\n this._requestId = null;\n\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n * @private\n */\n this._maxElapsedMS = 100;\n\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.ticker.Ticker#start} automatically\n * when a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.autoStart = false;\n\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS}\n * and is scaled with {@link PIXI.ticker.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n *\n * @member {number}\n * @default 1\n */\n this.deltaTime = 1;\n\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default 1 / TARGET_FPMS\n */\n this.elapsedMS = 1 / _settings2.default.TARGET_FPMS; // default to target frame time\n\n /**\n * The last time {@link PIXI.ticker.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default 0\n */\n this.lastTime = 0;\n\n /**\n * Factor of current {@link PIXI.ticker.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n *\n * @member {number}\n * @default 1\n */\n this.speed = 1;\n\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.ticker.Ticker#start} has been called.\n * `false` if {@link PIXI.ticker.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.ticker.Ticker#autoStart} being `true`\n * and a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.started = false;\n\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n *\n * @private\n * @param {number} time - Time since last tick.\n */\n this._tick = function (time) {\n _this._requestId = null;\n\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._emitter.listeners(TICK, true)) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n *\n * @private\n */\n\n\n Ticker.prototype._requestIfNeeded = function _requestIfNeeded() {\n if (this._requestId === null && this._emitter.listeners(TICK, true)) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n\n /**\n * Conditionally cancels a pending animation frame.\n *\n * @private\n */\n\n\n Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded() {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n *\n * @private\n */\n\n\n Ticker.prototype._startIfPossible = function _startIfPossible() {\n if (this.started) {\n this._requestIfNeeded();\n } else if (this.autoStart) {\n this.start();\n }\n };\n\n /**\n * Calls {@link module:eventemitter3.EventEmitter#on} internally for the\n * internal 'tick' event. It checks if the emitter has listeners,\n * and if so it requests a new animation frame at this point.\n *\n * @param {Function} fn - The listener function to be added for updates\n * @param {Function} [context] - The listener context\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.add = function add(fn, context) {\n this._emitter.on(TICK, fn, context);\n\n this._startIfPossible();\n\n return this;\n };\n\n /**\n * Calls {@link module:eventemitter3.EventEmitter#once} internally for the\n * internal 'tick' event. It checks if the emitter has listeners,\n * and if so it requests a new animation frame at this point.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} [context] - The listener context\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.addOnce = function addOnce(fn, context) {\n this._emitter.once(TICK, fn, context);\n\n this._startIfPossible();\n\n return this;\n };\n\n /**\n * Calls {@link module:eventemitter3.EventEmitter#off} internally for 'tick' event.\n * It checks if the emitter has listeners for 'tick' event.\n * If it does, then it cancels the animation frame.\n *\n * @param {Function} [fn] - The listener function to be removed\n * @param {Function} [context] - The listener context to be removed\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.remove = function remove(fn, context) {\n this._emitter.off(TICK, fn, context);\n\n if (!this._emitter.listeners(TICK, true)) {\n this._cancelIfNeeded();\n }\n\n return this;\n };\n\n /**\n * Starts the ticker. If the ticker has listeners\n * a new animation frame is requested at this point.\n */\n\n\n Ticker.prototype.start = function start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n\n /**\n * Stops the ticker. If the ticker has requested\n * an animation frame it is canceled at this point.\n */\n\n\n Ticker.prototype.stop = function stop() {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.ticker.Ticker#elapsedMS},\n * the current {@link PIXI.ticker.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.ticker.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n *\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n\n\n Ticker.prototype.update = function update() {\n var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();\n\n var elapsedMS = void 0;\n\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n\n this.deltaTime = elapsedMS * _settings2.default.TARGET_FPMS * this.speed;\n\n // Invoke listeners added to internal emitter\n this._emitter.emit(TICK, this.deltaTime);\n } else {\n this.deltaTime = this.elapsedMS = 0;\n }\n\n this.lastTime = currentTime;\n };\n\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.ticker.Ticker#speed}, which is specific\n * to scaling {@link PIXI.ticker.Ticker#deltaTime}.\n *\n * @member {number}\n * @readonly\n */\n\n\n _createClass(Ticker, [{\n key: 'FPS',\n get: function get() {\n return 1000 / this.elapsedMS;\n }\n\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.ticker.Ticker#update}.\n * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n *\n * @member {number}\n * @default 10\n */\n\n }, {\n key: 'minFPS',\n get: function get() {\n return 1000 / this._maxElapsedMS;\n },\n set: function set(fps) // eslint-disable-line require-jsdoc\n {\n // Clamp: 0 to TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, fps) / 1000, _settings2.default.TARGET_FPMS);\n\n this._maxElapsedMS = 1 / minFPMS;\n }\n }]);\n\n return Ticker;\n}();\n\nexports.default = Ticker;\n//# sourceMappingURL=Ticker.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/ticker/Ticker.js\n// module id = 252\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.Ticker = exports.shared = undefined;\n\nvar _Ticker = require('./Ticker');\n\nvar _Ticker2 = _interopRequireDefault(_Ticker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}.\n * and by {@link PIXI.interaction.InteractionManager}.\n * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true`\n * for this instance. Please follow the examples for usage, including\n * how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer(800, 600);\n * let stage = new PIXI.Container();\n * let interactionManager = PIXI.interaction.InteractionManager(renderer);\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @type {PIXI.ticker.Ticker}\n * @memberof PIXI.ticker\n */\nvar shared = new _Ticker2.default();\n\nshared.autoStart = true;\n\n/**\n * @namespace PIXI.ticker\n */\nexports.shared = shared;\nexports.Ticker = _Ticker2.default;\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/ticker/index.js\n// module id = 253\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Matrix = require('../core/math/Matrix');\n\nvar _Matrix2 = _interopRequireDefault(_Matrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar tempMat = new _Matrix2.default();\n\n/**\n * class controls uv transform and frame clamp for texture\n *\n * @class\n * @memberof PIXI.extras\n */\n\nvar TextureTransform = function () {\n /**\n *\n * @param {PIXI.Texture} texture observed texture\n * @param {number} [clampMargin] Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n * @constructor\n */\n function TextureTransform(texture, clampMargin) {\n _classCallCheck(this, TextureTransform);\n\n this._texture = texture;\n\n this.mapCoord = new _Matrix2.default();\n\n this.uClampFrame = new Float32Array(4);\n\n this.uClampOffset = new Float32Array(2);\n\n this._lastTextureID = -1;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders\n *\n * @default 0\n * @member {number}\n */\n this.clampOffset = 0;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n this.clampMargin = typeof clampMargin === 'undefined' ? 0.5 : clampMargin;\n }\n\n /**\n * texture property\n * @member {PIXI.Texture}\n */\n\n\n /**\n * updates matrices if texture was changed\n * @param {boolean} forceUpdate if true, matrices will be updated any case\n */\n TextureTransform.prototype.update = function update(forceUpdate) {\n var tex = this._texture;\n\n if (!tex || !tex.valid) {\n return;\n }\n\n if (!forceUpdate && this._lastTextureID === tex._updateID) {\n return;\n }\n\n this._lastTextureID = tex._updateID;\n\n var uvs = tex._uvs;\n\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n\n var orig = tex.orig;\n var trim = tex.trim;\n\n if (trim) {\n tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height);\n this.mapCoord.append(tempMat);\n }\n\n var texBase = tex.baseTexture;\n var frame = this.uClampFrame;\n var margin = this.clampMargin / texBase.resolution;\n var offset = this.clampOffset;\n\n frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n this.uClampOffset[0] = offset / texBase.realWidth;\n this.uClampOffset[1] = offset / texBase.realHeight;\n };\n\n _createClass(TextureTransform, [{\n key: 'texture',\n get: function get() {\n return this._texture;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._texture = value;\n this._lastTextureID = -1;\n }\n }]);\n\n return TextureTransform;\n}();\n\nexports.default = TextureTransform;\n//# sourceMappingURL=TextureTransform.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/TextureTransform.js\n// module id = 254\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurXFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurXFilter = function (_core$Filter) {\n _inherits(BlurXFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurXFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurXFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || 1;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurXFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.width * (output.size.width / input.size.width);\n\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes; // / this.passes//Math.pow(1, this.passes);\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 16\n */\n\n\n _createClass(BlurXFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurXFilter;\n}(core.Filter);\n\nexports.default = BlurXFilter;\n//# sourceMappingURL=BlurXFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurXFilter.js\n// module id = 255\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurYFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurYFilter = function (_core$Filter) {\n _inherits(BlurYFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurYFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurYFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || 1;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurYFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.height * (output.size.height / input.size.height);\n\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurYFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurYFilter;\n}(core.Filter);\n\nexports.default = BlurYFilter;\n//# sourceMappingURL=BlurYFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurYFilter.js\n// module id = 256\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateFragBlurSource;\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448]\n};\n\nvar fragTemplate = ['varying vec2 vBlurTexCoords[%size%];', 'uniform sampler2D uSampler;', 'void main(void)', '{', ' gl_FragColor = vec4(0.0);', ' %blur%', '}'].join('\\n');\n\nfunction generateFragBlurSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n\n var fragSource = fragTemplate;\n\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value = void 0;\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n value = i;\n\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n\n blur = blur.replace('%value%', kernel[value]);\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize);\n\n return fragSource;\n}\n//# sourceMappingURL=generateBlurFragSource.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/generateBlurFragSource.js\n// module id = 257\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateVertBlurSource;\nvar vertTemplate = ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform float strength;', 'uniform mat3 projectionMatrix;', 'varying vec2 vBlurTexCoords[%size%];', 'void main(void)', '{', 'gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);', '%blur%', '}'].join('\\n');\n\nfunction generateVertBlurSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n\n var vertSource = vertTemplate;\n\n var blurLoop = '';\n var template = void 0;\n // let value;\n\n if (x) {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);';\n } else {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n // value = i;\n\n // if(i >= halfLength)\n // {\n // value = kernelSize - i - 1;\n // }\n\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + '.0');\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize);\n\n return vertSource;\n}\n//# sourceMappingURL=generateBlurVertSource.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/generateBlurVertSource.js\n// module id = 258\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = getMaxKernelSize;\nfunction getMaxKernelSize(gl) {\n var maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS);\n var kernelSize = 15;\n\n while (kernelSize > maxVaryings) {\n kernelSize -= 2;\n }\n\n return kernelSize;\n}\n//# sourceMappingURL=getMaxBlurKernelSize.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/getMaxBlurKernelSize.js\n// module id = 259\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _FXAAFilter = require('./fxaa/FXAAFilter');\n\nObject.defineProperty(exports, 'FXAAFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FXAAFilter).default;\n }\n});\n\nvar _NoiseFilter = require('./noise/NoiseFilter');\n\nObject.defineProperty(exports, 'NoiseFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NoiseFilter).default;\n }\n});\n\nvar _DisplacementFilter = require('./displacement/DisplacementFilter');\n\nObject.defineProperty(exports, 'DisplacementFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DisplacementFilter).default;\n }\n});\n\nvar _BlurFilter = require('./blur/BlurFilter');\n\nObject.defineProperty(exports, 'BlurFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurFilter).default;\n }\n});\n\nvar _BlurXFilter = require('./blur/BlurXFilter');\n\nObject.defineProperty(exports, 'BlurXFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurXFilter).default;\n }\n});\n\nvar _BlurYFilter = require('./blur/BlurYFilter');\n\nObject.defineProperty(exports, 'BlurYFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurYFilter).default;\n }\n});\n\nvar _ColorMatrixFilter = require('./colormatrix/ColorMatrixFilter');\n\nObject.defineProperty(exports, 'ColorMatrixFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ColorMatrixFilter).default;\n }\n});\n\nvar _VoidFilter = require('./void/VoidFilter');\n\nObject.defineProperty(exports, 'VoidFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_VoidFilter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/index.js\n// module id = 260\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionData = function () {\n /**\n *\n */\n function InteractionData() {\n _classCallCheck(this, InteractionData);\n\n /**\n * This point stores the global coords of where the touch/mouse event happened\n *\n * @member {PIXI.Point}\n */\n this.global = new core.Point();\n\n /**\n * The target Sprite that was interacted with\n *\n * @member {PIXI.Sprite}\n */\n this.target = null;\n\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n *\n * @member {Event}\n */\n this.originalEvent = null;\n }\n\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n *\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n\n\n InteractionData.prototype.getLocalPosition = function getLocalPosition(displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n\n return InteractionData;\n}();\n\nexports.default = InteractionData;\n//# sourceMappingURL=InteractionData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionData.js\n// module id = 261\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @mixin\n * @name interactiveTarget\n * @memberof PIXI.interaction\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.interaction.interactiveTarget\n * );\n */\nexports.default = {\n /**\n * Determines if the displayObject be clicked/touched\n *\n * @inner {boolean}\n */\n interactive: false,\n\n /**\n * Determines if the children to the displayObject can be clicked/touched\n * Setting this to false allows pixi to bypass a recursive hitTest function\n *\n * @inner {boolean}\n */\n interactiveChildren: true,\n\n /**\n * Interaction shape. Children will be hit first, then this shape will be checked.\n * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n *\n * @inner {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}\n */\n hitArea: null,\n\n /**\n * If enabled, the mouse cursor will change when hovered over the displayObject if it is interactive\n *\n * @inner {boolean}\n */\n buttonMode: false,\n\n /**\n * If buttonMode is enabled, this defines what CSS cursor property is used when the mouse cursor\n * is hovered over the displayObject\n *\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n *\n * @inner {string}\n */\n defaultCursor: 'pointer',\n\n // some internal checks..\n /**\n * Internal check to detect if the mouse cursor is hovered over the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _over: false,\n\n /**\n * Internal check to detect if the left mouse button is pressed on the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _isLeftDown: false,\n\n /**\n * Internal check to detect if the right mouse button is pressed on the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _isRightDown: false,\n\n /**\n * Internal check to detect if the pointer cursor is hovered over the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _pointerOver: false,\n\n /**\n * Internal check to detect if the pointer is down on the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _pointerDown: false,\n\n /**\n * Internal check to detect if a user has touched the displayObject\n *\n * @inner {boolean}\n * @private\n */\n _touchDown: false\n};\n//# sourceMappingURL=interactiveTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/interactiveTarget.js\n// module id = 262\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.parse = parse;\n\nexports.default = function () {\n return function bitmapFontParser(resource, next) {\n // skip if no data or not xml data\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.XML) {\n next();\n\n return;\n }\n\n // skip if not bitmap font data, using some silly duck-typing\n if (resource.data.getElementsByTagName('page').length === 0 || resource.data.getElementsByTagName('info').length === 0 || resource.data.getElementsByTagName('info')[0].getAttribute('face') === null) {\n next();\n\n return;\n }\n\n var xmlUrl = !resource.isDataUrl ? path.dirname(resource.url) : '';\n\n if (resource.isDataUrl) {\n if (xmlUrl === '.') {\n xmlUrl = '';\n }\n\n if (this.baseUrl && xmlUrl) {\n // if baseurl has a trailing slash then add one to xmlUrl so the replace works below\n if (this.baseUrl.charAt(this.baseUrl.length - 1) === '/') {\n xmlUrl += '/';\n }\n\n // remove baseUrl from xmlUrl\n xmlUrl = xmlUrl.replace(this.baseUrl, '');\n }\n }\n\n // if there is an xmlUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (xmlUrl && xmlUrl.charAt(xmlUrl.length - 1) !== '/') {\n xmlUrl += '/';\n }\n\n var textureUrl = xmlUrl + resource.data.getElementsByTagName('page')[0].getAttribute('file');\n\n if (_core.utils.TextureCache[textureUrl]) {\n // reuse existing texture\n parse(resource, _core.utils.TextureCache[textureUrl]);\n next();\n } else {\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n loadType: _resourceLoader.Resource.LOAD_TYPE.IMAGE,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n // load the texture for the font\n this.add(resource.name + '_image', textureUrl, loadOptions, function (res) {\n parse(resource, res.texture);\n next();\n });\n }\n };\n};\n\nvar _path = require('path');\n\nvar path = _interopRequireWildcard(_path);\n\nvar _core = require('../core');\n\nvar _resourceLoader = require('resource-loader');\n\nvar _extras = require('../extras');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction parse(resource, texture) {\n var data = {};\n var info = resource.data.getElementsByTagName('info')[0];\n var common = resource.data.getElementsByTagName('common')[0];\n\n data.font = info.getAttribute('face');\n data.size = parseInt(info.getAttribute('size'), 10);\n data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);\n data.chars = {};\n\n // parse letters\n var letters = resource.data.getElementsByTagName('char');\n\n for (var i = 0; i < letters.length; i++) {\n var charCode = parseInt(letters[i].getAttribute('id'), 10);\n\n var textureRect = new _core.Rectangle(parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), parseInt(letters[i].getAttribute('height'), 10));\n\n data.chars[charCode] = {\n xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),\n yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),\n xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),\n kerning: {},\n texture: new _core.Texture(texture.baseTexture, textureRect)\n\n };\n }\n\n // parse kernings\n var kernings = resource.data.getElementsByTagName('kerning');\n\n for (var _i = 0; _i < kernings.length; _i++) {\n var first = parseInt(kernings[_i].getAttribute('first'), 10);\n var second = parseInt(kernings[_i].getAttribute('second'), 10);\n var amount = parseInt(kernings[_i].getAttribute('amount'), 10);\n\n if (data.chars[second]) {\n data.chars[second].kerning[first] = amount;\n }\n }\n\n resource.bitmapFont = data;\n\n // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3\n // but it's very likely to change\n _extras.BitmapText.fonts[data.font] = data;\n}\n//# sourceMappingURL=bitmapFontParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/bitmapFontParser.js\n// module id = 263\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _loader = require('./loader');\n\nObject.defineProperty(exports, 'Loader', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_loader).default;\n }\n});\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nObject.defineProperty(exports, 'bitmapFontParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_bitmapFontParser).default;\n }\n});\nObject.defineProperty(exports, 'parseBitmapFontData', {\n enumerable: true,\n get: function get() {\n return _bitmapFontParser.parse;\n }\n});\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nObject.defineProperty(exports, 'spritesheetParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_spritesheetParser).default;\n }\n});\n\nvar _textureParser = require('./textureParser');\n\nObject.defineProperty(exports, 'textureParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_textureParser).default;\n }\n});\n\nvar _resourceLoader = require('resource-loader');\n\nObject.defineProperty(exports, 'Resource', {\n enumerable: true,\n get: function get() {\n return _resourceLoader.Resource;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/index.js\n// module id = 264\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function spritesheetParser(resource, next) {\n var resourcePath = void 0;\n var imageResourceName = resource.name + '_image';\n\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.JSON || !resource.data.frames || this.resources[imageResourceName]) {\n next();\n\n return;\n }\n\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n loadType: _resourceLoader.Resource.LOAD_TYPE.IMAGE,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n resourcePath = resource.data.meta.image;\n } else {\n resourcePath = _path2.default.dirname(resource.url.replace(this.baseUrl, '')) + '/' + resource.data.meta.image;\n }\n\n // load the image for this sheet\n this.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n resource.textures = {};\n\n var frames = resource.data.frames;\n var frameKeys = Object.keys(frames);\n var baseTexture = res.texture.baseTexture;\n var scale = resource.data.meta.scale;\n\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = core.utils.getResolutionOfUrl(resource.url, null);\n\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? scale : 1;\n }\n\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n baseTexture.resolution = resolution;\n baseTexture.update();\n }\n\n var batchIndex = 0;\n\n function processFrames(initialFrameIndex, maxFrames) {\n var frameIndex = initialFrameIndex;\n\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < frameKeys.length) {\n var i = frameKeys[frameIndex];\n var rect = frames[i].frame;\n\n if (rect) {\n var frame = null;\n var trim = null;\n var orig = new core.Rectangle(0, 0, frames[i].sourceSize.w / resolution, frames[i].sourceSize.h / resolution);\n\n if (frames[i].rotated) {\n frame = new core.Rectangle(rect.x / resolution, rect.y / resolution, rect.h / resolution, rect.w / resolution);\n } else {\n frame = new core.Rectangle(rect.x / resolution, rect.y / resolution, rect.w / resolution, rect.h / resolution);\n }\n\n // Check to see if the sprite is trimmed\n if (frames[i].trimmed) {\n trim = new core.Rectangle(frames[i].spriteSourceSize.x / resolution, frames[i].spriteSourceSize.y / resolution, rect.w / resolution, rect.h / resolution);\n }\n\n resource.textures[i] = new core.Texture(baseTexture, frame, orig, trim, frames[i].rotated ? 2 : 0);\n\n // lets also add the frame to pixi's global cache for fromFrame and fromImage functions\n core.utils.TextureCache[i] = resource.textures[i];\n }\n\n frameIndex++;\n }\n }\n\n function shouldProcessNextBatch() {\n return batchIndex * BATCH_SIZE < frameKeys.length;\n }\n\n function processNextBatch(done) {\n processFrames(batchIndex * BATCH_SIZE, BATCH_SIZE);\n batchIndex++;\n setTimeout(done, 0);\n }\n\n function iteration() {\n processNextBatch(function () {\n if (shouldProcessNextBatch()) {\n iteration();\n } else {\n next();\n }\n });\n }\n\n if (frameKeys.length <= BATCH_SIZE) {\n processFrames(0, BATCH_SIZE);\n next();\n } else {\n iteration();\n }\n });\n };\n};\n\nvar _resourceLoader = require('resource-loader');\n\nvar _path = require('path');\n\nvar _path2 = _interopRequireDefault(_path);\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar BATCH_SIZE = 1000;\n//# sourceMappingURL=spritesheetParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/spritesheetParser.js\n// module id = 265\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function textureParser(resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && resource.type === _resourceLoader.Resource.TYPE.IMAGE) {\n var baseTexture = new core.BaseTexture(resource.data, null, core.utils.getResolutionOfUrl(resource.url));\n\n baseTexture.imageUrl = resource.url;\n resource.texture = new core.Texture(baseTexture);\n\n // lets also add the frame to pixi's global cache for fromFrame and fromImage fucntions\n core.utils.BaseTextureCache[resource.name] = baseTexture;\n core.utils.TextureCache[resource.name] = resource.texture;\n\n // also add references by url if they are different.\n if (resource.name !== resource.url) {\n core.utils.BaseTextureCache[resource.url] = baseTexture;\n core.utils.TextureCache[resource.url] = resource.texture;\n }\n }\n\n next();\n };\n};\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _resourceLoader = require('resource-loader');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n//# sourceMappingURL=textureParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/textureParser.js\n// module id = 266\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The Plane allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let Plane = new PIXI.Plane(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Plane = function (_Mesh) {\n _inherits(Plane, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the Plane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n function Plane(texture, verticesX, verticesY) {\n _classCallCheck(this, Plane);\n\n /**\n * Tracker for if the Plane is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this._ready = true;\n\n _this.verticesX = verticesX || 10;\n _this.verticesY = verticesY || 10;\n\n _this.drawMode = _Mesh3.default.DRAW_MODES.TRIANGLES;\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes\n *\n */\n\n\n Plane.prototype.refresh = function refresh() {\n var total = this.verticesX * this.verticesY;\n var verts = [];\n var colors = [];\n var uvs = [];\n var indices = [];\n var texture = this.texture;\n\n var segmentsX = this.verticesX - 1;\n var segmentsY = this.verticesY - 1;\n\n var sizeX = texture.width / segmentsX;\n var sizeY = texture.height / segmentsY;\n\n for (var i = 0; i < total; i++) {\n if (texture._uvs) {\n var x = i % this.verticesX;\n var y = i / this.verticesX | 0;\n\n verts.push(x * sizeX, y * sizeY);\n\n // this works for rectangular textures.\n uvs.push(texture._uvs.x0 + (texture._uvs.x1 - texture._uvs.x0) * (x / (this.verticesX - 1)), texture._uvs.y0 + (texture._uvs.y3 - texture._uvs.y0) * (y / (this.verticesY - 1)));\n } else {\n uvs.push(0);\n }\n }\n\n // cons\n\n var totalSub = segmentsX * segmentsY;\n\n for (var _i = 0; _i < totalSub; _i++) {\n var xpos = _i % segmentsX;\n var ypos = _i / segmentsX | 0;\n\n var value = ypos * this.verticesX + xpos;\n var value2 = ypos * this.verticesX + xpos + 1;\n var value3 = (ypos + 1) * this.verticesX + xpos;\n var value4 = (ypos + 1) * this.verticesX + xpos + 1;\n\n indices.push(value, value2, value3);\n indices.push(value2, value4, value3);\n }\n\n // console.log(indices)\n this.vertices = new Float32Array(verts);\n this.uvs = new Float32Array(uvs);\n this.colors = new Float32Array(colors);\n this.indices = new Uint16Array(indices);\n\n this.indexDirty = true;\n };\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n\n\n Plane.prototype._onTextureUpdate = function _onTextureUpdate() {\n _Mesh3.default.prototype._onTextureUpdate.call(this);\n\n // wait for the Plane ctor to finish before calling refresh\n if (this._ready) {\n this.refresh();\n }\n };\n\n return Plane;\n}(_Mesh3.default);\n\nexports.default = Plane;\n//# sourceMappingURL=Plane.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/Plane.js\n// module id = 267\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh = require('./Mesh');\n\nObject.defineProperty(exports, 'Mesh', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Mesh).default;\n }\n});\n\nvar _MeshRenderer = require('./webgl/MeshRenderer');\n\nObject.defineProperty(exports, 'MeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_MeshRenderer).default;\n }\n});\n\nvar _CanvasMeshRenderer = require('./canvas/CanvasMeshRenderer');\n\nObject.defineProperty(exports, 'CanvasMeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasMeshRenderer).default;\n }\n});\n\nvar _Plane = require('./Plane');\n\nObject.defineProperty(exports, 'Plane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Plane).default;\n }\n});\n\nvar _NineSlicePlane = require('./NineSlicePlane');\n\nObject.defineProperty(exports, 'NineSlicePlane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NineSlicePlane).default;\n }\n});\n\nvar _Rope = require('./Rope');\n\nObject.defineProperty(exports, 'Rope', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Rope).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/index.js\n// module id = 268\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _ParticleContainer = require('./ParticleContainer');\n\nObject.defineProperty(exports, 'ParticleContainer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleContainer).default;\n }\n});\n\nvar _ParticleRenderer = require('./webgl/ParticleRenderer');\n\nObject.defineProperty(exports, 'ParticleRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleRenderer).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/index.js\n// module id = 269\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLPrepare = require('./webgl/WebGLPrepare');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLPrepare).default;\n }\n});\n\nvar _CanvasPrepare = require('./canvas/CanvasPrepare');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasPrepare).default;\n }\n});\n\nvar _BasePrepare = require('./BasePrepare');\n\nObject.defineProperty(exports, 'BasePrepare', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BasePrepare).default;\n }\n});\n\nvar _CountLimiter = require('./limiters/CountLimiter');\n\nObject.defineProperty(exports, 'CountLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CountLimiter).default;\n }\n});\n\nvar _TimeLimiter = require('./limiters/TimeLimiter');\n\nObject.defineProperty(exports, 'TimeLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TimeLimiter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/index.js\n// module id = 270\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.prepare.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar CountLimiter = function () {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n _classCallCheck(this, CountLimiter);\n\n /**\n * The maximum number of items that can be prepared each frame.\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n CountLimiter.prototype.beginFrame = function beginFrame() {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n CountLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return this.itemsLeft-- > 0;\n };\n\n return CountLimiter;\n}();\n\nexports.default = CountLimiter;\n//# sourceMappingURL=CountLimiter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/limiters/CountLimiter.js\n// module id = 271\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.eachSeries = eachSeries;\nexports.queue = queue;\n/**\n * Smaller version of the async library constructs.\n *\n */\nfunction _noop() {} /* empty */\n\n/**\n * Iterates an array in series.\n *\n * @param {*[]} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n */\nfunction eachSeries(array, iterator, callback) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n iterator(array[i++], next);\n })();\n}\n\n/**\n * Ensures a function is only called once.\n *\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\n/**\n * Async queue implementation,\n *\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false;\n\n // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n//# sourceMappingURL=async.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/async.js\n// module id = 272\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.encodeBinary = encodeBinary;\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n }\n\n // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n encodedCharIndexes[0] = bytebuffer[0] >> 2;\n\n // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4;\n\n // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6;\n\n // index 3: forth 6 bits (6 least significant bits from input byte 3)\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n\n // Determine whether padding happened, and adjust accordingly\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break; // No padding - proceed\n }\n\n // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n//# sourceMappingURL=b64.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/b64.js\n// module id = 273\n// module chunks = 0","import {Howl} from 'howler';\nimport {loader, autoDetectRenderer} from 'pixi.js';\nimport {noop as _noop} from 'lodash/util';\nimport levels from '../data/levels.json';\nimport Stage from './Stage';\nimport audioSpriteSheet from '../../dist/audio.json';\n\nconst sound = new Howl(audioSpriteSheet);\n\nconst BLUE_SKY_COLOR = 0x64b0ff;\nconst PINK_SKY_COLOR = 0xfbb4d4;\nconst SUCCESS_RATIO = 0.6;\n\nclass Game {\n /**\n * Game Constructor\n * @param opts\n * @param {String} opts.spritesheet Path to the spritesheet file that PIXI's loader should load\n * @returns {Game}\n */\n constructor(opts) {\n this.spritesheet = opts.spritesheet;\n this.loader = loader;\n this.renderer = autoDetectRenderer(window.innerWidth, window.innerHeight, {\n backgroundColor: BLUE_SKY_COLOR\n });\n this.levelIndex = 0;\n\n this.waveEnding = false;\n this.levels = levels.normal;\n return this;\n }\n\n get ducksMissed() {\n return this.ducksMissedVal ? this.ducksMissedVal : 0;\n }\n\n set ducksMissed(val) {\n this.ducksMissedVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('ducksMissed')) {\n this.stage.hud.createTextureBasedCounter('ducksMissed', {\n texture: 'hud/score-live/0.png',\n spritesheet: this.spritesheet,\n location: Stage.missedDuckStatusBoxLocation()\n });\n }\n\n this.stage.hud.ducksMissed = val;\n }\n }\n\n get ducksShot() {\n return this.ducksShotVal ? this.ducksShotVal : 0;\n }\n\n set ducksShot(val) {\n this.ducksShotVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('ducksShot')) {\n this.stage.hud.createTextureBasedCounter('ducksShot', {\n texture: 'hud/score-dead/0.png',\n spritesheet: this.spritesheet,\n location: Stage.deadDuckStatusBoxLocation()\n });\n }\n\n this.stage.hud.ducksShot = val;\n }\n }\n /**\n * bullets - getter\n * @returns {Number}\n */\n get bullets() {\n return this.bulletVal ? this.bulletVal : 0;\n }\n\n /**\n * bullets - setter\n * Setter for the bullets property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying bullets, the property and a corresponding texture container\n * will be created in HUD.\n * @param {Number} val Number of bullets\n */\n set bullets(val) {\n this.bulletVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('bullets')) {\n this.stage.hud.createTextureBasedCounter('bullets', {\n texture: 'hud/bullet/0.png',\n spritesheet: this.spritesheet,\n location: Stage.bulletStatusBoxLocation()\n });\n }\n\n this.stage.hud.bullets = val;\n }\n\n }\n\n /**\n * score - getter\n * @returns {Number}\n */\n get score() {\n return this.scoreVal ? this.scoreVal : 0;\n }\n\n /**\n * score - setter\n * Setter for the score property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying the score, the property and a corresponding text box\n * will be created in HUD.\n * @param {Number} val Score value to set\n */\n set score(val) {\n this.scoreVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('score')) {\n this.stage.hud.createTextBox('score', {\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.scoreBoxLocation(),\n anchor: {\n x: 1,\n y: 0\n }\n });\n }\n\n this.stage.hud.score = val;\n }\n\n }\n\n /**\n * wave - get\n * @returns {Number}\n */\n get wave() {\n return this.waveVal ? this.waveVal : 0;\n }\n\n /**\n * wave - set\n * Setter for the wave property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying the wave, the property and a corresponding text box\n * will be created in the HUD.\n * @param {Number} val\n */\n set wave(val) {\n this.waveVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('waveStatus')) {\n this.stage.hud.createTextBox('waveStatus', {\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.waveStatusBoxLocation(),\n anchor: {\n x: 1,\n y: 1\n }\n });\n }\n\n if (!isNaN(val) && val > 0) {\n this.stage.hud.waveStatus = 'Wave ' + val + ' of ' + this.level.waves;\n } else {\n this.stage.hud.waveStatus = '';\n }\n }\n }\n\n /**\n * gameStatus - get\n * @returns {String}\n */\n get gameStatus() {\n return this.gameStatusVal ? this.gameStatusVal : '';\n }\n\n /**\n * gameStatus - set\n * @param {String} val\n */\n set gameStatus(val) {\n this.gameStatusVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('gameStatus')) {\n this.stage.hud.createTextBox('gameStatus', {\n style: {\n fontFamily: 'Arial',\n fontSize: '40px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.gameStatusBoxLocation()\n });\n }\n\n this.stage.hud.gameStatus = val;\n }\n }\n\n load() {\n this.loader\n .add(this.spritesheet)\n .load(this.onLoad.bind(this));\n }\n\n onLoad() {\n document.body.appendChild(this.renderer.view);\n\n this.stage = new Stage({\n spritesheet: this.spritesheet\n });\n\n this.scaleToWindow();\n this.bindEvents();\n this.startLevel();\n this.animate();\n\n }\n\n bindEvents() {\n window.addEventListener('resize', this.scaleToWindow.bind(this));\n }\n\n scaleToWindow() {\n this.renderer.resize(window.innerWidth, window.innerHeight);\n this.stage.scaleToWindow();\n }\n\n startLevel() {\n this.level = this.levels[this.levelIndex];\n this.ducksShot = 0;\n this.ducksMissed = 0;\n this.wave = 0;\n\n this.gameStatus = this.level.title;\n this.stage.preLevelAnimation().then(() => {\n this.gameStatus = '';\n this.bindInteractions();\n this.startWave();\n });\n }\n\n startWave() {\n sound.play('quacking');\n this.wave += 1;\n this.waveStartTime = Date.now();\n this.bullets = this.level.bullets;\n this.ducksShotThisWave = 0;\n this.waveEnding = false;\n\n this.stage.addDucks(this.level.ducks, this.level.speed);\n this.bindInteractions();\n }\n\n endWave() {\n this.waveEnding = true;\n this.bullets = 0;\n sound.stop('quacking');\n if (this.stage.ducksAlive()) {\n this.ducksMissed += this.level.ducks - this.ducksShotThisWave;\n this.renderer.backgroundColor = PINK_SKY_COLOR;\n this.stage.flyAway().then(this.goToNextWave.bind(this));\n } else {\n this.stage.cleanUpDucks();\n this.goToNextWave();\n }\n }\n\n goToNextWave() {\n this.renderer.backgroundColor = BLUE_SKY_COLOR;\n if (this.level.waves === this.wave) {\n this.endLevel();\n } else {\n this.startWave();\n }\n }\n\n shouldWaveEnd() {\n // evaluate pre-requisites for a wave to end\n if (this.wave === 0 || this.waveEnding || this.stage.dogActive()) {\n return false;\n }\n\n return this.isWaveTimeUp() || (this.outOfAmmo() && this.stage.ducksAlive()) || !this.stage.ducksActive();\n }\n\n isWaveTimeUp() {\n return this.level ? this.waveElapsedTime() >= this.level.time : false;\n }\n\n waveElapsedTime() {\n return (Date.now() - this.waveStartTime) / 1000;\n }\n\n outOfAmmo() {\n return this.level && this.bullets === 0;\n }\n\n endLevel() {\n this.wave = 0;\n this.goToNextLevel();\n }\n\n goToNextLevel() {\n this.levelIndex++;\n if (!this.levelWon()) {\n this.loss();\n } else if (this.levelIndex < this.levels.length) {\n this.startLevel();\n } else {\n this.win();\n }\n }\n\n levelWon() {\n return this.ducksShot > SUCCESS_RATIO * this.level.ducks * this.level.waves;\n }\n\n win() {\n sound.play('champ');\n this.gameStatus = 'You Win!';\n }\n\n loss() {\n sound.play('loserSound');\n this.gameStatus = 'You Lose!';\n }\n\n handleClick(event) {\n if (!this.outOfAmmo()) {\n sound.play('gunSound');\n this.bullets -= 1;\n this.updateScore(this.stage.shotsFired({\n x: event.data.global.x,\n y: event.data.global.y\n }));\n }\n }\n\n updateScore(ducksShot) {\n this.ducksShot += ducksShot;\n this.ducksShotThisWave += ducksShot;\n this.score += ducksShot * this.level.pointsPerDuck;\n }\n\n bindInteractions() {\n this.stage.mousedown = this.stage.touchstart = this.handleClick.bind(this);\n }\n\n unbindInteractions() {\n this.stage.mousedown = this.stage.touchstart = _noop;\n }\n\n animate() {\n this.renderer.render(this.stage);\n\n if (this.shouldWaveEnd()) {\n this.unbindInteractions();\n this.endWave();\n }\n\n requestAnimationFrame(this.animate.bind(this));\n }\n}\n\nexport default Game;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Game.js","import {TweenMax} from 'gsap';\nimport {noop as _noop} from 'lodash/util';\nimport {assign as _extend} from 'lodash/object';\nimport {Howl} from 'howler';\nimport audioSpriteSheet from '../../dist/audio.json';\nimport Character from './Character';\n\nconst sound = new Howl(audioSpriteSheet);\n\nclass Dog extends Character {\n /**\n * Dog Constructor\n * @param options\n * @param {String} options.spritesheet The object property to ask PIXI's resource loader for\n * @param {PIXI.Point} options.downPoint The point where the dog should sit at during active play\n * @param {PIXI.Point} options.upPoint The point the dog should rise to when retrieving ducks\n */\n constructor(options) {\n const states = [\n {\n name: 'double',\n animationSpeed: 0.1\n },\n {\n name: 'single',\n animationSpeed: 0.1\n },\n {\n name: 'find',\n animationSpeed: 0.1\n },\n {\n name: 'jump',\n animationSpeed: 0.1,\n loop: false\n },\n {\n name: 'laugh',\n animationSpeed: 0.1\n },\n {\n name: 'sniff',\n animationSpeed: 0.1\n }\n ];\n super('dog', options.spritesheet, states);\n this.toRetrieve = 0;\n this.anchor.set(0.5, 0);\n this.options = options;\n }\n\n /**\n * sniff\n * @param opts\n * @param {PIXI.Point} [opts.startPoint=this.position] Point the dog should start sniffing from\n * @param {PIXI.Point} [opts.endPoint=this.position] Point the dog should sniff to\n * @param {Function} [opts.onStart=_noop] Function to call at the start of the dog sniffing\n * @param {Function} [opts.onComplete=_noop] Function to call once the dog has finished sniffing\n * @returns {Dog}\n */\n sniff(opts) {\n const options = _extend({\n startPoint: this.position,\n endPoint: this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.sit({\n point: options.startPoint,\n pre: () => {\n this.visible = false;\n }\n });\n\n this.timeline.to(this.position, 2, {\n x: options.endPoint.x,\n y: options.endPoint.y,\n ease: 'Linear.easeNone',\n onStart: () => {\n this.visible = true;\n this.parent.setChildIndex(this, this.parent.children.length - 1);\n this.state = 'sniff';\n sound.play('sniff');\n options.onStart();\n },\n onComplete: () => {\n sound.stop('sniff');\n options.onComplete();\n }\n });\n\n return this;\n }\n\n /**\n * upDownTween\n * @param opts\n * @param {PIXI.Point} [opts.startPoint] Lowest point the dog should go to, and where the animation starts\n * @param {PIXI.Point} [opts.endPoint] Highest point the dog should go to\n * @param {Function} [opts.onStart] Function to call at the start of the up/down animation\n * @param {Function} [opts.onComplete] Function to call once the dog has completed an up/down cycle\n * return {Dog}\n */\n upDownTween(opts) {\n const options = _extend({\n startPoint: this.options.downPoint || this.position,\n endPoint: this.options.upPoint || this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.sit({\n point: options.startPoint\n });\n\n this.timeline.add(TweenMax.to(this.position, 0.4, {\n y: options.endPoint.y,\n yoyo: true,\n repeat: 1,\n repeatDelay: 0.5,\n ease: 'Linear.easeNone',\n onStart: () => {\n this.visible = true;\n options.onStart.call(this);\n },\n onComplete: options.onComplete\n }));\n return this;\n }\n\n /**\n * find\n * @param opts\n * @param {Function} [opts.onStart] Function called at the start of the animation\n * @param {Function} [opts.onComplete] Function called when the animation has completed\n * @returns {Dog}\n */\n find(opts) {\n const options = _extend({\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.timeline.add(() => {\n sound.stop('sniff'); // stop gap for some race condition bug\n sound.play('barkDucks');\n this.state = 'find';\n options.onStart();\n });\n\n this.timeline.to(this.position, 0.2, {\n y: '-=100',\n ease: 'Strong.easeOut',\n delay: 0.6,\n onStart: () => {\n this.state = 'jump';\n },\n onComplete: () => {\n this.visible = false;\n options.onComplete();\n }\n });\n\n return this;\n }\n\n /**\n * sit\n * @param opts\n * @param {PIXI.Point} [opts.point] Point the dog will go to without animation\n * @param {Function} [opts.onStart] Function called before moving the dog\n * @param {Function} [opts.onComplete] Function called after the dog has moved\n * @returns {Dog}\n */\n sit(opts) {\n const options = _extend({\n point: this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.timeline.add(() => {\n options.onStart();\n this.position.set(options.point.x, options.point.y);\n options.onComplete();\n });\n return this;\n }\n\n /**\n * retrieve\n * @retuns {Dog}\n */\n retrieve() {\n this.toRetrieve++;\n\n this.upDownTween({\n onStart: () => {\n if (this.toRetrieve >= 2) {\n this.state = 'double';\n this.toRetrieve-=2;\n } else if (this.toRetrieve === 1) {\n this.state = 'single';\n this.toRetrieve-=1;\n }\n }\n });\n return this;\n }\n\n /**\n * laugh\n * @returns {Dog}\n */\n laugh() {\n this.upDownTween({\n state: 'laugh',\n onStart: () => {\n this.toRetrieve = 0;\n this.state = 'laugh';\n sound.play('laugh');\n }\n });\n\n return this;\n }\n\n /**\n * isActive\n * @returns {boolean}\n */\n isActive() {\n return super.isActive() && this.toRetrieve > 0;\n }\n}\n\nexport default Dog;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Dog.js","import {Howl} from 'howler';\nimport {random as _random} from 'lodash/number';\nimport {assign as _extend} from 'lodash/object';\nimport {noop as _noop} from 'lodash/util';\nimport audioSpriteSheet from '../../dist/audio.json';\nimport Utils from '../libs/utils';\nimport Character from './Character';\n\nconst sound = new Howl(audioSpriteSheet);\nconst DEATH_ANIMATION_SECONDS = 0.6;\nconst RANDOM_FLIGHT_DELTA = 300;\n\nclass Duck extends Character {\n /**\n * Duck constructor\n * Method to instantiate a new Duck character\n * @param {Object} options with various duck configuration values\n * @param {String} options.colorProfile String that is concatinated with `duck/` to generate the sprite ID\n * @param {String} options.spritesheet The object property to ask PIXI's resource loader for\n * @param {Number} [options.maxX] When randomly flying, imposes an upper bound on the X coordinate\n * @param {Number} [options.maxY] When randomly flying, imposes an upper bound on the Y coordinate\n * @param {Number} [options.randomFlightDelta] The minimum distance the duck must travel when randomly flying\n */\n constructor(options) {\n const spriteId = 'duck/' + options.colorProfile;\n const states = [\n {\n name: 'left',\n animationSpeed: 0.18\n\n },\n {\n name: 'right',\n animationSpeed: 0.18\n\n },\n {\n name: 'top-left',\n animationSpeed: 0.18\n\n },\n {\n name: 'top-right',\n animationSpeed: 0.18\n\n },\n {\n name: 'dead',\n animationSpeed: 0.18\n\n },\n {\n name: 'shot',\n animationSpeed: 0.18\n\n }\n ];\n super(spriteId, options.spritesheet, states);\n this.alive = true;\n this.visible = true;\n this.options = options;\n this.anchor.set(0.5, 0.5);\n }\n\n /**\n * randomFlight\n * Method that causes the duck the randomly fly around a specific region of its parent\n * @param {Object} opts options for the flight tween\n * @param {Number} [opts.minX=0] Lowest x value allowed\n * @param {Number} [opts.maxX=Infinity] Highest x value allowed\n * @param {Number} [opts.minY=0] Lowest Y value allowed\n * @param {Number} [opts.maxY=Infinity] Highest Y value allowed\n * @param {Number} [opts.randomFlightDelta=300] Minimum distance to the next destination\n * @param {Number} [opts.speed=1] Speed of travel on a scale of 0 (slow) to 10 (fast)\n */\n randomFlight(opts) {\n const options = _extend({\n minX: 0,\n maxX: this.options.maxX || Infinity,\n minY: 0,\n maxY: this.options.maxY || Infinity,\n randomFlightDelta: this.options.randomFilghtDelta || RANDOM_FLIGHT_DELTA,\n speed: 1\n }, opts);\n\n let distance, destination;\n do {\n destination = {\n x: _random(options.minX, options.maxX),\n y: _random(options.minY, options.maxY)\n };\n distance = Utils.pointDistance(this.position, destination);\n } while (distance < options.randomFlightDelta);\n\n this.flyTo({\n point: destination,\n speed: options.speed,\n onComplete: this.randomFlight.bind(this, options)\n });\n }\n\n /**\n * flyTo\n * Method that adds an animation to the ducks timeline for flying to a specified point.\n * @param opts\n * @param {PIXI.Point} [opts.point] Location the duck should go to\n * @param {Number} [opts.speed] Integer from 0 to 10 which determines how fast the duck flys\n * @param {Function} [opts.onStart=_noop] Method to call when the duck begins flying to the destination\n * @param {Function} [opts.onComplete_noop] Method to call when the duck has arrived at the destination\n * @returns {Duck}\n */\n flyTo(opts) {\n const options = _extend({\n point: this.position,\n speed: this.speed,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.speed = options.speed;\n\n const direction = Utils.directionOfTravel(this.position, options.point);\n const tweenSeconds = (this.flightAnimationMs + _random(0, 300)) / 1000;\n\n this.timeline.to(this.position, tweenSeconds, {\n x: options.point.x,\n y: options.point.y,\n ease: 'Linear.easeNone',\n onStart: () => {\n if (!this.alive) {\n this.stopAndClearTimeline();\n }\n this.play();\n this.state = direction.replace('bottom', 'top');\n options.onStart();\n },\n onComplete: options.onComplete\n });\n\n return this;\n }\n\n /**\n * shot\n * Method that animates the duck when the player shoots it\n */\n shot() {\n if (!this.alive) {\n return;\n }\n this.alive = false;\n\n this.stopAndClearTimeline();\n this.timeline.add(() => {\n this.state = 'shot';\n sound.play('quak', _noop);\n });\n\n this.timeline.to(this.position, DEATH_ANIMATION_SECONDS, {\n y: this.options.maxY,\n ease: 'Linear.easeNone',\n delay: 0.3,\n onStart: () => {\n this.state = 'dead';\n },\n onComplete: () => {\n sound.play('thud', _noop);\n this.visible = false;\n }\n });\n\n }\n\n /**\n * isActive\n * Helper that tells whether the duck is currently or is able to be animated.\n * Because ducks have a complex death sequence, this method checks if a duck is visible\n * in addition to the standard timeline animation check. This avoids potential race conditions\n * since in Duckhunt, if you can see the duck, it's beind animated in some way even if it's\n * technically \"dead\"\n * @returns {*|boolean}\n */\n isActive() {\n return this.visible || super.isActive();\n }\n\n /**\n * speed - getter\n * This method returns the\n * @returns {Number} Returns the speed level, a number from 0 to 10\n */\n get speed() {\n return this.speedVal;\n }\n\n /**\n * speed - setter\n * Method that determines how fast the duck should fly. Uses a 0-10 scale for ease and since\n * it technically \"goes to 11\"\n * @see https://www.youtube.com/watch?v=KOO5S4vxi0o.\n * @param {Number} val A number from 0 (slow) to 10 (fast) that sets the length of the flight tween\n */\n set speed(val) {\n let flightAnimationMs;\n switch (val) {\n case 0:\n flightAnimationMs = 3000;\n break;\n case 1:\n flightAnimationMs = 2800;\n break;\n case 2:\n flightAnimationMs = 2500;\n break;\n case 3:\n flightAnimationMs = 2000;\n break;\n case 4:\n flightAnimationMs = 1800;\n break;\n case 5:\n flightAnimationMs = 1500;\n break;\n case 6:\n flightAnimationMs = 1300;\n break;\n case 7:\n flightAnimationMs = 1200;\n break;\n case 8:\n flightAnimationMs = 800;\n break;\n case 9:\n flightAnimationMs = 600;\n break;\n case 10:\n flightAnimationMs = 500;\n break;\n }\n this.speedVal = val;\n this.flightAnimationMs = flightAnimationMs;\n }\n}\n\nexport default Duck;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Duck.js","import {Container, Point, Text, loader, extras} from 'pixi.js';\nimport {assign as _extend} from 'lodash/object';\n\n/**\n * Hud\n * The heads up display class, or Hud is an abstraction that aids in the creation\n * and visual updating of text boxes that display useful information to the\n * user as they play the game.\n *\n * The instantiator of this class is responsible for displaying it at the proper\n * depth in it's parent container.\n */\nclass Hud extends Container {\n constructor() {\n super();\n }\n\n /**\n * createTextBox\n * This method defines a property key on the Hud object that when modified\n * ensures the text box is visually updated. This is accomplished using ES6 getters\n * and setters.\n * @param name string - This name becomes a property key on the Hud object,\n * modifying it will update the textBox automatically.\n * @param opts object - Object to convey style, location, anchor point, etc of the text box\n */\n createTextBox(name, opts) {\n // set defaults, and allow them to be overwritten\n const options = _extend({\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: new Point(0, 0),\n anchor: {\n x: 0.5,\n y: 0.5\n }\n }, opts);\n\n this[name + 'TextBox'] = new Text('', options.style);\n const textBox = this[name + 'TextBox'];\n textBox.position.set(options.location.x, options.location.y);\n textBox.anchor.set(options.anchor.x, options.anchor.y);\n this.addChild(textBox);\n\n Object.defineProperty(this, name, {\n set: (val) => {\n textBox.text = val;\n },\n get: () => {\n return textBox.text;\n }\n });\n }\n\n createTextureBasedCounter(name, opts) {\n const options = _extend({\n texture: '',\n spritesheet: '',\n location: new Point(0, 0)\n }, opts);\n\n this[name + 'Container'] = new Container();\n const container = this[name + 'Container'];\n container.position.set(options.location.x, options.location.y);\n this.addChild(container);\n\n Object.defineProperty(this, name, {\n set: (val) => {\n const gameTextures = loader.resources[options.spritesheet].textures;\n const texture = gameTextures[options.texture];\n const childCount = container.children.length;\n if (childCount < val) {\n for (let i = childCount; i < val; i++) {\n const item = new extras.AnimatedSprite([texture]);\n item.position.set(item.width * i, 0);\n container.addChild(item);\n }\n } else if (val != childCount) {\n container.removeChildren(val, childCount);\n }\n }\n });\n }\n}\n\nexport default Hud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Hud.js","import {Point, Graphics, Container, loader, extras} from 'pixi.js';\nimport BPromise from 'bluebird';\nimport {some as _some} from 'lodash/collection';\nimport {delay as _delay} from 'lodash/function';\nimport Utils from '../libs/utils';\nimport Duck from './Duck';\nimport Dog from './Dog';\nimport Hud from './Hud';\n\nconst MAX_X = 800;\nconst MAX_Y = 600;\n\nconst DUCK_POINTS = {\n ORIGIN: new Point(MAX_X / 2, MAX_Y)\n};\nconst DOG_POINTS = {\n DOWN: new Point(MAX_X / 2, MAX_Y),\n UP: new Point(MAX_X / 2, MAX_Y - 230),\n SNIFF_START: new Point(0, MAX_Y - 130),\n SNIFF_END: new Point(MAX_X / 2, MAX_Y - 130)\n};\nconst HUD_LOCATIONS = {\n SCORE: new Point(MAX_X - 10, 10),\n WAVE_STATUS: new Point(MAX_X - 10, MAX_Y - 20),\n GAME_STATUS: new Point(MAX_X / 2, MAX_Y * 0.45),\n BULLET_STATUS: new Point(10, 10),\n DEAD_DUCK_STATUS: new Point(10, MAX_Y * 0.91),\n MISSED_DUCK_STATUS: new Point(10, MAX_Y * 0.95)\n};\n\nconst FLASH_MS = 60;\nconst FLASH_SCREEN = new Graphics();\nFLASH_SCREEN.beginFill(0xFFFFFF);\nFLASH_SCREEN.drawRect(0, 0, MAX_X, MAX_Y);\nFLASH_SCREEN.endFill();\nFLASH_SCREEN.position.x = 0;\nFLASH_SCREEN.position.y = 0;\n\nclass Stage extends Container {\n\n /**\n * Stage Constructor\n * Container for the game\n * @param opts\n * @param opts.spritesheet - String representing the path to the spritesheet file\n */\n constructor(opts) {\n super();\n this.spritesheet = opts.spritesheet;\n this.interactive = true;\n this.ducks = [];\n this.dog = new Dog({\n spritesheet: opts.spritesheet,\n downPoint: DOG_POINTS.DOWN,\n upPoint: DOG_POINTS.UP\n });\n this.dog.visible = false;\n this.flashScreen = FLASH_SCREEN;\n this.flashScreen.visible = false;\n this.hud = new Hud();\n\n this._setStage();\n this.scaleToWindow();\n }\n\n static scoreBoxLocation() {\n return HUD_LOCATIONS.SCORE;\n }\n\n static waveStatusBoxLocation() {\n return HUD_LOCATIONS.WAVE_STATUS;\n }\n\n static gameStatusBoxLocation() {\n return HUD_LOCATIONS.GAME_STATUS;\n }\n\n static bulletStatusBoxLocation() {\n return HUD_LOCATIONS.BULLET_STATUS;\n }\n\n static deadDuckStatusBoxLocation() {\n return HUD_LOCATIONS.DEAD_DUCK_STATUS;\n }\n\n static missedDuckStatusBoxLocation() {\n return HUD_LOCATIONS.MISSED_DUCK_STATUS;\n }\n /**\n * scaleToWindow\n * Helper method that scales the stage container to the window size\n */\n scaleToWindow() {\n this.scale.set(window.innerWidth / MAX_X, window.innerHeight / MAX_Y);\n }\n\n /**\n * _setStage\n * Private method that adds all of the main pieces to the scene\n * @returns {Stage}\n * @private\n */\n _setStage() {\n const background = new extras.AnimatedSprite([\n loader.resources[this.spritesheet].textures['scene/back/0.png']\n ]);\n background.position.set(0, 0);\n\n const tree = new extras.AnimatedSprite([loader.resources[this.spritesheet].textures['scene/tree/0.png']]);\n tree.position.set(100, 237);\n\n this.addChild(tree);\n this.addChild(background);\n this.addChild(this.dog);\n this.addChild(this.flashScreen);\n this.addChild(this.hud);\n\n return this;\n }\n\n /**\n * preLevelAnimation\n * Helper method that runs the level intro animation with the dog and returns a promise that resolves\n * when it's complete.\n * @returns {Promise}\n */\n preLevelAnimation() {\n return new BPromise((resolve) => {\n this.cleanUpDucks();\n\n const sniffOpts = {\n startPoint: DOG_POINTS.SNIFF_START,\n endPoint: DOG_POINTS.SNIFF_END\n };\n\n const findOpts = {\n onComplete: () => {\n this.setChildIndex(this.dog, 0);\n resolve();\n }\n };\n\n this.dog.sniff(sniffOpts).find(findOpts);\n });\n }\n\n /**\n * addDucks\n * Helper method that adds ducks to the container and causes them to fly around randomly.\n * @param {Number} numDucks - How many ducks to add to the stage\n * @param {Number} speed - Value from 0 (slow) to 10 (fast) that determines how fast the ducks will fly\n */\n addDucks(numDucks, speed) {\n for (let i = 0; i < numDucks; i++) {\n const duckColor = i % 2 === 0 ? 'red' : 'black';\n\n // Al was here.\n const newDuck = new Duck({\n spritesheet: this.spritesheet,\n colorProfile: duckColor,\n maxX: MAX_X,\n maxY: MAX_Y\n });\n newDuck.position.set(DUCK_POINTS.ORIGIN.x, DUCK_POINTS.ORIGIN.y);\n this.addChildAt(newDuck, 0);\n newDuck.randomFlight({\n speed\n });\n\n this.ducks.push(newDuck);\n }\n }\n\n /**\n * shotsFired\n * Click handler for the stage, scale's the location of the click to ensure coordinate system\n * alignment and then calculates if any of the ducks were hit and should be shot.\n * @param {{x:Number, y:Number}} clickPoint - Point where the container was clicked in real coordinates\n * @returns {Number} - The number of ducks hit with the shot\n */\n shotsFired(clickPoint) {\n // flash the screen\n this.flashScreen.visible = true;\n _delay(() => {\n this.flashScreen.visible = false;\n }, FLASH_MS);\n\n clickPoint.x /= this.scale.x;\n clickPoint.y /= this.scale.y;\n let ducksShot = 0;\n for (let i = 0; i < this.ducks.length; i++) {\n const duck = this.ducks[i];\n if (duck.alive && Utils.pointDistance(duck.position, clickPoint) < 60) {\n ducksShot++;\n duck.shot();\n duck.timeline.add(() => {\n this.dog.retrieve();\n });\n }\n }\n return ducksShot;\n }\n\n /**\n * flyAway\n * Helper method that causes the sky to change color and the ducks to fly away\n * @returns {Promise} - This promise is resolved when all the ducks have flown away\n */\n flyAway() {\n this.dog.laugh();\n\n const duckPromises = [];\n\n for (let i = 0; i < this.ducks.length; i++) {\n const duck = this.ducks[i];\n if (duck.alive) {\n duckPromises.push(new BPromise((resolve) => {\n duck.stopAndClearTimeline();\n duck.flyTo({\n point: new Point(MAX_X / 2, -500),\n onComplete: resolve\n });\n }));\n }\n }\n\n return BPromise.all(duckPromises).then(this.cleanUpDucks.bind(this));\n }\n\n /**\n * cleanUpDucks\n * Helper that removes all ducks from the container and object\n */\n cleanUpDucks() {\n for (let i = 0; i < this.ducks.length; i++) {\n this.removeChild(this.ducks[i]);\n }\n this.ducks = [];\n }\n\n /**\n * ducksAlive\n * Helper that returns a boolean value depending on whether or not ducks are alive. The distinction\n * is that even dead ducks may be animating and still \"active\"\n * @returns {Boolean}\n */\n ducksAlive() {\n return _some(this.ducks, (duck) => {\n return duck.alive;\n });\n }\n\n /**\n * ducksActive\n * Helper that returns a boolean value depending on whether or not ducks are animating. Both live\n * and dead ducks may be animating.\n * @returns {Boolean}\n */\n ducksActive() {\n return _some(this.ducks, (duck) => {\n return duck.isActive();\n });\n }\n\n /**\n * dogActive\n * Helper proxy method that returns a boolean depending on whether the dog is animating\n * @returns {boolean}\n */\n dogActive() {\n return this.dog.isActive();\n }\n\n /**\n * isActive\n * High level helper to determine if things are animating on the stage\n * @returns {boolean|Boolean}\n */\n isActive() {\n return this.dogActive() || this.ducksAlive() || this.ducksActive();\n }\n}\n\nexport default Stage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Stage.js","/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2015 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.4.7\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var f;\"undefined\"!=typeof window?f=window:\"undefined\"!=typeof global?f=global:\"undefined\"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_==\"function\"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_==\"function\"&&_dereq_;for(var o=0;o 0) {\n var fn = queue.shift();\n if (typeof fn !== \"function\") {\n fn._settlePromises();\n continue;\n }\n var receiver = queue.shift();\n var arg = queue.shift();\n fn.call(receiver, arg);\n }\n};\n\nAsync.prototype._drainQueues = function () {\n this._drainQueue(this._normalQueue);\n this._reset();\n this._haveDrainedQueues = true;\n this._drainQueue(this._lateQueue);\n};\n\nAsync.prototype._queueTick = function () {\n if (!this._isTickUsed) {\n this._isTickUsed = true;\n this._schedule(this.drainQueues);\n }\n};\n\nAsync.prototype._reset = function () {\n this._isTickUsed = false;\n};\n\nmodule.exports = Async;\nmodule.exports.firstLineError = firstLineError;\n\n},{\"./queue\":26,\"./schedule\":29,\"./util\":36}],3:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\nvar calledBind = false;\nvar rejectThis = function(_, e) {\n this._reject(e);\n};\n\nvar targetRejected = function(e, context) {\n context.promiseRejectionQueued = true;\n context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n};\n\nvar bindingResolved = function(thisArg, context) {\n if (((this._bitField & 50397184) === 0)) {\n this._resolveCallback(context.target);\n }\n};\n\nvar bindingRejected = function(e, context) {\n if (!context.promiseRejectionQueued) this._reject(e);\n};\n\nPromise.prototype.bind = function (thisArg) {\n if (!calledBind) {\n calledBind = true;\n Promise.prototype._propagateFrom = debug.propagateFromFunction();\n Promise.prototype._boundValue = debug.boundValueFunction();\n }\n var maybePromise = tryConvertToPromise(thisArg);\n var ret = new Promise(INTERNAL);\n ret._propagateFrom(this, 1);\n var target = this._target();\n ret._setBoundTo(maybePromise);\n if (maybePromise instanceof Promise) {\n var context = {\n promiseRejectionQueued: false,\n promise: ret,\n target: target,\n bindingPromise: maybePromise\n };\n target._then(INTERNAL, targetRejected, undefined, ret, context);\n maybePromise._then(\n bindingResolved, bindingRejected, undefined, ret, context);\n ret._setOnCancel(maybePromise);\n } else {\n ret._resolveCallback(target);\n }\n return ret;\n};\n\nPromise.prototype._setBoundTo = function (obj) {\n if (obj !== undefined) {\n this._bitField = this._bitField | 2097152;\n this._boundTo = obj;\n } else {\n this._bitField = this._bitField & (~2097152);\n }\n};\n\nPromise.prototype._isBound = function () {\n return (this._bitField & 2097152) === 2097152;\n};\n\nPromise.bind = function (thisArg, value) {\n return Promise.resolve(value).bind(thisArg);\n};\n};\n\n},{}],4:[function(_dereq_,module,exports){\n\"use strict\";\nvar old;\nif (typeof Promise !== \"undefined\") old = Promise;\nfunction noConflict() {\n try { if (Promise === bluebird) Promise = old; }\n catch (e) {}\n return bluebird;\n}\nvar bluebird = _dereq_(\"./promise\")();\nbluebird.noConflict = noConflict;\nmodule.exports = bluebird;\n\n},{\"./promise\":22}],5:[function(_dereq_,module,exports){\n\"use strict\";\nvar cr = Object.create;\nif (cr) {\n var callerCache = cr(null);\n var getterCache = cr(null);\n callerCache[\" size\"] = getterCache[\" size\"] = 0;\n}\n\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar isIdentifier = util.isIdentifier;\n\nvar getMethodCaller;\nvar getGetter;\nif (!true) {\nvar makeMethodCaller = function (methodName) {\n return new Function(\"ensureMethod\", \" \\n\\\n return function(obj) { \\n\\\n 'use strict' \\n\\\n var len = this.length; \\n\\\n ensureMethod(obj, 'methodName'); \\n\\\n switch(len) { \\n\\\n case 1: return obj.methodName(this[0]); \\n\\\n case 2: return obj.methodName(this[0], this[1]); \\n\\\n case 3: return obj.methodName(this[0], this[1], this[2]); \\n\\\n case 0: return obj.methodName(); \\n\\\n default: \\n\\\n return obj.methodName.apply(obj, this); \\n\\\n } \\n\\\n }; \\n\\\n \".replace(/methodName/g, methodName))(ensureMethod);\n};\n\nvar makeGetter = function (propertyName) {\n return new Function(\"obj\", \" \\n\\\n 'use strict'; \\n\\\n return obj.propertyName; \\n\\\n \".replace(\"propertyName\", propertyName));\n};\n\nvar getCompiled = function(name, compiler, cache) {\n var ret = cache[name];\n if (typeof ret !== \"function\") {\n if (!isIdentifier(name)) {\n return null;\n }\n ret = compiler(name);\n cache[name] = ret;\n cache[\" size\"]++;\n if (cache[\" size\"] > 512) {\n var keys = Object.keys(cache);\n for (var i = 0; i < 256; ++i) delete cache[keys[i]];\n cache[\" size\"] = keys.length - 256;\n }\n }\n return ret;\n};\n\ngetMethodCaller = function(name) {\n return getCompiled(name, makeMethodCaller, callerCache);\n};\n\ngetGetter = function(name) {\n return getCompiled(name, makeGetter, getterCache);\n};\n}\n\nfunction ensureMethod(obj, methodName) {\n var fn;\n if (obj != null) fn = obj[methodName];\n if (typeof fn !== \"function\") {\n var message = \"Object \" + util.classString(obj) + \" has no method '\" +\n util.toString(methodName) + \"'\";\n throw new Promise.TypeError(message);\n }\n return fn;\n}\n\nfunction caller(obj) {\n var methodName = this.pop();\n var fn = ensureMethod(obj, methodName);\n return fn.apply(obj, this);\n}\nPromise.prototype.call = function (methodName) {\n var args = [].slice.call(arguments, 1);;\n if (!true) {\n if (canEvaluate) {\n var maybeCaller = getMethodCaller(methodName);\n if (maybeCaller !== null) {\n return this._then(\n maybeCaller, undefined, undefined, args, undefined);\n }\n }\n }\n args.push(methodName);\n return this._then(caller, undefined, undefined, args, undefined);\n};\n\nfunction namedGetter(obj) {\n return obj[this];\n}\nfunction indexedGetter(obj) {\n var index = +this;\n if (index < 0) index = Math.max(0, index + obj.length);\n return obj[index];\n}\nPromise.prototype.get = function (propertyName) {\n var isIndex = (typeof propertyName === \"number\");\n var getter;\n if (!isIndex) {\n if (canEvaluate) {\n var maybeGetter = getGetter(propertyName);\n getter = maybeGetter !== null ? maybeGetter : namedGetter;\n } else {\n getter = namedGetter;\n }\n } else {\n getter = indexedGetter;\n }\n return this._then(getter, undefined, undefined, propertyName, undefined);\n};\n};\n\n},{\"./util\":36}],6:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nPromise.prototype[\"break\"] = Promise.prototype.cancel = function() {\n if (!debug.cancellation()) return this._warn(\"cancellation is disabled\");\n\n var promise = this;\n var child = promise;\n while (promise._isCancellable()) {\n if (!promise._cancelBy(child)) {\n if (child._isFollowing()) {\n child._followee().cancel();\n } else {\n child._cancelBranched();\n }\n break;\n }\n\n var parent = promise._cancellationParent;\n if (parent == null || !parent._isCancellable()) {\n if (promise._isFollowing()) {\n promise._followee().cancel();\n } else {\n promise._cancelBranched();\n }\n break;\n } else {\n if (promise._isFollowing()) promise._followee().cancel();\n promise._setWillBeCancelled();\n child = promise;\n promise = parent;\n }\n }\n};\n\nPromise.prototype._branchHasCancelled = function() {\n this._branchesRemainingToCancel--;\n};\n\nPromise.prototype._enoughBranchesHaveCancelled = function() {\n return this._branchesRemainingToCancel === undefined ||\n this._branchesRemainingToCancel <= 0;\n};\n\nPromise.prototype._cancelBy = function(canceller) {\n if (canceller === this) {\n this._branchesRemainingToCancel = 0;\n this._invokeOnCancel();\n return true;\n } else {\n this._branchHasCancelled();\n if (this._enoughBranchesHaveCancelled()) {\n this._invokeOnCancel();\n return true;\n }\n }\n return false;\n};\n\nPromise.prototype._cancelBranched = function() {\n if (this._enoughBranchesHaveCancelled()) {\n this._cancel();\n }\n};\n\nPromise.prototype._cancel = function() {\n if (!this._isCancellable()) return;\n this._setCancelled();\n async.invoke(this._cancelPromises, this, undefined);\n};\n\nPromise.prototype._cancelPromises = function() {\n if (this._length() > 0) this._settlePromises();\n};\n\nPromise.prototype._unsetOnCancel = function() {\n this._onCancelField = undefined;\n};\n\nPromise.prototype._isCancellable = function() {\n return this.isPending() && !this._isCancelled();\n};\n\nPromise.prototype.isCancellable = function() {\n return this.isPending() && !this.isCancelled();\n};\n\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\n if (util.isArray(onCancelCallback)) {\n for (var i = 0; i < onCancelCallback.length; ++i) {\n this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n }\n } else if (onCancelCallback !== undefined) {\n if (typeof onCancelCallback === \"function\") {\n if (!internalOnly) {\n var e = tryCatch(onCancelCallback).call(this._boundValue());\n if (e === errorObj) {\n this._attachExtraTrace(e.e);\n async.throwLater(e.e);\n }\n }\n } else {\n onCancelCallback._resultCancelled(this);\n }\n }\n};\n\nPromise.prototype._invokeOnCancel = function() {\n var onCancelCallback = this._onCancel();\n this._unsetOnCancel();\n async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n};\n\nPromise.prototype._invokeInternalOnCancel = function() {\n if (this._isCancellable()) {\n this._doInvokeOnCancel(this._onCancel(), true);\n this._unsetOnCancel();\n }\n};\n\nPromise.prototype._resultCancelled = function() {\n this.cancel();\n};\n\n};\n\n},{\"./util\":36}],7:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(NEXT_FILTER) {\nvar util = _dereq_(\"./util\");\nvar getKeys = _dereq_(\"./es5\").keys;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction catchFilter(instances, cb, promise) {\n return function(e) {\n var boundTo = promise._boundValue();\n predicateLoop: for (var i = 0; i < instances.length; ++i) {\n var item = instances[i];\n\n if (item === Error ||\n (item != null && item.prototype instanceof Error)) {\n if (e instanceof item) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (typeof item === \"function\") {\n var matchesPredicate = tryCatch(item).call(boundTo, e);\n if (matchesPredicate === errorObj) {\n return matchesPredicate;\n } else if (matchesPredicate) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (util.isObject(e)) {\n var keys = getKeys(item);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n if (item[key] != e[key]) {\n continue predicateLoop;\n }\n }\n return tryCatch(cb).call(boundTo, e);\n }\n }\n return NEXT_FILTER;\n };\n}\n\nreturn catchFilter;\n};\n\n},{\"./es5\":13,\"./util\":36}],8:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar longStackTraces = false;\nvar contextStack = [];\n\nPromise.prototype._promiseCreated = function() {};\nPromise.prototype._pushContext = function() {};\nPromise.prototype._popContext = function() {return null;};\nPromise._peekContext = Promise.prototype._peekContext = function() {};\n\nfunction Context() {\n this._trace = new Context.CapturedTrace(peekContext());\n}\nContext.prototype._pushContext = function () {\n if (this._trace !== undefined) {\n this._trace._promiseCreated = null;\n contextStack.push(this._trace);\n }\n};\n\nContext.prototype._popContext = function () {\n if (this._trace !== undefined) {\n var trace = contextStack.pop();\n var ret = trace._promiseCreated;\n trace._promiseCreated = null;\n return ret;\n }\n return null;\n};\n\nfunction createContext() {\n if (longStackTraces) return new Context();\n}\n\nfunction peekContext() {\n var lastIndex = contextStack.length - 1;\n if (lastIndex >= 0) {\n return contextStack[lastIndex];\n }\n return undefined;\n}\nContext.CapturedTrace = null;\nContext.create = createContext;\nContext.deactivateLongStackTraces = function() {};\nContext.activateLongStackTraces = function() {\n var Promise_pushContext = Promise.prototype._pushContext;\n var Promise_popContext = Promise.prototype._popContext;\n var Promise_PeekContext = Promise._peekContext;\n var Promise_peekContext = Promise.prototype._peekContext;\n var Promise_promiseCreated = Promise.prototype._promiseCreated;\n Context.deactivateLongStackTraces = function() {\n Promise.prototype._pushContext = Promise_pushContext;\n Promise.prototype._popContext = Promise_popContext;\n Promise._peekContext = Promise_PeekContext;\n Promise.prototype._peekContext = Promise_peekContext;\n Promise.prototype._promiseCreated = Promise_promiseCreated;\n longStackTraces = false;\n };\n longStackTraces = true;\n Promise.prototype._pushContext = Context.prototype._pushContext;\n Promise.prototype._popContext = Context.prototype._popContext;\n Promise._peekContext = Promise.prototype._peekContext = peekContext;\n Promise.prototype._promiseCreated = function() {\n var ctx = this._peekContext();\n if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n };\n};\nreturn Context;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, Context) {\nvar getDomain = Promise._getDomain;\nvar async = Promise._async;\nvar Warning = _dereq_(\"./errors\").Warning;\nvar util = _dereq_(\"./util\");\nvar canAttachTrace = util.canAttachTrace;\nvar unhandledRejectionHandled;\nvar possiblyUnhandledRejection;\nvar bluebirdFramePattern =\n /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\nvar nodeFramePattern = /\\((?:timers\\.js):\\d+:\\d+\\)/;\nvar parseLinePattern = /[\\/<\\(](.+?):(\\d+):(\\d+)\\)?\\s*$/;\nvar stackFramePattern = null;\nvar formatStack = null;\nvar indentStackFrames = false;\nvar printWarning;\nvar debugging = !!(util.env(\"BLUEBIRD_DEBUG\") != 0 &&\n (true ||\n util.env(\"BLUEBIRD_DEBUG\") ||\n util.env(\"NODE_ENV\") === \"development\"));\n\nvar warnings = !!(util.env(\"BLUEBIRD_WARNINGS\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_WARNINGS\")));\n\nvar longStackTraces = !!(util.env(\"BLUEBIRD_LONG_STACK_TRACES\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_LONG_STACK_TRACES\")));\n\nvar wForgottenReturn = util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\") != 0 &&\n (warnings || !!util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\"));\n\nPromise.prototype.suppressUnhandledRejections = function() {\n var target = this._target();\n target._bitField = ((target._bitField & (~1048576)) |\n 524288);\n};\n\nPromise.prototype._ensurePossibleRejectionHandled = function () {\n if ((this._bitField & 524288) !== 0) return;\n this._setRejectionIsUnhandled();\n async.invokeLater(this._notifyUnhandledRejection, this, undefined);\n};\n\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\n fireRejectionEvent(\"rejectionHandled\",\n unhandledRejectionHandled, undefined, this);\n};\n\nPromise.prototype._setReturnedNonUndefined = function() {\n this._bitField = this._bitField | 268435456;\n};\n\nPromise.prototype._returnedNonUndefined = function() {\n return (this._bitField & 268435456) !== 0;\n};\n\nPromise.prototype._notifyUnhandledRejection = function () {\n if (this._isRejectionUnhandled()) {\n var reason = this._settledValue();\n this._setUnhandledRejectionIsNotified();\n fireRejectionEvent(\"unhandledRejection\",\n possiblyUnhandledRejection, reason, this);\n }\n};\n\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField | 262144;\n};\n\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField & (~262144);\n};\n\nPromise.prototype._isUnhandledRejectionNotified = function () {\n return (this._bitField & 262144) > 0;\n};\n\nPromise.prototype._setRejectionIsUnhandled = function () {\n this._bitField = this._bitField | 1048576;\n};\n\nPromise.prototype._unsetRejectionIsUnhandled = function () {\n this._bitField = this._bitField & (~1048576);\n if (this._isUnhandledRejectionNotified()) {\n this._unsetUnhandledRejectionIsNotified();\n this._notifyUnhandledRejectionIsHandled();\n }\n};\n\nPromise.prototype._isRejectionUnhandled = function () {\n return (this._bitField & 1048576) > 0;\n};\n\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\n return warn(message, shouldUseOwnTrace, promise || this);\n};\n\nPromise.onPossiblyUnhandledRejection = function (fn) {\n var domain = getDomain();\n possiblyUnhandledRejection =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nPromise.onUnhandledRejectionHandled = function (fn) {\n var domain = getDomain();\n unhandledRejectionHandled =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nvar disableLongStackTraces = function() {};\nPromise.longStackTraces = function () {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n if (!config.longStackTraces && longStackTracesIsSupported()) {\n var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n config.longStackTraces = true;\n disableLongStackTraces = function() {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n Context.deactivateLongStackTraces();\n async.enableTrampoline();\n config.longStackTraces = false;\n };\n Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n Context.activateLongStackTraces();\n async.disableTrampolineIfNecessary();\n }\n};\n\nPromise.hasLongStackTraces = function () {\n return config.longStackTraces && longStackTracesIsSupported();\n};\n\nvar fireDomEvent = (function() {\n try {\n if (typeof CustomEvent === \"function\") {\n var event = new CustomEvent(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = new CustomEvent(name.toLowerCase(), {\n detail: event,\n cancelable: true\n });\n return !util.global.dispatchEvent(domEvent);\n };\n } else if (typeof Event === \"function\") {\n var event = new Event(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = new Event(name.toLowerCase(), {\n cancelable: true\n });\n domEvent.detail = event;\n return !util.global.dispatchEvent(domEvent);\n };\n } else {\n var event = document.createEvent(\"CustomEvent\");\n event.initCustomEvent(\"testingtheevent\", false, true, {});\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = document.createEvent(\"CustomEvent\");\n domEvent.initCustomEvent(name.toLowerCase(), false, true,\n event);\n return !util.global.dispatchEvent(domEvent);\n };\n }\n } catch (e) {}\n return function() {\n return false;\n };\n})();\n\nvar fireGlobalEvent = (function() {\n if (util.isNode) {\n return function() {\n return process.emit.apply(process, arguments);\n };\n } else {\n if (!util.global) {\n return function() {\n return false;\n };\n }\n return function(name) {\n var methodName = \"on\" + name.toLowerCase();\n var method = util.global[methodName];\n if (!method) return false;\n method.apply(util.global, [].slice.call(arguments, 1));\n return true;\n };\n }\n})();\n\nfunction generatePromiseLifecycleEventObject(name, promise) {\n return {promise: promise};\n}\n\nvar eventToObjectGenerator = {\n promiseCreated: generatePromiseLifecycleEventObject,\n promiseFulfilled: generatePromiseLifecycleEventObject,\n promiseRejected: generatePromiseLifecycleEventObject,\n promiseResolved: generatePromiseLifecycleEventObject,\n promiseCancelled: generatePromiseLifecycleEventObject,\n promiseChained: function(name, promise, child) {\n return {promise: promise, child: child};\n },\n warning: function(name, warning) {\n return {warning: warning};\n },\n unhandledRejection: function (name, reason, promise) {\n return {reason: reason, promise: promise};\n },\n rejectionHandled: generatePromiseLifecycleEventObject\n};\n\nvar activeFireEvent = function (name) {\n var globalEventFired = false;\n try {\n globalEventFired = fireGlobalEvent.apply(null, arguments);\n } catch (e) {\n async.throwLater(e);\n globalEventFired = true;\n }\n\n var domEventFired = false;\n try {\n domEventFired = fireDomEvent(name,\n eventToObjectGenerator[name].apply(null, arguments));\n } catch (e) {\n async.throwLater(e);\n domEventFired = true;\n }\n\n return domEventFired || globalEventFired;\n};\n\nPromise.config = function(opts) {\n opts = Object(opts);\n if (\"longStackTraces\" in opts) {\n if (opts.longStackTraces) {\n Promise.longStackTraces();\n } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n disableLongStackTraces();\n }\n }\n if (\"warnings\" in opts) {\n var warningsOption = opts.warnings;\n config.warnings = !!warningsOption;\n wForgottenReturn = config.warnings;\n\n if (util.isObject(warningsOption)) {\n if (\"wForgottenReturn\" in warningsOption) {\n wForgottenReturn = !!warningsOption.wForgottenReturn;\n }\n }\n }\n if (\"cancellation\" in opts && opts.cancellation && !config.cancellation) {\n if (async.haveItemsQueued()) {\n throw new Error(\n \"cannot enable cancellation after promises are in use\");\n }\n Promise.prototype._clearCancellationData =\n cancellationClearCancellationData;\n Promise.prototype._propagateFrom = cancellationPropagateFrom;\n Promise.prototype._onCancel = cancellationOnCancel;\n Promise.prototype._setOnCancel = cancellationSetOnCancel;\n Promise.prototype._attachCancellationCallback =\n cancellationAttachCancellationCallback;\n Promise.prototype._execute = cancellationExecute;\n propagateFromFunction = cancellationPropagateFrom;\n config.cancellation = true;\n }\n if (\"monitoring\" in opts) {\n if (opts.monitoring && !config.monitoring) {\n config.monitoring = true;\n Promise.prototype._fireEvent = activeFireEvent;\n } else if (!opts.monitoring && config.monitoring) {\n config.monitoring = false;\n Promise.prototype._fireEvent = defaultFireEvent;\n }\n }\n return Promise;\n};\n\nfunction defaultFireEvent() { return false; }\n\nPromise.prototype._fireEvent = defaultFireEvent;\nPromise.prototype._execute = function(executor, resolve, reject) {\n try {\n executor(resolve, reject);\n } catch (e) {\n return e;\n }\n};\nPromise.prototype._onCancel = function () {};\nPromise.prototype._setOnCancel = function (handler) { ; };\nPromise.prototype._attachCancellationCallback = function(onCancel) {\n ;\n};\nPromise.prototype._captureStackTrace = function () {};\nPromise.prototype._attachExtraTrace = function () {};\nPromise.prototype._clearCancellationData = function() {};\nPromise.prototype._propagateFrom = function (parent, flags) {\n ;\n ;\n};\n\nfunction cancellationExecute(executor, resolve, reject) {\n var promise = this;\n try {\n executor(resolve, reject, function(onCancel) {\n if (typeof onCancel !== \"function\") {\n throw new TypeError(\"onCancel must be a function, got: \" +\n util.toString(onCancel));\n }\n promise._attachCancellationCallback(onCancel);\n });\n } catch (e) {\n return e;\n }\n}\n\nfunction cancellationAttachCancellationCallback(onCancel) {\n if (!this._isCancellable()) return this;\n\n var previousOnCancel = this._onCancel();\n if (previousOnCancel !== undefined) {\n if (util.isArray(previousOnCancel)) {\n previousOnCancel.push(onCancel);\n } else {\n this._setOnCancel([previousOnCancel, onCancel]);\n }\n } else {\n this._setOnCancel(onCancel);\n }\n}\n\nfunction cancellationOnCancel() {\n return this._onCancelField;\n}\n\nfunction cancellationSetOnCancel(onCancel) {\n this._onCancelField = onCancel;\n}\n\nfunction cancellationClearCancellationData() {\n this._cancellationParent = undefined;\n this._onCancelField = undefined;\n}\n\nfunction cancellationPropagateFrom(parent, flags) {\n if ((flags & 1) !== 0) {\n this._cancellationParent = parent;\n var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n if (branchesRemainingToCancel === undefined) {\n branchesRemainingToCancel = 0;\n }\n parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n }\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\n\nfunction bindingPropagateFrom(parent, flags) {\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\nvar propagateFromFunction = bindingPropagateFrom;\n\nfunction boundValueFunction() {\n var ret = this._boundTo;\n if (ret !== undefined) {\n if (ret instanceof Promise) {\n if (ret.isFulfilled()) {\n return ret.value();\n } else {\n return undefined;\n }\n }\n }\n return ret;\n}\n\nfunction longStackTracesCaptureStackTrace() {\n this._trace = new CapturedTrace(this._peekContext());\n}\n\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\n if (canAttachTrace(error)) {\n var trace = this._trace;\n if (trace !== undefined) {\n if (ignoreSelf) trace = trace._parent;\n }\n if (trace !== undefined) {\n trace.attachExtraTrace(error);\n } else if (!error.__stackCleaned__) {\n var parsed = parseStackAndMessage(error);\n util.notEnumerableProp(error, \"stack\",\n parsed.message + \"\\n\" + parsed.stack.join(\"\\n\"));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n }\n }\n}\n\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\n parent) {\n if (returnValue === undefined && promiseCreated !== null &&\n wForgottenReturn) {\n if (parent !== undefined && parent._returnedNonUndefined()) return;\n if ((promise._bitField & 65535) === 0) return;\n\n if (name) name = name + \" \";\n var handlerLine = \"\";\n var creatorLine = \"\";\n if (promiseCreated._trace) {\n var traceLines = promiseCreated._trace.stack.split(\"\\n\");\n var stack = cleanStack(traceLines);\n for (var i = stack.length - 1; i >= 0; --i) {\n var line = stack[i];\n if (!nodeFramePattern.test(line)) {\n var lineMatches = line.match(parseLinePattern);\n if (lineMatches) {\n handlerLine = \"at \" + lineMatches[1] +\n \":\" + lineMatches[2] + \":\" + lineMatches[3] + \" \";\n }\n break;\n }\n }\n\n if (stack.length > 0) {\n var firstUserLine = stack[0];\n for (var i = 0; i < traceLines.length; ++i) {\n\n if (traceLines[i] === firstUserLine) {\n if (i > 0) {\n creatorLine = \"\\n\" + traceLines[i - 1];\n }\n break;\n }\n }\n\n }\n }\n var msg = \"a promise was created in a \" + name +\n \"handler \" + handlerLine + \"but was not returned from it, \" +\n \"see http://goo.gl/rRqMUw\" +\n creatorLine;\n promise._warn(msg, true, promiseCreated);\n }\n}\n\nfunction deprecated(name, replacement) {\n var message = name +\n \" is deprecated and will be removed in a future version.\";\n if (replacement) message += \" Use \" + replacement + \" instead.\";\n return warn(message);\n}\n\nfunction warn(message, shouldUseOwnTrace, promise) {\n if (!config.warnings) return;\n var warning = new Warning(message);\n var ctx;\n if (shouldUseOwnTrace) {\n promise._attachExtraTrace(warning);\n } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n ctx.attachExtraTrace(warning);\n } else {\n var parsed = parseStackAndMessage(warning);\n warning.stack = parsed.message + \"\\n\" + parsed.stack.join(\"\\n\");\n }\n\n if (!activeFireEvent(\"warning\", warning)) {\n formatAndLogError(warning, \"\", true);\n }\n}\n\nfunction reconstructStack(message, stacks) {\n for (var i = 0; i < stacks.length - 1; ++i) {\n stacks[i].push(\"From previous event:\");\n stacks[i] = stacks[i].join(\"\\n\");\n }\n if (i < stacks.length) {\n stacks[i] = stacks[i].join(\"\\n\");\n }\n return message + \"\\n\" + stacks.join(\"\\n\");\n}\n\nfunction removeDuplicateOrEmptyJumps(stacks) {\n for (var i = 0; i < stacks.length; ++i) {\n if (stacks[i].length === 0 ||\n ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\n stacks.splice(i, 1);\n i--;\n }\n }\n}\n\nfunction removeCommonRoots(stacks) {\n var current = stacks[0];\n for (var i = 1; i < stacks.length; ++i) {\n var prev = stacks[i];\n var currentLastIndex = current.length - 1;\n var currentLastLine = current[currentLastIndex];\n var commonRootMeetPoint = -1;\n\n for (var j = prev.length - 1; j >= 0; --j) {\n if (prev[j] === currentLastLine) {\n commonRootMeetPoint = j;\n break;\n }\n }\n\n for (var j = commonRootMeetPoint; j >= 0; --j) {\n var line = prev[j];\n if (current[currentLastIndex] === line) {\n current.pop();\n currentLastIndex--;\n } else {\n break;\n }\n }\n current = prev;\n }\n}\n\nfunction cleanStack(stack) {\n var ret = [];\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n var isTraceLine = \" (No stack trace)\" === line ||\n stackFramePattern.test(line);\n var isInternalFrame = isTraceLine && shouldIgnore(line);\n if (isTraceLine && !isInternalFrame) {\n if (indentStackFrames && line.charAt(0) !== \" \") {\n line = \" \" + line;\n }\n ret.push(line);\n }\n }\n return ret;\n}\n\nfunction stackFramesAsArray(error) {\n var stack = error.stack.replace(/\\s+$/g, \"\").split(\"\\n\");\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n if (\" (No stack trace)\" === line || stackFramePattern.test(line)) {\n break;\n }\n }\n if (i > 0 && error.name != \"SyntaxError\") {\n stack = stack.slice(i);\n }\n return stack;\n}\n\nfunction parseStackAndMessage(error) {\n var stack = error.stack;\n var message = error.toString();\n stack = typeof stack === \"string\" && stack.length > 0\n ? stackFramesAsArray(error) : [\" (No stack trace)\"];\n return {\n message: message,\n stack: error.name == \"SyntaxError\" ? stack : cleanStack(stack)\n };\n}\n\nfunction formatAndLogError(error, title, isSoft) {\n if (typeof console !== \"undefined\") {\n var message;\n if (util.isObject(error)) {\n var stack = error.stack;\n message = title + formatStack(stack, error);\n } else {\n message = title + String(error);\n }\n if (typeof printWarning === \"function\") {\n printWarning(message, isSoft);\n } else if (typeof console.log === \"function\" ||\n typeof console.log === \"object\") {\n console.log(message);\n }\n }\n}\n\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\n var localEventFired = false;\n try {\n if (typeof localHandler === \"function\") {\n localEventFired = true;\n if (name === \"rejectionHandled\") {\n localHandler(promise);\n } else {\n localHandler(reason, promise);\n }\n }\n } catch (e) {\n async.throwLater(e);\n }\n\n if (name === \"unhandledRejection\") {\n if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n formatAndLogError(reason, \"Unhandled rejection \");\n }\n } else {\n activeFireEvent(name, promise);\n }\n}\n\nfunction formatNonError(obj) {\n var str;\n if (typeof obj === \"function\") {\n str = \"[function \" +\n (obj.name || \"anonymous\") +\n \"]\";\n } else {\n str = obj && typeof obj.toString === \"function\"\n ? obj.toString() : util.toString(obj);\n var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n if (ruselessToString.test(str)) {\n try {\n var newStr = JSON.stringify(obj);\n str = newStr;\n }\n catch(e) {\n\n }\n }\n if (str.length === 0) {\n str = \"(empty array)\";\n }\n }\n return (\"(<\" + snip(str) + \">, no stack trace)\");\n}\n\nfunction snip(str) {\n var maxChars = 41;\n if (str.length < maxChars) {\n return str;\n }\n return str.substr(0, maxChars - 3) + \"...\";\n}\n\nfunction longStackTracesIsSupported() {\n return typeof captureStackTrace === \"function\";\n}\n\nvar shouldIgnore = function() { return false; };\nvar parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\nfunction parseLineInfo(line) {\n var matches = line.match(parseLineInfoRegex);\n if (matches) {\n return {\n fileName: matches[1],\n line: parseInt(matches[2], 10)\n };\n }\n}\n\nfunction setBounds(firstLineError, lastLineError) {\n if (!longStackTracesIsSupported()) return;\n var firstStackLines = firstLineError.stack.split(\"\\n\");\n var lastStackLines = lastLineError.stack.split(\"\\n\");\n var firstIndex = -1;\n var lastIndex = -1;\n var firstFileName;\n var lastFileName;\n for (var i = 0; i < firstStackLines.length; ++i) {\n var result = parseLineInfo(firstStackLines[i]);\n if (result) {\n firstFileName = result.fileName;\n firstIndex = result.line;\n break;\n }\n }\n for (var i = 0; i < lastStackLines.length; ++i) {\n var result = parseLineInfo(lastStackLines[i]);\n if (result) {\n lastFileName = result.fileName;\n lastIndex = result.line;\n break;\n }\n }\n if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\n firstFileName !== lastFileName || firstIndex >= lastIndex) {\n return;\n }\n\n shouldIgnore = function(line) {\n if (bluebirdFramePattern.test(line)) return true;\n var info = parseLineInfo(line);\n if (info) {\n if (info.fileName === firstFileName &&\n (firstIndex <= info.line && info.line <= lastIndex)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction CapturedTrace(parent) {\n this._parent = parent;\n this._promisesCreated = 0;\n var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n captureStackTrace(this, CapturedTrace);\n if (length > 32) this.uncycle();\n}\nutil.inherits(CapturedTrace, Error);\nContext.CapturedTrace = CapturedTrace;\n\nCapturedTrace.prototype.uncycle = function() {\n var length = this._length;\n if (length < 2) return;\n var nodes = [];\n var stackToIndex = {};\n\n for (var i = 0, node = this; node !== undefined; ++i) {\n nodes.push(node);\n node = node._parent;\n }\n length = this._length = i;\n for (var i = length - 1; i >= 0; --i) {\n var stack = nodes[i].stack;\n if (stackToIndex[stack] === undefined) {\n stackToIndex[stack] = i;\n }\n }\n for (var i = 0; i < length; ++i) {\n var currentStack = nodes[i].stack;\n var index = stackToIndex[currentStack];\n if (index !== undefined && index !== i) {\n if (index > 0) {\n nodes[index - 1]._parent = undefined;\n nodes[index - 1]._length = 1;\n }\n nodes[i]._parent = undefined;\n nodes[i]._length = 1;\n var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n\n if (index < length - 1) {\n cycleEdgeNode._parent = nodes[index + 1];\n cycleEdgeNode._parent.uncycle();\n cycleEdgeNode._length =\n cycleEdgeNode._parent._length + 1;\n } else {\n cycleEdgeNode._parent = undefined;\n cycleEdgeNode._length = 1;\n }\n var currentChildLength = cycleEdgeNode._length + 1;\n for (var j = i - 2; j >= 0; --j) {\n nodes[j]._length = currentChildLength;\n currentChildLength++;\n }\n return;\n }\n }\n};\n\nCapturedTrace.prototype.attachExtraTrace = function(error) {\n if (error.__stackCleaned__) return;\n this.uncycle();\n var parsed = parseStackAndMessage(error);\n var message = parsed.message;\n var stacks = [parsed.stack];\n\n var trace = this;\n while (trace !== undefined) {\n stacks.push(cleanStack(trace.stack.split(\"\\n\")));\n trace = trace._parent;\n }\n removeCommonRoots(stacks);\n removeDuplicateOrEmptyJumps(stacks);\n util.notEnumerableProp(error, \"stack\", reconstructStack(message, stacks));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n};\n\nvar captureStackTrace = (function stackDetection() {\n var v8stackFramePattern = /^\\s*at\\s*/;\n var v8stackFormatter = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if (error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n if (typeof Error.stackTraceLimit === \"number\" &&\n typeof Error.captureStackTrace === \"function\") {\n Error.stackTraceLimit += 6;\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n var captureStackTrace = Error.captureStackTrace;\n\n shouldIgnore = function(line) {\n return bluebirdFramePattern.test(line);\n };\n return function(receiver, ignoreUntil) {\n Error.stackTraceLimit += 6;\n captureStackTrace(receiver, ignoreUntil);\n Error.stackTraceLimit -= 6;\n };\n }\n var err = new Error();\n\n if (typeof err.stack === \"string\" &&\n err.stack.split(\"\\n\")[0].indexOf(\"stackDetection@\") >= 0) {\n stackFramePattern = /@/;\n formatStack = v8stackFormatter;\n indentStackFrames = true;\n return function captureStackTrace(o) {\n o.stack = new Error().stack;\n };\n }\n\n var hasStackAfterThrow;\n try { throw new Error(); }\n catch(e) {\n hasStackAfterThrow = (\"stack\" in e);\n }\n if (!(\"stack\" in err) && hasStackAfterThrow &&\n typeof Error.stackTraceLimit === \"number\") {\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n return function captureStackTrace(o) {\n Error.stackTraceLimit += 6;\n try { throw new Error(); }\n catch(e) { o.stack = e.stack; }\n Error.stackTraceLimit -= 6;\n };\n }\n\n formatStack = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if ((typeof error === \"object\" ||\n typeof error === \"function\") &&\n error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n return null;\n\n})([]);\n\nif (typeof console !== \"undefined\" && typeof console.warn !== \"undefined\") {\n printWarning = function (message) {\n console.warn(message);\n };\n if (util.isNode && process.stderr.isTTY) {\n printWarning = function(message, isSoft) {\n var color = isSoft ? \"\\u001b[33m\" : \"\\u001b[31m\";\n console.warn(color + message + \"\\u001b[0m\\n\");\n };\n } else if (!util.isNode && typeof (new Error().stack) === \"string\") {\n printWarning = function(message, isSoft) {\n console.warn(\"%c\" + message,\n isSoft ? \"color: darkorange\" : \"color: red\");\n };\n }\n}\n\nvar config = {\n warnings: warnings,\n longStackTraces: false,\n cancellation: false,\n monitoring: false\n};\n\nif (longStackTraces) Promise.longStackTraces();\n\nreturn {\n longStackTraces: function() {\n return config.longStackTraces;\n },\n warnings: function() {\n return config.warnings;\n },\n cancellation: function() {\n return config.cancellation;\n },\n monitoring: function() {\n return config.monitoring;\n },\n propagateFromFunction: function() {\n return propagateFromFunction;\n },\n boundValueFunction: function() {\n return boundValueFunction;\n },\n checkForgottenReturns: checkForgottenReturns,\n setBounds: setBounds,\n warn: warn,\n deprecated: deprecated,\n CapturedTrace: CapturedTrace,\n fireDomEvent: fireDomEvent,\n fireGlobalEvent: fireGlobalEvent\n};\n};\n\n},{\"./errors\":12,\"./util\":36}],10:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction returner() {\n return this.value;\n}\nfunction thrower() {\n throw this.reason;\n}\n\nPromise.prototype[\"return\"] =\nPromise.prototype.thenReturn = function (value) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n returner, undefined, undefined, {value: value}, undefined);\n};\n\nPromise.prototype[\"throw\"] =\nPromise.prototype.thenThrow = function (reason) {\n return this._then(\n thrower, undefined, undefined, {reason: reason}, undefined);\n};\n\nPromise.prototype.catchThrow = function (reason) {\n if (arguments.length <= 1) {\n return this._then(\n undefined, thrower, undefined, {reason: reason}, undefined);\n } else {\n var _reason = arguments[1];\n var handler = function() {throw _reason;};\n return this.caught(reason, handler);\n }\n};\n\nPromise.prototype.catchReturn = function (value) {\n if (arguments.length <= 1) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n undefined, returner, undefined, {value: value}, undefined);\n } else {\n var _value = arguments[1];\n if (_value instanceof Promise) _value.suppressUnhandledRejections();\n var handler = function() {return _value;};\n return this.caught(value, handler);\n }\n};\n};\n\n},{}],11:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseReduce = Promise.reduce;\nvar PromiseAll = Promise.all;\n\nfunction promiseAllThis() {\n return PromiseAll(this);\n}\n\nfunction PromiseMapSeries(promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\n}\n\nPromise.prototype.each = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, this, undefined);\n};\n\nPromise.prototype.mapSeries = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, INTERNAL);\n};\n\nPromise.each = function (promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, promises, undefined);\n};\n\nPromise.mapSeries = PromiseMapSeries;\n};\n\n\n},{}],12:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar Objectfreeze = es5.freeze;\nvar util = _dereq_(\"./util\");\nvar inherits = util.inherits;\nvar notEnumerableProp = util.notEnumerableProp;\n\nfunction subError(nameProperty, defaultMessage) {\n function SubError(message) {\n if (!(this instanceof SubError)) return new SubError(message);\n notEnumerableProp(this, \"message\",\n typeof message === \"string\" ? message : defaultMessage);\n notEnumerableProp(this, \"name\", nameProperty);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n Error.call(this);\n }\n }\n inherits(SubError, Error);\n return SubError;\n}\n\nvar _TypeError, _RangeError;\nvar Warning = subError(\"Warning\", \"warning\");\nvar CancellationError = subError(\"CancellationError\", \"cancellation error\");\nvar TimeoutError = subError(\"TimeoutError\", \"timeout error\");\nvar AggregateError = subError(\"AggregateError\", \"aggregate error\");\ntry {\n _TypeError = TypeError;\n _RangeError = RangeError;\n} catch(e) {\n _TypeError = subError(\"TypeError\", \"type error\");\n _RangeError = subError(\"RangeError\", \"range error\");\n}\n\nvar methods = (\"join pop push shift unshift slice filter forEach some \" +\n \"every map indexOf lastIndexOf reduce reduceRight sort reverse\").split(\" \");\n\nfor (var i = 0; i < methods.length; ++i) {\n if (typeof Array.prototype[methods[i]] === \"function\") {\n AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n }\n}\n\nes5.defineProperty(AggregateError.prototype, \"length\", {\n value: 0,\n configurable: false,\n writable: true,\n enumerable: true\n});\nAggregateError.prototype[\"isOperational\"] = true;\nvar level = 0;\nAggregateError.prototype.toString = function() {\n var indent = Array(level * 4 + 1).join(\" \");\n var ret = \"\\n\" + indent + \"AggregateError of:\" + \"\\n\";\n level++;\n indent = Array(level * 4 + 1).join(\" \");\n for (var i = 0; i < this.length; ++i) {\n var str = this[i] === this ? \"[Circular AggregateError]\" : this[i] + \"\";\n var lines = str.split(\"\\n\");\n for (var j = 0; j < lines.length; ++j) {\n lines[j] = indent + lines[j];\n }\n str = lines.join(\"\\n\");\n ret += str + \"\\n\";\n }\n level--;\n return ret;\n};\n\nfunction OperationalError(message) {\n if (!(this instanceof OperationalError))\n return new OperationalError(message);\n notEnumerableProp(this, \"name\", \"OperationalError\");\n notEnumerableProp(this, \"message\", message);\n this.cause = message;\n this[\"isOperational\"] = true;\n\n if (message instanceof Error) {\n notEnumerableProp(this, \"message\", message.message);\n notEnumerableProp(this, \"stack\", message.stack);\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n}\ninherits(OperationalError, Error);\n\nvar errorTypes = Error[\"__BluebirdErrorTypes__\"];\nif (!errorTypes) {\n errorTypes = Objectfreeze({\n CancellationError: CancellationError,\n TimeoutError: TimeoutError,\n OperationalError: OperationalError,\n RejectionError: OperationalError,\n AggregateError: AggregateError\n });\n es5.defineProperty(Error, \"__BluebirdErrorTypes__\", {\n value: errorTypes,\n writable: false,\n enumerable: false,\n configurable: false\n });\n}\n\nmodule.exports = {\n Error: Error,\n TypeError: _TypeError,\n RangeError: _RangeError,\n CancellationError: errorTypes.CancellationError,\n OperationalError: errorTypes.OperationalError,\n TimeoutError: errorTypes.TimeoutError,\n AggregateError: errorTypes.AggregateError,\n Warning: Warning\n};\n\n},{\"./es5\":13,\"./util\":36}],13:[function(_dereq_,module,exports){\nvar isES5 = (function(){\n \"use strict\";\n return this === undefined;\n})();\n\nif (isES5) {\n module.exports = {\n freeze: Object.freeze,\n defineProperty: Object.defineProperty,\n getDescriptor: Object.getOwnPropertyDescriptor,\n keys: Object.keys,\n names: Object.getOwnPropertyNames,\n getPrototypeOf: Object.getPrototypeOf,\n isArray: Array.isArray,\n isES5: isES5,\n propertyIsWritable: function(obj, prop) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n return !!(!descriptor || descriptor.writable || descriptor.set);\n }\n };\n} else {\n var has = {}.hasOwnProperty;\n var str = {}.toString;\n var proto = {}.constructor.prototype;\n\n var ObjectKeys = function (o) {\n var ret = [];\n for (var key in o) {\n if (has.call(o, key)) {\n ret.push(key);\n }\n }\n return ret;\n };\n\n var ObjectGetDescriptor = function(o, key) {\n return {value: o[key]};\n };\n\n var ObjectDefineProperty = function (o, key, desc) {\n o[key] = desc.value;\n return o;\n };\n\n var ObjectFreeze = function (obj) {\n return obj;\n };\n\n var ObjectGetPrototypeOf = function (obj) {\n try {\n return Object(obj).constructor.prototype;\n }\n catch (e) {\n return proto;\n }\n };\n\n var ArrayIsArray = function (obj) {\n try {\n return str.call(obj) === \"[object Array]\";\n }\n catch(e) {\n return false;\n }\n };\n\n module.exports = {\n isArray: ArrayIsArray,\n keys: ObjectKeys,\n names: ObjectKeys,\n defineProperty: ObjectDefineProperty,\n getDescriptor: ObjectGetDescriptor,\n freeze: ObjectFreeze,\n getPrototypeOf: ObjectGetPrototypeOf,\n isES5: isES5,\n propertyIsWritable: function() {\n return true;\n }\n };\n}\n\n},{}],14:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseMap = Promise.map;\n\nPromise.prototype.filter = function (fn, options) {\n return PromiseMap(this, fn, options, INTERNAL);\n};\n\nPromise.filter = function (promises, fn, options) {\n return PromiseMap(promises, fn, options, INTERNAL);\n};\n};\n\n},{}],15:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, tryConvertToPromise) {\nvar util = _dereq_(\"./util\");\nvar CancellationError = Promise.CancellationError;\nvar errorObj = util.errorObj;\n\nfunction PassThroughHandlerContext(promise, type, handler) {\n this.promise = promise;\n this.type = type;\n this.handler = handler;\n this.called = false;\n this.cancelPromise = null;\n}\n\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\n return this.type === 0;\n};\n\nfunction FinallyHandlerCancelReaction(finallyHandler) {\n this.finallyHandler = finallyHandler;\n}\n\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\n checkCancel(this.finallyHandler);\n};\n\nfunction checkCancel(ctx, reason) {\n if (ctx.cancelPromise != null) {\n if (arguments.length > 1) {\n ctx.cancelPromise._reject(reason);\n } else {\n ctx.cancelPromise._cancel();\n }\n ctx.cancelPromise = null;\n return true;\n }\n return false;\n}\n\nfunction succeed() {\n return finallyHandler.call(this, this.promise._target()._settledValue());\n}\nfunction fail(reason) {\n if (checkCancel(this, reason)) return;\n errorObj.e = reason;\n return errorObj;\n}\nfunction finallyHandler(reasonOrValue) {\n var promise = this.promise;\n var handler = this.handler;\n\n if (!this.called) {\n this.called = true;\n var ret = this.isFinallyHandler()\n ? handler.call(promise._boundValue())\n : handler.call(promise._boundValue(), reasonOrValue);\n if (ret !== undefined) {\n promise._setReturnedNonUndefined();\n var maybePromise = tryConvertToPromise(ret, promise);\n if (maybePromise instanceof Promise) {\n if (this.cancelPromise != null) {\n if (maybePromise._isCancelled()) {\n var reason =\n new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n errorObj.e = reason;\n return errorObj;\n } else if (maybePromise.isPending()) {\n maybePromise._attachCancellationCallback(\n new FinallyHandlerCancelReaction(this));\n }\n }\n return maybePromise._then(\n succeed, fail, undefined, this, undefined);\n }\n }\n }\n\n if (promise.isRejected()) {\n checkCancel(this);\n errorObj.e = reasonOrValue;\n return errorObj;\n } else {\n checkCancel(this);\n return reasonOrValue;\n }\n}\n\nPromise.prototype._passThrough = function(handler, type, success, fail) {\n if (typeof handler !== \"function\") return this.then();\n return this._then(success,\n fail,\n undefined,\n new PassThroughHandlerContext(this, type, handler),\n undefined);\n};\n\nPromise.prototype.lastly =\nPromise.prototype[\"finally\"] = function (handler) {\n return this._passThrough(handler,\n 0,\n finallyHandler,\n finallyHandler);\n};\n\nPromise.prototype.tap = function (handler) {\n return this._passThrough(handler, 1, finallyHandler);\n};\n\nreturn PassThroughHandlerContext;\n};\n\n},{\"./util\":36}],16:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n apiRejection,\n INTERNAL,\n tryConvertToPromise,\n Proxyable,\n debug) {\nvar errors = _dereq_(\"./errors\");\nvar TypeError = errors.TypeError;\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nvar yieldHandlers = [];\n\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\n for (var i = 0; i < yieldHandlers.length; ++i) {\n traceParent._pushContext();\n var result = tryCatch(yieldHandlers[i])(value);\n traceParent._popContext();\n if (result === errorObj) {\n traceParent._pushContext();\n var ret = Promise.reject(errorObj.e);\n traceParent._popContext();\n return ret;\n }\n var maybePromise = tryConvertToPromise(result, traceParent);\n if (maybePromise instanceof Promise) return maybePromise;\n }\n return null;\n}\n\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\n if (debug.cancellation()) {\n var internal = new Promise(INTERNAL);\n var _finallyPromise = this._finallyPromise = new Promise(INTERNAL);\n this._promise = internal.lastly(function() {\n return _finallyPromise;\n });\n internal._captureStackTrace();\n internal._setOnCancel(this);\n } else {\n var promise = this._promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n }\n this._stack = stack;\n this._generatorFunction = generatorFunction;\n this._receiver = receiver;\n this._generator = undefined;\n this._yieldHandlers = typeof yieldHandler === \"function\"\n ? [yieldHandler].concat(yieldHandlers)\n : yieldHandlers;\n this._yieldedPromise = null;\n this._cancellationPhase = false;\n}\nutil.inherits(PromiseSpawn, Proxyable);\n\nPromiseSpawn.prototype._isResolved = function() {\n return this._promise === null;\n};\n\nPromiseSpawn.prototype._cleanup = function() {\n this._promise = this._generator = null;\n if (debug.cancellation() && this._finallyPromise !== null) {\n this._finallyPromise._fulfill();\n this._finallyPromise = null;\n }\n};\n\nPromiseSpawn.prototype._promiseCancelled = function() {\n if (this._isResolved()) return;\n var implementsReturn = typeof this._generator[\"return\"] !== \"undefined\";\n\n var result;\n if (!implementsReturn) {\n var reason = new Promise.CancellationError(\n \"generator .return() sentinel\");\n Promise.coroutine.returnSentinel = reason;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n result = tryCatch(this._generator[\"throw\"]).call(this._generator,\n reason);\n this._promise._popContext();\n } else {\n this._promise._pushContext();\n result = tryCatch(this._generator[\"return\"]).call(this._generator,\n undefined);\n this._promise._popContext();\n }\n this._cancellationPhase = true;\n this._yieldedPromise = null;\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\n this._yieldedPromise = null;\n this._promise._pushContext();\n var result = tryCatch(this._generator.next).call(this._generator, value);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseRejected = function(reason) {\n this._yieldedPromise = null;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n var result = tryCatch(this._generator[\"throw\"])\n .call(this._generator, reason);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._resultCancelled = function() {\n if (this._yieldedPromise instanceof Promise) {\n var promise = this._yieldedPromise;\n this._yieldedPromise = null;\n promise.cancel();\n }\n};\n\nPromiseSpawn.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseSpawn.prototype._run = function () {\n this._generator = this._generatorFunction.call(this._receiver);\n this._receiver =\n this._generatorFunction = undefined;\n this._promiseFulfilled(undefined);\n};\n\nPromiseSpawn.prototype._continue = function (result) {\n var promise = this._promise;\n if (result === errorObj) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._rejectCallback(result.e, false);\n }\n }\n\n var value = result.value;\n if (result.done === true) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._resolveCallback(value);\n }\n } else {\n var maybePromise = tryConvertToPromise(value, this._promise);\n if (!(maybePromise instanceof Promise)) {\n maybePromise =\n promiseFromYieldHandler(maybePromise,\n this._yieldHandlers,\n this._promise);\n if (maybePromise === null) {\n this._promiseRejected(\n new TypeError(\n \"A value %s was yielded that could not be treated as a promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\\u000a\".replace(\"%s\", value) +\n \"From coroutine:\\u000a\" +\n this._stack.split(\"\\n\").slice(1, -7).join(\"\\n\")\n )\n );\n return;\n }\n }\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n this._yieldedPromise = maybePromise;\n maybePromise._proxy(this, null);\n } else if (((bitField & 33554432) !== 0)) {\n Promise._async.invoke(\n this._promiseFulfilled, this, maybePromise._value()\n );\n } else if (((bitField & 16777216) !== 0)) {\n Promise._async.invoke(\n this._promiseRejected, this, maybePromise._reason()\n );\n } else {\n this._promiseCancelled();\n }\n }\n};\n\nPromise.coroutine = function (generatorFunction, options) {\n if (typeof generatorFunction !== \"function\") {\n throw new TypeError(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var yieldHandler = Object(options).yieldHandler;\n var PromiseSpawn$ = PromiseSpawn;\n var stack = new Error().stack;\n return function () {\n var generator = generatorFunction.apply(this, arguments);\n var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\n stack);\n var ret = spawn.promise();\n spawn._generator = generator;\n spawn._promiseFulfilled(undefined);\n return ret;\n };\n};\n\nPromise.coroutine.addYieldHandler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n yieldHandlers.push(fn);\n};\n\nPromise.spawn = function (generatorFunction) {\n debug.deprecated(\"Promise.spawn()\", \"Promise.coroutine()\");\n if (typeof generatorFunction !== \"function\") {\n return apiRejection(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var spawn = new PromiseSpawn(generatorFunction, this);\n var ret = spawn.promise();\n spawn._run(Promise.spawn);\n return ret;\n};\n};\n\n},{\"./errors\":12,\"./util\":36}],17:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async,\n getDomain) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar reject;\n\nif (!true) {\nif (canEvaluate) {\n var thenCallback = function(i) {\n return new Function(\"value\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = value; \\n\\\n holder.checkFulfillment(this); \\n\\\n \".replace(/Index/g, i));\n };\n\n var promiseSetter = function(i) {\n return new Function(\"promise\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = promise; \\n\\\n \".replace(/Index/g, i));\n };\n\n var generateHolderClass = function(total) {\n var props = new Array(total);\n for (var i = 0; i < props.length; ++i) {\n props[i] = \"this.p\" + (i+1);\n }\n var assignment = props.join(\" = \") + \" = null;\";\n var cancellationCode= \"var promise;\\n\" + props.map(function(prop) {\n return \" \\n\\\n promise = \" + prop + \"; \\n\\\n if (promise instanceof Promise) { \\n\\\n promise.cancel(); \\n\\\n } \\n\\\n \";\n }).join(\"\\n\");\n var passedArguments = props.join(\", \");\n var name = \"Holder$\" + total;\n\n\n var code = \"return function(tryCatch, errorObj, Promise, async) { \\n\\\n 'use strict'; \\n\\\n function [TheName](fn) { \\n\\\n [TheProperties] \\n\\\n this.fn = fn; \\n\\\n this.asyncNeeded = true; \\n\\\n this.now = 0; \\n\\\n } \\n\\\n \\n\\\n [TheName].prototype._callFunction = function(promise) { \\n\\\n promise._pushContext(); \\n\\\n var ret = tryCatch(this.fn)([ThePassedArguments]); \\n\\\n promise._popContext(); \\n\\\n if (ret === errorObj) { \\n\\\n promise._rejectCallback(ret.e, false); \\n\\\n } else { \\n\\\n promise._resolveCallback(ret); \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype.checkFulfillment = function(promise) { \\n\\\n var now = ++this.now; \\n\\\n if (now === [TheTotal]) { \\n\\\n if (this.asyncNeeded) { \\n\\\n async.invoke(this._callFunction, this, promise); \\n\\\n } else { \\n\\\n this._callFunction(promise); \\n\\\n } \\n\\\n \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype._resultCancelled = function() { \\n\\\n [CancellationCode] \\n\\\n }; \\n\\\n \\n\\\n return [TheName]; \\n\\\n }(tryCatch, errorObj, Promise, async); \\n\\\n \";\n\n code = code.replace(/\\[TheName\\]/g, name)\n .replace(/\\[TheTotal\\]/g, total)\n .replace(/\\[ThePassedArguments\\]/g, passedArguments)\n .replace(/\\[TheProperties\\]/g, assignment)\n .replace(/\\[CancellationCode\\]/g, cancellationCode);\n\n return new Function(\"tryCatch\", \"errorObj\", \"Promise\", \"async\", code)\n (tryCatch, errorObj, Promise, async);\n };\n\n var holderClasses = [];\n var thenCallbacks = [];\n var promiseSetters = [];\n\n for (var i = 0; i < 8; ++i) {\n holderClasses.push(generateHolderClass(i + 1));\n thenCallbacks.push(thenCallback(i + 1));\n promiseSetters.push(promiseSetter(i + 1));\n }\n\n reject = function (reason) {\n this._reject(reason);\n };\n}}\n\nPromise.join = function () {\n var last = arguments.length - 1;\n var fn;\n if (last > 0 && typeof arguments[last] === \"function\") {\n fn = arguments[last];\n if (!true) {\n if (last <= 8 && canEvaluate) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var HolderClass = holderClasses[last - 1];\n var holder = new HolderClass(fn);\n var callbacks = thenCallbacks;\n\n for (var i = 0; i < last; ++i) {\n var maybePromise = tryConvertToPromise(arguments[i], ret);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n maybePromise._then(callbacks[i], reject,\n undefined, ret, holder);\n promiseSetters[i](maybePromise, holder);\n holder.asyncNeeded = false;\n } else if (((bitField & 33554432) !== 0)) {\n callbacks[i].call(ret,\n maybePromise._value(), holder);\n } else if (((bitField & 16777216) !== 0)) {\n ret._reject(maybePromise._reason());\n } else {\n ret._cancel();\n }\n } else {\n callbacks[i].call(ret, maybePromise, holder);\n }\n }\n\n if (!ret._isFateSealed()) {\n if (holder.asyncNeeded) {\n var domain = getDomain();\n if (domain !== null) {\n holder.fn = util.domainBind(domain, holder.fn);\n }\n }\n ret._setAsyncGuaranteed();\n ret._setOnCancel(holder);\n }\n return ret;\n }\n }\n }\n var args = [].slice.call(arguments);;\n if (fn) args.pop();\n var ret = new PromiseArray(args).promise();\n return fn !== undefined ? ret.spread(fn) : ret;\n};\n\n};\n\n},{\"./util\":36}],18:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\n this.constructor$(promises);\n this._promise._captureStackTrace();\n var domain = getDomain();\n this._callback = domain === null ? fn : util.domainBind(domain, fn);\n this._preservedValues = _filter === INTERNAL\n ? new Array(this.length())\n : null;\n this._limit = limit;\n this._inFlight = 0;\n this._queue = [];\n async.invoke(this._asyncInit, this, undefined);\n}\nutil.inherits(MappingPromiseArray, PromiseArray);\n\nMappingPromiseArray.prototype._asyncInit = function() {\n this._init$(undefined, -2);\n};\n\nMappingPromiseArray.prototype._init = function () {};\n\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var values = this._values;\n var length = this.length();\n var preservedValues = this._preservedValues;\n var limit = this._limit;\n\n if (index < 0) {\n index = (index * -1) - 1;\n values[index] = value;\n if (limit >= 1) {\n this._inFlight--;\n this._drainQueue();\n if (this._isResolved()) return true;\n }\n } else {\n if (limit >= 1 && this._inFlight >= limit) {\n values[index] = value;\n this._queue.push(index);\n return false;\n }\n if (preservedValues !== null) preservedValues[index] = value;\n\n var promise = this._promise;\n var callback = this._callback;\n var receiver = promise._boundValue();\n promise._pushContext();\n var ret = tryCatch(callback).call(receiver, value, index, length);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n preservedValues !== null ? \"Promise.filter\" : \"Promise.map\",\n promise\n );\n if (ret === errorObj) {\n this._reject(ret.e);\n return true;\n }\n\n var maybePromise = tryConvertToPromise(ret, this._promise);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n if (limit >= 1) this._inFlight++;\n values[index] = maybePromise;\n maybePromise._proxy(this, (index + 1) * -1);\n return false;\n } else if (((bitField & 33554432) !== 0)) {\n ret = maybePromise._value();\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(maybePromise._reason());\n return true;\n } else {\n this._cancel();\n return true;\n }\n }\n values[index] = ret;\n }\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= length) {\n if (preservedValues !== null) {\n this._filter(values, preservedValues);\n } else {\n this._resolve(values);\n }\n return true;\n }\n return false;\n};\n\nMappingPromiseArray.prototype._drainQueue = function () {\n var queue = this._queue;\n var limit = this._limit;\n var values = this._values;\n while (queue.length > 0 && this._inFlight < limit) {\n if (this._isResolved()) return;\n var index = queue.pop();\n this._promiseFulfilled(values[index], index);\n }\n};\n\nMappingPromiseArray.prototype._filter = function (booleans, values) {\n var len = values.length;\n var ret = new Array(len);\n var j = 0;\n for (var i = 0; i < len; ++i) {\n if (booleans[i]) ret[j++] = values[i];\n }\n ret.length = j;\n this._resolve(ret);\n};\n\nMappingPromiseArray.prototype.preservedValues = function () {\n return this._preservedValues;\n};\n\nfunction map(promises, fn, options, _filter) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n\n var limit = 0;\n if (options !== undefined) {\n if (typeof options === \"object\" && options !== null) {\n if (typeof options.concurrency !== \"number\") {\n return Promise.reject(\n new TypeError(\"'concurrency' must be a number but it is \" +\n util.classString(options.concurrency)));\n }\n limit = options.concurrency;\n } else {\n return Promise.reject(new TypeError(\n \"options argument must be an object but it is \" +\n util.classString(options)));\n }\n }\n limit = typeof limit === \"number\" &&\n isFinite(limit) && limit >= 1 ? limit : 0;\n return new MappingPromiseArray(promises, fn, limit, _filter).promise();\n}\n\nPromise.prototype.map = function (fn, options) {\n return map(this, fn, options, null);\n};\n\nPromise.map = function (promises, fn, options, _filter) {\n return map(promises, fn, options, _filter);\n};\n\n\n};\n\n},{\"./util\":36}],19:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nPromise.method = function (fn) {\n if (typeof fn !== \"function\") {\n throw new Promise.TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return function () {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value = tryCatch(fn).apply(this, arguments);\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.method\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n };\n};\n\nPromise.attempt = Promise[\"try\"] = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value;\n if (arguments.length > 1) {\n debug.deprecated(\"calling Promise.try with more than 1 argument\");\n var arg = arguments[1];\n var ctx = arguments[2];\n value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\n : tryCatch(fn).call(ctx, arg);\n } else {\n value = tryCatch(fn)();\n }\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.try\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n};\n\nPromise.prototype._resolveFromSyncValue = function (value) {\n if (value === util.errorObj) {\n this._rejectCallback(value.e, false);\n } else {\n this._resolveCallback(value, true);\n }\n};\n};\n\n},{\"./util\":36}],20:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar errors = _dereq_(\"./errors\");\nvar OperationalError = errors.OperationalError;\nvar es5 = _dereq_(\"./es5\");\n\nfunction isUntypedError(obj) {\n return obj instanceof Error &&\n es5.getPrototypeOf(obj) === Error.prototype;\n}\n\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\nfunction wrapAsOperationalError(obj) {\n var ret;\n if (isUntypedError(obj)) {\n ret = new OperationalError(obj);\n ret.name = obj.name;\n ret.message = obj.message;\n ret.stack = obj.stack;\n var keys = es5.keys(obj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!rErrorKey.test(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n }\n util.markAsOriginatingFromRejection(obj);\n return obj;\n}\n\nfunction nodebackForPromise(promise, multiArgs) {\n return function(err, value) {\n if (promise === null) return;\n if (err) {\n var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n promise._attachExtraTrace(wrapped);\n promise._reject(wrapped);\n } else if (!multiArgs) {\n promise._fulfill(value);\n } else {\n var args = [].slice.call(arguments, 1);;\n promise._fulfill(args);\n }\n promise = null;\n };\n}\n\nmodule.exports = nodebackForPromise;\n\n},{\"./errors\":12,\"./es5\":13,\"./util\":36}],21:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar async = Promise._async;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction spreadAdapter(val, nodeback) {\n var promise = this;\n if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\n var ret =\n tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nfunction successAdapter(val, nodeback) {\n var promise = this;\n var receiver = promise._boundValue();\n var ret = val === undefined\n ? tryCatch(nodeback).call(receiver, null)\n : tryCatch(nodeback).call(receiver, null, val);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\nfunction errorAdapter(reason, nodeback) {\n var promise = this;\n if (!reason) {\n var newReason = new Error(reason + \"\");\n newReason.cause = reason;\n reason = newReason;\n }\n var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\n options) {\n if (typeof nodeback == \"function\") {\n var adapter = successAdapter;\n if (options !== undefined && Object(options).spread) {\n adapter = spreadAdapter;\n }\n this._then(\n adapter,\n errorAdapter,\n undefined,\n this,\n nodeback\n );\n }\n return this;\n};\n};\n\n},{\"./util\":36}],22:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function() {\nvar makeSelfResolutionError = function () {\n return new TypeError(\"circular promise resolution chain\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar reflectHandler = function() {\n return new Promise.PromiseInspection(this._target());\n};\nvar apiRejection = function(msg) {\n return Promise.reject(new TypeError(msg));\n};\nfunction Proxyable() {}\nvar UNDEFINED_BINDING = {};\nvar util = _dereq_(\"./util\");\n\nvar getDomain;\nif (util.isNode) {\n getDomain = function() {\n var ret = process.domain;\n if (ret === undefined) ret = null;\n return ret;\n };\n} else {\n getDomain = function() {\n return null;\n };\n}\nutil.notEnumerableProp(Promise, \"_getDomain\", getDomain);\n\nvar es5 = _dereq_(\"./es5\");\nvar Async = _dereq_(\"./async\");\nvar async = new Async();\nes5.defineProperty(Promise, \"_async\", {value: async});\nvar errors = _dereq_(\"./errors\");\nvar TypeError = Promise.TypeError = errors.TypeError;\nPromise.RangeError = errors.RangeError;\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\nPromise.TimeoutError = errors.TimeoutError;\nPromise.OperationalError = errors.OperationalError;\nPromise.RejectionError = errors.OperationalError;\nPromise.AggregateError = errors.AggregateError;\nvar INTERNAL = function(){};\nvar APPLY = {};\nvar NEXT_FILTER = {};\nvar tryConvertToPromise = _dereq_(\"./thenables\")(Promise, INTERNAL);\nvar PromiseArray =\n _dereq_(\"./promise_array\")(Promise, INTERNAL,\n tryConvertToPromise, apiRejection, Proxyable);\nvar Context = _dereq_(\"./context\")(Promise);\n /*jshint unused:false*/\nvar createContext = Context.create;\nvar debug = _dereq_(\"./debuggability\")(Promise, Context);\nvar CapturedTrace = debug.CapturedTrace;\nvar PassThroughHandlerContext =\n _dereq_(\"./finally\")(Promise, tryConvertToPromise);\nvar catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nfunction check(self, executor) {\n if (typeof executor !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(executor));\n }\n if (self.constructor !== Promise) {\n throw new TypeError(\"the promise constructor cannot be invoked directly\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n}\n\nfunction Promise(executor) {\n this._bitField = 0;\n this._fulfillmentHandler0 = undefined;\n this._rejectionHandler0 = undefined;\n this._promise0 = undefined;\n this._receiver0 = undefined;\n if (executor !== INTERNAL) {\n check(this, executor);\n this._resolveFromExecutor(executor);\n }\n this._promiseCreated();\n this._fireEvent(\"promiseCreated\", this);\n}\n\nPromise.prototype.toString = function () {\n return \"[object Promise]\";\n};\n\nPromise.prototype.caught = Promise.prototype[\"catch\"] = function (fn) {\n var len = arguments.length;\n if (len > 1) {\n var catchInstances = new Array(len - 1),\n j = 0, i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return apiRejection(\"expecting an object but got \" +\n \"A catch statement predicate \" + util.classString(item));\n }\n }\n catchInstances.length = j;\n fn = arguments[i];\n return this.then(undefined, catchFilter(catchInstances, fn, this));\n }\n return this.then(undefined, fn);\n};\n\nPromise.prototype.reflect = function () {\n return this._then(reflectHandler,\n reflectHandler, undefined, this, undefined);\n};\n\nPromise.prototype.then = function (didFulfill, didReject) {\n if (debug.warnings() && arguments.length > 0 &&\n typeof didFulfill !== \"function\" &&\n typeof didReject !== \"function\") {\n var msg = \".then() only accepts functions but was passed: \" +\n util.classString(didFulfill);\n if (arguments.length > 1) {\n msg += \", \" + util.classString(didReject);\n }\n this._warn(msg);\n }\n return this._then(didFulfill, didReject, undefined, undefined, undefined);\n};\n\nPromise.prototype.done = function (didFulfill, didReject) {\n var promise =\n this._then(didFulfill, didReject, undefined, undefined, undefined);\n promise._setIsFinal();\n};\n\nPromise.prototype.spread = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n};\n\nPromise.prototype.toJSON = function () {\n var ret = {\n isFulfilled: false,\n isRejected: false,\n fulfillmentValue: undefined,\n rejectionReason: undefined\n };\n if (this.isFulfilled()) {\n ret.fulfillmentValue = this.value();\n ret.isFulfilled = true;\n } else if (this.isRejected()) {\n ret.rejectionReason = this.reason();\n ret.isRejected = true;\n }\n return ret;\n};\n\nPromise.prototype.all = function () {\n if (arguments.length > 0) {\n this._warn(\".all() was passed arguments but it does not take any\");\n }\n return new PromiseArray(this).promise();\n};\n\nPromise.prototype.error = function (fn) {\n return this.caught(util.originatesFromRejection, fn);\n};\n\nPromise.getNewLibraryCopy = module.exports;\n\nPromise.is = function (val) {\n return val instanceof Promise;\n};\n\nPromise.fromNode = Promise.fromCallback = function(fn) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\n : false;\n var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n if (result === errorObj) {\n ret._rejectCallback(result.e, true);\n }\n if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.all = function (promises) {\n return new PromiseArray(promises).promise();\n};\n\nPromise.cast = function (obj) {\n var ret = tryConvertToPromise(obj);\n if (!(ret instanceof Promise)) {\n ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._setFulfilled();\n ret._rejectionHandler0 = obj;\n }\n return ret;\n};\n\nPromise.resolve = Promise.fulfilled = Promise.cast;\n\nPromise.reject = Promise.rejected = function (reason) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._rejectCallback(reason, true);\n return ret;\n};\n\nPromise.setScheduler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return async.setScheduler(fn);\n};\n\nPromise.prototype._then = function (\n didFulfill,\n didReject,\n _, receiver,\n internalData\n) {\n var haveInternalData = internalData !== undefined;\n var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n var target = this._target();\n var bitField = target._bitField;\n\n if (!haveInternalData) {\n promise._propagateFrom(this, 3);\n promise._captureStackTrace();\n if (receiver === undefined &&\n ((this._bitField & 2097152) !== 0)) {\n if (!((bitField & 50397184) === 0)) {\n receiver = this._boundValue();\n } else {\n receiver = target === this ? undefined : this._boundTo;\n }\n }\n this._fireEvent(\"promiseChained\", this, promise);\n }\n\n var domain = getDomain();\n if (!((bitField & 50397184) === 0)) {\n var handler, value, settler = target._settlePromiseCtx;\n if (((bitField & 33554432) !== 0)) {\n value = target._rejectionHandler0;\n handler = didFulfill;\n } else if (((bitField & 16777216) !== 0)) {\n value = target._fulfillmentHandler0;\n handler = didReject;\n target._unsetRejectionIsUnhandled();\n } else {\n settler = target._settlePromiseLateCancellationObserver;\n value = new CancellationError(\"late cancellation observer\");\n target._attachExtraTrace(value);\n handler = didReject;\n }\n\n async.invoke(settler, target, {\n handler: domain === null ? handler\n : (typeof handler === \"function\" &&\n util.domainBind(domain, handler)),\n promise: promise,\n receiver: receiver,\n value: value\n });\n } else {\n target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\n }\n\n return promise;\n};\n\nPromise.prototype._length = function () {\n return this._bitField & 65535;\n};\n\nPromise.prototype._isFateSealed = function () {\n return (this._bitField & 117506048) !== 0;\n};\n\nPromise.prototype._isFollowing = function () {\n return (this._bitField & 67108864) === 67108864;\n};\n\nPromise.prototype._setLength = function (len) {\n this._bitField = (this._bitField & -65536) |\n (len & 65535);\n};\n\nPromise.prototype._setFulfilled = function () {\n this._bitField = this._bitField | 33554432;\n this._fireEvent(\"promiseFulfilled\", this);\n};\n\nPromise.prototype._setRejected = function () {\n this._bitField = this._bitField | 16777216;\n this._fireEvent(\"promiseRejected\", this);\n};\n\nPromise.prototype._setFollowing = function () {\n this._bitField = this._bitField | 67108864;\n this._fireEvent(\"promiseResolved\", this);\n};\n\nPromise.prototype._setIsFinal = function () {\n this._bitField = this._bitField | 4194304;\n};\n\nPromise.prototype._isFinal = function () {\n return (this._bitField & 4194304) > 0;\n};\n\nPromise.prototype._unsetCancelled = function() {\n this._bitField = this._bitField & (~65536);\n};\n\nPromise.prototype._setCancelled = function() {\n this._bitField = this._bitField | 65536;\n this._fireEvent(\"promiseCancelled\", this);\n};\n\nPromise.prototype._setWillBeCancelled = function() {\n this._bitField = this._bitField | 8388608;\n};\n\nPromise.prototype._setAsyncGuaranteed = function() {\n if (async.hasCustomScheduler()) return;\n this._bitField = this._bitField | 134217728;\n};\n\nPromise.prototype._receiverAt = function (index) {\n var ret = index === 0 ? this._receiver0 : this[\n index * 4 - 4 + 3];\n if (ret === UNDEFINED_BINDING) {\n return undefined;\n } else if (ret === undefined && this._isBound()) {\n return this._boundValue();\n }\n return ret;\n};\n\nPromise.prototype._promiseAt = function (index) {\n return this[\n index * 4 - 4 + 2];\n};\n\nPromise.prototype._fulfillmentHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 0];\n};\n\nPromise.prototype._rejectionHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 1];\n};\n\nPromise.prototype._boundValue = function() {};\n\nPromise.prototype._migrateCallback0 = function (follower) {\n var bitField = follower._bitField;\n var fulfill = follower._fulfillmentHandler0;\n var reject = follower._rejectionHandler0;\n var promise = follower._promise0;\n var receiver = follower._receiverAt(0);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._migrateCallbackAt = function (follower, index) {\n var fulfill = follower._fulfillmentHandlerAt(index);\n var reject = follower._rejectionHandlerAt(index);\n var promise = follower._promiseAt(index);\n var receiver = follower._receiverAt(index);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._addCallbacks = function (\n fulfill,\n reject,\n promise,\n receiver,\n domain\n) {\n var index = this._length();\n\n if (index >= 65535 - 4) {\n index = 0;\n this._setLength(0);\n }\n\n if (index === 0) {\n this._promise0 = promise;\n this._receiver0 = receiver;\n if (typeof fulfill === \"function\") {\n this._fulfillmentHandler0 =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this._rejectionHandler0 =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n } else {\n var base = index * 4 - 4;\n this[base + 2] = promise;\n this[base + 3] = receiver;\n if (typeof fulfill === \"function\") {\n this[base + 0] =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this[base + 1] =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n }\n this._setLength(index + 1);\n return index;\n};\n\nPromise.prototype._proxy = function (proxyable, arg) {\n this._addCallbacks(undefined, undefined, arg, proxyable, null);\n};\n\nPromise.prototype._resolveCallback = function(value, shouldBind) {\n if (((this._bitField & 117506048) !== 0)) return;\n if (value === this)\n return this._rejectCallback(makeSelfResolutionError(), false);\n var maybePromise = tryConvertToPromise(value, this);\n if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n\n if (shouldBind) this._propagateFrom(maybePromise, 2);\n\n var promise = maybePromise._target();\n\n if (promise === this) {\n this._reject(makeSelfResolutionError());\n return;\n }\n\n var bitField = promise._bitField;\n if (((bitField & 50397184) === 0)) {\n var len = this._length();\n if (len > 0) promise._migrateCallback0(this);\n for (var i = 1; i < len; ++i) {\n promise._migrateCallbackAt(this, i);\n }\n this._setFollowing();\n this._setLength(0);\n this._setFollowee(promise);\n } else if (((bitField & 33554432) !== 0)) {\n this._fulfill(promise._value());\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(promise._reason());\n } else {\n var reason = new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n this._reject(reason);\n }\n};\n\nPromise.prototype._rejectCallback =\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\n var trace = util.ensureErrorObject(reason);\n var hasStack = trace === reason;\n if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n var message = \"a promise was rejected with a non-error: \" +\n util.classString(reason);\n this._warn(message, true);\n }\n this._attachExtraTrace(trace, synchronous ? hasStack : false);\n this._reject(reason);\n};\n\nPromise.prototype._resolveFromExecutor = function (executor) {\n var promise = this;\n this._captureStackTrace();\n this._pushContext();\n var synchronous = true;\n var r = this._execute(executor, function(value) {\n promise._resolveCallback(value);\n }, function (reason) {\n promise._rejectCallback(reason, synchronous);\n });\n synchronous = false;\n this._popContext();\n\n if (r !== undefined) {\n promise._rejectCallback(r, true);\n }\n};\n\nPromise.prototype._settlePromiseFromHandler = function (\n handler, receiver, value, promise\n) {\n var bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n promise._pushContext();\n var x;\n if (receiver === APPLY) {\n if (!value || typeof value.length !== \"number\") {\n x = errorObj;\n x.e = new TypeError(\"cannot .spread() a non-array: \" +\n util.classString(value));\n } else {\n x = tryCatch(handler).apply(this._boundValue(), value);\n }\n } else {\n x = tryCatch(handler).call(receiver, value);\n }\n var promiseCreated = promise._popContext();\n bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n\n if (x === NEXT_FILTER) {\n promise._reject(value);\n } else if (x === errorObj) {\n promise._rejectCallback(x.e, false);\n } else {\n debug.checkForgottenReturns(x, promiseCreated, \"\", promise, this);\n promise._resolveCallback(x);\n }\n};\n\nPromise.prototype._target = function() {\n var ret = this;\n while (ret._isFollowing()) ret = ret._followee();\n return ret;\n};\n\nPromise.prototype._followee = function() {\n return this._rejectionHandler0;\n};\n\nPromise.prototype._setFollowee = function(promise) {\n this._rejectionHandler0 = promise;\n};\n\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\n var isPromise = promise instanceof Promise;\n var bitField = this._bitField;\n var asyncGuaranteed = ((bitField & 134217728) !== 0);\n if (((bitField & 65536) !== 0)) {\n if (isPromise) promise._invokeInternalOnCancel();\n\n if (receiver instanceof PassThroughHandlerContext &&\n receiver.isFinallyHandler()) {\n receiver.cancelPromise = promise;\n if (tryCatch(handler).call(receiver, value) === errorObj) {\n promise._reject(errorObj.e);\n }\n } else if (handler === reflectHandler) {\n promise._fulfill(reflectHandler.call(receiver));\n } else if (receiver instanceof Proxyable) {\n receiver._promiseCancelled(promise);\n } else if (isPromise || promise instanceof PromiseArray) {\n promise._cancel();\n } else {\n receiver.cancel();\n }\n } else if (typeof handler === \"function\") {\n if (!isPromise) {\n handler.call(receiver, value, promise);\n } else {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (receiver instanceof Proxyable) {\n if (!receiver._isResolved()) {\n if (((bitField & 33554432) !== 0)) {\n receiver._promiseFulfilled(value, promise);\n } else {\n receiver._promiseRejected(value, promise);\n }\n }\n } else if (isPromise) {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n if (((bitField & 33554432) !== 0)) {\n promise._fulfill(value);\n } else {\n promise._reject(value);\n }\n }\n};\n\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\n var handler = ctx.handler;\n var promise = ctx.promise;\n var receiver = ctx.receiver;\n var value = ctx.value;\n if (typeof handler === \"function\") {\n if (!(promise instanceof Promise)) {\n handler.call(receiver, value, promise);\n } else {\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (promise instanceof Promise) {\n promise._reject(value);\n }\n};\n\nPromise.prototype._settlePromiseCtx = function(ctx) {\n this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n};\n\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\n var promise = this._promise0;\n var receiver = this._receiverAt(0);\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._settlePromise(promise, handler, receiver, value);\n};\n\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\n var base = index * 4 - 4;\n this[base + 2] =\n this[base + 3] =\n this[base + 0] =\n this[base + 1] = undefined;\n};\n\nPromise.prototype._fulfill = function (value) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n if (value === this) {\n var err = makeSelfResolutionError();\n this._attachExtraTrace(err);\n return this._reject(err);\n }\n this._setFulfilled();\n this._rejectionHandler0 = value;\n\n if ((bitField & 65535) > 0) {\n if (((bitField & 134217728) !== 0)) {\n this._settlePromises();\n } else {\n async.settlePromises(this);\n }\n }\n};\n\nPromise.prototype._reject = function (reason) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n this._setRejected();\n this._fulfillmentHandler0 = reason;\n\n if (this._isFinal()) {\n return async.fatalError(reason, util.isNode);\n }\n\n if ((bitField & 65535) > 0) {\n async.settlePromises(this);\n } else {\n this._ensurePossibleRejectionHandled();\n }\n};\n\nPromise.prototype._fulfillPromises = function (len, value) {\n for (var i = 1; i < len; i++) {\n var handler = this._fulfillmentHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, value);\n }\n};\n\nPromise.prototype._rejectPromises = function (len, reason) {\n for (var i = 1; i < len; i++) {\n var handler = this._rejectionHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, reason);\n }\n};\n\nPromise.prototype._settlePromises = function () {\n var bitField = this._bitField;\n var len = (bitField & 65535);\n\n if (len > 0) {\n if (((bitField & 16842752) !== 0)) {\n var reason = this._fulfillmentHandler0;\n this._settlePromise0(this._rejectionHandler0, reason, bitField);\n this._rejectPromises(len, reason);\n } else {\n var value = this._rejectionHandler0;\n this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n this._fulfillPromises(len, value);\n }\n this._setLength(0);\n }\n this._clearCancellationData();\n};\n\nPromise.prototype._settledValue = function() {\n var bitField = this._bitField;\n if (((bitField & 33554432) !== 0)) {\n return this._rejectionHandler0;\n } else if (((bitField & 16777216) !== 0)) {\n return this._fulfillmentHandler0;\n }\n};\n\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\n\nPromise.defer = Promise.pending = function() {\n debug.deprecated(\"Promise.defer\", \"new Promise\");\n var promise = new Promise(INTERNAL);\n return {\n promise: promise,\n resolve: deferResolve,\n reject: deferReject\n };\n};\n\nutil.notEnumerableProp(Promise,\n \"_makeSelfResolutionError\",\n makeSelfResolutionError);\n\n_dereq_(\"./method\")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\n debug);\n_dereq_(\"./bind\")(Promise, INTERNAL, tryConvertToPromise, debug);\n_dereq_(\"./cancel\")(Promise, PromiseArray, apiRejection, debug);\n_dereq_(\"./direct_resolve\")(Promise);\n_dereq_(\"./synchronous_inspection\")(Promise);\n_dereq_(\"./join\")(\n Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);\nPromise.Promise = Promise;\nPromise.version = \"3.4.7\";\n_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./call_get.js')(Promise);\n_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\n_dereq_('./timers.js')(Promise, INTERNAL, debug);\n_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\n_dereq_('./nodeify.js')(Promise);\n_dereq_('./promisify.js')(Promise, INTERNAL);\n_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\n_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\n_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./settle.js')(Promise, PromiseArray, debug);\n_dereq_('./some.js')(Promise, PromiseArray, apiRejection);\n_dereq_('./filter.js')(Promise, INTERNAL);\n_dereq_('./each.js')(Promise, INTERNAL);\n_dereq_('./any.js')(Promise);\n \n util.toFastProperties(Promise); \n util.toFastProperties(Promise.prototype); \n function fillTypes(value) { \n var p = new Promise(INTERNAL); \n p._fulfillmentHandler0 = value; \n p._rejectionHandler0 = value; \n p._promise0 = value; \n p._receiver0 = value; \n } \n // Complete slack tracking, opt out of field-type tracking and \n // stabilize map \n fillTypes({a: 1}); \n fillTypes({b: 2}); \n fillTypes({c: 3}); \n fillTypes(1); \n fillTypes(function(){}); \n fillTypes(undefined); \n fillTypes(false); \n fillTypes(new Promise(INTERNAL)); \n debug.setBounds(Async.firstLineError, util.lastLineError); \n return Promise; \n\n};\n\n},{\"./any.js\":1,\"./async\":2,\"./bind\":3,\"./call_get.js\":5,\"./cancel\":6,\"./catch_filter\":7,\"./context\":8,\"./debuggability\":9,\"./direct_resolve\":10,\"./each.js\":11,\"./errors\":12,\"./es5\":13,\"./filter.js\":14,\"./finally\":15,\"./generators.js\":16,\"./join\":17,\"./map.js\":18,\"./method\":19,\"./nodeback\":20,\"./nodeify.js\":21,\"./promise_array\":23,\"./promisify.js\":24,\"./props.js\":25,\"./race.js\":27,\"./reduce.js\":28,\"./settle.js\":30,\"./some.js\":31,\"./synchronous_inspection\":32,\"./thenables\":33,\"./timers.js\":34,\"./using.js\":35,\"./util\":36}],23:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\n apiRejection, Proxyable) {\nvar util = _dereq_(\"./util\");\nvar isArray = util.isArray;\n\nfunction toResolutionValue(val) {\n switch(val) {\n case -2: return [];\n case -3: return {};\n }\n}\n\nfunction PromiseArray(values) {\n var promise = this._promise = new Promise(INTERNAL);\n if (values instanceof Promise) {\n promise._propagateFrom(values, 3);\n }\n promise._setOnCancel(this);\n this._values = values;\n this._length = 0;\n this._totalResolved = 0;\n this._init(undefined, -2);\n}\nutil.inherits(PromiseArray, Proxyable);\n\nPromiseArray.prototype.length = function () {\n return this._length;\n};\n\nPromiseArray.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n var values = tryConvertToPromise(this._values, this._promise);\n if (values instanceof Promise) {\n values = values._target();\n var bitField = values._bitField;\n ;\n this._values = values;\n\n if (((bitField & 50397184) === 0)) {\n this._promise._setAsyncGuaranteed();\n return values._then(\n init,\n this._reject,\n undefined,\n this,\n resolveValueIfEmpty\n );\n } else if (((bitField & 33554432) !== 0)) {\n values = values._value();\n } else if (((bitField & 16777216) !== 0)) {\n return this._reject(values._reason());\n } else {\n return this._cancel();\n }\n }\n values = util.asArray(values);\n if (values === null) {\n var err = apiRejection(\n \"expecting an array or an iterable object but got \" + util.classString(values)).reason();\n this._promise._rejectCallback(err, false);\n return;\n }\n\n if (values.length === 0) {\n if (resolveValueIfEmpty === -5) {\n this._resolveEmptyArray();\n }\n else {\n this._resolve(toResolutionValue(resolveValueIfEmpty));\n }\n return;\n }\n this._iterate(values);\n};\n\nPromiseArray.prototype._iterate = function(values) {\n var len = this.getActualLength(values.length);\n this._length = len;\n this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n var result = this._promise;\n var isResolved = false;\n var bitField = null;\n for (var i = 0; i < len; ++i) {\n var maybePromise = tryConvertToPromise(values[i], result);\n\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n bitField = maybePromise._bitField;\n } else {\n bitField = null;\n }\n\n if (isResolved) {\n if (bitField !== null) {\n maybePromise.suppressUnhandledRejections();\n }\n } else if (bitField !== null) {\n if (((bitField & 50397184) === 0)) {\n maybePromise._proxy(this, i);\n this._values[i] = maybePromise;\n } else if (((bitField & 33554432) !== 0)) {\n isResolved = this._promiseFulfilled(maybePromise._value(), i);\n } else if (((bitField & 16777216) !== 0)) {\n isResolved = this._promiseRejected(maybePromise._reason(), i);\n } else {\n isResolved = this._promiseCancelled(i);\n }\n } else {\n isResolved = this._promiseFulfilled(maybePromise, i);\n }\n }\n if (!isResolved) result._setAsyncGuaranteed();\n};\n\nPromiseArray.prototype._isResolved = function () {\n return this._values === null;\n};\n\nPromiseArray.prototype._resolve = function (value) {\n this._values = null;\n this._promise._fulfill(value);\n};\n\nPromiseArray.prototype._cancel = function() {\n if (this._isResolved() || !this._promise._isCancellable()) return;\n this._values = null;\n this._promise._cancel();\n};\n\nPromiseArray.prototype._reject = function (reason) {\n this._values = null;\n this._promise._rejectCallback(reason, false);\n};\n\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nPromiseArray.prototype._promiseCancelled = function() {\n this._cancel();\n return true;\n};\n\nPromiseArray.prototype._promiseRejected = function (reason) {\n this._totalResolved++;\n this._reject(reason);\n return true;\n};\n\nPromiseArray.prototype._resultCancelled = function() {\n if (this._isResolved()) return;\n var values = this._values;\n this._cancel();\n if (values instanceof Promise) {\n values.cancel();\n } else {\n for (var i = 0; i < values.length; ++i) {\n if (values[i] instanceof Promise) {\n values[i].cancel();\n }\n }\n }\n};\n\nPromiseArray.prototype.shouldCopyValues = function () {\n return true;\n};\n\nPromiseArray.prototype.getActualLength = function (len) {\n return len;\n};\n\nreturn PromiseArray;\n};\n\n},{\"./util\":36}],24:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar THIS = {};\nvar util = _dereq_(\"./util\");\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar withAppended = util.withAppended;\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar canEvaluate = util.canEvaluate;\nvar TypeError = _dereq_(\"./errors\").TypeError;\nvar defaultSuffix = \"Async\";\nvar defaultPromisified = {__isPromisified__: true};\nvar noCopyProps = [\n \"arity\", \"length\",\n \"name\",\n \"arguments\",\n \"caller\",\n \"callee\",\n \"prototype\",\n \"__isPromisified__\"\n];\nvar noCopyPropsPattern = new RegExp(\"^(?:\" + noCopyProps.join(\"|\") + \")$\");\n\nvar defaultFilter = function(name) {\n return util.isIdentifier(name) &&\n name.charAt(0) !== \"_\" &&\n name !== \"constructor\";\n};\n\nfunction propsFilter(key) {\n return !noCopyPropsPattern.test(key);\n}\n\nfunction isPromisified(fn) {\n try {\n return fn.__isPromisified__ === true;\n }\n catch (e) {\n return false;\n }\n}\n\nfunction hasPromisified(obj, key, suffix) {\n var val = util.getDataPropertyOrDefault(obj, key + suffix,\n defaultPromisified);\n return val ? isPromisified(val) : false;\n}\nfunction checkValid(ret, suffix, suffixRegexp) {\n for (var i = 0; i < ret.length; i += 2) {\n var key = ret[i];\n if (suffixRegexp.test(key)) {\n var keyWithoutAsyncSuffix = key.replace(suffixRegexp, \"\");\n for (var j = 0; j < ret.length; j += 2) {\n if (ret[j] === keyWithoutAsyncSuffix) {\n throw new TypeError(\"Cannot promisify an API that has normal methods with '%s'-suffix\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\"\n .replace(\"%s\", suffix));\n }\n }\n }\n }\n}\n\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\n var keys = util.inheritedDataKeys(obj);\n var ret = [];\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var value = obj[key];\n var passesDefaultFilter = filter === defaultFilter\n ? true : defaultFilter(key, value, obj);\n if (typeof value === \"function\" &&\n !isPromisified(value) &&\n !hasPromisified(obj, key, suffix) &&\n filter(key, value, obj, passesDefaultFilter)) {\n ret.push(key, value);\n }\n }\n checkValid(ret, suffix, suffixRegexp);\n return ret;\n}\n\nvar escapeIdentRegex = function(str) {\n return str.replace(/([$])/, \"\\\\$\");\n};\n\nvar makeNodePromisifiedEval;\nif (!true) {\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\n var ret = [likelyArgumentCount];\n var min = Math.max(0, likelyArgumentCount - 1 - 3);\n for(var i = likelyArgumentCount - 1; i >= min; --i) {\n ret.push(i);\n }\n for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\n ret.push(i);\n }\n return ret;\n};\n\nvar argumentSequence = function(argumentCount) {\n return util.filledRange(argumentCount, \"_arg\", \"\");\n};\n\nvar parameterDeclaration = function(parameterCount) {\n return util.filledRange(\n Math.max(parameterCount, 3), \"_arg\", \"\");\n};\n\nvar parameterCount = function(fn) {\n if (typeof fn.length === \"number\") {\n return Math.max(Math.min(fn.length, 1023 + 1), 0);\n }\n return 0;\n};\n\nmakeNodePromisifiedEval =\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\n var newParameterCount = Math.max(0, parameterCount(fn) - 1);\n var argumentOrder = switchCaseArgumentOrder(newParameterCount);\n var shouldProxyThis = typeof callback === \"string\" || receiver === THIS;\n\n function generateCallForArgumentCount(count) {\n var args = argumentSequence(count).join(\", \");\n var comma = count > 0 ? \", \" : \"\";\n var ret;\n if (shouldProxyThis) {\n ret = \"ret = callback.call(this, {{args}}, nodeback); break;\\n\";\n } else {\n ret = receiver === undefined\n ? \"ret = callback({{args}}, nodeback); break;\\n\"\n : \"ret = callback.call(receiver, {{args}}, nodeback); break;\\n\";\n }\n return ret.replace(\"{{args}}\", args).replace(\", \", comma);\n }\n\n function generateArgumentSwitchCase() {\n var ret = \"\";\n for (var i = 0; i < argumentOrder.length; ++i) {\n ret += \"case \" + argumentOrder[i] +\":\" +\n generateCallForArgumentCount(argumentOrder[i]);\n }\n\n ret += \" \\n\\\n default: \\n\\\n var args = new Array(len + 1); \\n\\\n var i = 0; \\n\\\n for (var i = 0; i < len; ++i) { \\n\\\n args[i] = arguments[i]; \\n\\\n } \\n\\\n args[i] = nodeback; \\n\\\n [CodeForCall] \\n\\\n break; \\n\\\n \".replace(\"[CodeForCall]\", (shouldProxyThis\n ? \"ret = callback.apply(this, args);\\n\"\n : \"ret = callback.apply(receiver, args);\\n\"));\n return ret;\n }\n\n var getFunctionCode = typeof callback === \"string\"\n ? (\"this != null ? this['\"+callback+\"'] : fn\")\n : \"fn\";\n var body = \"'use strict'; \\n\\\n var ret = function (Parameters) { \\n\\\n 'use strict'; \\n\\\n var len = arguments.length; \\n\\\n var promise = new Promise(INTERNAL); \\n\\\n promise._captureStackTrace(); \\n\\\n var nodeback = nodebackForPromise(promise, \" + multiArgs + \"); \\n\\\n var ret; \\n\\\n var callback = tryCatch([GetFunctionCode]); \\n\\\n switch(len) { \\n\\\n [CodeForSwitchCase] \\n\\\n } \\n\\\n if (ret === errorObj) { \\n\\\n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\n\\\n } \\n\\\n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \\n\\\n return promise; \\n\\\n }; \\n\\\n notEnumerableProp(ret, '__isPromisified__', true); \\n\\\n return ret; \\n\\\n \".replace(\"[CodeForSwitchCase]\", generateArgumentSwitchCase())\n .replace(\"[GetFunctionCode]\", getFunctionCode);\n body = body.replace(\"Parameters\", parameterDeclaration(newParameterCount));\n return new Function(\"Promise\",\n \"fn\",\n \"receiver\",\n \"withAppended\",\n \"maybeWrapAsError\",\n \"nodebackForPromise\",\n \"tryCatch\",\n \"errorObj\",\n \"notEnumerableProp\",\n \"INTERNAL\",\n body)(\n Promise,\n fn,\n receiver,\n withAppended,\n maybeWrapAsError,\n nodebackForPromise,\n util.tryCatch,\n util.errorObj,\n util.notEnumerableProp,\n INTERNAL);\n};\n}\n\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\n var defaultThis = (function() {return this;})();\n var method = callback;\n if (typeof method === \"string\") {\n callback = fn;\n }\n function promisified() {\n var _receiver = receiver;\n if (receiver === THIS) _receiver = this;\n var promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n var cb = typeof method === \"string\" && this !== defaultThis\n ? this[method] : callback;\n var fn = nodebackForPromise(promise, multiArgs);\n try {\n cb.apply(_receiver, withAppended(arguments, fn));\n } catch(e) {\n promise._rejectCallback(maybeWrapAsError(e), true, true);\n }\n if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\n return promise;\n }\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n return promisified;\n}\n\nvar makeNodePromisified = canEvaluate\n ? makeNodePromisifiedEval\n : makeNodePromisifiedClosure;\n\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\n var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + \"$\");\n var methods =\n promisifiableMethods(obj, suffix, suffixRegexp, filter);\n\n for (var i = 0, len = methods.length; i < len; i+= 2) {\n var key = methods[i];\n var fn = methods[i+1];\n var promisifiedKey = key + suffix;\n if (promisifier === makeNodePromisified) {\n obj[promisifiedKey] =\n makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\n } else {\n var promisified = promisifier(fn, function() {\n return makeNodePromisified(key, THIS, key,\n fn, suffix, multiArgs);\n });\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n obj[promisifiedKey] = promisified;\n }\n }\n util.toFastProperties(obj);\n return obj;\n}\n\nfunction promisify(callback, receiver, multiArgs) {\n return makeNodePromisified(callback, receiver, undefined,\n callback, null, multiArgs);\n}\n\nPromise.promisify = function (fn, options) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n if (isPromisified(fn)) {\n return fn;\n }\n options = Object(options);\n var receiver = options.context === undefined ? THIS : options.context;\n var multiArgs = !!options.multiArgs;\n var ret = promisify(fn, receiver, multiArgs);\n util.copyDescriptors(fn, ret, propsFilter);\n return ret;\n};\n\nPromise.promisifyAll = function (target, options) {\n if (typeof target !== \"function\" && typeof target !== \"object\") {\n throw new TypeError(\"the target of promisifyAll must be an object or a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n options = Object(options);\n var multiArgs = !!options.multiArgs;\n var suffix = options.suffix;\n if (typeof suffix !== \"string\") suffix = defaultSuffix;\n var filter = options.filter;\n if (typeof filter !== \"function\") filter = defaultFilter;\n var promisifier = options.promisifier;\n if (typeof promisifier !== \"function\") promisifier = makeNodePromisified;\n\n if (!util.isIdentifier(suffix)) {\n throw new RangeError(\"suffix must be a valid identifier\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n\n var keys = util.inheritedDataKeys(target);\n for (var i = 0; i < keys.length; ++i) {\n var value = target[keys[i]];\n if (keys[i] !== \"constructor\" &&\n util.isClass(value)) {\n promisifyAll(value.prototype, suffix, filter, promisifier,\n multiArgs);\n promisifyAll(value, suffix, filter, promisifier, multiArgs);\n }\n }\n\n return promisifyAll(target, suffix, filter, promisifier, multiArgs);\n};\n};\n\n\n},{\"./errors\":12,\"./nodeback\":20,\"./util\":36}],25:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, PromiseArray, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar isObject = util.isObject;\nvar es5 = _dereq_(\"./es5\");\nvar Es6Map;\nif (typeof Map === \"function\") Es6Map = Map;\n\nvar mapToEntries = (function() {\n var index = 0;\n var size = 0;\n\n function extractEntry(value, key) {\n this[index] = value;\n this[index + size] = key;\n index++;\n }\n\n return function mapToEntries(map) {\n size = map.size;\n index = 0;\n var ret = new Array(map.size * 2);\n map.forEach(extractEntry, ret);\n return ret;\n };\n})();\n\nvar entriesToMap = function(entries) {\n var ret = new Es6Map();\n var length = entries.length / 2 | 0;\n for (var i = 0; i < length; ++i) {\n var key = entries[length + i];\n var value = entries[i];\n ret.set(key, value);\n }\n return ret;\n};\n\nfunction PropertiesPromiseArray(obj) {\n var isMap = false;\n var entries;\n if (Es6Map !== undefined && obj instanceof Es6Map) {\n entries = mapToEntries(obj);\n isMap = true;\n } else {\n var keys = es5.keys(obj);\n var len = keys.length;\n entries = new Array(len * 2);\n for (var i = 0; i < len; ++i) {\n var key = keys[i];\n entries[i] = obj[key];\n entries[i + len] = key;\n }\n }\n this.constructor$(entries);\n this._isMap = isMap;\n this._init$(undefined, -3);\n}\nutil.inherits(PropertiesPromiseArray, PromiseArray);\n\nPropertiesPromiseArray.prototype._init = function () {};\n\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n var val;\n if (this._isMap) {\n val = entriesToMap(this._values);\n } else {\n val = {};\n var keyOffset = this.length();\n for (var i = 0, len = this.length(); i < len; ++i) {\n val[this._values[i + keyOffset]] = this._values[i];\n }\n }\n this._resolve(val);\n return true;\n }\n return false;\n};\n\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\n return len >> 1;\n};\n\nfunction props(promises) {\n var ret;\n var castValue = tryConvertToPromise(promises);\n\n if (!isObject(castValue)) {\n return apiRejection(\"cannot await properties of a non-object\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n } else if (castValue instanceof Promise) {\n ret = castValue._then(\n Promise.props, undefined, undefined, undefined, undefined);\n } else {\n ret = new PropertiesPromiseArray(castValue).promise();\n }\n\n if (castValue instanceof Promise) {\n ret._propagateFrom(castValue, 2);\n }\n return ret;\n}\n\nPromise.prototype.props = function () {\n return props(this);\n};\n\nPromise.props = function (promises) {\n return props(promises);\n};\n};\n\n},{\"./es5\":13,\"./util\":36}],26:[function(_dereq_,module,exports){\n\"use strict\";\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\n for (var j = 0; j < len; ++j) {\n dst[j + dstIndex] = src[j + srcIndex];\n src[j + srcIndex] = void 0;\n }\n}\n\nfunction Queue(capacity) {\n this._capacity = capacity;\n this._length = 0;\n this._front = 0;\n}\n\nQueue.prototype._willBeOverCapacity = function (size) {\n return this._capacity < size;\n};\n\nQueue.prototype._pushOne = function (arg) {\n var length = this.length();\n this._checkCapacity(length + 1);\n var i = (this._front + length) & (this._capacity - 1);\n this[i] = arg;\n this._length = length + 1;\n};\n\nQueue.prototype.push = function (fn, receiver, arg) {\n var length = this.length() + 3;\n if (this._willBeOverCapacity(length)) {\n this._pushOne(fn);\n this._pushOne(receiver);\n this._pushOne(arg);\n return;\n }\n var j = this._front + length - 3;\n this._checkCapacity(length);\n var wrapMask = this._capacity - 1;\n this[(j + 0) & wrapMask] = fn;\n this[(j + 1) & wrapMask] = receiver;\n this[(j + 2) & wrapMask] = arg;\n this._length = length;\n};\n\nQueue.prototype.shift = function () {\n var front = this._front,\n ret = this[front];\n\n this[front] = undefined;\n this._front = (front + 1) & (this._capacity - 1);\n this._length--;\n return ret;\n};\n\nQueue.prototype.length = function () {\n return this._length;\n};\n\nQueue.prototype._checkCapacity = function (size) {\n if (this._capacity < size) {\n this._resizeTo(this._capacity << 1);\n }\n};\n\nQueue.prototype._resizeTo = function (capacity) {\n var oldCapacity = this._capacity;\n this._capacity = capacity;\n var front = this._front;\n var length = this._length;\n var moveItemsCount = (front + length) & (oldCapacity - 1);\n arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n};\n\nmodule.exports = Queue;\n\n},{}],27:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, INTERNAL, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\n\nvar raceLater = function (promise) {\n return promise.then(function(array) {\n return race(array, promise);\n });\n};\n\nfunction race(promises, parent) {\n var maybePromise = tryConvertToPromise(promises);\n\n if (maybePromise instanceof Promise) {\n return raceLater(maybePromise);\n } else {\n promises = util.asArray(promises);\n if (promises === null)\n return apiRejection(\"expecting an array or an iterable object but got \" + util.classString(promises));\n }\n\n var ret = new Promise(INTERNAL);\n if (parent !== undefined) {\n ret._propagateFrom(parent, 3);\n }\n var fulfill = ret._fulfill;\n var reject = ret._reject;\n for (var i = 0, len = promises.length; i < len; ++i) {\n var val = promises[i];\n\n if (val === undefined && !(i in promises)) {\n continue;\n }\n\n Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\n }\n return ret;\n}\n\nPromise.race = function (promises) {\n return race(promises, undefined);\n};\n\nPromise.prototype.race = function () {\n return race(this, undefined);\n};\n\n};\n\n},{\"./util\":36}],28:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\n this.constructor$(promises);\n var domain = getDomain();\n this._fn = domain === null ? fn : util.domainBind(domain, fn);\n if (initialValue !== undefined) {\n initialValue = Promise.resolve(initialValue);\n initialValue._attachCancellationCallback(this);\n }\n this._initialValue = initialValue;\n this._currentCancellable = null;\n if(_each === INTERNAL) {\n this._eachValues = Array(this._length);\n } else if (_each === 0) {\n this._eachValues = null;\n } else {\n this._eachValues = undefined;\n }\n this._promise._captureStackTrace();\n this._init$(undefined, -5);\n}\nutil.inherits(ReductionPromiseArray, PromiseArray);\n\nReductionPromiseArray.prototype._gotAccum = function(accum) {\n if (this._eachValues !== undefined && \n this._eachValues !== null && \n accum !== INTERNAL) {\n this._eachValues.push(accum);\n }\n};\n\nReductionPromiseArray.prototype._eachComplete = function(value) {\n if (this._eachValues !== null) {\n this._eachValues.push(value);\n }\n return this._eachValues;\n};\n\nReductionPromiseArray.prototype._init = function() {};\n\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\n this._resolve(this._eachValues !== undefined ? this._eachValues\n : this._initialValue);\n};\n\nReductionPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nReductionPromiseArray.prototype._resolve = function(value) {\n this._promise._resolveCallback(value);\n this._values = null;\n};\n\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\n if (sender === this._initialValue) return this._cancel();\n if (this._isResolved()) return;\n this._resultCancelled$();\n if (this._currentCancellable instanceof Promise) {\n this._currentCancellable.cancel();\n }\n if (this._initialValue instanceof Promise) {\n this._initialValue.cancel();\n }\n};\n\nReductionPromiseArray.prototype._iterate = function (values) {\n this._values = values;\n var value;\n var i;\n var length = values.length;\n if (this._initialValue !== undefined) {\n value = this._initialValue;\n i = 0;\n } else {\n value = Promise.resolve(values[0]);\n i = 1;\n }\n\n this._currentCancellable = value;\n\n if (!value.isRejected()) {\n for (; i < length; ++i) {\n var ctx = {\n accum: null,\n value: values[i],\n index: i,\n length: length,\n array: this\n };\n value = value._then(gotAccum, undefined, undefined, ctx, undefined);\n }\n }\n\n if (this._eachValues !== undefined) {\n value = value\n ._then(this._eachComplete, undefined, undefined, this, undefined);\n }\n value._then(completed, completed, undefined, value, this);\n};\n\nPromise.prototype.reduce = function (fn, initialValue) {\n return reduce(this, fn, initialValue, null);\n};\n\nPromise.reduce = function (promises, fn, initialValue, _each) {\n return reduce(promises, fn, initialValue, _each);\n};\n\nfunction completed(valueOrReason, array) {\n if (this.isFulfilled()) {\n array._resolve(valueOrReason);\n } else {\n array._reject(valueOrReason);\n }\n}\n\nfunction reduce(promises, fn, initialValue, _each) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\n return array.promise();\n}\n\nfunction gotAccum(accum) {\n this.accum = accum;\n this.array._gotAccum(accum);\n var value = tryConvertToPromise(this.value, this.array._promise);\n if (value instanceof Promise) {\n this.array._currentCancellable = value;\n return value._then(gotValue, undefined, undefined, this, undefined);\n } else {\n return gotValue.call(this, value);\n }\n}\n\nfunction gotValue(value) {\n var array = this.array;\n var promise = array._promise;\n var fn = tryCatch(array._fn);\n promise._pushContext();\n var ret;\n if (array._eachValues !== undefined) {\n ret = fn.call(promise._boundValue(), value, this.index, this.length);\n } else {\n ret = fn.call(promise._boundValue(),\n this.accum, value, this.index, this.length);\n }\n if (ret instanceof Promise) {\n array._currentCancellable = ret;\n }\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n array._eachValues !== undefined ? \"Promise.each\" : \"Promise.reduce\",\n promise\n );\n return ret;\n}\n};\n\n},{\"./util\":36}],29:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar schedule;\nvar noAsyncScheduler = function() {\n throw new Error(\"No async scheduler available\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar NativePromise = util.getNativePromise();\nif (util.isNode && typeof MutationObserver === \"undefined\") {\n var GlobalSetImmediate = global.setImmediate;\n var ProcessNextTick = process.nextTick;\n schedule = util.isRecentNode\n ? function(fn) { GlobalSetImmediate.call(global, fn); }\n : function(fn) { ProcessNextTick.call(process, fn); };\n} else if (typeof NativePromise === \"function\" &&\n typeof NativePromise.resolve === \"function\") {\n var nativePromise = NativePromise.resolve();\n schedule = function(fn) {\n nativePromise.then(fn);\n };\n} else if ((typeof MutationObserver !== \"undefined\") &&\n !(typeof window !== \"undefined\" &&\n window.navigator &&\n (window.navigator.standalone || window.cordova))) {\n schedule = (function() {\n var div = document.createElement(\"div\");\n var opts = {attributes: true};\n var toggleScheduled = false;\n var div2 = document.createElement(\"div\");\n var o2 = new MutationObserver(function() {\n div.classList.toggle(\"foo\");\n toggleScheduled = false;\n });\n o2.observe(div2, opts);\n\n var scheduleToggle = function() {\n if (toggleScheduled) return;\n toggleScheduled = true;\n div2.classList.toggle(\"foo\");\n };\n\n return function schedule(fn) {\n var o = new MutationObserver(function() {\n o.disconnect();\n fn();\n });\n o.observe(div, opts);\n scheduleToggle();\n };\n })();\n} else if (typeof setImmediate !== \"undefined\") {\n schedule = function (fn) {\n setImmediate(fn);\n };\n} else if (typeof setTimeout !== \"undefined\") {\n schedule = function (fn) {\n setTimeout(fn, 0);\n };\n} else {\n schedule = noAsyncScheduler;\n}\nmodule.exports = schedule;\n\n},{\"./util\":36}],30:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\n function(Promise, PromiseArray, debug) {\nvar PromiseInspection = Promise.PromiseInspection;\nvar util = _dereq_(\"./util\");\n\nfunction SettledPromiseArray(values) {\n this.constructor$(values);\n}\nutil.inherits(SettledPromiseArray, PromiseArray);\n\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\n this._values[index] = inspection;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var ret = new PromiseInspection();\n ret._bitField = 33554432;\n ret._settledValueField = value;\n return this._promiseResolved(index, ret);\n};\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\n var ret = new PromiseInspection();\n ret._bitField = 16777216;\n ret._settledValueField = reason;\n return this._promiseResolved(index, ret);\n};\n\nPromise.settle = function (promises) {\n debug.deprecated(\".settle()\", \".reflect()\");\n return new SettledPromiseArray(promises).promise();\n};\n\nPromise.prototype.settle = function () {\n return Promise.settle(this);\n};\n};\n\n},{\"./util\":36}],31:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar RangeError = _dereq_(\"./errors\").RangeError;\nvar AggregateError = _dereq_(\"./errors\").AggregateError;\nvar isArray = util.isArray;\nvar CANCELLATION = {};\n\n\nfunction SomePromiseArray(values) {\n this.constructor$(values);\n this._howMany = 0;\n this._unwrap = false;\n this._initialized = false;\n}\nutil.inherits(SomePromiseArray, PromiseArray);\n\nSomePromiseArray.prototype._init = function () {\n if (!this._initialized) {\n return;\n }\n if (this._howMany === 0) {\n this._resolve([]);\n return;\n }\n this._init$(undefined, -5);\n var isArrayResolved = isArray(this._values);\n if (!this._isResolved() &&\n isArrayResolved &&\n this._howMany > this._canPossiblyFulfill()) {\n this._reject(this._getRangeError(this.length()));\n }\n};\n\nSomePromiseArray.prototype.init = function () {\n this._initialized = true;\n this._init();\n};\n\nSomePromiseArray.prototype.setUnwrap = function () {\n this._unwrap = true;\n};\n\nSomePromiseArray.prototype.howMany = function () {\n return this._howMany;\n};\n\nSomePromiseArray.prototype.setHowMany = function (count) {\n this._howMany = count;\n};\n\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\n this._addFulfilled(value);\n if (this._fulfilled() === this.howMany()) {\n this._values.length = this.howMany();\n if (this.howMany() === 1 && this._unwrap) {\n this._resolve(this._values[0]);\n } else {\n this._resolve(this._values);\n }\n return true;\n }\n return false;\n\n};\nSomePromiseArray.prototype._promiseRejected = function (reason) {\n this._addRejected(reason);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._promiseCancelled = function () {\n if (this._values instanceof Promise || this._values == null) {\n return this._cancel();\n }\n this._addRejected(CANCELLATION);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._checkOutcome = function() {\n if (this.howMany() > this._canPossiblyFulfill()) {\n var e = new AggregateError();\n for (var i = this.length(); i < this._values.length; ++i) {\n if (this._values[i] !== CANCELLATION) {\n e.push(this._values[i]);\n }\n }\n if (e.length > 0) {\n this._reject(e);\n } else {\n this._cancel();\n }\n return true;\n }\n return false;\n};\n\nSomePromiseArray.prototype._fulfilled = function () {\n return this._totalResolved;\n};\n\nSomePromiseArray.prototype._rejected = function () {\n return this._values.length - this.length();\n};\n\nSomePromiseArray.prototype._addRejected = function (reason) {\n this._values.push(reason);\n};\n\nSomePromiseArray.prototype._addFulfilled = function (value) {\n this._values[this._totalResolved++] = value;\n};\n\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\n return this.length() - this._rejected();\n};\n\nSomePromiseArray.prototype._getRangeError = function (count) {\n var message = \"Input array must contain at least \" +\n this._howMany + \" items but contains only \" + count + \" items\";\n return new RangeError(message);\n};\n\nSomePromiseArray.prototype._resolveEmptyArray = function () {\n this._reject(this._getRangeError(0));\n};\n\nfunction some(promises, howMany) {\n if ((howMany | 0) !== howMany || howMany < 0) {\n return apiRejection(\"expecting a positive integer\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var ret = new SomePromiseArray(promises);\n var promise = ret.promise();\n ret.setHowMany(howMany);\n ret.init();\n return promise;\n}\n\nPromise.some = function (promises, howMany) {\n return some(promises, howMany);\n};\n\nPromise.prototype.some = function (howMany) {\n return some(this, howMany);\n};\n\nPromise._SomePromiseArray = SomePromiseArray;\n};\n\n},{\"./errors\":12,\"./util\":36}],32:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction PromiseInspection(promise) {\n if (promise !== undefined) {\n promise = promise._target();\n this._bitField = promise._bitField;\n this._settledValueField = promise._isFateSealed()\n ? promise._settledValue() : undefined;\n }\n else {\n this._bitField = 0;\n this._settledValueField = undefined;\n }\n}\n\nPromiseInspection.prototype._settledValue = function() {\n return this._settledValueField;\n};\n\nvar value = PromiseInspection.prototype.value = function () {\n if (!this.isFulfilled()) {\n throw new TypeError(\"cannot get fulfillment value of a non-fulfilled promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar reason = PromiseInspection.prototype.error =\nPromiseInspection.prototype.reason = function () {\n if (!this.isRejected()) {\n throw new TypeError(\"cannot get rejection reason of a non-rejected promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\n return (this._bitField & 33554432) !== 0;\n};\n\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\n return (this._bitField & 16777216) !== 0;\n};\n\nvar isPending = PromiseInspection.prototype.isPending = function () {\n return (this._bitField & 50397184) === 0;\n};\n\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\n return (this._bitField & 50331648) !== 0;\n};\n\nPromiseInspection.prototype.isCancelled = function() {\n return (this._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.__isCancelled = function() {\n return (this._bitField & 65536) === 65536;\n};\n\nPromise.prototype._isCancelled = function() {\n return this._target().__isCancelled();\n};\n\nPromise.prototype.isCancelled = function() {\n return (this._target()._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.isPending = function() {\n return isPending.call(this._target());\n};\n\nPromise.prototype.isRejected = function() {\n return isRejected.call(this._target());\n};\n\nPromise.prototype.isFulfilled = function() {\n return isFulfilled.call(this._target());\n};\n\nPromise.prototype.isResolved = function() {\n return isResolved.call(this._target());\n};\n\nPromise.prototype.value = function() {\n return value.call(this._target());\n};\n\nPromise.prototype.reason = function() {\n var target = this._target();\n target._unsetRejectionIsUnhandled();\n return reason.call(target);\n};\n\nPromise.prototype._value = function() {\n return this._settledValue();\n};\n\nPromise.prototype._reason = function() {\n this._unsetRejectionIsUnhandled();\n return this._settledValue();\n};\n\nPromise.PromiseInspection = PromiseInspection;\n};\n\n},{}],33:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar isObject = util.isObject;\n\nfunction tryConvertToPromise(obj, context) {\n if (isObject(obj)) {\n if (obj instanceof Promise) return obj;\n var then = getThen(obj);\n if (then === errorObj) {\n if (context) context._pushContext();\n var ret = Promise.reject(then.e);\n if (context) context._popContext();\n return ret;\n } else if (typeof then === \"function\") {\n if (isAnyBluebirdPromise(obj)) {\n var ret = new Promise(INTERNAL);\n obj._then(\n ret._fulfill,\n ret._reject,\n undefined,\n ret,\n null\n );\n return ret;\n }\n return doThenable(obj, then, context);\n }\n }\n return obj;\n}\n\nfunction doGetThen(obj) {\n return obj.then;\n}\n\nfunction getThen(obj) {\n try {\n return doGetThen(obj);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\n\nvar hasProp = {}.hasOwnProperty;\nfunction isAnyBluebirdPromise(obj) {\n try {\n return hasProp.call(obj, \"_promise0\");\n } catch (e) {\n return false;\n }\n}\n\nfunction doThenable(x, then, context) {\n var promise = new Promise(INTERNAL);\n var ret = promise;\n if (context) context._pushContext();\n promise._captureStackTrace();\n if (context) context._popContext();\n var synchronous = true;\n var result = util.tryCatch(then).call(x, resolve, reject);\n synchronous = false;\n\n if (promise && result === errorObj) {\n promise._rejectCallback(result.e, true, true);\n promise = null;\n }\n\n function resolve(value) {\n if (!promise) return;\n promise._resolveCallback(value);\n promise = null;\n }\n\n function reject(reason) {\n if (!promise) return;\n promise._rejectCallback(reason, synchronous, true);\n promise = null;\n }\n return ret;\n}\n\nreturn tryConvertToPromise;\n};\n\n},{\"./util\":36}],34:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, debug) {\nvar util = _dereq_(\"./util\");\nvar TimeoutError = Promise.TimeoutError;\n\nfunction HandleWrapper(handle) {\n this.handle = handle;\n}\n\nHandleWrapper.prototype._resultCancelled = function() {\n clearTimeout(this.handle);\n};\n\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\nvar delay = Promise.delay = function (ms, value) {\n var ret;\n var handle;\n if (value !== undefined) {\n ret = Promise.resolve(value)\n ._then(afterValue, null, null, ms, undefined);\n if (debug.cancellation() && value instanceof Promise) {\n ret._setOnCancel(value);\n }\n } else {\n ret = new Promise(INTERNAL);\n handle = setTimeout(function() { ret._fulfill(); }, +ms);\n if (debug.cancellation()) {\n ret._setOnCancel(new HandleWrapper(handle));\n }\n ret._captureStackTrace();\n }\n ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.prototype.delay = function (ms) {\n return delay(ms, this);\n};\n\nvar afterTimeout = function (promise, message, parent) {\n var err;\n if (typeof message !== \"string\") {\n if (message instanceof Error) {\n err = message;\n } else {\n err = new TimeoutError(\"operation timed out\");\n }\n } else {\n err = new TimeoutError(message);\n }\n util.markAsOriginatingFromRejection(err);\n promise._attachExtraTrace(err);\n promise._reject(err);\n\n if (parent != null) {\n parent.cancel();\n }\n};\n\nfunction successClear(value) {\n clearTimeout(this.handle);\n return value;\n}\n\nfunction failureClear(reason) {\n clearTimeout(this.handle);\n throw reason;\n}\n\nPromise.prototype.timeout = function (ms, message) {\n ms = +ms;\n var ret, parent;\n\n var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\n if (ret.isPending()) {\n afterTimeout(ret, message, parent);\n }\n }, ms));\n\n if (debug.cancellation()) {\n parent = this.then();\n ret = parent._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n ret._setOnCancel(handleWrapper);\n } else {\n ret = this._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n }\n\n return ret;\n};\n\n};\n\n},{\"./util\":36}],35:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\n createContext, INTERNAL, debug) {\n var util = _dereq_(\"./util\");\n var TypeError = _dereq_(\"./errors\").TypeError;\n var inherits = _dereq_(\"./util\").inherits;\n var errorObj = util.errorObj;\n var tryCatch = util.tryCatch;\n var NULL = {};\n\n function thrower(e) {\n setTimeout(function(){throw e;}, 0);\n }\n\n function castPreservingDisposable(thenable) {\n var maybePromise = tryConvertToPromise(thenable);\n if (maybePromise !== thenable &&\n typeof thenable._isDisposable === \"function\" &&\n typeof thenable._getDisposer === \"function\" &&\n thenable._isDisposable()) {\n maybePromise._setDisposable(thenable._getDisposer());\n }\n return maybePromise;\n }\n function dispose(resources, inspection) {\n var i = 0;\n var len = resources.length;\n var ret = new Promise(INTERNAL);\n function iterator() {\n if (i >= len) return ret._fulfill();\n var maybePromise = castPreservingDisposable(resources[i++]);\n if (maybePromise instanceof Promise &&\n maybePromise._isDisposable()) {\n try {\n maybePromise = tryConvertToPromise(\n maybePromise._getDisposer().tryDispose(inspection),\n resources.promise);\n } catch (e) {\n return thrower(e);\n }\n if (maybePromise instanceof Promise) {\n return maybePromise._then(iterator, thrower,\n null, null, null);\n }\n }\n iterator();\n }\n iterator();\n return ret;\n }\n\n function Disposer(data, promise, context) {\n this._data = data;\n this._promise = promise;\n this._context = context;\n }\n\n Disposer.prototype.data = function () {\n return this._data;\n };\n\n Disposer.prototype.promise = function () {\n return this._promise;\n };\n\n Disposer.prototype.resource = function () {\n if (this.promise().isFulfilled()) {\n return this.promise().value();\n }\n return NULL;\n };\n\n Disposer.prototype.tryDispose = function(inspection) {\n var resource = this.resource();\n var context = this._context;\n if (context !== undefined) context._pushContext();\n var ret = resource !== NULL\n ? this.doDispose(resource, inspection) : null;\n if (context !== undefined) context._popContext();\n this._promise._unsetDisposable();\n this._data = null;\n return ret;\n };\n\n Disposer.isDisposer = function (d) {\n return (d != null &&\n typeof d.resource === \"function\" &&\n typeof d.tryDispose === \"function\");\n };\n\n function FunctionDisposer(fn, promise, context) {\n this.constructor$(fn, promise, context);\n }\n inherits(FunctionDisposer, Disposer);\n\n FunctionDisposer.prototype.doDispose = function (resource, inspection) {\n var fn = this.data();\n return fn.call(resource, resource, inspection);\n };\n\n function maybeUnwrapDisposer(value) {\n if (Disposer.isDisposer(value)) {\n this.resources[this.index]._setDisposable(value);\n return value.promise();\n }\n return value;\n }\n\n function ResourceList(length) {\n this.length = length;\n this.promise = null;\n this[length-1] = null;\n }\n\n ResourceList.prototype._resultCancelled = function() {\n var len = this.length;\n for (var i = 0; i < len; ++i) {\n var item = this[i];\n if (item instanceof Promise) {\n item.cancel();\n }\n }\n };\n\n Promise.using = function () {\n var len = arguments.length;\n if (len < 2) return apiRejection(\n \"you must pass at least 2 arguments to Promise.using\");\n var fn = arguments[len - 1];\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var input;\n var spreadArgs = true;\n if (len === 2 && Array.isArray(arguments[0])) {\n input = arguments[0];\n len = input.length;\n spreadArgs = false;\n } else {\n input = arguments;\n len--;\n }\n var resources = new ResourceList(len);\n for (var i = 0; i < len; ++i) {\n var resource = input[i];\n if (Disposer.isDisposer(resource)) {\n var disposer = resource;\n resource = resource.promise();\n resource._setDisposable(disposer);\n } else {\n var maybePromise = tryConvertToPromise(resource);\n if (maybePromise instanceof Promise) {\n resource =\n maybePromise._then(maybeUnwrapDisposer, null, null, {\n resources: resources,\n index: i\n }, undefined);\n }\n }\n resources[i] = resource;\n }\n\n var reflectedResources = new Array(resources.length);\n for (var i = 0; i < reflectedResources.length; ++i) {\n reflectedResources[i] = Promise.resolve(resources[i]).reflect();\n }\n\n var resultPromise = Promise.all(reflectedResources)\n .then(function(inspections) {\n for (var i = 0; i < inspections.length; ++i) {\n var inspection = inspections[i];\n if (inspection.isRejected()) {\n errorObj.e = inspection.error();\n return errorObj;\n } else if (!inspection.isFulfilled()) {\n resultPromise.cancel();\n return;\n }\n inspections[i] = inspection.value();\n }\n promise._pushContext();\n\n fn = tryCatch(fn);\n var ret = spreadArgs\n ? fn.apply(undefined, inspections) : fn(inspections);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret, promiseCreated, \"Promise.using\", promise);\n return ret;\n });\n\n var promise = resultPromise.lastly(function() {\n var inspection = new Promise.PromiseInspection(resultPromise);\n return dispose(resources, inspection);\n });\n resources.promise = promise;\n promise._setOnCancel(resources);\n return promise;\n };\n\n Promise.prototype._setDisposable = function (disposer) {\n this._bitField = this._bitField | 131072;\n this._disposer = disposer;\n };\n\n Promise.prototype._isDisposable = function () {\n return (this._bitField & 131072) > 0;\n };\n\n Promise.prototype._getDisposer = function () {\n return this._disposer;\n };\n\n Promise.prototype._unsetDisposable = function () {\n this._bitField = this._bitField & (~131072);\n this._disposer = undefined;\n };\n\n Promise.prototype.disposer = function (fn) {\n if (typeof fn === \"function\") {\n return new FunctionDisposer(fn, this, createContext());\n }\n throw new TypeError();\n };\n\n};\n\n},{\"./errors\":12,\"./util\":36}],36:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar canEvaluate = typeof navigator == \"undefined\";\n\nvar errorObj = {e: {}};\nvar tryCatchTarget;\nvar globalObject = typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window :\n typeof global !== \"undefined\" ? global :\n this !== undefined ? this : null;\n\nfunction tryCatcher() {\n try {\n var target = tryCatchTarget;\n tryCatchTarget = null;\n return target.apply(this, arguments);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\nfunction tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n}\n\nvar inherits = function(Child, Parent) {\n var hasProp = {}.hasOwnProperty;\n\n function T() {\n this.constructor = Child;\n this.constructor$ = Parent;\n for (var propertyName in Parent.prototype) {\n if (hasProp.call(Parent.prototype, propertyName) &&\n propertyName.charAt(propertyName.length-1) !== \"$\"\n ) {\n this[propertyName + \"$\"] = Parent.prototype[propertyName];\n }\n }\n }\n T.prototype = Parent.prototype;\n Child.prototype = new T();\n return Child.prototype;\n};\n\n\nfunction isPrimitive(val) {\n return val == null || val === true || val === false ||\n typeof val === \"string\" || typeof val === \"number\";\n\n}\n\nfunction isObject(value) {\n return typeof value === \"function\" ||\n typeof value === \"object\" && value !== null;\n}\n\nfunction maybeWrapAsError(maybeError) {\n if (!isPrimitive(maybeError)) return maybeError;\n\n return new Error(safeToString(maybeError));\n}\n\nfunction withAppended(target, appendee) {\n var len = target.length;\n var ret = new Array(len + 1);\n var i;\n for (i = 0; i < len; ++i) {\n ret[i] = target[i];\n }\n ret[i] = appendee;\n return ret;\n}\n\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\n if (es5.isES5) {\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n\n if (desc != null) {\n return desc.get == null && desc.set == null\n ? desc.value\n : defaultValue;\n }\n } else {\n return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n }\n}\n\nfunction notEnumerableProp(obj, name, value) {\n if (isPrimitive(obj)) return obj;\n var descriptor = {\n value: value,\n configurable: true,\n enumerable: false,\n writable: true\n };\n es5.defineProperty(obj, name, descriptor);\n return obj;\n}\n\nfunction thrower(r) {\n throw r;\n}\n\nvar inheritedDataKeys = (function() {\n var excludedPrototypes = [\n Array.prototype,\n Object.prototype,\n Function.prototype\n ];\n\n var isExcludedProto = function(val) {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (excludedPrototypes[i] === val) {\n return true;\n }\n }\n return false;\n };\n\n if (es5.isES5) {\n var getKeys = Object.getOwnPropertyNames;\n return function(obj) {\n var ret = [];\n var visitedKeys = Object.create(null);\n while (obj != null && !isExcludedProto(obj)) {\n var keys;\n try {\n keys = getKeys(obj);\n } catch (e) {\n return ret;\n }\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (visitedKeys[key]) continue;\n visitedKeys[key] = true;\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n if (desc != null && desc.get == null && desc.set == null) {\n ret.push(key);\n }\n }\n obj = es5.getPrototypeOf(obj);\n }\n return ret;\n };\n } else {\n var hasProp = {}.hasOwnProperty;\n return function(obj) {\n if (isExcludedProto(obj)) return [];\n var ret = [];\n\n /*jshint forin:false */\n enumeration: for (var key in obj) {\n if (hasProp.call(obj, key)) {\n ret.push(key);\n } else {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (hasProp.call(excludedPrototypes[i], key)) {\n continue enumeration;\n }\n }\n ret.push(key);\n }\n }\n return ret;\n };\n }\n\n})();\n\nvar thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\nfunction isClass(fn) {\n try {\n if (typeof fn === \"function\") {\n var keys = es5.names(fn.prototype);\n\n var hasMethods = es5.isES5 && keys.length > 1;\n var hasMethodsOtherThanConstructor = keys.length > 0 &&\n !(keys.length === 1 && keys[0] === \"constructor\");\n var hasThisAssignmentAndStaticMethods =\n thisAssignmentPattern.test(fn + \"\") && es5.names(fn).length > 0;\n\n if (hasMethods || hasMethodsOtherThanConstructor ||\n hasThisAssignmentAndStaticMethods) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n}\n\nfunction toFastProperties(obj) {\n /*jshint -W027,-W055,-W031*/\n function FakeConstructor() {}\n FakeConstructor.prototype = obj;\n var l = 8;\n while (l--) new FakeConstructor();\n return obj;\n eval(obj);\n}\n\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\nfunction isIdentifier(str) {\n return rident.test(str);\n}\n\nfunction filledRange(count, prefix, suffix) {\n var ret = new Array(count);\n for(var i = 0; i < count; ++i) {\n ret[i] = prefix + i + suffix;\n }\n return ret;\n}\n\nfunction safeToString(obj) {\n try {\n return obj + \"\";\n } catch (e) {\n return \"[no string representation]\";\n }\n}\n\nfunction isError(obj) {\n return obj !== null &&\n typeof obj === \"object\" &&\n typeof obj.message === \"string\" &&\n typeof obj.name === \"string\";\n}\n\nfunction markAsOriginatingFromRejection(e) {\n try {\n notEnumerableProp(e, \"isOperational\", true);\n }\n catch(ignore) {}\n}\n\nfunction originatesFromRejection(e) {\n if (e == null) return false;\n return ((e instanceof Error[\"__BluebirdErrorTypes__\"].OperationalError) ||\n e[\"isOperational\"] === true);\n}\n\nfunction canAttachTrace(obj) {\n return isError(obj) && es5.propertyIsWritable(obj, \"stack\");\n}\n\nvar ensureErrorObject = (function() {\n if (!(\"stack\" in new Error())) {\n return function(value) {\n if (canAttachTrace(value)) return value;\n try {throw new Error(safeToString(value));}\n catch(err) {return err;}\n };\n } else {\n return function(value) {\n if (canAttachTrace(value)) return value;\n return new Error(safeToString(value));\n };\n }\n})();\n\nfunction classString(obj) {\n return {}.toString.call(obj);\n}\n\nfunction copyDescriptors(from, to, filter) {\n var keys = es5.names(from);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (filter(key)) {\n try {\n es5.defineProperty(to, key, es5.getDescriptor(from, key));\n } catch (ignore) {}\n }\n }\n}\n\nvar asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n }\n return null;\n};\n\nif (typeof Symbol !== \"undefined\" && Symbol.iterator) {\n var ArrayFrom = typeof Array.from === \"function\" ? function(v) {\n return Array.from(v);\n } : function(v) {\n var ret = [];\n var it = v[Symbol.iterator]();\n var itResult;\n while (!((itResult = it.next()).done)) {\n ret.push(itResult.value);\n }\n return ret;\n };\n\n asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n } else if (v != null && typeof v[Symbol.iterator] === \"function\") {\n return ArrayFrom(v);\n }\n return null;\n };\n}\n\nvar isNode = typeof process !== \"undefined\" &&\n classString(process).toLowerCase() === \"[object process]\";\n\nvar hasEnvVariables = typeof process !== \"undefined\" &&\n typeof process.env !== \"undefined\";\n\nfunction env(key) {\n return hasEnvVariables ? process.env[key] : undefined;\n}\n\nfunction getNativePromise() {\n if (typeof Promise === \"function\") {\n try {\n var promise = new Promise(function(){});\n if ({}.toString.call(promise) === \"[object Promise]\") {\n return Promise;\n }\n } catch (e) {}\n }\n}\n\nfunction domainBind(self, cb) {\n return self.bind(cb);\n}\n\nvar ret = {\n isClass: isClass,\n isIdentifier: isIdentifier,\n inheritedDataKeys: inheritedDataKeys,\n getDataPropertyOrDefault: getDataPropertyOrDefault,\n thrower: thrower,\n isArray: es5.isArray,\n asArray: asArray,\n notEnumerableProp: notEnumerableProp,\n isPrimitive: isPrimitive,\n isObject: isObject,\n isError: isError,\n canEvaluate: canEvaluate,\n errorObj: errorObj,\n tryCatch: tryCatch,\n inherits: inherits,\n withAppended: withAppended,\n maybeWrapAsError: maybeWrapAsError,\n toFastProperties: toFastProperties,\n filledRange: filledRange,\n toString: safeToString,\n canAttachTrace: canAttachTrace,\n ensureErrorObject: ensureErrorObject,\n originatesFromRejection: originatesFromRejection,\n markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n classString: classString,\n copyDescriptors: copyDescriptors,\n hasDevTools: typeof chrome !== \"undefined\" && chrome &&\n typeof chrome.loadTimes === \"function\",\n isNode: isNode,\n hasEnvVariables: hasEnvVariables,\n env: env,\n global: globalObject,\n getNativePromise: getNativePromise,\n domainBind: domainBind\n};\nret.isRecentNode = ret.isNode && (function() {\n var version = process.versions.node.split(\".\").map(Number);\n return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\n})();\n\nif (ret.isNode) ret.toFastProperties(process);\n\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\nmodule.exports = ret;\n\n},{\"./es5\":13}]},{},[4])(4)\n}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bluebird/js/browser/bluebird.js\n// module id = 279\n// module chunks = 0","module.exports = {\n\t\"normal\": [\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"title\": \"Level 1\",\n\t\t\t\"waves\": 3,\n\t\t\t\"ducks\": 2,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 5,\n\t\t\t\"bullets\": 3,\n\t\t\t\"time\": 13\n\t\t},\n\t\t{\n\t\t\t\"id\": 2,\n\t\t\t\"title\": \"Level 2\",\n\t\t\t\"waves\": 5,\n\t\t\t\"ducks\": 3,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 6,\n\t\t\t\"bullets\": 4,\n\t\t\t\"time\": 10\n\t\t},\n\t\t{\n\t\t\t\"id\": 3,\n\t\t\t\"title\": \"Level 3\",\n\t\t\t\"waves\": 6,\n\t\t\t\"ducks\": 3,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 7,\n\t\t\t\"bullets\": 4,\n\t\t\t\"time\": 10\n\t\t},\n\t\t{\n\t\t\t\"id\": 4,\n\t\t\t\"title\": \"Level 4\",\n\t\t\t\"waves\": 3,\n\t\t\t\"ducks\": 10,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 7,\n\t\t\t\"bullets\": 11,\n\t\t\t\"time\": 18\n\t\t},\n\t\t{\n\t\t\t\"id\": 5,\n\t\t\t\"title\": \"Level 5\",\n\t\t\t\"waves\": 5,\n\t\t\t\"ducks\": 2,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 8,\n\t\t\t\"bullets\": 3,\n\t\t\t\"time\": 13\n\t\t},\n\t\t{\n\t\t\t\"id\": 6,\n\t\t\t\"title\": \"Level 6\",\n\t\t\t\"waves\": 1,\n\t\t\t\"ducks\": 15,\n\t\t\t\"pointsPerDuck\": 100,\n\t\t\t\"speed\": 8,\n\t\t\t\"bullets\": 15,\n\t\t\t\"time\": 25\n\t\t}\n\t]\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/data/levels.json\n// module id = 280\n// module chunks = 0","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_DataView.js\n// module id = 281\n// module chunks = 0","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Hash.js\n// module id = 282\n// module chunks = 0","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Promise.js\n// module id = 283\n// module chunks = 0","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Set.js\n// module id = 284\n// module chunks = 0","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_SetCache.js\n// module id = 285\n// module chunks = 0","/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\nmodule.exports = addMapEntry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_addMapEntry.js\n// module id = 286\n// module chunks = 0","/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\nmodule.exports = addSetEntry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_addSetEntry.js\n// module id = 287\n// module chunks = 0","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayAggregator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayAggregator.js\n// module id = 288\n// module chunks = 0","/**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEachRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayEachRight.js\n// module id = 289\n// module chunks = 0","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayIncludes.js\n// module id = 290\n// module chunks = 0","/**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduceRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayReduceRight.js\n// module id = 291\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n copyArray = require('./_copyArray'),\n shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n}\n\nmodule.exports = arraySampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arraySampleSize.js\n// module id = 292\n// module chunks = 0","var copyArray = require('./_copyArray'),\n shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n}\n\nmodule.exports = arrayShuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayShuffle.js\n// module id = 293\n// module chunks = 0","var baseProperty = require('./_baseProperty');\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_asciiSize.js\n// module id = 294\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseAggregator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAggregator.js\n// module id = 295\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAssignIn.js\n// module id = 296\n// module chunks = 0","var get = require('./get');\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n}\n\nmodule.exports = baseAt;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAt.js\n// module id = 297\n// module chunks = 0","var baseConformsTo = require('./_baseConformsTo'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n}\n\nmodule.exports = baseConforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseConforms.js\n// module id = 298\n// module chunks = 0","/**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\nfunction baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = baseConformsTo;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseConformsTo.js\n// module id = 299\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseEvery.js\n// module id = 300\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseHas.js\n// module id = 301\n// module chunks = 0","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseHasIn.js\n// module id = 302\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\nfunction baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n}\n\nmodule.exports = baseInRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseInRange.js\n// module id = 303\n// module chunks = 0","var baseForOwn = require('./_baseForOwn');\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nmodule.exports = baseInverter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseInverter.js\n// module id = 304\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsArguments.js\n// module id = 305\n// module chunks = 0","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsEqualDeep.js\n// module id = 306\n// module chunks = 0","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsMatch.js\n// module id = 307\n// module chunks = 0","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNaN.js\n// module id = 308\n// module chunks = 0","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNative.js\n// module id = 309\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsTypedArray.js\n// module id = 310\n// module chunks = 0","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeysIn.js\n// module id = 311\n// module chunks = 0","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = object[key],\n srcValue = source[key],\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMergeDeep.js\n// module id = 312\n// module chunks = 0","var isIndex = require('./_isIndex');\n\n/**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\nfunction baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n}\n\nmodule.exports = baseNth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseNth.js\n// module id = 313\n// module chunks = 0","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePick.js\n// module id = 314\n// module chunks = 0","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePropertyDeep.js\n// module id = 315\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseRange.js\n// module id = 316\n// module chunks = 0","var arraySample = require('./_arraySample'),\n values = require('./values');\n\n/**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\nfunction baseSample(collection) {\n return arraySample(values(collection));\n}\n\nmodule.exports = baseSample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSample.js\n// module id = 317\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n shuffleSelf = require('./_shuffleSelf'),\n values = require('./values');\n\n/**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n}\n\nmodule.exports = baseSampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSampleSize.js\n// module id = 318\n// module chunks = 0","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSetToString.js\n// module id = 319\n// module chunks = 0","var shuffleSelf = require('./_shuffleSelf'),\n values = require('./values');\n\n/**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction baseShuffle(collection) {\n return shuffleSelf(values(collection));\n}\n\nmodule.exports = baseShuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseShuffle.js\n// module id = 320\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSome.js\n// module id = 321\n// module chunks = 0","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSortBy.js\n// module id = 322\n// module chunks = 0","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n}\n\nmodule.exports = baseToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseToPairs.js\n// module id = 323\n// module chunks = 0","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseToString.js\n// module id = 324\n// module chunks = 0","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cacheHas.js\n// module id = 325\n// module chunks = 0","var baseRest = require('./_baseRest');\n\n/**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nvar castRest = baseRest;\n\nmodule.exports = castRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_castRest.js\n// module id = 326\n// module chunks = 0","var baseSlice = require('./_baseSlice');\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nmodule.exports = castSlice;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_castSlice.js\n// module id = 327\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneDataView.js\n// module id = 328\n// module chunks = 0","var addMapEntry = require('./_addMapEntry'),\n arrayReduce = require('./_arrayReduce'),\n mapToArray = require('./_mapToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\nmodule.exports = cloneMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneMap.js\n// module id = 329\n// module chunks = 0","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneRegExp.js\n// module id = 330\n// module chunks = 0","var addSetEntry = require('./_addSetEntry'),\n arrayReduce = require('./_arrayReduce'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\nmodule.exports = cloneSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneSet.js\n// module id = 331\n// module chunks = 0","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneSymbol.js\n// module id = 332\n// module chunks = 0","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_compareAscending.js\n// module id = 333\n// module chunks = 0","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_compareMultiple.js\n// module id = 334\n// module chunks = 0","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_copySymbols.js\n// module id = 335\n// module chunks = 0","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_copySymbolsIn.js\n// module id = 336\n// module chunks = 0","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_coreJsData.js\n// module id = 337\n// module chunks = 0","/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nmodule.exports = countHolders;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_countHolders.js\n// module id = 338\n// module chunks = 0","var createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nmodule.exports = createBind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBind.js\n// module id = 339\n// module chunks = 0","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n createHybrid = require('./_createHybrid'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createCurry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createCurry.js\n// module id = 340\n// module chunks = 0","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createPartial;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createPartial.js\n// module id = 341\n// module chunks = 0","var eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n}\n\nmodule.exports = customDefaultsAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customDefaultsAssignIn.js\n// module id = 342\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n isObject = require('./isObject');\n\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n}\n\nmodule.exports = customDefaultsMerge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customDefaultsMerge.js\n// module id = 343\n// module chunks = 0","var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customOmitClone.js\n// module id = 344\n// module chunks = 0","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalByTag.js\n// module id = 345\n// module chunks = 0","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalObjects.js\n// module id = 346\n// module chunks = 0","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getMatchData.js\n// module id = 347\n// module chunks = 0","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getRawTag.js\n// module id = 348\n// module chunks = 0","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getValue.js\n// module id = 349\n// module chunks = 0","/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nmodule.exports = getWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getWrapDetails.js\n// module id = 350\n// module chunks = 0","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hasUnicode.js\n// module id = 351\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashClear.js\n// module id = 352\n// module chunks = 0","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashDelete.js\n// module id = 353\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashGet.js\n// module id = 354\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashHas.js\n// module id = 355\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashSet.js\n// module id = 356\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneArray.js\n// module id = 357\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneMap = require('./_cloneMap'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSet = require('./_cloneSet'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneByTag.js\n// module id = 358\n// module chunks = 0","/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nmodule.exports = insertWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_insertWrapDetails.js\n// module id = 359\n// module chunks = 0","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isFlattenable.js\n// module id = 360\n// module chunks = 0","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isKeyable.js\n// module id = 361\n// module chunks = 0","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isMasked.js\n// module id = 362\n// module chunks = 0","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheClear.js\n// module id = 363\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheDelete.js\n// module id = 364\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheGet.js\n// module id = 365\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheHas.js\n// module id = 366\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheSet.js\n// module id = 367\n// module chunks = 0","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheClear.js\n// module id = 368\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheDelete.js\n// module id = 369\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheGet.js\n// module id = 370\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheHas.js\n// module id = 371\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheSet.js\n// module id = 372\n// module chunks = 0","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_memoizeCapped.js\n// module id = 373\n// module chunks = 0","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nmodule.exports = mergeData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mergeData.js\n// module id = 374\n// module chunks = 0","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeys.js\n// module id = 375\n// module chunks = 0","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeysIn.js\n// module id = 376\n// module chunks = 0","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nodeUtil.js\n// module id = 377\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_objectToString.js\n// module id = 378\n// module chunks = 0","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_realNames.js\n// module id = 379\n// module chunks = 0","var copyArray = require('./_copyArray'),\n isIndex = require('./_isIndex');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nmodule.exports = reorder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_reorder.js\n// module id = 380\n// module chunks = 0","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setCacheAdd.js\n// module id = 381\n// module chunks = 0","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setCacheHas.js\n// module id = 382\n// module chunks = 0","/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n}\n\nmodule.exports = setToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setToPairs.js\n// module id = 383\n// module chunks = 0","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackClear.js\n// module id = 384\n// module chunks = 0","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackDelete.js\n// module id = 385\n// module chunks = 0","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackGet.js\n// module id = 386\n// module chunks = 0","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackHas.js\n// module id = 387\n// module chunks = 0","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackSet.js\n// module id = 388\n// module chunks = 0","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_strictIndexOf.js\n// module id = 389\n// module chunks = 0","var asciiSize = require('./_asciiSize'),\n hasUnicode = require('./_hasUnicode'),\n unicodeSize = require('./_unicodeSize');\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stringSize.js\n// module id = 390\n// module chunks = 0","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nmodule.exports = unicodeSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_unicodeSize.js\n// module id = 391\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n arrayIncludes = require('./_arrayIncludes');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nmodule.exports = updateWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_updateWrapDetails.js\n// module id = 392\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n copyArray = require('./_copyArray');\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nmodule.exports = wrapperClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_wrapperClone.js\n// module id = 393\n// module chunks = 0","var toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\nfunction after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n\nmodule.exports = after;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/after.js\n// module id = 394\n// module chunks = 0","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assign.js\n// module id = 395\n// module chunks = 0","var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keys = require('./keys');\n\n/**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n});\n\nmodule.exports = assignWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assignWith.js\n// module id = 396\n// module chunks = 0","var baseAt = require('./_baseAt'),\n flatRest = require('./_flatRest');\n\n/**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\nvar at = flatRest(baseAt);\n\nmodule.exports = at;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/at.js\n// module id = 397\n// module chunks = 0","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n isError = require('./isError');\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nmodule.exports = attempt;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/attempt.js\n// module id = 398\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseAssignValue = require('./_baseAssignValue'),\n bind = require('./bind'),\n flatRest = require('./_flatRest'),\n toKey = require('./_toKey');\n\n/**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\nvar bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n});\n\nmodule.exports = bindAll;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bindAll.js\n// module id = 399\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\nvar bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n});\n\n// Assign default placeholders.\nbindKey.placeholder = {};\n\nmodule.exports = bindKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bindKey.js\n// module id = 400\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n toNumber = require('./toNumber');\n\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n}\n\nmodule.exports = clamp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/clamp.js\n// module id = 401\n// module chunks = 0","var apply = require('./_apply'),\n arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseRest = require('./_baseRest');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\nfunction cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = baseIteratee;\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n}\n\nmodule.exports = cond;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/cond.js\n// module id = 402\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseConforms = require('./_baseConforms');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\nfunction conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = conforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/conforms.js\n// module id = 403\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\nvar countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n});\n\nmodule.exports = countBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/countBy.js\n// module id = 404\n// module chunks = 0","var baseAssign = require('./_baseAssign'),\n baseCreate = require('./_baseCreate');\n\n/**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\nfunction create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n}\n\nmodule.exports = create;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/create.js\n// module id = 405\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8;\n\n/**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\nfunction curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurry.placeholder = {};\n\nmodule.exports = curry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/curry.js\n// module id = 406\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_RIGHT_FLAG = 16;\n\n/**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\nfunction curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurryRight.placeholder = {};\n\nmodule.exports = curryRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/curryRight.js\n// module id = 407\n// module chunks = 0","/**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\nfunction defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n}\n\nmodule.exports = defaultTo;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaultTo.js\n// module id = 408\n// module chunks = 0","var apply = require('./_apply'),\n assignInWith = require('./assignInWith'),\n baseRest = require('./_baseRest'),\n customDefaultsAssignIn = require('./_customDefaultsAssignIn');\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(args) {\n args.push(undefined, customDefaultsAssignIn);\n return apply(assignInWith, undefined, args);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaults.js\n// module id = 409\n// module chunks = 0","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n customDefaultsMerge = require('./_customDefaultsMerge'),\n mergeWith = require('./mergeWith');\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\nvar defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n});\n\nmodule.exports = defaultsDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaultsDeep.js\n// module id = 410\n// module chunks = 0","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest');\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\nvar defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defer.js\n// module id = 411\n// module chunks = 0","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest'),\n toNumber = require('./toNumber');\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nmodule.exports = delay;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/delay.js\n// module id = 412\n// module chunks = 0","module.exports = require('./forEach');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/each.js\n// module id = 413\n// module chunks = 0","module.exports = require('./forEachRight');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/eachRight.js\n// module id = 414\n// module chunks = 0","module.exports = require('./toPairs');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/entries.js\n// module id = 415\n// module chunks = 0","module.exports = require('./toPairsIn');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/entriesIn.js\n// module id = 416\n// module chunks = 0","var arrayEvery = require('./_arrayEvery'),\n baseEvery = require('./_baseEvery'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = every;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/every.js\n// module id = 417\n// module chunks = 0","module.exports = require('./assignIn');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/extend.js\n// module id = 418\n// module chunks = 0","module.exports = require('./assignInWith');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/extendWith.js\n// module id = 419\n// module chunks = 0","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/filter.js\n// module id = 420\n// module chunks = 0","var createFind = require('./_createFind'),\n findIndex = require('./findIndex');\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/find.js\n// module id = 421\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findIndex.js\n// module id = 422\n// module chunks = 0","var baseFindKey = require('./_baseFindKey'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\nfunction findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n}\n\nmodule.exports = findKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findKey.js\n// module id = 423\n// module chunks = 0","var createFind = require('./_createFind'),\n findLastIndex = require('./findLastIndex');\n\n/**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\nvar findLast = createFind(findLastIndex);\n\nmodule.exports = findLast;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLast.js\n// module id = 424\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\nfunction findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n}\n\nmodule.exports = findLastIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLastIndex.js\n// module id = 425\n// module chunks = 0","var baseFindKey = require('./_baseFindKey'),\n baseForOwnRight = require('./_baseForOwnRight'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\nfunction findLastKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n}\n\nmodule.exports = findLastKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLastKey.js\n// module id = 426\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n}\n\nmodule.exports = flatMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMap.js\n// module id = 427\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nmodule.exports = flatMapDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMapDeep.js\n// module id = 428\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map'),\n toInteger = require('./toInteger');\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\nfunction flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n}\n\nmodule.exports = flatMapDepth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMapDepth.js\n// module id = 429\n// module chunks = 0","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatten.js\n// module id = 430\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\nfunction flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n}\n\nmodule.exports = flip;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flip.js\n// module id = 431\n// module chunks = 0","var createFlow = require('./_createFlow');\n\n/**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flow = createFlow();\n\nmodule.exports = flow;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flow.js\n// module id = 432\n// module chunks = 0","var createFlow = require('./_createFlow');\n\n/**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flowRight = createFlow(true);\n\nmodule.exports = flowRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flowRight.js\n// module id = 433\n// module chunks = 0","var baseFor = require('./_baseFor'),\n castFunction = require('./_castFunction'),\n keysIn = require('./keysIn');\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forIn.js\n// module id = 434\n// module chunks = 0","var baseForRight = require('./_baseForRight'),\n castFunction = require('./_castFunction'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\nfunction forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forInRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forInRight.js\n// module id = 435\n// module chunks = 0","var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forOwn.js\n// module id = 436\n// module chunks = 0","var baseForOwnRight = require('./_baseForOwnRight'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\nfunction forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwnRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forOwnRight.js\n// module id = 437\n// module chunks = 0","module.exports = {\n 'after': require('./after'),\n 'ary': require('./ary'),\n 'before': require('./before'),\n 'bind': require('./bind'),\n 'bindKey': require('./bindKey'),\n 'curry': require('./curry'),\n 'curryRight': require('./curryRight'),\n 'debounce': require('./debounce'),\n 'defer': require('./defer'),\n 'delay': require('./delay'),\n 'flip': require('./flip'),\n 'memoize': require('./memoize'),\n 'negate': require('./negate'),\n 'once': require('./once'),\n 'overArgs': require('./overArgs'),\n 'partial': require('./partial'),\n 'partialRight': require('./partialRight'),\n 'rearg': require('./rearg'),\n 'rest': require('./rest'),\n 'spread': require('./spread'),\n 'throttle': require('./throttle'),\n 'unary': require('./unary'),\n 'wrap': require('./wrap')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/function.js\n// module id = 438\n// module chunks = 0","var baseFunctions = require('./_baseFunctions'),\n keys = require('./keys');\n\n/**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\nfunction functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n}\n\nmodule.exports = functions;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/functions.js\n// module id = 439\n// module chunks = 0","var baseFunctions = require('./_baseFunctions'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\nfunction functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n}\n\nmodule.exports = functionsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/functionsIn.js\n// module id = 440\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nmodule.exports = groupBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/groupBy.js\n// module id = 441\n// module chunks = 0","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/has.js\n// module id = 442\n// module chunks = 0","var baseInRange = require('./_baseInRange'),\n toFinite = require('./toFinite'),\n toNumber = require('./toNumber');\n\n/**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\nfunction inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n}\n\nmodule.exports = inRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/inRange.js\n// module id = 443\n// module chunks = 0","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/includes.js\n// module id = 444\n// module chunks = 0","var constant = require('./constant'),\n createInverter = require('./_createInverter'),\n identity = require('./identity');\n\n/**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\nvar invert = createInverter(function(result, value, key) {\n result[value] = key;\n}, constant(identity));\n\nmodule.exports = invert;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invert.js\n// module id = 445\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n createInverter = require('./_createInverter');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\nvar invertBy = createInverter(function(result, value, key) {\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n}, baseIteratee);\n\nmodule.exports = invertBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invertBy.js\n// module id = 446\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\nvar invoke = baseRest(baseInvoke);\n\nmodule.exports = invoke;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invoke.js\n// module id = 447\n// module chunks = 0","var apply = require('./_apply'),\n baseEach = require('./_baseEach'),\n baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\nvar invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n});\n\nmodule.exports = invokeMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invokeMap.js\n// module id = 448\n// module chunks = 0","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isArrayLikeObject.js\n// module id = 449\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike'),\n isPlainObject = require('./isPlainObject');\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nmodule.exports = isError;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isError.js\n// module id = 450\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseIteratee = require('./_baseIteratee');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\nfunction iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = iteratee;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/iteratee.js\n// module id = 451\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\nvar keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n});\n\nmodule.exports = keyBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/keyBy.js\n// module id = 452\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\nfunction mapKeys(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n}\n\nmodule.exports = mapKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mapKeys.js\n// module id = 453\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nmodule.exports = mapValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mapValues.js\n// module id = 454\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseMatches = require('./_baseMatches');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n */\nfunction matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = matches;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/matches.js\n// module id = 455\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseMatchesProperty = require('./_baseMatchesProperty');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n */\nfunction matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = matchesProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/matchesProperty.js\n// module id = 456\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/merge.js\n// module id = 457\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\nvar method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n});\n\nmodule.exports = method;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/method.js\n// module id = 458\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\nvar methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n});\n\nmodule.exports = methodOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/methodOf.js\n// module id = 459\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n arrayPush = require('./_arrayPush'),\n baseFunctions = require('./_baseFunctions'),\n copyArray = require('./_copyArray'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n keys = require('./keys');\n\n/**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\nfunction mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n}\n\nmodule.exports = mixin;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mixin.js\n// module id = 460\n// module chunks = 0","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/now.js\n// module id = 461\n// module chunks = 0","var baseNth = require('./_baseNth'),\n baseRest = require('./_baseRest'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\nfunction nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n}\n\nmodule.exports = nthArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/nthArg.js\n// module id = 462\n// module chunks = 0","module.exports = {\n 'clamp': require('./clamp'),\n 'inRange': require('./inRange'),\n 'random': require('./random')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/number.js\n// module id = 463\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nmodule.exports = omit;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/omit.js\n// module id = 464\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n negate = require('./negate'),\n pickBy = require('./pickBy');\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\nfunction omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n}\n\nmodule.exports = omitBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/omitBy.js\n// module id = 465\n// module chunks = 0","var before = require('./before');\n\n/**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\nfunction once(func) {\n return before(2, func);\n}\n\nmodule.exports = once;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/once.js\n// module id = 466\n// module chunks = 0","var baseOrderBy = require('./_baseOrderBy'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nfunction orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n}\n\nmodule.exports = orderBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/orderBy.js\n// module id = 467\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\nvar over = createOver(arrayMap);\n\nmodule.exports = over;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/over.js\n// module id = 468\n// module chunks = 0","var apply = require('./_apply'),\n arrayMap = require('./_arrayMap'),\n baseFlatten = require('./_baseFlatten'),\n baseIteratee = require('./_baseIteratee'),\n baseRest = require('./_baseRest'),\n baseUnary = require('./_baseUnary'),\n castRest = require('./_castRest'),\n isArray = require('./isArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\nvar overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(baseIteratee))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n});\n\nmodule.exports = overArgs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overArgs.js\n// module id = 469\n// module chunks = 0","var arrayEvery = require('./_arrayEvery'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\nvar overEvery = createOver(arrayEvery);\n\nmodule.exports = overEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overEvery.js\n// module id = 470\n// module chunks = 0","var arraySome = require('./_arraySome'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n */\nvar overSome = createOver(arraySome);\n\nmodule.exports = overSome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overSome.js\n// module id = 471\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\nvar partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartialRight.placeholder = {};\n\nmodule.exports = partialRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partialRight.js\n// module id = 472\n// module chunks = 0","var createAggregator = require('./_createAggregator');\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nmodule.exports = partition;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partition.js\n// module id = 473\n// module chunks = 0","var basePick = require('./_basePick'),\n flatRest = require('./_flatRest');\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nmodule.exports = pick;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/pick.js\n// module id = 474\n// module chunks = 0","var baseGet = require('./_baseGet');\n\n/**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\nfunction propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n}\n\nmodule.exports = propertyOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/propertyOf.js\n// module id = 475\n// module chunks = 0","var baseRandom = require('./_baseRandom'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseFloat = parseFloat;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min,\n nativeRandom = Math.random;\n\n/**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\nfunction random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n}\n\nmodule.exports = random;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/random.js\n// module id = 476\n// module chunks = 0","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/range.js\n// module id = 477\n// module chunks = 0","var createRange = require('./_createRange');\n\n/**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\nvar rangeRight = createRange(true);\n\nmodule.exports = rangeRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rangeRight.js\n// module id = 478\n// module chunks = 0","var createWrap = require('./_createWrap'),\n flatRest = require('./_flatRest');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\nvar rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n});\n\nmodule.exports = rearg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rearg.js\n// module id = 479\n// module chunks = 0","var arrayReduce = require('./_arrayReduce'),\n baseEach = require('./_baseEach'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reduce.js\n// module id = 480\n// module chunks = 0","var arrayReduceRight = require('./_arrayReduceRight'),\n baseEachRight = require('./_baseEachRight'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\nfunction reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n}\n\nmodule.exports = reduceRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reduceRight.js\n// module id = 481\n// module chunks = 0","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n negate = require('./negate');\n\n/**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\nfunction reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n}\n\nmodule.exports = reject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reject.js\n// module id = 482\n// module chunks = 0","var baseRest = require('./_baseRest'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n}\n\nmodule.exports = rest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rest.js\n// module id = 483\n// module chunks = 0","var castPath = require('./_castPath'),\n isFunction = require('./isFunction'),\n toKey = require('./_toKey');\n\n/**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\nfunction result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n}\n\nmodule.exports = result;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/result.js\n// module id = 484\n// module chunks = 0","var arraySample = require('./_arraySample'),\n baseSample = require('./_baseSample'),\n isArray = require('./isArray');\n\n/**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\nfunction sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n}\n\nmodule.exports = sample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sample.js\n// module id = 485\n// module chunks = 0","var arraySampleSize = require('./_arraySampleSize'),\n baseSampleSize = require('./_baseSampleSize'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n}\n\nmodule.exports = sampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sampleSize.js\n// module id = 486\n// module chunks = 0","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/set.js\n// module id = 487\n// module chunks = 0","var baseSet = require('./_baseSet');\n\n/**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n}\n\nmodule.exports = setWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/setWith.js\n// module id = 488\n// module chunks = 0","var arrayShuffle = require('./_arrayShuffle'),\n baseShuffle = require('./_baseShuffle'),\n isArray = require('./isArray');\n\n/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\nfunction shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n}\n\nmodule.exports = shuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/shuffle.js\n// module id = 489\n// module chunks = 0","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n stringSize = require('./_stringSize');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n}\n\nmodule.exports = size;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/size.js\n// module id = 490\n// module chunks = 0","var arraySome = require('./_arraySome'),\n baseIteratee = require('./_baseIteratee'),\n baseSome = require('./_baseSome'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = some;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/some.js\n// module id = 491\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sortBy.js\n// module id = 492\n// module chunks = 0","var apply = require('./_apply'),\n arrayPush = require('./_arrayPush'),\n baseRest = require('./_baseRest'),\n castSlice = require('./_castSlice'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\nfunction spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n}\n\nmodule.exports = spread;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/spread.js\n// module id = 493\n// module chunks = 0","/**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\nfunction stubObject() {\n return {};\n}\n\nmodule.exports = stubObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubObject.js\n// module id = 494\n// module chunks = 0","/**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\nfunction stubString() {\n return '';\n}\n\nmodule.exports = stubString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubString.js\n// module id = 495\n// module chunks = 0","/**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\nfunction stubTrue() {\n return true;\n}\n\nmodule.exports = stubTrue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubTrue.js\n// module id = 496\n// module chunks = 0","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/throttle.js\n// module id = 497\n// module chunks = 0","var baseTimes = require('./_baseTimes'),\n castFunction = require('./_castFunction'),\n toInteger = require('./toInteger');\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\nfunction times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = castFunction(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n}\n\nmodule.exports = times;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/times.js\n// module id = 498\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n copyArray = require('./_copyArray'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol'),\n stringToPath = require('./_stringToPath'),\n toKey = require('./_toKey'),\n toString = require('./toString');\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nmodule.exports = toPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPath.js\n// module id = 499\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPlainObject.js\n// module id = 500\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseCreate = require('./_baseCreate'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee'),\n getPrototype = require('./_getPrototype'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isTypedArray = require('./isTypedArray');\n\n/**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\nfunction transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = baseIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n}\n\nmodule.exports = transform;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/transform.js\n// module id = 501\n// module chunks = 0","var ary = require('./ary');\n\n/**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\nfunction unary(func) {\n return ary(func, 1);\n}\n\nmodule.exports = unary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/unary.js\n// module id = 502\n// module chunks = 0","var toString = require('./toString');\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nmodule.exports = uniqueId;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/uniqueId.js\n// module id = 503\n// module chunks = 0","var baseUnset = require('./_baseUnset');\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nmodule.exports = unset;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/unset.js\n// module id = 504\n// module chunks = 0","var baseUpdate = require('./_baseUpdate'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\nfunction update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n}\n\nmodule.exports = update;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/update.js\n// module id = 505\n// module chunks = 0","var baseUpdate = require('./_baseUpdate'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n}\n\nmodule.exports = updateWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/updateWith.js\n// module id = 506\n// module chunks = 0","var baseValues = require('./_baseValues'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\nfunction valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n}\n\nmodule.exports = valuesIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/valuesIn.js\n// module id = 507\n// module chunks = 0","var castFunction = require('./_castFunction'),\n partial = require('./partial');\n\n/**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\nfunction wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n}\n\nmodule.exports = wrap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/wrap.js\n// module id = 508\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n baseLodash = require('./_baseLodash'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike'),\n wrapperClone = require('./_wrapperClone');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nmodule.exports = lodash;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/wrapperLodash.js\n// module id = 509\n// module chunks = 0","var apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\nexports.setImmediate = setImmediate;\nexports.clearImmediate = clearImmediate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-libs-browser/~/timers-browserify/main.js\n// module id = 510\n// module chunks = 0","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/object-assign/index.js\n// module id = 511\n// module chunks = 0","var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);\n\n/**\n * Helper class to create a webGL buffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\nvar Buffer = function(gl, type, data, drawType)\n{\n\n\t/**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n\tthis.gl = gl;\n\n\t/**\n * The WebGL buffer, created upon instantiation\n *\n * @member {WebGLBuffer}\n */\n\tthis.buffer = gl.createBuffer();\n\n\t/**\n * The type of the buffer\n *\n * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER}\n */\n\tthis.type = type || gl.ARRAY_BUFFER;\n\n\t/**\n * The draw type of the buffer\n *\n * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\n\tthis.drawType = drawType || gl.STATIC_DRAW;\n\n\t/**\n * The data in the buffer, as a typed array\n *\n * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView}\n */\n\tthis.data = EMPTY_ARRAY_BUFFER;\n\n\tif(data)\n\t{\n\t\tthis.upload(data);\n\t}\n\n\tthis._updateID = 0;\n};\n\n/**\n * Uploads the buffer to the GPU\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload\n * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract\n * @param dontBind {Boolean} whether to bind the buffer before uploading it\n */\nBuffer.prototype.upload = function(data, offset, dontBind)\n{\n\t// todo - needed?\n\tif(!dontBind) this.bind();\n\n\tvar gl = this.gl;\n\n\tdata = data || this.data;\n\toffset = offset || 0;\n\n\tif(this.data.byteLength >= data.byteLength)\n\t{\n\t\tgl.bufferSubData(this.type, offset, data);\n\t}\n\telse\n\t{\n\t\tgl.bufferData(this.type, data, this.drawType);\n\t}\n\n\tthis.data = data;\n};\n/**\n * Binds the buffer\n *\n */\nBuffer.prototype.bind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindBuffer(this.type, this.buffer);\n};\n\nBuffer.createVertexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.createIndexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.create = function(gl, type, data, drawType)\n{\n\treturn new Buffer(gl, type, data, drawType);\n};\n\n/**\n * Destroys the buffer\n *\n */\nBuffer.prototype.destroy = function(){\n\tthis.gl.deleteBuffer(this.buffer);\n};\n\nmodule.exports = Buffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLBuffer.js\n// module id = 512\n// module chunks = 0","\nvar Texture = require('./GLTexture');\n\n/**\n * Helper class to create a webGL Framebuffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n */\nvar Framebuffer = function(gl, width, height)\n{\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * The frame buffer\n *\n * @member {WebGLFramebuffer}\n */\n this.framebuffer = gl.createFramebuffer();\n\n /**\n * The stencil buffer\n *\n * @member {WebGLRenderbuffer}\n */\n this.stencil = null;\n\n /**\n * The stencil buffer\n *\n * @member {PIXI.glCore.GLTexture}\n */\n this.texture = null;\n\n /**\n * The width of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.width = width || 100;\n /**\n * The height of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.height = height || 100;\n};\n\n/**\n * Adds a texture to the frame buffer\n * @param texture {PIXI.glCore.GLTexture}\n */\nFramebuffer.prototype.enableTexture = function(texture)\n{\n var gl = this.gl;\n\n this.texture = texture || new Texture(gl);\n\n this.texture.bind();\n\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n this.bind();\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0);\n};\n\n/**\n * Initialises the stencil buffer\n */\nFramebuffer.prototype.enableStencil = function()\n{\n if(this.stencil)return;\n\n var gl = this.gl;\n\n this.stencil = gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n\n // TODO.. this is depth AND stencil?\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width , this.height );\n\n\n};\n\n/**\n * Erases the drawing area and fills it with a colour\n * @param r {Number} the red value of the clearing colour\n * @param g {Number} the green value of the clearing colour\n * @param b {Number} the blue value of the clearing colour\n * @param a {Number} the alpha value of the clearing colour\n */\nFramebuffer.prototype.clear = function( r, g, b, a )\n{\n this.bind();\n\n var gl = this.gl;\n\n gl.clearColor(r, g, b, a);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n};\n\n/**\n * Binds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.bind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );\n};\n\n/**\n * Unbinds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.unbind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null );\n};\n/**\n * Resizes the drawing area of the buffer to the given width and height\n * @param width {Number} the new width\n * @param height {Number} the new height\n */\nFramebuffer.prototype.resize = function(width, height)\n{\n var gl = this.gl;\n\n this.width = width;\n this.height = height;\n\n if ( this.texture )\n {\n this.texture.uploadData(null, width, height);\n }\n\n if ( this.stencil )\n {\n // update the stencil buffer width and height\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);\n }\n};\n\n/**\n * Destroys this buffer\n */\nFramebuffer.prototype.destroy = function()\n{\n var gl = this.gl;\n\n //TODO\n if(this.texture)\n {\n this.texture.destroy();\n }\n\n gl.deleteFramebuffer(this.framebuffer);\n\n this.gl = null;\n\n this.stencil = null;\n this.texture = null;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createRGBA = function(gl, width, height, data)\n{\n var texture = Texture.fromData(gl, null, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n\n //fbo.enableStencil(); // get this back on soon!\n\n fbo.unbind();\n\n return fbo;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createFloat32 = function(gl, width, height, data)\n{\n // create a new texture..\n var texture = new Texture.fromData(gl, data, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n\n fbo.unbind();\n\n return fbo;\n};\n\nmodule.exports = Framebuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLFramebuffer.js\n// module id = 513\n// module chunks = 0","\nvar compileProgram = require('./shader/compileProgram'),\n\textractAttributes = require('./shader/extractAttributes'),\n\textractUniforms = require('./shader/extractUniforms'),\n\tsetPrecision = require('./shader/setPrecision'),\n\tgenerateUniformAccessObject = require('./shader/generateUniformAccessObject');\n\n/**\n * Helper class to create a webGL Shader\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param precision {precision]} The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n * @param attributeLocations {object} A key value pair showing which location eact attribute should sit eg {position:0, uvs:1}\n */\nvar Shader = function(gl, vertexSrc, fragmentSrc, precision, attributeLocations)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\tif(precision)\n\t{\n\t\tvertexSrc = setPrecision(vertexSrc, precision);\n\t\tfragmentSrc = setPrecision(fragmentSrc, precision);\n\t}\n\n\t/**\n\t * The shader program\n\t *\n\t * @member {WebGLProgram}\n\t */\n\t// First compile the program..\n\tthis.program = compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations);\n\n\t/**\n\t * The attributes of the shader as an object containing the following properties\n\t * {\n\t * \ttype,\n\t * \tsize,\n\t * \tlocation,\n\t * \tpointer\n\t * }\n\t * @member {Object}\n\t */\n\t// next extract the attributes\n\tthis.attributes = extractAttributes(gl, this.program);\n\n this.uniformData = extractUniforms(gl, this.program);\n\n\t/**\n\t * The uniforms of the shader as an object containing the following properties\n\t * {\n\t * \tgl,\n\t * \tdata\n\t * }\n\t * @member {Object}\n\t */\n\tthis.uniforms = generateUniformAccessObject( gl, this.uniformData );\n\n};\n/**\n * Uses this shader\n */\nShader.prototype.bind = function()\n{\n\tthis.gl.useProgram(this.program);\n};\n\n/**\n * Destroys this shader\n * TODO\n */\nShader.prototype.destroy = function()\n{\n\tthis.attributes = null;\n\tthis.uniformData = null;\n\tthis.uniforms = null;\n\n\tvar gl = this.gl;\n\tgl.deleteProgram(this.program);\n};\n\n\nmodule.exports = Shader;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLShader.js\n// module id = 514\n// module chunks = 0","\n// state object//\nvar setVertexAttribArrays = require( './setVertexAttribArrays' );\n\n/**\n * Helper class to work with WebGL VertexArrayObjects (vaos)\n * Only works if WebGL extensions are enabled (they usually are)\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n */\nfunction VertexArrayObject(gl, state)\n{\n this.nativeVaoExtension = null;\n\n if(!VertexArrayObject.FORCE_NATIVE)\n {\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') ||\n gl.getExtension('MOZ_OES_vertex_array_object') ||\n gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n this.nativeState = state;\n\n if(this.nativeVaoExtension)\n {\n this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();\n\n var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n // VAO - overwrite the state..\n this.nativeState = {\n tempAttribState: new Array(maxAttribs),\n attribState: new Array(maxAttribs)\n };\n }\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of attributes\n *\n * @member {Array}\n */\n this.attributes = [];\n\n /**\n * @member {PIXI.glCore.GLBuffer}\n */\n this.indexBuffer = null;\n\n /**\n * A boolean flag\n *\n * @member {Boolean}\n */\n this.dirty = false;\n}\n\nVertexArrayObject.prototype.constructor = VertexArrayObject;\nmodule.exports = VertexArrayObject;\n\n/**\n* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n* If you find on older devices that things have gone a bit weird then set this to true.\n*/\n/**\n * Lets the VAO know if you should use the WebGL extension or the native methods.\n * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n * If you find on older devices that things have gone a bit weird then set this to true.\n * @static\n * @property {Boolean} FORCE_NATIVE\n */\nVertexArrayObject.FORCE_NATIVE = false;\n\n/**\n * Binds the buffer\n */\nVertexArrayObject.prototype.bind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n\n if(this.dirty)\n {\n this.dirty = false;\n this.activate();\n }\n }\n else\n {\n\n this.activate();\n }\n\n return this;\n};\n\n/**\n * Unbinds the buffer\n */\nVertexArrayObject.prototype.unbind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n return this;\n};\n\n/**\n * Uses this vao\n */\nVertexArrayObject.prototype.activate = function()\n{\n\n var gl = this.gl;\n var lastBuffer = null;\n\n for (var i = 0; i < this.attributes.length; i++)\n {\n var attrib = this.attributes[i];\n\n if(lastBuffer !== attrib.buffer)\n {\n attrib.buffer.bind();\n lastBuffer = attrib.buffer;\n }\n\n gl.vertexAttribPointer(attrib.attribute.location,\n attrib.attribute.size,\n attrib.type || gl.FLOAT,\n attrib.normalized || false,\n attrib.stride || 0,\n attrib.start || 0);\n }\n\n setVertexAttribArrays(gl, this.attributes, this.nativeState);\n\n if(this.indexBuffer)\n {\n this.indexBuffer.bind();\n }\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n * @param attribute {*}\n * @param type {String}\n * @param normalized {Boolean}\n * @param stride {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start)\n{\n this.attributes.push({\n buffer: buffer,\n attribute: attribute,\n\n location: attribute.location,\n type: type || this.gl.FLOAT,\n normalized: normalized || false,\n stride: stride || 0,\n start: start || 0\n });\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n */\nVertexArrayObject.prototype.addIndex = function(buffer/*, options*/)\n{\n this.indexBuffer = buffer;\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n * Unbinds this vao and disables it\n */\nVertexArrayObject.prototype.clear = function()\n{\n // var gl = this.gl;\n\n // TODO - should this function unbind after clear?\n // for now, no but lets see what happens in the real world!\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n }\n\n this.attributes.length = 0;\n this.indexBuffer = null;\n\n return this;\n};\n\n/**\n * @param type {Number}\n * @param size {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.draw = function(type, size, start)\n{\n var gl = this.gl;\n\n if(this.indexBuffer)\n {\n gl.drawElements(type, size || this.indexBuffer.data.length, gl.UNSIGNED_SHORT, (start || 0) * 2 );\n }\n else\n {\n // TODO need a better way to calculate size..\n gl.drawArrays(type, start, size || this.getSize());\n }\n\n return this;\n};\n\n/**\n * Destroy this vao\n */\nVertexArrayObject.prototype.destroy = function()\n{\n // lose references\n this.gl = null;\n this.indexBuffer = null;\n this.attributes = null;\n this.nativeState = null;\n\n if(this.nativeVao)\n {\n this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao);\n }\n\n this.nativeVaoExtension = null;\n this.nativeVao = null;\n};\n\nVertexArrayObject.prototype.getSize = function()\n{\n var attrib = this.attributes[0];\n return attrib.buffer.data.length / (( attrib.stride/4 ) || attrib.attribute.size);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/VertexArrayObject.js\n// module id = 515\n// module chunks = 0","\n/**\n * Helper class to create a webGL Context\n *\n * @class\n * @memberof PIXI.glCore\n * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from\n * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes,\n * see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available\n * @return {WebGLRenderingContext} the WebGL context\n */\nvar createContext = function(canvas, options)\n{\n var gl = canvas.getContext('webgl', options) || \n canvas.getContext('experimental-webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support webGL. Try using the canvas renderer');\n }\n\n return gl;\n};\n\nmodule.exports = createContext;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/createContext.js\n// module id = 516\n// module chunks = 0","module.exports = {\n compileProgram: require('./compileProgram'),\n defaultValue: require('./defaultValue'),\n extractAttributes: require('./extractAttributes'),\n extractUniforms: require('./extractUniforms'),\n generateUniformAccessObject: require('./generateUniformAccessObject'),\n setPrecision: require('./setPrecision'),\n mapSize: require('./mapSize'),\n mapType: require('./mapType')\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/index.js\n// module id = 517\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nvar _accessibleTarget2 = _interopRequireDefault(_accessibleTarget);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// add some extra variables to the container..\nObject.assign(core.DisplayObject.prototype, _accessibleTarget2.default);\n\nvar KEY_CODE_TAB = 9;\n\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\n\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n\n/**\n * The Accessibility manager reacreates the ability to tab and and have content read by screen\n * readers. This is very important as it can possibly help people with disabilities access pixi\n * content.\n *\n * Much like interaction any DisplayObject can be made accessible. This manager will map the\n * events as if the mouse was being used, minimizing the efferot required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility\n *\n * @class\n * @memberof PIXI.accessibility\n */\n\nvar AccessibilityManager = function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n _classCallCheck(this, AccessibilityManager);\n\n if ((_ismobilejs2.default.tablet || _ismobilejs2.default.phone) && !navigator.isCocoonJS) {\n this.createTouchHook();\n }\n\n // first we create a div that will sit over the pixi element. This is where the div overlays will go.\n var div = document.createElement('div');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + 'px';\n div.style.left = DIV_TOUCH_POS_Y + 'px';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n\n /**\n * This is the dom element that will sit over the pixi element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n\n /**\n * Setting this to true will visually show the divs\n *\n * @type {boolean}\n */\n this.debug = false;\n\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n\n /**\n * pre-bind the functions\n *\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onMouseMove = this._onMouseMove.bind(this);\n\n /**\n * stores the state of the manager. If there are no accessible objects or the mouse is moving the will be false.\n *\n * @member {Array<*>}\n * @private\n */\n this.isActive = false;\n this.isMobileAccessabillity = false;\n\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n\n /**\n * Creates the touch hooks.\n *\n */\n\n\n AccessibilityManager.prototype.createTouchHook = function createTouchHook() {\n var _this = this;\n\n var hookDiv = document.createElement('button');\n\n hookDiv.style.width = DIV_HOOK_SIZE + 'px';\n hookDiv.style.height = DIV_HOOK_SIZE + 'px';\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + 'px';\n hookDiv.style.left = DIV_HOOK_POS_Y + 'px';\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX;\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'HOOK DIV';\n\n hookDiv.addEventListener('focus', function () {\n _this.isMobileAccessabillity = true;\n _this.activate();\n document.body.removeChild(hookDiv);\n });\n\n document.body.appendChild(hookDiv);\n };\n\n /**\n * Activating will cause the Accessibility layer to be shown. This is called when a user\n * preses the tab key\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.activate = function activate() {\n if (this.isActive) {\n return;\n }\n\n this.isActive = true;\n\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.on('postrender', this.update, this);\n\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n };\n\n /**\n * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves\n * the mouse\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.deactivate = function deactivate() {\n if (!this.isActive || this.isMobileAccessabillity) {\n return;\n }\n\n this.isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.off('postrender', this.update);\n\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n };\n\n /**\n * This recursive function will run throught he scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n\n\n AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects(displayObject) {\n if (!displayObject.visible) {\n return;\n }\n\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n\n displayObject.renderId = this.renderId;\n }\n\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n this.updateAccessibleObjects(children[i]);\n }\n };\n\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.update = function update() {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n\n // update children...\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n\n var rect = this.renderer.view.getBoundingClientRect();\n var sx = rect.width / this.renderer.width;\n var sy = rect.height / this.renderer.height;\n\n var div = this.div;\n\n div.style.left = rect.left + 'px';\n div.style.top = rect.top + 'px';\n div.style.width = this.renderer.width + 'px';\n div.style.height = this.renderer.height + 'px';\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n\n core.utils.removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n\n i--;\n\n if (this.children.length === 0) {\n this.deactivate();\n }\n } else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n\n if (child.hitArea) {\n div.style.left = (wt.tx + hitArea.x * wt.a) * sx + 'px';\n div.style.top = (wt.ty + hitArea.y * wt.d) * sy + 'px';\n\n div.style.width = hitArea.width * wt.a * sx + 'px';\n div.style.height = hitArea.height * wt.d * sy + 'px';\n } else {\n hitArea = child.getBounds();\n\n this.capHitArea(hitArea);\n\n div.style.left = hitArea.x * sx + 'px';\n div.style.top = hitArea.y * sy + 'px';\n\n div.style.width = hitArea.width * sx + 'px';\n div.style.height = hitArea.height * sy + 'px';\n }\n }\n }\n\n // increment the render id..\n this.renderId++;\n };\n\n /**\n * TODO: docs.\n *\n * @param {Rectangle} hitArea - TODO docs\n */\n\n\n AccessibilityManager.prototype.capHitArea = function capHitArea(hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n\n if (hitArea.x + hitArea.width > this.renderer.width) {\n hitArea.width = this.renderer.width - hitArea.x;\n }\n\n if (hitArea.y + hitArea.height > this.renderer.height) {\n hitArea.height = this.renderer.height - hitArea.y;\n }\n };\n\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {DisplayObject} displayObject - The child to make accessible.\n */\n\n\n AccessibilityManager.prototype.addChild = function addChild(displayObject) {\n // this.activate();\n\n var div = this.pool.pop();\n\n if (!div) {\n div = document.createElement('button');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n div.style.borderStyle = 'none';\n\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n\n if (displayObject.accessibleTitle) {\n div.title = displayObject.accessibleTitle;\n } else if (!displayObject.accessibleTitle && !displayObject.accessibleHint) {\n div.title = 'displayObject ' + this.tabIndex;\n }\n\n if (displayObject.accessibleHint) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n\n //\n\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n\n\n AccessibilityManager.prototype._onClick = function _onClick(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixis InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n\n\n AccessibilityManager.prototype._onFocus = function _onFocus(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixis InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n\n\n AccessibilityManager.prototype._onFocusOut = function _onFocusOut(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n };\n\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n\n\n AccessibilityManager.prototype._onKeyDown = function _onKeyDown(e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n\n this.activate();\n };\n\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n */\n\n\n AccessibilityManager.prototype._onMouseMove = function _onMouseMove() {\n this.deactivate();\n };\n\n /**\n * Destroys the accessibility manager\n *\n */\n\n\n AccessibilityManager.prototype.destroy = function destroy() {\n this.div = null;\n\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n\n return AccessibilityManager;\n}();\n\nexports.default = AccessibilityManager;\n\n\ncore.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager);\ncore.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager);\n//# sourceMappingURL=AccessibilityManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/AccessibilityManager.js\n// module id = 518\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nObject.defineProperty(exports, 'accessibleTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_accessibleTarget).default;\n }\n});\n\nvar _AccessibilityManager = require('./AccessibilityManager');\n\nObject.defineProperty(exports, 'AccessibilityManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AccessibilityManager).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/index.js\n// module id = 519\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _autoDetectRenderer = require('./autoDetectRenderer');\n\nvar _Container = require('./display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _Ticker = require('./ticker/Ticker');\n\nvar _Ticker2 = _interopRequireDefault(_Ticker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Convenience class to create a new PIXI application.\n * This class automatically creates the renderer, ticker\n * and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.fromImage('something.png'));\n *\n * @class\n * @memberof PIXI\n */\nvar Application = function () {\n /**\n * @param {number} [width=800] - the width of the renderers view\n * @param {number} [height=600] - the height of the renderers view\n * @param {object} [options] - The optional renderer parameters\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [noWebGL=false] - prevents selection of WebGL renderer, even if such is present\n */\n function Application(width, height, options, noWebGL) {\n _classCallCheck(this, Application);\n\n /**\n * WebGL renderer if available, otherwise CanvasRenderer\n * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer}\n */\n this.renderer = (0, _autoDetectRenderer.autoDetectRenderer)(width, height, options, noWebGL);\n\n /**\n * The root display container that's renderered.\n * @member {PIXI.Container}\n */\n this.stage = new _Container2.default();\n\n /**\n * Ticker for doing render updates.\n * @member {PIXI.ticker.Ticker}\n */\n this.ticker = new _Ticker2.default();\n\n this.ticker.add(this.render, this);\n\n // Start the rendering\n this.start();\n }\n\n /**\n * Render the current stage.\n */\n\n\n Application.prototype.render = function render() {\n this.renderer.render(this.stage);\n };\n\n /**\n * Convenience method for stopping the render.\n */\n\n\n Application.prototype.stop = function stop() {\n this.ticker.stop();\n };\n\n /**\n * Convenience method for starting the render.\n */\n\n\n Application.prototype.start = function start() {\n this.ticker.start();\n };\n\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n\n\n /**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.\n */\n Application.prototype.destroy = function destroy(removeView) {\n this.stop();\n this.ticker.remove(this.render, this);\n this.ticker = null;\n\n this.stage.destroy();\n this.stage = null;\n\n this.renderer.destroy(removeView);\n this.renderer = null;\n };\n\n _createClass(Application, [{\n key: 'view',\n get: function get() {\n return this.renderer.view;\n }\n }]);\n\n return Application;\n}();\n\nexports.default = Application;\n//# sourceMappingURL=Application.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/Application.js\n// module id = 520\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Container2 = require('../display/Container');\n\nvar _Container3 = _interopRequireDefault(_Container2);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _GraphicsData = require('./GraphicsData');\n\nvar _GraphicsData2 = _interopRequireDefault(_GraphicsData);\n\nvar _Sprite = require('../sprites/Sprite');\n\nvar _Sprite2 = _interopRequireDefault(_Sprite);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _Bounds = require('../display/Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _bezierCurveTo2 = require('./utils/bezierCurveTo');\n\nvar _bezierCurveTo3 = _interopRequireDefault(_bezierCurveTo2);\n\nvar _CanvasRenderer = require('../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar canvasRenderer = void 0;\nvar tempMatrix = new _math.Matrix();\nvar tempPoint = new _math.Point();\nvar tempColor1 = new Float32Array(4);\nvar tempColor2 = new Float32Array(4);\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\n\nvar Graphics = function (_Container) {\n _inherits(Graphics, _Container);\n\n /**\n *\n */\n function Graphics() {\n _classCallCheck(this, Graphics);\n\n /**\n * The alpha value used when filling the Graphics object.\n *\n * @member {number}\n * @default 1\n */\n var _this = _possibleConstructorReturn(this, _Container.call(this));\n\n _this.fillAlpha = 1;\n\n /**\n * The width (thickness) of any lines drawn.\n *\n * @member {number}\n * @default 0\n */\n _this.lineWidth = 0;\n\n /**\n * The color of any lines drawn.\n *\n * @member {string}\n * @default 0\n */\n _this.lineColor = 0;\n\n /**\n * Graphics data\n *\n * @member {PIXI.GraphicsData[]}\n * @private\n */\n _this.graphicsData = [];\n\n /**\n * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to\n * reset the tint.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n _this.tint = 0xFFFFFF;\n\n /**\n * The previous tint applied to the graphic shape. Used to compare to the current tint and\n * check if theres change.\n *\n * @member {number}\n * @private\n * @default 0xFFFFFF\n */\n _this._prevTint = 0xFFFFFF;\n\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = _const.BLEND_MODES.NORMAL;\n\n /**\n * Current path\n *\n * @member {PIXI.GraphicsData}\n * @private\n */\n _this.currentPath = null;\n\n /**\n * Array containing some WebGL-related properties used by the WebGL renderer.\n *\n * @member {object}\n * @private\n */\n // TODO - _webgl should use a prototype object, not a random undocumented object...\n _this._webGL = {};\n\n /**\n * Whether this shape is being used as a mask.\n *\n * @member {boolean}\n */\n _this.isMask = false;\n\n /**\n * The bounds' padding used for bounds calculation.\n *\n * @member {number}\n */\n _this.boundsPadding = 0;\n\n /**\n * A cache of the local bounds to prevent recalculation.\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._localBounds = new _Bounds2.default();\n\n /**\n * Used to detect if the graphics object has changed. If this is set to true then the graphics\n * object will be recalculated.\n *\n * @member {boolean}\n * @private\n */\n _this.dirty = 0;\n\n /**\n * Used to detect if we need to do a fast rect check using the id compare method\n * @type {Number}\n */\n _this.fastRectDirty = -1;\n\n /**\n * Used to detect if we clear the graphics webGL data\n * @type {Number}\n */\n _this.clearDirty = 0;\n\n /**\n * Used to detect if we we need to recalculate local bounds\n * @type {Number}\n */\n _this.boundsDirty = -1;\n\n /**\n * Used to detect if the cached sprite object needs to be updated.\n *\n * @member {boolean}\n * @private\n */\n _this.cachedSpriteDirty = false;\n\n _this._spriteRect = null;\n _this._fastRect = false;\n\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n *\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n return _this;\n }\n\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)\n *\n * @return {PIXI.Graphics} A clone of the graphics object\n */\n\n\n Graphics.prototype.clone = function clone() {\n var clone = new Graphics();\n\n clone.renderable = this.renderable;\n clone.fillAlpha = this.fillAlpha;\n clone.lineWidth = this.lineWidth;\n clone.lineColor = this.lineColor;\n clone.tint = this.tint;\n clone.blendMode = this.blendMode;\n clone.isMask = this.isMask;\n clone.boundsPadding = this.boundsPadding;\n clone.dirty = 0;\n clone.cachedSpriteDirty = this.cachedSpriteDirty;\n\n // copy graphics data\n for (var i = 0; i < this.graphicsData.length; ++i) {\n clone.graphicsData.push(this.graphicsData[i].clone());\n }\n\n clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1];\n\n clone.updateLocalBounds();\n\n return clone;\n };\n\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style\n * @param {number} [color=0] - color of the line to draw, will update the objects stored style\n * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineStyle = function lineStyle() {\n var lineWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n this.lineWidth = lineWidth;\n this.lineColor = color;\n this.lineAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length) {\n // halfway through a line? start a new one!\n var shape = new _math.Polygon(this.currentPath.shape.points.slice(-2));\n\n shape.closed = false;\n\n this.drawShape(shape);\n } else {\n // otherwise its empty so lets just set the line properties\n this.currentPath.lineWidth = this.lineWidth;\n this.currentPath.lineColor = this.lineColor;\n this.currentPath.lineAlpha = this.lineAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Moves the current drawing position to x, y.\n *\n * @param {number} x - the X coordinate to move to\n * @param {number} y - the Y coordinate to move to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.moveTo = function moveTo(x, y) {\n var shape = new _math.Polygon([x, y]);\n\n shape.closed = false;\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n *\n * @param {number} x - the X coordinate to draw to\n * @param {number} y - the Y coordinate to draw to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineTo = function lineTo(x, y) {\n this.currentPath.shape.points.push(x, y);\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.quadraticCurveTo = function quadraticCurveTo(cpX, cpY, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var n = 20;\n var points = this.currentPath.shape.points;\n var xa = 0;\n var ya = 0;\n\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n\n xa = fromX + (cpX - fromX) * j;\n ya = fromY + (cpY - fromY) * j;\n\n points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.bezierCurveTo = function bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var points = this.currentPath.shape.points;\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n points.length -= 2;\n\n (0, _bezierCurveTo3.default)(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points);\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @param {number} x1 - The x-coordinate of the beginning of the arc\n * @param {number} y1 - The y-coordinate of the beginning of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arcTo = function arcTo(x1, y1, x2, y2, radius) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points.push(x1, y1);\n }\n } else {\n this.moveTo(x1, y1);\n }\n\n var points = this.currentPath.shape.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs(a1 * b2 - b1 * a2);\n\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n } else {\n var dd = a1 * a1 + b1 * b1;\n var cc = a2 * a2 + b2 * b2;\n var tt = a1 * a2 + b1 * b2;\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = k1 * b2 + k2 * b1;\n var cy = k1 * a2 + k2 * a1;\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n\n this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arc = function arc(cx, cy, radius, startAngle, endAngle) {\n var anticlockwise = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;\n\n if (startAngle === endAngle) {\n return this;\n }\n\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += Math.PI * 2;\n } else if (anticlockwise && startAngle <= endAngle) {\n startAngle += Math.PI * 2;\n }\n\n var sweep = endAngle - startAngle;\n var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 40;\n\n if (sweep === 0) {\n return this;\n }\n\n var startX = cx + Math.cos(startAngle) * radius;\n var startY = cy + Math.sin(startAngle) * radius;\n\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.shape.points : null;\n\n if (points) {\n if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) {\n points.push(startX, startY);\n }\n } else {\n this.moveTo(startX, startY);\n points = this.currentPath.shape.points;\n }\n\n var theta = sweep / (segs * 2);\n var theta2 = theta * 2;\n\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n\n var segMinus = segs - 1;\n\n var remainder = segMinus % 1 / segMinus;\n\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + remainder * i;\n\n var angle = theta + startAngle + theta2 * real;\n\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n\n points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n *\n * @param {number} [color=0] - the color of the fill\n * @param {number} [alpha=1] - the alpha of the fill\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.beginFill = function beginFill() {\n var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.filling = true;\n this.fillColor = color;\n this.fillAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length <= 2) {\n this.currentPath.fill = this.filling;\n this.currentPath.fillColor = this.fillColor;\n this.currentPath.fillAlpha = this.fillAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.endFill = function endFill() {\n this.filling = false;\n this.fillColor = null;\n this.fillAlpha = 1;\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRect = function drawRect(x, y, width, height) {\n this.drawShape(new _math.Rectangle(x, y, width, height));\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @param {number} radius - Radius of the rectangle corners\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRoundedRect = function drawRoundedRect(x, y, width, height, radius) {\n this.drawShape(new _math.RoundedRectangle(x, y, width, height, radius));\n\n return this;\n };\n\n /**\n * Draws a circle.\n *\n * @param {number} x - The X coordinate of the center of the circle\n * @param {number} y - The Y coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawCircle = function drawCircle(x, y, radius) {\n this.drawShape(new _math.Circle(x, y, radius));\n\n return this;\n };\n\n /**\n * Draws an ellipse.\n *\n * @param {number} x - The X coordinate of the center of the ellipse\n * @param {number} y - The Y coordinate of the center of the ellipse\n * @param {number} width - The half width of the ellipse\n * @param {number} height - The half height of the ellipse\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawEllipse = function drawEllipse(x, y, width, height) {\n this.drawShape(new _math.Ellipse(x, y, width, height));\n\n return this;\n };\n\n /**\n * Draws a polygon using the given path.\n *\n * @param {number[]|PIXI.Point[]} path - The path data used to construct the polygon.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawPolygon = function drawPolygon(path) {\n // prevents an argument assignment deopt\n // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n var points = path;\n\n var closed = true;\n\n if (points instanceof _math.Polygon) {\n closed = points.closed;\n points = points.points;\n }\n\n if (!Array.isArray(points)) {\n // prevents an argument leak deopt\n // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n points = new Array(arguments.length);\n\n for (var i = 0; i < points.length; ++i) {\n points[i] = arguments[i]; // eslint-disable-line prefer-rest-params\n }\n }\n\n var shape = new _math.Polygon(points);\n\n shape.closed = closed;\n\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.clear = function clear() {\n if (this.lineWidth || this.filling || this.graphicsData.length > 0) {\n this.lineWidth = 0;\n this.filling = false;\n\n this.boundsDirty = -1;\n this.dirty++;\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n\n this.currentPath = null;\n this._spriteRect = null;\n\n return this;\n };\n\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n *\n * @returns {boolean} True if only 1 rect.\n */\n\n\n Graphics.prototype.isFastRect = function isFastRect() {\n return this.graphicsData.length === 1 && this.graphicsData[0].shape.type === _const.SHAPES.RECT && !this.graphicsData[0].lineWidth;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderWebGL = function _renderWebGL(renderer) {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (this.dirty !== this.fastRectDirty) {\n this.fastRectDirty = this.dirty;\n this._fastRect = this.isFastRect();\n }\n\n // TODO this check can be moved to dirty?\n if (this._fastRect) {\n this._renderSpriteRect(renderer);\n } else {\n renderer.setObjectRenderer(renderer.plugins.graphics);\n renderer.plugins.graphics.render(this);\n }\n };\n\n /**\n * Renders a sprite rectangle.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderSpriteRect = function _renderSpriteRect(renderer) {\n var rect = this.graphicsData[0].shape;\n\n if (!this._spriteRect) {\n if (!Graphics._SPRITE_TEXTURE) {\n Graphics._SPRITE_TEXTURE = _RenderTexture2.default.create(10, 10);\n\n var canvas = document.createElement('canvas');\n\n canvas.width = 10;\n canvas.height = 10;\n\n var context = canvas.getContext('2d');\n\n context.fillStyle = 'white';\n context.fillRect(0, 0, 10, 10);\n\n Graphics._SPRITE_TEXTURE = _Texture2.default.fromCanvas(canvas);\n }\n\n this._spriteRect = new _Sprite2.default(Graphics._SPRITE_TEXTURE);\n }\n if (this.tint === 0xffffff) {\n this._spriteRect.tint = this.graphicsData[0].fillColor;\n } else {\n var t1 = tempColor1;\n var t2 = tempColor2;\n\n (0, _utils.hex2rgb)(this.graphicsData[0].fillColor, t1);\n (0, _utils.hex2rgb)(this.tint, t2);\n\n t1[0] *= t2[0];\n t1[1] *= t2[1];\n t1[2] *= t2[2];\n\n this._spriteRect.tint = (0, _utils.rgb2hex)(t1);\n }\n this._spriteRect.alpha = this.graphicsData[0].fillAlpha;\n this._spriteRect.worldAlpha = this.worldAlpha * this._spriteRect.alpha;\n\n Graphics._SPRITE_TEXTURE._frame.width = rect.width;\n Graphics._SPRITE_TEXTURE._frame.height = rect.height;\n\n this._spriteRect.transform.worldTransform = this.transform.worldTransform;\n\n this._spriteRect.anchor.set(-rect.x / rect.width, -rect.y / rect.height);\n this._spriteRect._onAnchorUpdate();\n\n this._spriteRect._renderWebGL(renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.isMask === true) {\n return;\n }\n\n renderer.plugins.graphics.render(this);\n };\n\n /**\n * Retrieves the bounds of the graphic shape as a rectangle object\n *\n * @private\n */\n\n\n Graphics.prototype._calculateBounds = function _calculateBounds() {\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.updateLocalBounds();\n\n this.cachedSpriteDirty = true;\n }\n\n var lb = this._localBounds;\n\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n };\n\n /**\n * Tests if a point is inside this graphics object\n *\n * @param {PIXI.Point} point - the point to test\n * @return {boolean} the result of the test\n */\n\n\n Graphics.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var graphicsData = this.graphicsData;\n\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n\n if (!data.fill) {\n continue;\n }\n\n // only deal with fills..\n if (data.shape) {\n if (data.shape.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n /**\n * Update the bounds of the object\n *\n */\n\n\n Graphics.prototype.updateLocalBounds = function updateLocalBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n\n var minY = Infinity;\n var maxY = -Infinity;\n\n if (this.graphicsData.length) {\n var shape = 0;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineWidth;\n\n shape = data.shape;\n\n if (type === _const.SHAPES.RECT || type === _const.SHAPES.RREC) {\n x = shape.x - lineWidth / 2;\n y = shape.y - lineWidth / 2;\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + lineWidth / 2;\n h = shape.radius + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + lineWidth / 2;\n h = shape.height + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt(dx * dx + dy * dy);\n\n if (w < 1e-9) {\n continue;\n }\n\n rw = (h / w * dy + dx) / 2;\n rh = (h / w * dx + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n } else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n\n var padding = this.boundsPadding;\n\n this._localBounds.minX = minX - padding;\n this._localBounds.maxX = maxX + padding * 2;\n\n this._localBounds.minY = minY - padding;\n this._localBounds.maxY = maxY + padding * 2;\n };\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @return {PIXI.GraphicsData} The generated GraphicsData object.\n */\n\n\n Graphics.prototype.drawShape = function drawShape(shape) {\n if (this.currentPath) {\n // check current path!\n if (this.currentPath.shape.points.length <= 2) {\n this.graphicsData.pop();\n }\n }\n\n this.currentPath = null;\n\n var data = new _GraphicsData2.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape);\n\n this.graphicsData.push(data);\n\n if (data.type === _const.SHAPES.POLY) {\n data.shape.closed = data.shape.closed || this.filling;\n this.currentPath = data;\n }\n\n this.dirty++;\n\n return data;\n };\n\n /**\n * Generates a canvas texture.\n *\n * @param {number} scaleMode - The scale mode of the texture.\n * @param {number} resolution - The resolution of the texture.\n * @return {PIXI.Texture} The new texture.\n */\n\n\n Graphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var bounds = this.getLocalBounds();\n\n var canvasBuffer = _RenderTexture2.default.create(bounds.width, bounds.height, scaleMode, resolution);\n\n if (!canvasRenderer) {\n canvasRenderer = new _CanvasRenderer2.default();\n }\n\n tempMatrix.tx = -bounds.x;\n tempMatrix.ty = -bounds.y;\n\n canvasRenderer.render(this, canvasBuffer, false, tempMatrix);\n\n var texture = _Texture2.default.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode);\n\n texture.baseTexture.resolution = resolution;\n texture.baseTexture.update();\n\n return texture;\n };\n\n /**\n * Closes the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.closePath = function closePath() {\n // ok so close path assumes next one is a hole!\n var currentPath = this.currentPath;\n\n if (currentPath && currentPath.shape) {\n currentPath.shape.close();\n }\n\n return this;\n };\n\n /**\n * Adds a hole in the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.addHole = function addHole() {\n // this is a hole!\n var hole = this.graphicsData.pop();\n\n this.currentPath = this.graphicsData[this.graphicsData.length - 1];\n\n this.currentPath.addHole(hole.shape);\n this.currentPath = null;\n\n return this;\n };\n\n /**\n * Destroys the Graphics object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n Graphics.prototype.destroy = function destroy(options) {\n _Container.prototype.destroy.call(this, options);\n\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n\n // for each webgl data entry, destroy the WebGLGraphicsData\n for (var id in this._webgl) {\n for (var j = 0; j < this._webgl[id].data.length; ++j) {\n this._webgl[id].data[j].destroy();\n }\n }\n\n if (this._spriteRect) {\n this._spriteRect.destroy();\n }\n\n this.graphicsData = null;\n\n this.currentPath = null;\n this._webgl = null;\n this._localBounds = null;\n };\n\n return Graphics;\n}(_Container3.default);\n\nexports.default = Graphics;\n\n\nGraphics._SPRITE_TEXTURE = null;\n//# sourceMappingURL=Graphics.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/Graphics.js\n// module id = 521\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they\n * now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasGraphicsRenderer:\n * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching graphics objects.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar CanvasGraphicsRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer.\n */\n function CanvasGraphicsRenderer(renderer) {\n _classCallCheck(this, CanvasGraphicsRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders a Graphics object to a canvas.\n *\n * @param {PIXI.Graphics} graphics - the actual graphics object to render\n */\n\n\n CanvasGraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var context = renderer.context;\n var worldAlpha = graphics.worldAlpha;\n var transform = graphics.transform.worldTransform;\n var resolution = renderer.resolution;\n\n // if the tint has changed, set the graphics object to dirty.\n if (this._prevTint !== this.tint) {\n this.dirty = true;\n }\n\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n if (graphics.dirty) {\n this.updateGraphicsTint(graphics);\n graphics.dirty = false;\n }\n\n renderer.setBlendMode(graphics.blendMode);\n\n for (var i = 0; i < graphics.graphicsData.length; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n var fillColor = data._fillTint;\n var lineColor = data._lineTint;\n\n context.lineWidth = data.lineWidth;\n\n if (data.type === _const.SHAPES.POLY) {\n context.beginPath();\n\n this.renderPolygon(shape.points, shape.closed, context);\n\n for (var j = 0; j < data.holes.length; j++) {\n this.renderPolygon(data.holes[j].points, true, context);\n }\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fillRect(shape.x, shape.y, shape.width, shape.height);\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.strokeRect(shape.x, shape.y, shape.width, shape.height);\n }\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.beginPath();\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n context.beginPath();\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.beginPath();\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n }\n }\n };\n\n /**\n * Updates the tint of a graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated\n */\n\n\n CanvasGraphicsRenderer.prototype.updateGraphicsTint = function updateGraphicsTint(graphics) {\n graphics._prevTint = graphics.tint;\n\n var tintR = (graphics.tint >> 16 & 0xFF) / 255;\n var tintG = (graphics.tint >> 8 & 0xFF) / 255;\n var tintB = (graphics.tint & 0xFF) / 255;\n\n for (var i = 0; i < graphics.graphicsData.length; ++i) {\n var data = graphics.graphicsData[i];\n\n var fillColor = data.fillColor | 0;\n var lineColor = data.lineColor | 0;\n\n // super inline cos im an optimization NAZI :)\n data._fillTint = ((fillColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (fillColor & 0xFF) / 255 * tintB * 255;\n\n data._lineTint = ((lineColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (lineColor & 0xFF) / 255 * tintB * 255;\n }\n };\n\n /**\n * Renders a polygon.\n *\n * @param {PIXI.Point[]} points - The points to render\n * @param {boolean} close - Should the polygon be closed\n * @param {CanvasRenderingContext2D} context - The rendering context to use\n */\n\n\n CanvasGraphicsRenderer.prototype.renderPolygon = function renderPolygon(points, close, context) {\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; ++j) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n if (close) {\n context.closePath();\n }\n };\n\n /**\n * destroy graphics object\n *\n */\n\n\n CanvasGraphicsRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasGraphicsRenderer;\n}();\n\nexports.default = CanvasGraphicsRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('graphics', CanvasGraphicsRenderer);\n//# sourceMappingURL=CanvasGraphicsRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/canvas/CanvasGraphicsRenderer.js\n// module id = 522\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = bezierCurveTo;\n/**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [path=[]] - Path array to push points into\n * @return {number[]} Array of points of the curve\n */\nfunction bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var path = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];\n\n var n = 20;\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n\n path.push(fromX, fromY);\n\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n\n dt = 1 - j;\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n path.push(dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);\n }\n\n return path;\n}\n//# sourceMappingURL=bezierCurveTo.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/utils/bezierCurveTo.js\n// module id = 523\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../../utils');\n\nvar _const = require('../../const');\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _WebGLGraphicsData = require('./WebGLGraphicsData');\n\nvar _WebGLGraphicsData2 = _interopRequireDefault(_WebGLGraphicsData);\n\nvar _PrimitiveShader = require('./shaders/PrimitiveShader');\n\nvar _PrimitiveShader2 = _interopRequireDefault(_PrimitiveShader);\n\nvar _buildPoly = require('./utils/buildPoly');\n\nvar _buildPoly2 = _interopRequireDefault(_buildPoly);\n\nvar _buildRectangle = require('./utils/buildRectangle');\n\nvar _buildRectangle2 = _interopRequireDefault(_buildRectangle);\n\nvar _buildRoundedRectangle = require('./utils/buildRoundedRectangle');\n\nvar _buildRoundedRectangle2 = _interopRequireDefault(_buildRoundedRectangle);\n\nvar _buildCircle = require('./utils/buildCircle');\n\nvar _buildCircle2 = _interopRequireDefault(_buildCircle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Renders the graphics object.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar GraphicsRenderer = function (_ObjectRenderer) {\n _inherits(GraphicsRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for.\n */\n function GraphicsRenderer(renderer) {\n _classCallCheck(this, GraphicsRenderer);\n\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.graphicsDataPool = [];\n\n _this.primitiveShader = null;\n\n _this.gl = renderer.gl;\n\n // easy access!\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * Called when there is a WebGL context change\n *\n * @private\n *\n */\n\n\n GraphicsRenderer.prototype.onContextChange = function onContextChange() {\n this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.primitiveShader = new _PrimitiveShader2.default(this.gl);\n };\n\n /**\n * Destroys this renderer.\n *\n */\n\n\n GraphicsRenderer.prototype.destroy = function destroy() {\n _ObjectRenderer3.default.prototype.destroy.call(this);\n\n for (var i = 0; i < this.graphicsDataPool.length; ++i) {\n this.graphicsDataPool[i].destroy();\n }\n\n this.graphicsDataPool = null;\n };\n\n /**\n * Renders a graphics object.\n *\n * @param {PIXI.Graphics} graphics - The graphics object to render.\n */\n\n\n GraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var webGLData = void 0;\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n if (!webGL || graphics.dirty !== webGL.dirty) {\n this.updateGraphics(graphics);\n\n webGL = graphics._webGL[this.CONTEXT_UID];\n }\n\n // This could be speeded up for sure!\n var shader = this.primitiveShader;\n\n renderer.bindShader(shader);\n renderer.state.setBlendMode(graphics.blendMode);\n\n for (var i = 0, n = webGL.data.length; i < n; i++) {\n webGLData = webGL.data[i];\n var shaderTemp = webGLData.shader;\n\n renderer.bindShader(shaderTemp);\n shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true);\n shaderTemp.uniforms.tint = (0, _utils.hex2rgb)(graphics.tint);\n shaderTemp.uniforms.alpha = graphics.worldAlpha;\n\n renderer.bindVao(webGLData.vao);\n webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length);\n }\n };\n\n /**\n * Updates the graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - The graphics object to update\n */\n\n\n GraphicsRenderer.prototype.updateGraphics = function updateGraphics(graphics) {\n var gl = this.renderer.gl;\n\n // get the contexts graphics object\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n // if the graphics object does not exist in the webGL context time to create it!\n if (!webGL) {\n webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl: gl, clearDirty: -1, dirty: -1 };\n }\n\n // flag the graphics as not dirty as we are about to update it...\n webGL.dirty = graphics.dirty;\n\n // if the user cleared the graphics object we will need to clear every object\n if (graphics.clearDirty !== webGL.clearDirty) {\n webGL.clearDirty = graphics.clearDirty;\n\n // loop through and return all the webGLDatas to the object pool so than can be reused later on\n for (var i = 0; i < webGL.data.length; i++) {\n this.graphicsDataPool.push(webGL.data[i]);\n }\n\n // clear the array and reset the index..\n webGL.data.length = 0;\n webGL.lastIndex = 0;\n }\n\n var webGLData = void 0;\n\n // loop through the graphics datas and construct each one..\n // if the object is a complex fill then the new stencil buffer technique will be used\n // other wise graphics objects will be pushed into a batch..\n for (var _i = webGL.lastIndex; _i < graphics.graphicsData.length; _i++) {\n var data = graphics.graphicsData[_i];\n\n // TODO - this can be simplified\n webGLData = this.getWebGLData(webGL, 0);\n\n if (data.type === _const.SHAPES.POLY) {\n (0, _buildPoly2.default)(data, webGLData);\n }\n if (data.type === _const.SHAPES.RECT) {\n (0, _buildRectangle2.default)(data, webGLData);\n } else if (data.type === _const.SHAPES.CIRC || data.type === _const.SHAPES.ELIP) {\n (0, _buildCircle2.default)(data, webGLData);\n } else if (data.type === _const.SHAPES.RREC) {\n (0, _buildRoundedRectangle2.default)(data, webGLData);\n }\n\n webGL.lastIndex++;\n }\n\n this.renderer.bindVao(null);\n\n // upload all the dirty data...\n for (var _i2 = 0; _i2 < webGL.data.length; _i2++) {\n webGLData = webGL.data[_i2];\n\n if (webGLData.dirty) {\n webGLData.upload();\n }\n }\n };\n\n /**\n *\n * @private\n * @param {WebGLRenderingContext} gl - the current WebGL drawing context\n * @param {number} type - TODO @Alvin\n * @return {*} TODO\n */\n\n\n GraphicsRenderer.prototype.getWebGLData = function getWebGLData(gl, type) {\n var webGLData = gl.data[gl.data.length - 1];\n\n if (!webGLData || webGLData.points.length > 320000) {\n webGLData = this.graphicsDataPool.pop() || new _WebGLGraphicsData2.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState);\n\n webGLData.reset(type);\n gl.data.push(webGLData);\n }\n\n webGLData.dirty = true;\n\n return webGLData;\n };\n\n return GraphicsRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = GraphicsRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer);\n//# sourceMappingURL=GraphicsRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/GraphicsRenderer.js\n// module id = 524\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * An object containing WebGL specific properties to be used by the WebGL renderer\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar WebGLGraphicsData = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {PIXI.Shader} shader - The shader\n * @param {object} attribsState - The state for the VAO\n */\n function WebGLGraphicsData(gl, shader, attribsState) {\n _classCallCheck(this, WebGLGraphicsData);\n\n /**\n * The current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n // TODO does this need to be split before uploading??\n /**\n * An array of color components (r,g,b)\n * @member {number[]}\n */\n this.color = [0, 0, 0]; // color split!\n\n /**\n * An array of points to draw\n * @member {PIXI.Point[]}\n */\n this.points = [];\n\n /**\n * The indices of the vertices\n * @member {number[]}\n */\n this.indices = [];\n /**\n * The main buffer\n * @member {WebGLBuffer}\n */\n this.buffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl);\n\n /**\n * The index buffer\n * @member {WebGLBuffer}\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl);\n\n /**\n * Whether this graphics is dirty or not\n * @member {boolean}\n */\n this.dirty = true;\n\n this.glPoints = null;\n this.glIndices = null;\n\n /**\n *\n * @member {PIXI.Shader}\n */\n this.shader = shader;\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, attribsState).addIndex(this.indexBuffer).addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0).addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4);\n }\n\n /**\n * Resets the vertices and the indices\n */\n\n\n WebGLGraphicsData.prototype.reset = function reset() {\n this.points.length = 0;\n this.indices.length = 0;\n };\n\n /**\n * Binds the buffers and uploads the data\n */\n\n\n WebGLGraphicsData.prototype.upload = function upload() {\n this.glPoints = new Float32Array(this.points);\n this.buffer.upload(this.glPoints);\n\n this.glIndices = new Uint16Array(this.indices);\n this.indexBuffer.upload(this.glIndices);\n\n this.dirty = false;\n };\n\n /**\n * Empties all the data\n */\n\n\n WebGLGraphicsData.prototype.destroy = function destroy() {\n this.color = null;\n this.points = null;\n this.indices = null;\n\n this.vao.destroy();\n this.buffer.destroy();\n this.indexBuffer.destroy();\n\n this.gl = null;\n\n this.buffer = null;\n this.indexBuffer = null;\n\n this.glPoints = null;\n this.glIndices = null;\n };\n\n return WebGLGraphicsData;\n}();\n\nexports.default = WebGLGraphicsData;\n//# sourceMappingURL=WebGLGraphicsData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/WebGLGraphicsData.js\n// module id = 525\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../../Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nvar PrimitiveShader = function (_Shader) {\n _inherits(PrimitiveShader, _Shader);\n\n /**\n * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for.\n */\n function PrimitiveShader(gl) {\n _classCallCheck(this, PrimitiveShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['attribute vec2 aVertexPosition;', 'attribute vec4 aColor;', 'uniform mat3 translationMatrix;', 'uniform mat3 projectionMatrix;', 'uniform float alpha;', 'uniform vec3 tint;', 'varying vec4 vColor;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vColor = aColor * vec4(tint * alpha, alpha);', '}'].join('\\n'),\n // fragment shader\n ['varying vec4 vColor;', 'void main(void){', ' gl_FragColor = vColor;', '}'].join('\\n')));\n }\n\n return PrimitiveShader;\n}(_Shader3.default);\n\nexports.default = PrimitiveShader;\n//# sourceMappingURL=PrimitiveShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/shaders/PrimitiveShader.js\n// module id = 526\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildCircle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _const = require('../../../const');\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nfunction buildCircle(graphicsData, webGLData) {\n // need to convert points to a nice regular data\n var circleData = graphicsData.shape;\n var x = circleData.x;\n var y = circleData.y;\n var width = void 0;\n var height = void 0;\n\n // TODO - bit hacky??\n if (graphicsData.type === _const.SHAPES.CIRC) {\n width = circleData.radius;\n height = circleData.radius;\n } else {\n width = circleData.width;\n height = circleData.height;\n }\n\n var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) || Math.floor(15 * Math.sqrt(circleData.width + circleData.height));\n\n var seg = Math.PI * 2 / totalSegs;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n indices.push(vecPos);\n\n for (var i = 0; i < totalSegs + 1; i++) {\n verts.push(x, y, r, g, b, alpha);\n\n verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha);\n\n indices.push(vecPos++, vecPos++);\n }\n\n indices.push(vecPos - 1);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [];\n\n for (var _i = 0; _i < totalSegs + 1; _i++) {\n graphicsData.points.push(x + Math.sin(seg * _i) * width, y + Math.cos(seg * _i) * height);\n }\n\n (0, _buildLine2.default)(graphicsData, webGLData);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildCircle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildCircle.js\n// module id = 527\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildPoly;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nfunction buildPoly(graphicsData, webGLData) {\n graphicsData.points = graphicsData.shape.points.slice();\n\n var points = graphicsData.points;\n\n if (graphicsData.fill && points.length >= 6) {\n var holeArray = [];\n // Process holes..\n var holes = graphicsData.holes;\n\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n\n holeArray.push(points.length / 2);\n\n points = points.concat(hole.points);\n }\n\n // get first and last point.. figure out the middle!\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var length = points.length / 2;\n\n // sort color\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var triangles = (0, _earcut2.default)(points, holeArray, 2);\n\n if (!triangles) {\n return;\n }\n\n var vertPos = verts.length / 6;\n\n for (var _i = 0; _i < triangles.length; _i += 3) {\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i + 1] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n }\n\n for (var _i2 = 0; _i2 < length; _i2++) {\n verts.push(points[_i2 * 2], points[_i2 * 2 + 1], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth > 0) {\n (0, _buildLine2.default)(graphicsData, webGLData);\n }\n}\n//# sourceMappingURL=buildPoly.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildPoly.js\n// module id = 528\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRectangle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nfunction buildRectangle(graphicsData, webGLData) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vertPos = verts.length / 6;\n\n // start\n verts.push(x, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x, y + height);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y + height);\n verts.push(r, g, b, alpha);\n\n // insert 2 dead triangles..\n indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y];\n\n (0, _buildLine2.default)(graphicsData, webGLData);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildRectangle.js\n// module id = 529\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRoundedRectangle;\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n */\nfunction buildRoundedRectangle(graphicsData, webGLData) {\n var rrectData = graphicsData.shape;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n\n var radius = rrectData.radius;\n\n var recPoints = [];\n\n recPoints.push(x, y + radius);\n quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints);\n quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints);\n quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints);\n quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints);\n\n // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n // TODO - fix this properly, this is not very elegant.. but it works for now.\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n var triangles = (0, _earcut2.default)(recPoints, null, 2);\n\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n\n for (var _i = 0, _j = recPoints.length; _i < _j; _i++) {\n verts.push(recPoints[_i], recPoints[++_i], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = recPoints;\n\n (0, _buildLine2.default)(graphicsData, webGLData);\n\n graphicsData.points = tempPoints;\n }\n}\n\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) {\n var out = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];\n\n var n = 20;\n var points = out;\n\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n\n function getPt(n1, n2, perc) {\n var diff = n2 - n1;\n\n return n1 + diff * perc;\n }\n\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n\n points.push(x, y);\n }\n\n return points;\n}\n//# sourceMappingURL=buildRoundedRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildRoundedRectangle.js\n// module id = 530\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Circle object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Circle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n function Circle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n _classCallCheck(this, Circle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n\n\n Circle.prototype.clone = function clone() {\n return new Circle(this.x, this.y, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n\n\n Circle.prototype.contains = function contains(x, y) {\n if (this.radius <= 0) {\n return false;\n }\n\n var r2 = this.radius * this.radius;\n var dx = this.x - x;\n var dy = this.y - y;\n\n dx *= dx;\n dy *= dy;\n\n return dx + dy <= r2;\n };\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Circle.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n\n return Circle;\n}();\n\nexports.default = Circle;\n//# sourceMappingURL=Circle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Circle.js\n// module id = 531\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Ellipse object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Ellipse = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [width=0] - The half width of this ellipse\n * @param {number} [height=0] - The half height of this ellipse\n */\n function Ellipse() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, Ellipse);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n\n\n Ellipse.prototype.clone = function clone() {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n\n\n Ellipse.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n var normx = (x - this.x) / this.width;\n var normy = (y - this.y) / this.height;\n\n normx *= normx;\n normy *= normy;\n\n return normx + normy <= 1;\n };\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Ellipse.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n\n return Ellipse;\n}();\n\nexports.default = Ellipse;\n//# sourceMappingURL=Ellipse.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Ellipse.js\n// module id = 532\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Point = require('../Point');\n\nvar _Point2 = _interopRequireDefault(_Point);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Polygon = function () {\n /**\n * @param {PIXI.Point[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n for (var _len = arguments.length, points = Array(_len), _key = 0; _key < _len; _key++) {\n points[_key] = arguments[_key];\n }\n\n _classCallCheck(this, Polygon);\n\n if (Array.isArray(points[0])) {\n points = points[0];\n }\n\n // if this is an array of points, convert it to a flat array of numbers\n if (points[0] instanceof _Point2.default) {\n var p = [];\n\n for (var i = 0, il = points.length; i < il; i++) {\n p.push(points[i].x, points[i].y);\n }\n\n points = p;\n }\n\n this.closed = true;\n\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = points;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.POLY;\n }\n\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n\n\n Polygon.prototype.clone = function clone() {\n return new Polygon(this.points.slice());\n };\n\n /**\n * Closes the polygon, adding points if necessary.\n *\n */\n\n\n Polygon.prototype.close = function close() {\n var points = this.points;\n\n // close the poly if the value is true!\n if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1]) {\n points.push(points[0], points[1]);\n }\n };\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n\n\n Polygon.prototype.contains = function contains(x, y) {\n var inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[i * 2 + 1];\n var xj = this.points[j * 2];\n var yj = this.points[j * 2 + 1];\n var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;\n\n if (intersect) {\n inside = !inside;\n }\n }\n\n return inside;\n };\n\n return Polygon;\n}();\n\nexports.default = Polygon;\n//# sourceMappingURL=Polygon.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Polygon.js\n// module id = 533\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nvar RoundedRectangle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n function RoundedRectangle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;\n\n _classCallCheck(this, RoundedRectangle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.RREC;\n }\n\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n\n\n RoundedRectangle.prototype.clone = function clone() {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n\n\n RoundedRectangle.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n if (y >= this.y + this.radius && y <= this.y + this.height - this.radius || x >= this.x + this.radius && x <= this.x + this.width - this.radius) {\n return true;\n }\n var dx = x - (this.x + this.radius);\n var dy = y - (this.y + this.radius);\n var radius2 = this.radius * this.radius;\n\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n return RoundedRectangle;\n}();\n\nexports.default = RoundedRectangle;\n//# sourceMappingURL=RoundedRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/RoundedRectangle.js\n// module id = 534\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A set of functions used to handle masking.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasMaskManager = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n */\n function CanvasMaskManager(renderer) {\n _classCallCheck(this, CanvasMaskManager);\n\n this.renderer = renderer;\n }\n\n /**\n * This method adds it to the current stack of masks.\n *\n * @param {object} maskData - the maskData that will be pushed\n */\n\n\n CanvasMaskManager.prototype.pushMask = function pushMask(maskData) {\n var renderer = this.renderer;\n\n renderer.context.save();\n\n var cacheAlpha = maskData.alpha;\n var transform = maskData.transform.worldTransform;\n var resolution = renderer.resolution;\n\n renderer.context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n // TODO suport sprite alpha masks??\n // lots of effort required. If demand is great enough..\n if (!maskData._texture) {\n this.renderGraphicsShape(maskData);\n renderer.context.clip();\n }\n\n maskData.worldAlpha = cacheAlpha;\n };\n\n /**\n * Renders a PIXI.Graphics shape.\n *\n * @param {PIXI.Graphics} graphics - The object to render.\n */\n\n\n CanvasMaskManager.prototype.renderGraphicsShape = function renderGraphicsShape(graphics) {\n var context = this.renderer.context;\n var len = graphics.graphicsData.length;\n\n if (len === 0) {\n return;\n }\n\n context.beginPath();\n\n for (var i = 0; i < len; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n if (data.type === _const.SHAPES.POLY) {\n var points = shape.points;\n\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; j++) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) {\n context.closePath();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n context.rect(shape.x, shape.y, shape.width, shape.height);\n context.closePath();\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n }\n }\n };\n\n /**\n * Restores the current drawing context to the state it was before the mask was applied.\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.\n */\n\n\n CanvasMaskManager.prototype.popMask = function popMask(renderer) {\n renderer.context.restore();\n };\n\n /**\n * Destroys this canvas mask manager.\n *\n */\n\n\n CanvasMaskManager.prototype.destroy = function destroy() {\n /* empty */\n };\n\n return CanvasMaskManager;\n}();\n\nexports.default = CanvasMaskManager;\n//# sourceMappingURL=CanvasMaskManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/CanvasMaskManager.js\n// module id = 535\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapCanvasBlendModesToPixi;\n\nvar _const = require('../../../const');\n\nvar _canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes');\n\nvar _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Maps blend combinations to Canvas.\n *\n * @memberof PIXI\n * @function mapCanvasBlendModesToPixi\n * @private\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapCanvasBlendModesToPixi() {\n var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if ((0, _canUseNewCanvasBlendModes2.default)()) {\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'multiply';\n array[_const.BLEND_MODES.SCREEN] = 'screen';\n array[_const.BLEND_MODES.OVERLAY] = 'overlay';\n array[_const.BLEND_MODES.DARKEN] = 'darken';\n array[_const.BLEND_MODES.LIGHTEN] = 'lighten';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'color-dodge';\n array[_const.BLEND_MODES.COLOR_BURN] = 'color-burn';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'hard-light';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'soft-light';\n array[_const.BLEND_MODES.DIFFERENCE] = 'difference';\n array[_const.BLEND_MODES.EXCLUSION] = 'exclusion';\n array[_const.BLEND_MODES.HUE] = 'hue';\n array[_const.BLEND_MODES.SATURATION] = 'saturate';\n array[_const.BLEND_MODES.COLOR] = 'color';\n array[_const.BLEND_MODES.LUMINOSITY] = 'luminosity';\n } else {\n // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough'\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'source-over';\n array[_const.BLEND_MODES.SCREEN] = 'source-over';\n array[_const.BLEND_MODES.OVERLAY] = 'source-over';\n array[_const.BLEND_MODES.DARKEN] = 'source-over';\n array[_const.BLEND_MODES.LIGHTEN] = 'source-over';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'source-over';\n array[_const.BLEND_MODES.COLOR_BURN] = 'source-over';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.DIFFERENCE] = 'source-over';\n array[_const.BLEND_MODES.EXCLUSION] = 'source-over';\n array[_const.BLEND_MODES.HUE] = 'source-over';\n array[_const.BLEND_MODES.SATURATION] = 'source-over';\n array[_const.BLEND_MODES.COLOR] = 'source-over';\n array[_const.BLEND_MODES.LUMINOSITY] = 'source-over';\n }\n\n return array;\n}\n//# sourceMappingURL=mapCanvasBlendModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js\n// module id = 536\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged\n * up with textures that are no longer being used.\n *\n * @class\n * @memberof PIXI\n */\nvar TextureGarbageCollector = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function TextureGarbageCollector(renderer) {\n _classCallCheck(this, TextureGarbageCollector);\n\n this.renderer = renderer;\n\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = _settings2.default.GC_MAX_IDLE;\n this.checkCountMax = _settings2.default.GC_MAX_CHECK_COUNT;\n this.mode = _settings2.default.GC_MODE;\n }\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.update = function update() {\n this.count++;\n\n if (this.mode === _const.GC_MODES.MANUAL) {\n return;\n }\n\n this.checkCount++;\n\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n\n this.run();\n }\n };\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.run = function run() {\n var tm = this.renderer.textureManager;\n var managedTextures = tm._managedTextures;\n var wasRemoved = false;\n\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n\n // only supports non generated textures at the moment!\n if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n\n if (wasRemoved) {\n var j = 0;\n\n for (var _i = 0; _i < managedTextures.length; _i++) {\n if (managedTextures[_i] !== null) {\n managedTextures[j++] = managedTextures[_i];\n }\n }\n\n managedTextures.length = j;\n }\n };\n\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n *\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n\n\n TextureGarbageCollector.prototype.unload = function unload(displayObject) {\n var tm = this.renderer.textureManager;\n\n // only destroy non generated textures\n if (displayObject._texture && displayObject._texture._glRenderTargets) {\n tm.destroyTexture(displayObject._texture, true);\n }\n\n for (var i = displayObject.children.length - 1; i >= 0; i--) {\n this.unload(displayObject.children[i]);\n }\n };\n\n return TextureGarbageCollector;\n}();\n\nexports.default = TextureGarbageCollector;\n//# sourceMappingURL=TextureGarbageCollector.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/TextureGarbageCollector.js\n// module id = 537\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _const = require('../../const');\n\nvar _RenderTarget = require('./utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _utils = require('../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a webGL Texture\n *\n * @class\n * @memberof PIXI\n */\nvar TextureManager = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function TextureManager(renderer) {\n _classCallCheck(this, TextureManager);\n\n /**\n * A reference to the current renderer\n *\n * @member {PIXI.WebGLRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = renderer.gl;\n\n /**\n * Track textures in the renderer so we can no longer listen to them on destruction.\n *\n * @member {Array<*>}\n * @private\n */\n this._managedTextures = [];\n }\n\n /**\n * Binds a texture.\n *\n */\n\n\n TextureManager.prototype.bindTexture = function bindTexture() {}\n // empty\n\n\n /**\n * Gets a texture.\n *\n */\n ;\n\n TextureManager.prototype.getTexture = function getTexture() {}\n // empty\n\n\n /**\n * Updates and/or Creates a WebGL texture for the renderer's context.\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update\n * @param {Number} location - the location the texture will be bound to.\n * @return {GLTexture} The gl texture.\n */\n ;\n\n TextureManager.prototype.updateTexture = function updateTexture(texture, location) {\n // assume it good!\n // texture = texture.baseTexture || texture;\n\n var gl = this.gl;\n\n var isRenderTexture = !!texture._glRenderTargets;\n\n if (!texture.hasLoaded) {\n return null;\n }\n\n var boundTextures = this.renderer.boundTextures;\n\n // if the location is undefined then this may have been called by n event.\n // this being the case the texture may already be bound to a slot. As a texture can only be bound once\n // we need to find its current location if it exists.\n if (location === undefined) {\n location = 0;\n\n // TODO maybe we can use texture bound ids later on...\n // check if texture is already bound..\n for (var i = 0; i < boundTextures.length; ++i) {\n if (boundTextures[i] === texture) {\n location = i;\n break;\n }\n }\n }\n\n boundTextures[location] = texture;\n\n gl.activeTexture(gl.TEXTURE0 + location);\n\n var glTexture = texture._glTextures[this.renderer.CONTEXT_UID];\n\n if (!glTexture) {\n if (isRenderTexture) {\n var renderTarget = new _RenderTarget2.default(this.gl, texture.width, texture.height, texture.scaleMode, texture.resolution);\n\n renderTarget.resize(texture.width, texture.height);\n texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget;\n glTexture = renderTarget.texture;\n } else {\n glTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null);\n glTexture.bind(location);\n glTexture.premultiplyAlpha = true;\n glTexture.upload(texture.source);\n }\n\n texture._glTextures[this.renderer.CONTEXT_UID] = glTexture;\n\n texture.on('update', this.updateTexture, this);\n texture.on('dispose', this.destroyTexture, this);\n\n this._managedTextures.push(texture);\n\n if (texture.isPowerOfTwo) {\n if (texture.mipmap) {\n glTexture.enableMipmap();\n }\n\n if (texture.wrapMode === _const.WRAP_MODES.CLAMP) {\n glTexture.enableWrapClamp();\n } else if (texture.wrapMode === _const.WRAP_MODES.REPEAT) {\n glTexture.enableWrapRepeat();\n } else {\n glTexture.enableWrapMirrorRepeat();\n }\n } else {\n glTexture.enableWrapClamp();\n }\n\n if (texture.scaleMode === _const.SCALE_MODES.NEAREST) {\n glTexture.enableNearestScaling();\n } else {\n glTexture.enableLinearScaling();\n }\n }\n // the texture already exists so we only need to update it..\n else if (isRenderTexture) {\n texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height);\n } else {\n glTexture.upload(texture.source);\n }\n\n return glTexture;\n };\n\n /**\n * Deletes the texture from WebGL\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy\n * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n\n\n TextureManager.prototype.destroyTexture = function destroyTexture(texture, skipRemove) {\n texture = texture.baseTexture || texture;\n\n if (!texture.hasLoaded) {\n return;\n }\n\n if (texture._glTextures[this.renderer.CONTEXT_UID]) {\n this.renderer.unbindTexture(texture);\n\n texture._glTextures[this.renderer.CONTEXT_UID].destroy();\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n\n delete texture._glTextures[this.renderer.CONTEXT_UID];\n\n if (!skipRemove) {\n var i = this._managedTextures.indexOf(texture);\n\n if (i !== -1) {\n (0, _utils.removeItems)(this._managedTextures, i, 1);\n }\n }\n }\n };\n\n /**\n * Deletes all the textures from WebGL\n */\n\n\n TextureManager.prototype.removeAll = function removeAll() {\n // empty all the old gl textures as they are useless now\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n if (texture._glTextures[this.renderer.CONTEXT_UID]) {\n delete texture._glTextures[this.renderer.CONTEXT_UID];\n }\n }\n };\n\n /**\n * Destroys this manager and removes all its textures\n */\n\n\n TextureManager.prototype.destroy = function destroy() {\n // destroy managed textures\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n this.destroyTexture(texture, true);\n\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n }\n\n this._managedTextures = null;\n };\n\n return TextureManager;\n}();\n\nexports.default = TextureManager;\n//# sourceMappingURL=TextureManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/TextureManager.js\n// module id = 538\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _mapWebGLBlendModesToPixi = require('./utils/mapWebGLBlendModesToPixi');\n\nvar _mapWebGLBlendModesToPixi2 = _interopRequireDefault(_mapWebGLBlendModesToPixi);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BLEND = 0;\nvar DEPTH_TEST = 1;\nvar FRONT_FACE = 2;\nvar CULL_FACE = 3;\nvar BLEND_FUNC = 4;\n\n/**\n * A WebGL state machines\n *\n * @memberof PIXI\n * @class\n */\n\nvar WebGLState = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n */\n function WebGLState(gl) {\n _classCallCheck(this, WebGLState);\n\n /**\n * The current active state\n *\n * @member {Uint8Array}\n */\n this.activeState = new Uint8Array(16);\n\n /**\n * The default state\n *\n * @member {Uint8Array}\n */\n this.defaultState = new Uint8Array(16);\n\n // default blend mode..\n this.defaultState[0] = 1;\n\n /**\n * The current state index in the stack\n *\n * @member {number}\n * @private\n */\n this.stackIndex = 0;\n\n /**\n * The stack holding all the different states\n *\n * @member {Array<*>}\n * @private\n */\n this.stack = [];\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n this.attribState = {\n tempAttribState: new Array(this.maxAttribs),\n attribState: new Array(this.maxAttribs)\n };\n\n this.blendModes = (0, _mapWebGLBlendModesToPixi2.default)(gl);\n\n // check we have vao..\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n /**\n * Pushes a new active state\n */\n\n\n WebGLState.prototype.push = function push() {\n // next state..\n var state = this.stack[++this.stackIndex];\n\n if (!state) {\n state = this.stack[this.stackIndex] = new Uint8Array(16);\n }\n\n // copy state..\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; i++) {\n this.activeState[i] = state[i];\n }\n };\n\n /**\n * Pops a state out\n */\n\n\n WebGLState.prototype.pop = function pop() {\n var state = this.stack[--this.stackIndex];\n\n this.setState(state);\n };\n\n /**\n * Sets the current state\n *\n * @param {*} state - The state to set.\n */\n\n\n WebGLState.prototype.setState = function setState(state) {\n this.setBlend(state[BLEND]);\n this.setDepthTest(state[DEPTH_TEST]);\n this.setFrontFace(state[FRONT_FACE]);\n this.setCullFace(state[CULL_FACE]);\n this.setBlendMode(state[BLEND_FUNC]);\n };\n\n /**\n * Enables or disabled blending.\n *\n * @param {boolean} value - Turn on or off webgl blending.\n */\n\n\n WebGLState.prototype.setBlend = function setBlend(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[BLEND] === value) {\n return;\n }\n\n this.activeState[BLEND] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n };\n\n /**\n * Sets the blend mode.\n *\n * @param {number} value - The blend mode to set to.\n */\n\n\n WebGLState.prototype.setBlendMode = function setBlendMode(value) {\n if (value === this.activeState[BLEND_FUNC]) {\n return;\n }\n\n this.activeState[BLEND_FUNC] = value;\n\n this.gl.blendFunc(this.blendModes[value][0], this.blendModes[value][1]);\n };\n\n /**\n * Sets whether to enable or disable depth test.\n *\n * @param {boolean} value - Turn on or off webgl depth testing.\n */\n\n\n WebGLState.prototype.setDepthTest = function setDepthTest(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[DEPTH_TEST] === value) {\n return;\n }\n\n this.activeState[DEPTH_TEST] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n };\n\n /**\n * Sets whether to enable or disable cull face.\n *\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n\n\n WebGLState.prototype.setCullFace = function setCullFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[CULL_FACE] === value) {\n return;\n }\n\n this.activeState[CULL_FACE] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n };\n\n /**\n * Sets the gl front face.\n *\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n\n\n WebGLState.prototype.setFrontFace = function setFrontFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[FRONT_FACE] === value) {\n return;\n }\n\n this.activeState[FRONT_FACE] = value;\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n };\n\n /**\n * Disables all the vaos in use\n *\n */\n\n\n WebGLState.prototype.resetAttributes = function resetAttributes() {\n for (var i = 0; i < this.attribState.tempAttribState.length; i++) {\n this.attribState.tempAttribState[i] = 0;\n }\n\n for (var _i = 0; _i < this.attribState.attribState.length; _i++) {\n this.attribState.attribState[_i] = 0;\n }\n\n // im going to assume one is always active for performance reasons.\n for (var _i2 = 1; _i2 < this.maxAttribs; _i2++) {\n this.gl.disableVertexAttribArray(_i2);\n }\n };\n\n // used\n /**\n * Resets all the logic and disables the vaos\n */\n\n\n WebGLState.prototype.resetToDefault = function resetToDefault() {\n // unbind any VAO if they exist..\n if (this.nativeVaoExtension) {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n // reset all attributes..\n this.resetAttributes();\n\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; ++i) {\n this.activeState[i] = 32;\n }\n\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.setState(this.defaultState);\n };\n\n return WebGLState;\n}();\n\nexports.default = WebGLState;\n//# sourceMappingURL=WebGLState.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/WebGLState.js\n// module id = 539\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = extractUniformsFromSrc;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar defaultValue = _pixiGlCore2.default.shader.defaultValue;\n\nfunction extractUniformsFromSrc(vertexSrc, fragmentSrc, mask) {\n var vertUniforms = extractUniformsFromString(vertexSrc, mask);\n var fragUniforms = extractUniformsFromString(fragmentSrc, mask);\n\n return Object.assign(vertUniforms, fragUniforms);\n}\n\nfunction extractUniformsFromString(string) {\n var maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea)$');\n\n var uniforms = {};\n var nameSplit = void 0;\n\n // clean the lines a little - remove extra spaces / tabs etc\n // then split along ';'\n var lines = string.replace(/\\s+/g, ' ').split(/\\s*;\\s*/);\n\n // loop through..\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n\n if (line.indexOf('uniform') > -1) {\n var splitLine = line.split(' ');\n var type = splitLine[1];\n\n var name = splitLine[2];\n var size = 1;\n\n if (name.indexOf('[') > -1) {\n // array!\n nameSplit = name.split(/\\[|]/);\n name = nameSplit[0];\n size *= Number(nameSplit[1]);\n }\n\n if (!name.match(maskRegex)) {\n uniforms[name] = {\n value: defaultValue(type, size),\n name: name,\n type: type\n };\n }\n }\n }\n\n return uniforms;\n}\n//# sourceMappingURL=extractUniformsFromSrc.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/extractUniformsFromSrc.js\n// module id = 540\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.calculateScreenSpaceMatrix = calculateScreenSpaceMatrix;\nexports.calculateNormalizedScreenSpaceMatrix = calculateNormalizedScreenSpaceMatrix;\nexports.calculateSpriteMatrix = calculateSpriteMatrix;\n\nvar _math = require('../../../math');\n\n/*\n * Calculates the mapped matrix\n * @param filterArea {Rectangle} The filter area\n * @param sprite {Sprite} the target sprite\n * @param outputMatrix {Matrix} @alvin\n */\n// TODO playing around here.. this is temporary - (will end up in the shader)\n// this returns a matrix that will normalise map filter cords in the filter to screen space\nfunction calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX),\n // let texture = {width:1136, height:700};//sprite._texture.baseTexture;\n\n // TODO unwrap?\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n mappedMatrix.scale(textureSize.width, textureSize.height);\n\n return mappedMatrix;\n}\n\nfunction calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n var translateScaleX = textureSize.width / filterArea.width;\n var translateScaleY = textureSize.height / filterArea.height;\n\n mappedMatrix.scale(translateScaleX, translateScaleY);\n\n return mappedMatrix;\n}\n\n// this will map the filter coord so that a texture can be used based on the transform of a sprite\nfunction calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) {\n var worldTransform = sprite.worldTransform.copy(_math.Matrix.TEMP_MATRIX);\n var texture = sprite._texture.baseTexture;\n\n // TODO unwrap?\n var mappedMatrix = outputMatrix.identity();\n\n // scale..\n var ratio = textureSize.height / textureSize.width;\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n mappedMatrix.scale(1, ratio);\n\n var translateScaleX = textureSize.width / texture.width;\n var translateScaleY = textureSize.height / texture.height;\n\n worldTransform.tx /= texture.width * translateScaleX;\n\n // this...? free beer for anyone who can explain why this makes sense!\n worldTransform.ty /= texture.width * translateScaleX;\n // worldTransform.ty /= texture.height * translateScaleY;\n\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n\n // apply inverse scale..\n mappedMatrix.scale(1, 1 / ratio);\n\n mappedMatrix.scale(translateScaleX, translateScaleY);\n\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n\n return mappedMatrix;\n}\n//# sourceMappingURL=filterTransforms.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/filterTransforms.js\n// module id = 541\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _RenderTarget = require('../utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _Quad = require('../utils/Quad');\n\nvar _Quad2 = _interopRequireDefault(_Quad);\n\nvar _math = require('../../../math');\n\nvar _Shader = require('../../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _filterTransforms = require('../filters/filterTransforms');\n\nvar filterTransforms = _interopRequireWildcard(_filterTransforms);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @ignore\n * @class\n */\nvar FilterState =\n/**\n *\n */\nfunction FilterState() {\n _classCallCheck(this, FilterState);\n\n this.renderTarget = null;\n this.sourceFrame = new _math.Rectangle();\n this.destinationFrame = new _math.Rectangle();\n this.filters = [];\n this.target = null;\n this.resolution = 1;\n};\n\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.WebGLManager\n */\n\n\nvar FilterManager = function (_WebGLManager) {\n _inherits(FilterManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function FilterManager(renderer) {\n _classCallCheck(this, FilterManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.gl = _this.renderer.gl;\n // know about sprites!\n _this.quad = new _Quad2.default(_this.gl, renderer.state.attribState);\n\n _this.shaderCache = {};\n // todo add default!\n _this.pool = {};\n\n _this.filterData = null;\n return _this;\n }\n\n /**\n * Adds a new filter to the manager.\n *\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param {PIXI.Filter[]} filters - The filters to apply.\n */\n\n\n FilterManager.prototype.pushFilter = function pushFilter(target, filters) {\n var renderer = this.renderer;\n\n var filterData = this.filterData;\n\n if (!filterData) {\n filterData = this.renderer._activeRenderTarget.filterStack;\n\n // add new stack\n var filterState = new FilterState();\n\n filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size;\n filterState.renderTarget = renderer._activeRenderTarget;\n\n this.renderer._activeRenderTarget.filterData = filterData = {\n index: 0,\n stack: [filterState]\n };\n\n this.filterData = filterData;\n }\n\n // get the current filter state..\n var currentState = filterData.stack[++filterData.index];\n\n if (!currentState) {\n currentState = filterData.stack[filterData.index] = new FilterState();\n }\n\n // for now we go off the filter of the first resolution..\n var resolution = filters[0].resolution;\n var padding = filters[0].padding | 0;\n var targetBounds = target.filterArea || target.getBounds(true);\n var sourceFrame = currentState.sourceFrame;\n var destinationFrame = currentState.destinationFrame;\n\n sourceFrame.x = (targetBounds.x * resolution | 0) / resolution;\n sourceFrame.y = (targetBounds.y * resolution | 0) / resolution;\n sourceFrame.width = (targetBounds.width * resolution | 0) / resolution;\n sourceFrame.height = (targetBounds.height * resolution | 0) / resolution;\n\n if (filterData.stack[0].renderTarget.transform) {//\n\n // TODO we should fit the rect around the transform..\n } else {\n sourceFrame.fit(filterData.stack[0].destinationFrame);\n }\n\n // lets apply the padding After we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n sourceFrame.pad(padding);\n\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n\n // lets play the padding after we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n\n var renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);\n\n currentState.target = target;\n currentState.filters = filters;\n currentState.resolution = resolution;\n currentState.renderTarget = renderTarget;\n\n // bind the render target to draw the shape in the top corner..\n\n renderTarget.setFrame(destinationFrame, sourceFrame);\n\n // bind the render target\n renderer.bindRenderTarget(renderTarget);\n renderTarget.clear();\n };\n\n /**\n * Pops off the filter and applies it.\n *\n */\n\n\n FilterManager.prototype.popFilter = function popFilter() {\n var filterData = this.filterData;\n\n var lastState = filterData.stack[filterData.index - 1];\n var currentState = filterData.stack[filterData.index];\n\n this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload();\n\n var filters = currentState.filters;\n\n if (filters.length === 1) {\n filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false);\n this.freePotRenderTarget(currentState.renderTarget);\n } else {\n var flip = currentState.renderTarget;\n var flop = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, currentState.resolution);\n\n flop.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n // finally lets clear the render target before drawing to it..\n flop.clear();\n\n var i = 0;\n\n for (i = 0; i < filters.length - 1; ++i) {\n filters[i].apply(this, flip, flop, true);\n\n var t = flip;\n\n flip = flop;\n flop = t;\n }\n\n filters[i].apply(this, flip, lastState.renderTarget, true);\n\n this.freePotRenderTarget(flip);\n this.freePotRenderTarget(flop);\n }\n\n filterData.index--;\n\n if (filterData.index === 0) {\n this.filterData = null;\n }\n };\n\n /**\n * Draws a filter.\n *\n * @param {PIXI.Filter} filter - The filter to draw.\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n */\n\n\n FilterManager.prototype.applyFilter = function applyFilter(filter, input, output, clear) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var shader = filter.glShaders[renderer.CONTEXT_UID];\n\n // cacheing..\n if (!shader) {\n if (filter.glShaderKey) {\n shader = this.shaderCache[filter.glShaderKey];\n\n if (!shader) {\n shader = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n\n filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader;\n }\n } else {\n shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n }\n\n // TODO - this only needs to be done once?\n renderer.bindVao(null);\n\n this.quad.initVao(shader);\n }\n\n renderer.bindVao(this.quad.vao);\n\n renderer.bindRenderTarget(output);\n\n if (clear) {\n gl.disable(gl.SCISSOR_TEST);\n renderer.clear(); // [1, 1, 1, 1]);\n gl.enable(gl.SCISSOR_TEST);\n }\n\n // in case the render target is being masked using a scissor rect\n if (output === renderer.maskManager.scissorRenderTarget) {\n renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData);\n }\n\n renderer.bindShader(shader);\n\n // this syncs the pixi filters uniforms with glsl uniforms\n this.syncUniforms(shader, filter);\n\n renderer.state.setBlendMode(filter.blendMode);\n\n // temporary bypass cache..\n var tex = this.renderer.boundTextures[0];\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, input.texture.texture);\n\n this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n\n // restore cache.\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n };\n\n /**\n * Uploads the uniforms of the filter.\n *\n * @param {GLShader} shader - The underlying gl shader.\n * @param {PIXI.Filter} filter - The filter we are synchronizing.\n */\n\n\n FilterManager.prototype.syncUniforms = function syncUniforms(shader, filter) {\n var uniformData = filter.uniformData;\n var uniforms = filter.uniforms;\n\n // 0 is reserved for the pixi texture so we start at 1!\n var textureCount = 1;\n var currentState = void 0;\n\n if (shader.uniforms.data.filterArea) {\n currentState = this.filterData.stack[this.filterData.index];\n var filterArea = shader.uniforms.filterArea;\n\n filterArea[0] = currentState.renderTarget.size.width;\n filterArea[1] = currentState.renderTarget.size.height;\n filterArea[2] = currentState.sourceFrame.x;\n filterArea[3] = currentState.sourceFrame.y;\n\n shader.uniforms.filterArea = filterArea;\n }\n\n // use this to clamp displaced texture coords so they belong to filterArea\n // see displacementFilter fragment shader for an example\n if (shader.uniforms.data.filterClamp) {\n currentState = this.filterData.stack[this.filterData.index];\n\n var filterClamp = shader.uniforms.filterClamp;\n\n filterClamp[0] = 0;\n filterClamp[1] = 0;\n filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width;\n filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height;\n\n shader.uniforms.filterClamp = filterClamp;\n }\n\n // TODO Cacheing layer..\n for (var i in uniformData) {\n if (uniformData[i].type === 'sampler2D' && uniforms[i] !== 0) {\n if (uniforms[i].baseTexture) {\n shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount);\n } else {\n shader.uniforms[i] = textureCount;\n\n // TODO\n // this is helpful as renderTargets can also be set.\n // Although thinking about it, we could probably\n // make the filter texture cache return a RenderTexture\n // rather than a renderTarget\n var gl = this.renderer.gl;\n\n this.renderer.boundTextures[textureCount] = this.renderer.emptyTextures[textureCount];\n gl.activeTexture(gl.TEXTURE0 + textureCount);\n\n uniforms[i].texture.bind();\n }\n\n textureCount++;\n } else if (uniformData[i].type === 'mat3') {\n // check if its pixi matrix..\n if (uniforms[i].a !== undefined) {\n shader.uniforms[i] = uniforms[i].toArray(true);\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (uniformData[i].type === 'vec2') {\n // check if its a point..\n if (uniforms[i].x !== undefined) {\n var val = shader.uniforms[i] || new Float32Array(2);\n\n val[0] = uniforms[i].x;\n val[1] = uniforms[i].y;\n shader.uniforms[i] = val;\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (uniformData[i].type === 'float') {\n if (shader.uniforms.data[i].value !== uniformData[i]) {\n shader.uniforms[i] = uniforms[i];\n }\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n }\n };\n\n /**\n * Gets a render target from the pool, or creates a new one.\n *\n * @param {boolean} clear - Should we clear the render texture when we get it?\n * @param {number} resolution - The resolution of the target.\n * @return {PIXI.RenderTarget} The new render target\n */\n\n\n FilterManager.prototype.getRenderTarget = function getRenderTarget(clear, resolution) {\n var currentState = this.filterData.stack[this.filterData.index];\n var renderTarget = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, resolution || currentState.resolution);\n\n renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n return renderTarget;\n };\n\n /**\n * Returns a render target to the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The render target to return.\n */\n\n\n FilterManager.prototype.returnRenderTarget = function returnRenderTarget(renderTarget) {\n this.freePotRenderTarget(renderTarget);\n };\n\n /**\n * Calculates the mapped matrix.\n *\n * TODO playing around here.. this is temporary - (will end up in the shader)\n * this returns a matrix that will normalise map filter cords in the filter to screen space\n *\n * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateScreenSpaceMatrix = function calculateScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size);\n };\n\n /**\n * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateNormalizedScreenSpaceMatrix = function calculateNormalizedScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateNormalizedScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, currentState.destinationFrame);\n };\n\n /**\n * This will map the filter coord so that a texture can be used based on the transform of a sprite\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateSpriteMatrix = function calculateSpriteMatrix(outputMatrix, sprite) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateSpriteMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, sprite);\n };\n\n /**\n * Destroys this Filter Manager.\n *\n */\n\n\n FilterManager.prototype.destroy = function destroy() {\n this.shaderCache = [];\n this.emptyPool();\n };\n\n /**\n * Gets a Power-of-Two render texture.\n *\n * TODO move to a seperate class could be on renderer?\n * also - could cause issue with multiple contexts?\n *\n * @private\n * @param {WebGLRenderingContext} gl - The webgl rendering context\n * @param {number} minWidth - The minimum width of the render target.\n * @param {number} minHeight - The minimum height of the render target.\n * @param {number} resolution - The resolution of the render target.\n * @return {PIXI.RenderTarget} The new render target.\n */\n\n\n FilterManager.prototype.getPotRenderTarget = function getPotRenderTarget(gl, minWidth, minHeight, resolution) {\n // TODO you could return a bigger texture if there is not one in the pool?\n minWidth = _bitTwiddle2.default.nextPow2(minWidth * resolution);\n minHeight = _bitTwiddle2.default.nextPow2(minHeight * resolution);\n\n var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n\n if (!this.pool[key]) {\n this.pool[key] = [];\n }\n\n var renderTarget = this.pool[key].pop();\n\n // creating render target will cause texture to be bound!\n if (!renderTarget) {\n // temporary bypass cache..\n var tex = this.renderer.boundTextures[0];\n\n gl.activeTexture(gl.TEXTURE0);\n\n // internally - this will cause a texture to be bound..\n renderTarget = new _RenderTarget2.default(gl, minWidth, minHeight, null, 1);\n\n // set the current one back\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n }\n\n // manually tweak the resolution...\n // this will not modify the size of the frame buffer, just its resolution.\n renderTarget.resolution = resolution;\n renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution;\n renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution;\n\n return renderTarget;\n };\n\n /**\n * Empties the texture pool.\n *\n */\n\n\n FilterManager.prototype.emptyPool = function emptyPool() {\n for (var i in this.pool) {\n var textures = this.pool[i];\n\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n\n this.pool = {};\n };\n\n /**\n * Frees a render target back into the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free\n */\n\n\n FilterManager.prototype.freePotRenderTarget = function freePotRenderTarget(renderTarget) {\n var minWidth = renderTarget.size.width * renderTarget.resolution;\n var minHeight = renderTarget.size.height * renderTarget.resolution;\n var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n\n this.pool[key].push(renderTarget);\n };\n\n return FilterManager;\n}(_WebGLManager3.default);\n\nexports.default = FilterManager;\n//# sourceMappingURL=FilterManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/FilterManager.js\n// module id = 542\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _SpriteMaskFilter = require('../filters/spriteMask/SpriteMaskFilter');\n\nvar _SpriteMaskFilter2 = _interopRequireDefault(_SpriteMaskFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar MaskManager = function (_WebGLManager) {\n _inherits(MaskManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function MaskManager(renderer) {\n _classCallCheck(this, MaskManager);\n\n // TODO - we don't need both!\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.scissor = false;\n _this.scissorData = null;\n _this.scissorRenderTarget = null;\n\n _this.enableScissor = true;\n\n _this.alphaMaskPool = [];\n _this.alphaMaskIndex = 0;\n return _this;\n }\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushMask = function pushMask(target, maskData) {\n // TODO the root check means scissor rect will not\n // be used on render textures more info here:\n // https://github.com/pixijs/pixi.js/pull/3545\n\n if (maskData.texture) {\n this.pushSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) {\n var matrix = maskData.worldTransform;\n\n var rot = Math.atan2(matrix.b, matrix.a);\n\n // use the nearest degree!\n rot = Math.round(rot * (180 / Math.PI));\n\n if (rot % 90) {\n this.pushStencilMask(maskData);\n } else {\n this.pushScissorMask(target, maskData);\n }\n } else {\n this.pushStencilMask(maskData);\n }\n };\n\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * @param {PIXI.DisplayObject} target - Display Object to pop the mask from\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.popMask = function popMask(target, maskData) {\n if (maskData.texture) {\n this.popSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length) {\n this.popScissorMask(target, maskData);\n } else {\n this.popStencilMask(target, maskData);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to\n * @param {PIXI.Sprite} maskData - Sprite to be used as the mask\n */\n\n\n MaskManager.prototype.pushSpriteMask = function pushSpriteMask(target, maskData) {\n var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new _SpriteMaskFilter2.default(maskData)];\n }\n\n alphaMaskFilter[0].resolution = this.renderer.resolution;\n alphaMaskFilter[0].maskSprite = maskData;\n\n // TODO - may cause issues!\n target.filterArea = maskData.getBounds(true);\n\n this.renderer.filterManager.pushFilter(target, alphaMaskFilter);\n\n this.alphaMaskIndex++;\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popSpriteMask = function popSpriteMask() {\n this.renderer.filterManager.popFilter();\n this.alphaMaskIndex--;\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushStencilMask = function pushStencilMask(maskData) {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.pushStencil(maskData);\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popStencilMask = function popStencilMask() {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.popStencil();\n };\n\n /**\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushScissorMask = function pushScissorMask(target, maskData) {\n maskData.renderable = true;\n\n var renderTarget = this.renderer._activeRenderTarget;\n\n var bounds = maskData.getBounds();\n\n bounds.fit(renderTarget.size);\n maskData.renderable = false;\n\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n\n var resolution = this.renderer.resolution;\n\n this.renderer.gl.scissor(bounds.x * resolution, (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, bounds.width * resolution, bounds.height * resolution);\n\n this.scissorRenderTarget = renderTarget;\n this.scissorData = maskData;\n this.scissor = true;\n };\n\n /**\n *\n *\n */\n\n\n MaskManager.prototype.popScissorMask = function popScissorMask() {\n this.scissorRenderTarget = null;\n this.scissorData = null;\n this.scissor = false;\n\n // must be scissor!\n var gl = this.renderer.gl;\n\n gl.disable(gl.SCISSOR_TEST);\n };\n\n return MaskManager;\n}(_WebGLManager3.default);\n\nexports.default = MaskManager;\n//# sourceMappingURL=MaskManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/MaskManager.js\n// module id = 543\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar StencilManager = function (_WebGLManager) {\n _inherits(StencilManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function StencilManager(renderer) {\n _classCallCheck(this, StencilManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.stencilMaskStack = null;\n return _this;\n }\n\n /**\n * Changes the mask stack that is used by this manager.\n *\n * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack\n */\n\n\n StencilManager.prototype.setMaskStack = function setMaskStack(stencilMaskStack) {\n this.stencilMaskStack = stencilMaskStack;\n\n var gl = this.renderer.gl;\n\n if (stencilMaskStack.length === 0) {\n gl.disable(gl.STENCIL_TEST);\n } else {\n gl.enable(gl.STENCIL_TEST);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack. @alvin\n *\n * @param {PIXI.Graphics} graphics - The mask\n */\n\n\n StencilManager.prototype.pushStencil = function pushStencil(graphics) {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n this.renderer._activeRenderTarget.attachStencilBuffer();\n\n var gl = this.renderer.gl;\n var sms = this.stencilMaskStack;\n\n if (sms.length === 0) {\n gl.enable(gl.STENCIL_TEST);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.stencilFunc(gl.ALWAYS, 1, 1);\n }\n\n sms.push(graphics);\n\n gl.colorMask(false, false, false, false);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n\n this.renderer.plugins.graphics.render(graphics);\n\n gl.colorMask(true, true, true, true);\n gl.stencilFunc(gl.NOTEQUAL, 0, sms.length);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n };\n\n /**\n * TODO @alvin\n */\n\n\n StencilManager.prototype.popStencil = function popStencil() {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n var gl = this.renderer.gl;\n var sms = this.stencilMaskStack;\n\n var graphics = sms.pop();\n\n if (sms.length === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n } else {\n gl.colorMask(false, false, false, false);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n\n this.renderer.plugins.graphics.render(graphics);\n\n gl.colorMask(true, true, true, true);\n gl.stencilFunc(gl.NOTEQUAL, 0, sms.length);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n }\n };\n\n /**\n * Destroys the mask stack.\n *\n */\n\n\n StencilManager.prototype.destroy = function destroy() {\n _WebGLManager3.default.prototype.destroy.call(this);\n\n this.stencilMaskStack.stencilStack = null;\n };\n\n return StencilManager;\n}(_WebGLManager3.default);\n\nexports.default = StencilManager;\n//# sourceMappingURL=StencilManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/StencilManager.js\n// module id = 544\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = checkMaxIfStatmentsInShader;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['precision mediump float;', 'void main(void){', 'float test = 0.1;', '%forloop%', 'gl_FragColor = vec4(0.0);', '}'].join('\\n');\n\nfunction checkMaxIfStatmentsInShader(maxIfs, gl) {\n var createTempContext = !gl;\n\n // @if DEBUG\n if (maxIfs === 0) {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n // @endif\n\n if (createTempContext) {\n var tinyCanvas = document.createElement('canvas');\n\n tinyCanvas.width = 1;\n tinyCanvas.height = 1;\n\n gl = _pixiGlCore2.default.createContext(tinyCanvas);\n }\n\n var shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n while (true) // eslint-disable-line no-constant-condition\n {\n var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = maxIfs / 2 | 0;\n } else {\n // valid!\n break;\n }\n }\n\n if (createTempContext) {\n // get rid of context\n if (gl.getExtension('WEBGL_lose_context')) {\n gl.getExtension('WEBGL_lose_context').loseContext();\n }\n }\n\n return maxIfs;\n}\n\nfunction generateIfTestSrc(maxIfs) {\n var src = '';\n\n for (var i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1) {\n src += 'if(test == ' + i + '.0){}';\n }\n }\n\n return src;\n}\n//# sourceMappingURL=checkMaxIfStatmentsInShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/checkMaxIfStatmentsInShader.js\n// module id = 545\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLBlendModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Maps gl blend combinations to WebGL.\n *\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapWebGLBlendModesToPixi(gl) {\n var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[_const.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA];\n array[_const.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n array[_const.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n return array;\n}\n//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js\n// module id = 546\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLDrawModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Generic Mask Stack data structure.\n *\n * @memberof PIXI\n * @function mapWebGLDrawModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {object} [object={}] - The object to map into\n * @return {object} The mapped draw modes.\n */\nfunction mapWebGLDrawModesToPixi(gl) {\n var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n object[_const.DRAW_MODES.POINTS] = gl.POINTS;\n object[_const.DRAW_MODES.LINES] = gl.LINES;\n object[_const.DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP;\n object[_const.DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP;\n object[_const.DRAW_MODES.TRIANGLES] = gl.TRIANGLES;\n object[_const.DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP;\n object[_const.DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN;\n\n return object;\n}\n//# sourceMappingURL=mapWebGLDrawModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js\n// module id = 547\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = validateContext;\nfunction validateContext(gl) {\n var attributes = gl.getContextAttributes();\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (!attributes.stencil) {\n /* eslint-disable no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable no-console */\n }\n}\n//# sourceMappingURL=validateContext.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/validateContext.js\n// module id = 548\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nvar _math = require('../../math');\n\nvar _CanvasTinter = require('./CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar canvasRenderWorldTransform = new _math.Matrix();\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasSpriteRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n */\n\nvar CanvasSpriteRenderer = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for.\n */\n function CanvasSpriteRenderer(renderer) {\n _classCallCheck(this, CanvasSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n CanvasSpriteRenderer.prototype.render = function render(sprite) {\n var texture = sprite._texture;\n var renderer = this.renderer;\n\n var width = texture._frame.width;\n var height = texture._frame.height;\n\n var wt = sprite.transform.worldTransform;\n var dx = 0;\n var dy = 0;\n\n if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source) {\n return;\n }\n\n renderer.setBlendMode(sprite.blendMode);\n\n // Ignore null sources\n if (texture.valid) {\n renderer.context.globalAlpha = sprite.worldAlpha;\n\n // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture\n var smoothingEnabled = texture.baseTexture.scaleMode === _const.SCALE_MODES.LINEAR;\n\n if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled) {\n renderer.context[renderer.smoothProperty] = smoothingEnabled;\n }\n\n if (texture.trim) {\n dx = texture.trim.width / 2 + texture.trim.x - sprite.anchor.x * texture.orig.width;\n dy = texture.trim.height / 2 + texture.trim.y - sprite.anchor.y * texture.orig.height;\n } else {\n dx = (0.5 - sprite.anchor.x) * texture.orig.width;\n dy = (0.5 - sprite.anchor.y) * texture.orig.height;\n }\n\n if (texture.rotate) {\n wt.copy(canvasRenderWorldTransform);\n wt = canvasRenderWorldTransform;\n _math.GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy);\n // the anchor has already been applied above, so lets set it to zero\n dx = 0;\n dy = 0;\n }\n\n dx -= width / 2;\n dy -= height / 2;\n\n // Allow for pixel rounding\n if (renderer.roundPixels) {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution | 0, wt.ty * renderer.resolution | 0);\n\n dx = dx | 0;\n dy = dy | 0;\n } else {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);\n }\n\n var resolution = texture.baseTexture.resolution;\n\n if (sprite.tint !== 0xFFFFFF) {\n if (sprite.cachedTint !== sprite.tint) {\n sprite.cachedTint = sprite.tint;\n\n // TODO clean up caching - how to clean up the caches?\n sprite.tintedTexture = _CanvasTinter2.default.getTintedTexture(sprite, sprite.tint);\n }\n\n renderer.context.drawImage(sprite.tintedTexture, 0, 0, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n } else {\n renderer.context.drawImage(texture.baseTexture.source, texture._frame.x * resolution, texture._frame.y * resolution, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n }\n }\n };\n\n /**\n * destroy the sprite object.\n *\n */\n\n\n CanvasSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasSpriteRenderer;\n}();\n\nexports.default = CanvasSpriteRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer);\n//# sourceMappingURL=CanvasSpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/canvas/CanvasSpriteRenderer.js\n// module id = 549\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Buffer = function () {\n /**\n * @param {number} size - The size of the buffer in bytes.\n */\n function Buffer(size) {\n _classCallCheck(this, Buffer);\n\n this.vertices = new ArrayBuffer(size);\n\n /**\n * View on the vertices as a Float32Array for positions\n *\n * @member {Float32Array}\n */\n this.float32View = new Float32Array(this.vertices);\n\n /**\n * View on the vertices as a Uint32Array for uvs\n *\n * @member {Float32Array}\n */\n this.uint32View = new Uint32Array(this.vertices);\n }\n\n /**\n * Destroys the buffer.\n *\n */\n\n\n Buffer.prototype.destroy = function destroy() {\n this.vertices = null;\n this.positions = null;\n this.uvs = null;\n this.colors = null;\n };\n\n return Buffer;\n}();\n\nexports.default = Buffer;\n//# sourceMappingURL=BatchBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/BatchBuffer.js\n// module id = 550\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _createIndicesForQuads = require('../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nvar _generateMultiTextureShader = require('./generateMultiTextureShader');\n\nvar _generateMultiTextureShader2 = _interopRequireDefault(_generateMultiTextureShader);\n\nvar _checkMaxIfStatmentsInShader = require('../../renderers/webgl/utils/checkMaxIfStatmentsInShader');\n\nvar _checkMaxIfStatmentsInShader2 = _interopRequireDefault(_checkMaxIfStatmentsInShader);\n\nvar _BatchBuffer = require('./BatchBuffer');\n\nvar _BatchBuffer2 = _interopRequireDefault(_BatchBuffer);\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TICK = 0;\nvar TEXTURE_TICK = 0;\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar SpriteRenderer = function (_ObjectRenderer) {\n _inherits(SpriteRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function SpriteRenderer(renderer) {\n _classCallCheck(this, SpriteRenderer);\n\n /**\n * Number of values sent in the vertex buffer.\n * positionX, positionY, colorR, colorG, colorB = 5\n *\n * @member {number}\n */\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.vertSize = 5;\n\n /**\n * The size of the vertex information in bytes.\n *\n * @member {number}\n */\n _this.vertByteSize = _this.vertSize * 4;\n\n /**\n * The number of images in the SpriteRenderer before it flushes.\n *\n * @member {number}\n */\n _this.size = _settings2.default.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop\n\n // the total number of bytes in our batch\n // let numVerts = this.size * 4 * this.vertByteSize;\n\n _this.buffers = [];\n for (var i = 1; i <= _bitTwiddle2.default.nextPow2(_this.size); i *= 2) {\n _this.buffers.push(new _BatchBuffer2.default(i * 4 * _this.vertByteSize));\n }\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n _this.indices = (0, _createIndicesForQuads2.default)(_this.size);\n\n /**\n * The default shaders that is used if a sprite doesn't have a more specific one.\n * there is a shader for each number of textures that can be rendererd.\n * These shaders will also be generated on the fly as required.\n * @member {PIXI.Shader[]}\n */\n _this.shader = null;\n\n _this.currentIndex = 0;\n TICK = 0;\n _this.groups = [];\n\n for (var k = 0; k < _this.size; k++) {\n _this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 };\n }\n\n _this.sprites = [];\n\n _this.vertexBuffers = [];\n _this.vaos = [];\n\n _this.vaoMax = 2;\n _this.vertexCount = 0;\n\n _this.renderer.on('prerender', _this.onPrerender, _this);\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n SpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), _settings2.default.SPRITE_MAX_TEXTURES);\n\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = (0, _checkMaxIfStatmentsInShader2.default)(this.MAX_TEXTURES, gl);\n\n var shader = this.shader = (0, _generateMultiTextureShader2.default)(gl, this.MAX_TEXTURES);\n\n // create a couple of buffers\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n // we use the second shader as the first one depending on your browser may omit aTextureId\n // as it is not used by the shader so is optimized out.\n\n this.renderer.bindVao(null);\n\n for (var i = 0; i < this.vaoMax; i++) {\n this.vertexBuffers[i] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n\n /* eslint-disable max-len */\n\n // build the vao object that will render..\n this.vaos[i] = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[i], shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(this.vertexBuffers[i], shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(this.vertexBuffers[i], shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4).addAttribute(this.vertexBuffers[i], shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n\n /* eslint-enable max-len */\n }\n\n this.vao = this.vaos[0];\n this.currentBlendMode = 99999;\n\n this.boundTextures = new Array(this.MAX_TEXTURES);\n };\n\n /**\n * Called before the renderer starts rendering.\n *\n */\n\n\n SpriteRenderer.prototype.onPrerender = function onPrerender() {\n this.vertexCount = 0;\n };\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n SpriteRenderer.prototype.render = function render(sprite) {\n // TODO set blend modes..\n // check texture..\n if (this.currentIndex >= this.size) {\n this.flush();\n }\n\n // get the uvs for the texture\n\n // if the uvs have not updated then no point rendering just yet!\n if (!sprite._texture._uvs) {\n return;\n }\n\n // push a texture.\n // increment the batchsize\n this.sprites[this.currentIndex++] = sprite;\n };\n\n /**\n * Renders the content and empties the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.flush = function flush() {\n if (this.currentIndex === 0) {\n return;\n }\n\n var gl = this.renderer.gl;\n var MAX_TEXTURES = this.MAX_TEXTURES;\n\n var np2 = _bitTwiddle2.default.nextPow2(this.currentIndex);\n var log2 = _bitTwiddle2.default.log2(np2);\n var buffer = this.buffers[log2];\n\n var sprites = this.sprites;\n var groups = this.groups;\n\n var float32View = buffer.float32View;\n var uint32View = buffer.uint32View;\n\n var boundTextures = this.boundTextures;\n var rendererBoundTextures = this.renderer.boundTextures;\n var touch = this.renderer.textureGC.count;\n\n var index = 0;\n var nextTexture = void 0;\n var currentTexture = void 0;\n var groupCount = 1;\n var textureCount = 0;\n var currentGroup = groups[0];\n var vertexData = void 0;\n var uvs = void 0;\n var blendMode = sprites[0].blendMode;\n\n currentGroup.textureCount = 0;\n currentGroup.start = 0;\n currentGroup.blend = blendMode;\n\n TICK++;\n\n var i = void 0;\n\n // copy textures..\n for (i = 0; i < MAX_TEXTURES; ++i) {\n boundTextures[i] = rendererBoundTextures[i];\n boundTextures[i]._virtalBoundId = i;\n }\n\n for (i = 0; i < this.currentIndex; ++i) {\n // upload the sprite elemetns...\n // they have all ready been calculated so we just need to push them into the buffer.\n var sprite = sprites[i];\n\n nextTexture = sprite._texture.baseTexture;\n\n if (blendMode !== sprite.blendMode) {\n // finish a group..\n blendMode = sprite.blendMode;\n\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n\n if (nextTexture._enabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n\n currentGroup.size = i - currentGroup.start;\n\n textureCount = 0;\n\n currentGroup = groups[groupCount++];\n currentGroup.blend = blendMode;\n currentGroup.textureCount = 0;\n currentGroup.start = i;\n }\n\n nextTexture.touched = touch;\n\n if (nextTexture._virtalBoundId === -1) {\n for (var j = 0; j < MAX_TEXTURES; ++j) {\n var tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES;\n\n var t = boundTextures[tIndex];\n\n if (t._enabled !== TICK) {\n TEXTURE_TICK++;\n\n t._virtalBoundId = -1;\n\n nextTexture._virtalBoundId = tIndex;\n\n boundTextures[tIndex] = nextTexture;\n break;\n }\n }\n }\n\n nextTexture._enabled = TICK;\n\n currentGroup.textureCount++;\n currentGroup.ids[textureCount] = nextTexture._virtalBoundId;\n currentGroup.textures[textureCount++] = nextTexture;\n }\n }\n\n vertexData = sprite.vertexData;\n\n // TODO this sum does not need to be set each frame..\n uvs = sprite._texture._uvs.uvsUint32;\n\n if (this.renderer.roundPixels) {\n var resolution = this.renderer.resolution;\n\n // xy\n float32View[index] = (vertexData[0] * resolution | 0) / resolution;\n float32View[index + 1] = (vertexData[1] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 5] = (vertexData[2] * resolution | 0) / resolution;\n float32View[index + 6] = (vertexData[3] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 10] = (vertexData[4] * resolution | 0) / resolution;\n float32View[index + 11] = (vertexData[5] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 15] = (vertexData[6] * resolution | 0) / resolution;\n float32View[index + 16] = (vertexData[7] * resolution | 0) / resolution;\n } else {\n // xy\n float32View[index] = vertexData[0];\n float32View[index + 1] = vertexData[1];\n\n // xy\n float32View[index + 5] = vertexData[2];\n float32View[index + 6] = vertexData[3];\n\n // xy\n float32View[index + 10] = vertexData[4];\n float32View[index + 11] = vertexData[5];\n\n // xy\n float32View[index + 15] = vertexData[6];\n float32View[index + 16] = vertexData[7];\n }\n\n uint32View[index + 2] = uvs[0];\n uint32View[index + 7] = uvs[1];\n uint32View[index + 12] = uvs[2];\n uint32View[index + 17] = uvs[3];\n\n /* eslint-disable max-len */\n uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = sprite._tintRGB + (Math.min(sprite.worldAlpha, 1) * 255 << 24);\n\n float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId;\n /* eslint-enable max-len */\n\n index += 20;\n }\n\n currentGroup.size = i - currentGroup.start;\n\n if (!_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // this is still needed for IOS performance..\n // it really does not like uploading to the same buffer in a single frame!\n if (this.vaoMax <= this.vertexCount) {\n this.vaoMax++;\n this.vertexBuffers[this.vertexCount] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n\n /* eslint-disable max-len */\n\n // build the vao object that will render..\n this.vaos[this.vertexCount] = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n\n /* eslint-enable max-len */\n }\n\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false);\n\n this.vertexCount++;\n } else {\n // lets use the faster option, always use buffer number 0\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true);\n }\n\n for (i = 0; i < MAX_TEXTURES; ++i) {\n rendererBoundTextures[i]._virtalBoundId = -1;\n }\n\n // render the groups..\n for (i = 0; i < groupCount; ++i) {\n var group = groups[i];\n var groupTextureCount = group.textureCount;\n\n for (var _j = 0; _j < groupTextureCount; _j++) {\n currentTexture = group.textures[_j];\n\n // reset virtual ids..\n // lets do a quick check..\n if (rendererBoundTextures[group.ids[_j]] !== currentTexture) {\n this.renderer.bindTexture(currentTexture, group.ids[_j], true);\n }\n\n // reset the virtualId..\n currentTexture._virtalBoundId = -1;\n }\n\n // set the blend mode..\n this.renderer.state.setBlendMode(group.blend);\n\n gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2);\n }\n\n // reset elements for the next flush\n this.currentIndex = 0;\n };\n\n /**\n * Starts a new sprite batch.\n */\n\n\n SpriteRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n\n if (_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].bind();\n }\n };\n\n /**\n * Stops and flushes the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.stop = function stop() {\n this.flush();\n };\n\n /**\n * Destroys the SpriteRenderer.\n *\n */\n\n\n SpriteRenderer.prototype.destroy = function destroy() {\n for (var i = 0; i < this.vaoMax; i++) {\n if (this.vertexBuffers[i]) {\n this.vertexBuffers[i].destroy();\n }\n if (this.vaos[i]) {\n this.vaos[i].destroy();\n }\n }\n\n if (this.indexBuffer) {\n this.indexBuffer.destroy();\n }\n\n this.renderer.off('prerender', this.onPrerender, this);\n\n _ObjectRenderer.prototype.destroy.call(this);\n\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n\n this.vertexBuffers = null;\n this.vaos = null;\n this.indexBuffer = null;\n this.indices = null;\n\n this.sprites = null;\n\n for (var _i = 0; _i < this.buffers.length; ++_i) {\n this.buffers[_i].destroy();\n }\n };\n\n return SpriteRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = SpriteRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('sprite', SpriteRenderer);\n//# sourceMappingURL=SpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/SpriteRenderer.js\n// module id = 551\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateMultiTextureShader;\n\nvar _Shader = require('../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'varying float vTextureId;', 'uniform sampler2D uSamplers[%count%];', 'void main(void){', 'vec4 color;', 'float textureId = floor(vTextureId+0.5);', '%forloop%', 'gl_FragColor = color * vColor;', '}'].join('\\n');\n\nfunction generateMultiTextureShader(gl, maxTextures) {\n var vertexSrc = 'precision highp float;\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\nattribute float aTextureId;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vTextureId = aTextureId;\\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\\n}\\n';\n var fragmentSrc = fragTemplate;\n\n fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n\n var shader = new _Shader2.default(gl, vertexSrc, fragmentSrc);\n\n var sampleValues = [];\n\n for (var i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n\n shader.bind();\n shader.uniforms.uSamplers = sampleValues;\n\n return shader;\n}\n\nfunction generateSampleSrc(maxTextures) {\n var src = '';\n\n src += '\\n';\n src += '\\n';\n\n for (var i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxTextures - 1) {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers[' + i + '], vTextureCoord);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n//# sourceMappingURL=generateMultiTextureShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/generateMultiTextureShader.js\n// module id = 552\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Sprite2 = require('../sprites/Sprite');\n\nvar _Sprite3 = _interopRequireDefault(_Sprite2);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TextStyle = require('./TextStyle');\n\nvar _TextStyle2 = _interopRequireDefault(_TextStyle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint max-depth: [2, 8] */\n\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true\n};\n\n/**\n * A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\n * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.\n *\n * A Text can be created directly from a string and a style object\n *\n * ```js\n * let text = new PIXI.Text('This is a pixi text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\n\nvar Text = function (_Sprite) {\n _inherits(Text, _Sprite);\n\n /**\n * @param {string} text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n _classCallCheck(this, Text);\n\n canvas = canvas || document.createElement('canvas');\n\n canvas.width = 3;\n canvas.height = 3;\n\n var texture = _Texture2.default.fromCanvas(canvas);\n\n texture.orig = new _math.Rectangle();\n texture.trim = new _math.Rectangle();\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n var _this = _possibleConstructorReturn(this, _Sprite.call(this, texture));\n\n _this.canvas = canvas;\n\n /**\n * The canvas 2d context that everything is drawn with\n * @member {HTMLCanvasElement}\n */\n _this.context = _this.canvas.getContext('2d');\n\n /**\n * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer.\n * @member {number}\n * @default 1\n */\n _this.resolution = _settings2.default.RESOLUTION;\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = null;\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._style = null;\n /**\n * Private listener to track style changes.\n *\n * @member {Function}\n * @private\n */\n _this._styleListener = null;\n\n /**\n * Private tracker for the current font.\n *\n * @member {string}\n * @private\n */\n _this._font = '';\n\n _this.text = text;\n _this.style = style;\n\n _this.localStyleID = -1;\n return _this;\n }\n\n /**\n * Renders text and updates it when needed.\n *\n * @private\n * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n\n\n Text.prototype.updateText = function updateText(respectDirty) {\n var style = this._style;\n\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n\n if (!this.dirty && respectDirty) {\n return;\n }\n\n this._font = Text.getFontStyle(style);\n\n this.context.font = this._font;\n\n // word wrap\n // preserve original text\n var outputText = style.wordWrap ? this.wordWrap(this._text) : this._text;\n\n // split text into lines\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n\n // calculate text width\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n var fontProperties = Text.calculateFontProperties(this._font);\n\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = this.context.measureText(lines[i]).width + (lines[i].length - 1) * style.letterSpacing;\n\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n\n var width = maxLineWidth + style.strokeThickness;\n\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n\n this.canvas.width = Math.ceil((width + style.padding * 2) * this.resolution);\n\n // calculate text height\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness) + (lines.length - 1) * lineHeight;\n\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n\n this.canvas.height = Math.ceil((height + style.padding * 2) * this.resolution);\n\n this.context.scale(this.resolution, this.resolution);\n\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n this.context.font = this._font;\n this.context.strokeStyle = style.stroke;\n this.context.lineWidth = style.strokeThickness;\n this.context.textBaseline = style.textBaseline;\n this.context.lineJoin = style.lineJoin;\n this.context.miterLimit = style.miterLimit;\n\n var linePositionX = void 0;\n var linePositionY = void 0;\n\n if (style.dropShadow) {\n if (style.dropShadowBlur > 0) {\n this.context.shadowColor = style.dropShadowColor;\n this.context.shadowBlur = style.dropShadowBlur;\n } else {\n this.context.fillStyle = style.dropShadowColor;\n }\n\n var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n\n for (var _i = 0; _i < lines.length; _i++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + _i * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[_i];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[_i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding);\n\n if (style.stroke && style.strokeThickness) {\n this.context.strokeStyle = style.dropShadowColor;\n this.drawLetterSpacing(lines[_i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding, true);\n this.context.strokeStyle = style.stroke;\n }\n }\n }\n }\n\n // set canvas text styles\n this.context.fillStyle = this._generateFillStyle(style, lines);\n\n // draw lines line by line\n for (var _i2 = 0; _i2 < lines.length; _i2++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + _i2 * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[_i2];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[_i2]) / 2;\n }\n\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[_i2], linePositionX + style.padding, linePositionY + style.padding, true);\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[_i2], linePositionX + style.padding, linePositionY + style.padding);\n }\n }\n\n this.updateTexture();\n };\n\n /**\n * Render the text with letter-spacing.\n * @param {string} text - The text to draw\n * @param {number} x - Horizontal position to draw the text\n * @param {number} y - Vertical position to draw the text\n * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n * @private\n */\n\n\n Text.prototype.drawLetterSpacing = function drawLetterSpacing(text, x, y) {\n var isStroke = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var style = this._style;\n\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n\n if (letterSpacing === 0) {\n if (isStroke) {\n this.context.strokeText(text, x, y);\n } else {\n this.context.fillText(text, x, y);\n }\n\n return;\n }\n\n var characters = String.prototype.split.call(text, '');\n var currentPosition = x;\n var index = 0;\n var current = '';\n\n while (index < text.length) {\n current = characters[index++];\n if (isStroke) {\n this.context.strokeText(current, currentPosition, y);\n } else {\n this.context.fillText(current, currentPosition, y);\n }\n currentPosition += this.context.measureText(current).width + letterSpacing;\n }\n };\n\n /**\n * Updates texture size based on canvas size\n *\n * @private\n */\n\n\n Text.prototype.updateTexture = function updateTexture() {\n var texture = this._texture;\n var style = this._style;\n\n texture.baseTexture.hasLoaded = true;\n texture.baseTexture.resolution = this.resolution;\n\n texture.baseTexture.realWidth = this.canvas.width;\n texture.baseTexture.realHeight = this.canvas.height;\n texture.baseTexture.width = this.canvas.width / this.resolution;\n texture.baseTexture.height = this.canvas.height / this.resolution;\n texture.trim.width = texture._frame.width = this.canvas.width / this.resolution;\n texture.trim.height = texture._frame.height = this.canvas.height / this.resolution;\n\n texture.trim.x = -style.padding;\n texture.trim.y = -style.padding;\n\n texture.orig.width = texture._frame.width - style.padding * 2;\n texture.orig.height = texture._frame.height - style.padding * 2;\n\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n\n texture.baseTexture.emit('update', texture.baseTexture);\n\n this.dirty = false;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Text.prototype.renderWebGL = function renderWebGL(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype.renderWebGL.call(this, renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Text.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype._renderCanvas.call(this, renderer);\n };\n\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n *\n * @private\n * @param {string} text - String to apply word wrapping to\n * @return {string} New string with new lines applied where required\n */\n\n\n Text.prototype.wordWrap = function wordWrap(text) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer\n // than its horizontal bounds.\n var result = '';\n var style = this._style;\n var lines = text.split('\\n');\n var wordWrapWidth = style.wordWrapWidth;\n\n for (var i = 0; i < lines.length; i++) {\n var spaceLeft = wordWrapWidth;\n var words = lines[i].split(' ');\n\n for (var j = 0; j < words.length; j++) {\n var wordWidth = this.context.measureText(words[j]).width;\n\n if (style.breakWords && wordWidth > wordWrapWidth) {\n // Word should be split in the middle\n var characters = words[j].split('');\n\n for (var c = 0; c < characters.length; c++) {\n var characterWidth = this.context.measureText(characters[c]).width;\n\n if (characterWidth > spaceLeft) {\n result += '\\n' + characters[c];\n spaceLeft = wordWrapWidth - characterWidth;\n } else {\n if (c === 0) {\n result += ' ';\n }\n\n result += characters[c];\n spaceLeft -= characterWidth;\n }\n }\n } else {\n var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;\n\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is\n // greater than the word wrap width.\n if (j > 0) {\n result += '\\n';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth;\n } else {\n spaceLeft -= wordWidthWithSpace;\n result += ' ' + words[j];\n }\n }\n }\n\n if (i < lines.length - 1) {\n result += '\\n';\n }\n }\n\n return result;\n };\n\n /**\n * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n */\n\n\n Text.prototype._calculateBounds = function _calculateBounds() {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n\n /**\n * Method to be called upon a TextStyle change.\n * @private\n */\n\n\n Text.prototype._onStyleChange = function _onStyleChange() {\n this.dirty = true;\n };\n\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\n\n\n Text.prototype._generateFillStyle = function _generateFillStyle(style, lines) {\n if (!Array.isArray(style.fill)) {\n return style.fill;\n }\n\n // cocoon on canvas+ cannot generate textures, so use the first colour instead\n if (navigator.isCocoonJS) {\n return style.fill[0];\n }\n\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient = void 0;\n var totalIterations = void 0;\n var currentIteration = void 0;\n var stop = void 0;\n\n var width = this.canvas.width / this.resolution;\n var height = this.canvas.height / this.resolution;\n\n if (style.fillGradientType === _const.TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height);\n\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n totalIterations = (style.fill.length + 1) * lines.length;\n currentIteration = 0;\n for (var i = 0; i < lines.length; i++) {\n currentIteration += 1;\n for (var j = 0; j < style.fill.length; j++) {\n stop = currentIteration / totalIterations;\n gradient.addColorStop(stop, style.fill[j]);\n currentIteration++;\n }\n }\n } else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(0, height / 2, width, height / 2);\n\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n totalIterations = style.fill.length + 1;\n currentIteration = 1;\n\n for (var _i3 = 0; _i3 < style.fill.length; _i3++) {\n stop = currentIteration / totalIterations;\n gradient.addColorStop(stop, style.fill[_i3]);\n currentIteration++;\n }\n }\n\n return gradient;\n };\n\n /**\n * Destroys this text object.\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majorety of the time the texture will not be shared with any other Sprites.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n\n\n Text.prototype.destroy = function destroy(options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n\n options = Object.assign({}, defaultDestroyOptions, options);\n\n _Sprite.prototype.destroy.call(this, options);\n\n // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n\n this._style = null;\n };\n\n /**\n * The width of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n /**\n * Generates a font style string to use for Text.calculateFontProperties(). Takes the same parameter\n * as Text.style.\n *\n * @static\n * @param {object|TextStyle} style - String representing the style of the font\n * @return {string} Font style string, for passing to Text.calculateFontProperties()\n */\n Text.getFontStyle = function getFontStyle(style) {\n style = style || {};\n\n if (!(style instanceof _TextStyle2.default)) {\n style = new _TextStyle2.default(style);\n }\n\n // build canvas api font setting from individual components. Convert a numeric style.fontSize to px\n var fontSizeString = typeof style.fontSize === 'number' ? style.fontSize + 'px' : style.fontSize;\n\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = style.fontFamily;\n\n if (!Array.isArray(style.fontFamily)) {\n fontFamilies = style.fontFamily.split(',');\n }\n\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n\n // Check if font already contains strings\n if (!/([\\\"\\'])[^\\'\\\"]+\\1/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies[i] = fontFamily;\n }\n\n return style.fontStyle + ' ' + style.fontVariant + ' ' + style.fontWeight + ' ' + fontSizeString + ' ' + fontFamilies.join(',');\n };\n\n /**\n * Calculates the ascent, descent and fontSize of a given fontStyle\n *\n * @static\n * @param {string} fontStyle - String representing the style of the font\n * @return {Object} Font properties object\n */\n\n\n Text.calculateFontProperties = function calculateFontProperties(fontStyle) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (Text.fontPropertiesCache[fontStyle]) {\n return Text.fontPropertiesCache[fontStyle];\n }\n\n var properties = {};\n\n var canvas = Text.fontPropertiesCanvas;\n var context = Text.fontPropertiesContext;\n\n context.font = fontStyle;\n\n var width = Math.ceil(context.measureText('|MÉq').width);\n var baseline = Math.ceil(context.measureText('M').width);\n var height = 2 * baseline;\n\n baseline = baseline * 1.4 | 0;\n\n canvas.width = width;\n canvas.height = height;\n\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n\n context.font = fontStyle;\n\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText('|MÉq', 0, baseline);\n\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n\n var i = 0;\n var idx = 0;\n var stop = false;\n\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n } else {\n break;\n }\n }\n\n properties.ascent = baseline - i;\n\n idx = pixels - line;\n stop = false;\n\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var _j = 0; _j < line; _j += 4) {\n if (imagedata[idx + _j] !== 255) {\n stop = true;\n break;\n }\n }\n\n if (!stop) {\n idx -= line;\n } else {\n break;\n }\n }\n\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n\n Text.fontPropertiesCache[fontStyle] = properties;\n\n return properties;\n };\n\n _createClass(Text, [{\n key: 'width',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /**\n * The height of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * Set the style of the text. Set up an event listener to listen for changes on the style\n * object and mark the text as dirty.\n *\n * @member {object|PIXI.TextStyle}\n */\n\n }, {\n key: 'style',\n get: function get() {\n return this._style;\n },\n set: function set(style) // eslint-disable-line require-jsdoc\n {\n style = style || {};\n\n if (style instanceof _TextStyle2.default) {\n this._style = style;\n } else {\n this._style = new _TextStyle2.default(style);\n }\n\n this.localStyleID = -1;\n this.dirty = true;\n }\n\n /**\n * Set the copy for the text object. To split a line you can use '\\n'.\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(text) // eslint-disable-line require-jsdoc\n {\n text = String(text || ' ');\n\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n }\n }]);\n\n return Text;\n}(_Sprite3.default);\n\nexports.default = Text;\n\n\nText.fontPropertiesCache = {};\nText.fontPropertiesCanvas = document.createElement('canvas');\nText.fontPropertiesContext = Text.fontPropertiesCanvas.getContext('2d');\n//# sourceMappingURL=Text.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/text/Text.js\n// module id = 553\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = canUploadSameBuffer;\nfunction canUploadSameBuffer() {\n\t// Uploading the same buffer multiple times in a single frame can cause perf issues.\n\t// Apparent on IOS so only check for that at the moment\n\t// this check may become more complex if this issue pops up elsewhere.\n\tvar ios = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n\n\treturn !ios;\n}\n//# sourceMappingURL=canUploadSameBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/canUploadSameBuffer.js\n// module id = 554\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = determineCrossOrigin;\n\nvar _url2 = require('url');\n\nvar _url3 = _interopRequireDefault(_url2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar tempAnchor = void 0;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n *\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nfunction determineCrossOrigin(url) {\n var loc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location;\n\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n\n // default is window.location\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n url = _url3.default.parse(tempAnchor.href);\n\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n\n // if cross origin\n if (url.hostname !== loc.hostname || !samePort || url.protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n}\n//# sourceMappingURL=determineCrossOrigin.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/determineCrossOrigin.js\n// module id = 555\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = maxRecommendedTextures;\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction maxRecommendedTextures(max) {\n if (_ismobilejs2.default.tablet || _ismobilejs2.default.phone) {\n // check if the res is iphone 6 or higher..\n return 4;\n }\n\n // desktop should be ok\n return max;\n}\n//# sourceMappingURL=maxRecommendedTextures.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/maxRecommendedTextures.js\n// module id = 556\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Mixins functionality to make an object have \"plugins\".\n *\n * @example\n * function MyObject() {}\n *\n * pluginTarget.mixin(MyObject);\n *\n * @mixin\n * @memberof PIXI.utils\n * @param {object} obj - The object to mix into.\n */\nfunction pluginTarget(obj) {\n obj.__plugins = {};\n\n /**\n * Adds a plugin to an object\n *\n * @param {string} pluginName - The events that should be listed.\n * @param {Function} ctor - The constructor function for the plugin.\n */\n obj.registerPlugin = function registerPlugin(pluginName, ctor) {\n obj.__plugins[pluginName] = ctor;\n };\n\n /**\n * Instantiates all the plugins of this object\n *\n */\n obj.prototype.initPlugins = function initPlugins() {\n this.plugins = this.plugins || {};\n\n for (var o in obj.__plugins) {\n this.plugins[o] = new obj.__plugins[o](this);\n }\n };\n\n /**\n * Removes all the plugins of this object\n *\n */\n obj.prototype.destroyPlugins = function destroyPlugins() {\n for (var o in this.plugins) {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n\n this.plugins = null;\n };\n}\n\nexports.default = {\n /**\n * Mixes in the properties of the pluginTarget into another object\n *\n * @param {object} obj - The obj to mix into\n */\n mixin: function mixin(obj) {\n pluginTarget(obj);\n }\n};\n//# sourceMappingURL=pluginTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/pluginTarget.js\n// module id = 557\n// module chunks = 0","'use strict';\n\nvar _core = require('./core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _mesh = require('./mesh');\n\nvar mesh = _interopRequireWildcard(_mesh);\n\nvar _particles = require('./particles');\n\nvar particles = _interopRequireWildcard(_particles);\n\nvar _extras = require('./extras');\n\nvar extras = _interopRequireWildcard(_extras);\n\nvar _filters = require('./filters');\n\nvar filters = _interopRequireWildcard(_filters);\n\nvar _prepare = require('./prepare');\n\nvar prepare = _interopRequireWildcard(_prepare);\n\nvar _loaders = require('./loaders');\n\nvar loaders = _interopRequireWildcard(_loaders);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// provide method to give a stack track for warnings\n// useful for tracking-down where deprecated methods/properties/classes\n// are being used within the code\nfunction warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}\n\n/**\n * @class\n * @private\n * @name SpriteBatch\n * @memberof PIXI\n * @see PIXI.ParticleContainer\n * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead.\n * @deprecated since version 3.0.0\n */\ncore.SpriteBatch = function () {\n throw new ReferenceError('SpriteBatch does not exist any more, please use the new ParticleContainer instead.');\n};\n\n/**\n * @class\n * @private\n * @name AssetLoader\n * @memberof PIXI\n * @see PIXI.loaders.Loader\n * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.\n * @deprecated since version 3.0.0\n */\ncore.AssetLoader = function () {\n throw new ReferenceError('The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.');\n};\n\nObject.defineProperties(core, {\n\n /**\n * @class\n * @private\n * @name Stage\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n Stage: {\n enumerable: true,\n get: function get() {\n warn('You do not need to use a PIXI Stage any more, you can simply render any container.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name DisplayObjectContainer\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n DisplayObjectContainer: {\n enumerable: true,\n get: function get() {\n warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name Strip\n * @memberof PIXI\n * @see PIXI.mesh.Mesh\n * @deprecated since version 3.0.0\n */\n Strip: {\n enumerable: true,\n get: function get() {\n warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.');\n\n return mesh.Mesh;\n }\n },\n\n /**\n * @class\n * @private\n * @name Rope\n * @memberof PIXI\n * @see PIXI.mesh.Rope\n * @deprecated since version 3.0.0\n */\n Rope: {\n enumerable: true,\n get: function get() {\n warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.');\n\n return mesh.Rope;\n }\n },\n\n /**\n * @class\n * @private\n * @name ParticleContainer\n * @memberof PIXI\n * @see PIXI.particles.ParticleContainer\n * @deprecated since version 4.0.0\n */\n ParticleContainer: {\n enumerable: true,\n get: function get() {\n warn('The ParticleContainer class has been moved to particles.ParticleContainer, ' + 'please use particles.ParticleContainer from now on.');\n\n return particles.ParticleContainer;\n }\n },\n\n /**\n * @class\n * @private\n * @name MovieClip\n * @memberof PIXI\n * @see PIXI.extras.MovieClip\n * @deprecated since version 3.0.0\n */\n MovieClip: {\n enumerable: true,\n get: function get() {\n warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.');\n\n return extras.AnimatedSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name TilingSprite\n * @memberof PIXI\n * @see PIXI.extras.TilingSprite\n * @deprecated since version 3.0.0\n */\n TilingSprite: {\n enumerable: true,\n get: function get() {\n warn('The TilingSprite class has been moved to extras.TilingSprite, ' + 'please use extras.TilingSprite from now on.');\n\n return extras.TilingSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name BitmapText\n * @memberof PIXI\n * @see PIXI.extras.BitmapText\n * @deprecated since version 3.0.0\n */\n BitmapText: {\n enumerable: true,\n get: function get() {\n warn('The BitmapText class has been moved to extras.BitmapText, ' + 'please use extras.BitmapText from now on.');\n\n return extras.BitmapText;\n }\n },\n\n /**\n * @class\n * @private\n * @name blendModes\n * @memberof PIXI\n * @see PIXI.BLEND_MODES\n * @deprecated since version 3.0.0\n */\n blendModes: {\n enumerable: true,\n get: function get() {\n warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.');\n\n return core.BLEND_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name scaleModes\n * @memberof PIXI\n * @see PIXI.SCALE_MODES\n * @deprecated since version 3.0.0\n */\n scaleModes: {\n enumerable: true,\n get: function get() {\n warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.');\n\n return core.SCALE_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name BaseTextureCache\n * @memberof PIXI\n * @see PIXI.utils.BaseTextureCache\n * @deprecated since version 3.0.0\n */\n BaseTextureCache: {\n enumerable: true,\n get: function get() {\n warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, ' + 'please use utils.BaseTextureCache from now on.');\n\n return core.utils.BaseTextureCache;\n }\n },\n\n /**\n * @class\n * @private\n * @name TextureCache\n * @memberof PIXI\n * @see PIXI.utils.TextureCache\n * @deprecated since version 3.0.0\n */\n TextureCache: {\n enumerable: true,\n get: function get() {\n warn('The TextureCache class has been moved to utils.TextureCache, ' + 'please use utils.TextureCache from now on.');\n\n return core.utils.TextureCache;\n }\n },\n\n /**\n * @namespace\n * @private\n * @name math\n * @memberof PIXI\n * @see PIXI\n * @deprecated since version 3.0.6\n */\n math: {\n enumerable: true,\n get: function get() {\n warn('The math namespace is deprecated, please access members already accessible on PIXI.');\n\n return core;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.AbstractFilter\n * @see PIXI.Filter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n enumerable: true,\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.Filter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.TransformManual\n * @see PIXI.TransformBase\n * @deprecated since version 4.0.0\n */\n TransformManual: {\n enumerable: true,\n get: function get() {\n warn('TransformManual has been renamed to TransformBase, please update your pixi-spine');\n\n return core.TransformBase;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.TARGET_FPMS\n * @see PIXI.settings.TARGET_FPMS\n * @deprecated since version 4.2.0\n */\n TARGET_FPMS: {\n enumerable: true,\n get: function get() {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n return core.settings.TARGET_FPMS;\n },\n set: function set(value) {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n core.settings.TARGET_FPMS = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.FILTER_RESOLUTION\n * @see PIXI.settings.FILTER_RESOLUTION\n * @deprecated since version 4.2.0\n */\n FILTER_RESOLUTION: {\n enumerable: true,\n get: function get() {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n return core.settings.FILTER_RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n core.settings.FILTER_RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RESOLUTION\n * @see PIXI.settings.RESOLUTION\n * @deprecated since version 4.2.0\n */\n RESOLUTION: {\n enumerable: true,\n get: function get() {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n return core.settings.RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n core.settings.RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.MIPMAP_TEXTURES\n * @see PIXI.settings.MIPMAP_TEXTURES\n * @deprecated since version 4.2.0\n */\n MIPMAP_TEXTURES: {\n enumerable: true,\n get: function get() {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n return core.settings.MIPMAP_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n core.settings.MIPMAP_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_BATCH_SIZE\n * @see PIXI.settings.SPRITE_BATCH_SIZE\n * @deprecated since version 4.2.0\n */\n SPRITE_BATCH_SIZE: {\n enumerable: true,\n get: function get() {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n return core.settings.SPRITE_BATCH_SIZE;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n core.settings.SPRITE_BATCH_SIZE = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_MAX_TEXTURES\n * @see PIXI.settings.SPRITE_MAX_TEXTURES\n * @deprecated since version 4.2.0\n */\n SPRITE_MAX_TEXTURES: {\n enumerable: true,\n get: function get() {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n return core.settings.SPRITE_MAX_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n core.settings.SPRITE_MAX_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RETINA_PREFIX\n * @see PIXI.settings.RETINA_PREFIX\n * @deprecated since version 4.2.0\n */\n RETINA_PREFIX: {\n enumerable: true,\n get: function get() {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n return core.settings.RETINA_PREFIX;\n },\n set: function set(value) {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n core.settings.RETINA_PREFIX = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.DEFAULT_RENDER_OPTIONS\n * @see PIXI.settings.RENDER_OPTIONS\n * @deprecated since version 4.2.0\n */\n DEFAULT_RENDER_OPTIONS: {\n enumerable: true,\n get: function get() {\n warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS');\n\n return core.settings.RENDER_OPTIONS;\n }\n }\n});\n\n// Move the default properties to settings\nvar defaults = [{ parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' }, { parent: 'GC_MODES', target: 'GC_MODE' }, { parent: 'WRAP_MODES', target: 'WRAP_MODE' }, { parent: 'SCALE_MODES', target: 'SCALE_MODE' }, { parent: 'PRECISION', target: 'PRECISION' }];\n\nvar _loop = function _loop(i) {\n var deprecation = defaults[i];\n\n Object.defineProperty(core[deprecation.parent], 'DEFAULT', {\n enumerable: true,\n get: function get() {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, please use PIXI.settings.' + deprecation.target);\n\n return core.settings[deprecation.target];\n },\n set: function set(value) {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, please use PIXI.settings.' + deprecation.target);\n\n core.settings[deprecation.target] = value;\n }\n });\n};\n\nfor (var i = 0; i < defaults.length; i++) {\n _loop(i);\n}\n\nObject.defineProperties(extras, {\n\n /**\n * @class\n * @name MovieClip\n * @memberof PIXI.extras\n * @see PIXI.extras.AnimatedSprite\n * @deprecated since version 4.2.0\n */\n MovieClip: {\n enumerable: true,\n get: function get() {\n warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');\n\n return extras.AnimatedSprite;\n }\n }\n});\n\ncore.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) {\n warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)');\n\n return renderer.generateTexture(this, scaleMode, resolution);\n};\n\ncore.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution) {\n warn('graphics generate texture has moved to the renderer. ' + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture');\n\n return this.generateCanvasTexture(scaleMode, resolution);\n};\n\ncore.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform) {\n this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform);\n warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)');\n};\n\ncore.RenderTexture.prototype.getImage = function getImage(target) {\n warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)');\n\n return this.legacyRenderer.extract.image(target);\n};\n\ncore.RenderTexture.prototype.getBase64 = function getBase64(target) {\n warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)');\n\n return this.legacyRenderer.extract.base64(target);\n};\n\ncore.RenderTexture.prototype.getCanvas = function getCanvas(target) {\n warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)');\n\n return this.legacyRenderer.extract.canvas(target);\n};\n\ncore.RenderTexture.prototype.getPixels = function getPixels(target) {\n warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)');\n\n return this.legacyRenderer.pixels(target);\n};\n\n/**\n * @method\n * @private\n * @name PIXI.Sprite#setTexture\n * @see PIXI.Sprite#texture\n * @deprecated since version 3.0.0\n * @param {PIXI.Texture} texture - The texture to set to.\n */\ncore.Sprite.prototype.setTexture = function setTexture(texture) {\n this.texture = texture;\n warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;');\n};\n\n/**\n * @method\n * @name PIXI.extras.BitmapText#setText\n * @see PIXI.extras.BitmapText#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\nextras.BitmapText.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \\'my text\\';');\n};\n\n/**\n * @method\n * @name PIXI.Text#setText\n * @see PIXI.Text#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\ncore.Text.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myText.text = \\'my text\\';');\n};\n\n/**\n * @method\n * @name PIXI.Text#setStyle\n * @see PIXI.Text#style\n * @deprecated since version 3.0.0\n * @param {*} style - The style to set to.\n */\ncore.Text.prototype.setStyle = function setStyle(style) {\n this.style = style;\n warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;');\n};\n\n/**\n * @method\n * @name PIXI.Text#determineFontProperties\n * @see PIXI.Text#calculateFontProperties\n * @deprecated since version 4.2.0\n * @private\n * @param {string} fontStyle - String representing the style of the font\n * @return {Object} Font properties object\n */\ncore.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle) {\n warn('determineFontProperties is now deprecated, please use the static calculateFontProperties method, ' + 'e.g : Text.calculateFontProperties(fontStyle);');\n\n return Text.calculateFontProperties(fontStyle);\n};\n\nObject.defineProperties(core.TextStyle.prototype, {\n /**\n * Set all properties of a font as a single string\n *\n * @name PIXI.TextStyle#font\n * @deprecated since version 4.0.0\n */\n font: {\n get: function get() {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\', \\'fontSize\\', \\'fontStyle\\', \\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n var fontSizeString = typeof this._fontSize === 'number' ? this._fontSize + 'px' : this._fontSize;\n\n return this._fontStyle + ' ' + this._fontVariant + ' ' + this._fontWeight + ' ' + fontSizeString + ' ' + this._fontFamily;\n },\n set: function set(font) {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\',\\'fontSize\\',fontStyle\\',\\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n // can work out fontStyle from search of whole string\n if (font.indexOf('italic') > 1) {\n this._fontStyle = 'italic';\n } else if (font.indexOf('oblique') > -1) {\n this._fontStyle = 'oblique';\n } else {\n this._fontStyle = 'normal';\n }\n\n // can work out fontVariant from search of whole string\n if (font.indexOf('small-caps') > -1) {\n this._fontVariant = 'small-caps';\n } else {\n this._fontVariant = 'normal';\n }\n\n // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units\n var splits = font.split(' ');\n var fontSizeIndex = -1;\n\n this._fontSize = 26;\n for (var i = 0; i < splits.length; ++i) {\n if (splits[i].match(/(px|pt|em|%)/)) {\n fontSizeIndex = i;\n this._fontSize = splits[i];\n break;\n }\n }\n\n // we can now search for fontWeight as we know it must occur before the fontSize\n this._fontWeight = 'normal';\n for (var _i = 0; _i < fontSizeIndex; ++_i) {\n if (splits[_i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) {\n this._fontWeight = splits[_i];\n break;\n }\n }\n\n // and finally join everything together after the fontSize in case the font family has multiple words\n if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1) {\n this._fontFamily = '';\n for (var _i2 = fontSizeIndex + 1; _i2 < splits.length; ++_i2) {\n this._fontFamily += splits[_i2] + ' ';\n }\n\n this._fontFamily = this._fontFamily.slice(0, -1);\n } else {\n this._fontFamily = 'Arial';\n }\n\n this.styleID++;\n }\n }\n});\n\n/**\n * @method\n * @name PIXI.Texture#setFrame\n * @see PIXI.Texture#setFrame\n * @deprecated since version 3.0.0\n * @param {PIXI.Rectangle} frame - The frame to set.\n */\ncore.Texture.prototype.setFrame = function setFrame(frame) {\n this.frame = frame;\n warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;');\n};\n\nObject.defineProperties(filters, {\n\n /**\n * @class\n * @private\n * @name PIXI.filters.AbstractFilter\n * @see PIXI.AbstractFilter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.AbstractFilter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.filters.SpriteMaskFilter\n * @see PIXI.SpriteMaskFilter\n * @deprecated since version 3.0.6\n */\n SpriteMaskFilter: {\n get: function get() {\n warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.');\n\n return core.SpriteMaskFilter;\n }\n }\n});\n\n/**\n * @method\n * @name PIXI.utils.uuid\n * @see PIXI.utils.uid\n * @deprecated since version 3.0.6\n * @return {number} The uid\n */\ncore.utils.uuid = function () {\n warn('utils.uuid() is deprecated, please use utils.uid() from now on.');\n\n return core.utils.uid();\n};\n\n/**\n * @method\n * @name PIXI.utils.canUseNewCanvasBlendModes\n * @see PIXI.CanvasTinter\n * @deprecated\n * @return {boolean} Can use blend modes.\n */\ncore.utils.canUseNewCanvasBlendModes = function () {\n warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on');\n\n return core.CanvasTinter.canUseMultiply;\n};\n\nvar saidHello = true;\n\n/**\n * @name PIXI.utils._saidHello\n * @type {boolean}\n * @see PIXI.utils.skipHello\n * @deprecated since 4.1.0\n */\nObject.defineProperty(core.utils, '_saidHello', {\n set: function set(bool) {\n if (bool) {\n warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()');\n this.skipHello();\n }\n saidHello = bool;\n },\n get: function get() {\n return saidHello;\n }\n});\n\n/**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\nObject.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n});\n\n/**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\nObject.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n});\n\nObject.defineProperties(loaders.Resource.prototype, {\n isJson: {\n get: function get() {\n warn('The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`.');\n\n return this.type === loaders.Loader.Resource.TYPE.JSON;\n }\n },\n isXml: {\n get: function get() {\n warn('The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`.');\n\n return this.type === loaders.Loader.Resource.TYPE.XML;\n }\n },\n isImage: {\n get: function get() {\n warn('The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`.');\n\n return this.type === loaders.Loader.Resource.TYPE.IMAGE;\n }\n },\n isAudio: {\n get: function get() {\n warn('The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`.');\n\n return this.type === loaders.Loader.Resource.TYPE.AUDIO;\n }\n },\n isVideo: {\n get: function get() {\n warn('The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`.');\n\n return this.type === loaders.Loader.Resource.TYPE.VIDEO;\n }\n }\n});\n\nObject.defineProperties(loaders.Loader.prototype, {\n before: {\n get: function get() {\n warn('The before() method is deprecated, please use pre().');\n\n return this.pre;\n }\n },\n after: {\n get: function get() {\n warn('The after() method is deprecated, please use use().');\n\n return this.use;\n }\n }\n});\n//# sourceMappingURL=deprecation.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/deprecation.js\n// module id = 558\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI\n */\n\nvar CanvasExtract = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasExtract(renderer) {\n _classCallCheck(this, CanvasExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.CanvasExtract} extract\n * @memberof PIXI.CanvasRenderer#\n * @see PIXI.CanvasExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n CanvasExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `CanvasExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n CanvasExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n CanvasExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = this.renderer.width;\n frame.height = this.renderer.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n CanvasExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n }\n\n return context.getImageData(0, 0, frame.width * resolution, frame.height * resolution).data;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n CanvasExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return CanvasExtract;\n}();\n\nexports.default = CanvasExtract;\n\n\ncore.CanvasRenderer.registerPlugin('extract', CanvasExtract);\n//# sourceMappingURL=CanvasExtract.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/canvas/CanvasExtract.js\n// module id = 559\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLExtract = require('./webgl/WebGLExtract');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLExtract).default;\n }\n});\n\nvar _CanvasExtract = require('./canvas/CanvasExtract');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasExtract).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/index.js\n// module id = 560\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\nvar BYTES_PER_PIXEL = 4;\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI\n */\n\nvar WebGLExtract = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLExtract(renderer) {\n _classCallCheck(this, WebGLExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.WebGLExtract} extract\n * @memberof PIXI.WebGLRenderer#\n * @see PIXI.WebGLExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n WebGLExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `WebGLExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n WebGLExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n WebGLExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var flipY = false;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n flipY = false;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n flipY = true;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n\n // set up an array of pixels\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n\n // add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n\n canvasData.data.set(webglPixels);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // pulling pixels\n if (flipY) {\n canvasBuffer.context.scale(1, -1);\n canvasBuffer.context.drawImage(canvasBuffer.canvas, 0, -height);\n }\n }\n\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n WebGLExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n }\n\n return webglPixels;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n WebGLExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return WebGLExtract;\n}();\n\nexports.default = WebGLExtract;\n\n\ncore.WebGLRenderer.registerPlugin('extract', WebGLExtract);\n//# sourceMappingURL=WebGLExtract.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/webgl/WebGLExtract.js\n// module id = 561\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @typedef FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.fromImage(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let mc = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\nvar AnimatedSprite = function (_core$Sprite) {\n _inherits(AnimatedSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture[]|FrameObject[]} textures - an array of {@link PIXI.Texture} or frame\n * objects that make up the animation\n * @param {boolean} [autoUpdate=true] - Whether use PIXI.ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n _classCallCheck(this, AnimatedSprite);\n\n /**\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, textures[0] instanceof core.Texture ? textures[0] : textures[0].texture));\n\n _this._textures = null;\n\n /**\n * @private\n */\n _this._durations = null;\n\n _this.textures = textures;\n\n /**\n * `true` uses PIXI.ticker.shared to auto update animation time.\n * @type {boolean}\n * @default true\n * @private\n */\n _this._autoUpdate = autoUpdate !== false;\n\n /**\n * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower\n *\n * @member {number}\n * @default 1\n */\n _this.animationSpeed = 1;\n\n /**\n * Whether or not the animate sprite repeats after playing.\n *\n * @member {boolean}\n * @default true\n */\n _this.loop = true;\n\n /**\n * Function to call when a AnimatedSprite finishes playing\n *\n * @member {Function}\n */\n _this.onComplete = null;\n\n /**\n * Function to call when a AnimatedSprite changes which texture is being rendered\n *\n * @member {Function}\n */\n _this.onFrameChange = null;\n\n /**\n * Elapsed time since animation has been started, used internally to display current texture\n *\n * @member {number}\n * @private\n */\n _this._currentTime = 0;\n\n /**\n * Indicates if the AnimatedSprite is currently playing\n *\n * @member {boolean}\n * @readonly\n */\n _this.playing = false;\n return _this;\n }\n\n /**\n * Stops the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.stop = function stop() {\n if (!this.playing) {\n return;\n }\n\n this.playing = false;\n if (this._autoUpdate) {\n core.ticker.shared.remove(this.update, this);\n }\n };\n\n /**\n * Plays the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.play = function play() {\n if (this.playing) {\n return;\n }\n\n this.playing = true;\n if (this._autoUpdate) {\n core.ticker.shared.add(this.update, this);\n }\n };\n\n /**\n * Stops the AnimatedSprite and goes to a specific frame\n *\n * @param {number} frameNumber - frame index to stop at\n */\n\n\n AnimatedSprite.prototype.gotoAndStop = function gotoAndStop(frameNumber) {\n this.stop();\n\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite\n *\n * @param {number} frameNumber - frame index to start at\n */\n\n\n AnimatedSprite.prototype.gotoAndPlay = function gotoAndPlay(frameNumber) {\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n\n this.play();\n };\n\n /**\n * Updates the object transform for rendering.\n *\n * @private\n * @param {number} deltaTime - Time since last tick.\n */\n\n\n AnimatedSprite.prototype.update = function update(deltaTime) {\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n\n lag += elapsed / 60 * 1000;\n\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n\n var sign = Math.sign(this.animationSpeed * deltaTime);\n\n this._currentTime = Math.floor(this._currentTime);\n\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n\n this._currentTime += lag / this._durations[this.currentFrame];\n } else {\n this._currentTime += elapsed;\n }\n\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n\n /**\n * Updates the displayed texture to match the current frame index\n *\n * @private\n */\n\n\n AnimatedSprite.prototype.updateTexture = function updateTexture() {\n this._texture = this._textures[this.currentFrame];\n this._textureID = -1;\n\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n\n /**\n * Stops the AnimatedSprite and destroys it\n *\n */\n\n\n AnimatedSprite.prototype.destroy = function destroy() {\n this.stop();\n _core$Sprite.prototype.destroy.call(this);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of frame ids\n *\n * @static\n * @param {string[]} frames - The array of frames ids the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animated sprite with the specified frames.\n */\n\n\n AnimatedSprite.fromFrames = function fromFrames(frames) {\n var textures = [];\n\n for (var i = 0; i < frames.length; ++i) {\n textures.push(core.Texture.fromFrame(frames[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of image ids\n *\n * @static\n * @param {string[]} images - the array of image urls the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animate sprite with the specified images as frames.\n */\n\n\n AnimatedSprite.fromImages = function fromImages(images) {\n var textures = [];\n\n for (var i = 0; i < images.length; ++i) {\n textures.push(core.Texture.fromImage(images[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * totalFrames is the total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n *\n * @readonly\n * @member {number}\n * @default 0\n */\n\n\n _createClass(AnimatedSprite, [{\n key: 'totalFrames',\n get: function get() {\n return this._textures.length;\n }\n\n /**\n * The array of textures used for this AnimatedSprite\n *\n * @member {PIXI.Texture[]}\n */\n\n }, {\n key: 'textures',\n get: function get() {\n return this._textures;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value[0] instanceof core.Texture) {\n this._textures = value;\n this._durations = null;\n } else {\n this._textures = [];\n this._durations = [];\n\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n }\n\n /**\n * The AnimatedSprites current frame index\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'currentFrame',\n get: function get() {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n\n return currentFrame;\n }\n }]);\n\n return AnimatedSprite;\n}(core.Sprite);\n\nexports.default = AnimatedSprite;\n//# sourceMappingURL=AnimatedSprite.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/AnimatedSprite.js\n// module id = 562\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ObservablePoint = require('../core/math/ObservablePoint');\n\nvar _ObservablePoint2 = _interopRequireDefault(_ObservablePoint);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font. To\n * split a line you can use '\\n', '\\r' or '\\r\\n' in your string. You can generate the fnt files using:\n *\n * A BitmapText can only be created when the font is loaded\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.extras.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * http://www.angelcode.com/products/bmfont/ for windows or\n * http://www.bmglyph.com/ for mac.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.extras\n */\nvar BitmapText = function (_core$Container) {\n _inherits(BitmapText, _core$Container);\n\n /**\n * @param {string} text - The copy that you would like the text to display\n * @param {object} style - The style parameters\n * @param {string|object} style.font - The font descriptor for the object, can be passed as a string of form\n * \"24px FontName\" or \"FontName\" or as an object with explicit name/size properties.\n * @param {string} [style.font.name] - The bitmap font id\n * @param {number} [style.font.size] - The size of the font in pixels, e.g. 24\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'), does not affect\n * single line text\n * @param {number} [style.tint=0xFFFFFF] - The tint color\n */\n function BitmapText(text) {\n var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, BitmapText);\n\n /**\n * Private tracker for the width of the overall text\n *\n * @member {number}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n _this._textWidth = 0;\n\n /**\n * Private tracker for the height of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textHeight = 0;\n\n /**\n * Private tracker for the letter sprite pool.\n *\n * @member {PIXI.Sprite[]}\n * @private\n */\n _this._glyphs = [];\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._font = {\n tint: style.tint !== undefined ? style.tint : 0xFFFFFF,\n align: style.align || 'left',\n name: null,\n size: 0\n };\n\n /**\n * Private tracker for the current font.\n *\n * @member {object}\n * @private\n */\n _this.font = style.font; // run font setter\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = text;\n\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n */\n _this.maxWidth = 0;\n\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align.\n *\n * @member {number}\n */\n _this.maxLineHeight = 0;\n\n /**\n * Text anchor. read-only\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new _ObservablePoint2.default(function () {\n _this.dirty = true;\n }, _this, 0, 0);\n\n /**\n * The dirty state of this object.\n *\n * @member {boolean}\n */\n _this.dirty = false;\n\n _this.updateText();\n return _this;\n }\n\n /**\n * Renders text and updates it when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.updateText = function updateText() {\n var data = BitmapText.fonts[this._font.name];\n var scale = this._font.size / data.size;\n var pos = new core.Point();\n var chars = [];\n var lineWidths = [];\n\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastSpace = -1;\n var lastSpaceWidth = 0;\n var maxLineHeight = 0;\n\n for (var i = 0; i < this.text.length; i++) {\n var charCode = this.text.charCodeAt(i);\n\n if (/(\\s)/.test(this.text.charAt(i))) {\n lastSpace = i;\n lastSpaceWidth = lastLineWidth;\n }\n\n if (/(?:\\r\\n|\\r|\\n)/.test(this.text.charAt(i))) {\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n if (lastSpace !== -1 && this.maxWidth > 0 && pos.x * scale > this.maxWidth) {\n core.utils.removeItems(chars, lastSpace, i - lastSpace);\n i = lastSpace;\n lastSpace = -1;\n\n lineWidths.push(lastSpaceWidth);\n maxLineWidth = Math.max(maxLineWidth, lastSpaceWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n var charData = data.chars[charCode];\n\n if (!charData) {\n continue;\n }\n\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n\n chars.push({\n texture: charData.texture,\n line: line,\n charCode: charCode,\n position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)\n });\n lastLineWidth = pos.x + (charData.texture.width + charData.xOffset);\n pos.x += charData.xAdvance;\n maxLineHeight = Math.max(maxLineHeight, charData.yOffset + charData.texture.height);\n prevCharCode = charCode;\n }\n\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n\n var lineAlignOffsets = [];\n\n for (var _i = 0; _i <= line; _i++) {\n var alignOffset = 0;\n\n if (this._font.align === 'right') {\n alignOffset = maxLineWidth - lineWidths[_i];\n } else if (this._font.align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n lineAlignOffsets.push(alignOffset);\n }\n\n var lenChars = chars.length;\n var tint = this.tint;\n\n for (var _i2 = 0; _i2 < lenChars; _i2++) {\n var c = this._glyphs[_i2]; // get the next glyph sprite\n\n if (c) {\n c.texture = chars[_i2].texture;\n } else {\n c = new core.Sprite(chars[_i2].texture);\n this._glyphs.push(c);\n }\n\n c.position.x = (chars[_i2].position.x + lineAlignOffsets[chars[_i2].line]) * scale;\n c.position.y = chars[_i2].position.y * scale;\n c.scale.x = c.scale.y = scale;\n c.tint = tint;\n\n if (!c.parent) {\n this.addChild(c);\n }\n }\n\n // remove unnecessary children.\n for (var _i3 = lenChars; _i3 < this._glyphs.length; ++_i3) {\n this.removeChild(this._glyphs[_i3]);\n }\n\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n for (var _i4 = 0; _i4 < lenChars; _i4++) {\n this._glyphs[_i4].x -= this._textWidth * this.anchor.x;\n this._glyphs[_i4].y -= this._textHeight * this.anchor.y;\n }\n }\n this.maxLineHeight = maxLineHeight * scale;\n };\n\n /**\n * Updates the transform of this object\n *\n * @private\n */\n\n\n BitmapText.prototype.updateTransform = function updateTransform() {\n this.validate();\n this.containerUpdateTransform();\n };\n\n /**\n * Validates text before calling parent's getLocalBounds\n *\n * @return {PIXI.Rectangle} The rectangular bounding area\n */\n\n\n BitmapText.prototype.getLocalBounds = function getLocalBounds() {\n this.validate();\n\n return _core$Container.prototype.getLocalBounds.call(this);\n };\n\n /**\n * Updates text when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.validate = function validate() {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n };\n\n /**\n * The tint of the BitmapText object\n *\n * @member {number}\n */\n\n\n _createClass(BitmapText, [{\n key: 'tint',\n get: function get() {\n return this._font.tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.tint = typeof value === 'number' && value >= 0 ? value : 0xFFFFFF;\n\n this.dirty = true;\n }\n\n /**\n * The alignment of the BitmapText object\n *\n * @member {string}\n * @default 'left'\n */\n\n }, {\n key: 'align',\n get: function get() {\n return this._font.align;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.align = value || 'left';\n\n this.dirty = true;\n }\n\n /**\n * The anchor sets the origin point of the text.\n * The default is 0,0 this means the text's origin is the top left\n * Setting the anchor to 0.5,0.5 means the text's origin is centered\n * Setting the anchor to 1,1 would mean the text's origin point will be the bottom right corner\n *\n * @member {PIXI.Point | number}\n */\n\n }, {\n key: 'anchor',\n get: function get() {\n return this._anchor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (typeof value === 'number') {\n this._anchor.set(value);\n } else {\n this._anchor.copy(value);\n }\n }\n\n /**\n * The font descriptor of the BitmapText object\n *\n * @member {string|object}\n */\n\n }, {\n key: 'font',\n get: function get() {\n return this._font;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (!value) {\n return;\n }\n\n if (typeof value === 'string') {\n value = value.split(' ');\n\n this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' ');\n this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size;\n } else {\n this._font.name = value.name;\n this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10);\n }\n\n this.dirty = true;\n }\n\n /**\n * The text of the BitmapText object\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n value = value.toString() || ' ';\n if (this._text === value) {\n return;\n }\n this._text = value;\n this.dirty = true;\n }\n\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textWidth',\n get: function get() {\n this.validate();\n\n return this._textWidth;\n }\n\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textHeight',\n get: function get() {\n this.validate();\n\n return this._textHeight;\n }\n }]);\n\n return BitmapText;\n}(core.Container);\n\nexports.default = BitmapText;\n\n\nBitmapText.fonts = {};\n//# sourceMappingURL=BitmapText.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/BitmapText.js\n// module id = 563\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _CanvasTinter = require('../core/sprites/canvas/CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nvar _TextureTransform = require('./TextureTransform');\n\nvar _TextureTransform2 = _interopRequireDefault(_TextureTransform);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempPoint = new core.Point();\n\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\n\nvar TilingSprite = function (_core$Sprite) {\n _inherits(TilingSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture} texture - the texture of the tiling sprite\n * @param {number} [width=100] - the width of the tiling sprite\n * @param {number} [height=100] - the height of the tiling sprite\n */\n function TilingSprite(texture) {\n var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n\n _classCallCheck(this, TilingSprite);\n\n /**\n * Tile transform\n *\n * @member {PIXI.TransformStatic}\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, texture));\n\n _this.tileTransform = new core.TransformStatic();\n\n // /// private\n\n /**\n * The with of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._width = width;\n\n /**\n * The height of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._height = height;\n\n /**\n * Canvas pattern\n *\n * @type {CanvasPattern}\n * @private\n */\n _this._canvasPattern = null;\n\n /**\n * transform that is applied to UV to get the texture coords\n *\n * @member {PIXI.extras.TextureTransform}\n */\n _this.uvTransform = texture.transform || new _TextureTransform2.default(texture);\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_renderWebGL' method.\n *\n * @member {string}\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n\n /**\n * Whether or not anchor affects uvs\n *\n * @member {boolean}\n * @default false\n */\n _this.uvRespectAnchor = false;\n return _this;\n }\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n\n\n /**\n * @private\n */\n TilingSprite.prototype._onTextureUpdate = function _onTextureUpdate() {\n if (this.uvTransform) {\n this.uvTransform.texture = this._texture;\n }\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n TilingSprite.prototype._renderWebGL = function _renderWebGL(renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n\n if (!texture || !texture.valid) {\n return;\n }\n\n this.tileTransform.updateLocalTransform();\n this.uvTransform.update();\n\n renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer\n */\n\n\n TilingSprite.prototype._renderCanvas = function _renderCanvas(renderer) {\n var texture = this._texture;\n\n if (!texture.baseTexture.hasLoaded) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var resolution = renderer.resolution;\n var baseTexture = texture.baseTexture;\n var baseTextureResolution = texture.baseTexture.resolution;\n var modX = this.tilePosition.x / this.tileScale.x % texture._frame.width;\n var modY = this.tilePosition.y / this.tileScale.y % texture._frame.height;\n\n // create a nice shiny pattern!\n // TODO this needs to be refreshed if texture changes..\n if (!this._canvasPattern) {\n // cut an object from a spritesheet..\n var tempCanvas = new core.CanvasRenderTarget(texture._frame.width, texture._frame.height, baseTextureResolution);\n\n // Tint the tiling sprite\n if (this.tint !== 0xFFFFFF) {\n if (this.cachedTint !== this.tint) {\n this.cachedTint = this.tint;\n\n this.tintedTexture = _CanvasTinter2.default.getTintedTexture(this, this.tint);\n }\n tempCanvas.context.drawImage(this.tintedTexture, 0, 0);\n } else {\n tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x, -texture._frame.y);\n }\n this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat');\n }\n\n // set context state..\n context.globalAlpha = this.worldAlpha;\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n // TODO - this should be rolled into the setTransform above..\n context.scale(this.tileScale.x / baseTextureResolution, this.tileScale.y / baseTextureResolution);\n\n context.translate(modX + this.anchor.x * -this._width, modY + this.anchor.y * -this._height);\n\n renderer.setBlendMode(this.blendMode);\n\n // fill the pattern!\n context.fillStyle = this._canvasPattern;\n context.fillRect(-modX, -modY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution);\n };\n\n /**\n * Updates the bounds of the tiling sprite.\n *\n * @private\n */\n\n\n TilingSprite.prototype._calculateBounds = function _calculateBounds() {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n\n\n TilingSprite.prototype.getLocalBounds = function getLocalBounds(rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._x);\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new core.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n return _core$Sprite.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * Checks if a point is inside this tiling sprite.\n *\n * @param {PIXI.Point} point - the point to check\n * @return {boolean} Whether or not the sprite contains the point.\n */\n\n\n TilingSprite.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n\n if (tempPoint.x > x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n\n if (tempPoint.y > y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Destroys this tiling sprite\n *\n */\n\n\n TilingSprite.prototype.destroy = function destroy() {\n _core$Sprite.prototype.destroy.call(this);\n\n this.tileTransform = null;\n this.uvTransform = null;\n };\n\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n TilingSprite.from = function from(source, width, height) {\n return new TilingSprite(core.Texture.from(source), width, height);\n };\n\n /**\n * Helper function that creates a tiling sprite that will use a texture from the TextureCache based on the frameId\n * The frame ids are created when a Texture packer file has been loaded\n *\n * @static\n * @param {string} frameId - The frame Id of the texture in the cache\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId\n */\n\n\n TilingSprite.fromFrame = function fromFrame(frameId, width, height) {\n var texture = core.utils.TextureCache[frameId];\n\n if (!texture) {\n throw new Error('The frameId \"' + frameId + '\" does not exist in the texture cache ' + this);\n }\n\n return new TilingSprite(texture, width, height);\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture based on an image url\n * If the image is not in the texture cache it will be loaded\n *\n * @static\n * @param {string} imageId - The image url of the texture\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @param {boolean} [crossorigin] - if you want to specify the cross-origin parameter\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n * see {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id\n */\n\n\n TilingSprite.fromImage = function fromImage(imageId, width, height, crossorigin, scaleMode) {\n return new TilingSprite(core.Texture.fromImage(imageId, crossorigin, scaleMode), width, height);\n };\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(TilingSprite, [{\n key: 'clampMargin',\n get: function get() {\n return this.uvTransform.clampMargin;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uvTransform.clampMargin = value;\n this.uvTransform.update(true);\n }\n\n /**\n * The scaling of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tileScale',\n get: function get() {\n return this.tileTransform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.scale.copy(value);\n }\n\n /**\n * The offset of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tilePosition',\n get: function get() {\n return this.tileTransform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.position.copy(value);\n }\n }, {\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n }\n\n /**\n * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n }\n }]);\n\n return TilingSprite;\n}(core.Sprite);\n\nexports.default = TilingSprite;\n//# sourceMappingURL=TilingSprite.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/TilingSprite.js\n// module id = 564\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DisplayObject = core.DisplayObject;\nvar _tempMatrix = new core.Matrix();\n\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = false;\n\n// figured theres no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\n\nvar CacheData =\n/**\n *\n */\nfunction CacheData() {\n _classCallCheck(this, CacheData);\n\n this.originalRenderWebGL = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n\n this.originalUpdateTransform = null;\n this.originalHitTest = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.sprite = null;\n};\n\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to 'false'\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function get() {\n return this._cacheAsBitmap;\n },\n set: function set(value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n\n this._cacheAsBitmap = value;\n\n var data = void 0;\n\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n\n data = this._cacheData;\n\n data.originalRenderWebGL = this.renderWebGL;\n data.originalRenderCanvas = this.renderCanvas;\n\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this._calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n\n data.originalDestroy = this.destroy;\n\n data.originalContainsPoint = this.containsPoint;\n\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.renderCanvas = this._renderCachedCanvas;\n\n this.destroy = this._cacheAsBitmapDestroy;\n } else {\n data = this._cacheData;\n\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n\n this.renderWebGL = data.originalRenderWebGL;\n this.renderCanvas = data.originalRenderCanvas;\n this._calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n\n this.destroy = data.originalDestroy;\n\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n }\n }\n});\n\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedWebGL = function _renderCachedWebGL(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObject(renderer);\n\n this._cacheData.sprite._transformID = -1;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderWebGL(renderer);\n};\n\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.currentRenderer.flush();\n // this.filters= [];\n\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds().clone();\n\n // add some padding!\n if (this._filters) {\n var padding = this._filters[0].padding;\n\n bounds.pad(padding);\n }\n\n // for now we cache the current renderTarget that the webGL renderer is currently using.\n // this could be more elegent..\n var cachedRenderTarget = renderer._activeRenderTarget;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n var stack = renderer.filterManager.filterStack;\n\n // this renderTexture will be used to store the cached DisplayObject\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n // need to set //\n var m = _tempMatrix;\n\n m.tx = -bounds.x;\n m.ty = -bounds.y;\n\n // reset\n this.transform.worldTransform.identity();\n\n // set all properties to there original so we can render to a texture\n this.renderWebGL = this._cacheData.originalRenderWebGL;\n\n renderer.render(this, renderTexture, true, m, true);\n // now restore the state be setting the new properties\n\n renderer.bindRenderTarget(cachedRenderTarget);\n\n renderer.filterManager.filterStack = stack;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n\n // easy bounds..\n this._calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n\n this._cacheData.sprite = cachedSprite;\n\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n this.updateTransform();\n\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObjectCanvas(renderer);\n\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n\n this._cacheData.sprite.renderCanvas(renderer);\n};\n\n// TODO this can be the same as the webGL verison.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds();\n\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n var cachedRenderTarget = renderer.context;\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n // need to set //\n var m = _tempMatrix;\n\n this.transform.localTransform.copy(m);\n m.invert();\n\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n\n // renderTexture.render(this, m, true);\n renderer.render(this, renderTexture, true, m, false);\n\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n\n this.renderCanvas = this._renderCachedCanvas;\n this._calculateBounds = this._calculateCachedBounds;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite._bounds = this._bounds;\n cachedSprite.alpha = cacheAlpha;\n\n this.updateTransform();\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._cacheData.sprite = cachedSprite;\n\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._cacheData.sprite._calculateBounds();\n};\n\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds();\n};\n\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n};\n\n/**\n * Destroys the cached object.\n *\n * @private\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy() {\n this.cacheAsBitmap = false;\n this.destroy();\n};\n//# sourceMappingURL=cacheAsBitmap.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/cacheAsBitmap.js\n// module id = 565\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string}\n */\ncore.DisplayObject.prototype.name = null;\n\n/**\n * Returns the display object in the container\n *\n * @memberof PIXI.Container#\n * @param {string} name - instance name\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\ncore.Container.prototype.getChildByName = function getChildByName(name) {\n for (var i = 0; i < this.children.length; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n\n return null;\n};\n//# sourceMappingURL=getChildByName.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/getChildByName.js\n// module id = 566\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @memberof PIXI.DisplayObject#\n * @param {Point} point - the point to write the global value to. If null a new point will be returned\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @return {Point} The updated point\n */\ncore.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition() {\n var point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new core.Point();\n var skipUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n } else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n\n return point;\n};\n//# sourceMappingURL=getGlobalPosition.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/getGlobalPosition.js\n// module id = 567\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _const = require('../../core/const');\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMat = new core.Matrix();\nvar tempArray = new Float32Array(4);\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar TilingSpriteRenderer = function (_core$ObjectRenderer) {\n _inherits(TilingSpriteRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n _classCallCheck(this, TilingSpriteRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n _this.simpleShader = null;\n _this.quad = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n TilingSpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 sample = texture2D(uSampler, coord);\\n vec4 color = vec4(uColor.rgb * uColor.a, uColor.a);\\n\\n gl_FragColor = sample * color ;\\n}\\n');\n this.simpleShader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\n\\nvoid main(void)\\n{\\n vec4 sample = texture2D(uSampler, vTextureCoord);\\n vec4 color = vec4(uColor.rgb * uColor.a, uColor.a);\\n gl_FragColor = sample * color;\\n}\\n');\n\n this.renderer.bindVao(null);\n this.quad = new core.Quad(gl, this.renderer.state.attribState);\n this.quad.initVao(this.shader);\n };\n\n /**\n *\n * @param {PIXI.extras.TilingSprite} ts tilingSprite to be rendered\n */\n\n\n TilingSpriteRenderer.prototype.render = function render(ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n\n renderer.bindVao(quad.vao);\n\n var vertices = quad.vertices;\n\n vertices[0] = vertices[6] = ts._width * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n\n vertices[2] = vertices[4] = ts._width * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n\n if (ts.uvRespectAnchor) {\n vertices = quad.uvs;\n\n vertices[0] = vertices[6] = -ts.anchor.x;\n vertices[1] = vertices[3] = -ts.anchor.y;\n\n vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n }\n\n quad.upload();\n\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvTransform;\n var isSimple = baseTex.isPowerOfTwo && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === _const.WRAP_MODES.CLAMP) {\n baseTex.wrapMode = _const.WRAP_MODES.REPEAT;\n }\n } else {\n isSimple = baseTex.wrapMode !== _const.WRAP_MODES.CLAMP;\n }\n }\n\n var shader = isSimple ? this.simpleShader : this.shader;\n\n renderer.bindShader(shader);\n\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n\n tempMat.invert();\n if (isSimple) {\n tempMat.append(uv.mapCoord);\n } else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n\n shader.uniforms.uTransform = tempMat.toArray(true);\n\n var color = tempArray;\n\n core.utils.hex2rgb(ts.tint, color);\n color[3] = ts.worldAlpha;\n shader.uniforms.uColor = color;\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n\n shader.uniforms.uSampler = renderer.bindTexture(tex);\n\n renderer.setBlendMode(ts.blendMode);\n\n quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n\n return TilingSpriteRenderer;\n}(core.ObjectRenderer);\n\nexports.default = TilingSpriteRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\n//# sourceMappingURL=TilingSpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/webgl/TilingSpriteRenderer.js\n// module id = 568\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BlurXFilter = require('./BlurXFilter');\n\nvar _BlurXFilter2 = _interopRequireDefault(_BlurXFilter);\n\nvar _BlurYFilter = require('./BlurYFilter');\n\nvar _BlurYFilter2 = _interopRequireDefault(_BlurYFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilter = function (_core$Filter) {\n _inherits(BlurFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this));\n\n _this.blurXFilter = new _BlurXFilter2.default(strength, quality, resolution, kernelSize);\n _this.blurYFilter = new _BlurYFilter2.default(strength, quality, resolution, kernelSize);\n _this.resolution = 1;\n\n _this.padding = 0;\n _this.resolution = resolution || 1;\n _this.quality = quality || 4;\n _this.blur = strength || 8;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n BlurFilter.prototype.apply = function apply(filterManager, input, output) {\n var renderTarget = filterManager.getRenderTarget(true);\n\n this.blurXFilter.apply(filterManager, input, renderTarget, true);\n this.blurYFilter.apply(filterManager, renderTarget, output, false);\n\n filterManager.returnRenderTarget(renderTarget);\n };\n\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurFilter, [{\n key: 'blur',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the number of passes for blur. More passes means higher quaility bluring.\n *\n * @member {number}\n * @default 1\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this.blurXFilter.quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n }\n\n /**\n * Sets the strength of the blurX property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurX',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the strength of the blurY property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurY',\n get: function get() {\n return this.blurYFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n }]);\n\n return BlurFilter;\n}(core.Filter);\n\nexports.default = BlurFilter;\n//# sourceMappingURL=BlurFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurFilter.js\n// module id = 569\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = function (_core$Filter) {\n _inherits(ColorMatrixFilter, _core$Filter);\n\n /**\n *\n */\n function ColorMatrixFilter() {\n _classCallCheck(this, ColorMatrixFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float m[20];\\n\\nvoid main(void)\\n{\\n\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n gl_FragColor.r = (m[0] * c.r);\\n gl_FragColor.r += (m[1] * c.g);\\n gl_FragColor.r += (m[2] * c.b);\\n gl_FragColor.r += (m[3] * c.a);\\n gl_FragColor.r += m[4] * c.a;\\n\\n gl_FragColor.g = (m[5] * c.r);\\n gl_FragColor.g += (m[6] * c.g);\\n gl_FragColor.g += (m[7] * c.b);\\n gl_FragColor.g += (m[8] * c.a);\\n gl_FragColor.g += m[9] * c.a;\\n\\n gl_FragColor.b = (m[10] * c.r);\\n gl_FragColor.b += (m[11] * c.g);\\n gl_FragColor.b += (m[12] * c.b);\\n gl_FragColor.b += (m[13] * c.a);\\n gl_FragColor.b += m[14] * c.a;\\n\\n gl_FragColor.a = (m[15] * c.r);\\n gl_FragColor.a += (m[16] * c.g);\\n gl_FragColor.a += (m[17] * c.b);\\n gl_FragColor.a += (m[18] * c.a);\\n gl_FragColor.a += m[19] * c.a;\\n\\n// gl_FragColor = vec4(m[0]);\\n}\\n'));\n\n _this.uniforms.m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n return _this;\n }\n\n /**\n * Transforms current matrix and set the new one\n *\n * @param {number[]} matrix - 5x4 matrix\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype._loadMatrix = function _loadMatrix(matrix) {\n var multiply = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var newMatrix = matrix;\n\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n\n /**\n * Multiplies two mat5's\n *\n * @private\n * @param {number[]} out - 5x4 matrix the receiving matrix\n * @param {number[]} a - 5x4 matrix the first operand\n * @param {number[]} b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n\n\n ColorMatrixFilter.prototype._multiply = function _multiply(out, a, b) {\n // Red Channel\n out[0] = a[0] * b[0] + a[1] * b[5] + a[2] * b[10] + a[3] * b[15];\n out[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16];\n out[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17];\n out[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18];\n out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19];\n\n // Green Channel\n out[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15];\n out[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16];\n out[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17];\n out[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18];\n out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19];\n\n // Blue Channel\n out[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15];\n out[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16];\n out[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17];\n out[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18];\n out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19];\n\n // Alpha Channel\n out[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15];\n out[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16];\n out[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17];\n out[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18];\n out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19];\n\n return out;\n };\n\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n *\n * @private\n * @param {number[]} matrix - 5x4 matrix\n * @return {number[]} 5x4 matrix with all values between 0-1\n */\n\n\n ColorMatrixFilter.prototype._colorMatrix = function _colorMatrix(matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n return m;\n };\n\n /**\n * Adjusts brightness\n *\n * @param {number} b - value of the brigthness (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.brightness = function brightness(b, multiply) {\n var matrix = [b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the matrices in grey scales\n *\n * @param {number} scale - value of the grey (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.greyscale = function greyscale(scale, multiply) {\n var matrix = [scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the black and white matrice.\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.blackAndWhite = function blackAndWhite(multiply) {\n var matrix = [0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the hue property of the color\n *\n * @param {number} rotation - in degrees\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.hue = function hue(rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n\n var a00 = cosR + (1.0 - cosR) * w;\n var a01 = w * (1.0 - cosR) - sqrW * sinR;\n var a02 = w * (1.0 - cosR) + sqrW * sinR;\n\n var a10 = w * (1.0 - cosR) + sqrW * sinR;\n var a11 = cosR + w * (1.0 - cosR);\n var a12 = w * (1.0 - cosR) - sqrW * sinR;\n\n var a20 = w * (1.0 - cosR) - sqrW * sinR;\n var a21 = w * (1.0 - cosR) + sqrW * sinR;\n var a22 = cosR + w * (1.0 - cosR);\n\n var matrix = [a00, a01, a02, 0, 0, a10, a11, a12, 0, 0, a20, a21, a22, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n *\n * @param {number} amount - value of the contrast (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.contrast = function contrast(amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -128 * (v - 1);\n\n var matrix = [v, 0, 0, 0, o, 0, v, 0, 0, o, 0, 0, v, 0, o, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n *\n * @param {number} amount - The saturation amount (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.saturate = function saturate() {\n var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var multiply = arguments[1];\n\n var x = amount * 2 / 3 + 1;\n var y = (x - 1) * -0.5;\n\n var matrix = [x, y, y, 0, 0, y, x, y, 0, 0, y, y, x, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Desaturate image (remove color)\n *\n * Call the saturate function\n *\n */\n\n\n ColorMatrixFilter.prototype.desaturate = function desaturate() // eslint-disable-line no-unused-vars\n {\n this.saturate(-1);\n };\n\n /**\n * Negative image (inverse of classic rgb matrix)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.negative = function negative(multiply) {\n var matrix = [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Sepia image\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.sepia = function sepia(multiply) {\n var matrix = [0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.technicolor = function technicolor(multiply) {\n var matrix = [1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Polaroid filter\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.polaroid = function polaroid(multiply) {\n var matrix = [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.toBGR = function toBGR(multiply) {\n var matrix = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.kodachrome = function kodachrome(multiply) {\n var matrix = [1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.browni = function browni(multiply) {\n var matrix = [0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Vintage filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.vintage = function vintage(multiply) {\n var matrix = [0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n *\n * @param {number} desaturation - Tone values.\n * @param {number} toned - Tone values.\n * @param {string} lightColor - Tone values, example: `0xFFE580`\n * @param {string} darkColor - Tone values, example: `0xFFE580`\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.colorTone = function colorTone(desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n\n var lR = (lightColor >> 16 & 0xFF) / 255;\n var lG = (lightColor >> 8 & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n\n var dR = (darkColor >> 16 & 0xFF) / 255;\n var dG = (darkColor >> 8 & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n\n var matrix = [0.3, 0.59, 0.11, 0, 0, lR, lG, lB, desaturation, 0, dR, dG, dB, toned, 0, lR - dR, lG - dG, lB - dB, 0, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Night effect\n *\n * @param {number} intensity - The intensity of the night effect.\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.night = function night(intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [intensity * -2.0, -intensity, 0, 0, 0, -intensity, 0, intensity, 0, 0, 0, intensity, intensity * 2.0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n *\n * @param {number} amount - how much the predator feels his future victim\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.predator = function predator(amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount, -4.794486999511719 * amount, -2.8746118545532227 * amount, 0 * amount, 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount, 9.193157196044922 * amount, -2.951810836791992 * amount, 0 * amount, -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount, -4.2375030517578125 * amount, 7.476448059082031 * amount, 0 * amount, 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * LSD effect\n *\n * Multiply the current matrix\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.lsd = function lsd(multiply) {\n var matrix = [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Erase the current matrix by setting the default one\n *\n */\n\n\n ColorMatrixFilter.prototype.reset = function reset() {\n var matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, false);\n };\n\n /**\n * The matrix of the color matrix filter\n *\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n\n\n _createClass(ColorMatrixFilter, [{\n key: 'matrix',\n get: function get() {\n return this.uniforms.m;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.m = value;\n }\n }]);\n\n return ColorMatrixFilter;\n}(core.Filter);\n\n// Americanized alias\n\n\nexports.default = ColorMatrixFilter;\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n//# sourceMappingURL=ColorMatrixFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/colormatrix/ColorMatrixFilter.js\n// module id = 570\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object. You can\n * use this filter to apply all manor of crazy warping effects. Currently the r\n * property of the texture is used to offset the x and the g property of the texture\n * is used to offset the y.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = function (_core$Filter) {\n _inherits(DisplacementFilter, _core$Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param {number} scale - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n _classCallCheck(this, DisplacementFilter);\n\n var maskMatrix = new core.Matrix();\n\n sprite.renderable = false;\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy *= scale;\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\\n}\\n'));\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n\n _this.uniforms.mapSampler = sprite.texture;\n _this.uniforms.filterMatrix = maskMatrix.toArray(true);\n _this.uniforms.scale = { x: 1, y: 1 };\n\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n\n _this.scale = new core.Point(scale, scale);\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n DisplacementFilter.prototype.apply = function apply(filterManager, input, output) {\n var ratio = 1 / output.destinationFrame.width * (output.size.width / input.size.width);\n\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x * ratio;\n this.uniforms.scale.y = this.scale.y * ratio;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output);\n };\n\n /**\n * The texture used for the displacement map. Must be power of 2 sized texture.\n *\n * @member {PIXI.Texture}\n */\n\n\n _createClass(DisplacementFilter, [{\n key: 'map',\n get: function get() {\n return this.uniforms.mapSampler;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.mapSampler = value;\n }\n }]);\n\n return DisplacementFilter;\n}(core.Filter);\n\nexports.default = DisplacementFilter;\n//# sourceMappingURL=DisplacementFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/displacement/DisplacementFilter.js\n// module id = 571\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * Basic FXAA implementation based on the code on geeks3d.com with the\n * modification that the texture2DLod stuff was removed since it's\n * unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nvar FXAAFilter = function (_core$Filter) {\n _inherits(FXAAFilter, _core$Filter);\n\n /**\n *\n */\n function FXAAFilter() {\n _classCallCheck(this, FXAAFilter);\n\n // TODO - needs work\n return _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n '\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nuniform vec4 filterArea;\\n\\nvarying vec2 vTextureCoord;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\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\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}',\n // fragment shader\n 'varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it\\'s\\n unsupported by WebGL.\\n \\n --\\n \\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n \\n Copyright (c) 2011 by Armin Ronacher.\\n \\n Some rights reserved.\\n \\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n \\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n \\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n \\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n \\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 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\\nvoid main() {\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n'));\n }\n\n return FXAAFilter;\n}(core.Filter);\n\nexports.default = FXAAFilter;\n//# sourceMappingURL=FXAAFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/fxaa/FXAAFilter.js\n// module id = 572\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar NoiseFilter = function (_core$Filter) {\n _inherits(NoiseFilter, _core$Filter);\n\n /**\n *\n */\n function NoiseFilter() {\n _classCallCheck(this, NoiseFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float noise;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n float diff = (rand(gl_FragCoord.xy) - 0.5) * noise;\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n gl_FragColor = color;\\n}\\n'));\n\n _this.noise = 0.5;\n return _this;\n }\n\n /**\n * The amount of noise to apply.\n *\n * @member {number}\n * @default 0.5\n */\n\n\n _createClass(NoiseFilter, [{\n key: 'noise',\n get: function get() {\n return this.uniforms.noise;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.noise = value;\n }\n }]);\n\n return NoiseFilter;\n}(core.Filter);\n\nexports.default = NoiseFilter;\n//# sourceMappingURL=NoiseFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/noise/NoiseFilter.js\n// module id = 573\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Does nothing. Very handy.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar VoidFilter = function (_core$Filter) {\n _inherits(VoidFilter, _core$Filter);\n\n /**\n *\n */\n function VoidFilter() {\n _classCallCheck(this, VoidFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n}\\n'));\n\n _this.glShaderKey = 'void';\n return _this;\n }\n\n return VoidFilter;\n}(core.Filter);\n\nexports.default = VoidFilter;\n//# sourceMappingURL=VoidFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/void/VoidFilter.js\n// module id = 574\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionEvent = function () {\n /**\n *\n */\n function InteractionEvent() {\n _classCallCheck(this, InteractionEvent);\n\n /**\n * Whether this event will continue propagating in the tree\n *\n * @member {boolean}\n */\n this.stopped = false;\n\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n\n /**\n * The object whose event listener’s callback is currently being invoked.\n *\n * @member {PIXI.DisplayObject}\n */\n this.currentTarget = null;\n\n /*\n * Type of the event\n *\n * @member {string}\n */\n this.type = null;\n\n /*\n * InteractionData related to this event\n *\n * @member {PIXI.interaction.InteractionData}\n */\n this.data = null;\n }\n\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n */\n\n\n InteractionEvent.prototype.stopPropagation = function stopPropagation() {\n this.stopped = true;\n };\n\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n * @private\n */\n\n\n InteractionEvent.prototype._reset = function _reset() {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n };\n\n return InteractionEvent;\n}();\n\nexports.default = InteractionEvent;\n//# sourceMappingURL=InteractionEvent.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionEvent.js\n// module id = 575\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _InteractionData = require('./InteractionData');\n\nvar _InteractionData2 = _interopRequireDefault(_InteractionData);\n\nvar _InteractionEvent = require('./InteractionEvent');\n\nvar _InteractionEvent2 = _interopRequireDefault(_InteractionEvent);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nvar _interactiveTarget2 = _interopRequireDefault(_interactiveTarget);\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Mix interactiveTarget into core.DisplayObject.prototype\nObject.assign(core.DisplayObject.prototype, _interactiveTarget2.default);\n\n/**\n * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive\n * if its interactive parameter is set to true\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.interaction\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI.interaction\n */\n\nvar InteractionManager = function (_EventEmitter) {\n _inherits(InteractionManager, _EventEmitter);\n\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n * @param {object} [options] - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Frequency increases the interaction events will be checked.\n */\n function InteractionManager(renderer, options) {\n _classCallCheck(this, InteractionManager);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n options = options || {};\n\n /**\n * The renderer this interaction manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n _this.renderer = renderer;\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n\n /**\n * Frequency in milliseconds that the mousemove, moveover & mouseout interaction events will be checked.\n *\n * @member {number}\n * @default 10\n */\n _this.interactionFrequency = options.interactionFrequency || 10;\n\n /**\n * The mouse data\n *\n * @member {PIXI.interaction.InteractionData}\n */\n _this.mouse = new _InteractionData2.default();\n\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n\n /**\n * The pointer data\n *\n * @member {PIXI.interaction.InteractionData}\n */\n _this.pointer = new _InteractionData2.default();\n\n // setting the pointer to start off far off screen will mean that pointer over does\n // not get called before we even move the pointer.\n _this.pointer.global.set(-999999);\n\n /**\n * An event data object to handle all the event tracking/dispatching\n *\n * @member {object}\n */\n _this.eventData = new _InteractionEvent2.default();\n\n /**\n * Tiny little interactiveData pool !\n *\n * @member {PIXI.interaction.InteractionData[]}\n */\n _this.interactiveDataPool = [];\n\n /**\n * The DOM element to bind to.\n *\n * @private\n * @member {HTMLElement}\n */\n _this.interactionDOMElement = null;\n\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM verison works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how pixi used to work. This will be set to true in\n * future versions of pixi.\n *\n * @member {boolean}\n * @default false\n */\n _this.moveWhenInside = false;\n\n /**\n * Have events been attached to the dom element?\n *\n * @private\n * @member {boolean}\n */\n _this.eventsAdded = false;\n\n /**\n * Is the mouse hovering over the renderer?\n *\n * @private\n * @member {boolean}\n */\n _this.mouseOverRenderer = false;\n\n /**\n * Does the device support touch events\n * https://www.w3.org/TR/touch-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsTouchEvents = 'ontouchstart' in window;\n\n /**\n * Does the device support pointer events\n * https://www.w3.org/Submission/pointer-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsPointerEvents = !!window.PointerEvent;\n\n /**\n * Are touch events being 'normalized' and converted into pointer events if pointer events are not supported\n * For example, on a touch screen mobile device, a touchstart would also be emitted as a pointerdown\n *\n * @private\n * @readonly\n * @member {boolean}\n */\n _this.normalizeTouchEvents = !_this.supportsPointerEvents && _this.supportsTouchEvents;\n\n /**\n * Are mouse events being 'normalized' and converted into pointer events if pointer events are not supported\n * For example, on a desktop pc, a mousedown would also be emitted as a pointerdown\n *\n * @private\n * @readonly\n * @member {boolean}\n */\n _this.normalizeMouseEvents = !_this.supportsPointerEvents && !_ismobilejs2.default.any;\n\n // this will make it so that you don't have to call bind all the time\n\n /**\n * @private\n * @member {Function}\n */\n _this.onMouseUp = _this.onMouseUp.bind(_this);\n _this.processMouseUp = _this.processMouseUp.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onMouseDown = _this.onMouseDown.bind(_this);\n _this.processMouseDown = _this.processMouseDown.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onMouseMove = _this.onMouseMove.bind(_this);\n _this.processMouseMove = _this.processMouseMove.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onMouseOut = _this.onMouseOut.bind(_this);\n _this.processMouseOverOut = _this.processMouseOverOut.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onMouseOver = _this.onMouseOver.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onTouchStart = _this.onTouchStart.bind(_this);\n _this.processTouchStart = _this.processTouchStart.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onTouchEnd = _this.onTouchEnd.bind(_this);\n _this.processTouchEnd = _this.processTouchEnd.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onTouchMove = _this.onTouchMove.bind(_this);\n _this.processTouchMove = _this.processTouchMove.bind(_this);\n\n /**\n * Every update cursor will be reset to this value, if some element wont override it in\n * its hitTest.\n *\n * @member {string}\n * @default 'inherit'\n */\n _this.defaultCursorStyle = 'inherit';\n\n /**\n * The css style of the cursor that is being used.\n *\n * @member {string}\n */\n _this.currentCursorStyle = 'inherit';\n\n /**\n * Internal cached let.\n *\n * @private\n * @member {PIXI.Point}\n */\n _this._tempPoint = new core.Point();\n\n /**\n * The current resolution / device pixel ratio.\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = 1;\n\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n\n /**\n * Fired when a pointer device button (usually a mouse button) is pressed on the display\n * object.\n *\n * @event mousedown\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n *\n * @event rightdown\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button (usually a mouse button) is released over the display\n * object.\n *\n * @event mouseup\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n *\n * @event rightup\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button (usually a mouse button) is pressed and released on\n * the display object.\n *\n * @event click\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n *\n * @event rightclick\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button (usually a mouse button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.interaction.InteractionManager#event:mousedown}.\n *\n * @event mouseupoutside\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.interaction.InteractionManager#event:rightdown}.\n *\n * @event rightupoutside\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n *\n * @event mousemove\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n *\n * @event mouseover\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n *\n * @event mouseout\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n *\n * @event pointerdown\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n *\n * @event pointerup\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n *\n * @event pointertap\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.interaction.InteractionManager#event:pointerdown}.\n *\n * @event pointerupoutside\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device is moved while over the display object\n *\n * @event pointermove\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device is moved onto the display object\n *\n * @event pointerover\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a pointer device is moved off the display object\n *\n * @event pointerout\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n *\n * @event touchstart\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n *\n * @event touchend\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n *\n * @event tap\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.interaction.InteractionManager#event:touchstart}.\n *\n * @event touchendoutside\n * @memberof PIXI.interaction.InteractionManager#\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n *\n * @event touchmove\n * @memberof PIXI.interaction.InteractionManager#\n */\n return _this;\n }\n\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate\n * another DOM element to receive those events.\n *\n * @param {HTMLCanvasElement} element - the DOM element which will receive mouse and touch events.\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n * @private\n */\n\n\n InteractionManager.prototype.setTargetElement = function setTargetElement(element) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.removeEvents();\n\n this.interactionDOMElement = element;\n\n this.resolution = resolution;\n\n this.addEvents();\n };\n\n /**\n * Registers all the DOM events\n *\n * @private\n */\n\n\n InteractionManager.prototype.addEvents = function addEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.add(this.update, this);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = 'none';\n this.interactionDOMElement.style['-ms-touch-action'] = 'none';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = 'none';\n }\n\n /**\n * These events are added first, so that if pointer events are normalised, they are fired\n * in the same order as non-normalised events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('pointerout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n } else {\n /**\n * If pointer events aren't available on a device, this will turn either the touch or\n * mouse events into pointer events. This allows a developer to just listen for emitted\n * pointer events on interactive sprites\n */\n if (this.normalizeTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n if (this.normalizeMouseEvents) {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n }\n\n window.document.addEventListener('mousemove', this.onMouseMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onMouseDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onMouseOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onMouseOver, true);\n window.addEventListener('mouseup', this.onMouseUp, true);\n\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onTouchStart, true);\n this.interactionDOMElement.addEventListener('touchend', this.onTouchEnd, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onTouchMove, true);\n }\n\n this.eventsAdded = true;\n };\n\n /**\n * Removes all the DOM events that were previously registered\n *\n * @private\n */\n\n\n InteractionManager.prototype.removeEvents = function removeEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.remove(this.update, this);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = '';\n this.interactionDOMElement.style['-ms-touch-action'] = '';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = '';\n }\n\n if (this.supportsPointerEvents) {\n window.document.removeEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('pointerout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n window.removeEventListener('pointerup', this.onPointerUp, true);\n } else {\n /**\n * If pointer events aren't available on a device, this will turn either the touch or\n * mouse events into pointer events. This allows a developer to just listen for emitted\n * pointer events on interactive sprites\n */\n if (this.normalizeTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n\n if (this.normalizeMouseEvents) {\n window.document.removeEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n window.removeEventListener('mouseup', this.onPointerUp, true);\n }\n }\n\n window.document.removeEventListener('mousemove', this.onMouseMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onMouseOver, true);\n window.removeEventListener('mouseup', this.onMouseUp, true);\n\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);\n }\n\n this.interactionDOMElement = null;\n\n this.eventsAdded = false;\n };\n\n /**\n * Updates the state of interactive objects.\n * Invoked by a throttled ticker update from {@link PIXI.ticker.shared}.\n *\n * @param {number} deltaTime - time delta since last tick\n */\n\n\n InteractionManager.prototype.update = function update(deltaTime) {\n this._deltaTime += deltaTime;\n\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n\n this._deltaTime = 0;\n\n if (!this.interactionDOMElement) {\n return;\n }\n\n // if the user move the mouse this check has already been dfone using the mouse move!\n if (this.didMove) {\n this.didMove = false;\n\n return;\n }\n\n this.cursor = this.defaultCursorStyle;\n\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n this.eventData._reset();\n\n this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, true);\n\n if (this.currentCursorStyle !== this.cursor) {\n this.currentCursorStyle = this.cursor;\n this.interactionDOMElement.style.cursor = this.cursor;\n }\n\n // TODO\n };\n\n /**\n * Dispatches an event on the display object that was interacted with\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {object} eventData - the event data object\n * @private\n */\n\n\n InteractionManager.prototype.dispatchEvent = function dispatchEvent(displayObject, eventString, eventData) {\n if (!eventData.stopped) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n\n displayObject.emit(eventString, eventData);\n\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n *\n * @param {PIXI.Point} point - the point that the result will be stored in\n * @param {number} x - the x coord of the position to map\n * @param {number} y - the y coord of the position to map\n */\n\n\n InteractionManager.prototype.mapPositionToPoint = function mapPositionToPoint(point, x, y) {\n var rect = void 0;\n\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = { x: 0, y: 0, width: 0, height: 0 };\n } else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n\n var resolutionMultiplier = navigator.isCocoonJS ? this.resolution : 1.0 / this.resolution;\n\n point.x = (x - rect.left) * (this.interactionDOMElement.width / rect.width) * resolutionMultiplier;\n point.y = (y - rect.top) * (this.interactionDOMElement.height / rect.height) * resolutionMultiplier;\n };\n\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @param {PIXI.Point} point - the point that is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @param {boolean} [interactive] - Whether the displayObject is interactive\n * @return {boolean} returns true if the displayObject hit the point\n */\n\n\n InteractionManager.prototype.processInteractive = function processInteractive(point, displayObject, func, hitTest, interactive) {\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n\n // Took a little while to rework this function correctly! But now it is done and nice and optimised. ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimisation once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimisation is that an object is not hit test directly if a child has already been hit.\n\n interactive = displayObject.interactive || interactive;\n\n var hit = false;\n var interactiveParent = interactive;\n\n // if the displayobject has a hitArea, then it does not need to hitTest children.\n if (displayObject.hitArea) {\n interactiveParent = false;\n }\n\n // it has a mask! Then lets hit test that before continuing..\n if (hitTest && displayObject._mask) {\n if (!displayObject._mask.containsPoint(point)) {\n hitTest = false;\n }\n }\n\n // it has a filterArea! Same as mask but easier, its a rectangle\n if (hitTest && displayObject.filterArea) {\n if (!displayObject.filterArea.contains(point.x, point.y)) {\n hitTest = false;\n }\n }\n\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow pixi to completely ignore and bypass checking the displayObjects children.\n if (displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n\n // time to get recursive.. if this function will return if something is hit..\n if (this.processInteractive(point, child, func, hitTest, interactiveParent)) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n\n hit = true;\n\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n\n // {\n hitTest = false;\n // }\n\n // we can break now as we have hit an object.\n }\n }\n }\n\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit!\n if (hitTest && !hit) {\n if (displayObject.hitArea) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n hit = displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y);\n } else if (displayObject.containsPoint) {\n hit = displayObject.containsPoint(point);\n }\n }\n\n if (displayObject.interactive) {\n if (hit && !this.eventData.target) {\n this.eventData.target = displayObject;\n this.mouse.target = displayObject;\n this.pointer.target = displayObject;\n }\n\n func(displayObject, hit);\n }\n }\n\n return hit;\n };\n\n /**\n * Is called when the mouse button is pressed down on the renderer element\n *\n * @private\n * @param {MouseEvent} event - The DOM event of a mouse button being pressed down\n */\n\n\n InteractionManager.prototype.onMouseDown = function onMouseDown(event) {\n this.mouse.originalEvent = event;\n this.eventData.data = this.mouse;\n this.eventData._reset();\n\n // Update internal mouse reference\n this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n if (this.autoPreventDefault) {\n this.mouse.originalEvent.preventDefault();\n }\n\n this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseDown, true);\n\n var isRightButton = event.button === 2 || event.which === 3;\n\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n };\n\n /**\n * Processes the result of the mouse down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processMouseDown = function processMouseDown(displayObject, hit) {\n var e = this.mouse.originalEvent;\n\n var isRightButton = e.button === 2 || e.which === 3;\n\n if (hit) {\n displayObject[isRightButton ? '_isRightDown' : '_isLeftDown'] = true;\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n };\n\n /**\n * Is called when the mouse button is released on the renderer element\n *\n * @private\n * @param {MouseEvent} event - The DOM event of a mouse button being released\n */\n\n\n InteractionManager.prototype.onMouseUp = function onMouseUp(event) {\n this.mouse.originalEvent = event;\n this.eventData.data = this.mouse;\n this.eventData._reset();\n\n // Update internal mouse reference\n this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseUp, true);\n\n var isRightButton = event.button === 2 || event.which === 3;\n\n this.emit(isRightButton ? 'rightup' : 'mouseup', this.eventData);\n };\n\n /**\n * Processes the result of the mouse up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processMouseUp = function processMouseUp(displayObject, hit) {\n var e = this.mouse.originalEvent;\n\n var isRightButton = e.button === 2 || e.which === 3;\n var isDown = isRightButton ? '_isRightDown' : '_isLeftDown';\n\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', this.eventData);\n\n if (displayObject[isDown]) {\n displayObject[isDown] = false;\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', this.eventData);\n }\n } else if (displayObject[isDown]) {\n displayObject[isDown] = false;\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', this.eventData);\n }\n };\n\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n * @param {MouseEvent} event - The DOM event of the mouse moving\n */\n\n\n InteractionManager.prototype.onMouseMove = function onMouseMove(event) {\n this.mouse.originalEvent = event;\n this.eventData.data = this.mouse;\n this.eventData._reset();\n\n this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n this.didMove = true;\n\n this.cursor = this.defaultCursorStyle;\n\n this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseMove, true);\n\n this.emit('mousemove', this.eventData);\n\n if (this.currentCursorStyle !== this.cursor) {\n this.currentCursorStyle = this.cursor;\n this.interactionDOMElement.style.cursor = this.cursor;\n }\n\n // TODO BUG for parents interactive object (border order issue)\n };\n\n /**\n * Processes the result of the mouse move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processMouseMove = function processMouseMove(displayObject, hit) {\n this.processMouseOverOut(displayObject, hit);\n\n // only display on mouse over\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'mousemove', this.eventData);\n }\n };\n\n /**\n * Is called when the mouse is moved out of the renderer element\n *\n * @private\n * @param {MouseEvent} event - The DOM event of the mouse being moved out\n */\n\n\n InteractionManager.prototype.onMouseOut = function onMouseOut(event) {\n this.mouseOverRenderer = false;\n\n this.mouse.originalEvent = event;\n this.eventData.data = this.mouse;\n this.eventData._reset();\n\n // Update internal mouse reference\n this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n this.interactionDOMElement.style.cursor = this.defaultCursorStyle;\n\n // TODO optimize by not check EVERY TIME! maybe half as often? //\n this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY);\n\n this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, false);\n\n this.emit('mouseout', this.eventData);\n };\n\n /**\n * Processes the result of the mouse over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processMouseOverOut = function processMouseOverOut(displayObject, hit) {\n if (hit && this.mouseOverRenderer) {\n if (!displayObject._mouseOver) {\n displayObject._mouseOver = true;\n this.dispatchEvent(displayObject, 'mouseover', this.eventData);\n }\n\n if (displayObject.buttonMode) {\n this.cursor = displayObject.defaultCursor;\n }\n } else if (displayObject._mouseOver) {\n displayObject._mouseOver = false;\n this.dispatchEvent(displayObject, 'mouseout', this.eventData);\n }\n };\n\n /**\n * Is called when the mouse enters the renderer element area\n *\n * @private\n * @param {MouseEvent} event - The DOM event of the mouse moving into the renderer view\n */\n\n\n InteractionManager.prototype.onMouseOver = function onMouseOver(event) {\n this.mouseOverRenderer = true;\n\n this.mouse.originalEvent = event;\n this.eventData.data = this.mouse;\n this.eventData._reset();\n\n this.emit('mouseover', this.eventData);\n };\n\n /**\n * Is called when the pointer button is pressed down on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being pressed down\n */\n\n\n InteractionManager.prototype.onPointerDown = function onPointerDown(event) {\n this.normalizeToPointerData(event);\n this.pointer.originalEvent = event;\n this.eventData.data = this.pointer;\n this.eventData._reset();\n\n // Update internal pointer reference\n this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n /**\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n if (this.autoPreventDefault && (this.normalizeMouseEvents || this.normalizeTouchEvents)) {\n this.pointer.originalEvent.preventDefault();\n }\n\n this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerDown, true);\n\n this.emit('pointerdown', this.eventData);\n };\n\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerDown = function processPointerDown(displayObject, hit) {\n if (hit) {\n displayObject._pointerDown = true;\n this.dispatchEvent(displayObject, 'pointerdown', this.eventData);\n }\n };\n\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n\n\n InteractionManager.prototype.onPointerUp = function onPointerUp(event) {\n this.normalizeToPointerData(event);\n this.pointer.originalEvent = event;\n this.eventData.data = this.pointer;\n this.eventData._reset();\n\n // Update internal pointer reference\n this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerUp, true);\n\n this.emit('pointerup', this.eventData);\n };\n\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerUp = function processPointerUp(displayObject, hit) {\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', this.eventData);\n\n if (displayObject._pointerDown) {\n displayObject._pointerDown = false;\n this.dispatchEvent(displayObject, 'pointertap', this.eventData);\n }\n } else if (displayObject._pointerDown) {\n displayObject._pointerDown = false;\n this.dispatchEvent(displayObject, 'pointerupoutside', this.eventData);\n }\n };\n\n /**\n * Is called when the pointer moves across the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer moving\n */\n\n\n InteractionManager.prototype.onPointerMove = function onPointerMove(event) {\n this.normalizeToPointerData(event);\n this.pointer.originalEvent = event;\n this.eventData.data = this.pointer;\n this.eventData._reset();\n\n this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerMove, true);\n\n this.emit('pointermove', this.eventData);\n };\n\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerMove = function processPointerMove(displayObject, hit) {\n if (!this.pointer.originalEvent.changedTouches) {\n this.processPointerOverOut(displayObject, hit);\n }\n\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', this.eventData);\n }\n };\n\n /**\n * Is called when the pointer is moved out of the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer being moved out\n */\n\n\n InteractionManager.prototype.onPointerOut = function onPointerOut(event) {\n this.normalizeToPointerData(event);\n this.pointer.originalEvent = event;\n this.eventData.data = this.pointer;\n this.eventData._reset();\n\n // Update internal pointer reference\n this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY);\n\n this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerOverOut, false);\n\n this.emit('pointerout', this.eventData);\n };\n\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerOverOut = function processPointerOverOut(displayObject, hit) {\n if (hit && this.mouseOverRenderer) {\n if (!displayObject._pointerOver) {\n displayObject._pointerOver = true;\n this.dispatchEvent(displayObject, 'pointerover', this.eventData);\n }\n } else if (displayObject._pointerOver) {\n displayObject._pointerOver = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n }\n };\n\n /**\n * Is called when the pointer is moved into the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being moved into the renderer view\n */\n\n\n InteractionManager.prototype.onPointerOver = function onPointerOver(event) {\n this.pointer.originalEvent = event;\n this.eventData.data = this.pointer;\n this.eventData._reset();\n\n this.emit('pointerover', this.eventData);\n };\n\n /**\n * Is called when a touch is started on the renderer element\n *\n * @private\n * @param {TouchEvent} event - The DOM event of a touch starting on the renderer view\n */\n\n\n InteractionManager.prototype.onTouchStart = function onTouchStart(event) {\n if (this.autoPreventDefault) {\n event.preventDefault();\n }\n\n var changedTouches = event.changedTouches;\n var cLength = changedTouches.length;\n\n for (var i = 0; i < cLength; i++) {\n var touch = changedTouches[i];\n var touchData = this.getTouchData(touch);\n\n touchData.originalEvent = event;\n\n this.eventData.data = touchData;\n this.eventData._reset();\n\n this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchStart, true);\n\n this.emit('touchstart', this.eventData);\n\n this.returnTouchData(touchData);\n }\n };\n\n /**\n * Processes the result of a touch check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processTouchStart = function processTouchStart(displayObject, hit) {\n if (hit) {\n displayObject._touchDown = true;\n this.dispatchEvent(displayObject, 'touchstart', this.eventData);\n }\n };\n\n /**\n * Is called when a touch ends on the renderer element\n *\n * @private\n * @param {TouchEvent} event - The DOM event of a touch ending on the renderer view\n */\n\n\n InteractionManager.prototype.onTouchEnd = function onTouchEnd(event) {\n if (this.autoPreventDefault) {\n event.preventDefault();\n }\n\n var changedTouches = event.changedTouches;\n var cLength = changedTouches.length;\n\n for (var i = 0; i < cLength; i++) {\n var touchEvent = changedTouches[i];\n\n var touchData = this.getTouchData(touchEvent);\n\n touchData.originalEvent = event;\n\n // TODO this should be passed along.. no set\n this.eventData.data = touchData;\n this.eventData._reset();\n\n this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchEnd, true);\n\n this.emit('touchend', this.eventData);\n\n this.returnTouchData(touchData);\n }\n };\n\n /**\n * Processes the result of the end of a touch and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processTouchEnd = function processTouchEnd(displayObject, hit) {\n if (hit) {\n this.dispatchEvent(displayObject, 'touchend', this.eventData);\n\n if (displayObject._touchDown) {\n displayObject._touchDown = false;\n this.dispatchEvent(displayObject, 'tap', this.eventData);\n }\n } else if (displayObject._touchDown) {\n displayObject._touchDown = false;\n this.dispatchEvent(displayObject, 'touchendoutside', this.eventData);\n }\n };\n\n /**\n * Is called when a touch is moved across the renderer element\n *\n * @private\n * @param {TouchEvent} event - The DOM event of a touch moving accross the renderer view\n */\n\n\n InteractionManager.prototype.onTouchMove = function onTouchMove(event) {\n if (this.autoPreventDefault) {\n event.preventDefault();\n }\n\n var changedTouches = event.changedTouches;\n var cLength = changedTouches.length;\n\n for (var i = 0; i < cLength; i++) {\n var touchEvent = changedTouches[i];\n\n var touchData = this.getTouchData(touchEvent);\n\n touchData.originalEvent = event;\n\n this.eventData.data = touchData;\n this.eventData._reset();\n\n this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchMove, this.moveWhenInside);\n\n this.emit('touchmove', this.eventData);\n\n this.returnTouchData(touchData);\n }\n };\n\n /**\n * Processes the result of a touch move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processTouchMove = function processTouchMove(displayObject, hit) {\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'touchmove', this.eventData);\n }\n };\n\n /**\n * Grabs an interaction data object from the internal pool\n *\n * @private\n * @param {Touch} touch - The touch data we need to pair with an interactionData object\n * @return {PIXI.interaction.InteractionData} The built data object.\n */\n\n\n InteractionManager.prototype.getTouchData = function getTouchData(touch) {\n var touchData = this.interactiveDataPool.pop() || new _InteractionData2.default();\n\n touchData.identifier = touch.identifier;\n this.mapPositionToPoint(touchData.global, touch.clientX, touch.clientY);\n\n if (navigator.isCocoonJS) {\n touchData.global.x = touchData.global.x / this.resolution;\n touchData.global.y = touchData.global.y / this.resolution;\n }\n\n touch.globalX = touchData.global.x;\n touch.globalY = touchData.global.y;\n\n return touchData;\n };\n\n /**\n * Returns an interaction data object to the internal pool\n *\n * @private\n * @param {PIXI.interaction.InteractionData} touchData - The touch data object we want to return to the pool\n */\n\n\n InteractionManager.prototype.returnTouchData = function returnTouchData(touchData) {\n this.interactiveDataPool.push(touchData);\n };\n\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n *\n * @private\n * @param {TouchEvent|MouseEvent} event - The original event data from a touch or mouse event\n */\n\n\n InteractionManager.prototype.normalizeToPointerData = function normalizeToPointerData(event) {\n if (this.normalizeTouchEvents && event.changedTouches) {\n if (typeof event.button === 'undefined') event.button = event.touches.length ? 1 : 0;\n if (typeof event.buttons === 'undefined') event.buttons = event.touches.length ? 1 : 0;\n if (typeof event.isPrimary === 'undefined') event.isPrimary = event.touches.length === 1;\n if (typeof event.width === 'undefined') event.width = event.changedTouches[0].radiusX || 1;\n if (typeof event.height === 'undefined') event.height = event.changedTouches[0].radiusY || 1;\n if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n if (typeof event.pointerType === 'undefined') event.pointerType = 'touch';\n if (typeof event.pointerId === 'undefined') event.pointerId = event.changedTouches[0].identifier || 0;\n if (typeof event.pressure === 'undefined') event.pressure = event.changedTouches[0].force || 0.5;\n if (typeof event.rotation === 'undefined') event.rotation = event.changedTouches[0].rotationAngle || 0;\n\n if (typeof event.clientX === 'undefined') event.clientX = event.changedTouches[0].clientX;\n if (typeof event.clientY === 'undefined') event.clientY = event.changedTouches[0].clientY;\n if (typeof event.pageX === 'undefined') event.pageX = event.changedTouches[0].pageX;\n if (typeof event.pageY === 'undefined') event.pageY = event.changedTouches[0].pageY;\n if (typeof event.screenX === 'undefined') event.screenX = event.changedTouches[0].screenX;\n if (typeof event.screenY === 'undefined') event.screenY = event.changedTouches[0].screenY;\n if (typeof event.layerX === 'undefined') event.layerX = event.offsetX = event.clientX;\n if (typeof event.layerY === 'undefined') event.layerY = event.offsetY = event.clientY;\n } else if (this.normalizeMouseEvents) {\n if (typeof event.isPrimary === 'undefined') event.isPrimary = true;\n if (typeof event.width === 'undefined') event.width = 1;\n if (typeof event.height === 'undefined') event.height = 1;\n if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';\n if (typeof event.pointerId === 'undefined') event.pointerId = 1;\n if (typeof event.pressure === 'undefined') event.pressure = 0.5;\n if (typeof event.rotation === 'undefined') event.rotation = 0;\n }\n };\n\n /**\n * Destroys the interaction manager\n *\n */\n\n\n InteractionManager.prototype.destroy = function destroy() {\n this.removeEvents();\n\n this.removeAllListeners();\n\n this.renderer = null;\n\n this.mouse = null;\n\n this.eventData = null;\n\n this.interactiveDataPool = null;\n\n this.interactionDOMElement = null;\n\n this.onMouseDown = null;\n this.processMouseDown = null;\n\n this.onMouseUp = null;\n this.processMouseUp = null;\n\n this.onMouseMove = null;\n this.processMouseMove = null;\n\n this.onMouseOut = null;\n this.processMouseOverOut = null;\n\n this.onMouseOver = null;\n\n this.onPointerDown = null;\n this.processPointerDown = null;\n\n this.onPointerUp = null;\n this.processPointerUp = null;\n\n this.onPointerMove = null;\n this.processPointerMove = null;\n\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n\n this.onPointerOver = null;\n\n this.onTouchStart = null;\n this.processTouchStart = null;\n\n this.onTouchEnd = null;\n this.processTouchEnd = null;\n\n this.onTouchMove = null;\n this.processTouchMove = null;\n\n this._tempPoint = null;\n };\n\n return InteractionManager;\n}(_eventemitter2.default);\n\nexports.default = InteractionManager;\n\n\ncore.WebGLRenderer.registerPlugin('interaction', InteractionManager);\ncore.CanvasRenderer.registerPlugin('interaction', InteractionManager);\n//# sourceMappingURL=InteractionManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionManager.js\n// module id = 576\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _InteractionData = require('./InteractionData');\n\nObject.defineProperty(exports, 'InteractionData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionData).default;\n }\n});\n\nvar _InteractionManager = require('./InteractionManager');\n\nObject.defineProperty(exports, 'InteractionManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionManager).default;\n }\n});\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nObject.defineProperty(exports, 'interactiveTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_interactiveTarget).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/index.js\n// module id = 577\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _resourceLoader = require('resource-loader');\n\nvar _resourceLoader2 = _interopRequireDefault(_resourceLoader);\n\nvar _blob = require('resource-loader/lib/middlewares/parsing/blob');\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _textureParser = require('./textureParser');\n\nvar _textureParser2 = _interopRequireDefault(_textureParser);\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nvar _spritesheetParser2 = _interopRequireDefault(_spritesheetParser);\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nvar _bitmapFontParser2 = _interopRequireDefault(_bitmapFontParser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader\n *\n * ```js\n * let loader = PIXI.loader; // pixi exposes a premade instance for you to use.\n * //or\n * let loader = new PIXI.loaders.Loader(); // you can also create your own if you want\n *\n * loader.add('bunny', 'data/bunny.png');\n * loader.add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * loader.once('complete',onAssetsLoaded);\n *\n * loader.load();\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class\n * @extends module:resource-loader.ResourceLoader\n * @memberof PIXI.loaders\n */\nvar Loader = function (_ResourceLoader) {\n _inherits(Loader, _ResourceLoader);\n\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n _classCallCheck(this, Loader);\n\n var _this = _possibleConstructorReturn(this, _ResourceLoader.call(this, baseUrl, concurrency));\n\n _eventemitter2.default.call(_this);\n\n for (var i = 0; i < Loader._pixiMiddleware.length; ++i) {\n _this.use(Loader._pixiMiddleware[i]());\n }\n\n // Compat layer, translate the new v2 signals into old v1 events.\n _this.onStart.add(function (l) {\n return _this.emit('start', l);\n });\n _this.onProgress.add(function (l, r) {\n return _this.emit('progress', l, r);\n });\n _this.onError.add(function (e, l, r) {\n return _this.emit('error', e, l, r);\n });\n _this.onLoad.add(function (l, r) {\n return _this.emit('load', l, r);\n });\n _this.onComplete.add(function (l, r) {\n return _this.emit('complete', l, r);\n });\n return _this;\n }\n\n /**\n * Adds a default middleware to the pixi loader.\n *\n * @static\n * @param {Function} fn - The middleware to add.\n */\n\n\n Loader.addPixiMiddleware = function addPixiMiddleware(fn) {\n Loader._pixiMiddleware.push(fn);\n };\n\n return Loader;\n}(_resourceLoader2.default);\n\n// Copy EE3 prototype (mixin)\n\n\nexports.default = Loader;\nfor (var k in _eventemitter2.default.prototype) {\n Loader.prototype[k] = _eventemitter2.default.prototype[k];\n}\n\nLoader._pixiMiddleware = [\n// parse any blob into more usable objects (e.g. Image)\n_blob.blobMiddlewareFactory,\n// parse any Image objects into textures\n_textureParser2.default,\n// parse any spritesheet data into multiple textures\n_spritesheetParser2.default,\n// parse bitmap font data into multiple textures\n_bitmapFontParser2.default];\n\n// Add custom extentions\nvar Resource = _resourceLoader2.default.Resource;\n\nResource.setExtensionXhrType('fnt', Resource.XHR_RESPONSE_TYPE.DOCUMENT);\n//# sourceMappingURL=loader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/loader.js\n// module id = 578\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Plane2 = require('./Plane');\n\nvar _Plane3 = _interopRequireDefault(_Plane2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DEFAULT_BORDER_SIZE = 10;\n\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.fromImage('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.mesh.Plane\n * @memberof PIXI.mesh\n *\n */\n\nvar NineSlicePlane = function (_Plane) {\n _inherits(NineSlicePlane, _Plane);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {int} [leftWidth=10] size of the left vertical bar (A)\n * @param {int} [topHeight=10] size of the top horizontal bar (C)\n * @param {int} [rightWidth=10] size of the right vertical bar (B)\n * @param {int} [bottomHeight=10] size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n _classCallCheck(this, NineSlicePlane);\n\n var _this = _possibleConstructorReturn(this, _Plane.call(this, texture, 4, 4));\n\n var uvs = _this.uvs;\n\n // right and bottom uv's are always 1\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n\n _this._origWidth = texture.width;\n _this._origHeight = texture.height;\n _this._uvw = 1 / _this._origWidth;\n _this._uvh = 1 / _this._origHeight;\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.width = texture.width;\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.height = texture.height;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _this._uvw * leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _this._uvw * rightWidth;\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _this._uvh * topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _this._uvh * bottomHeight;\n\n /**\n * The width of the left column (a)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.leftWidth = typeof leftWidth !== 'undefined' ? leftWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The width of the right column (b)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.rightWidth = typeof rightWidth !== 'undefined' ? rightWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the top row (c)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.topHeight = typeof topHeight !== 'undefined' ? topHeight : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.bottomHeight = typeof bottomHeight !== 'undefined' ? bottomHeight : DEFAULT_BORDER_SIZE;\n return _this;\n }\n\n /**\n * Updates the horizontal vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateHorizontalVertices = function updateHorizontalVertices() {\n var vertices = this.vertices;\n\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - this._bottomHeight;\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n\n /**\n * Updates the vertical vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateVerticalVertices = function updateVerticalVertices() {\n var vertices = this.vertices;\n\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - this._rightWidth;\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer to render with.\n */\n\n\n NineSlicePlane.prototype._renderCanvas = function _renderCanvas(renderer) {\n var context = renderer.context;\n\n context.globalAlpha = this.worldAlpha;\n\n var transform = this.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n var base = this._texture.baseTexture;\n var textureSource = base.source;\n var w = base.width;\n var h = base.height;\n\n this.drawSegment(context, textureSource, w, h, 0, 1, 10, 11);\n this.drawSegment(context, textureSource, w, h, 2, 3, 12, 13);\n this.drawSegment(context, textureSource, w, h, 4, 5, 14, 15);\n this.drawSegment(context, textureSource, w, h, 8, 9, 18, 19);\n this.drawSegment(context, textureSource, w, h, 10, 11, 20, 21);\n this.drawSegment(context, textureSource, w, h, 12, 13, 22, 23);\n this.drawSegment(context, textureSource, w, h, 16, 17, 26, 27);\n this.drawSegment(context, textureSource, w, h, 18, 19, 28, 29);\n this.drawSegment(context, textureSource, w, h, 20, 21, 30, 31);\n };\n\n /**\n * Renders one segment of the plane.\n * to mimic the exact drawing behavior of stretching the image like WebGL does, we need to make sure\n * that the source area is at least 1 pixel in size, otherwise nothing gets drawn when a slice size of 0 is used.\n *\n * @private\n * @param {CanvasRenderingContext2D} context - The context to draw with.\n * @param {CanvasImageSource} textureSource - The source to draw.\n * @param {number} w - width of the texture\n * @param {number} h - height of the texture\n * @param {number} x1 - x index 1\n * @param {number} y1 - y index 1\n * @param {number} x2 - x index 2\n * @param {number} y2 - y index 2\n */\n\n\n NineSlicePlane.prototype.drawSegment = function drawSegment(context, textureSource, w, h, x1, y1, x2, y2) {\n // otherwise you get weird results when using slices of that are 0 wide or high.\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n var sw = (uvs[x2] - uvs[x1]) * w;\n var sh = (uvs[y2] - uvs[y1]) * h;\n var dw = vertices[x2] - vertices[x1];\n var dh = vertices[y2] - vertices[y1];\n\n // make sure the source is at least 1 pixel wide and high, otherwise nothing will be drawn.\n if (sw < 1) {\n sw = 1;\n }\n\n if (sh < 1) {\n sh = 1;\n }\n\n // make sure destination is at least 1 pixel wide and high, otherwise you get\n // lines when rendering close to original size.\n if (dw < 1) {\n dw = 1;\n }\n\n if (dh < 1) {\n dh = 1;\n }\n\n context.drawImage(textureSource, uvs[x1] * w, uvs[y1] * h, sw, sh, vertices[x1], vertices[y1], dw, dh);\n };\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n\n _createClass(NineSlicePlane, [{\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n this.updateVerticalVertices();\n }\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n this.updateHorizontalVertices();\n }\n\n /**\n * The width of the left column\n *\n * @member {number}\n */\n\n }, {\n key: 'leftWidth',\n get: function get() {\n return this._leftWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._leftWidth = value;\n\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = this._uvw * value;\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = value;\n\n this.dirty = true;\n }\n\n /**\n * The width of the right column\n *\n * @member {number}\n */\n\n }, {\n key: 'rightWidth',\n get: function get() {\n return this._rightWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rightWidth = value;\n\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - this._uvw * value;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - value;\n\n this.dirty = true;\n }\n\n /**\n * The height of the top row\n *\n * @member {number}\n */\n\n }, {\n key: 'topHeight',\n get: function get() {\n return this._topHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._topHeight = value;\n\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = this._uvh * value;\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = value;\n\n this.dirty = true;\n }\n\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n\n }, {\n key: 'bottomHeight',\n get: function get() {\n return this._bottomHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._bottomHeight = value;\n\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - this._uvh * value;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - value;\n\n this.dirty = true;\n }\n }]);\n\n return NineSlicePlane;\n}(_Plane3.default);\n\nexports.default = NineSlicePlane;\n//# sourceMappingURL=NineSlicePlane.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/NineSlicePlane.js\n// module id = 579\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The rope allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.Rope(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Rope = function (_Mesh) {\n _inherits(Rope, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n */\n function Rope(texture, points) {\n _classCallCheck(this, Rope);\n\n /*\n * @member {PIXI.Point[]} An array of points that determine the rope\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this.points = points;\n\n /*\n * @member {Float32Array} An array of vertices used to construct this rope.\n */\n _this.vertices = new Float32Array(points.length * 4);\n\n /*\n * @member {Float32Array} The WebGL Uvs of the rope.\n */\n _this.uvs = new Float32Array(points.length * 4);\n\n /*\n * @member {Float32Array} An array containing the color components\n */\n _this.colors = new Float32Array(points.length * 2);\n\n /*\n * @member {Uint16Array} An array containing the indices of the vertices\n */\n _this.indices = new Uint16Array(points.length * 2);\n\n /**\n * Tracker for if the rope is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n _this._ready = true;\n\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes\n *\n */\n\n\n Rope.prototype.refresh = function refresh() {\n var points = this.points;\n\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1 || !this._texture._uvs) {\n return;\n }\n\n // if the number of points has changed we will need to recreate the arraybuffers\n if (this.vertices.length / 4 !== points.length) {\n this.vertices = new Float32Array(points.length * 4);\n this.uvs = new Float32Array(points.length * 4);\n this.colors = new Float32Array(points.length * 2);\n this.indices = new Uint16Array(points.length * 2);\n }\n\n var uvs = this.uvs;\n\n var indices = this.indices;\n var colors = this.colors;\n\n var textureUvs = this._texture._uvs;\n var offset = new core.Point(textureUvs.x0, textureUvs.y0);\n var factor = new core.Point(textureUvs.x2 - textureUvs.x0, Number(textureUvs.y2 - textureUvs.y0));\n\n uvs[0] = 0 + offset.x;\n uvs[1] = 0 + offset.y;\n uvs[2] = 0 + offset.x;\n uvs[3] = factor.y + offset.y;\n\n colors[0] = 1;\n colors[1] = 1;\n\n indices[0] = 0;\n indices[1] = 1;\n\n var total = points.length;\n\n for (var i = 1; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n var amount = i / (total - 1);\n\n uvs[index] = amount * factor.x + offset.x;\n uvs[index + 1] = 0 + offset.y;\n\n uvs[index + 2] = amount * factor.x + offset.x;\n uvs[index + 3] = factor.y + offset.y;\n\n index = i * 2;\n colors[index] = 1;\n colors[index + 1] = 1;\n\n index = i * 2;\n indices[index] = index;\n indices[index + 1] = index + 1;\n }\n\n // ensure that the changes are uploaded\n this.dirty++;\n this.indexDirty++;\n };\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n\n\n Rope.prototype._onTextureUpdate = function _onTextureUpdate() {\n _Mesh.prototype._onTextureUpdate.call(this);\n\n // wait for the Rope ctor to finish before calling refresh\n if (this._ready) {\n this.refresh();\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n Rope.prototype.updateTransform = function updateTransform() {\n var points = this.points;\n\n if (points.length < 1) {\n return;\n }\n\n var lastPoint = points[0];\n var nextPoint = void 0;\n var perpX = 0;\n var perpY = 0;\n\n // this.count -= 0.2;\n\n var vertices = this.vertices;\n var total = points.length;\n\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n } else {\n nextPoint = point;\n }\n\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n\n var ratio = (1 - i / (total - 1)) * 10;\n\n if (ratio > 1) {\n ratio = 1;\n }\n\n var perpLength = Math.sqrt(perpX * perpX + perpY * perpY);\n var num = this._texture.height / 2; // (20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;\n\n perpX /= perpLength;\n perpY /= perpLength;\n\n perpX *= num;\n perpY *= num;\n\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n\n lastPoint = point;\n }\n\n this.containerUpdateTransform();\n };\n\n return Rope;\n}(_Mesh3.default);\n\nexports.default = Rope;\n//# sourceMappingURL=Rope.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/Rope.js\n// module id = 580\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Renderer dedicated to meshes.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar MeshSpriteRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The renderer this downport works for\n */\n function MeshSpriteRenderer(renderer) {\n _classCallCheck(this, MeshSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the Mesh\n *\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var context = renderer.context;\n\n var transform = mesh.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n renderer.setBlendMode(mesh.blendMode);\n\n if (mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH) {\n this._renderTriangleMesh(mesh);\n } else {\n this._renderTriangles(mesh);\n }\n };\n\n /**\n * Draws the object in Triangle Mesh mode\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangleMesh = function _renderTriangleMesh(mesh) {\n // draw triangles!!\n var length = mesh.vertices.length / 2;\n\n for (var i = 0; i < length - 2; i++) {\n // draw some triangles!\n var index = i * 2;\n\n this._renderDrawTriangle(mesh, index, index + 2, index + 4);\n }\n };\n\n /**\n * Draws the object in triangle mode using canvas\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangles = function _renderTriangles(mesh) {\n // draw triangles!!\n var indices = mesh.indices;\n var length = indices.length;\n\n for (var i = 0; i < length; i += 3) {\n // draw some triangles!\n var index0 = indices[i] * 2;\n var index1 = indices[i + 1] * 2;\n var index2 = indices[i + 2] * 2;\n\n this._renderDrawTriangle(mesh, index0, index1, index2);\n }\n };\n\n /**\n * Draws one of the triangles that from the Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n * @param {number} index0 - the index of the first vertex\n * @param {number} index1 - the index of the second vertex\n * @param {number} index2 - the index of the third vertex\n */\n\n\n MeshSpriteRenderer.prototype._renderDrawTriangle = function _renderDrawTriangle(mesh, index0, index1, index2) {\n var context = this.renderer.context;\n var uvs = mesh.uvs;\n var vertices = mesh.vertices;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var base = texture.baseTexture;\n var textureSource = base.source;\n var textureWidth = base.width;\n var textureHeight = base.height;\n\n var u0 = uvs[index0] * base.width;\n var u1 = uvs[index1] * base.width;\n var u2 = uvs[index2] * base.width;\n var v0 = uvs[index0 + 1] * base.height;\n var v1 = uvs[index1 + 1] * base.height;\n var v2 = uvs[index2 + 1] * base.height;\n\n var x0 = vertices[index0];\n var x1 = vertices[index1];\n var x2 = vertices[index2];\n var y0 = vertices[index0 + 1];\n var y1 = vertices[index1 + 1];\n var y2 = vertices[index2 + 1];\n\n if (mesh.canvasPadding > 0) {\n var paddingX = mesh.canvasPadding / mesh.worldTransform.a;\n var paddingY = mesh.canvasPadding / mesh.worldTransform.d;\n var centerX = (x0 + x1 + x2) / 3;\n var centerY = (y0 + y1 + y2) / 3;\n\n var normX = x0 - centerX;\n var normY = y0 - centerY;\n\n var dist = Math.sqrt(normX * normX + normY * normY);\n\n x0 = centerX + normX / dist * (dist + paddingX);\n y0 = centerY + normY / dist * (dist + paddingY);\n\n //\n\n normX = x1 - centerX;\n normY = y1 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x1 = centerX + normX / dist * (dist + paddingX);\n y1 = centerY + normY / dist * (dist + paddingY);\n\n normX = x2 - centerX;\n normY = y2 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x2 = centerX + normX / dist * (dist + paddingX);\n y2 = centerY + normY / dist * (dist + paddingY);\n }\n\n context.save();\n context.beginPath();\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n\n context.closePath();\n\n context.clip();\n\n // Compute matrix transform\n var delta = u0 * v1 + v0 * u2 + u1 * v2 - v1 * u2 - v0 * u1 - u0 * v2;\n var deltaA = x0 * v1 + v0 * x2 + x1 * v2 - v1 * x2 - v0 * x1 - x0 * v2;\n var deltaB = u0 * x1 + x0 * u2 + u1 * x2 - x1 * u2 - x0 * u1 - u0 * x2;\n var deltaC = u0 * v1 * x2 + v0 * x1 * u2 + x0 * u1 * v2 - x0 * v1 * u2 - v0 * u1 * x2 - u0 * x1 * v2;\n var deltaD = y0 * v1 + v0 * y2 + y1 * v2 - v1 * y2 - v0 * y1 - y0 * v2;\n var deltaE = u0 * y1 + y0 * u2 + u1 * y2 - y1 * u2 - y0 * u1 - u0 * y2;\n var deltaF = u0 * v1 * y2 + v0 * y1 * u2 + y0 * u1 * v2 - y0 * v1 * u2 - v0 * u1 * y2 - u0 * y1 * v2;\n\n context.transform(deltaA / delta, deltaD / delta, deltaB / delta, deltaE / delta, deltaC / delta, deltaF / delta);\n\n context.drawImage(textureSource, 0, 0, textureWidth * base.resolution, textureHeight * base.resolution, 0, 0, textureWidth, textureHeight);\n\n context.restore();\n };\n\n /**\n * Renders a flat Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - The Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.renderMeshFlat = function renderMeshFlat(mesh) {\n var context = this.renderer.context;\n var vertices = mesh.vertices;\n var length = vertices.length / 2;\n\n // this.count++;\n\n context.beginPath();\n\n for (var i = 1; i < length - 2; ++i) {\n // draw some triangles!\n var index = i * 2;\n\n var x0 = vertices[index];\n var y0 = vertices[index + 1];\n\n var x1 = vertices[index + 2];\n var y1 = vertices[index + 3];\n\n var x2 = vertices[index + 4];\n var y2 = vertices[index + 5];\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n }\n\n context.fillStyle = '#FF0000';\n context.fill();\n context.closePath();\n };\n\n /**\n * destroy the the renderer.\n *\n */\n\n\n MeshSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return MeshSpriteRenderer;\n}();\n\nexports.default = MeshSpriteRenderer;\n\n\ncore.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer);\n//# sourceMappingURL=CanvasMeshRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/canvas/CanvasMeshRenderer.js\n// module id = 581\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar MeshRenderer = function (_core$ObjectRenderer) {\n _inherits(MeshRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function MeshRenderer(renderer) {\n _classCallCheck(this, MeshRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n MeshRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 translationMatrix;\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n}\\n', 'varying vec2 vTextureCoord;\\nuniform float alpha;\\nuniform vec3 tint;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vec4(tint * alpha, alpha);\\n}\\n');\n };\n\n /**\n * renders mesh\n *\n * @param {PIXI.mesh.Mesh} mesh mesh instance\n */\n\n\n MeshRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var glData = mesh._glDatas[renderer.CONTEXT_UID];\n\n if (!glData) {\n renderer.bindVao(null);\n\n glData = {\n shader: this.shader,\n vertexBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.vertices, gl.STREAM_DRAW),\n uvBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.uvs, gl.STREAM_DRAW),\n indexBuffer: _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, mesh.indices, gl.STATIC_DRAW),\n // build the vao object that will render..\n vao: null,\n dirty: mesh.dirty,\n indexDirty: mesh.indexDirty\n };\n\n // build the vao object that will render..\n glData.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(glData.indexBuffer).addAttribute(glData.vertexBuffer, glData.shader.attributes.aVertexPosition, gl.FLOAT, false, 2 * 4, 0).addAttribute(glData.uvBuffer, glData.shader.attributes.aTextureCoord, gl.FLOAT, false, 2 * 4, 0);\n\n mesh._glDatas[renderer.CONTEXT_UID] = glData;\n }\n\n renderer.bindVao(glData.vao);\n\n if (mesh.dirty !== glData.dirty) {\n glData.dirty = mesh.dirty;\n glData.uvBuffer.upload(mesh.uvs);\n }\n\n if (mesh.indexDirty !== glData.indexDirty) {\n glData.indexDirty = mesh.indexDirty;\n glData.indexBuffer.upload(mesh.indices);\n }\n\n glData.vertexBuffer.upload(mesh.vertices);\n\n renderer.bindShader(glData.shader);\n\n glData.shader.uniforms.uSampler = renderer.bindTexture(texture);\n\n renderer.state.setBlendMode(mesh.blendMode);\n\n glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true);\n glData.shader.uniforms.alpha = mesh.worldAlpha;\n glData.shader.uniforms.tint = mesh.tintRgb;\n\n var drawMode = mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES;\n\n glData.vao.draw(drawMode, mesh.indices.length, 0);\n };\n\n return MeshRenderer;\n}(core.ObjectRenderer);\n\nexports.default = MeshRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('mesh', MeshRenderer);\n//# sourceMappingURL=MeshRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/webgl/MeshRenderer.js\n// module id = 582\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that advanced\n * functionality will not work. ParticleContainer implements only the basic object transform (position, scale, rotation).\n * Any other functionality like tinting, masking, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use :\n *\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be renderer at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.particles\n */\nvar ParticleContainer = function (_core$Container) {\n _inherits(ParticleContainer, _core$Container);\n\n /**\n * @param {number} [maxSize=15000] - The maximum number of particles that can be renderer by the container.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.alpha=false] - When true, alpha be uploaded and applied.\n * @param {number} [batchSize=15000] - Number of particles per batch.\n */\n function ParticleContainer() {\n var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1500;\n var properties = arguments[1];\n var batchSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16384;\n\n _classCallCheck(this, ParticleContainer);\n\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n var maxBatchSize = 16384;\n\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n\n if (batchSize > maxSize) {\n batchSize = maxSize;\n }\n\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n _this._properties = [false, true, false, false, false];\n\n /**\n * @member {number}\n * @private\n */\n _this._maxSize = maxSize;\n\n /**\n * @member {number}\n * @private\n */\n _this._batchSize = batchSize;\n\n /**\n * @member {object}\n * @private\n */\n _this._glBuffers = {};\n\n /**\n * @member {number}\n * @private\n */\n _this._bufferToUpdate = 0;\n\n /**\n * @member {boolean}\n *\n */\n _this.interactiveChildren = false;\n\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = core.BLEND_MODES.NORMAL;\n\n /**\n * Used for canvas renderering. If true then the elements will be positioned at the\n * nearest pixel. This provides a nice speed boost.\n *\n * @member {boolean}\n * @default true;\n */\n _this.roundPixels = true;\n\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {BaseTexture}\n */\n _this.baseTexture = null;\n\n _this.setProperties(properties);\n return _this;\n }\n\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n\n\n ParticleContainer.prototype.setProperties = function setProperties(properties) {\n if (properties) {\n this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'alpha' in properties ? !!properties.alpha : this._properties[4];\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n ParticleContainer.prototype.updateTransform = function updateTransform() {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n // PIXI.Container.prototype.updateTransform.call( this );\n };\n\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The webgl renderer\n */\n\n\n ParticleContainer.prototype.renderWebGL = function renderWebGL(renderer) {\n var _this2 = this;\n\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.hasLoaded) {\n this.baseTexture.once('update', function () {\n return _this2.onChildrenChange(0);\n });\n }\n }\n\n renderer.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n\n\n ParticleContainer.prototype.onChildrenChange = function onChildrenChange(smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n\n if (bufferIndex < this._bufferToUpdate) {\n this._bufferToUpdate = bufferIndex;\n }\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\n\n\n ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var isRotated = true;\n\n var positionX = 0;\n var positionY = 0;\n\n var finalWidth = 0;\n var finalHeight = 0;\n\n var compositeOperation = renderer.blendModes[this.blendMode];\n\n if (compositeOperation !== context.globalCompositeOperation) {\n context.globalCompositeOperation = compositeOperation;\n }\n\n context.globalAlpha = this.worldAlpha;\n\n this.displayObjectUpdateTransform();\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i];\n\n if (!child.visible) {\n continue;\n }\n\n var frame = child._texture.frame;\n\n context.globalAlpha = this.worldAlpha * child.alpha;\n\n if (child.rotation % (Math.PI * 2) === 0) {\n // this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call\n if (isRotated) {\n context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx * renderer.resolution, transform.ty * renderer.resolution);\n\n isRotated = false;\n }\n\n positionX = child.anchor.x * (-frame.width * child.scale.x) + child.position.x + 0.5;\n positionY = child.anchor.y * (-frame.height * child.scale.y) + child.position.y + 0.5;\n\n finalWidth = frame.width * child.scale.x;\n finalHeight = frame.height * child.scale.y;\n } else {\n if (!isRotated) {\n isRotated = true;\n }\n\n child.displayObjectUpdateTransform();\n\n var childTransform = child.worldTransform;\n\n if (renderer.roundPixels) {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution | 0, childTransform.ty * renderer.resolution | 0);\n } else {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution, childTransform.ty * renderer.resolution);\n }\n\n positionX = child.anchor.x * -frame.width + 0.5;\n positionY = child.anchor.y * -frame.height + 0.5;\n\n finalWidth = frame.width;\n finalHeight = frame.height;\n }\n\n var resolution = child._texture.baseTexture.resolution;\n\n context.drawImage(child._texture.baseTexture.source, frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * resolution, positionY * resolution, finalWidth * resolution, finalHeight * resolution);\n }\n };\n\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n ParticleContainer.prototype.destroy = function destroy(options) {\n _core$Container.prototype.destroy.call(this, options);\n\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n }\n\n this._properties = null;\n this._buffers = null;\n };\n\n return ParticleContainer;\n}(core.Container);\n\nexports.default = ParticleContainer;\n//# sourceMappingURL=ParticleContainer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/ParticleContainer.js\n// module id = 583\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../core/utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = function () {\n /**\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) {\n _classCallCheck(this, ParticleBuffer);\n\n /**\n * The current WebGL drawing context.\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * Size of a single vertex.\n *\n * @member {number}\n */\n this.vertSize = 2;\n\n /**\n * Size of a single vertex in bytes.\n *\n * @member {number}\n */\n this.vertByteSize = this.vertSize * 4;\n\n /**\n * The number of particles the buffer can hold\n *\n * @member {number}\n */\n this.size = size;\n\n /**\n * A list of the properties that are dynamic.\n *\n * @member {object[]}\n */\n this.dynamicProperties = [];\n\n /**\n * A list of the properties that are static.\n *\n * @member {object[]}\n */\n this.staticProperties = [];\n\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attribute: property.attribute,\n size: property.size,\n uploadFunction: property.uploadFunction,\n offset: property.offset\n };\n\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n } else {\n this.staticProperties.push(property);\n }\n }\n\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n\n this.initBuffers();\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n ParticleBuffer.prototype.initBuffers = function initBuffers() {\n var gl = this.gl;\n var dynamicOffset = 0;\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n this.indices = (0, _createIndicesForQuads2.default)(this.size);\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n this.dynamicStride = 0;\n\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n\n this.dynamicData = new Float32Array(this.size * this.dynamicStride * 4);\n this.dynamicBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.dynamicData, gl.STREAM_DRAW);\n\n // static //\n var staticOffset = 0;\n\n this.staticStride = 0;\n\n for (var _i = 0; _i < this.staticProperties.length; ++_i) {\n var _property = this.staticProperties[_i];\n\n _property.offset = staticOffset;\n staticOffset += _property.size;\n this.staticStride += _property.size;\n }\n\n this.staticData = new Float32Array(this.size * this.staticStride * 4);\n this.staticBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.staticData, gl.STATIC_DRAW);\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(this.indexBuffer);\n\n for (var _i2 = 0; _i2 < this.dynamicProperties.length; ++_i2) {\n var _property2 = this.dynamicProperties[_i2];\n\n this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.FLOAT, false, this.dynamicStride * 4, _property2.offset * 4);\n }\n\n for (var _i3 = 0; _i3 < this.staticProperties.length; ++_i3) {\n var _property3 = this.staticProperties[_i3];\n\n this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.FLOAT, false, this.staticStride * 4, _property3.offset * 4);\n }\n };\n\n /**\n * Uploads the dynamic properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadDynamic = function uploadDynamic(children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n\n property.uploadFunction(children, startIndex, amount, this.dynamicData, this.dynamicStride, property.offset);\n }\n\n this.dynamicBuffer.upload();\n };\n\n /**\n * Uploads the static properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadStatic = function uploadStatic(children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n\n property.uploadFunction(children, startIndex, amount, this.staticData, this.staticStride, property.offset);\n }\n\n this.staticBuffer.upload();\n };\n\n /**\n * Destroys the ParticleBuffer.\n *\n */\n\n\n ParticleBuffer.prototype.destroy = function destroy() {\n this.dynamicProperties = null;\n this.dynamicData = null;\n this.dynamicBuffer.destroy();\n\n this.staticProperties = null;\n this.staticData = null;\n this.staticBuffer.destroy();\n };\n\n return ParticleBuffer;\n}();\n\nexports.default = ParticleBuffer;\n//# sourceMappingURL=ParticleBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleBuffer.js\n// module id = 584\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ParticleShader = require('./ParticleShader');\n\nvar _ParticleShader2 = _interopRequireDefault(_ParticleShader);\n\nvar _ParticleBuffer = require('./ParticleBuffer');\n\nvar _ParticleBuffer2 = _interopRequireDefault(_ParticleBuffer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original pixi version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n\n/**\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleRenderer = function (_core$ObjectRenderer) {\n _inherits(ParticleRenderer, _core$ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n _classCallCheck(this, ParticleRenderer);\n\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n\n _this.indexBuffer = null;\n\n _this.properties = null;\n\n _this.tempMatrix = new core.Matrix();\n\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * When there is a WebGL context change\n *\n * @private\n */\n\n\n ParticleRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n // setup default shader\n this.shader = new _ParticleShader2.default(gl);\n\n this.properties = [\n // verticesData\n {\n attribute: this.shader.attributes.aVertexPosition,\n size: 2,\n uploadFunction: this.uploadVertices,\n offset: 0\n },\n // positionData\n {\n attribute: this.shader.attributes.aPositionCoord,\n size: 2,\n uploadFunction: this.uploadPosition,\n offset: 0\n },\n // rotationData\n {\n attribute: this.shader.attributes.aRotation,\n size: 1,\n uploadFunction: this.uploadRotation,\n offset: 0\n },\n // uvsData\n {\n attribute: this.shader.attributes.aTextureCoord,\n size: 2,\n uploadFunction: this.uploadUvs,\n offset: 0\n },\n // alphaData\n {\n attribute: this.shader.attributes.aColor,\n size: 1,\n uploadFunction: this.uploadAlpha,\n offset: 0\n }];\n };\n\n /**\n * Starts a new particle batch.\n *\n */\n\n\n ParticleRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n };\n\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n\n\n ParticleRenderer.prototype.render = function render(container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n\n if (totalChildren === 0) {\n return;\n } else if (totalChildren > maxSize) {\n totalChildren = maxSize;\n }\n\n var buffers = container._glBuffers[renderer.CONTEXT_UID];\n\n if (!buffers) {\n buffers = container._glBuffers[renderer.CONTEXT_UID] = this.generateBuffers(container);\n }\n\n // if the uvs have not updated then no point rendering just yet!\n this.renderer.setBlendMode(container.blendMode);\n\n var gl = renderer.gl;\n\n var m = container.worldTransform.copy(this.tempMatrix);\n\n m.prepend(renderer._activeRenderTarget.projectionMatrix);\n\n this.shader.uniforms.projectionMatrix = m.toArray(true);\n this.shader.uniforms.uAlpha = container.worldAlpha;\n\n // make sure the texture is bound..\n var baseTexture = children[0]._texture.baseTexture;\n\n this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture);\n\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = totalChildren - i;\n\n if (amount > batchSize) {\n amount = batchSize;\n }\n\n var buffer = buffers[j];\n\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n\n // we only upload the static content when we have to!\n if (container._bufferToUpdate === j) {\n buffer.uploadStatic(children, i, amount);\n container._bufferToUpdate = j + 1;\n }\n\n // bind the buffer\n renderer.bindVao(buffer.vao);\n buffer.vao.draw(gl.TRIANGLES, amount * 6);\n }\n };\n\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n */\n\n\n ParticleRenderer.prototype.generateBuffers = function generateBuffers(container) {\n var gl = this.renderer.gl;\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize));\n }\n\n return buffers;\n };\n\n /**\n * Uploads the verticies.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadVertices = function uploadVertices(children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - sprite.anchor.x * orig.width;\n w0 = w1 + trim.width;\n\n h1 = trim.y - sprite.anchor.y * orig.height;\n h0 = h1 + trim.height;\n } else {\n w0 = orig.width * (1 - sprite.anchor.x);\n w1 = orig.width * -sprite.anchor.x;\n\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n\n array[offset + stride * 2] = w0 * sx;\n array[offset + stride * 2 + 1] = h0 * sy;\n\n array[offset + stride * 3] = w1 * sx;\n array[offset + stride * 3 + 1] = h0 * sy;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadPosition = function uploadPosition(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n\n array[offset + stride * 2] = spritePosition.x;\n array[offset + stride * 2 + 1] = spritePosition.y;\n\n array[offset + stride * 3] = spritePosition.x;\n array[offset + stride * 3 + 1] = spritePosition.y;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadRotation = function uploadRotation(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + stride * 2] = spriteRotation;\n array[offset + stride * 3] = spriteRotation;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadUvs = function uploadUvs(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n\n array[offset + stride * 2] = textureUvs.x2;\n array[offset + stride * 2 + 1] = textureUvs.y2;\n\n array[offset + stride * 3] = textureUvs.x3;\n array[offset + stride * 3 + 1] = textureUvs.y3;\n\n offset += stride * 4;\n } else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n\n array[offset + stride * 2] = 0;\n array[offset + stride * 2 + 1] = 0;\n\n array[offset + stride * 3] = 0;\n array[offset + stride * 3 + 1] = 0;\n\n offset += stride * 4;\n }\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadAlpha = function uploadAlpha(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteAlpha = children[startIndex + i].alpha;\n\n array[offset] = spriteAlpha;\n array[offset + stride] = spriteAlpha;\n array[offset + stride * 2] = spriteAlpha;\n array[offset + stride * 3] = spriteAlpha;\n\n offset += stride * 4;\n }\n };\n\n /**\n * Destroys the ParticleRenderer.\n *\n */\n\n\n ParticleRenderer.prototype.destroy = function destroy() {\n if (this.renderer.gl) {\n this.renderer.gl.deleteBuffer(this.indexBuffer);\n }\n\n _core$ObjectRenderer.prototype.destroy.call(this);\n\n this.shader.destroy();\n\n this.indices = null;\n this.tempMatrix = null;\n };\n\n return ParticleRenderer;\n}(core.ObjectRenderer);\n\nexports.default = ParticleRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('particle', ParticleRenderer);\n//# sourceMappingURL=ParticleRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleRenderer.js\n// module id = 585\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../core/Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.Shader\n * @memberof PIXI\n */\nvar ParticleShader = function (_Shader) {\n _inherits(ParticleShader, _Shader);\n\n /**\n * @param {PIXI.Shader} gl - The webgl shader manager this shader works for.\n */\n function ParticleShader(gl) {\n _classCallCheck(this, ParticleShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['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'),\n // hello\n ['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')));\n }\n\n return ParticleShader;\n}(_Shader3.default);\n\nexports.default = ParticleShader;\n//# sourceMappingURL=ParticleShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleShader.js\n// module id = 586\n// module chunks = 0","\"use strict\";\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n\n if (x === 0 || isNaN(x)) {\n return x;\n }\n\n return x > 0 ? 1 : -1;\n };\n}\n//# sourceMappingURL=Math.sign.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/Math.sign.js\n// module id = 587\n// module chunks = 0","'use strict';\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nif (!Object.assign) {\n Object.assign = _objectAssign2.default;\n} // References:\n// https://github.com/sindresorhus/object-assign\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n//# sourceMappingURL=Object.assign.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/Object.assign.js\n// module id = 588\n// module chunks = 0","'use strict';\n\nrequire('./Object.assign');\n\nrequire('./requestAnimationFrame');\n\nrequire('./Math.sign');\n\nif (!window.ArrayBuffer) {\n window.ArrayBuffer = Array;\n}\n\nif (!window.Float32Array) {\n window.Float32Array = Array;\n}\n\nif (!window.Uint32Array) {\n window.Uint32Array = Array;\n}\n\nif (!window.Uint16Array) {\n window.Uint16Array = Array;\n}\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/index.js\n// module id = 589\n// module chunks = 0","'use strict';\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\n\nvar ONE_FRAME_TIME = 16;\n\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n\n// performance.now\nif (!(global.performance && global.performance.now)) {\n (function () {\n var startTime = Date.now();\n\n if (!global.performance) {\n global.performance = {};\n }\n\n global.performance.now = function () {\n return Date.now() - startTime;\n };\n })();\n}\n\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\n\nfor (var x = 0; x < vendors.length && !global.requestAnimationFrame; ++x) {\n var p = vendors[x];\n\n global.requestAnimationFrame = global[p + 'RequestAnimationFrame'];\n global.cancelAnimationFrame = global[p + 'CancelAnimationFrame'] || global[p + 'CancelRequestAnimationFrame'];\n}\n\nif (!global.requestAnimationFrame) {\n global.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + 'is not a function');\n }\n\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n\n if (delay < 0) {\n delay = 0;\n }\n\n lastTime = currentTime;\n\n return setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\n\nif (!global.cancelAnimationFrame) {\n global.cancelAnimationFrame = function (id) {\n return clearTimeout(id);\n };\n}\n//# sourceMappingURL=requestAnimationFrame.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/requestAnimationFrame.js\n// module id = 590\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CANVAS_START_SIZE = 16;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU\n * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing\n * textures to an offline canvas.\n * This draw call will force the texture to be moved onto the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @memberof PIXI\n */\n\nvar CanvasPrepare = function (_BasePrepare) {\n _inherits(CanvasPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasPrepare(renderer) {\n _classCallCheck(this, CanvasPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this;\n\n /**\n * An offline canvas to render textures to\n * @type {HTMLCanvasElement}\n * @private\n */\n _this.canvas = document.createElement('canvas');\n _this.canvas.width = CANVAS_START_SIZE;\n _this.canvas.height = CANVAS_START_SIZE;\n\n /**\n * The context to the canvas\n * @type {CanvasRenderingContext2D}\n * @private\n */\n _this.ctx = _this.canvas.getContext('2d');\n\n // Add textures to upload\n _this.register(findBaseTextures, uploadBaseTextures);\n return _this;\n }\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n\n\n CanvasPrepare.prototype.destroy = function destroy() {\n _BasePrepare.prototype.destroy.call(this);\n this.ctx = null;\n this.canvas = null;\n };\n\n return CanvasPrepare;\n}(_BasePrepare3.default);\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {*} prepare - Instance of CanvasPrepare\n * @param {*} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = CanvasPrepare;\nfunction uploadBaseTextures(prepare, item) {\n if (item instanceof core.BaseTexture) {\n var image = item.source;\n\n // Sometimes images (like atlas images) report a size of zero, causing errors on windows phone.\n // So if the width or height is equal to zero then use the canvas size\n // Otherwise use whatever is smaller, the image dimensions or the canvas dimensions.\n var imageWidth = image.width === 0 ? prepare.canvas.width : Math.min(prepare.canvas.width, image.width);\n var imageHeight = image.height === 0 ? prepare.canvas.height : Math.min(prepare.canvas.height, image.height);\n\n // Only a small subsections is required to be drawn to have the whole texture uploaded to the GPU\n // A smaller draw can be faster.\n prepare.ctx.drawImage(image, 0, 0, imageWidth, imageHeight, 0, 0, prepare.canvas.width, prepare.canvas.height);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find textures from Sprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item -Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTextures(item, queue) {\n // Objects with textures, like Sprites/Text\n if (item instanceof core.BaseTexture) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n\n return true;\n } else if (item._texture && item._texture instanceof core.Texture) {\n var texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\ncore.CanvasRenderer.registerPlugin('prepare', CanvasPrepare);\n//# sourceMappingURL=CanvasPrepare.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/canvas/CanvasPrepare.js\n// module id = 591\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar TimeLimiter = function () {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n function TimeLimiter(maxMilliseconds) {\n _classCallCheck(this, TimeLimiter);\n\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n TimeLimiter.prototype.beginFrame = function beginFrame() {\n this.frameStart = Date.now();\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n TimeLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n\n return TimeLimiter;\n}();\n\nexports.default = TimeLimiter;\n//# sourceMappingURL=TimeLimiter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/limiters/TimeLimiter.js\n// module id = 592\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @memberof PIXI\n */\nvar WebGLPrepare = function (_BasePrepare) {\n _inherits(WebGLPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLPrepare(renderer) {\n _classCallCheck(this, WebGLPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this.renderer;\n\n // Add textures and graphics to upload\n _this.register(findBaseTextures, uploadBaseTextures).register(findGraphics, uploadGraphics);\n return _this;\n }\n\n return WebGLPrepare;\n}(_BasePrepare3.default);\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = WebGLPrepare;\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof core.BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.textureManager.updateTexture(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (item instanceof core.Graphics) {\n // if the item is not dirty and already has webgl data, then it got prepared or rendered\n // before now and we shouldn't waste time updating it again\n if (item.dirty || item.clearDirty || !item._webGL[renderer.plugins.graphics.CONTEXT_UID]) {\n renderer.plugins.graphics.updateGraphics(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find textures from Sprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTextures(item, queue) {\n // Objects with textures, like Sprites/Text\n if (item instanceof core.BaseTexture) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n\n return true;\n } else if (item._texture && item._texture instanceof core.Texture) {\n var texture = item._texture.baseTexture;\n\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof core.Graphics) {\n queue.push(item);\n\n return true;\n }\n\n return false;\n}\n\ncore.WebGLRenderer.registerPlugin('prepare', WebGLPrepare);\n//# sourceMappingURL=WebGLPrepare.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/webgl/WebGLPrepare.js\n// module id = 593\n// module chunks = 0","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/punycode/punycode.js\n// module id = 594\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/decode.js\n// module id = 595\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/encode.js\n// module id = 596\n// module chunks = 0","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/index.js\n// module id = 597\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _miniSignals = require('mini-signals');\n\nvar _miniSignals2 = _interopRequireDefault(_miniSignals);\n\nvar _parseUri = require('parse-uri');\n\nvar _parseUri2 = _interopRequireDefault(_parseUri);\n\nvar _async = require('./async');\n\nvar async = _interopRequireWildcard(_async);\n\nvar _Resource = require('./Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// some constants\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader = function () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader() {\n var _this = this;\n\n var baseUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var concurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n\n _classCallCheck(this, Loader);\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n */\n this.progress = 0;\n\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n */\n this.loading = false;\n\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n *\n * ```js\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n * ```\n */\n this.defaultQueryString = '';\n\n /**\n * The middleware to run before loading each resource.\n *\n * @member {function[]}\n */\n this._beforeMiddleware = [];\n\n /**\n * The middleware to run after loading each resource.\n *\n * @member {function[]}\n */\n this._afterMiddleware = [];\n\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @member {Resource[]}\n */\n this._resourcesParsing = [];\n\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n this._queue = async.queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n this.resources = {};\n\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n this.onProgress = new _miniSignals2.default();\n\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n this.onError = new _miniSignals2.default();\n\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n this.onLoad = new _miniSignals2.default();\n\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n this.onStart = new _miniSignals2.default();\n\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n this.onComplete = new _miniSignals2.default();\n\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n }\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @param {string} [name] - The name of the resource to load, if not passed the url is used.\n * @param {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @param {object} [options] - The options for the load.\n * @param {boolean} [options.crossOrigin] - Is this request cross-origin? Default is to determine automatically.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How should\n * the data being loaded be interpreted when using XHR?\n * @param {object} [options.metadata] - Extra configuration for middleware and the Resource object.\n * @param {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [options.metadata.loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @param {function} [cb] - Function to call when this specific resource completes loading.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n }\n\n // if an object is passed instead of params\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n }\n\n // case where no name is passed shift all args over by one.\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n }\n\n // now that we shifted make sure we have a proper url.\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n }\n\n // options are optional so people might pass a function and no options\n if (typeof options === 'function') {\n cb = options;\n options = null;\n }\n\n // if loading already you can only add resources that have a parent.\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n }\n\n // check if resource already exists.\n if (this.resources[name]) {\n throw new Error('Resource named \"' + name + '\" already exists.');\n }\n\n // add base url if this isn't an absolute url\n url = this._prepareUrl(url);\n\n // create the store the resource\n this.resources[name] = new _Resource2.default(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n }\n\n // if actively loading, make sure to adjust progress chunks for that parent and its children\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i = 0; _i < parent.children.length; ++_i) {\n if (!parent.children[_i].isComplete) {\n incompleteChildren.push(parent.children[_i]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i2 = 0; _i2 < incompleteChildren.length; ++_i2) {\n incompleteChildren[_i2].progressChunk = eachChunk;\n }\n }\n\n // add the resource to the queue\n this._queue.push(this.resources[name]);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @method before\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @alias use\n * @method after\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n this._queue.pause();\n\n // abort all resource loads\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n\n return this;\n };\n\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n }\n\n // if the queue has already started we are done here\n if (this.loading) {\n return this;\n }\n\n // distribute progress chunks\n var chunk = 100 / this._queue._tasks.length;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n }\n\n // update loading state\n this.loading = true;\n\n // notify of start\n this.onStart.dispatch(this);\n\n // start loading\n this._queue.resume();\n\n return this;\n };\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n\n\n Loader.prototype._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = (0, _parseUri2.default)(url, { strictMode: true });\n var result = void 0;\n\n // absolute url, just use it as is.\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n }\n // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + '/' + url;\n } else {\n result = this.baseUrl + url;\n }\n\n // if we need to add a default querystring, there is a bit more work\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += '&' + this.defaultQueryString;\n } else {\n result += '?' + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n };\n\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n\n\n Loader.prototype._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue;\n\n // run before middleware\n async.eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n });\n };\n\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n\n\n Loader.prototype._onComplete = function _onComplete() {\n this.loading = false;\n\n this.onComplete.dispatch(this, this.resources);\n };\n\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n\n\n Loader.prototype._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null;\n\n // remove this resource from the async queue, and add it to our list of resources that are being parsed\n resource._dequeue();\n this._resourcesParsing.push(resource);\n\n // run middleware, this *must* happen before dequeue so sub-assets get added properly\n async.eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n\n _this3.progress += resource.progressChunk;\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1);\n\n // do completion check\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3.progress = MAX_PROGRESS;\n _this3._onComplete();\n }\n });\n };\n\n return Loader;\n}();\n\nexports.default = Loader;\n//# sourceMappingURL=Loader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/Loader.js\n// module id = 598\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.blobMiddlewareFactory = blobMiddlewareFactory;\n\nvar _Resource = require('../../Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nvar _b = require('../../b64');\n\nvar _b2 = _interopRequireDefault(_b);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Url = window.URL || window.webkitURL;\n\n// a middleware for transforming XHR loaded Blobs into more useful objects\nfunction blobMiddlewareFactory() {\n return function blobMiddleware(resource, next) {\n if (!resource.data) {\n next();\n\n return;\n }\n\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === _Resource2.default.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type');\n\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = 'data:' + type + ';base64,' + _b2.default.encodeBinary(resource.xhr.responseText);\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // wait until the image loads and then callback\n resource.data.onload = function () {\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var _ret = function () {\n var src = Url.createObjectURL(resource.data);\n\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load.\n return {\n v: void 0\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }\n\n next();\n };\n}\n//# sourceMappingURL=blob.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/middlewares/parsing/blob.js\n// module id = 599\n// module chunks = 0","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a