!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return n(r?r:e)},u,u.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(e,r){(function(e){!function(){function i(t){var e=!1;return function(){if(e)throw new Error("Callback was already called.");e=!0,t.apply(n,arguments)}}var n,o,s={};n=this,null!=n&&(o=n.async),s.noConflict=function(){return n.async=o,s};var a=Object.prototype.toString,h=Array.isArray||function(t){return"[object Array]"===a.call(t)},l=function(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r+=1)e(t[r],r,t)},u=function(t,e){if(t.map)return t.map(e);var r=[];return l(t,function(t,i,n){r.push(e(t,i,n))}),r},c=function(t,e,r){return t.reduce?t.reduce(e,r):(l(t,function(t,i,n){r=e(r,t,i,n)}),r)},d=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e};"undefined"!=typeof e&&e.nextTick?(s.nextTick=e.nextTick,s.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:s.nextTick):"function"==typeof setImmediate?(s.nextTick=function(t){setImmediate(t)},s.setImmediate=s.nextTick):(s.nextTick=function(t){setTimeout(t,0)},s.setImmediate=s.nextTick),s.each=function(t,e,r){function n(e){e?(r(e),r=function(){}):(o+=1,o>=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;l(t,function(t){e(t,i(n))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var i=0,n=function(){e(t[i],function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length?r():n())})};n()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,i){var n=p(e);n.apply(null,[t,r,i])},s.forEachLimit=s.eachLimit;var p=function(t){return function(e,r,i){if(i=i||function(){},!e.length||0>=t)return i();var n=0,o=0,s=0;!function a(){if(n>=e.length)return i();for(;t>s&&o<e.length;)o+=1,s+=1,r(e[o-1],function(t){t?(i(t),i=function(){}):(n+=1,s-=1,n>=e.length?i():a())})}()}},f=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},g=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[p(t)].concat(r))}},v=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},m=function(t,e,r,i){if(e=u(e,function(t,e){return{index:e,value:t}}),i){var n=[];t(e,function(t,e){r(t.value,function(r,i){n[t.index]=i,e(r)})},function(t){i(t,n)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=f(m),s.mapSeries=v(m),s.mapLimit=function(t,e,r,i){return y(e)(t,r,i)};var y=function(t){return g(t,m)};s.reduce=function(t,e,r,i){s.eachSeries(t,function(t,i){r(e,t,function(t,r){e=r,i(t)})},function(t){i(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,i){var n=u(t,function(t){return t}).reverse();s.reduce(n,e,r,i)},s.foldr=s.reduceRight;var x=function(t,e,r,i){var n=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&n.push(t),e()})},function(){i(u(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=f(x),s.filterSeries=v(x),s.select=s.filter,s.selectSeries=s.filterSeries;var b=function(t,e,r,i){var n=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||n.push(t),e()})},function(){i(u(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=f(b),s.rejectSeries=v(b);var T=function(t,e,r,i){t(e,function(t,e){r(t,function(r){r?(i(t),i=function(){}):e()})},function(){i()})};s.detect=f(T),s.detectSeries=v(T),s.some=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t&&(r(!0),r=function(){}),i()})},function(){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t||(r(!1),r=function(){}),i()})},function(){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){if(t)return r(t);var i=function(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0};r(null,u(e.sort(i),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=d(t),i=r.length;if(!i)return e();var n={},o=[],a=function(t){o.unshift(t)},u=function(t){for(var e=0;e<o.length;e+=1)if(o[e]===t)return void o.splice(e,1)},p=function(){i--,l(o.slice(0),function(t){t()})};a(function(){if(!i){var t=e;e=function(){},t(null,n)}}),l(r,function(r){var i=h(t[r])?t[r]:[t[r]],o=function(t){var i=Array.prototype.slice.call(arguments,1);if(i.length<=1&&(i=i[0]),t){var o={};l(d(n),function(t){o[t]=n[t]}),o[r]=i,e(t,o),e=function(){}}else n[r]=i,s.setImmediate(p)},f=i.slice(0,Math.abs(i.length-1))||[],g=function(){return c(f,function(t,e){return t&&n.hasOwnProperty(e)},!0)&&!n.hasOwnProperty(r)};if(g())i[i.length-1](o,n);else{var v=function(){g()&&(u(v),i[i.length-1](o,n))};a(v)}})},s.retry=function(t,e,r){var i=5,n=[];"function"==typeof t&&(r=e,e=t,t=i),t=parseInt(t,10)||i;var o=function(i,o){for(var a=function(t,e){return function(r){t(function(t,i){r(!t||e,{err:t,result:i})},o)}};t;)n.push(a(e,!(t-=1)));s.series(n,function(t,e){e=e[e.length-1],(i||r)(e.err,e.result)})};return r?o():o},s.waterfall=function(t,e){if(e=e||function(){},!h(t)){var r=new Error("First argument to waterfall must be an array of functions");return e(r)}if(!t.length)return e();var i=function(t){return function(r){if(r)e.apply(null,arguments),e=function(){};else{var n=Array.prototype.slice.call(arguments,1),o=t.next();n.push(o?i(o):e),s.setImmediate(function(){t.apply(null,n)})}}};i(s.iterator(t))()};var _=function(t,e,r){if(r=r||function(){},h(e))t.map(e,function(t,e){t&&t(function(t){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),e.call(null,t,r)})},r);else{var i={};t.each(d(e),function(t,r){e[t](function(e){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),i[t]=n,r(e)})},function(t){r(t,i)})}};s.parallel=function(t,e){_({map:s.map,each:s.each},t,e)},s.parallelLimit=function(t,e,r){_({map:y(e),each:p(e)},t,r)},s.series=function(t,e){if(e=e||function(){},h(t))s.mapSeries(t,function(t,e){t&&t(function(t){var r=Array.prototype.slice.call(arguments,1);r.length<=1&&(r=r[0]),e.call(null,t,r)})},e);else{var r={};s.eachSeries(d(t),function(e,i){t[e](function(t){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),r[e]=n,i(t)})},function(t){e(t,r)})}},s.iterator=function(t){var e=function(r){var i=function(){return t.length&&t[r].apply(null,arguments),i.next()};return i.next=function(){return r<t.length-1?e(r+1):null},i};return e(0)},s.apply=function(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e.concat(Array.prototype.slice.call(arguments)))}};var E=function(t,e,r,i){var n=[];t(e,function(t,e){r(t,function(t,r){n=n.concat(r||[]),e(t)})},function(t){i(t,n)})};s.concat=f(E),s.concatSeries=v(E),s.whilst=function(t,e,r){t()?e(function(i){return i?r(i):void s.whilst(t,e,r)}):r()},s.doWhilst=function(t,e,r){t(function(i){if(i)return r(i);var n=Array.prototype.slice.call(arguments,1);e.apply(null,n)?s.doWhilst(t,e,r):r()})},s.until=function(t,e,r){t()?r():e(function(i){return i?r(i):void s.until(t,e,r)})},s.doUntil=function(t,e,r){t(function(i){if(i)return r(i);var n=Array.prototype.slice.call(arguments,1);e.apply(null,n)?r():s.doUntil(t,e,r)})},s.queue=function(t,e){function r(t,e,r,i){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var n={data:e,callback:"function"==typeof i?i:null};r?t.tasks.unshift(n):t.tasks.push(n),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}void 0===e&&(e=1);var n=0,o={tasks:[],concurrency:e,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(t,e){r(o,t,!1,e)},kill:function(){o.drain=null,o.tasks=[]},unshift:function(t,e){r(o,t,!0,e)},process:function(){if(!o.paused&&n<o.concurrency&&o.tasks.length){var e=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),n+=1;var r=function(){n-=1,e.callback&&e.callback.apply(e,arguments),o.drain&&o.tasks.length+n===0&&o.drain(),o.process()},s=i(r);t(e.data,s)}},length:function(){return o.tasks.length},running:function(){return n},idle:function(){return o.tasks.length+n===0},pause:function(){o.paused!==!0&&(o.paused=!0,o.process())},resume:function(){o.paused!==!1&&(o.paused=!1,o.process())}};return o},s.priorityQueue=function(t,e){function r(t,e){return t.priority-e.priority}function i(t,e,r){for(var i=-1,n=t.length-1;n>i;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function n(t,e,n,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void l(e,function(e){var a={data:e,priority:n,callback:"function"==typeof o?o:null};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){n(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,i=[],n={tasks:i,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),l(t,function(t){i.push({data:t,callback:"function"==typeof r?r:null}),n.drained=!1,n.saturated&&i.length===e&&n.saturated()}),s.setImmediate(n.process)},process:function o(){if(!r){if(0===i.length)return n.drain&&!n.drained&&n.drain(),void(n.drained=!0);var s="number"==typeof e?i.splice(0,e):i.splice(0,i.length),a=u(s,function(t){return t.data});n.empty&&n.empty(),r=!0,t(a,function(){r=!1;var t=arguments;l(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return i.length},running:function(){return r}};return n};var w=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&l(r,function(e){console[t](e)}))}]))}};s.log=w("log"),s.dir=w("dir"),s.memoize=function(t,e){var r={},i={};e=e||function(t){return t};var n=function(){var n=Array.prototype.slice.call(arguments),o=n.pop(),a=e.apply(null,n);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in i?i[a].push(o):(i[a]=[o],t.apply(null,n.concat([function(){r[a]=arguments;var t=i[a];delete i[a];for(var e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)}])))};return n.memo=r,n.unmemoized=t,n},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.map(i,e,r)},s.timesSeries=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.mapSeries(i,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();s.reduce(t,r,function(t,r,i){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);i(t,e)}]))},function(t,r){i.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var S=function(t,e){var r=function(){var r=this,i=Array.prototype.slice.call(arguments),n=i.pop();return t(e,function(t,e){t.apply(r,i.concat([e]))},n)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return r.apply(this,i)}return r};s.applyEach=f(S),s.applyEachSeries=v(S),s.forever=function(t,e){function r(i){if(i){if(e)return e(i);throw i}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):n.async=s}()}).call(this,e("_process"))},{_process:3}],2:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i<t.length;i++)e(t[i],i,t)&&r.push(t[i]);return r}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return n.exec(t).slice(1)};r.resolve=function(){for(var r="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;s>h;h++)if(n[h]!==o[h]){a=h;break}for(var l=[],h=a;h<n.length;h++)l.push("..");return l=l.concat(o.slice(a)),l.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=o(t),r=e[0],i=e[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},r.basename=function(t,e){var r=o(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return o(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return 0>e&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e){function r(){if(!s){s=!0;for(var t,e=o.length;e;){t=o,o=[];for(var r=-1;++r<e;)t[r]();e=o.length}s=!1}}function i(){}var n=e.exports={},o=[],s=!1;n.nextTick=function(t){o.push(t),s||setTimeout(r,0)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.on=i,n.addListener=i,n.once=i,n.off=i,n.removeListener=i,n.removeAllListeners=i,n.emit=i,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],4:[function(e,r,i){!function(){function e(){this._events={},this._conf&&r.call(this,this._conf)}function r(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),t.maxListeners&&(this._events.maxListeners=t.maxListeners),t.wildcard&&(this.wildcard=t.wildcard),t.newListener&&(this.newListener=t.newListener),this.wildcard&&(this.listenerTree={}))}function n(t){this._events={},this.newListener=!1,r.call(this,t)}function o(t,e,r,i){if(!r)return[];var n,s,a,h,l,u,c,d=[],p=e.length,f=e[i],g=e[i+1];if(i===p&&r._listeners){if("function"==typeof r._listeners)return t&&t.push(r._listeners),[r];for(n=0,s=r._listeners.length;s>n;n++)t&&t.push(r._listeners[n]);return[r]}if("*"===f||"**"===f||r[f]){if("*"===f){for(a in r)"_listeners"!==a&&r.hasOwnProperty(a)&&(d=d.concat(o(t,e,r[a],i+1)));return d}if("**"===f){c=i+1===p||i+2===p&&"*"===g,c&&r._listeners&&(d=d.concat(o(t,e,r,p)));for(a in r)"_listeners"!==a&&r.hasOwnProperty(a)&&("*"===a||"**"===a?(r[a]._listeners&&!c&&(d=d.concat(o(t,e,r[a],p))),d=d.concat(o(t,e,r[a],i))):d=d.concat(a===g?o(t,e,r[a],i+2):o(t,e,r[a],i)));return d}d=d.concat(o(t,e,r[f],i+1))}if(h=r["*"],h&&o(t,e,h,i+1),l=r["**"])if(p>i){l._listeners&&o(t,e,l,p);for(a in l)"_listeners"!==a&&l.hasOwnProperty(a)&&(a===g?o(t,e,l[a],i+2):a===f?o(t,e,l[a],i+1):(u={},u[a]=l[a],o(t,e,{"**":u},i+1)))}else l._listeners?o(t,e,l,p):l["*"]&&l["*"]._listeners&&o(t,e,l["*"],p);return d}function s(t,e){t="string"==typeof t?t.split(this.delimiter):t.slice();for(var r=0,i=t.length;i>r+1;r++)if("**"===t[r]&&"**"===t[r+1])return;for(var n=this.listenerTree,o=t.shift();o;){if(n[o]||(n[o]={}),n=n[o],0===t.length){if(n._listeners){if("function"==typeof n._listeners)n._listeners=[n._listeners,e];else if(a(n._listeners)&&(n._listeners.push(e),!n._listeners.warned)){var s=h;"undefined"!=typeof this._events.maxListeners&&(s=this._events.maxListeners),s>0&&n._listeners.length>s&&(n._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",n._listeners.length),console.trace())}}else n._listeners=e;return!0}o=t.shift()}return!0}var a=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},h=10;n.prototype.delimiter=".",n.prototype.setMaxListeners=function(t){this._events||e.call(this),this._events.maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t},n.prototype.event="",n.prototype.once=function(t,e){return this.many(t,1,e),this},n.prototype.many=function(t,e,r){function i(){0===--e&&n.off(t,i),r.apply(this,arguments)}var n=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");return i._origin=r,this.on(t,i),n},n.prototype.emit=function(){this._events||e.call(this);var t=arguments[0];if("newListener"===t&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var r=arguments.length,i=new Array(r-1),n=1;r>n;n++)i[n-1]=arguments[n];for(n=0,r=this._all.length;r>n;n++)this.event=t,this._all[n].apply(this,i)}if("error"===t&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var a="string"==typeof t?t.split(this.delimiter):t.slice();o.call(this,s,a,this.listenerTree,0)}else s=this._events[t];if("function"==typeof s){if(this.event=t,1===arguments.length)s.call(this);else if(arguments.length>1)switch(arguments.length){case 2:s.call(this,arguments[1]);break;case 3:s.call(this,arguments[1],arguments[2]);break;default:for(var r=arguments.length,i=new Array(r-1),n=1;r>n;n++)i[n-1]=arguments[n];s.apply(this,i)}return!0}if(s){for(var r=arguments.length,i=new Array(r-1),n=1;r>n;n++)i[n-1]=arguments[n];for(var h=s.slice(),n=0,r=h.length;r>n;n++)this.event=t,h[n].apply(this,i);return h.length>0||!!this._all}return!!this._all},n.prototype.on=function(t,r){if("function"==typeof t)return this.onAny(t),this;if("function"!=typeof r)throw new Error("on only accepts instances of Function");if(this._events||e.call(this),this.emit("newListener",t,r),this.wildcard)return s.call(this,t,r),this;if(this._events[t]){if("function"==typeof this._events[t])this._events[t]=[this._events[t],r];else if(a(this._events[t])&&(this._events[t].push(r),!this._events[t].warned)){var i=h;"undefined"!=typeof this._events.maxListeners&&(i=this._events.maxListeners),i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}}else this._events[t]=r;return this},n.prototype.onAny=function(t){if("function"!=typeof t)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(t),this},n.prototype.addListener=n.prototype.on,n.prototype.off=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");var r,i=[];if(this.wildcard){var n="string"==typeof t?t.split(this.delimiter):t.slice();i=o.call(this,null,n,this.listenerTree,0)}else{if(!this._events[t])return this;r=this._events[t],i.push({_listeners:r})}for(var s=0;s<i.length;s++){var h=i[s];if(r=h._listeners,a(r)){for(var l=-1,u=0,c=r.length;c>u;u++)if(r[u]===e||r[u].listener&&r[u].listener===e||r[u]._origin&&r[u]._origin===e){l=u;break}if(0>l)continue;return this.wildcard?h._listeners.splice(l,1):this._events[t].splice(l,1),0===r.length&&(this.wildcard?delete h._listeners:delete this._events[t]),this}(r===e||r.listener&&r.listener===e||r._origin&&r._origin===e)&&(this.wildcard?delete h._listeners:delete this._events[t])}return this},n.prototype.offAny=function(t){var e,r=0,i=0;if(t&&this._all&&this._all.length>0){for(e=this._all,r=0,i=e.length;i>r;r++)if(t===e[r])return e.splice(r,1),this}else this._all=[];return this},n.prototype.removeListener=n.prototype.off,n.prototype.removeAllListeners=function(t){if(0===arguments.length)return!this._events||e.call(this),this;if(this.wildcard)for(var r="string"==typeof t?t.split(this.delimiter):t.slice(),i=o.call(this,null,r,this.listenerTree,0),n=0;n<i.length;n++){var s=i[n];s._listeners=null}else{if(!this._events[t])return this;this._events[t]=null}return this},n.prototype.listeners=function(t){if(this.wildcard){var r=[],i="string"==typeof t?t.split(this.delimiter):t.slice();return o.call(this,r,i,this.listenerTree,0),r}return this._events||e.call(this),this._events[t]||(this._events[t]=[]),a(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]},n.prototype.listenersAny=function(){return this._all?this._all:[]},"function"==typeof t&&t.amd?t(function(){return n}):"object"==typeof i?i.EventEmitter2=n:window.EventEmitter2=n}()},{}],5:[function(t,e){function r(t,e){o.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this.loadResource.bind(this),this._boundOnComplete=this._onComplete.bind(this),this._buffer=[],this.queue=i.queue(this._boundLoadResource,e),this.resources={}}var i=t("async"),n=t("./Resource"),o=t("eventemitter2").EventEmitter2;r.prototype=Object.create(o.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.add=r.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var o=0;o<t.length;++o)this.add(t[o]);return this}if("object"==typeof t&&(i=e||t.callback||t.onComplete,r=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(i=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof r&&(i=r,r=null),this.resources[t])throw new Error('Resource with name "'+t+'" already exists.');return this.resources[t]=new n(t,this.baseUrl+e,r),"function"==typeof i&&this.resources[t].once("afterMiddleware",i),this.queue.started?(this.queue.push(this.resources[t]),this._progressChunk=(100-this.progress)/(this.queue.length()+this.queue.running())):(this._buffer.push(this.resources[t]),this._progressChunk=100/this._buffer.length),this},r.prototype.before=r.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},r.prototype.after=r.prototype.use=function(t){return this._afterMiddleware.push(t),this},r.prototype.reset=function(){this._buffer.length=0,this.queue.kill(),this.queue.started=!1,this.progress=0,this._progressChunk=0,this.loading=!1},r.prototype.load=function(t){if("function"==typeof t&&this.once("complete",t),this.queue.started)return this;this.queue.drain=this._boundOnComplete,this.emit("start",this);for(var e=0;e<this._buffer.length;++e)this.queue.push(this._buffer[e]);return this._buffer.length=0,this},r.prototype.loadResource=function(t,e){var r=this;this._runMiddleware(t,this._beforeMiddleware,function(){t.once("complete",r._onLoad.bind(r,t,e)),t.load()})},r.prototype._onComplete=function(){this.emit("complete",this,this.resources)},r.prototype._onLoad=function(t,e){this.progress+=this._progressChunk,this.emit("progress",this,t),t.error?this.emit("error",t.error,this,t):this.emit("load",this,t),this._runMiddleware(t,this._afterMiddleware,function(){t.emit("afterMiddleware",t),e&&e()})},r.prototype._runMiddleware=function(t,e,r){var n=this;i.eachSeries(e,function(e,r){e.call(n,t,r)},r.bind(this,t))},r.LOAD_TYPE=n.LOAD_TYPE,r.XHR_READY_STATE=n.XHR_READY_STATE,r.XHR_RESPONSE_TYPE=n.XHR_RESPONSE_TYPE},{"./Resource":6,async:1,eventemitter2:4}],6:[function(t,e){function r(t,e,i){if(n.call(this),i=i||{},"string"!=typeof t||"string"!=typeof e)throw new Error("Both name and url are required for constructing a resource.");this.name=t,this.url=e,this.data=null,this.crossOrigin=i.crossOrigin,this.loadType=i.loadType||r.LOAD_TYPE.XHR,this.xhrType=i.xhrType,this.error=null,this.xhr=null,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this._boundXdrOnTimeout=this._xdrOnTimeout.bind(this)}function i(t){return t.toString().replace("object ","")}var n=t("eventemitter2").EventEmitter2,o=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest);r.prototype=Object.create(n.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.complete=function(){this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError),this.data.removeEventListener("load",this._boundComplete),this.data.removeEventListener("progress",this._boundOnProgress),this.data.removeEventListener("canplaythrough",this._boundComplete)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError),this.xhr.removeEventListener("abort",this._boundXhrOnAbort),this.xhr.removeEventListener("progress",this._boundOnProgress),this.xhr.removeEventListener("load",this._boundXhrOnLoad)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null)),this.emit("complete",this)},r.prototype.load=function(){switch(this.emit("start",this),"string"!=typeof this.crossOrigin&&(this.crossOrigin=this._determineCrossOrigin()),this.loadType){case r.LOAD_TYPE.IMAGE:this._loadImage();break;case r.LOAD_TYPE.AUDIO:this._loadElement("audio");break;case r.LOAD_TYPE.VIDEO:this._loadElement("video");break;case r.LOAD_TYPE.XHR:default:o?this._loadXdr():this._loadXhr()}},r.prototype._loadImage=function(){this.data=new Image,this.crossOrigin&&(this.data.crossOrigin=""),this.data.src=this.url,this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1)},r.prototype._loadElement=function(t){if(this.data=document.createElement(t),Array.isArray(this.url))for(var e=0;e<this.url.length;++e)this.data.appendChild(this._createSource(t,this.url[e]));else this.data.appendChild(this._createSource(t,this.url));this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load()},r.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;t.open("GET",this.url,!0),t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},r.prototype._loadXdr=function(){var t=this.xhr=new XDomainRequest;t.timeout=5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXdrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){t.send()},0)},r.prototype._createSource=function(t,e,r){r||(r=t+"/"+e.substr(e.lastIndexOf(".")+1));var i=document.createElement("source");return i.src=e,i.type=r,i},r.prototype._onError=function(t){this.error=new Error("Failed to load element using "+t.target.nodeName),this.complete()},r.prototype._onProgress=function(t){t.lengthComputable&&this.emit("progress",this,t.loaded/t.total)},r.prototype._xhrOnError=function(t){this.error=new Error(i(t.target)+" Request failed. Status: "+t.target.status+', text: "'+t.target.statusText+'"'),this.complete()},r.prototype._xhrOnAbort=function(t){this.error=new Error(i(t.target)+" Request was aborted by the user."),this.complete()},r.prototype._xdrOnTimeout=function(t){this.error=new Error(i(t.target)+" Request timed out."),this.complete()},r.prototype._xhrOnLoad=function(t){var e=t.target;200===e.status?this.data=this.xhrType===r.XHR_RESPONSE_TYPE.TEXT?e.responseText:this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?e.responseXML||e.response:e.response:this.error=new Error("["+e.status+"]"+e.statusText+":"+e.responseURL),this.complete()},r.prototype._determineCrossOrigin=function(){if(0===this.url.indexOf("data:"))return"";var t=window.location,e=document.createElement("a");return e.href=this.url,e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""},r.prototype._determineXhrType=function(){var t=this.url.substr(this.url.lastIndexOf(".")+1);switch(t){case"xhtml":case"html":case"htm":case"xml":case"tmx":case"tsx":case"svg":return r.XHR_RESPONSE_TYPE.DOCUMENT;case"gif":case"png":case"jpg":case"jpeg":case"tif":case"tiff":case"webp":return r.XHR_RESPONSE_TYPE.BLOB;case"json":return r.XHR_RESPONSE_TYPE.JSON;case"text":case"txt":default:return r.XHR_RESPONSE_TYPE.TEXT}},r.prototype._getMimeFromXhrType=function(t){switch(t){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},r.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},r.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"}},{eventemitter2:4}],7:[function(t,e){e.exports=t("./Loader"),e.exports.Resource=t("./Resource"),e.exports.middleware={caching:{memory:t("./middlewares/caching/memory")},parsing:{json:t("./middlewares/parsing/json"),blob:t("./middlewares/parsing/blob")}}},{"./Loader":5,"./Resource":6,"./middlewares/caching/memory":8,"./middlewares/parsing/blob":9,"./middlewares/parsing/json":10}],8:[function(t,e){var r={};e.exports=function(){return function(t,e){r[t.url]?(t.data=r[t.url],t.complete()):(t.once("complete",function(){r[this.url]=this.data}),e())}}},{}],9:[function(t,e){var r=t("../../Resource");window.URL=window.URL||window.webkitURL,e.exports=function(){return function(t,e){if(t.xhr&&t.xhrType===r.XHR_RESPONSE_TYPE.BLOB){if(0===t.data.type.indexOf("image")){var i=URL.createObjectURL(t.data);t.data=new Image,t.data.src=i,t.data.onload=function(){URL.revokeObjectURL(i),t.data.onload=null,e()}}}else e()}}},{"../../Resource":6}],10:[function(t,e){e.exports=function(){return function(t,e){if("string"==typeof t.data)try{t.data=JSON.parse(t.data)}catch(r){}e()}}},{}],11:[function(t,e){e.exports={name:"pixi.js",version:"3.0.0-rc2",description:"Pixi.js is a fast lightweight 2D library that works across all devices.",author:"Mat Groves",contributors:["Chad Engler <chad@pantherdev.com>","Richard Davey <rdavey@gmail.com>"],main:"./src/index.js",homepage:"http://goodboydigital.com/",bugs:"https://github.com/GoodBoyDigital/pixi.js/issues",license:"MIT",repository:{type:"git",url:"https://github.com/GoodBoyDigital/pixi.js.git"},scripts:{test:"gulp test",docs:"./node_modules/.bin/jsdoc -c ./gulp/util/jsdoc.conf.json"},devDependencies:{browserify:"^8.0.2",chai:"^1.10.0",del:"^1.1.0",exorcist:"^0.1.6",gulp:"^3.8.10","gulp-cached":"^1.0.1","gulp-concat":"^2.5.2","gulp-debug":"^2.0.0","gulp-jsdoc":"^0.1.4","gulp-jshint":"^1.9.0","gulp-plumber":"^0.6.6","gulp-rename":"^1.2.0","gulp-uglify":"^1.0.2","gulp-util":"^3.0.1","ink-docstrap":"^0.5.2",jsdoc:"^3.3.0-alpha13","jshint-summary":"^0.4.0",karma:"^0.12.28","karma-firefox-launcher":"^0.1.0","karma-mocha":"^0.1.10","karma-spec-reporter":"^0.0.16",minimist:"^1.1.0",mocha:"^2.1.0","require-dir":"^0.1.0","run-sequence":"^1.0.2","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0",watchify:"^2.2.1"},dependencies:{async:"^0.9.0","resource-loader":"^1.2.2",brfs:"^1.2.0"},browserify:{transform:["brfs"]}} },{}],12:[function(t,e){e.exports={VERSION:t("../../package.json").version,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3}},{"../../package.json":11}],13:[function(t,e){function r(){n.call(this),this.children=[]}var i=t("../math"),n=t("./DisplayObject"),o=t("../textures/RenderTexture"),s=new i.Matrix;r.prototype=Object.create(n.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}}),r.prototype.addChild=function(t){return this.addChildAt(t,this.children.length)},r.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},r.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(0>r||0>i)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t}},r.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},r.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);this.children.splice(r,1),this.children.splice(e,0,t)},r.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},r.prototype.removeChild=function(t){var e=this.children.indexOf(t);if(-1!==e)return this.removeChildAt(e)},r.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),e},r.prototype.removeChildren=function(t,e){var r=t||0,i="number"==typeof e?e:this.children.length,n=i-r;if(n>0&&i>=n){for(var o=this.children.splice(r,n),s=0;s<o.length;++s)o[s].parent=null;return o}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},r.prototype.generateTexture=function(t,e,r){var i=this.getLocalBounds(),n=new o(t,0|i.width,0|i.height,t,r,e);return s.tx=-i.x,s.ty=-i.y,n.render(this,s),n},r.prototype.updateTransform=function(){if(this.visible){this.displayObjectUpdateTransform();for(var t=0,e=this.children.length;e>t;++t)this.children[t].updateTransform()}},r.prototype.containerUpdateTransform=r.prototype.updateTransform,r.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var t,e,r,n=1/0,o=1/0,s=-1/0,a=-1/0,h=!1,l=0,u=this.children.length;u>l;++l){var c=this.children[l];c.visible&&(h=!0,t=this.children[l].getBounds(),n=n<t.x?n:t.x,o=o<t.y?o:t.y,e=t.width+t.x,r=t.height+t.y,s=s>e?s:e,a=a>r?a:r)}if(!h)return i.Rectangle.EMPTY;var d=this._bounds;d.x=n,d.y=o,d.width=s-n,d.height=a-o,this._currentBounds=d}return this._currentBounds},r.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds()},r.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},r.prototype._renderWebGL=function(){},r.prototype._renderCanvas=function(){},r.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},r.prototype.destroy=function(){this.children=null}},{"../math":22,"../textures/RenderTexture":59,"./DisplayObject":14}],14:[function(t,e){function r(){this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var i=t("../math"),n=t("../utils"),o=t("../textures/RenderTexture"),s=new i.Matrix;r.prototype.constructor=r,n.eventTarget.mixin(r.prototype),e.exports=r,Object.defineProperties(r.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),r.prototype.updateTransform=function(){var t,e,r,n,o,s,a=this.parent.worldTransform,h=this.worldTransform;this.rotation%i.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,n=this._cr*this.scale.y,o=this.position.x,s=this.position.y,(this.pivot.x||this.pivot.y)&&(o-=this.pivot.x*t+this.pivot.y*r,s-=this.pivot.x*e+this.pivot.y*n),h.a=t*a.a+e*a.c,h.b=t*a.b+e*a.d,h.c=r*a.a+n*a.c,h.d=r*a.b+n*a.d,h.tx=o*a.a+s*a.c+a.tx,h.ty=o*a.b+s*a.d+a.ty):(t=this.scale.x,n=this.scale.y,o=this.position.x-this.pivot.x*t,s=this.position.y-this.pivot.y*n,h.a=t*a.a,h.b=t*a.b,h.c=n*a.c,h.d=n*a.d,h.tx=o*a.a+s*a.c+a.tx,h.ty=o*a.b+s*a.d+a.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},r.prototype.displayObjectUpdateTransform=r.prototype.updateTransform,r.prototype.getBounds=function(){return i.Rectangle.EMPTY},r.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},r.prototype.toGlobal=function(t){return this.displayObjectUpdateTransform(),this.worldTransform.apply(t)},r.prototype.toLocal=function(t,e){return e&&(t=e.toGlobal(t)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(t)},r.prototype.renderWebGL=function(){},r.prototype.renderCanvas=function(){},r.prototype.generateTexture=function(t,e,r){var i=this.getLocalBounds(),n=new o(t,0|i.width,0|i.height,t,r,e);return s.tx=-i.x,s.ty=-i.y,n.render(this,s),n},r.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null,this.listeners=null}},{"../math":22,"../textures/RenderTexture":59,"../utils":66}],15:[function(t,e){function r(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.cachedSpriteDirty=!1}var i=t("../display/Container"),n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),h=t("./GraphicsData"),l=t("../math"),u=t("../const"),c=new l.Point;r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{}),r.prototype.clone=function(){var t=new r;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=this.dirty,t.glDirty=this.glDirty,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e<this.graphicsData.length;++e)t.graphicsData.push(this.graphicsData.clone());return t.currentPath=t.graphicsData[t.graphicsData.length-1],t.updateLocalBounds(),t},r.prototype.lineStyle=function(t,e,r){return this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=arguments.length<3?1:r,this.currentPath&&(this.currentPath.shape.points.length?this.drawShape(new l.Polygon(this.currentPath.shape.points.slice(-2))):(this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha)),this},r.prototype.moveTo=function(t,e){return this.drawShape(new l.Polygon([t,e])),this},r.prototype.lineTo=function(t,e){return this.currentPath.shape.points.push(t,e),this.dirty=!0,this},r.prototype.quadraticCurveTo=function(t,e,r,i){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var n,o,s=20,a=this.currentPath.shape.points;0===a.length&&this.moveTo(0,0);for(var h=a[a.length-2],l=a[a.length-1],u=0,c=1;s>=c;++c)u=c/s,n=h+(t-h)*u,o=l+(e-l)*u,a.push(n+(t+(r-t)*u-n)*u,o+(e+(i-e)*u-o)*u);return this.dirty=!0,this},r.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,h,l,u,c=20,d=this.currentPath.shape.points,p=d[d.length-2],f=d[d.length-1],g=0,v=1;c>=v;++v)g=v/c,s=1-g,a=s*s,h=a*s,l=g*g,u=l*g,d.push(h*p+3*a*g*t+3*s*l*r+u*n,h*f+3*a*g*e+3*s*l*i+u*o);return this.dirty=!0,this},r.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,l=s-t,u=i-e,c=r-t,d=Math.abs(h*c-l*u);if(1e-8>d||0===n)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var p=h*h+l*l,f=u*u+c*c,g=h*u+l*c,v=n*Math.sqrt(p)/d,m=n*Math.sqrt(f)/d,y=v*g/p,x=m*g/f,b=v*c+m*l,T=v*u+m*h,_=l*(m+y),E=h*(m+y),w=c*(v+x),S=u*(v+x),A=Math.atan2(E-T,_-b),C=Math.atan2(S-T,w-b);this.arc(b+t,T+e,n,A,C,l*u>c*h)}return this.dirty=!0,this},r.prototype.arc=function(t,e,r,i,n,o){var s,a=t+Math.cos(i)*r,h=e+Math.sin(i)*r;if(this.currentPath?(s=this.currentPath.shape.points,0===s.length?s.push(a,h):(s[s.length-2]!==a||s[s.length-1]!==h)&&s.push(a,h)):(this.moveTo(a,h),s=this.currentPath.shape.points),i===n)return this;!o&&i>=n?n+=2*Math.PI:o&&n>=i&&(i+=2*Math.PI);var l=o?-1*(i-n):n-i,u=40*Math.ceil(Math.abs(l)/(2*Math.PI));if(0===l)return this;for(var c=l/(2*u),d=2*c,p=Math.cos(c),f=Math.sin(c),g=u-1,v=g%1/g,m=0;g>=m;m++){var y=m+v*m,x=c+i+d*y,b=Math.cos(x),T=-Math.sin(x);s.push((p*b+f*T)*r+t,(p*-T+f*b)*r+e)}return this.dirty=!0,this},r.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},r.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},r.prototype.drawRect=function(t,e,r,i){return this.drawShape(new l.Rectangle(t,e,r,i)),this},r.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new l.RoundedRectangle(t,e,r,i,n)),this},r.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},r.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new l.Ellipse(t,e,r,i)),this},r.prototype.drawPolygon=function(t){return t instanceof Array||(t=Array.prototype.slice.call(arguments)),this.drawShape(new l.Polygon(t)),this},r.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},r.prototype.generateTexture=function(t,e){t=t||1;var r=this.getBounds(),i=new s(r.width*t,r.height*t),n=o.fromCanvas(i.canvas,e);return n.baseTexture.resolution=t,i.context.scale(t,t),i.context.translate(-r.x,-r.y),a.renderGraphics(this,i.context),n},r.prototype._renderWebGL=function(t){this.glDirty&&(this.dirty=!0,this.glDirty=!1),t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this)},r.prototype._renderCanvas=function(t){if(this.isMask!==!0){if(this._prevTint!==this.tint&&(this.dirty=!0,this._prevTint=this.tint),this._cacheAsBitmap)return(this.dirty||this.cachedSpriteDirty)&&(this._generateCachedSprite(),this.updateCachedSpriteTexture(),this.cachedSpriteDirty=!1,this.dirty=!1),this._cachedSprite.alpha=this.alpha,void n.prototype._renderCanvas.call(this._cachedSprite,t);var e=t.context,r=this.worldTransform;this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,e.globalCompositeOperation=t.blendModes[t.currentBlendMode]);var i=t.resolution;e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i),a.renderGraphics(this,e)}},r.prototype.getBounds=function(t){if(!this._currentBounds){if(!this.renderable)return l.Rectangle.EMPTY;this.dirty&&(this.updateLocalBounds(),this.glDirty=!0,this.cachedSpriteDirty=!0,this.dirty=!1);var e=this._localBounds,r=e.x,i=e.width+e.x,n=e.y,o=e.height+e.y,s=t||this.worldTransform,a=s.a,h=s.b,u=s.c,c=s.d,d=s.tx,p=s.ty,f=a*i+u*o+d,g=c*o+h*i+p,v=a*r+u*o+d,m=c*o+h*r+p,y=a*r+u*n+d,x=c*n+h*r+p,b=a*i+u*n+d,T=c*n+h*i+p,_=f,E=g,w=f,S=g;w=w>v?v:w,w=w>y?y:w,w=w>b?b:w,S=S>m?m:S,S=S>x?x:S,S=S>T?T:S,_=v>_?v:_,_=y>_?y:_,_=b>_?b:_,E=m>E?m:E,E=x>E?x:E,E=T>E?T:E,this._bounds.x=w,this._bounds.width=_-w,this._bounds.y=S,this._bounds.height=E-S,this._currentBounds=this._bounds}return this._currentBounds},r.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;r<e.length;r++){var i=e[r];if(i.fill&&i.shape&&i.shape.contains(c.x,c.y))return!0}return!1},r.prototype.updateLocalBounds=function(){var t=1/0,e=-1/0,r=1/0,i=-1/0;if(this.graphicsData.length)for(var n,o,s,a,h,l,c=0;c<this.graphicsData.length;c++){var d=this.graphicsData[c],p=d.type,f=d.lineWidth;if(n=d.shape,p===u.SHAPES.RECT||p===u.SHAPES.RREC)s=n.x-f/2,a=n.y-f/2,h=n.width+f,l=n.height+f,t=t>s?s:t,e=s+h>e?s+h:e,r=r>a?a:r,i=a+l>i?a+l:i;else if(p===u.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,l=n.radius+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,i=a+l>i?a+l:i;else if(p===u.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,l=n.height+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-l?a-l:r,i=a+l>i?a+l:i;else{o=n.points;for(var g=0;g<o.length;g+=2)s=o[g],a=o[g+1],t=t>s-f?s-f:t,e=s+f>e?s+f:e,r=r>a-f?a-f:r,i=a+f>i?a+f:i}}else t=0,e=0,r=0,i=0;var v=this.boundsPadding;this._localBounds.x=t-v,this._localBounds.width=e-t+2*v,this._localBounds.y=r-v,this._localBounds.height=i-r+2*v},r.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===u.SHAPES.POLY&&(e.shape.closed=this.filling,this.currentPath=e),this.dirty=!0,e}},{"../const":12,"../display/Container":13,"../math":22,"../renderers/canvas/utils/CanvasBuffer":34,"../renderers/canvas/utils/CanvasGraphics":35,"../sprites/Sprite":56,"../textures/Texture":60,"./GraphicsData":16}],16:[function(t,e){function r(t,e,r,i,n,o,s){this.lineWidth=t,this.lineColor=e,this.lineAlpha=r,this._lineTint=e,this.fillColor=i,this.fillAlpha=n,this._fillTint=i,this.fill=o,this.shape=s,this.type=s.type}r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)}},{}],17:[function(t,e){function r(t){s.call(this,t),this.graphicsDataPool=[],this.primitiveShader=null,this.complexPrimitiveShader=null}var i=t("../../utils"),n=t("../../math"),o=t("../../const"),s=t("../../renderers/webgl/utils/ObjectRenderer"),a=t("../../renderers/webgl/WebGLRenderer"),h=t("./WebGLGraphicsData");r.prototype=Object.create(s.prototype),r.prototype.constructor=r,e.exports=r,a.registerPlugin("graphics",r),r.prototype.onContextChange=function(){},r.prototype.destroy=function(){s.prototype.destroy.call(this),this.graphicsDataPool=null},r.prototype.render=function(t){var e,r=this.renderer,n=r.gl,o=r.shaderManager.plugins.primitiveShader;t.dirty&&this.updateGraphics(t,n);var s=t._webGL[n.id];r.blendModeManager.setBlendMode(t.blendMode);for(var a=0;a<s.data.length;a++)1===s.data[a].mode?(e=s.data[a],r.stencilManager.pushStencil(t,e,r),n.drawElements(n.TRIANGLE_FAN,4,n.UNSIGNED_SHORT,2*(e.indices.length-4)),r.stencilManager.popStencil(t,e,r)):(e=s.data[a],o=r.shaderManager.primitiveShader,r.shaderManager.setShader(o),n.uniformMatrix3fv(o.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),n.uniformMatrix3fv(o.uniforms.projectionMatrix._location,!1,r.currentRenderTarget.projectionMatrix.toArray(!0)),n.uniform3fv(o.uniforms.tint._location,i.hex2rgb(t.tint)),n.uniform1f(o.uniforms.alpha._location,t.worldAlpha),n.bindBuffer(n.ARRAY_BUFFER,e.buffer),n.vertexAttribPointer(o.attributes.aVertexPosition,2,n.FLOAT,!1,24,0),n.vertexAttribPointer(o.attributes.aColor,4,n.FLOAT,!1,24,8),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.indexBuffer),n.drawElements(n.TRIANGLE_STRIP,e.indices.length,n.UNSIGNED_SHORT,0))},r.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[e.id];r||(r=t._webGL[e.id]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i<r.data.length;i++){var n=r.data[i];n.reset(),this.graphicsDataPool.push(n)}r.data=[],r.lastIndex=0}var s;for(i=r.lastIndex;i<t.graphicsData.length;i++){var a=t.graphicsData[i];if(a.type===o.SHAPES.POLY){if(a.points=a.shape.points.slice(),a.shape.closed&&(a.points[0]!==a.points[a.points.length-2]||a.points[1]!==a.points[a.points.length-1])&&a.points.push(a.points[0],a.points[1]),a.fill&&a.points.length>=6)if(a.points.length<12){s=this.switchMode(r,0);var h=this.buildPoly(a,s);h||(s=this.switchMode(r,1),this.buildComplexPoly(a,s))}else s=this.switchMode(r,1),this.buildComplexPoly(a,s);a.lineWidth>0&&(s=this.switchMode(r,0),this.buildLine(a,s))}else s=this.switchMode(r,0),a.type===o.SHAPES.RECT?this.buildRectangle(a,s):a.type===o.SHAPES.CIRC||a.type===o.SHAPES.ELIP?this.buildCircle(a,s):a.type===o.SHAPES.RREC&&this.buildRoundedRectangle(a,s);r.lastIndex++}for(i=0;i<r.data.length;i++)s=r.data[i],s.dirty&&s.upload()},r.prototype.switchMode=function(t,e){var r;return t.data.length?(r=t.data[t.data.length-1],(r.points.length>32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new h(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new h(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},r.prototype.buildRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var h=i.hex2rgb(t.fillColor),l=t.fillAlpha,u=h[0]*l,c=h[1]*l,d=h[2]*l,p=e.points,f=e.indices,g=p.length/6;p.push(n,o),p.push(u,c,d,l),p.push(n+s,o),p.push(u,c,d,l),p.push(n,o+a),p.push(u,c,d,l),p.push(n+s,o+a),p.push(u,c,d,l),f.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var v=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],this.buildLine(t,e),t.points=v}},r.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,n=r.x,o=r.y,s=r.width,a=r.height,h=r.radius,l=[];if(l.push(n,o+h),l=l.concat(this.quadraticBezierCurve(n,o+a-h,n,o+a,n+h,o+a)),l=l.concat(this.quadraticBezierCurve(n+s-h,o+a,n+s,o+a,n+s,o+a-h)),l=l.concat(this.quadraticBezierCurve(n+s,o+h,n+s,o,n+s-h,o)),l=l.concat(this.quadraticBezierCurve(n+h,o,n,o,n,o+h)),t.fill){var u=i.hex2rgb(t.fillColor),c=t.fillAlpha,d=u[0]*c,p=u[1]*c,f=u[2]*c,g=e.points,v=e.indices,m=g.length/6,y=i.PolyK.Triangulate(l),x=0;for(x=0;x<y.length;x+=3)v.push(y[x]+m),v.push(y[x]+m),v.push(y[x+1]+m),v.push(y[x+2]+m),v.push(y[x+2]+m);for(x=0;x<l.length;x++)g.push(l[x],l[++x],d,p,f,c)}if(t.lineWidth){var b=t.points;t.points=l,this.buildLine(t,e),t.points=b}},r.prototype.quadraticBezierCurve=function(t,e,r,i,n,o){function s(t,e,r){var i=e-t;return t+i*r}for(var a,h,l,u,c,d,p=20,f=[],g=0,v=0;p>=v;v++)g=v/p,a=s(t,r,g),h=s(e,i,g),l=s(r,n,g),u=s(i,o,g),c=s(a,l,g),d=s(h,u,g),f.push(c,d);return f},r.prototype.buildCircle=function(t,e){var r,n,s=t.shape,a=s.x,h=s.y;t.type===o.SHAPES.CIRC?(r=s.radius,n=s.radius):(r=s.width,n=s.height);var l=40,u=2*Math.PI/l,c=0;if(t.fill){var d=i.hex2rgb(t.fillColor),p=t.fillAlpha,f=d[0]*p,g=d[1]*p,v=d[2]*p,m=e.points,y=e.indices,x=m.length/6;for(y.push(x),c=0;l+1>c;c++)m.push(a,h,f,g,v,p),m.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n,f,g,v,p),y.push(x++,x++);y.push(x-1)}if(t.lineWidth){var b=t.points;for(t.points=[],c=0;l+1>c;c++)t.points.push(a+Math.sin(u*c)*r,h+Math.cos(u*c)*n);this.buildLine(t,e),t.points=b}},r.prototype.buildLine=function(t,e){var r=0,o=t.points;if(0!==o.length){if(t.lineWidth%2)for(r=0;r<o.length;r++)o[r]+=.5;var s=new n.Point(o[0],o[1]),a=new n.Point(o[o.length-2],o[o.length-1]);if(s.x===a.x&&s.y===a.y){o=o.slice(),o.pop(),o.pop(),a=new n.Point(o[o.length-2],o[o.length-1]);var h=a.x+.5*(s.x-a.x),l=a.y+.5*(s.y-a.y);o.unshift(h,l),o.push(h,l)}var u,c,d,p,f,g,v,m,y,x,b,T,_,E,w,S,A,C,M,R,F,D,O,P=e.points,B=e.indices,L=o.length/2,I=o.length,N=P.length/6,k=t.lineWidth/2,U=i.hex2rgb(t.lineColor),j=t.lineAlpha,X=U[0]*j,Y=U[1]*j,W=U[2]*j;for(d=o[0],p=o[1],f=o[2],g=o[3],y=-(p-g),x=d-f,O=Math.sqrt(y*y+x*x),y/=O,x/=O,y*=k,x*=k,P.push(d-y,p-x,X,Y,W,j),P.push(d+y,p+x,X,Y,W,j),r=1;L-1>r;r++)d=o[2*(r-1)],p=o[2*(r-1)+1],f=o[2*r],g=o[2*r+1],v=o[2*(r+1)],m=o[2*(r+1)+1],y=-(p-g),x=d-f,O=Math.sqrt(y*y+x*x),y/=O,x/=O,y*=k,x*=k,b=-(g-m),T=f-v,O=Math.sqrt(b*b+T*T),b/=O,T/=O,b*=k,T*=k,w=-x+p-(-x+g),S=-y+f-(-y+d),A=(-y+d)*(-x+g)-(-y+f)*(-x+p),C=-T+m-(-T+g),M=-b+f-(-b+v),R=(-b+v)*(-T+g)-(-b+f)*(-T+m),F=w*M-C*S,Math.abs(F)<.1?(F+=10.1,P.push(f-y,g-x,X,Y,W,j),P.push(f+y,g+x,X,Y,W,j)):(u=(S*R-M*A)/F,c=(C*A-w*R)/F,D=(u-f)*(u-f)+(c-g)+(c-g),D>19600?(_=y-b,E=x-T,O=Math.sqrt(_*_+E*E),_/=O,E/=O,_*=k,E*=k,P.push(f-_,g-E),P.push(X,Y,W,j),P.push(f+_,g+E),P.push(X,Y,W,j),P.push(f-_,g-E),P.push(X,Y,W,j),I++):(P.push(u,c),P.push(X,Y,W,j),P.push(f-(u-f),g-(c-g)),P.push(X,Y,W,j)));for(d=o[2*(L-2)],p=o[2*(L-2)+1],f=o[2*(L-1)],g=o[2*(L-1)+1],y=-(p-g),x=d-f,O=Math.sqrt(y*y+x*x),y/=O,x/=O,y*=k,x*=k,P.push(f-y,g-x),P.push(X,Y,W,j),P.push(f+y,g+x),P.push(X,Y,W,j),B.push(N),r=0;I>r;r++)B.push(N++);B.push(N-1)}},r.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var n=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=i.hex2rgb(t.fillColor);for(var o,s,a=1/0,h=-1/0,l=1/0,u=-1/0,c=0;c<r.length;c+=2)o=r[c],s=r[c+1],a=a>o?o:a,h=o>h?o:h,l=l>s?s:l,u=s>u?s:u;r.push(a,l,h,l,h,u,a,u);var d=r.length/2;for(c=0;d>c;c++)n.push(c)}},r.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var n=e.points,o=e.indices,s=r.length/2,a=i.hex2rgb(t.fillColor),h=t.fillAlpha,l=a[0]*h,u=a[1]*h,c=a[2]*h,d=i.PolyK.Triangulate(r);if(!d)return!1;var p=n.length/6,f=0;for(f=0;f<d.length;f+=3)o.push(d[f]+p),o.push(d[f]+p),o.push(d[f+1]+p),o.push(d[f+2]+p),o.push(d[f+2]+p);for(f=0;s>f;f++)n.push(r[2*f],r[2*f+1],l,u,c,h);return!0}}},{"../../const":12,"../../math":22,"../../renderers/webgl/WebGLRenderer":38,"../../renderers/webgl/utils/ObjectRenderer":52,"../../utils":66,"./WebGLGraphicsData":18}],18:[function(t,e){function r(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0}r.prototype.constructor=r,e.exports=r,r.prototype.reset=function(){this.points=[],this.indices=[]},r.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1}},{}],19:[function(t,e){function r(){try{if(!window.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),e=t.getContext("webgl",s)||t.getContext("experimental-webgl",s);return!(!e||!e.getContextAttributes().stencil)}catch(r){return!1}}var i=e.exports={utils:t("./utils"),math:t("./math"),CONST:t("./const"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Stage:t("./display/Container"),DisplayObjectContainer:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),autoDetectRenderer:function(t,e,n,o){return t=t||800,e=e||600,!o&&r()?new i.WebGLRenderer(t,e,n):new i.CanvasRenderer(t,e,n)}},n=t("./const");for(var o in n)i[o]=n[o];var s={stencil:!0}},{"./const":12,"./display/Container":13,"./display/DisplayObject":14,"./graphics/Graphics":15,"./graphics/GraphicsData":16,"./graphics/webgl/GraphicsRenderer":17,"./math":22,"./particles/ParticleContainer":28,"./particles/webgl/ParticleRenderer":30,"./renderers/canvas/CanvasRenderer":33,"./renderers/canvas/utils/CanvasBuffer":34,"./renderers/canvas/utils/CanvasGraphics":35,"./renderers/webgl/WebGLRenderer":38,"./renderers/webgl/filters/AbstractFilter":39,"./renderers/webgl/managers/ShaderManager":45,"./renderers/webgl/shaders/Shader":50,"./sprites/Sprite":56,"./sprites/webgl/SpriteRenderer":57,"./textures/BaseTexture":58,"./textures/RenderTexture":59,"./textures/Texture":60,"./textures/VideoBaseTexture":62,"./utils":66}],20:[function(t,e){function r(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var i=t("./Point");r.prototype.constructor=r,e.exports=r,r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.toArray=function(t){this.array||(this.array=new Float32Array(9));var e=this.array;return t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,e[7]=this.ty,e[8]=1):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0,e[7]=0,e[8]=1),e},r.prototype.apply=function(t,e){e=e||new i;var r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new i;var r=1/(this.a*this.d+this.c*-this.b),n=t.x,o=t.y;return e.x=this.d*r*n+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*n+(-this.ty*this.a+this.tx*this.b)*r,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},r.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},r.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.IDENTITY=new r,r.TEMP_MATRIX=new r},{"./Point":21}],21:[function(t,e){function r(t,e){this.x=t||0,this.y=e||0}r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],22:[function(t,e){e.exports={PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,Point:t("./Point"),Matrix:t("./Matrix"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./Matrix":20,"./Point":21,"./shapes/Circle":23,"./shapes/Ellipse":24,"./shapes/Polygon":25,"./shapes/Rectangle":26,"./shapes/RoundedRectangle":27}],23:[function(t,e){function r(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=n.SHAPES.CIRC}var i=t("./Rectangle"),n=t("../../const");r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},r.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":12,"./Rectangle":26}],24:[function(t,e){function r(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.ELIP}var i=t("./Rectangle"),n=t("../../const");r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},r.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":12,"./Rectangle":26}],25:[function(t,e){function r(t){if(t instanceof Array||(t=Array.prototype.slice.call(arguments)),t[0]instanceof i){for(var e=[],r=0,o=t.length;o>r;r++)e.push(t[r].x,t[r].y);t=e}this.closed=!0,this.points=t,this.type=n.SHAPES.POLY}var i=t("../Point"),n=t("../../const");r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.points.slice())},r.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;i>n;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],l=this.points[2*o+1],u=a>e!=l>e&&(h-s)*(e-a)/(l-a)+s>t; u&&(r=!r)}return r}},{"../../const":12,"../Point":21}],26:[function(t,e){function r(t,e,r,n){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.type=i.SHAPES.RECT}var i=t("../../const");r.prototype.constructor=r,e.exports=r,r.EMPTY=new r(0,0,0,0),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height?!0:!1}},{"../../const":12}],27:[function(t,e){function r(t,e,r,n,o){this.x=t||0,this.y=e||0,this.width=r||0,this.height=n||0,this.radius=o||20,this.type=i.SHAPES.RREC}var i=t("../../const");r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":12}],28:[function(t,e){function r(t,e){i.call(this),this._properties=e||[!1,!0,!1,!1,!1],this._size=t||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1}var i=t("../display/Container");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.addChildAt=function(t,e){if(t===this)return t;if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this._updateStatic=!0,t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},r.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,this.children.splice(t,1),this._updateStatic=!0,e},r.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0;e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var n=0;n<this.children.length;++n){var o=this.children[n];if(o.visible){var s=o.texture.frame;if(e.globalAlpha=this.worldAlpha*o.alpha,o.rotation%(2*Math.PI)===0)i&&(e.setTransform(r.a,r.b,r.c,r.d,r.tx,r.ty),i=!1),e.drawImage(o.texture.baseTexture.source,s.x,s.y,s.width,s.height,o.anchor.x*-s.width*o.scale.x+o.position.x+.5|0,o.anchor.y*-s.height*o.scale.y+o.position.y+.5|0,s.width*o.scale.x,s.height*o.scale.y);else{i||(i=!0),o.displayObjectUpdateTransform();var a=o.worldTransform;t.roundPixels?e.setTransform(a.a,a.b,a.c,a.d,0|a.tx,0|a.ty):e.setTransform(a.a,a.b,a.c,a.d,a.tx,a.ty),e.drawImage(o.texture.baseTexture.source,s.x,s.y,s.width,s.height,o.anchor.x*-s.width+.5|0,o.anchor.y*-s.height+.5|0,s.width,s.height)}}}}}},{"../display/Container":13}],29:[function(t,e){function r(t,e,r){this.gl=t,this.vertSize=2,this.vertByteSize=4*this.vertSize,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<e.length;i++){var n=e[i];n.dynamic?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.initBuffers()}r.prototype.constructor=r,e.exports=r,r.prototype.initBuffers=function(){var t,e,r=this.gl,i=0;for(this.dynamicStride=0,t=0;t<this.dynamicProperties.length;t++)e=this.dynamicProperties[t],e.offset=i,i+=e.size,this.dynamicStride+=e.size;this.dynamicData=new Float32Array(this.size*this.dynamicStride*4),this.dynamicBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,this.dynamicBuffer),r.bufferData(r.ARRAY_BUFFER,this.dynamicData,r.DYNAMIC_DRAW);var n=0;for(this.staticStride=0,t=0;t<this.staticProperties.length;t++)e=this.staticProperties[t],e.offset=n,n+=e.size,this.staticStride+=e.size;this.staticData=new Float32Array(this.size*this.staticStride*4),this.staticBuffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,this.staticBuffer),r.bufferData(r.ARRAY_BUFFER,this.staticData,r.DYNAMIC_DRAW)},r.prototype.uploadDynamic=function(t,e,r){for(var i=this.gl,n=0;n<this.dynamicProperties.length;n++){var o=this.dynamicProperties[n];o.uploadFunction(t,e,r,this.dynamicData,this.dynamicStride,o.offset)}i.bindBuffer(i.ARRAY_BUFFER,this.dynamicBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,this.dynamicData)},r.prototype.uploadStatic=function(t,e,r){for(var i=this.gl,n=0;n<this.staticProperties.length;n++){var o=this.staticProperties[n];o.uploadFunction(t,e,r,this.staticData,this.staticStride,o.offset)}i.bindBuffer(i.ARRAY_BUFFER,this.staticBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,this.staticData)},r.prototype.bind=function(){var t,e,r=this.gl;for(r.bindBuffer(r.ARRAY_BUFFER,this.dynamicBuffer),t=0;t<this.dynamicProperties.length;t++)e=this.dynamicProperties[t],r.vertexAttribPointer(e.attribute,e.size,r.FLOAT,!1,4*this.dynamicStride,4*e.offset);for(r.bindBuffer(r.ARRAY_BUFFER,this.staticBuffer),t=0;t<this.staticProperties.length;t++)e=this.staticProperties[t],r.vertexAttribPointer(e.attribute,e.size,r.FLOAT,!1,4*this.staticStride,4*e.offset)},r.prototype.destroy=function(){}},{}],30:[function(t,e){function r(t){i.call(this,t),this.size=15e3;var e=6*this.size;this.indices=new Uint16Array(e);for(var r=0,n=0;e>r;r+=6,n+=4)this.indices[r+0]=n+0,this.indices[r+1]=n+1,this.indices[r+2]=n+2,this.indices[r+3]=n+0,this.indices[r+4]=n+2,this.indices[r+5]=n+3;this.shader=null,this.tempMatrix=new a.Matrix}var i=t("../../renderers/webgl/utils/ObjectRenderer"),n=t("../../renderers/webgl/WebGLRenderer"),o=t("./ParticleShader"),s=t("./ParticleBuffer"),a=t("../../math");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,n.registerPlugin("particle",r),r.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new o(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},r.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},r.prototype.render=function(t){var e=t.children,r=e.length,i=t._size;if(0!==r){r>i&&(r=i),t._buffers||(t._buffers=this.generateBuffers(t));var n=this.renderer.gl,o=t.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),n.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0));var s=t._updateStatic,a=e[0]._texture.baseTexture;a._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,a._glTextures[n.id]):(this.renderer.updateTexture(a),this.properties[0].dynamic&&this.properties[3].dynamic||(s=!0));for(var h=0,l=0;r>l;l+=this.size){var u=r-l;u>this.size&&(u=this.size);var c=t._buffers[h++];c.uploadDynamic(e,l,u),s&&c.uploadStatic(e,l,u),c.bind(this.shader),n.drawElements(n.TRIANGLES,6*u,n.UNSIGNED_SHORT,0),this.renderer.drawCount++}t._updateStatic=!1}},r.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._size;for(e=0;e<t._properties.length;e++)this.properties[e].dynamic=t._properties[e];for(e=0;n>e;e+=this.size)i.push(new s(r,this.properties,this.size,this.shader));return i},r.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,l,u,c,d,p,f,g=0;r>g;g++)s=t[e+g],a=s._texture,l=s.scale.x,u=s.scale.y,a.trim?(h=a.trim,d=h.x-s.anchor.x*h.width,c=d+a.crop.width,f=h.y-s.anchor.y*h.height,p=f+a.crop.height):(c=a._frame.width*(1-s.anchor.x),d=a._frame.width*-s.anchor.x,p=a._frame.height*(1-s.anchor.y),f=a._frame.height*-s.anchor.y),i[o]=d*l,i[o+1]=f*u,i[o+n]=c*l,i[o+n+1]=f*u,i[o+2*n]=c*l,i[o+2*n+1]=p*u,i[o+3*n]=d*l,i[o+3*n+1]=p*u,o+=4*n},r.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},r.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},r.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},r.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},r.prototype.destroy=function(){this.shader.destroy()}},{"../../math":22,"../../renderers/webgl/WebGLRenderer":38,"../../renderers/webgl/utils/ObjectRenderer":52,"./ParticleBuffer":29,"./ParticleShader":31}],31:[function(t,e){function r(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n"),null,{aPositionCoord:0,aRotation:0})}var i=t("../../renderers/webgl/shaders/TextureShader");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},{"../../renderers/webgl/shaders/TextureShader":51}],32:[function(t,e){function r(t,e,r,s){if(i.sayHello(t),s)for(var a in o.DEFAULT_RENDER_OPTIONS)"undefined"==typeof s[a]&&(s[a]=o.DEFAULT_RENDER_OPTIONS[a]);else s=o.DEFAULT_RENDER_OPTIONS;this.type=o.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=s.view||document.createElement("canvas"),this.resolution=s.resolution,this.transparent=s.transparent,this.autoResize=s.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=s.preserveDrawingBuffer,this.clearBeforeRender=s.clearBeforeRender,this._backgroundColor=16777215,this._backgroundColorRgb=[1,1,1],this._backgroundColorString="#000000",this.backgroundColor=s.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new n.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var i=t("../utils"),n=t("../math"),o=t("../const");r.prototype.constructor=r,e.exports=r,i.eventTarget.mixin(r.prototype),Object.defineProperties(r.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=i.hex2string(t),i.hex2rgb(t,this._backgroundColorRgb)}}}),r.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},r.prototype.destroy=function(t){t&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=o.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":12,"../math":22,"../utils":66}],33:[function(t,e){function r(t,e,r){i.call(this,"Canvas",t,e,r),this.type=a.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new n,this.roundPixels=!1,this.currentScaleMode=a.SCALE_MODES.DEFAULT,this.currentBlendMode=a.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new s.Matrix,worldAlpha:1},this.resize(t,e)}var i=t("../SystemRenderer"),n=t("./utils/CanvasMaskManager"),o=t("../../utils"),s=t("../../math"),a=t("../../const");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,o.pluginTarget.mixin(r),r.prototype.render=function(t){var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=a.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[a.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context)},r.prototype.destroy=function(t){this.destroyPlugins(),i.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},r.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},r.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},o.canUseNewCanvasBlendModes()?(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[a.BLEND_MODES.SCREEN]="screen",this.blendModes[a.BLEND_MODES.OVERLAY]="overlay",this.blendModes[a.BLEND_MODES.DARKEN]="darken",this.blendModes[a.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[a.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[a.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[a.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[a.BLEND_MODES.HUE]="hue",this.blendModes[a.BLEND_MODES.SATURATION]="saturation",this.blendModes[a.BLEND_MODES.COLOR]="color",this.blendModes[a.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[a.BLEND_MODES.SCREEN]="source-over",this.blendModes[a.BLEND_MODES.OVERLAY]="source-over",this.blendModes[a.BLEND_MODES.DARKEN]="source-over",this.blendModes[a.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[a.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[a.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[a.BLEND_MODES.HUE]="source-over",this.blendModes[a.BLEND_MODES.SATURATION]="source-over",this.blendModes[a.BLEND_MODES.COLOR]="source-over",this.blendModes[a.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":12,"../../math":22,"../../utils":66,"../SystemRenderer":32,"./utils/CanvasMaskManager":36}],34:[function(t,e){function r(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},r.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],35:[function(t,e){var r=t("../../../const"),i=e.exports={};i.renderGraphics=function(t,e){var i=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var n=0;n<t.graphicsData.length;n++){var o=t.graphicsData[n],s=o.shape,a=o._fillTint,h=o._lineTint;if(e.lineWidth=o.lineWidth,o.type===r.SHAPES.POLY){e.beginPath();var l=s.points;e.moveTo(l[0],l[1]);for(var u=1;u<l.length/2;u++)e.lineTo(l[2*u],l[2*u+1]);s.closed&&e.lineTo(l[0],l[1]),l[0]===l[l.length-2]&&l[1]===l[l.length-1]&&e.closePath(),o.fill&&(e.globalAlpha=o.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}else if(o.type===r.SHAPES.RECT)(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fillRect(s.x,s.y,s.width,s.height)),o.lineWidth&&(e.globalAlpha=o.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.strokeRect(s.x,s.y,s.width,s.height));else if(o.type===r.SHAPES.CIRC)e.beginPath(),e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath(),o.fill&&(e.globalAlpha=o.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke());else if(o.type===r.SHAPES.ELIP){var c=2*s.width,d=2*s.height,p=s.x-c/2,f=s.y-d/2;e.beginPath();var g=.5522848,v=c/2*g,m=d/2*g,y=p+c,x=f+d,b=p+c/2,T=f+d/2;e.moveTo(p,T),e.bezierCurveTo(p,T-m,b-v,f,b,f),e.bezierCurveTo(b+v,f,y,T-m,y,T),e.bezierCurveTo(y,T+m,b+v,x,b,x),e.bezierCurveTo(b-v,x,p,T+m,p,T),e.closePath(),o.fill&&(e.globalAlpha=o.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}else if(o.type===r.SHAPES.RREC){var _=s.x,E=s.y,w=s.width,S=s.height,A=s.radius,C=Math.min(w,S)/2|0;A=A>C?C:A,e.beginPath(),e.moveTo(_,E+A),e.lineTo(_,E+S-A),e.quadraticCurveTo(_,E+S,_+A,E+S),e.lineTo(_+w-A,E+S),e.quadraticCurveTo(_+w,E+S,_+w,E+S-A),e.lineTo(_+w,E+A),e.quadraticCurveTo(_+w,E,_+w-A,E),e.lineTo(_+A,E),e.quadraticCurveTo(_,E,_,E+A),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*i,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*i,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},i.renderGraphicsMask=function(t,e){var i=t.graphicsData.length;if(0!==i){e.beginPath();for(var n=0;i>n;n++){var o=t.graphicsData[n],s=o.shape;if(o.type===r.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;h<a.length/2;h++)e.lineTo(a[2*h],a[2*h+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(o.type===r.SHAPES.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(o.type===r.SHAPES.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(o.type===r.SHAPES.ELIP){var l=2*s.width,u=2*s.height,c=s.x-l/2,d=s.y-u/2,p=.5522848,f=l/2*p,g=u/2*p,v=c+l,m=d+u,y=c+l/2,x=d+u/2;e.moveTo(c,x),e.bezierCurveTo(c,x-g,y-f,d,y,d),e.bezierCurveTo(y+f,d,v,x-g,v,x),e.bezierCurveTo(v,x+g,y+f,m,y,m),e.bezierCurveTo(y-f,m,c,x+g,c,x),e.closePath()}else if(o.type===r.SHAPES.RREC){var b=s.x,T=s.y,_=s.width,E=s.height,w=s.radius,S=Math.min(_,E)/2|0;w=w>S?S:w,e.moveTo(b,T+w),e.lineTo(b,T+E-w),e.quadraticCurveTo(b,T+E,b+w,T+E),e.lineTo(b+_-w,T+E),e.quadraticCurveTo(b+_,T+E,b+_,T+E-w),e.lineTo(b+_,T+w),e.quadraticCurveTo(b+_,T,b+_-w,T),e.lineTo(b+w,T),e.quadraticCurveTo(b,T,b,T+w),e.closePath()}}}},i.updateGraphicsTint=function(t){if(16777215!==t.tint)for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n<t.graphicsData.length;n++){var o=t.graphicsData[n],s=0|o.fillColor,a=0|o.lineColor;o._fillTint=((s>>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}},{"../../../const":12}],36:[function(t,e){function r(){}var i=t("./CanvasGraphics");r.prototype.constructor=r,e.exports=r,r.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,n=t.worldTransform,o=e.resolution;e.context.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.texture||(i.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},r.prototype.popMask=function(t){t.context.restore()}},{"./CanvasGraphics":35}],37:[function(t,e){var r=t("../../../utils"),i=e.exports={};i.getTintedTexture=function(t,e){var r=t.texture;e=i.roundColor(e);var n="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[n])return r.tintCache[n];var o=i.canvas||document.createElement("canvas");if(i.tintMethod(r,e,o),i.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[n]=s}else r.tintCache[n]=o,i.canvas=null;return o},i.tintWithMultiply=function(t,e,r){var i=r.getContext("2d"),n=t.crop;r.width=n.width,r.height=n.height,i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height)},i.tintWithOverlay=function(t,e,r){var i=r.getContext("2d"),n=t.crop;r.width=n.width,r.height=n.height,i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height)},i.tintWithPerPixel=function(t,e,i){var n=i.getContext("2d"),o=t.crop;i.width=o.width,i.height=o.height,n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=r.hex2rgb(e),a=s[0],h=s[1],l=s[2],u=n.getImageData(0,0,o.width,o.height),c=u.data,d=0;d<c.length;d+=4)c[d+0]*=a,c[d+1]*=h,c[d+2]*=l;n.putImageData(u,0,0)},i.roundColor=function(t){var e=i.cacheStepsPerColorChannel,n=r.hex2rgb(t);return n[0]=Math.min(255,n[0]/e*e),n[1]=Math.min(255,n[1]/e*e),n[2]=Math.min(255,n[2]/e*e),r.rgb2hex(n)},i.cacheStepsPerColorChannel=8,i.convertTintToImage=!1,i.canUseMultiply=r.canUseNewCanvasBlendModes(),i.tintMethod=i.canUseMultiply?i.tintWithMultiply:i.tintWithPerPixel},{"../../../utils":66}],38:[function(t,e){function r(t,e,r){r=r||{},i.call(this,"WebGL",t,e,r),this.type=p.RENDERER_TYPE.WEBGL,this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),this._updateTextureBound=function(t){this.updateTexture(t.target)}.bind(this),this._destroyTextureBound=function(t){this.destroyTexture(t.target)}.bind(this),this.view.addEventListener("webglcontextlost",this.handleContextLost,!1),this.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1),this._useFXAA=!!r.forceFXAA&&r.antialias,this._FXAAFilter=null,this._contextOptions={alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer},this.drawCount=0,this.shaderManager=new n(this),this.maskManager=new o(this),this.stencilManager=new s(this),this.filterManager=new a(this),this.blendModeManager=new h(this),this.currentRenderTarget=this.renderTarget,this.currentRenderer=new u(this),this.initPlugins(),this._initContext(),this._mapBlendModes(),this._renderTargetStack=[]}var i=t("../SystemRenderer"),n=t("./managers/ShaderManager"),o=t("./managers/MaskManager"),s=t("./managers/StencilManager"),a=t("./managers/FilterManager"),h=t("./managers/BlendModeManager"),l=t("./utils/RenderTarget"),u=t("./utils/ObjectRenderer"),c=t("./filters/FXAAFilter"),d=t("../../utils"),p=t("../../const");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,d.pluginTarget.mixin(r),r.glContextId=0,r.prototype._initContext=function(){var t=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=t,!t)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=r.glContextId++,t.id=this.glContextId,t.renderer=this,t.disable(t.DEPTH_TEST),t.disable(t.CULL_FACE),t.enable(t.BLEND),this.renderTarget=new l(this.gl,this.width,this.height,null,this.resolution,!0),this.emit("context",t),this.resize(this.width,this.height),this._useFXAA||(this._useFXAA=this._contextOptions.antialias&&!t.getContextAttributes().antialias),this._useFXAA&&(window.console.warn("FXAA antialiasing being used instead of native antialiasing"),this._FXAAFilter=[new c])},r.prototype.render=function(t){if(!this.gl.isContextLost()){this._lastObjectRendered=t,this._useFXAA&&(this._FXAAFilter[0].uniforms.resolution.value.x=this.width,this._FXAAFilter[0].uniforms.resolution.value.y=this.height,t.filterArea=this.renderTarget.size,t.filters=this._FXAAFilter);var e=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e;var r=this.gl;this.setRenderTarget(this.renderTarget),this.clearBeforeRender&&(this.transparent?r.clearColor(0,0,0,0):r.clearColor(this._backgroundColorRgb[0],this._backgroundColorRgb[1],this._backgroundColorRgb[2],1),r.clear(r.COLOR_BUFFER_BIT)),this.renderDisplayObject(t,this.renderTarget)}},r.prototype.renderDisplayObject=function(t,e){this.setRenderTarget(e),this.filterManager.setFilterStack(e.filterStack),t.renderWebGL(this),this.currentRenderer.flush()},r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.setRenderTarget=function(t){this.currentRenderTarget!==t&&(this.currentRenderTarget=t,this.currentRenderTarget.activate(),this.stencilManager.setMaskStack(t.stencilMaskStack))},r.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.filterManager.resize(t,e),this.renderTarget.resize(t,e),this.currentRenderTarget===this.renderTarget&&this.renderTarget.activate()},r.prototype.updateTexture=function(t){if(t=t.baseTexture||t,t.hasLoaded){var e=this.gl;return t._glTextures[e.id]||(t._glTextures[e.id]=e.createTexture(),t.on("update",this._updateTextureBound),t.on("dispose",this._destroyTextureBound)),e.bindTexture(e.TEXTURE_2D,t._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t.scaleMode===p.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),t.mipmap&&t.isPowerOfTwo?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===p.SCALE_MODES.LINEAR?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST),e.generateMipmap(e.TEXTURE_2D)):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t.scaleMode===p.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),t.isPowerOfTwo?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),t._glTextures[e.id]}},r.prototype.destroyTexture=function(t){t=t.baseTexture||t,t.hasLoaded&&t._glTextures[this.gl.id]&&this.gl.deleteTexture(t._glTextures[this.gl.id])},r.prototype.handleContextLost=function(t){t.preventDefault()},r.prototype.handleContextRestored=function(){this._initContext();for(var t in d.BaseTextureCache)d.BaseTextureCache[t]._glTextures.length=0},r.prototype.destroy=function(t){this.destroyPlugins(),this.view.removeEventListener("webglcontextlost",this.handleContextLost),this.view.removeEventListener("webglcontextrestored",this.handleContextRestored),i.prototype.destroy.call(this,t),this.uuid=0,this.shaderManager.destroy(),this.maskManager.destroy(),this.stencilManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.maskManager=null,this.filterManager=null,this.blendModeManager=null,this.handleContextLost=null,this.handleContextRestored=null,this._contextOptions=null,this.drawCount=0,this.gl=null},r.prototype._mapBlendModes=function(){var t=this.gl;this.blendModes||(this.blendModes={},this.blendModes[p.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.ADD]=[t.SRC_ALPHA,t.DST_ALPHA],this.blendModes[p.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SCREEN]=[t.SRC_ALPHA,t.ONE],this.blendModes[p.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA])}},{"../../const":12,"../../utils":66,"../SystemRenderer":32,"./filters/FXAAFilter":40,"./managers/BlendModeManager":42,"./managers/FilterManager":43,"./managers/MaskManager":44,"./managers/ShaderManager":45,"./managers/StencilManager":46,"./utils/ObjectRenderer":52,"./utils/RenderTarget":54}],39:[function(t,e){function r(t,e,r){this.shaders=[],this.padding=0,this.uniforms=r||{},this.vertexSrc=t||i.defaultVertexSrc,this.fragmentSrc=e||i.defaultFragmentSrc}var i=t("../shaders/TextureShader");r.prototype.constructor=r,e.exports=r,r.prototype.getShader=function(t){var e=t.gl,r=this.shaders[e.id];return r||(r=new i(t.shaderManager,this.vertexSrc,this.fragmentSrc,this.uniforms,this.attributes),this.shaders[e.id]=r),r},r.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);t.filterManager.applyFilter(n,e,r,i)},r.prototype.syncUniform=function(t){for(var e=0,r=this.shaders.length;r>e;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":51}],40:[function(t,e){function r(){i.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FXAA_REDUCE_MIN\n #define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n #define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n #define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}}) }var i=t("./AbstractFilter");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var i=t.filterManager,n=this.getShader(t);i.applyFilter(n,e,r)}},{"./AbstractFilter":39}],41:[function(t,e){function r(t){var e=new n.Matrix;i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var i=t("./AbstractFilter"),n=t("../../../math");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var i=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(r.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":22,"./AbstractFilter":39}],42:[function(t,e){function r(t){i.call(this,t),this.currentBlendMode=99999}var i=t("./WebGLManager");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":47}],43:[function(t,e){function r(t){i.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new a.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var i=t("./WebGLManager"),n=t("../utils/RenderTarget"),o=t("../../../const"),s=t("../utils/Quad"),a=t("../../../math");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new s(t)},r.prototype.setFilterStack=function(t){this.filterStack=t},r.prototype.pushFilter=function(t,e){var r=t.filterArea||t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var i=0|e[0].padding;if(r.x-=i,r.y-=i,r.width+=2*i,r.height+=2*i,this.renderer.currentRenderTarget.transform){var n=this.renderer.currentRenderTarget.transform;r.x+=n.tx,r.y+=n.ty,this.capFilterArea(r),r.x-=n.tx,r.y-=n.ty}else this.capFilterArea(r);this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})},r.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget,i=e.renderTarget,n=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),n.bindBuffer(n.ARRAY_BUFFER,this.quad.vertexBuffer),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,n.FLOAT,!1,0,0),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,n.FLOAT,!1,0,32),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,n.FLOAT,!1,0,64),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,i),this.returnRenderTarget(r);else{for(var s=r,a=this.getRenderTarget(!0),h=0;h<o.length-1;h++){var l=o[h];l.uniforms.dimensions&&(l.uniforms.dimensions.value[0]=this.renderer.width,l.uniforms.dimensions.value[1]=this.renderer.height,l.uniforms.dimensions.value[2]=this.quad.vertices[0],l.uniforms.dimensions.value[3]=this.quad.vertices[5]),l.applyFilter(this.renderer,s,a);var u=s;s=a,a=u}o[o.length-1].applyFilter(this.renderer,s,i),this.returnRenderTarget(s),this.returnRenderTarget(a)}return t.filter},r.prototype.getRenderTarget=function(t){var e=this.texturePool.pop()||new n(this.renderer.gl,this.textureSize.width,this.textureSize.height,o.SCALE_MODES.LINEAR,this.renderer.resolution*o.FILTER_RESOLUTION);return e.frame=this.currentFrame,t&&e.clear(!0),e},r.prototype.returnRenderTarget=function(t){this.texturePool.push(t)},r.prototype.applyFilter=function(t,e,r,i){var n=this.renderer.gl;this.renderer.setRenderTarget(r),i&&r.clear(),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e.texture),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0)},r.prototype.calculateMappedMatrix=function(t,e,r){var i=e.worldTransform.copy(a.Matrix.TEMP_MATRIX),n=e._texture.baseTexture,o=r.identity(),s=this.textureSize.height/this.textureSize.width;o.translate(t.x/this.textureSize.width,t.y/this.textureSize.height),o.scale(1,s);var h=this.textureSize.width/n.width,l=this.textureSize.height/n.height;return i.tx/=n.width*h,i.ty/=n.width*h,i.invert(),o.prepend(i),o.scale(1,1/s),o.scale(h,l),o.translate(e.anchor.x,e.anchor.y),o},r.prototype.capFilterArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},r.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;r<this.texturePool.length;r++)this.texturePool[r].resize(t,e)},r.prototype.destroy=function(){this.filterStack=null,this.offsetY=0;for(var t=0;t<this.texturePool.length;t++)this.texturePool[t].destroy();this.texturePool=null}},{"../../../const":12,"../../../math":22,"../utils/Quad":53,"../utils/RenderTarget":54,"./WebGLManager":47}],44:[function(t,e){function r(t){i.call(this,t),this.stencilStack=[],this.reverse=!0,this.count=0,this.alphaMaskPool=[]}var i=t("./WebGLManager"),n=t("../filters/SpriteMaskFilter");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.pushMask=function(t,e){e.texture?this.pushSpriteMask(t,e):this.pushStencilMask(t,e)},r.prototype.popMask=function(t,e){e.texture?this.popSpriteMask(t,e):this.popStencilMask(t,e)},r.prototype.pushSpriteMask=function(t,e){var r=this.alphaMaskPool.pop();r||(r=[new n(e)]),this.renderer.filterManager.pushFilter(t,r)},r.prototype.popSpriteMask=function(){var t=this.renderer.filterManager.popFilter();this.alphaMaskPool.push(t)},r.prototype.pushStencilMask=function(t,e){this.renderer.stencilManager.pushMask(e)},r.prototype.popStencilMask=function(t,e){this.renderer.stencilManager.popMask(e)}},{"../filters/SpriteMaskFilter":41,"./WebGLManager":47}],45:[function(t,e){function r(t){i.call(this,t),this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var e=0;e<this.maxAttibs;e++)this.attribState[e]=!1;this.stack=[],this._currentId=-1,this.currentShader=null}var i=t("./WebGLManager"),n=t("../shaders/TextureShader"),o=t("../shaders/ComplexPrimitiveShader"),s=t("../shaders/PrimitiveShader"),a=t("../../../utils");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,a.pluginTarget.mixin(r),e.exports=r,r.prototype.onContextChange=function(){this.initPlugins(),this.defaultShader=new n(this),this.primitiveShader=new s(this),this.complexPrimitiveShader=new o(this)},r.prototype.setAttribs=function(t){var e;for(e=0;e<this.tempAttribState.length;e++)this.tempAttribState[e]=!1;for(var r in t)this.tempAttribState[t[r]]=!0;var i=this.renderer.gl;for(e=0;e<this.attribState.length;e++)this.attribState[e]!==this.tempAttribState[e]&&(this.attribState[e]=this.tempAttribState[e],this.attribState[e]?i.enableVertexAttribArray(e):i.disableVertexAttribArray(e))},r.prototype.setShader=function(t){return this._currentId===t.uuid?!1:(this._currentId=t.uuid,this.currentShader=t,this.renderer.gl.useProgram(t.program),this.setAttribs(t.attributes),!0)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.destroyPlugins(),this.attribState=null,this.tempAttribState=null}},{"../../../utils":66,"../shaders/ComplexPrimitiveShader":48,"../shaders/PrimitiveShader":49,"../shaders/TextureShader":51,"./WebGLManager":47}],46:[function(t,e){function r(t){i.call(this,t),this.stencilMaskStack=null}var i=t("./WebGLManager"),n=t("../../../utils");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.setMaskStack=function(t){this.stencilMaskStack=t;var e=this.renderer.gl;0===t.stencilStack.length?e.disable(e.STENCIL_TEST):e.enable(e.STENCIL_TEST)},r.prototype.pushStencil=function(t,e){this.renderer.currentRenderTarget.attachStencilBuffer();var r=this.renderer.gl,i=this.stencilMaskStack;this.bindGraphics(t,e,this.renderer),0===i.stencilStack.length&&(r.enable(r.STENCIL_TEST),r.clear(r.STENCIL_BUFFER_BIT),i.reverse=!0,i.count=0),i.stencilStack.push(e);var n=i.count;r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.ALWAYS,0,255),r.stencilOp(r.KEEP,r.KEEP,r.INVERT),1===e.mode?(r.drawElements(r.TRIANGLE_FAN,e.indices.length-4,r.UNSIGNED_SHORT,0),i.reverse?(r.stencilFunc(r.EQUAL,255-n,255),r.stencilOp(r.KEEP,r.KEEP,r.DECR)):(r.stencilFunc(r.EQUAL,n,255),r.stencilOp(r.KEEP,r.KEEP,r.INCR)),r.drawElements(r.TRIANGLE_FAN,4,r.UNSIGNED_SHORT,2*(e.indices.length-4)),i.reverse?r.stencilFunc(r.EQUAL,255-(n+1),255):r.stencilFunc(r.EQUAL,n+1,255),i.reverse=!i.reverse):(i.reverse?(r.stencilFunc(r.EQUAL,n,255),r.stencilOp(r.KEEP,r.KEEP,r.INCR)):(r.stencilFunc(r.EQUAL,255-n,255),r.stencilOp(r.KEEP,r.KEEP,r.DECR)),r.drawElements(r.TRIANGLE_STRIP,e.indices.length,r.UNSIGNED_SHORT,0),i.reverse?r.stencilFunc(r.EQUAL,n+1,255):r.stencilFunc(r.EQUAL,255-(n+1),255)),r.colorMask(!0,!0,!0,!0),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),i.count++},r.prototype.bindGraphics=function(t,e){this._currentGraphics=t;var r,i=this.renderer.gl;1===e.mode?(r=this.renderer.shaderManager.complexPrimitiveShader,this.renderer.shaderManager.setShader(r),i.uniformMatrix3fv(r.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),i.uniformMatrix3fv(r.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(r.uniforms.tint._location,n.hex2rgb(t.tint)),i.uniform3fv(r.uniforms.color._location,e.color),i.uniform1f(r.uniforms.alpha._location,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,e.buffer),i.vertexAttribPointer(r.attributes.aVertexPosition,2,i.FLOAT,!1,8,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.indexBuffer)):(r=this.renderer.shaderManager.primitiveShader,this.renderer.shaderManager.setShader(r),i.uniformMatrix3fv(r.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),i.uniformMatrix3fv(r.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(r.uniforms.tint._location,n.hex2rgb(t.tint)),i.uniform1f(r.uniforms.alpha._location,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,e.buffer),i.vertexAttribPointer(r.attributes.aVertexPosition,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(r.attributes.aColor,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.indexBuffer))},r.prototype.popStencil=function(t,e){var r=this.renderer.gl,i=this.stencilMaskStack;if(i.stencilStack.pop(),i.count--,0===i.stencilStack.length)r.disable(r.STENCIL_TEST);else{var n=i.count;this.bindGraphics(t,e,this.renderer),r.colorMask(!1,!1,!1,!1),1===e.mode?(i.reverse=!i.reverse,i.reverse?(r.stencilFunc(r.EQUAL,255-(n+1),255),r.stencilOp(r.KEEP,r.KEEP,r.INCR)):(r.stencilFunc(r.EQUAL,n+1,255),r.stencilOp(r.KEEP,r.KEEP,r.DECR)),r.drawElements(r.TRIANGLE_FAN,4,r.UNSIGNED_SHORT,2*(e.indices.length-4)),r.stencilFunc(r.ALWAYS,0,255),r.stencilOp(r.KEEP,r.KEEP,r.INVERT),r.drawElements(r.TRIANGLE_FAN,e.indices.length-4,r.UNSIGNED_SHORT,0),i.reverse?r.stencilFunc(r.EQUAL,n,255):r.stencilFunc(r.EQUAL,255-n,255)):(i.reverse?(r.stencilFunc(r.EQUAL,n+1,255),r.stencilOp(r.KEEP,r.KEEP,r.DECR)):(r.stencilFunc(r.EQUAL,255-(n+1),255),r.stencilOp(r.KEEP,r.KEEP,r.INCR)),r.drawElements(r.TRIANGLE_STRIP,e.indices.length,r.UNSIGNED_SHORT,0),i.reverse?r.stencilFunc(r.EQUAL,n,255):r.stencilFunc(r.EQUAL,255-n,255)),r.colorMask(!0,!0,!0,!0),r.stencilOp(r.KEEP,r.KEEP,r.KEEP)}},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.stencilMaskStack.stencilStack=null},r.prototype.pushMask=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),t.dirty&&this.renderer.plugins.graphics.updateGraphics(t,this.renderer.gl),t._webGL[this.renderer.gl.id].data.length&&this.pushStencil(t,t._webGL[this.renderer.gl.id].data[0],this.renderer)},r.prototype.popMask=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),this.popStencil(t,t._webGL[this.renderer.gl.id].data[0],this.renderer)}},{"../../../utils":66,"./WebGLManager":47}],47:[function(t,e){function r(t){this.renderer=t;var e=this;this.renderer.on("context",this._onContextChangeFn=function(){e.onContextChange()})}r.prototype.constructor=r,e.exports=r,r.prototype.onContextChange=function(){},r.prototype.destroy=function(){this.renderer.off("context",this._onContextChangeFn),this.renderer=null}},{}],48:[function(t,e){function r(t){i.call(this,t,["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},color:{type:"3f",value:[0,0,0]},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0})}var i=t("./Shader");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},{"./Shader":50}],49:[function(t,e){function r(t){i.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform float flipY;","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"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aColor:0})}var i=t("./Shader");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},{"./Shader":50}],50:[function(t,e){function r(t,e,r,n,o){if(!e||!r)throw new Error("Pixi.js Error. Shader requires vertexSrc and fragmentSrc");this.uuid=i.uuid(),this.gl=t.renderer.gl,this.shaderManager=t,this.program=null,this.uniforms=n||{},this.attributes=o||{},this.textureCount=1,this.vertexSrc=e,this.fragmentSrc=r,this.init()}{var i=t("../../../utils");t("../../../const")}r.prototype.constructor=r,e.exports=r,r.prototype.init=function(){this.compile(),this.gl.useProgram(this.program),this.cacheUniformLocations(Object.keys(this.uniforms)),this.cacheAttributeLocations(Object.keys(this.attributes))},r.prototype.cacheUniformLocations=function(t){for(var e=0;e<t.length;++e)this.uniforms[t[e]]._location=this.gl.getUniformLocation(this.program,t[e])},r.prototype.cacheAttributeLocations=function(t){for(var e=0;e<t.length;++e)this.attributes[t[e]]=this.gl.getAttribLocation(this.program,t[e])},r.prototype.compile=function(){var t=this.gl,e=this._glCompile(t.VERTEX_SHADER,this.vertexSrc),r=this._glCompile(t.FRAGMENT_SHADER,this.fragmentSrc),i=t.createProgram();return t.attachShader(i,e),t.attachShader(i,r),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(i,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(i)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(i)),t.deleteProgram(i),i=null),t.deleteShader(e),t.deleteShader(r),this.program=i},r.prototype.syncUniform=function(t){var e,r,n=t._location,o=t.value,s=this.gl;switch(t.type){case"i":case"1i":s.uniform1i(n,o);break;case"f":case"1f":s.uniform1f(n,o);break;case"2f":s.uniform2f(n,o[0],o[1]);break;case"3f":s.uniform3f(n,o[0],o[1],o[2]);break;case"4f":s.uniform4f(n,o[0],o[1],o[2],o[3]);break;case"v2":s.uniform2f(n,o.x,o.y);break;case"v3":s.uniform3f(n,o.x,o.y,o.z);break;case"v4":s.uniform4f(n,o.x,o.y,o.z,o.w);break;case"1iv":s.uniform1iv(n,o);break;case"2iv":s.uniform2iv(n,o);break;case"3iv":s.uniform3iv(n,o);break;case"4iv":s.uniform4iv(n,o);break;case"1fv":s.uniform1fv(n,o);break;case"2fv":s.uniform2fv(n,o);break;case"3fv":s.uniform3fv(n,o);break;case"4fv":s.uniform4fv(n,o);break;case"m2":case"mat2":case"Matrix2fv":s.uniformMatrix2fv(n,t.transpose,o);break;case"m3":case"mat3":case"Matrix3fv":s.uniformMatrix3fv(n,t.transpose,o);break;case"m4":case"mat4":case"Matrix4fv":s.uniformMatrix4fv(n,t.transpose,o);break;case"c":"number"==typeof o&&(o=i.hex2rgb(o)),s.uniform3f(n,o[0],o[1],o[2]);break;case"iv1":s.uniform1iv(n,o);break;case"iv":s.uniform3iv(n,o);break;case"fv1":s.uniform1fv(n,o);break;case"fv":s.uniform3fv(n,o);break;case"v2v":for(t._array||(t._array=new Float32Array(2*o.length)),e=0,r=o.length;r>e;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(n,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(n,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(n,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||this.initSampler2D(t),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:window.console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},r.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},r.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var i=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,i.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i.magFilter?i.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i.wrapT?i.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},r.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},r.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(window.console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../const":12,"../../../utils":66}],51:[function(t,e){function r(t,e,n,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array(1,0,0,0,1,0,0,0,1)}};if(o)for(var h in o)a[h]=o[h];var l={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var u in s)l[u]=s[u];e=e||r.defaultVertexSrc,n=n||r.defaultFragmentSrc,i.call(this,t,e,n,a,l)}var i=t("./Shader");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),r.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":50}],52:[function(t,e){function r(t){i.call(this,t)}var i=t("../managers/WebGLManager");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.flush=function(){},r.prototype.render=function(){}},{"../managers/WebGLManager":47}],53:[function(t,e){function r(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}r.prototype.constructor=r,r.prototype.map=function(t,e){var r=0,i=0;this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.upload()},r.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},e.exports=r},{}],54:[function(t,e){var r=t("../../../math"),i=t("../../../utils"),n=t("../../../const"),o=t("./StencilMaskStack"),s=function(t,e,s,a,h,l){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new r.Rectangle(0,0,1,1),this.resolution=h||n.RESOLUTION,this.projectionMatrix=new r.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new o,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||n.SCALE_MODES.DEFAULT,this.root=l,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===n.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===n.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var u=i.isPowerOfTwo(e,s);u?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,s)};s.prototype.constructor=s,e.exports=s,s.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},s.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},s.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},s.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},s.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var i=this.frame||this.size;this.calculateProjection(i)}},s.prototype.destroy=function(){var t=this.gl;t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":12,"../../../math":22,"../../../utils":66,"./StencilMaskStack":55}],55:[function(t,e){function r(){this.stencilStack=[],this.reverse=!0,this.count=0}r.prototype.constructor=r,e.exports=r},{}],56:[function(t,e){function r(t){o.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=h.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||n.EMPTY}var i=t("../math"),n=t("../textures/Texture"),o=t("../display/Container"),s=t("../renderers/canvas/utils/CanvasTinter"),a=t("../utils"),h=t("../const"),l=new i.Point;r.prototype=Object.create(o.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(t){this.scale.x=t/this.texture._frame.width,this._width=t}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(t){this.scale.y=t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate.bind(this))))}}}),r.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},r.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},r.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,i,n,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),h=o*-this.anchor.x,l=s*(1-this.anchor.y),u=s*-this.anchor.y,c=t||this.worldTransform,d=c.a,p=c.b,f=c.c,g=c.d,v=c.tx,m=c.ty;if(0===p&&0===f)0>d&&(d*=-1),0>g&&(g*=-1),e=d*h+v,r=d*a+v,i=g*u+m,n=g*l+m;else{var y=d*h+f*u+v,x=g*u+p*h+m,b=d*a+f*u+v,T=g*u+p*a+m,_=d*a+f*l+v,E=g*l+p*a+m,w=d*h+f*l+v,S=g*l+p*h+m;e=y,e=e>b?b:e,e=e>_?_:e,e=e>w?w:e,i=x,i=i>T?T:i,i=i>E?E:i,i=i>S?S:i,r=y,r=b>r?b:r,r=_>r?_:r,r=w>r?w:r,n=x,n=T>n?T:n,n=E>n?E:n,n=S>n?S:n}var A=this._bounds;A.x=e,A.width=r-e,A.y=i,A.height=n-i,this._currentBounds=A}return this._currentBounds},r.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},r.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,l);var e,r=this._texture._frame.width,i=this._texture._frame.height,n=-r*this.anchor.x;return l.x>n&&l.x<n+r&&(e=-i*this.anchor.y,l.y>e&&l.y<e+i)?!0:!1},r.prototype._renderCanvas=function(t){if(!(this.texture.crop.width<=0||this.texture.crop.height<=0)&&(this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,t.context.globalCompositeOperation=t.blendModes[t.currentBlendMode]),this.texture.valid)){var e,r,i,n,o=this._texture,a=this.worldTransform,l=o.baseTexture.resolution/t.resolution;if(t.context.globalAlpha=this.worldAlpha,t.smoothProperty&&t.currentScaleMode!==o.baseTexture.scaleMode&&(t.currentScaleMode=o.baseTexture.scaleMode,t.context[t.smoothProperty]=t.currentScaleMode===h.SCALE_MODES.LINEAR),o.rotate){var u=a.a,c=a.b;a.a=-a.c,a.b=-a.d,a.c=u,a.d=c,i=o.crop.height,n=o.crop.width,e=o.trim?o.trim.y-this.anchor.y*o.trim.height:this.anchor.y*-o._frame.height,r=o.trim?o.trim.x-this.anchor.x*o.trim.width:this.anchor.x*-o._frame.width}else i=o.crop.width,n=o.crop.height,e=o.trim?o.trim.x-this.anchor.x*o.trim.width:this.anchor.x*-o._frame.width,r=o.trim?o.trim.y-this.anchor.y*o.trim.height:this.anchor.y*-o._frame.height;t.roundPixels?(t.context.setTransform(a.a,a.b,a.c,a.d,a.tx*t.resolution|0,a.ty*t.resolution|0),e=0|e,r=0|r):t.context.setTransform(a.a,a.b,a.c,a.d,a.tx*t.resolution,a.ty*t.resolution),16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=s.getTintedTexture(this,this.tint)),t.context.drawImage(this.tintedTexture,0,0,i,n,e/l,r/l,i/l,i/l)):t.context.drawImage(o.baseTexture.source,o.crop.x,o.crop.y,i,n,e/l,r/l,i/l,n/l)}},r.prototype.destroy=function(t,e){o.prototype.destroy.call(this),this.anchor=null,t&&this._texture.destroy(e),this._texture=null,this.shader=null},r.fromFrame=function(t){var e=a.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new r(e)},r.fromImage=function(t,e,i){return new r(n.fromImage(t,e,i))}},{"../const":12,"../display/Container":13,"../math":22,"../renderers/canvas/utils/CanvasTinter":37,"../textures/Texture":60,"../utils":66}],57:[function(t,e){function r(t){i.call(this,t),this.vertSize=5,this.vertByteSize=4*this.vertSize,this.size=o.SPRITE_BATCH_SIZE;var e=4*this.size*this.vertByteSize,r=6*this.size;this.vertices=new ArrayBuffer(e),this.positions=new Float32Array(this.vertices),this.colors=new Uint32Array(this.vertices),this.indices=new Uint16Array(r),this.lastIndexCount=0;for(var n=0,s=0;r>n;n+=6,s+=4)this.indices[n+0]=s+0,this.indices[n+1]=s+1,this.indices[n+2]=s+2,this.indices[n+3]=s+0,this.indices[n+4]=s+2,this.indices[n+5]=s+3; this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.textures=[],this.blendModes=[],this.shaders=[],this.sprites=[],this.shader=null}var i=t("../../renderers/webgl/utils/ObjectRenderer"),n=(t("../../renderers/webgl/shaders/Shader"),t("../../renderers/webgl/WebGLRenderer")),o=t("../../const");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,n.registerPlugin("sprite",r),r.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},r.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&(this.flush(),this.currentBaseTexture=e.baseTexture);var r=e._uvs;if(r){var i,n,o,s,a=t.anchor.x,h=t.anchor.y;if(e.trim){var l=e.trim;n=l.x-a*l.width,i=n+e.crop.width,s=l.y-h*l.height,o=s+e.crop.height}else i=e._frame.width*(1-a),n=e._frame.width*-a,o=e._frame.height*(1-h),s=e._frame.height*-h;var u=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,d=c.a,p=c.b,f=c.c,g=c.d,v=c.tx,m=c.ty,y=this.colors,x=this.positions;this.renderer.roundPixels?(x[u]=d*n+f*s+v|0,x[u+1]=g*s+p*n+m|0,x[u+5]=d*i+f*s+v|0,x[u+6]=g*s+p*i+m|0,x[u+10]=d*i+f*o+v|0,x[u+11]=g*o+p*i+m|0,x[u+15]=d*n+f*o+v|0,x[u+16]=g*o+p*n+m|0):(x[u]=d*n+f*s+v,x[u+1]=g*s+p*n+m,x[u+5]=d*i+f*s+v,x[u+6]=g*s+p*i+m,x[u+10]=d*i+f*o+v,x[u+11]=g*o+p*i+m,x[u+15]=d*n+f*o+v,x[u+16]=g*o+p*n+m),x[u+2]=r.x0,x[u+3]=r.y0,x[u+7]=r.x1,x[u+8]=r.y1,x[u+12]=r.x2,x[u+13]=r.y2,x[u+17]=r.x3,x[u+18]=r.y3;var b=t.tint;y[u+4]=y[u+9]=y[u+14]=y[u+19]=(b>>16)+(65280&b)+((255&b)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},r.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var i,n,o,s,a=0,h=0,l=null,u=this.renderer.blendModeManager.currentBlendMode,c=null,d=!1,p=!1,f=0,g=this.currentBatchSize;g>f;f++)s=this.sprites[f],i=s._texture.baseTexture,n=s.blendMode,o=s.shader||this.shader,d=u!==n,p=c!==o,(l!==i||d||p)&&(this.renderBatch(l,a,h),h=f,a=0,l=i,d&&(u=n,this.renderer.blendModeManager.setBlendMode(u)),p&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(l,a,h),this.currentBatchSize=0}},r.prototype.renderBatch=function(t,e,r){if(0!==e){var i=this.renderer.gl;t._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,t._glTextures[i.id]):this.renderer.updateTexture(t),i.drawElements(i.TRIANGLES,6*e,i.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},r.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},r.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.currentBaseTexture=null,this.drawing=!1,this.textures=null,this.blendModes=null,this.shaders=null,this.sprites=null,this.shader=null}},{"../../const":12,"../../renderers/webgl/WebGLRenderer":38,"../../renderers/webgl/shaders/Shader":50,"../../renderers/webgl/utils/ObjectRenderer":52}],58:[function(t,e){function r(t,e,r){this.uuid=i.uuid(),this.resolution=r||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||n.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=!1,this._glTextures=[],t&&this.loadSource(t)}var i=t("../utils"),n=t("../const");r.prototype.constructor=r,e.exports=r,i.eventTarget.mixin(r.prototype),r.prototype.update=function(){this.emit("update",this)},r.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var r=this;t.onload=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r._sourceLoaded(),r.emit("loaded",r))},t.onerror=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r.emit("error",r))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},r.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.realWidth=this.source.naturalWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=i.isPowerOfTwo(this.width,this.height),this.update()},r.prototype.destroy=function(){this.imageUrl?(delete i.BaseTextureCache[this.imageUrl],delete i.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete i.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},r.prototype.dispose=function(){this.emit("dispose",this)},r.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},r.fromImage=function(t,e,n){var o=i.BaseTextureCache[t];if(void 0===e&&0!==t.indexOf("data:")&&(e=!0),!o){var s=new Image;e&&(s.crossOrigin=""),o=new r(s,n),o.imageUrl=t,s.src=t,i.BaseTextureCache[t]=o,o.resolution=i.getResolutionOfUrl(t)}return o},r.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+i.uuid());var n=i.BaseTextureCache[t._pixiId];return n||(n=new r(t,e),i.BaseTextureCache[t._pixiId]=n),n}},{"../const":12,"../utils":66}],59:[function(t,e){function r(t,e,r,u,c){if(!t)throw new Error("Unable to create RenderTexture, you must pass a renderer into the constructor.");e=e||100,r=r||100,c=c||l.RESOLUTION;var d=new i;if(d.width=e,d.height=r,d.resolution=c,d.scaleMode=u||l.SCALE_MODES.DEFAULT,d.hasLoaded=!0,n.call(this,d,new h.Rectangle(0,0,e,r)),this.width=e,this.height=r,this.resolution=c,this.render=null,this.renderer=t,this.renderer.type===l.RENDERER_TYPE.WEBGL){var p=this.renderer.gl;this.textureBuffer=new o(p,this.width,this.height,null,this.resolution),this.baseTexture._glTextures[p.id]=this.textureBuffer.texture,this.filterManager=new s(this.renderer),this.filterManager.onContextChange(),this.filterManager.resize(e,r),this.render=this.renderWebGL,this.renderer.currentRenderer.start()}else this.render=this.renderCanvas,this.textureBuffer=new a(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()}var i=t("./BaseTexture"),n=t("./Texture"),o=t("../renderers/webgl/utils/RenderTarget"),s=t("../renderers/webgl/managers/FilterManager"),a=t("../renderers/canvas/utils/CanvasBuffer"),h=t("../math"),l=t("../const"),u=new h.Matrix;r.prototype=Object.create(n.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.resize=function(t,e,r){(t!==this.width||e!==this.height)&&(this.valid=t>0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.renderer.type===l.RENDERER_TYPE.WEBGL&&(this.projection.x=this.width/2,this.projection.y=-this.height/2),this.valid&&(this.textureBuffer.resize(this.width*this.resolution,this.height*this.resolution),this.filterManager&&this.filterManager.resize(this.width,this.height)))},r.prototype.clear=function(){this.valid&&(this.renderer.type===l.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},r.prototype.renderWebGL=function(t,e,r,i){if(this.valid){if(i=!!i,this.textureBuffer.transform=e,t.worldAlpha=t.alpha,i){t.worldTransform.identity(),t.currentBounds=null;var n,o,s=t.children;for(n=0,o=s.length;o>n;++n)s[n].updateTransform()}r&&this.textureBuffer.clear();var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer),this.renderer.filterManager=a}},r.prototype.renderCanvas=function(t,e,r,i){if(this.valid){i=!!i;var n=t.worldTransform,o=u;o.identity(),e&&o.append(e),t.worldTransform=o,t.worldAlpha=1;var s,a,h=t.children;for(s=0,a=h.length;a>s;++s)h[s].updateTransform();r&&this.textureBuffer.clear(),t.worldTransform=n;var l=this.textureBuffer.context,c=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,l),this.renderer.resolution=c}},r.prototype.destroy=function(){n.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},r.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},r.prototype.getBase64=function(){return this.getCanvas().toDataURL()},r.prototype.getCanvas=function(){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.width,r=this.textureBuffer.height,i=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null);var n=new a(e,r),o=n.context.getImageData(0,0,e,r);return o.data.set(i),n.context.putImageData(o,0,0),n.canvas}return this.textureBuffer.canvas}},{"../const":12,"../math":22,"../renderers/canvas/utils/CanvasBuffer":34,"../renderers/webgl/managers/FilterManager":43,"../renderers/webgl/utils/RenderTarget":54,"./BaseTexture":58,"./Texture":60}],60:[function(t,e){function r(t,e,i,n,o){this.noFrame=!1,e||(this.noFrame=!0,e=new a.Rectangle(0,0,1,1)),t instanceof r&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=i||e,this.rotate=!!o,t.hasLoaded?(this.noFrame&&(e=new a.Rectangle(0,0,t.width,t.height)),this.frame=e):t.addEventListener("loaded",this.onBaseTextureLoaded.bind(this))}var i=t("./BaseTexture"),n=t("./VideoBaseTexture"),o=t("./TextureUvs"),s=t("../utils/eventTarget"),a=t("../math"),h=t("../utils");r.prototype.constructor=r,e.exports=r,s.mixin(r.prototype),Object.defineProperties(r.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}}}),r.prototype.update=function(){this.baseTexture.update()},r.prototype.onBaseTextureLoaded=function(){var t=this.baseTexture;t.removeEventListener("loaded",this.onLoaded),this.frame=this.noFrame?new a.Rectangle(0,0,t.width,t.height):this._frame,this.emit("update",this)},r.prototype.destroy=function(t){t&&this.baseTexture.destroy(),this.valid=!1},r.prototype.clone=function(){return new r(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},r.prototype._updateUvs=function(){this._uvs||(this._uvs=new o),this._uvs.set(this.crop,this.baseTexture,this.rotate)},r.fromImage=function(t,e,n){var o=h.TextureCache[t];return o||(o=new r(i.fromImage(t,e,n)),h.TextureCache[t]=o),o},r.fromFrame=function(t){var e=h.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},r.fromCanvas=function(t,e){return new r(i.fromCanvas(t,e))},r.fromVideo=function(t,e){return new r(n.baseTextureFromVideo(t,e))},r.fromVideoUrl=function(t,e){return new r(n.fromUrl(t,e))},r.addTextureToCache=function(t,e){h.TextureCache[e]=t},r.removeTextureFromCache=function(t){var e=h.TextureCache[t];return delete h.TextureCache[t],delete h.BaseTextureCache[t],e},r.emptyTexture=new r(new i)},{"../math":22,"../utils":66,"../utils/eventTarget":65,"./BaseTexture":58,"./TextureUvs":61,"./VideoBaseTexture":62}],61:[function(t,e){function r(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}e.exports=r,r.prototype.set=function(t,e,r){var i=e.width,n=e.height;r?(this.x0=(t.x+t.height)/i,this.y0=t.y/n,this.x1=(t.x+t.height)/i,this.y1=(t.y+t.width)/n,this.x2=t.x/i,this.y2=(t.y+t.width)/n,this.x3=t.x/i,this.y3=t.y/n):(this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n)}},{}],62:[function(t,e){function r(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),n.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function i(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var n=t("./BaseTexture"),o=t("../utils");r.prototype=Object.create(n.prototype),r.prototype.constructor=r,e.exports=r,r.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},r.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},r.prototype._onPlayStop=function(){this.autoUpdate=!1},r.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},r.prototype.destroy=function(){this.source&&this.source._pixiId&&(o.BaseTextureCache[this.source._pixiId]=null,delete o.BaseTextureCache[this.source._pixiId],this.source._pixiId=null,delete this.source._pixiId),n.prototype.destroy.call(this)},r.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+o.uuid());var i=o.BaseTextureCache[t._pixiId];return i||(i=new r(t,e),o.BaseTextureCache[t._pixiId]=i),i},r.fromUrl=function(t,e){var n=document.createElement("video");if(Array.isArray(t))for(var o=0;o<t.length;++o)n.appendChild(i(t.src||t,t.mime));else n.appendChild(i(t.src||t,t.mime));return n.load(),n.play(),r.fromVideo(n,e)},r.fromUrls=r.fromUrl},{"../utils":66,"./BaseTexture":58}],63:[function(t,e){function r(t,e,r){this.__isEventObject=!0,this.stopped=!1,this.stoppedImmediate=!1,this.target=t,this.type=e,this.data=r,this.timeStamp=Date.now()}r.prototype.constructor=r,e.exports=r,r.prototype.stopPropagation=function(){this.stopped=!0},r.prototype.stopImmediatePropagation=function(){this.stoppedImmediate=!0}},{}],64:[function(t,e){var r=e.exports={};r.Triangulate=function(t){var e=!0,i=t.length>>1;if(3>i)return[];for(var n=[],o=[],s=0;i>s;s++)o.push(s);s=0;for(var a=i;a>3;){var h=o[(s+0)%a],l=o[(s+1)%a],u=o[(s+2)%a],c=t[2*h],d=t[2*h+1],p=t[2*l],f=t[2*l+1],g=t[2*u],v=t[2*u+1],m=!1;if(r._convex(c,d,p,f,g,v,e)){m=!0;for(var y=0;a>y;y++){var x=o[y];if(x!==h&&x!==l&&x!==u&&r._PointInTriangle(t[2*x],t[2*x+1],c,d,p,f,g,v)){m=!1;break}}}if(m)n.push(h,l,u),o.splice((s+1)%a,1),a--,s=0;else if(s++>3*a){if(!e)return null;for(n=[],o=[],s=0;i>s;s++)o.push(s);s=0,a=i,e=!1}}return n.push(o[0],o[1],o[2]),n},r._PointInTriangle=function(t,e,r,i,n,o,s,a){var h=s-r,l=a-i,u=n-r,c=o-i,d=t-r,p=e-i,f=h*h+l*l,g=h*u+l*c,v=h*d+l*p,m=u*u+c*c,y=u*d+c*p,x=1/(f*m-g*g),b=(m*v-g*y)*x,T=(f*y-g*v)*x;return b>=0&&T>=0&&1>b+T},r._convex=function(t,e,r,i,n,o,s){return(e-i)*(n-r)+(r-t)*(o-i)>=0===s}},{}],65:[function(t,e){function r(t){t.listeners=function(t){return this._listeners=this._listeners||{},this._listeners[t]?this._listeners[t].slice():[]},t.emit=t.dispatchEvent=function(t,e){if(this._listeners=this._listeners||{},this._listeners[t]){e&&e.__isEventObject||(n.target=this,n.type=t,n.data=e,e=n);var r,i=this._listeners[t].slice(0),o=i.length,s=i[0];for(r=0;o>r;s=i[++r])if(s(e),e.stoppedImmediate)return this;return e.stopped?this:this}},t.on=t.addEventListener=function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},t.once=function(t,e){function r(){e.apply(i.off(t,r),arguments)}this._listeners=this._listeners||{};var i=this;return r._originalHandler=e,this.on(t,r)},t.off=t.removeEventListener=function(t,e){if(this._listeners=this._listeners||{},!this._listeners[t])return this;for(var r=this._listeners[t],i=e?r.length:0;i-->0;)(r[i]===e||r[i]._originalHandler===e)&&r.splice(i,1);return 0===r.length&&(this._listeners[t]=null),this},t.removeAllListeners=function(t){return this._listeners=this._listeners||{},this._listeners[t]?(this._listeners[t]=null,this):this}}var i=t("./EventData"),n=new i(null,null,{});e.exports={mixin:function(t){r(t)}}},{"./EventData":63}],66:[function(t,e){var r=t("../const"),i=e.exports={_uid:0,_saidHello:!1,RAFramePolyfill:t("./requestAnimationFramePolyfill"),EventData:t("./EventData"),eventTarget:t("./eventTarget"),pluginTarget:t("./pluginTarget"),PolyK:t("./PolyK"),uuid:function(){return++i._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=r.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!i._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["%c %c %c Pixi.js "+r.VERSION+" - "+t+" %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ ","background: #ff66a5","background: #ff66a5","color: #ff66a5; background: #030307;","background: #ff66a5","background: #ffc3dc","background: #ff66a5","color: #ff2424; background: #fff","color: #ff2424; background: #fff","color: #ff2424; background: #fff"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+r.VERSION+" - "+t+" - http://www.pixijs.com/");i._saidHello=!0}},TextureCache:{},BaseTextureCache:{}}},{"../const":12,"./EventData":63,"./PolyK":64,"./eventTarget":65,"./pluginTarget":67,"./requestAnimationFramePolyfill":68}],67:[function(t,e){function r(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){r(t)}}},{}],68:[function(){!function(t){for(var e=0,r=["ms","moz","webkit","o"],i=0;i<r.length&&!t.requestAnimationFrame;++i)t.requestAnimationFrame=t[r[i]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[r[i]+"CancelAnimationFrame"]||t[r[i]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(r){var i=(new Date).getTime(),n=Math.max(0,16-(i-e)),o=t.setTimeout(function(){r(i+n)},n);return e=i+n,o}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}(window)},{}],69:[function(t,e){var r=t("./core"),i=(t("./extras"),t("./mesh")),n=t("./text");r.SpriteBatch=function(){window.console.warn("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},r.AssetLoader=function(){window.console.warn("The loader system was overhauled in pixi v3, please see the new PIXI.Loader class.")},Object.defineProperties(r,{Stage:{get:function(){return window.console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),new r.Container}},DisplayObjectContainer:{get:function(){return window.console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on"),new r.Container}},Strip:{get:function(){return window.console.warn("The Strip class has been renamed to Mesh, please use Mesh from now on"),new i.Mesh(texture)}}}),r.Sprite.prototype.setTexture=function(t){this.texture=t,window.console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},n.BitmapText.prototype.setText=function(t){this.text=t,window.console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,window.console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},e.exports={}},{"./core":19,"./extras":75,"./mesh":116,"./text":124}],70:[function(t,e){function r(t){i.Sprite.call(this,t[0]),this._textures=t,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this.currentFrame=0,this.playing=!1,this._updateBound=this.update.bind(this)}var i=t("../core"),n=t("./Ticker");r.prototype=Object.create(i.Sprite.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{totalFrames:{get:function(){return this._textures.length}},textures:{get:function(){return this._textures},set:function(t){this._textures=t,this.texture=this._textures[Math.floor(this.currentFrame)%this._textures.length]}}}),r.prototype.stop=function(){this.playing&&(this.playing=!1,n.off("tick",this._updateBound))},r.prototype.play=function(){this.playing||(this.playing=!0,n.on("tick",this._updateBound))},r.prototype.gotoAndStop=function(t){this.stop(),this.currentFrame=t;var e=Math.floor(this.currentFrame);this.texture=this._textures[e%this._textures.length]},r.prototype.gotoAndPlay=function(t){this.currentFrame=t,this.play()},r.prototype.update=function(t){this.currentFrame+=this.animationSpeed*t.data.deltaTime;var e=Math.floor(this.currentFrame);0>e?this.loop?(this.currentFrame+=this._textures.length,this.texture=this._textures[this.currentFrame]):(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this.loop||e<this._textures.length?this.texture=this._textures[e%this._textures.length]:e>=this._textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())},r.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},r.fromFrames=function(t){for(var e=[],n=0;n<t.length;++n)e.push(new i.Texture.fromFrame(t[n]));return new r(e)},r.fromImages=function(t){for(var e=[],n=0;n<t.length;++n)e.push(new i.Texture.fromImage(t[n]));return new r(e)}},{"../core":19,"./Ticker":71}],71:[function(t,e){var r=t("../core/utils/eventTarget"),i=t("../core/utils/EventData"),n=function(){this.updateBind=this.update.bind(this),this.active=!1,this.eventData=new i(this,"tick",{deltaTime:1}),this.deltaTime=1,this.timeElapsed=0,this.lastTime=0,this.speed=1,this.start()};r.mixin(n.prototype),n.prototype.start=function(){this.active||(this.active=!0,requestAnimationFrame(this.updateBind))},n.prototype.stop=function(){this.active&&(this.active=!1)},n.prototype.update=function(){if(this.active){requestAnimationFrame(this.updateBind);var t=(new Date).getTime(),e=t-this.lastTime;e>100&&(e=100),this.deltaTime=.06*e,this.deltaTime*=this.speed,this.eventData.data.deltaTime=this.deltaTime,this.emit("tick",this.eventData),this.lastTime=t}},e.exports=new n},{"../core/utils/EventData":63,"../core/utils/eventTarget":65}],72:[function(t,e){function r(t,e,r){i.Sprite.call(this,t),this.tileScale=new i.math.Point(1,1),this.tilePosition=new i.math.Point(0,0),this._width=e||100,this._height=r||100,this._tileScaleOffset=new i.math.Point(1,1),this._tilingTexture=null,this._refreshTexture=!1,this._uvs=new n}var i=t("../core"),n=t("../core/textures/TextureUvs"),o=t("../core/textures/RenderTexture"),s=new i.Sprite,a=new i.math.Point;r.prototype=Object.create(i.Sprite.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{width:{get:function(){return this._width},set:function(t){this._width=t}},height:{get:function(){return this._height},set:function(t){this._height=t}}}),r.prototype._onTextureUpdate=function(){},r.prototype._renderWebGL=function(t){(!this._tilingTexture||this._refreshTexture)&&this.generateTilingTexture(t,this.texture,!0);var e=this._tilingTexture;if(e){var r=this._uvs;this.tilePosition.x%=e.baseTexture.width/this._tileScaleOffset.x,this.tilePosition.y%=e.baseTexture.height/this._tileScaleOffset.y;var i=this.tilePosition.x/(e.baseTexture.width/this._tileScaleOffset.x),n=this.tilePosition.y/(e.baseTexture.height/this._tileScaleOffset.y),o=this._width/e.baseTexture.width*this._tileScaleOffset.x,s=this._height/e.baseTexture.height*this._tileScaleOffset.y;o/=this.tileScale.x,s/=this.tileScale.y,r.x0=0-i,r.y0=0-n,r.x1=1*o-i,r.y1=0-n,r.x2=1*o-i,r.y2=1*s-n,r.x3=0-i,r.y3=1*s-n;var a=e._uvs,h=e._frame.width,l=e._frame.height;e._uvs=r,e._frame.width=this.width,e._frame.height=this.height,t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this),e._uvs=a,e._frame.width=h,e._frame.height=l}},r.prototype._renderCanvas=function(t){var e=t.context;e.globalAlpha=this.worldAlpha;var r=this.worldTransform,i=t.resolution;if(e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i),!this.__tilePattern||this._refreshTexture){if(this.generateTilingTexture(!1),!this._tilingTexture)return;this.__tilePattern=e.createPattern(this._tilingTexture.baseTexture.source,"repeat")}this.blendMode!==t.currentBlendMode&&(t.currentBlendMode=this.blendMode,e.globalCompositeOperation=t.blendModes[t.currentBlendMode]);var n=this.tilePosition,o=this.tileScale;n.x%=this._tilingTexture.baseTexture.width,n.y%=this._tilingTexture.baseTexture.height,e.scale(o.x,o.y),e.translate(n.x+this.anchor.x*-this._width,n.y+this.anchor.y*-this._height),e.fillStyle=this.__tilePattern,e.fillRect(-n.x,-n.y,this._width/o.x,this._height/o.y),e.translate(-n.x+this.anchor.x*this._width,-n.y+this.anchor.y*this._height),e.scale(1/o.x,1/o.y)},r.prototype.getBounds=function(){var t,e,r,i,n=this._width,o=this._height,s=n*(1-this.anchor.x),a=n*-this.anchor.x,h=o*(1-this.anchor.y),l=o*-this.anchor.y,u=this.worldTransform,c=u.a,d=u.b,p=u.c,f=u.d,g=u.tx,v=u.ty,m=c*a+p*l+g,y=f*l+d*a+v,x=c*s+p*l+g,b=f*l+d*s+v,T=c*s+p*h+g,_=f*h+d*s+v,E=c*a+p*h+g,w=f*h+d*a+v;t=m,t=t>x?x:t,t=t>T?T:t,t=t>E?E:t,r=y,r=r>b?b:r,r=r>_?_:r,r=r>w?w:r,e=m,e=x>e?x:e,e=T>e?T:e,e=E>e?E:e,i=y,i=b>i?b:i,i=_>i?_:i,i=w>i?w:i;var S=this._bounds;return S.x=t,S.width=e-t,S.y=r,S.height=i-r,this._currentBounds=S,S},r.prototype.onTextureUpdate=function(){},r.prototype.generateTilingTexture=function(t,e,r){if(this.texture.baseTexture.hasLoaded){e=this.originalTexture||this._texture;var n,a,h=e.frame,l=h.width!==e.baseTexture.width||h.height!==e.baseTexture.height;if(r&&!e.baseTexture.isPowerOfTwo||l){n=i.utils.getNextPowerOfTwo(h.width),a=i.utils.getNextPowerOfTwo(h.height),s.texture=e;var u=new o(t,n,a,e.baseTexture.scaleMode,e.baseTexture.resolution);s.worldTransform.a=(n+1)/h.width,s.worldTransform.d=(a+1)/h.height,s.worldTransform.tx-=.5,s.worldTransform.ty-=.5;var c=t.currentRenderTarget;u.render(s,s.worldTransform,!0,!1),t.setRenderTarget(c),this._tileScaleOffset.x=n/h.width,this._tileScaleOffset.y=a/h.height,this._tilingTexture=u}else this._tilingTexture&&this._tilingTexture.isTiling&&this._tilingTexture.destroy(!0),this._tileScaleOffset.x=1,this._tileScaleOffset.y=1,this._tilingTexture=e;this._refreshTexture=!1,this.originalTexture=this.texture,this._texture=this._tilingTexture}},r.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,a);var e,r=this._width,i=this._height,n=-r*this.anchor.x;return a.x>n&&a.x<n+r&&(e=-i*this.anchor.y,a.y>e&&a.y<e+i)?!0:!1},r.prototype.destroy=function(){i.Sprite.prototype.destroy.call(this),this.tileScale=null,this._tileScaleOffset=null,this.tilePosition=null,this._tilingTexture.destroy(!0),this._tilingTexture=null,this._uvs=null},r.fromFrame=function(t,e,n){var o=i.utils.TextureCache[t];if(!o)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new r(o,e,n)},r.fromImage=function(t,e,n,o,s){return new r(i.Texture.fromImage(t,o,s),e,n)}},{"../core":19,"../core/textures/RenderTexture":59,"../core/textures/TextureUvs":61}],73:[function(t,e){var r=t("../core/math"),i=t("../core/textures/RenderTexture"),n=t("../core/display/DisplayObject"),o=t("../core/sprites/Sprite"),s=new r.Matrix;n.prototype._cacheAsBitmap=!1,n.prototype._originalRenderWebGL=null,n.prototype._originalRenderCanvas=null,n.prototype._originalUpdateTransform=null,n.prototype._originalHitTest=null,n.prototype._cachedSprite=null,Object.defineProperties(n.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._originalRenderWebGL=this.renderWebGL,this._originalRenderCanvas=this.renderCanvas,this._originalUpdateTransform=this.updateTransform,this._originalGetBounds=this.getBounds,this._originalContainesPoint=this.containsPoint,this.renderWebGL=this._renderCachedWebGL,this.renderCanvas=this._renderCachedCanvas):(this._cachedSprite&&this._destroyCachedDisplayObject(),this.renderWebGL=this._originalRenderWebGL,this.renderCanvas=this._originalRenderCanvas,this.getBounds=this._originalGetBounds,this.updateTransform=this._originalUpdateTransform,this.containsPoint=this._originalContainsPoint))}}}),n.prototype._renderCachedWebGL=function(t){this._initCachedDisplayObject(t),this._cachedSprite.worldAlpha=this.worldAlpha,t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this._cachedSprite)},n.prototype._initCachedDisplayObject=function(t){if(!this._cachedSprite){t.currentRenderer.flush();var e=this.getLocalBounds().clone();if(this._filters){var r=this._filters[0].padding;e.x-=r,e.y-=r,e.width+=2*r,e.height+=2*r}var n=t.currentRenderTarget,a=t.filterManager.filterStack,h=new i(t,0|e.width,0|e.height),l=s;l.tx=-e.x,l.ty=-e.y,this.renderWebGL=this._originalRenderWebGL,h.render(this,l,!0),t.setRenderTarget(n),t.filterManager.filterStack=a,this.renderWebGL=this._renderCachedWebGL,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new o(h),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-(e.x/e.width),this._cachedSprite.anchor.y=-(e.y/e.height),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite) }},n.prototype._renderCachedCanvas=function(t){this._initCachedDisplayObjectCanvas(t),this._cachedSprite.worldAlpha=this.worldAlpha,this._cachedSprite.renderCanvas(t)},n.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cachedSprite){var e=this.getLocalBounds(),r=t.context,n=new i(t,0|e.width,0|e.height),a=s;a.tx=-e.x,a.ty=-e.y,this.renderCanvas=this._originalRenderCanvas,n.render(this,a,!0),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new o(n),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-(e.x/e.width),this._cachedSprite.anchor.y=-(e.y/e.height),this.hitTest=this._cachedSprite.hitTest.bind(this._cachedSprite)}},n.prototype._getCachedBounds=function(){return this._cachedSprite._currentBounds=null,this._cachedSprite.getBounds()},n.prototype._destroyCachedDisplayObject=function(){this._cachedSprite._texture.destroy(),this._cachedSprite=null},e.exports={}},{"../core/display/DisplayObject":14,"../core/math":22,"../core/sprites/Sprite":56,"../core/textures/RenderTexture":59}],74:[function(t,e){var r=t("../core/display/DisplayObject"),i=t("../core/display/Container");r.prototype.name=null,i.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null},e.exports={}},{"../core/display/Container":13,"../core/display/DisplayObject":14}],75:[function(t,e){e.exports={Ticker:t("./Ticker"),MovieClip:t("./MovieClip"),TilingSprite:t("./TilingSprite"),cacheAsBitmap:t("./cacheAsBitmap"),getChildByName:t("./getChildByName")}},{"./MovieClip":70,"./Ticker":71,"./TilingSprite":72,"./cacheAsBitmap":73,"./getChildByName":74}],76:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nuniform vec4 dimensions;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n if (clamp(p.x, 0.0, 4.0) == p.x && clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 uv = gl_FragCoord.xy;\n\n vec3 col = texture2D(uSampler, floor( uv / pixelSize ) * pixelSize / dimensions.xy).rgb;\n\n float gray = (col.r + col.g + col.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":19}],77:[function(t,e){function r(){i.AbstractFilter.call(this),this.blurXFilter=new n,this.blurYFilter=new o,this.defaultFilter=new i.AbstractFilter}var i=t("../../core"),n=t("../blur/BlurXFilter"),o=t("../blur/BlurYFilter");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(i.CONST.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.CONST.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(n)},Object.defineProperties(r.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":19,"../blur/BlurXFilter":79,"../blur/BlurYFilter":80}],78:[function(t,e){function r(){i.AbstractFilter.call(this),this.blurXFilter=new n,this.blurYFilter=new o}var i=t("../../core"),n=t("./BlurXFilter"),o=t("./BlurYFilter");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.blurXFilter.applyFilter(t,e,i),this.blurYFilter.applyFilter(t,i,r),t.filterManager.returnRenderTarget(i)},Object.defineProperties(r.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.padding=.5*t,this.blurXFilter.blur=this.blurYFilter.blur=t}},passes:{get:function(){return this.blurXFilter.passes},set:function(t){this.blurXFilter.passes=this.blurYFilter.passes=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":19,"./BlurXFilter":79,"./BlurYFilter":80}],79:[function(t,e){function r(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(-0.012 * strength, 0.0);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(-0.008 * strength, 0.0);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(-0.004 * strength, 0.0);\n vBlurTexCoords[ 3] = aTextureCoord + vec2( 0.004 * strength, 0.0);\n vBlurTexCoords[ 4] = aTextureCoord + vec2( 0.008 * strength, 0.0);\n vBlurTexCoords[ 5] = aTextureCoord + vec2( 0.012 * strength, 0.0);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n}\n",{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h<this.passes-1;h++){t.filterManager.applyFilter(n,s,a,i);var l=a;a=s,s=l}t.filterManager.applyFilter(n,s,r,i),t.filterManager.returnRenderTarget(o)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*t,this.strength=t}}})},{"../../core":19}],80:[function(t,e){function r(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n}\n",{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h<this.passes-1;h++){t.filterManager.applyFilter(n,s,a,i);var l=a;a=s,s=l}t.filterManager.applyFilter(n,s,r,i),t.filterManager.returnRenderTarget(o)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*t,this.strength=t}}})},{"../../core":19}],81:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nconst vec2 delta = vec2(1.0/10.0, 0.0);\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta * percent);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n")}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r},{"../../core":19}],82:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float m[24];\n\nuniform vec4 d;\n\nvoid main(void)\n{\n \n vec4 c = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor.r = m[0] * c.r + m[1] * c.g + m[2] * c.b + m[3] * c.a + m[4];\n gl_FragColor.g = m[5] * c.r + m[6] * c.g + m[7] * c.b + m[8] * c.a + m[9];\n gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14];\n gl_FragColor.a = c.a;\n}\n",{m:{type:"1fv",value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype._loadMatrix=function(t,e){e=!!e;var r=t;e&&(this._multiply(r,this.uniforms.m.value,t),r=this._colorMatrix(r)),this.uniforms.m.value=r},r.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15]+e[4]*r[20],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16]+e[4]*r[21],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17]+e[4]*r[22],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18]+e[4]*r[23],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4]*r[24],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15]+e[9]*r[20],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16]+e[9]*r[21],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17]+e[9]*r[22],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18]+e[9]*r[23],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9]*r[24],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15]+e[14]*r[20],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16]+e[14]*r[21],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17]+e[14]*r[22],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18]+e[14]*r[23],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14]*r[24],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15]+e[19]*r[20],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16]+e[19]*r[21],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17]+e[19]*r[22],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18]+e[19]*r[23],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19]*r[24],t[20]=e[20]*r[0]+e[21]*r[5]+e[22]*r[10]+e[23]*r[15]+e[24]*r[20],t[21]=e[20]*r[1]+e[21]*r[6]+e[22]*r[11]+e[23]*r[16]+e[24]*r[21],t[22]=e[20]*r[2]+e[21]*r[7]+e[22]*r[12]+e[23]*r[17]+e[24]*r[22],t[23]=e[20]*r[3]+e[21]*r[8]+e[22]*r[13]+e[23]*r[18]+e[24]*r[23],t[24]=e[20]*r[4]+e[21]*r[9]+e[22]*r[14]+e[23]*r[19]+e[24]*r[24],t},r.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},r.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(r,e)},r.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(r,e)},r.prototype.blackAndWhite=function(t){var e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=.213,o=.715,s=.072,a=[n+r*(1-n)+i*-n,o+r*-o+i*-o,s+r*-s+i*(1-s),0,0,n+r*-n+.143*i,o+r*(1-o)+.14*i,s+r*-s+i*-.283,0,0,n+r*-n+i*-(1-n),o+r*-o+i*o,s+r*(1-s)+i*s,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(a,e)},r.prototype.contrast=function(t,e){var r=(t||0)+1,i=-128*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(n,e)},r.prototype.saturation=function(t,e){var r=2*(t||0)/3+1,i=(r-1)*-.5,n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(n,e)},r.prototype.desaturate=function(){this.saturation(-1)},r.prototype.negative=function(t){var e=[0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.sepia=function(t){var e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.technicolor=function(t){var e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0,0,0,0,0,0];this._loadMatrix(e,t)},r.prototype.polaroid=function(t){var e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.toBGR=function(t){var e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.kodachrome=function(t){var e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.browni=function(t){var e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.vintage=function(t){var e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.colorTone=function(t,e,r,i,n){t=t||.2,e=e||.15,r=r||16770432,i=i||3375104;var o=(r>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,l=(i>>8&255)/255,u=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,l,u,e,0,o-h,s-l,a-u,0,0,0,0,0,0,1];this._loadMatrix(c,n)},r.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(r,e)},r.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0,0,0,0,0,0];this._loadMatrix(r,e)},r.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(e,t)},r.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1];this._loadMatrix(t,!1)},Object.defineProperties(r.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=t}}})},{"../../core":19}],83:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":19}],84:[function(t,e){function r(t,e,r){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"2v",value:{x:1/e,y:1/r}}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":19}],85:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r},{"../../core":19}],86:[function(t,e){function r(t){var e=new i.math.Matrix;t.renderable=!1,i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:e.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=e,this.scale=new i.math.Point(20,20)}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var i=t.filterManager;i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(r.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":19}],87:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * dimensions.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":19}],88:[function(t,e){function r(){i.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h<this.passes-1;h++){t.filterManager.applyFilter(n,s,a,i);var l=a;a=s,s=l}t.filterManager.applyFilter(n,s,r,i),t.filterManager.returnRenderTarget(o)}},Object.defineProperties(r.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=.5*t,this.strength=t}}})},{"../../core":19}],89:[function(t,e){function r(){i.AbstractFilter.call(this),this.blurXFilter=new n,this.blurYTintFilter=new o,this.defaultFilter=new i.AbstractFilter,this.padding=30,this._dirtyPosition=!0,this._angle=45*Math.PI/180,this._distance=10,this.alpha=.75,this.hideObject=!1,this.blendMode=i.CONST.BLEND_MODES.MULTIPLY}var i=t("../../core"),n=t("../blur/BlurXFilter"),o=t("./BlurYTintFilter");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var n=t.filterManager.getRenderTarget(!0);this._dirtyPosition&&(this._dirtyPosition=!1,this.blurYTintFilter.uniforms.offset.value[0]=Math.sin(this._angle)*this._distance,this.blurYTintFilter.uniforms.offset.value[1]=Math.cos(this._angle)*this._distance),this.blurXFilter.applyFilter(t,e,n),t.blendModeManager.setBlendMode(this.blendMode),this.blurYTintFilter.applyFilter(t,n,r),t.blendModeManager.setBlendMode(i.CONST.BLEND_MODES.NORMAL),this.hideObject||this.defaultFilter.applyFilter(t,e,r),t.filterManager.returnRenderTarget(n)},Object.defineProperties(r.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYTintFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYTintFilter.blur},set:function(t){this.blurYTintFilter.blur=t}},color:{get:function(){return i.utils.rgb2hex(this.blurYTintFilter.uniforms.color.value)},set:function(t){this.blurYTintFilter.uniforms.color.value=i.utils.hex2rgb(t)}},alpha:{get:function(){return this.blurYTintFilter.uniforms.alpha.value},set:function(t){this.blurYTintFilter.uniforms.alpha.value=t}},distance:{get:function(){return this._distance},set:function(t){this._dirtyPosition=!0,this._distance=t}},angle:{get:function(){return this._angle},set:function(t){this._dirtyPosition=!0,this._angle=t}}})},{"../../core":19,"../blur/BlurXFilter":79,"./BlurYTintFilter":88}],90:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float gray;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);\n}\n",{gray:{type:"1f",value:1}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{gray:{get:function(){return this.uniforms.gray.value},set:function(t){this.uniforms.gray.value=t}}})},{"../../core":19}],91:[function(t,e){e.exports={AbstractFilter:t("../core/renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("../core/renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("../core/renderers/webgl/filters/SpriteMaskFilter"),AsciiFilter:t("./ascii/AsciiFilter"),BloomFilter:t("./bloom/BloomFilter"),BlurFilter:t("./blur/BlurFilter"),BlurXFilter:t("./blur/BlurXFilter"),BlurYFilter:t("./blur/BlurYFilter"),ColorMatrixFilter:t("./color/ColorMatrixFilter"),ColorStepFilter:t("./color/ColorStepFilter"),ConvolutionFilter:t("./convolution/ConvolutionFilter"),CrossHatchFilter:t("./crosshatch/CrossHatchFilter"),DisplacementFilter:t("./displacement/DisplacementFilter"),DotScreenFilter:t("./dot/DotScreenFilter"),GrayFilter:t("./gray/GrayFilter"),DropShadowFilter:t("./dropshadow/DropShadowFilter"),InvertFilter:t("./invert/InvertFilter"),NoiseFilter:t("./noise/NoiseFilter"),NormalMapFilter:t("./normal/NormalMapFilter"),PixelateFilter:t("./pixelate/PixelateFilter"),RGBSplitFilter:t("./rgb/RGBSplitFilter"),ShockwaveFilter:t("./shockwave/ShockwaveFilter"),SepiaFilter:t("./sepia/SepiaFilter"),SmartBlurFilter:t("./blur/SmartBlurFilter"),TiltShiftFilter:t("./tiltshift/TiltShiftFilter"),TiltShiftXFilter:t("./tiltshift/TiltShiftXFilter"),TiltShiftYFilter:t("./tiltshift/TiltShiftYFilter"),TwistFilter:t("./twist/TwistFilter")}},{"../core/renderers/webgl/filters/AbstractFilter":39,"../core/renderers/webgl/filters/FXAAFilter":40,"../core/renderers/webgl/filters/SpriteMaskFilter":41,"./ascii/AsciiFilter":76,"./bloom/BloomFilter":77,"./blur/BlurFilter":78,"./blur/BlurXFilter":79,"./blur/BlurYFilter":80,"./blur/SmartBlurFilter":81,"./color/ColorMatrixFilter":82,"./color/ColorStepFilter":83,"./convolution/ConvolutionFilter":84,"./crosshatch/CrossHatchFilter":85,"./displacement/DisplacementFilter":86,"./dot/DotScreenFilter":87,"./dropshadow/DropShadowFilter":89,"./gray/GrayFilter":90,"./invert/InvertFilter":92,"./noise/NoiseFilter":93,"./normal/NormalMapFilter":94,"./pixelate/PixelateFilter":95,"./rgb/RGBSplitFilter":96,"./sepia/SepiaFilter":97,"./shockwave/ShockwaveFilter":98,"./tiltshift/TiltShiftFilter":100,"./tiltshift/TiltShiftXFilter":101,"./tiltshift/TiltShiftYFilter":102,"./twist/TwistFilter":103}],92:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform float invert;\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor.rgb = mix( (vec3(1)-gl_FragColor.rgb) * gl_FragColor.a, gl_FragColor.rgb, 1.0 - invert);\n}\n",{invert:{type:"1f",value:1}}) }var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{invert:{get:function(){return this.uniforms.invert.value},set:function(t){this.uniforms.invert.value=t}}})},{"../../core":19}],93:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump 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(vTextureCoord) - 0.5) * noise;\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n gl_FragColor = color;\n}\n",{noise:{type:"1f",value:.5}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{noise:{get:function(){return this.uniforms.noise.value},set:function(t){this.uniforms.noise.value=t}}})},{"../../core":19}],94:[function(t,e){function r(t){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying float vColor;\n\nuniform sampler2D displacementMap;\nuniform sampler2D uSampler;\n\nuniform vec4 dimensions;\n\nconst vec2 Resolution = vec2(1.0,1.0); //resolution of screen\nuniform vec3 LightPos; //light position, normalized\nconst vec4 LightColor = vec4(1.0, 1.0, 1.0, 1.0); //light RGBA -- alpha is intensity\nconst vec4 AmbientColor = vec4(1.0, 1.0, 1.0, 0.5); //ambient RGBA -- alpha is intensity\nconst vec3 Falloff = vec3(0.0, 1.0, 0.2); //attenuation coefficients\n\nuniform vec3 LightDir; // = vec3(1.0, 0.0, 1.0);\n\nuniform vec2 mapDimensions; // = vec2(256.0, 256.0);\n\n\nvoid main(void)\n{\n vec2 mapCords = vTextureCoord.xy;\n\n vec4 color = texture2D(uSampler, vTextureCoord.st);\n vec3 nColor = texture2D(displacementMap, vTextureCoord.st).rgb;\n\n\n mapCords *= vec2(dimensions.x/512.0, dimensions.y/512.0);\n\n mapCords.y *= -1.0;\n mapCords.y += 1.0;\n\n // RGBA of our diffuse color\n vec4 DiffuseColor = texture2D(uSampler, vTextureCoord);\n\n // RGB of our normal map\n vec3 NormalMap = texture2D(displacementMap, mapCords).rgb;\n\n // The delta position of light\n // vec3 LightDir = vec3(LightPos.xy - (gl_FragCoord.xy / Resolution.xy), LightPos.z);\n vec3 LightDir = vec3(LightPos.xy - (mapCords.xy), LightPos.z);\n\n // Correct for aspect ratio\n // LightDir.x *= Resolution.x / Resolution.y;\n\n // Determine distance (used for attenuation) BEFORE we normalize our LightDir\n float D = length(LightDir);\n\n // normalize our vectors\n vec3 N = normalize(NormalMap * 2.0 - 1.0);\n vec3 L = normalize(LightDir);\n\n // Pre-multiply light color with intensity\n // Then perform 'N dot L' to determine our diffuse term\n vec3 Diffuse = (LightColor.rgb * LightColor.a) * max(dot(N, L), 0.0);\n\n // pre-multiply ambient color with intensity\n vec3 Ambient = AmbientColor.rgb * AmbientColor.a;\n\n // calculate attenuation\n float Attenuation = 1.0 / ( Falloff.x + (Falloff.y*D) + (Falloff.z*D*D) );\n\n // the calculation which brings it all together\n vec3 Intensity = Ambient + Diffuse * Attenuation;\n vec3 FinalColor = DiffuseColor.rgb * Intensity;\n gl_FragColor = vColor * vec4(FinalColor, DiffuseColor.a);\n\n // gl_FragColor = vec4(1.0, 0.0, 0.0, Attenuation); // vColor * vec4(FinalColor, DiffuseColor.a);\n\n/*\n // normalise color\n vec3 normal = normalize(nColor * 2.0 - 1.0);\n\n vec3 deltaPos = vec3( (light.xy - gl_FragCoord.xy) / resolution.xy, light.z );\n\n float lambert = clamp(dot(normal, lightDir), 0.0, 1.0);\n\n float d = sqrt(dot(deltaPos, deltaPos));\n float att = 1.0 / ( attenuation.x + (attenuation.y*d) + (attenuation.z*d*d) );\n\n vec3 result = (ambientColor * ambientIntensity) + (lightColor.rgb * lambert) * att;\n result *= color.rgb;\n\n gl_FragColor = vec4(result, 1.0);\n*/\n}\n",{displacementMap:{type:"sampler2D",value:t},scale:{type:"2f",value:{x:15,y:15}},offset:{type:"2f",value:{x:0,y:0}},mapDimensions:{type:"2f",value:{x:1,y:1}},dimensions:{type:"4f",value:[0,0,0,0]},LightPos:{type:"3f",value:[0,1,0]}}),t.baseTexture._powerOf2=!0,t.baseTexture.hasLoaded?this.onTextureLoaded():t.baseTexture.once("loaded",this.onTextureLoaded.bind(this))}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.onTextureLoaded=function(){this.uniforms.mapDimensions.value.x=this.uniforms.displacementMap.value.width,this.uniforms.mapDimensions.value.y=this.uniforms.displacementMap.value.height},Object.defineProperties(r.prototype,{map:{get:function(){return this.uniforms.displacementMap.value},set:function(t){this.uniforms.displacementMap.value=t}},scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../core":19}],95:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 dimensions;\nuniform vec2 pixelSize;\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord;\n\n vec2 size = dimensions.xy / pixelSize;\n\n vec2 color = floor( ( vTextureCoord * size ) ) / size + pixelSize/dimensions.xy * 0.5;\n\n gl_FragColor = texture2D(uSampler, color);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"v2",value:{x:10,y:10}}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":19}],96:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 dimensions;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/dimensions.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/dimensions.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/dimensions.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n",{red:{type:"v2",value:{x:20,y:20}},green:{type:"v2",value:{x:-20,y:20}},blue:{type:"v2",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{red:{get:function(){return this.uniforms.red.value},set:function(t){this.uniforms.red.value=t}},green:{get:function(){return this.uniforms.green.value},set:function(t){this.uniforms.green.value=t}},blue:{get:function(){return this.uniforms.blue.value},set:function(t){this.uniforms.blue.value=t}}})},{"../../core":19}],97:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float sepia;\n\nconst mat3 sepiaMatrix = mat3(0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912);\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb * sepiaMatrix, sepia);\n}\n",{sepia:{type:"1f",value:1}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{sepia:{get:function(){return this.uniforms.sepia.value},set:function(t){this.uniforms.sepia.value=t}}})},{"../../core":19}],98:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nuniform vec2 center;\nuniform vec3 params; // 10.0, 0.8, 0.1\nuniform float time;\n\nvoid main()\n{\n vec2 uv = vTextureCoord;\n vec2 texCoord = uv;\n\n float dist = distance(uv, center);\n\n if ( (dist <= (time + params.z)) && (dist >= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":19}],99:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(r.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":19}],100:[function(t,e){function r(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new n,this.tiltShiftYFilter=new o}var i=t("../../core"),n=t("./TiltShiftXFilter"),o=t("./TiltShiftYFilter");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,i),this.tiltShiftYFilter.applyFilter(t,i,r),t.filterManager.returnRenderTarget(i)},Object.defineProperties(r.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":19,"./TiltShiftXFilter":101,"./TiltShiftYFilter":102}],101:[function(t,e){function r(){i.call(this)}var i=t("./TiltShiftAxisFilter");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":99}],102:[function(t,e){function r(){i.call(this)}var i=t("./TiltShiftAxisFilter");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":99}],103:[function(t,e){function r(){i.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var i=t("../../core");r.prototype=Object.create(i.AbstractFilter.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":19}],104:[function(t,e){function r(){this.global=new i.math.Point,this.target=null,this.originalEvent=null}var i=t("../core");r.prototype.constructor=r,e.exports=r,r.prototype.getLocalPosition=function(t,e){var r=t.worldTransform,n=this.global,o=r.a,s=r.c,a=r.tx,h=r.b,l=r.d,u=r.ty,c=1/(o*l+s*-h);return e=e||new i.math.Point,e.x=l*c*n.x+-s*c*n.y+(u*s-a*l)*c,e.y=o*c*n.y+-h*c*n.x+(-u*o+a*h)*c,e}},{"../core":19}],105:[function(t,e){function r(t){this.renderer=t,this.mouse=new n,this.eventData=new i.utils.EventData,this.eventData.data=this.mouse,this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.math.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution),this.update()}var i=t("../core"),n=t("./InteractionData"),o=10,s=!0;r.prototype.constructor=r,e.exports=r,r.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},r.prototype.addEvents=function(){this.interactionDOMElement&&(window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),this.interactionDOMElement.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},r.prototype.removeEvents=function(){this.interactionDOMElement&&(window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},r.prototype.update=function(){if(requestAnimationFrame(this.update.bind(this)),!this.throttleUpdate()&&this.interactionDOMElement){if(this.didMove)return void(this.didMove=!1);this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut.bind(this),!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)}},r.prototype.dispatchEvent=function(t,e,r){r.stopped||(r.target=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},r.prototype.throttleUpdate=function(){var t=Date.now(),e=t-this.last;return e=e*o/1e3,1>e?!0:(this.last=t,!1)},r.prototype.mapPositionToPoint=function(t,e,r){var i=this.interactionDOMElement.getBoundingClientRect();t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)/this.resolution,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)/this.resolution},r.prototype.processInteractive=function(t,e,r,i,n){if(!e.visible)return!1;var o=e.children,s=!1;if(n=n||e.interactive,e.interactiveChildren)for(var a=o.length-1;a>=0;a--)!s&&i?s=this.processInteractive(t,o[a],r,!0,n):this.processInteractive(t,o[a],r,!1,!1);return n&&(i&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),s=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(s=e.containsPoint(t))),e.interactive&&r(e,s)),s},r.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,s&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},r.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},r.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},r.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},r.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},r.prototype.processMouseMove=function(t,e){this.dispatchEvent(t,"mousemove",this.eventData),this.processMouseOverOut(t,e)},r.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},r.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},r.prototype.onTouchStart=function(t){s&&t.preventDefault();for(var e=t.changedTouches,r=0;r<e.length;r++){var i=e[r],n=this.getTouchData(i);n.originalEvent=t,this.eventData.data=n,this.eventData.stopped=!1,this.processInteractive(n.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(n)}},r.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},r.prototype.onTouchEnd=function(t){s&&t.preventDefault();for(var e=t.changedTouches,r=0;r<e.length;r++){var i=e[r],n=this.getTouchData(i);n.originalEvent=t,this.eventData.data=n,this.eventData.stopped=!1,this.processInteractive(n.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(n)}},r.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},r.prototype.onTouchMove=function(t){s&&t.preventDefault();for(var e=t.changedTouches,r=0;r<e.length;r++){var i=e[r],n=this.getTouchData(i);n.originalEvent=t,this.eventData.data=n,this.eventData.stopped=!1,this.processInteractive(n.global,this.renderer._lastObjectRendered,this.processTouchMove,!1),this.returnTouchData(n)}},r.prototype.processTouchMove=function(t,e){e=e,this.dispatchEvent(t,"touchmove",this.eventData)},r.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new n),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),e},r.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.WebGLRenderer.registerPlugin("interaction",r),i.CanvasRenderer.registerPlugin("interaction",r)},{"../core":19,"./InteractionData":104}],106:[function(t,e){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":104,"./InteractionManager":105,"./interactiveTarget":107}],107:[function(t,e){var r=t("../core");r.DisplayObject.prototype.interactive=!1,r.DisplayObject.prototype.buttonMode=!1,r.DisplayObject.prototype.interactiveChildren=!0,r.DisplayObject.prototype.defaultCursor="pointer",r.DisplayObject.prototype._over=!1,r.DisplayObject.prototype._touchDown=!1,e.exports={}},{"../core":19}],108:[function(t,e){var r=t("resource-loader").Resource,i=t("../core"),n=t("../text");e.exports=function(){return function(t,e){if(!t.data||navigator.isCocoonJS)if(window.DOMParser){var o=new DOMParser;t.data=o.parseFromString(this.xhr.responseText,"text/xml")}else{var s=document.createElement("div");s.innerHTML=this.xhr.responseText,t.data=s}var a=t.data.nodeName;if(!t.data||!a||"#document"!==a.toLowerCase()&&"div"!==a.toLowerCase())return e();var h=t.data.getElementsByTagName("page")[0].getAttribute("file"),l={crossOrigin:t.crossOrigin,loadType:r.LOAD_TYPE.IMAGE};this.add(t.name+"_image",h,l,function(r){var o={},s=t.data.getElementsByTagName("info")[0],a=t.data.getElementsByTagName("common")[0];o.font=s.getAttribute("face"),o.size=parseInt(s.getAttribute("size"),10),o.lineHeight=parseInt(a.getAttribute("lineHeight"),10),o.chars={};for(var h=t.data.getElementsByTagName("char"),l=0;l<h.length;l++){var u=parseInt(h[l].getAttribute("id"),10),c=new i.math.Rectangle(parseInt(h[l].getAttribute("x"),10),parseInt(h[l].getAttribute("y"),10),parseInt(h[l].getAttribute("width"),10),parseInt(h[l].getAttribute("height"),10));o.chars[u]={xOffset:parseInt(h[l].getAttribute("xoffset"),10),yOffset:parseInt(h[l].getAttribute("yoffset"),10),xAdvance:parseInt(h[l].getAttribute("xadvance"),10),kerning:{},texture:i.utils.TextureCache[u]=new i.Texture(r.texture.baseTexture,c)}}var d=t.data.getElementsByTagName("kerning");for(l=0;l<d.length;l++){var p=parseInt(d[l].getAttribute("first"),10),f=parseInt(d[l].getAttribute("second"),10),g=parseInt(d[l].getAttribute("amount"),10);o.chars[f].kerning[p]=g}t.bitmapFont=o,n.BitmapText.fonts[o.font]=o,e()})}}},{"../core":19,"../text":124,"resource-loader":7}],109:[function(t,e){e.exports={Loader:t("./loader"),bitmapFontParser:t("./bitmapFontParser"),spineAtlasParser:t("./spineAtlasParser"),spritesheetParser:t("./spritesheetParser"),textureParser:t("./textureParser")},e.exports.loader=new e.exports.Loader},{"./bitmapFontParser":108,"./loader":110,"./spineAtlasParser":111,"./spritesheetParser":112,"./textureParser":113}],110:[function(t,e){var r=t("resource-loader"),i=t("./textureParser"),n=t("./spritesheetParser"),o=t("./spineAtlasParser"),s=t("./bitmapFontParser"),a=function(){r.call(this),this.use(r.middleware.parsing.json()).use(r.middleware.parsing.blob()).use(i()).use(n()).use(o()).use(s())};a.prototype=Object.create(r.prototype),a.prototype.constructor=a,e.exports=a},{"./bitmapFontParser":108,"./spineAtlasParser":111,"./spritesheetParser":112,"./textureParser":113,"resource-loader":7}],111:[function(t,e){var r=t("resource-loader").Resource,i=t("async"),n=t("../spine");e.exports=function(){return function(t,e){if(t.data&&t.data.bones){var o=t.url.substr(0,t.url.lastIndexOf("."))+".atlas",s={crossOrigin:t.crossOrigin,xhrType:r.XHR_RESPONSE_TYPE.TEXT},a=t.url.substr(0,t.url.lastIndexOf("/")+1);this.add(t.name+"_atlas",o,s,function(r){var o=new n.SpineRuntime.Atlas(this.xhr.responseText,a,r.crossOrigin),s=new n.SpineRuntime.SkeletonJsonParser(new n.SpineRuntime.AtlasAttachmentParser(o)),h=s.readSkeletonData(t.data);t.spineData=h,t.spineAtlas=o,i.each(o.pages,function(t,e){t.rendererObject.hasLoaded?e():t.rendererObject.once("loaded",e)},e)})}else e()}}},{"../spine":121,async:1,"resource-loader":7}],112:[function(t,e){var r=t("resource-loader").Resource,i=t("path"),n=t("../core");e.exports=function(){return function(t,e){if(t.data&&t.data.frames){var o={crossOrigin:t.crossOrigin,loadType:r.LOAD_TYPE.IMAGE},s=i.dirname(t.url.replace(this.baseUrl,"")),a=n.utils.getResolutionOfUrl(t.url);this.add(t.name+"_image",s+"/"+t.data.meta.image,o,function(r){t.textures={};var i=t.data.frames;for(var o in i){var s=i[o].frame;if(s){var h=null,l=null;if(h=i[o].rotated?new n.math.Rectangle(s.x,s.y,s.h,s.w):new n.math.Rectangle(s.x,s.y,s.w,s.h),i[o].trimmed&&(l=new n.math.Rectangle(i[o].spriteSourceSize.x/a,i[o].spriteSourceSize.y/a,i[o].sourceSize.w/a,i[o].sourceSize.h/a)),i[o].rotated){var u=h.width;h.width=h.height,h.height=u}h.x/=a,h.y/=a,h.width/=a,h.height/=a,t.textures[o]=new n.Texture(r.texture.baseTexture,h,h.clone(),l,i[o].rotated),n.utils.TextureCache[o]=t.textures[o]}}e()})}else e()}}},{"../core":19,path:2,"resource-loader":7}],113:[function(t,e){var r=t("../core");e.exports=function(){return function(t,e){t.data&&t.data.nodeName&&"img"===t.data.nodeName.toLowerCase()&&(t.texture=new r.Texture(new r.BaseTexture(t.data,null,r.utils.getResolutionOfUrl(t.url))),r.utils.TextureCache[t.url]=t.texture),e()}}},{"../core":19}],114:[function(t,e){function r(t,e,n,o,s){i.Container.call(this),this.texture=t,this.uvs=n||new Float32Array([0,1,1,1,1,0,0,1]),this.vertices=e||new Float32Array([0,0,100,0,100,100,0,100]),this.indices=o||new Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=i.CONST.BLEND_MODES.NORMAL,this.canvasPadding=0,this.drawMode=s||r.DRAW_MODES.TRIANGLE_MESH}var i=t("../core");r.prototype=Object.create(i.Container.prototype),r.prototype.constructor=r,e.exports=r,r.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.mesh),t.plugins.mesh.render(this)},r.prototype._renderCanvas=function(t){var e=t.context,i=this.worldTransform;t.roundPixels?e.setTransform(i.a,i.b,i.c,i.d,0|i.tx,0|i.ty):e.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),this.drawMode===r.DRAW_MODES.TRIANGLE_MESH?this._renderCanvasTriangleMesh(e):this._renderCanvasTriangles(e)},r.prototype._renderCanvasTriangleMesh=function(t){for(var e=this.vertices,r=this.uvs,i=e.length/2,n=0;i-2>n;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},r.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;n>o;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},r.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this.texture.baseTexture.source,a=this.texture.width,h=this.texture.height,l=e[i],u=e[n],c=e[o],d=e[i+1],p=e[n+1],f=e[o+1],g=r[i]*a,v=r[n]*a,m=r[o]*a,y=r[i+1]*h,x=r[n+1]*h,b=r[o+1]*h;if(this.canvasPadding>0){var T=this.canvasPadding/this.worldTransform.a,_=this.canvasPadding/this.worldTransform.d,E=(l+u+c)/3,w=(d+p+f)/3,S=l-E,A=d-w,C=Math.sqrt(S*S+A*A);l=E+S/C*(C+T),d=w+A/C*(C+_),S=u-E,A=p-w,C=Math.sqrt(S*S+A*A),u=E+S/C*(C+T),p=w+A/C*(C+_),S=c-E,A=f-w,C=Math.sqrt(S*S+A*A),c=E+S/C*(C+T),f=w+A/C*(C+_)}t.save(),t.beginPath(),t.moveTo(l,d),t.lineTo(u,p),t.lineTo(c,f),t.closePath(),t.clip();var M=g*x+y*m+v*b-x*m-y*v-g*b,R=l*x+y*c+u*b-x*c-y*u-l*b,F=g*u+l*m+v*c-u*m-l*v-g*c,D=g*x*c+y*u*m+l*v*b-l*x*m-y*v*c-g*u*b,O=d*x+y*f+p*b-x*f-y*p-d*b,P=g*p+d*m+v*f-p*m-d*v-g*f,B=g*x*f+y*p*m+d*v*b-d*x*m-y*v*f-g*p*b;t.transform(R/M,O/M,F/M,P/M,D/M,B/M),t.drawImage(s,0,0),t.restore()},r.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;i-2>n;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],l=r[o+1],u=r[o+3],c=r[o+5];e.moveTo(s,l),e.lineTo(a,u),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},r.prototype.onTextureUpdate=function(){this.updateFrame=!0},r.prototype.getBounds=function(t){for(var e=t||this.worldTransform,r=e.a,n=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,l=-1/0,u=-1/0,c=1/0,d=1/0,p=this.vertices,f=0,g=p.length;g>f;f+=2){var v=p[f],m=p[f+1],y=r*v+o*m+a,x=s*m+n*v+h;c=c>y?y:c,d=d>x?x:d,l=y>l?y:l,u=x>u?x:u}if(c===-1/0||1/0===u)return i.math.Rectangle.EMPTY;var b=this._bounds;return b.x=c,b.width=l-c,b.y=d,b.height=u-d,this._currentBounds=b,b},r.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":19}],115:[function(t,e){function r(t,e){i.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this.refresh()}var i=t("./Mesh");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.refresh=function(){var t=this.points;if(!(t.length<1)){var e=this.uvs,r=this.indices,i=this.colors;e[0]=0,e[1]=0,e[2]=0,e[3]=1,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var n,o,s,a=t.length,h=1;a>h;h++)n=t[h],o=4*h,s=h/(a-1),h%2?(e[o]=s,e[o+1]=0,e[o+2]=s,e[o+3]=1):(e[o]=s,e[o+1]=0,e[o+2]=s,e[o+3]=1),o=2*h,i[o]=1,i[o+1]=1,o=2*h,r[o]=o,r[o+1]=o+1 }},r.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,l=0,u=this.vertices,c=t.length,d=0;c>d;d++)r=t[d],i=4*d,e=d<t.length-1?t[d+1]:r,l=-(e.x-a.x),h=e.y-a.y,n=10*(1-d/(c-1)),n>1&&(n=1),o=Math.sqrt(h*h+l*l),s=this.texture.height/2,h/=o,l/=o,h*=s,l*=s,u[i]=r.x+h,u[i+1]=r.y+l,u[i+2]=r.x-h,u[i+3]=r.y-l,a=r;this.containerUpdateTransform()}}},{"./Mesh":114}],116:[function(t,e){e.exports={Mesh:t("./Mesh"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":114,"./Rope":115,"./webgl/MeshRenderer":117,"./webgl/MeshShader":118}],117:[function(t,e){function r(t){i.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3}var i=t("../../core/renderers/webgl/utils/ObjectRenderer"),n=t("../../core/renderers/webgl/WebGLRenderer");r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,n.registerPlugin("mesh",r),r.prototype.onContextChange=function(){},r.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,i=t.texture.baseTexture,n=e.shaderManager.plugins.meshShader,o=r.TRIANGLE_STRIP;e.blendModeManager.setBlendMode(t.blendMode),r.uniformMatrix3fv(n.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),r.uniformMatrix3fv(n.uniforms.projectionMatrix._location,!1,e.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform1f(n.uniforms.alpha._location,t.worldAlpha),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices),r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i)),r.drawElements(o,t.indices.length,r.UNSIGNED_SHORT,0)},r.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},r.prototype.flush=function(){},r.prototype.start=function(){var t=(this.renderer.gl,this.renderer.shaderManager.plugins.meshShader);this.renderer.shaderManager.setShader(t)},r.prototype.destroy=function(){}},{"../../core/renderers/webgl/WebGLRenderer":38,"../../core/renderers/webgl/utils/ObjectRenderer":52}],118:[function(t,e){function r(t){i.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var i=t("../../core");r.prototype=Object.create(i.Shader.prototype),r.prototype.constructor=r,e.exports=r,i.ShaderManager.registerPlugin("meshShader",r)},{"../../core":19}],119:[function(t,e){function r(t){if(i.Container.call(this),!t)throw new Error("The spineData param is required.");this.spineData=t,this.skeleton=new n.Skeleton(t),this.skeleton.updateWorldTransform(),this.stateData=new n.AnimationStateData(t),this.state=new n.AnimationState(this.stateData),this.slotContainers=[];for(var e=0,r=this.skeleton.drawOrder.length;r>e;e++){var o=this.skeleton.drawOrder[e],s=o.attachment,a=new i.Container;if(this.slotContainers.push(a),this.addChild(a),s instanceof n.RegionAttachment){var h=s.rendererObject.name,l=this.createSprite(o,s);o.currentSprite=l,o.currentSpriteName=h,a.addChild(l)}else{if(!(s instanceof n.MeshAttachment))continue;var u=this.createMesh(o,s);o.currentMesh=u,o.currentMeshName=s.name,a.addChild(u)}}this.autoUpdate=!0}var i=t("../core"),n=t("./SpineRuntime");n.Bone.yDown=!0,r.prototype=Object.create(i.Container.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{autoUpdate:{get:function(){return this.updateTransform===r.prototype.autoUpdateTransform},set:function(t){this.updateTransform=t?r.prototype.autoUpdateTransform:i.Container.prototype.updateTransform}}}),r.prototype.update=function(t){this.state.update(t),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var e=this.skeleton.drawOrder,r=0,o=e.length;o>r;r++){var s=e[r],a=s.attachment,h=this.slotContainers[r];if(a){var l=a.type;if(l===n.AttachmentType.region){if(a.rendererObject&&(!s.currentSpriteName||s.currentSpriteName!==a.rendererObject.name)){var u=a.rendererObject.name;if(void 0!==s.currentSprite&&(s.currentSprite.visible=!1),s.sprites=s.sprites||{},void 0!==s.sprites[u])s.sprites[u].visible=!0;else{var c=this.createSprite(s,a);h.addChild(c)}s.currentSprite=s.sprites[u],s.currentSpriteName=u}var d=s.bone;h.position.x=d.worldX+a.x*d.m00+a.y*d.m01,h.position.y=d.worldY+a.x*d.m10+a.y*d.m11,h.scale.x=d.worldScaleX,h.scale.y=d.worldScaleY,h.rotation=-(s.bone.worldRotation*n.degRad),s.currentSprite.tint=i.utils.rgb2hex([s.r,s.g,s.b])}else{if(l!==n.AttachmentType.skinnedmesh){h.visible=!1;continue}if(!s.currentMeshName||s.currentMeshName!==a.name){var p=a.name;if(void 0!==s.currentMesh&&(s.currentMesh.visible=!1),s.meshes=s.meshes||{},void 0!==s.meshes[p])s.meshes[p].visible=!0;else{var f=this.createMesh(s,a);h.addChild(f)}s.currentMesh=s.meshes[p],s.currentMeshName=p}a.computeWorldVertices(s.bone.skeleton.x,s.bone.skeleton.y,s,s.currentMesh.vertices)}h.visible=!0,h.alpha=s.a}else h.visible=!1}},r.prototype.autoUpdateTransform=function(){this.lastTime=this.lastTime||Date.now();var t=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.update(t),i.Container.prototype.updateTransform.call(this)},r.prototype.createSprite=function(t,e){var r=e.rendererObject,o=r.page.rendererObject,s=new i.math.Rectangle(r.x,r.y,r.rotate?r.height:r.width,r.rotate?r.width:r.height),a=new i.Texture(o,s),h=new i.Sprite(a),l=r.rotate?.5*Math.PI:0;return h.scale.set(r.width/r.originalWidth,r.height/r.originalHeight),h.rotation=l-e.rotation*n.degRad,h.anchor.x=h.anchor.y=.5,t.sprites=t.sprites||{},t.sprites[r.name]=h,h},r.prototype.createMesh=function(t,e){var r=e.rendererObject,n=r.page.rendererObject,o=new i.Texture(n),s=new i.Strip(o);return s.drawMode=i.Strip.DRAW_MODES.TRIANGLES,s.canvasPadding=1.5,s.vertices=new Float32Array(e.uvs.length),s.uvs=e.uvs,s.indices=e.triangles,t.meshes=t.meshes||{},t.meshes[e.name]=s,s}},{"../core":19,"./SpineRuntime":120}],120:[function(t,e){var r=t("../core"),i=e.exports={radDeg:180/Math.PI,degRad:Math.PI/180,temp:[],Float32Array:"undefined"==typeof Float32Array?Array:Float32Array,Uint16Array:"undefined"==typeof Uint16Array?Array:Uint16Array};i.BoneData=function(t,e){this.name=t,this.parent=e},i.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,inheritScale:!0,inheritRotation:!0,flipX:!1,flipY:!1},i.SlotData=function(t,e){this.name=t,this.boneData=e},i.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null,additiveBlending:!1},i.IkConstraintData=function(t){this.name=t,this.bones=[]},i.IkConstraintData.prototype={target:null,bendDirection:1,mix:1},i.Bone=function(t,e,r){this.data=t,this.skeleton=e,this.parent=r,this.setToSetupPose()},i.Bone.yDown=!1,i.Bone.prototype={x:0,y:0,rotation:0,rotationIK:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,worldFlipX:!1,worldFlipY:!1,updateWorldTransform:function(){var t=this.parent;if(t)this.worldX=this.x*t.m00+this.y*t.m01+t.worldX,this.worldY=this.x*t.m10+this.y*t.m11+t.worldY,this.data.inheritScale?(this.worldScaleX=t.worldScaleX*this.scaleX,this.worldScaleY=t.worldScaleY*this.scaleY):(this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY),this.worldRotation=this.data.inheritRotation?t.worldRotation+this.rotationIK:this.rotationIK,this.worldFlipX=t.worldFlipX!=this.flipX,this.worldFlipY=t.worldFlipY!=this.flipY;else{var e=this.skeleton.flipX,r=this.skeleton.flipY;this.worldX=e?-this.x:this.x,this.worldY=r!=i.Bone.yDown?-this.y:this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotationIK,this.worldFlipX=e!=this.flipX,this.worldFlipY=r!=this.flipY}var n=this.worldRotation*i.degRad,o=Math.cos(n),s=Math.sin(n);this.worldFlipX?(this.m00=-o*this.worldScaleX,this.m01=s*this.worldScaleY):(this.m00=o*this.worldScaleX,this.m01=-s*this.worldScaleY),this.worldFlipY!=i.Bone.yDown?(this.m10=-s*this.worldScaleX,this.m11=-o*this.worldScaleY):(this.m10=s*this.worldScaleX,this.m11=o*this.worldScaleY)},setToSetupPose:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.rotationIK=this.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.flipX=t.flipX,this.flipY=t.flipY},worldToLocal:function(t){var e=t[0]-this.worldX,r=t[1]-this.worldY,n=this.m00,o=this.m10,s=this.m01,a=this.m11;this.worldFlipX!=(this.worldFlipY!=i.Bone.yDown)&&(n=-n,a=-a);var h=1/(n*a-s*o);t[0]=e*n*h-r*s*h,t[1]=r*a*h-e*o*h},localToWorld:function(t){var e=t[0],r=t[1];t[0]=e*this.m00+r*this.m01+this.worldX,t[1]=e*this.m10+r*this.m11+this.worldY}},i.Slot=function(t,e){this.data=t,this.bone=e,this.setToSetupPose()},i.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,attachmentVertices:[],setAttachment:function(t){this.attachment=t,this._attachmentTime=this.bone.skeleton.time,this.attachmentVertices.length=0},setAttachmentTime:function(t){this._attachmentTime=this.bone.skeleton.time-t},getAttachmentTime:function(){return this.bone.skeleton.time-this._attachmentTime},setToSetupPose:function(){var t=this.data;this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a;for(var e=this.bone.skeleton.data.slots,r=0,i=e.length;i>r;r++)if(e[r]==t){this.setAttachment(t.attachmentName?this.bone.skeleton.getAttachmentBySlotIndex(r,t.attachmentName):null);break}}},i.IkConstraint=function(t,e){this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=[];for(var r=0,i=t.bones.length;i>r;r++)this.bones.push(e.findBone(t.bones[r].name));this.target=e.findBone(t.target.name)},i.IkConstraint.prototype={apply:function(){var t=this.target,e=this.bones;switch(e.length){case 1:i.IkConstraint.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:i.IkConstraint.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}}},i.IkConstraint.apply1=function(t,e,r,n){var o=t.data.inheritRotation&&t.parent?t.parent.worldRotation:0,s=t.rotation,a=Math.atan2(r-t.worldY,e-t.worldX)*i.radDeg-o;t.rotationIK=s+(a-s)*n},i.IkConstraint.apply2=function(t,e,r,n,o,s){var a=e.rotation,h=t.rotation;if(!s)return e.rotationIK=a,void(t.rotationIK=h);var l,u,c=i.temp,d=t.parent;d?(c[0]=r,c[1]=n,d.worldToLocal(c),r=(c[0]-t.x)*d.worldScaleX,n=(c[1]-t.y)*d.worldScaleY):(r-=t.x,n-=t.y),e.parent==t?(l=e.x,u=e.y):(c[0]=e.x,c[1]=e.y,e.parent.localToWorld(c),t.worldToLocal(c),l=c[0],u=c[1]);var p=l*t.worldScaleX,f=u*t.worldScaleY,g=Math.atan2(f,p),v=Math.sqrt(p*p+f*f),m=e.data.length*e.worldScaleX,y=2*v*m;if(1e-4>y)return void(e.rotationIK=a+(Math.atan2(n,r)*i.radDeg-h-a)*s);var x=(r*r+n*n-v*v-m*m)/y;-1>x?x=-1:x>1&&(x=1);var b=Math.acos(x)*o,T=v+m*x,_=m*Math.sin(b),E=Math.atan2(n*T-r*_,r*T+n*_),w=(E-g)*i.radDeg-h;w>180?w-=360:-180>w&&(w+=360),t.rotationIK=h+w*s,w=(b+g)*i.radDeg-a,w>180?w-=360:-180>w&&(w+=360),e.rotationIK=a+(w+t.worldRotation-e.parent.worldRotation)*s},i.Skin=function(t){this.name=t,this.attachments={}},i.Skin.prototype={addAttachment:function(t,e,r){this.attachments[t+":"+e]=r},getAttachment:function(t,e){return this.attachments[t+":"+e]},_attachAll:function(t,e){for(var r in e.attachments){var i=r.indexOf(":"),n=parseInt(r.substring(0,i)),o=r.substring(i+1),s=t.slots[n];if(s.attachment&&s.attachment.name==o){var a=this.getAttachment(n,o);a&&s.setAttachment(a)}}}},i.Animation=function(t,e,r){this.name=t,this.timelines=e,this.duration=r},i.Animation.prototype={apply:function(t,e,r,i,n){i&&0!=this.duration&&(r%=this.duration,e%=this.duration);for(var o=this.timelines,s=0,a=o.length;a>s;s++)o[s].apply(t,e,r,n,1)},mix:function(t,e,r,i,n,o){i&&0!=this.duration&&(r%=this.duration,e%=this.duration);for(var s=this.timelines,a=0,h=s.length;h>a;a++)s[a].apply(t,e,r,n,o)}},i.Animation.binarySearch=function(t,e,r){var i=0,n=Math.floor(t.length/r)-2;if(!n)return r;for(var o=n>>>1;;){if(t[(o+1)*r]<=e?i=o+1:n=o,i==n)return(i+1)*r;o=i+n>>>1}},i.Animation.binarySearch1=function(t,e){var r=0,i=t.length-2;if(!i)return 1;for(var n=i>>>1;;){if(t[n+1]<=e?r=n+1:i=n,r==i)return r+1;n=r+i>>>1}},i.Animation.linearSearch=function(t,e,r){for(var i=0,n=t.length-r;n>=i;i+=r)if(t[i]>e)return i;return-1},i.Curves=function(){this.curves=[]},i.Curves.prototype={setLinear:function(t){this.curves[19*t]=0},setStepped:function(t){this.curves[19*t]=1},setCurve:function(t,e,r,i,n){var o=.1,s=o*o,a=s*o,h=3*o,l=3*s,u=6*s,c=6*a,d=2*-e+i,p=2*-r+n,f=3*(e-i)+1,g=3*(r-n)+1,v=e*h+d*l+f*a,m=r*h+p*l+g*a,y=d*u+f*c,x=p*u+g*c,b=f*c,T=g*c,_=19*t,E=this.curves;E[_++]=2;for(var w=v,S=m,A=_+19-1;A>_;_+=2)E[_]=w,E[_+1]=S,v+=y,m+=x,y+=b,x+=T,w+=v,S+=m},getCurvePercent:function(t,e){e=0>e?0:e>1?1:e;var r=this.curves,i=19*t,n=r[i];if(0===n)return e;if(1==n)return 0;i++;for(var o=0,s=i,a=i+19-1;a>i;i+=2)if(o=r[i],o>=e){var h,l;return i==s?(h=0,l=0):(h=r[i-2],l=r[i-1]),l+(r[i+1]-l)*(e-h)/(o-h)}var u=r[i-1];return u+(1-u)*(e-o)/(1-o)}},i.RotateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,r){t*=2,this.frames[t]=e,this.frames[t+1]=r},apply:function(t,e,r,n,o){var s=this.frames;if(!(r<s[0])){var a=t.bones[this.boneIndex];if(r>=s[s.length-2]){for(var h=a.data.rotation+s[s.length-1]-a.rotation;h>180;)h-=360;for(;-180>h;)h+=360;return void(a.rotation+=h*o)}var l=i.Animation.binarySearch(s,r,2),u=s[l-1],c=s[l],d=1-(r-c)/(s[l-2]-c);d=this.curves.getCurvePercent(l/2-1,d);for(var h=s[l+1]-u;h>180;)h-=360;for(;-180>h;)h+=360;for(h=a.data.rotation+(u+h*d)-a.rotation;h>180;)h-=360;for(;-180>h;)h+=360;a.rotation+=h*o}}},i.TranslateTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,r,i){t*=3,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=i},apply:function(t,e,r,n,o){var s=this.frames;if(!(r<s[0])){var a=t.bones[this.boneIndex];if(r>=s[s.length-3])return a.x+=(a.data.x+s[s.length-2]-a.x)*o,void(a.y+=(a.data.y+s[s.length-1]-a.y)*o);var h=i.Animation.binarySearch(s,r,3),l=s[h-2],u=s[h-1],c=s[h],d=1-(r-c)/(s[h+-3]-c);d=this.curves.getCurvePercent(h/3-1,d),a.x+=(a.data.x+l+(s[h+1]-l)*d-a.x)*o,a.y+=(a.data.y+u+(s[h+2]-u)*d-a.y)*o}}},i.ScaleTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,r,i){t*=3,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=i},apply:function(t,e,r,n,o){var s=this.frames;if(!(r<s[0])){var a=t.bones[this.boneIndex];if(r>=s[s.length-3])return a.scaleX+=(a.data.scaleX*s[s.length-2]-a.scaleX)*o,void(a.scaleY+=(a.data.scaleY*s[s.length-1]-a.scaleY)*o);var h=i.Animation.binarySearch(s,r,3),l=s[h-2],u=s[h-1],c=s[h],d=1-(r-c)/(s[h+-3]-c);d=this.curves.getCurvePercent(h/3-1,d),a.scaleX+=(a.data.scaleX*(l+(s[h+1]-l)*d)-a.scaleX)*o,a.scaleY+=(a.data.scaleY*(u+(s[h+2]-u)*d)-a.scaleY)*o}}},i.ColorTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=5*t},i.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(t,e,r,i,n,o){t*=5,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=o},apply:function(t,e,r,n,o){var s=this.frames;if(!(r<s[0])){var a,h,l,u;if(r>=s[s.length-5]){var c=s.length-1;a=s[c-3],h=s[c-2],l=s[c-1],u=s[c]}else{var d=i.Animation.binarySearch(s,r,5),p=s[d-4],f=s[d-3],g=s[d-2],v=s[d-1],m=s[d],y=1-(r-m)/(s[d-5]-m);y=this.curves.getCurvePercent(d/5-1,y),a=p+(s[d+1]-p)*y,h=f+(s[d+2]-f)*y,l=g+(s[d+3]-g)*y,u=v+(s[d+4]-v)*y}var x=t.slots[this.slotIndex];1>o?(x.r+=(a-x.r)*o,x.g+=(h-x.g)*o,x.b+=(l-x.b)*o,x.a+=(u-x.a)*o):(x.r=a,x.g=h,x.b=l,x.a=u)}}},i.AttachmentTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.attachmentNames=[],this.attachmentNames.length=t},i.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,r){this.frames[t]=e,this.attachmentNames[t]=r},apply:function(t,e,r){var n=this.frames;if(r<n[0])return void(e>r&&this.apply(t,e,Number.MAX_VALUE,null,0));e>r&&(e=-1);var o=r>=n[n.length-1]?n.length-1:i.Animation.binarySearch1(n,r)-1;if(!(n[o]<e)){var s=this.attachmentNames[o];t.slots[this.slotIndex].setAttachment(s?t.getAttachmentBySlotIndex(this.slotIndex,s):null)}}},i.EventTimeline=function(t){this.frames=[],this.frames.length=t,this.events=[],this.events.length=t},i.EventTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,r){this.frames[t]=e,this.events[t]=r},apply:function(t,e,r,n,o){if(n){var s=this.frames,a=s.length;if(e>r)this.apply(t,e,Number.MAX_VALUE,n,o),e=-1;else if(e>=s[a-1])return;if(!(r<s[0])){var h;if(e<s[0])h=0;else{h=i.Animation.binarySearch1(s,e);for(var l=s[h];h>0&&s[h-1]==l;)h--}for(var u=this.events;a>h&&r>=s[h];h++)n.push(u[h])}}}},i.DrawOrderTimeline=function(t){this.frames=[],this.frames.length=t,this.drawOrders=[],this.drawOrders.length=t},i.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(t,e,r){this.frames[t]=e,this.drawOrders[t]=r},apply:function(t,e,r){var n=this.frames;if(!(r<n[0])){var o;o=r>=n[n.length-1]?n.length-1:i.Animation.binarySearch1(n,r)-1;var s=t.drawOrder,a=t.slots,h=this.drawOrders[o];if(h)for(var l=0,u=h.length;u>l;l++)s[l]=t.slots[h[l]];else for(var l=0,u=a.length;u>l;l++)s[l]=a[l]}}},i.FfdTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=t,this.frameVertices=[],this.frameVertices.length=t},i.FfdTimeline.prototype={slotIndex:0,attachment:0,getFrameCount:function(){return this.frames.length},setFrame:function(t,e,r){this.frames[t]=e,this.frameVertices[t]=r},apply:function(t,e,r,n,o){var s=t.slots[this.slotIndex];if(s.attachment==this.attachment){var a=this.frames;if(!(r<a[0])){var h=this.frameVertices,l=h[0].length,u=s.attachmentVertices;if(u.length!=l&&(o=1),u.length=l,r>=a[a.length-1]){var c=h[a.length-1];if(1>o)for(var d=0;l>d;d++)u[d]+=(c[d]-u[d])*o;else for(var d=0;l>d;d++)u[d]=c[d]}else{var p=i.Animation.binarySearch1(a,r),f=a[p],g=1-(r-f)/(a[p-1]-f);g=this.curves.getCurvePercent(p-1,0>g?0:g>1?1:g);var v=h[p-1],m=h[p];if(1>o)for(var d=0;l>d;d++){var y=v[d];u[d]+=(y+(m[d]-y)*g-u[d])*o}else for(var d=0;l>d;d++){var y=v[d];u[d]=y+(m[d]-y)*g}}}}}},i.IkConstraintTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=3*t},i.IkConstraintTimeline.prototype={ikConstraintIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(t,e,r,i){t*=3,this.frames[t]=e,this.frames[t+1]=r,this.frames[t+2]=i},apply:function(t,e,r,n,o){var s=this.frames;if(!(r<s[0])){var a=t.ikConstraints[this.ikConstraintIndex];if(r>=s[s.length-3])return a.mix+=(s[s.length-2]-a.mix)*o,void(a.bendDirection=s[s.length-1]);var h=i.Animation.binarySearch(s,r,3),l=s[h+-2],u=s[h],c=1-(r-u)/(s[h+-3]-u);c=this.curves.getCurvePercent(h/3-1,c);var d=l+(s[h+1]-l)*c;a.mix+=(d-a.mix)*o,a.bendDirection=s[h+-1]}}},i.FlipXTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,r){t*=2,this.frames[t]=e,this.frames[t+1]=r?1:0},apply:function(t,e,r){var n=this.frames;if(r<n[0])return void(e>r&&this.apply(t,e,Number.MAX_VALUE,null,0));e>r&&(e=-1);var o=(r>=n[n.length-2]?n.length:i.Animation.binarySearch(n,r,2))-2;n[o]<e||(t.bones[boneIndex].flipX=0!=n[o+1])}},i.FlipYTimeline=function(t){this.curves=new i.Curves(t),this.frames=[],this.frames.length=2*t},i.FlipYTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(t,e,r){t*=2,this.frames[t]=e,this.frames[t+1]=r?1:0},apply:function(t,e,r){var n=this.frames;if(r<n[0])return void(e>r&&this.apply(t,e,Number.MAX_VALUE,null,0));e>r&&(e=-1);var o=(r>=n[n.length-2]?n.length:i.Animation.binarySearch(n,r,2))-2;n[o]<e||(t.bones[boneIndex].flipY=0!=n[o+1])}},i.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[]},i.SkeletonData.prototype={name:null,defaultSkin:null,width:0,height:0,version:null,hash:null,findBone:function(t){for(var e=this.bones,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null},findBoneIndex:function(t){for(var e=this.bones,r=0,i=e.length;i>r;r++)if(e[r].name==t)return r;return-1},findSlot:function(t){for(var e=this.slots,r=0,i=e.length;i>r;r++)if(e[r].name==t)return slot[r];return null},findSlotIndex:function(t){for(var e=this.slots,r=0,i=e.length;i>r;r++)if(e[r].name==t)return r;return-1},findSkin:function(t){for(var e=this.skins,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null},findEvent:function(t){for(var e=this.events,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null},findAnimation:function(t){for(var e=this.animations,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null},findIkConstraint:function(t){for(var e=this.ikConstraints,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null}},i.Skeleton=function(t){this.data=t,this.bones=[];for(var e=0,r=t.bones.length;r>e;e++){var n=t.bones[e],o=n.parent?this.bones[t.bones.indexOf(n.parent)]:null;this.bones.push(new i.Bone(n,this,o))}this.slots=[],this.drawOrder=[];for(var e=0,r=t.slots.length;r>e;e++){var s=t.slots[e],a=this.bones[t.bones.indexOf(s.boneData)],h=new i.Slot(s,a);this.slots.push(h),this.drawOrder.push(h)}this.ikConstraints=[];for(var e=0,r=t.ikConstraints.length;r>e;e++)this.ikConstraints.push(new i.IkConstraint(t.ikConstraints[e],this));this.boneCache=[],this.updateCache()},i.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateCache:function(){var t=this.ikConstraints,e=t.length,r=e+1,i=this.boneCache;i.length>r&&(i.length=r);for(var n=0,o=i.length;o>n;n++)i[n].length=0;for(;i.length<r;)i[i.length]=[];var s=i[0],a=this.bones;t:for(var n=0,o=a.length;o>n;n++){var h=a[n],l=h;do{for(var u=0;e>u;u++)for(var c=t[u],d=c.bones[0],p=c.bones[c.bones.length-1];;){if(l==p){i[u].push(h),i[u+1].push(h);continue t}if(p==d)break;p=p.parent}l=l.parent}while(l);s[s.length]=h}},updateWorldTransform:function(){for(var t=this.bones,e=0,r=t.length;r>e;e++){var i=t[e];i.rotationIK=i.rotation}for(var e=0,n=this.boneCache.length-1;;){for(var o=this.boneCache[e],s=0,a=o.length;a>s;s++)o[s].updateWorldTransform();if(e==n)break;this.ikConstraints[e].apply(),e++}},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var t=this.bones,e=0,r=t.length;r>e;e++)t[e].setToSetupPose();for(var i=this.ikConstraints,e=0,r=i.length;r>e;e++){var n=i[e];n.bendDirection=n.data.bendDirection,n.mix=n.data.mix}},setSlotsToSetupPose:function(){for(var t=this.slots,e=this.drawOrder,r=0,i=t.length;i>r;r++)e[r]=t[r],t[r].setToSetupPose(r)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(t){for(var e=this.bones,r=0,i=e.length;i>r;r++)if(e[r].data.name==t)return e[r];return null},findBoneIndex:function(t){for(var e=this.bones,r=0,i=e.length;i>r;r++)if(e[r].data.name==t)return r;return-1},findSlot:function(t){for(var e=this.slots,r=0,i=e.length;i>r;r++)if(e[r].data.name==t)return e[r];return null},findSlotIndex:function(t){for(var e=this.slots,r=0,i=e.length;i>r;r++)if(e[r].data.name==t)return r;return-1},setSkinByName:function(t){var e=this.data.findSkin(t);if(!e)throw"Skin not found: "+t;this.setSkin(e)},setSkin:function(t){if(t)if(this.skin)t._attachAll(this,this.skin);else for(var e=this.slots,r=0,i=e.length;i>r;r++){var n=e[r],o=n.data.attachmentName;if(o){var s=t.getAttachment(r,o);s&&n.setAttachment(s)}}this.skin=t},getAttachmentBySlotName:function(t,e){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(t),e)},getAttachmentBySlotIndex:function(t,e){if(this.skin){var r=this.skin.getAttachment(t,e);if(r)return r}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},setAttachment:function(t,e){for(var r=this.slots,i=0,n=r.length;n>i;i++){var o=r[i];if(o.data.name==t){var s=null;if(e&&(s=this.getAttachmentBySlotIndex(i,e),!s))throw"Attachment not found: "+e+", for slot: "+t;return void o.setAttachment(s)}}throw"Slot not found: "+t},findIkConstraint:function(t){for(var e=this.ikConstraints,r=0,i=e.length;i>r;r++)if(e[r].data.name==t)return e[r];return null},update:function(t){this.time+=t}},i.EventData=function(t){this.name=t},i.EventData.prototype={intValue:0,floatValue:0,stringValue:null},i.Event=function(t){this.data=t},i.Event.prototype={intValue:0,floatValue:0,stringValue:null},i.AttachmentType={region:0,boundingbox:1,mesh:2,skinnedmesh:3},i.RegionAttachment=function(t){this.name=t,this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},i.RegionAttachment.prototype={type:i.AttachmentType.region,x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(t,e,r,i,n){var o=this.uvs;n?(o[2]=t,o[3]=i,o[4]=t,o[5]=e,o[6]=r,o[7]=e,o[0]=r,o[1]=i):(o[0]=t,o[1]=i,o[2]=t,o[3]=e,o[4]=r,o[5]=e,o[6]=r,o[7]=i)},updateOffset:function(){var t=this.width/this.regionOriginalWidth*this.scaleX,e=this.height/this.regionOriginalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.regionOffsetX*t,n=-this.height/2*this.scaleY+this.regionOffsetY*e,o=r+this.regionWidth*t,s=n+this.regionHeight*e,a=this.rotation*i.degRad,h=Math.cos(a),l=Math.sin(a),u=r*h+this.x,c=r*l,d=n*h+this.y,p=n*l,f=o*h+this.x,g=o*l,v=s*h+this.y,m=s*l,y=this.offset;y[0]=u-p,y[1]=d+c,y[2]=u-m,y[3]=v+c,y[4]=f-m,y[5]=v+g,y[6]=f-p,y[7]=d+g},computeVertices:function(t,e,r,i){t+=r.worldX,e+=r.worldY;var n=r.m00,o=r.m01,s=r.m10,a=r.m11,h=this.offset;i[0]=h[0]*n+h[1]*o+t,i[1]=h[0]*s+h[1]*a+e,i[2]=h[2]*n+h[3]*o+t,i[3]=h[2]*s+h[3]*a+e,i[4]=h[4]*n+h[5]*o+t,i[5]=h[4]*s+h[5]*a+e,i[6]=h[6]*n+h[7]*o+t,i[7]=h[6]*s+h[7]*a+e}},i.MeshAttachment=function(t){this.name=t},i.MeshAttachment.prototype={type:i.AttachmentType.mesh,vertices:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var t=this.regionU2-this.regionU,e=this.regionV2-this.regionV,r=this.regionUVs.length;if(this.uvs&&this.uvs.length==r||(this.uvs=new i.Float32Array(r)),this.regionRotate)for(var n=0;r>n;n+=2)this.uvs[n]=this.regionU+this.regionUVs[n+1]*t,this.uvs[n+1]=this.regionV+e-this.regionUVs[n]*e;else for(var n=0;r>n;n+=2)this.uvs[n]=this.regionU+this.regionUVs[n]*t,this.uvs[n+1]=this.regionV+this.regionUVs[n+1]*e},computeWorldVertices:function(t,e,r,i){var n=r.bone;t+=n.worldX,e+=n.worldY;var o=n.m00,s=n.m01,a=n.m10,h=n.m11,l=this.vertices,u=l.length;r.attachmentVertices.length==u&&(l=r.attachmentVertices);for(var c=0;u>c;c+=2){var d=l[c],p=l[c+1];i[c]=d*o+p*s+t,i[c+1]=d*a+p*h+e}}},i.SkinnedMeshAttachment=function(t){this.name=t},i.SkinnedMeshAttachment.prototype={type:i.AttachmentType.skinnedmesh,bones:null,weights:null,uvs:null,regionUVs:null,triangles:null,hullLength:0,r:1,g:1,b:1,a:1,path:null,rendererObject:null,regionU:0,regionV:0,regionU2:0,regionV2:0,regionRotate:!1,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,edges:null,width:0,height:0,updateUVs:function(){var t=this.regionU2-this.regionU,e=this.regionV2-this.regionV,r=this.regionUVs.length;if(this.uvs&&this.uvs.length==r||(this.uvs=new i.Float32Array(r)),this.regionRotate)for(var n=0;r>n;n+=2)this.uvs[n]=this.regionU+this.regionUVs[n+1]*t,this.uvs[n+1]=this.regionV+e-this.regionUVs[n]*e;else for(var n=0;r>n;n+=2)this.uvs[n]=this.regionU+this.regionUVs[n]*t,this.uvs[n+1]=this.regionV+this.regionUVs[n+1]*e},computeWorldVertices:function(t,e,r,i){var n,o,s,a,h,l,u,c=r.bone.skeleton.bones,d=this.weights,p=this.bones,f=0,g=0,v=0,m=0,y=p.length;if(r.attachmentVertices.length)for(var x=r.attachmentVertices;y>g;f+=2){for(o=0,s=0,n=p[g++]+g;n>g;g++,v+=3,m+=2)a=c[p[g]],h=d[v]+x[m],l=d[v+1]+x[m+1],u=d[v+2],o+=(h*a.m00+l*a.m01+a.worldX)*u,s+=(h*a.m10+l*a.m11+a.worldY)*u;i[f]=o+t,i[f+1]=s+e}else for(;y>g;f+=2){for(o=0,s=0,n=p[g++]+g;n>g;g++,v+=3)a=c[p[g]],h=d[v],l=d[v+1],u=d[v+2],o+=(h*a.m00+l*a.m01+a.worldX)*u,s+=(h*a.m10+l*a.m11+a.worldY)*u;i[f]=o+t,i[f+1]=s+e}}},i.BoundingBoxAttachment=function(t){this.name=t,this.vertices=[]},i.BoundingBoxAttachment.prototype={type:i.AttachmentType.boundingbox,computeWorldVertices:function(t,e,r,i){t+=r.worldX,e+=r.worldY;for(var n=r.m00,o=r.m01,s=r.m10,a=r.m11,h=this.vertices,l=0,u=h.length;u>l;l+=2){var c=h[l],d=h[l+1];i[l]=c*n+d*o+t,i[l+1]=c*s+d*a+e}}},i.AnimationStateData=function(t){this.skeletonData=t,this.animationToMixTime={}},i.AnimationStateData.prototype={defaultMix:0,setMixByName:function(t,e,r){var i=this.skeletonData.findAnimation(t);if(!i)throw"Animation not found: "+t;var n=this.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;this.setMix(i,n,r)},setMix:function(t,e,r){this.animationToMixTime[t.name+":"+e.name]=r},getMix:function(t,e){var r=t.name+":"+e.name;return this.animationToMixTime.hasOwnProperty(r)?this.animationToMixTime[r]:this.defaultMix}},i.TrackEntry=function(){},i.TrackEntry.prototype={next:null,previous:null,animation:null,loop:!1,delay:0,time:0,lastTime:-1,endTime:0,timeScale:1,mixTime:0,mixDuration:0,mix:1,onStart:null,onEnd:null,onComplete:null,onEvent:null},i.AnimationState=function(t){this.data=t,this.tracks=[],this.events=[]},i.AnimationState.prototype={onStart:null,onEnd:null,onComplete:null,onEvent:null,timeScale:1,update:function(t){t*=this.timeScale;for(var e=0;e<this.tracks.length;e++){var r=this.tracks[e];if(r){if(r.time+=t*r.timeScale,r.previous){var i=t*r.previous.timeScale; r.previous.time+=i,r.mixTime+=i}var n=r.next;n?(n.time=r.lastTime-n.delay,n.time>=0&&this.setCurrent(e,n)):!r.loop&&r.lastTime>=r.endTime&&this.clearTrack(e)}}},apply:function(t){for(var e=0;e<this.tracks.length;e++){var r=this.tracks[e];if(r){this.events.length=0;var i=r.time,n=r.lastTime,o=r.endTime,s=r.loop;!s&&i>o&&(i=o);var a=r.previous;if(a){var h=a.time;!a.loop&&h>a.endTime&&(h=a.endTime),a.animation.apply(t,h,h,a.loop,null);var l=r.mixTime/r.mixDuration*r.mix;l>=1&&(l=1,r.previous=null),r.animation.mix(t,r.lastTime,i,s,this.events,l)}else 1==r.mix?r.animation.apply(t,r.lastTime,i,s,this.events):r.animation.mix(t,r.lastTime,i,s,this.events,r.mix);for(var u=0,c=this.events.length;c>u;u++){var d=this.events[u];r.onEvent&&r.onEvent(e,d),this.onEvent&&this.onEvent(e,d)}if(s?n%o>i%o:o>n&&i>=o){var p=Math.floor(i/o);r.onComplete&&r.onComplete(e,p),this.onComplete&&this.onComplete(e,p)}r.lastTime=r.time}}},clearTracks:function(){for(var t=0,e=this.tracks.length;e>t;t++)this.clearTrack(t);this.tracks.length=0},clearTrack:function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];e&&(e.onEnd&&e.onEnd(t),this.onEnd&&this.onEnd(t),this.tracks[t]=null)}},_expandToIndex:function(t){if(t<this.tracks.length)return this.tracks[t];for(;t>=this.tracks.length;)this.tracks.push(null);return null},setCurrent:function(t,e){var r=this._expandToIndex(t);if(r){var i=r.previous;r.previous=null,r.onEnd&&r.onEnd(t),this.onEnd&&this.onEnd(t),e.mixDuration=this.data.getMix(r.animation,e.animation),e.mixDuration>0&&(e.mixTime=0,e.previous=i&&r.mixTime/r.mixDuration<.5?i:r)}this.tracks[t]=e,e.onStart&&e.onStart(t),this.onStart&&this.onStart(t)},setAnimationByName:function(t,e,r){var i=this.data.skeletonData.findAnimation(e);if(!i)throw"Animation not found: "+e;return this.setAnimation(t,i,r)},setAnimation:function(t,e,r){var n=new i.TrackEntry;return n.animation=e,n.loop=r,n.endTime=e.duration,this.setCurrent(t,n),n},addAnimationByName:function(t,e,r,i){var n=this.data.skeletonData.findAnimation(e);if(!n)throw"Animation not found: "+e;return this.addAnimation(t,n,r,i)},addAnimation:function(t,e,r,n){var o=new i.TrackEntry;o.animation=e,o.loop=r,o.endTime=e.duration;var s=this._expandToIndex(t);if(s){for(;s.next;)s=s.next;s.next=o}else this.tracks[t]=o;return 0>=n&&(s?n+=s.endTime-this.data.getMix(s.animation,e):n=0),o.delay=n,o},getCurrent:function(t){return t>=this.tracks.length?null:this.tracks[t]}},i.SkeletonJsonParser=function(t){this.attachmentLoader=t},i.SkeletonJsonParser.prototype={scale:1,readSkeletonData:function(t,e){var r=new i.SkeletonData;r.name=e;var n=t.skeleton;n&&(r.hash=n.hash,r.version=n.spine,r.width=n.width||0,r.height=n.height||0);for(var o=t.bones,s=0,a=o.length;a>s;s++){var h=o[s],l=null;if(h.parent&&(l=r.findBone(h.parent),!l))throw"Parent bone not found: "+h.parent;var u=new i.BoneData(h.name,l);u.length=(h.length||0)*this.scale,u.x=(h.x||0)*this.scale,u.y=(h.y||0)*this.scale,u.rotation=h.rotation||0,u.scaleX=h.hasOwnProperty("scaleX")?h.scaleX:1,u.scaleY=h.hasOwnProperty("scaleY")?h.scaleY:1,u.inheritScale=h.hasOwnProperty("inheritScale")?h.inheritScale:!0,u.inheritRotation=h.hasOwnProperty("inheritRotation")?h.inheritRotation:!0,r.bones.push(u)}var c=t.ik;if(c)for(var s=0,a=c.length;a>s;s++){for(var d=c[s],p=new i.IkConstraintData(d.name),o=d.bones,f=0,g=o.length;g>f;f++){var v=r.findBone(o[f]);if(!v)throw"IK bone not found: "+o[f];p.bones.push(v)}if(p.target=r.findBone(d.target),!p.target)throw"Target bone not found: "+d.target;p.bendDirection=!d.hasOwnProperty("bendPositive")||d.bendPositive?1:-1,p.mix=d.hasOwnProperty("mix")?d.mix:1,r.ikConstraints.push(p)}for(var m=t.slots,s=0,a=m.length;a>s;s++){var y=m[s],u=r.findBone(y.bone);if(!u)throw"Slot bone not found: "+y.bone;var x=new i.SlotData(y.name,u),b=y.color;b&&(x.r=this.toColor(b,0),x.g=this.toColor(b,1),x.b=this.toColor(b,2),x.a=this.toColor(b,3)),x.attachmentName=y.attachment,x.additiveBlending=y.additive&&"true"==y.additive,r.slots.push(x)}var T=t.skins;for(var _ in T)if(T.hasOwnProperty(_)){var E=T[_],w=new i.Skin(_);for(var S in E)if(E.hasOwnProperty(S)){var A=r.findSlotIndex(S),C=E[S];for(var M in C)if(C.hasOwnProperty(M)){var R=this.readAttachment(w,M,C[M]);R&&w.addAttachment(A,M,R)}}r.skins.push(w),"default"==w.name&&(r.defaultSkin=w)}var F=t.events;for(var D in F)if(F.hasOwnProperty(D)){var O=F[D],P=new i.EventData(D);P.intValue=O["int"]||0,P.floatValue=O["float"]||0,P.stringValue=O.string||null,r.events.push(P)}var B=t.animations;for(var L in B)B.hasOwnProperty(L)&&this.readAnimation(L,B[L],r);return r},readAttachment:function(t,e,r){e=r.name||e;var n=i.AttachmentType[r.type||"region"],o=r.path||e,s=this.scale;if(n==i.AttachmentType.region){var a=this.attachmentLoader.newRegionAttachment(t,e,o);if(!a)return null;a.path=o,a.x=(r.x||0)*s,a.y=(r.y||0)*s,a.scaleX=r.hasOwnProperty("scaleX")?r.scaleX:1,a.scaleY=r.hasOwnProperty("scaleY")?r.scaleY:1,a.rotation=r.rotation||0,a.width=(r.width||0)*s,a.height=(r.height||0)*s;var h=r.color;return h&&(a.r=this.toColor(h,0),a.g=this.toColor(h,1),a.b=this.toColor(h,2),a.a=this.toColor(h,3)),a.updateOffset(),a}if(n==i.AttachmentType.mesh){var l=this.attachmentLoader.newMeshAttachment(t,e,o);return l?(l.path=o,l.vertices=this.getFloatArray(r,"vertices",s),l.triangles=this.getIntArray(r,"triangles"),l.regionUVs=this.getFloatArray(r,"uvs",1),l.updateUVs(),h=r.color,h&&(l.r=this.toColor(h,0),l.g=this.toColor(h,1),l.b=this.toColor(h,2),l.a=this.toColor(h,3)),l.hullLength=2*(r.hull||0),r.edges&&(l.edges=this.getIntArray(r,"edges")),l.width=(r.width||0)*s,l.height=(r.height||0)*s,l):null}if(n==i.AttachmentType.skinnedmesh){var l=this.attachmentLoader.newSkinnedMeshAttachment(t,e,o);if(!l)return null;l.path=o;for(var u=this.getFloatArray(r,"uvs",1),c=this.getFloatArray(r,"vertices",1),d=[],p=[],f=0,g=c.length;g>f;){var v=0|c[f++];p[p.length]=v;for(var m=f+4*v;m>f;)p[p.length]=c[f],d[d.length]=c[f+1]*s,d[d.length]=c[f+2]*s,d[d.length]=c[f+3],f+=4}return l.bones=p,l.weights=d,l.triangles=this.getIntArray(r,"triangles"),l.regionUVs=u,l.updateUVs(),h=r.color,h&&(l.r=this.toColor(h,0),l.g=this.toColor(h,1),l.b=this.toColor(h,2),l.a=this.toColor(h,3)),l.hullLength=2*(r.hull||0),r.edges&&(l.edges=this.getIntArray(r,"edges")),l.width=(r.width||0)*s,l.height=(r.height||0)*s,l}if(n==i.AttachmentType.boundingbox){for(var y=this.attachmentLoader.newBoundingBoxAttachment(t,e),c=r.vertices,f=0,g=c.length;g>f;f++)y.vertices.push(c[f]*s);return y}throw"Unknown attachment type: "+n},readAnimation:function(t,e,r){var n=[],o=0,s=e.slots;for(var a in s)if(s.hasOwnProperty(a)){var h=s[a],l=r.findSlotIndex(a);for(var u in h)if(h.hasOwnProperty(u)){var c=h[u];if("color"==u){var d=new i.ColorTimeline(c.length);d.slotIndex=l;for(var p=0,f=0,g=c.length;g>f;f++){var v=c[f],m=v.color,y=this.toColor(m,0),x=this.toColor(m,1),b=this.toColor(m,2),T=this.toColor(m,3);d.setFrame(p,v.time,y,x,b,T),this.readCurve(d,p,v),p++}n.push(d),o=Math.max(o,d.frames[5*d.getFrameCount()-5])}else{if("attachment"!=u)throw"Invalid timeline type for a slot: "+u+" ("+a+")";var d=new i.AttachmentTimeline(c.length);d.slotIndex=l;for(var p=0,f=0,g=c.length;g>f;f++){var v=c[f];d.setFrame(p++,v.time,v.name)}n.push(d),o=Math.max(o,d.frames[d.getFrameCount()-1])}}}var _=e.bones;for(var E in _)if(_.hasOwnProperty(E)){var w=r.findBoneIndex(E);if(-1==w)throw"Bone not found: "+E;var S=_[E];for(var u in S)if(S.hasOwnProperty(u)){var c=S[u];if("rotate"==u){var d=new i.RotateTimeline(c.length);d.boneIndex=w;for(var p=0,f=0,g=c.length;g>f;f++){var v=c[f];d.setFrame(p,v.time,v.angle),this.readCurve(d,p,v),p++}n.push(d),o=Math.max(o,d.frames[2*d.getFrameCount()-2])}else if("translate"==u||"scale"==u){var d,A=1;"scale"==u?d=new i.ScaleTimeline(c.length):(d=new i.TranslateTimeline(c.length),A=this.scale),d.boneIndex=w;for(var p=0,f=0,g=c.length;g>f;f++){var v=c[f],C=(v.x||0)*A,M=(v.y||0)*A;d.setFrame(p,v.time,C,M),this.readCurve(d,p,v),p++}n.push(d),o=Math.max(o,d.frames[3*d.getFrameCount()-3])}else{if("flipX"!=u&&"flipY"!=u)throw"Invalid timeline type for a bone: "+u+" ("+E+")";var C="flipX"==u,d=C?new i.FlipXTimeline(c.length):new i.FlipYTimeline(c.length);d.boneIndex=w;for(var R=C?"x":"y",p=0,f=0,g=c.length;g>f;f++){var v=c[f];d.setFrame(p,v.time,v[R]||!1),p++}n.push(d),o=Math.max(o,d.frames[2*d.getFrameCount()-2])}}}var F=e.ik;for(var D in F)if(F.hasOwnProperty(D)){var O=r.findIkConstraint(D),c=F[D],d=new i.IkConstraintTimeline(c.length);d.ikConstraintIndex=r.ikConstraints.indexOf(O);for(var p=0,f=0,g=c.length;g>f;f++){var v=c[f],P=v.hasOwnProperty("mix")?v.mix:1,B=!v.hasOwnProperty("bendPositive")||v.bendPositive?1:-1;d.setFrame(p,v.time,P,B),this.readCurve(d,p,v),p++}n.push(d),o=Math.max(o,d.frames[3*d.frameCount-3])}var L=e.ffd;for(var I in L){var N=r.findSkin(I),h=L[I];for(a in h){var l=r.findSlotIndex(a),k=h[a];for(var U in k){var c=k[U],d=new i.FfdTimeline(c.length),j=N.getAttachment(l,U);if(!j)throw"FFD attachment not found: "+U;d.slotIndex=l,d.attachment=j;var X,Y=j.type==i.AttachmentType.mesh;X=Y?j.vertices.length:j.weights.length/3*2;for(var p=0,f=0,g=c.length;g>f;f++){var W,v=c[f];if(v.vertices){var G=v.vertices,W=[];W.length=X;var z=v.offset||0,H=G.length;if(1==this.scale)for(var V=0;H>V;V++)W[V+z]=G[V];else for(var V=0;H>V;V++)W[V+z]=G[V]*this.scale;if(Y)for(var q=j.vertices,V=0,H=W.length;H>V;V++)W[V]+=q[V]}else Y?W=j.vertices:(W=[],W.length=X);d.setFrame(p,v.time,W),this.readCurve(d,p,v),p++}n[n.length]=d,o=Math.max(o,d.frames[d.frameCount-1])}}}var K=e.drawOrder;if(K||(K=e.draworder),K){for(var d=new i.DrawOrderTimeline(K.length),Q=r.slots.length,p=0,f=0,g=K.length;g>f;f++){var J=K[f],Z=null;if(J.offsets){Z=[],Z.length=Q;for(var V=Q-1;V>=0;V--)Z[V]=-1;var $=J.offsets,te=[];te.length=Q-$.length;for(var ee=0,re=0,V=0,H=$.length;H>V;V++){var ie=$[V],l=r.findSlotIndex(ie.slot);if(-1==l)throw"Slot not found: "+ie.slot;for(;ee!=l;)te[re++]=ee++;Z[ee+ie.offset]=ee++}for(;Q>ee;)te[re++]=ee++;for(var V=Q-1;V>=0;V--)-1==Z[V]&&(Z[V]=te[--re])}d.setFrame(p++,J.time,Z)}n.push(d),o=Math.max(o,d.frames[d.getFrameCount()-1])}var ne=e.events;if(ne){for(var d=new i.EventTimeline(ne.length),p=0,f=0,g=ne.length;g>f;f++){var oe=ne[f],se=r.findEvent(oe.name);if(!se)throw"Event not found: "+oe.name;var ae=new i.Event(se);ae.intValue=oe.hasOwnProperty("int")?oe["int"]:se.intValue,ae.floatValue=oe.hasOwnProperty("float")?oe["float"]:se.floatValue,ae.stringValue=oe.hasOwnProperty("string")?oe.string:se.stringValue,d.setFrame(p++,oe.time,ae)}n.push(d),o=Math.max(o,d.frames[d.getFrameCount()-1])}r.animations.push(new i.Animation(t,n,o))},readCurve:function(t,e,r){var i=r.curve;i?"stepped"==i?t.curves.setStepped(e):i instanceof Array&&t.curves.setCurve(e,i[0],i[1],i[2],i[3]):t.curves.setLinear(e)},toColor:function(t,e){if(8!=t.length)throw"Color hexidecimal length must be 8, recieved: "+t;return parseInt(t.substring(2*e,2*e+2),16)/255},getFloatArray:function(t,e,r){var n=t[e],o=new i.Float32Array(n.length),s=0,a=n.length;if(1==r)for(;a>s;s++)o[s]=n[s];else for(;a>s;s++)o[s]=n[s]*r;return o},getIntArray:function(t,e){for(var r=t[e],n=new i.Uint16Array(r.length),o=0,s=r.length;s>o;o++)n[o]=0|r[o];return n}},i.Atlas=function(t,e,n){e&&e.indexOf("/")!==e.length&&(e+="/"),this.pages=[],this.regions=[],this.texturesLoading=0;var o=new i.AtlasReader(t),s=[];s.length=4;for(var a=null;;){var h=o.readLine();if(null===h)break;if(h=o.trim(h),h.length)if(a){var l=new i.AtlasRegion;l.name=h,l.page=a,l.rotate="true"==o.readValue(),o.readTuple(s);var u=parseInt(s[0]),c=parseInt(s[1]);o.readTuple(s);var d=parseInt(s[0]),p=parseInt(s[1]);l.u=u/a.width,l.v=c/a.height,l.rotate?(l.u2=(u+p)/a.width,l.v2=(c+d)/a.height):(l.u2=(u+d)/a.width,l.v2=(c+p)/a.height),l.x=u,l.y=c,l.width=Math.abs(d),l.height=Math.abs(p),4==o.readTuple(s)&&(l.splits=[parseInt(s[0]),parseInt(s[1]),parseInt(s[2]),parseInt(s[3])],4==o.readTuple(s)&&(l.pads=[parseInt(s[0]),parseInt(s[1]),parseInt(s[2]),parseInt(s[3])],o.readTuple(s))),l.originalWidth=parseInt(s[0]),l.originalHeight=parseInt(s[1]),o.readTuple(s),l.offsetX=parseInt(s[0]),l.offsetY=parseInt(s[1]),l.index=parseInt(o.readValue()),this.regions.push(l)}else{a=new i.AtlasPage,a.name=h,2==o.readTuple(s)&&(a.width=parseInt(s[0]),a.height=parseInt(s[1]),o.readTuple(s)),a.format=i.Atlas.Format[s[0]],o.readTuple(s),a.minFilter=i.Atlas.TextureFilter[s[0]],a.magFilter=i.Atlas.TextureFilter[s[1]];var f=o.readValue();a.uWrap=i.Atlas.TextureWrap.clampToEdge,a.vWrap=i.Atlas.TextureWrap.clampToEdge,"x"==f?a.uWrap=i.Atlas.TextureWrap.repeat:"y"==f?a.vWrap=i.Atlas.TextureWrap.repeat:"xy"==f&&(a.uWrap=a.vWrap=i.Atlas.TextureWrap.repeat),a.rendererObject=r.BaseTexture.fromImage(e+h,n),this.pages.push(a)}else a=null}},i.Atlas.prototype={findRegion:function(t){for(var e=this.regions,r=0,i=e.length;i>r;r++)if(e[r].name==t)return e[r];return null},dispose:function(){for(var t=this.pages,e=0,r=t.length;r>e;e++)t[e].rendererObject.destroy(!0)},updateUVs:function(t){for(var e=this.regions,r=0,i=e.length;i>r;r++){var n=e[r];n.page==t&&(n.u=n.x/t.width,n.v=n.y/t.height,n.rotate?(n.u2=(n.x+n.height)/t.width,n.v2=(n.y+n.width)/t.height):(n.u2=(n.x+n.width)/t.width,n.v2=(n.y+n.height)/t.height))}}},i.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},i.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},i.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},i.AtlasPage=function(){},i.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},i.AtlasRegion=function(){},i.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},i.AtlasReader=function(t){this.lines=t.split(/\r\n|\r|\n/)},i.AtlasReader.prototype={index:0,trim:function(t){return t.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw"Invalid line: "+t;return this.trim(t.substring(e+1))},readTuple:function(t){var e=this.readLine(),r=e.indexOf(":");if(-1==r)throw"Invalid line: "+e;for(var i=0,n=r+1;3>i;i++){var o=e.indexOf(",",n);if(-1==o)break;t[i]=this.trim(e.substr(n,o-n)),n=o+1}return t[i]=this.trim(e.substring(n)),i+1}},i.AtlasAttachmentParser=function(t){this.atlas=t},i.AtlasAttachmentParser.prototype={newRegionAttachment:function(t,e,r){var n=this.atlas.findRegion(r);if(!n)throw"Region not found in atlas: "+r+" (region attachment: "+e+")";var o=new i.RegionAttachment(e);return o.rendererObject=n,o.setUVs(n.u,n.v,n.u2,n.v2,n.rotate),o.regionOffsetX=n.offsetX,o.regionOffsetY=n.offsetY,o.regionWidth=n.width,o.regionHeight=n.height,o.regionOriginalWidth=n.originalWidth,o.regionOriginalHeight=n.originalHeight,o},newMeshAttachment:function(t,e,r){var n=this.atlas.findRegion(r);if(!n)throw"Region not found in atlas: "+r+" (mesh attachment: "+e+")";var o=new i.MeshAttachment(e);return o.rendererObject=n,o.regionU=n.u,o.regionV=n.v,o.regionU2=n.u2,o.regionV2=n.v2,o.regionRotate=n.rotate,o.regionOffsetX=n.offsetX,o.regionOffsetY=n.offsetY,o.regionWidth=n.width,o.regionHeight=n.height,o.regionOriginalWidth=n.originalWidth,o.regionOriginalHeight=n.originalHeight,o},newSkinnedMeshAttachment:function(t,e,r){var n=this.atlas.findRegion(r);if(!n)throw"Region not found in atlas: "+r+" (skinned mesh attachment: "+e+")";var o=new i.SkinnedMeshAttachment(e);return o.rendererObject=n,o.regionU=n.u,o.regionV=n.v,o.regionU2=n.u2,o.regionV2=n.v2,o.regionRotate=n.rotate,o.regionOffsetX=n.offsetX,o.regionOffsetY=n.offsetY,o.regionWidth=n.width,o.regionHeight=n.height,o.regionOriginalWidth=n.originalWidth,o.regionOriginalHeight=n.originalHeight,o},newBoundingBoxAttachment:function(t,e){return new i.BoundingBoxAttachment(e)}},i.SkeletonBounds=function(){this.polygonPool=[],this.polygons=[],this.boundingBoxes=[]},i.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(t,e){var r=t.slots,n=r.length,o=t.x,s=t.y,a=this.boundingBoxes,h=this.polygonPool,l=this.polygons;a.length=0;for(var u=0,c=l.length;c>u;u++)h.push(l[u]);l.length=0;for(var u=0;n>u;u++){var d=r[u],p=d.attachment;if(p.type==i.AttachmentType.boundingbox){a.push(p);var f,g=h.length;g>0?(f=h[g-1],h.splice(g-1,1)):f=[],l.push(f),f.length=p.vertices.length,p.computeWorldVertices(o,s,d.bone,f)}}e&&this.aabbCompute()},aabbCompute:function(){for(var t=this.polygons,e=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,n=Number.MIN_VALUE,o=0,s=t.length;s>o;o++)for(var a=t[o],h=0,l=a.length;l>h;h+=2){var u=a[h],c=a[h+1];e=Math.min(e,u),r=Math.min(r,c),i=Math.max(i,u),n=Math.max(n,c)}this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},aabbContainsPoint:function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},aabbIntersectsSegment:function(t,e,r,i){var n=this.minX,o=this.minY,s=this.maxX,a=this.maxY;if(n>=t&&n>=r||o>=e&&o>=i||t>=s&&r>=s||e>=a&&i>=a)return!1;var h=(i-e)/(r-t),l=h*(n-t)+e;if(l>o&&a>l)return!0;if(l=h*(s-t)+e,l>o&&a>l)return!0;var u=(o-e)/h+t;return u>n&&s>u?!0:(u=(a-e)/h+t,u>n&&s>u?!0:!1)},aabbIntersectsSkeleton:function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},containsPoint:function(t,e){for(var r=this.polygons,i=0,n=r.length;n>i;i++)if(this.polygonContainsPoint(r[i],t,e))return this.boundingBoxes[i];return null},intersectsSegment:function(t,e,r,i){for(var n=this.polygons,o=0,s=n.length;s>o;o++)if(n[o].intersectsSegment(t,e,r,i))return this.boundingBoxes[o];return null},polygonContainsPoint:function(t,e,r){for(var i=t.length,n=i-2,o=!1,s=0;i>s;s+=2){var a=t[s+1],h=t[n+1];if(r>a&&h>=r||r>h&&a>=r){var l=t[s];l+(r-a)/(h-a)*(t[n]-l)<e&&(o=!o)}n=s}return o},polygonIntersectsSegment:function(t,e,r,i,n){for(var o=t.length,s=e-i,a=r-n,h=e*n-r*i,l=t[o-2],u=t[o-1],c=0;o>c;c+=2){var d=t[c],p=t[c+1],f=l*p-u*d,g=l-d,v=u-p,m=s*v-a*g,y=(h*g-s*f)/m;if((y>=l&&d>=y||y>=d&&l>=y)&&(y>=e&&i>=y||y>=i&&e>=y)){var x=(h*v-a*f)/m;if((x>=u&&p>=x||x>=p&&u>=x)&&(x>=r&&n>=x||x>=n&&r>=x))return!0}l=d,u=p}return!1},getPolygon:function(t){var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}}},{"../core":19}],121:[function(t,e){e.exports={Spine:t("./Spine"),SpineRuntime:t("./SpineRuntime")}},{"./Spine":119,"./SpineRuntime":120}],122:[function(t,e){function r(t,e){i.Container.call(this),this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:e.tint,align:e.align,name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.dirty=!1,this.updateText()}var i=t("../core");r.prototype=Object.create(i.Container.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t,this.dirty=!0}},font:{get:function(){return this._font},set:function(t){"string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):r.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0}},text:{get:function(){return this._text},set:function(t){this._text=t,this.dirty=!0}}}),r.prototype.updateText=function(){for(var t=r.fonts[this._font.name],e=new i.math.Point,n=null,o=[],s=0,a=0,h=[],l=0,u=this._font.size/t.size,c=-1,d=0;d<this.text.length;d++){var p=this.text.charCodeAt(d);if(c=/(\s)/.test(this.text.charAt(d))?d:c,/(?:\r\n|\r|\n)/.test(this.text.charAt(d)))h.push(s),a=Math.max(a,s),l++,e.x=0,e.y+=t.lineHeight,n=null;else if(-1!==c&&this.maxWidth>0&&e.x*u>this.maxWidth)o.splice(c,d-c),d=c,c=-1,h.push(s),a=Math.max(a,s),l++,e.x=0,e.y+=t.lineHeight,n=null;else{var f=t.chars[p];f&&(n&&f.kerning[n]&&(e.x+=f.kerning[n]),o.push({texture:f.texture,line:l,charCode:p,position:new i.math.Point(e.x+f.xOffset,e.y+f.yOffset)}),s=e.x+(f.texture.width+f.xOffset),e.x+=f.xAdvance,n=p)}}h.push(s),a=Math.max(a,s);var g=[];for(d=0;l>=d;d++){var v=0;"right"===this._font.align?v=a-h[d]:"center"===this._font.align&&(v=(a-h[d])/2),g.push(v)}var m=o.length,y=this.tint;for(d=0;m>d;d++){var x=this._glyphs[d];x?x.texture=o[d].texture:(x=new i.Sprite(o[d].texture),this._glyphs.push(x)),x.position.x=(o[d].position.x+g[o[d].line])*u,x.position.y=o[d].position.y*u,x.scale.x=x.scale.y=u,x.tint=y,x.parent||this.addChild(x)}for(d=m;d<this._glyphs.length;++d)this.removeChild(this._glyphs[d]);this.textWidth=a*u,this.textHeight=(e.y+t.lineHeight)*u},r.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),this.containerUpdateTransform()},r.fonts={}},{"../core":19}],123:[function(t,e){function r(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||i.RESOLUTION,this._text=null,this._style=null;var n=i.Texture.fromCanvas(this.canvas);n.trim=new i.math.Rectangle,i.Sprite.call(this,n),this.text=t,this.style=e}var i=t("../core");r.prototype=Object.create(i.Sprite.prototype),r.prototype.constructor=r,e.exports=r,r.fontPropertiesCache={},r.fontPropertiesCanvas=document.createElement("canvas"),r.fontPropertiesContext=r.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(r.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=t.dropShadowAngle||Math.PI/6,t.dropShadowDistance=t.dropShadowDistance||5,t.padding=t.padding||0,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),r.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),i=new Array(r.length),n=0,o=this.determineFontProperties(t.font),s=0;s<r.length;s++){var a=this.context.measureText(r[s]).width;i[s]=a,n=Math.max(n,a)}var h=n+t.strokeThickness;t.dropShadow&&(h+=t.dropShadowDistance),this.canvas.width=(h+this.context.lineWidth)*this.resolution;var l=this.style.lineHeight||o.fontSize+t.strokeThickness,u=l*r.length;t.dropShadow&&(u+=t.dropShadowDistance),this.canvas.height=(u+2*this._style.padding)*this.resolution,this.context.scale(this.resolution,this.resolution),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.font=t.font,this.context.strokeStyle=t.stroke,this.context.lineWidth=t.strokeThickness,this.context.textBaseline="alphabetic";var c,d;if(t.dropShadow){this.context.fillStyle=t.dropShadowColor;var p=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,f=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(s=0;s<r.length;s++)c=t.strokeThickness/2,d=t.strokeThickness/2+s*l+o.ascent,"right"===t.align?c+=n-i[s]:"center"===t.align&&(c+=(n-i[s])/2),t.fill&&this.context.fillText(r[s],c+p,d+f+this._style.padding)}for(this.context.fillStyle=t.fill,s=0;s<r.length;s++)c=t.strokeThickness/2,d=t.strokeThickness/2+s*l+o.ascent,"right"===t.align?c+=n-i[s]:"center"===t.align&&(c+=(n-i[s])/2),t.stroke&&t.strokeThickness&&this.context.strokeText(r[s],c,d+this._style.padding),t.fill&&this.context.fillText(r[s],c,d+this._style.padding);this.updateTexture()},r.prototype.updateTexture=function(){var t=this._texture;t.baseTexture.hasLoaded=!0,t.baseTexture.resolution=this.resolution,t.baseTexture.width=this.canvas.width/this.resolution,t.baseTexture.height=this.canvas.height/this.resolution,t.crop.width=t._frame.width=this.canvas.width/this.resolution,t.crop.height=t._frame.height=this.canvas.height/this.resolution,t.trim.x=0,t.trim.y=-this._style.padding,t.trim.width=t._frame.width,t.trim.height=t._frame.height-2*this._style.padding,this._width=this.canvas.width/this.resolution,this._height=this.canvas.height/this.resolution,t.update(),this.dirty=!1},r.prototype.renderWebGL=function(t){this.dirty&&this.updateText(),i.Sprite.prototype.renderWebGL.call(this,t)},r.prototype._renderCanvas=function(t){this.dirty&&this.updateText(),i.Sprite.prototype._renderCanvas.call(this,t)},r.prototype.determineFontProperties=function(t){var e=r.fontPropertiesCache[t];if(!e){e={};var i=r.fontPropertiesCanvas,n=r.fontPropertiesContext;n.font=t;var o=Math.ceil(n.measureText("|MÉq").width),s=Math.ceil(n.measureText("M").width),a=2*s;s=1.4*s|0,i.width=o,i.height=a,n.fillStyle="#f00",n.fillRect(0,0,o,a),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText("|MÉq",0,s);var h,l,u=n.getImageData(0,0,o,a).data,c=u.length,d=4*o,p=0,f=!1;for(h=0;s>h;h++){for(l=0;d>l;l+=4)if(255!==u[p+l]){f=!0;break}if(f)break;p+=d}for(e.ascent=s-h,p=c-d,f=!1,h=a;h>s;h--){for(l=0;d>l;l+=4)if(255!==u[p+l]){f=!0;break}if(f)break;p-=d}e.descent=h-s,e.fontSize=e.ascent+e.descent,r.fontPropertiesCache[t]=e}return e},r.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;n<r.length;n++){for(var o=i,s=r[n].split(" "),a=0;a<s.length;a++){var h=this.context.measureText(s[a]).width,l=h+this.context.measureText(" ").width;0===a||l>o?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=l,e+=" "+s[a])}n<r.length-1&&(e+="\n")}return e},r.prototype.getBounds=function(t){return this.dirty&&this.updateText(),i.Sprite.prototype.getBounds.call(this,t)},r.prototype.destroy=function(t){this.context=null,this.canvas=null,this._texture.destroy(void 0===t?!0:t)}},{"../core":19}],124:[function(t,e){e.exports={Text:t("./Text"),BitmapText:t("./BitmapText")}},{"./BitmapText":122,"./Text":123}],"pixi.js":[function(t,e){function r(t){for(var e in t)i[e]=t[e]}var i=t("./core");r(t("./extras")),r(t("./mesh")),r(t("./filters")),r(t("./interaction")),r(t("./loaders")),r(t("./spine")),r(t("./text")),r(t("./deprecation")),e.exports=i},{"./core":19,"./deprecation":69,"./extras":75,"./filters":91,"./interaction":106,"./loaders":109,"./mesh":116,"./spine":121,"./text":124}]},{},["pixi.js"])("pixi.js")});