/**
 * apng-canvas v2.0.1
 * @copyright 2011, 2015 David Mzareulyan
 * @link https://github.com/davidmz/apng-canvas
 * @license MIT
 */
!function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){(function(n,r){(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function a(t){Z=t}function s(t){z=t}function u(){return function(){n.nextTick(d)}}function c(){return function(){Q(d)}}function f(){var t=0,e=new et(d),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function h(){var t=new MessageChannel;return t.port1.onmessage=d,function(){t.port2.postMessage(0)}}function l(){return function(){setTimeout(d,1)}}function d(){for(var t=0;t<$;t+=2){var e=it[t],n=it[t+1];e(n),it[t]=void 0,it[t+1]=void 0}$=0}function p(){try{var e=t,n=e("vertx");return Q=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function A(t,e){var n=this,r=new this.constructor(m);void 0===r[st]&&k(r);var i=n._state;if(i){var o=arguments[i-1];z(function(){I(i,r,o,n._result)})}else B(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(m);return x(n,t),n}function m(){}function g(){return new TypeError("You cannot resolve a promise with itself")}function w(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(e){return ht.error=e,ht}}function _(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function b(t,e,n){z(function(t){var r=!1,i=_(n,e,function(n){r||(r=!0,e!==n?x(t,n):C(t,n))},function(e){r||(r=!0,T(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,T(t,i))},t)}function E(t,e){e._state===ct?C(t,e._result):e._state===ft?T(t,e._result):B(e,void 0,function(e){x(t,e)},function(e){T(t,e)})}function P(t,e,n){e.constructor===t.constructor&&n===ot&&constructor.resolve===at?E(t,e):n===ht?T(t,ht.error):void 0===n?C(t,e):o(n)?b(t,e,n):C(t,e)}function x(t,e){t===e?T(t,g()):i(e)?P(t,e,y(e)):C(t,e)}function N(t){t._onerror&&t._onerror(t._result),O(t)}function C(t,e){t._state===ut&&(t._result=e,t._state=ct,0!==t._subscribers.length&&z(O,t))}function T(t,e){t._state===ut&&(t._state=ft,t._result=e,z(N,t))}function B(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+ct]=n,i[o+ft]=r,0===o&&t._state&&z(O,t)}function O(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?I(n,r,i,o):i(o);t._subscribers.length=0}}function R(){this.error=null}function U(t,e){try{return t(e)}catch(n){return lt.error=n,lt}}function I(t,e,n,r){var i,a,s,u,c=o(n);if(c){if(i=U(n,r),i===lt?(u=!0,a=i.error,i=null):s=!0,e===i)return void T(e,w())}else i=r,s=!0;e._state!==ut||(c&&s?x(e,i):u?T(e,a):t===ct?C(e,i):t===ft&&T(e,i))}function L(t,e){try{e(function(e){x(t,e)},function(e){T(t,e)})}catch(n){T(t,n)}}function D(){return dt++}function k(t){t[st]=dt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function S(t){return new gt(this,t).promise}function j(t){var e=this;return new e(W(t)?function(n,r){for(var i=t.length,o=0;o<i;o++)e.resolve(t[o]).then(n,r)}:function(t,e){e(new TypeError("You must pass an array to race."))})}function F(t){var e=this,n=new e(m);return T(n,t),n}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(t){this[st]=D(),this._result=this._state=void 0,this._subscribers=[],m!==t&&("function"!=typeof t&&G(),this instanceof q?L(this,t):M())}function Y(t,e){this._instanceConstructor=t,this.promise=new t(m),this.promise[st]||k(this.promise),W(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&C(this.promise,this._result))):T(this.promise,V())}function V(){return new Error("Array Methods must be provided an Array")}function H(){var t;if("undefined"!=typeof r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(t.Promise=mt)}var J;J=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var Q,Z,K,W=J,$=0,z=function(t,e){it[$]=t,it[$+1]=e,$+=2,2===$&&(Z?Z(d):K())},X="undefined"!=typeof window?window:void 0,tt=X||{},et=tt.MutationObserver||tt.WebKitMutationObserver,nt="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),rt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,it=new Array(1e3);K=nt?u():et?f():rt?h():void 0===X&&"function"==typeof t?p():l();var ot=A,at=v,st=Math.random().toString(36).substring(16),ut=void 0,ct=1,ft=2,ht=new R,lt=new R,dt=0,pt=S,At=j,vt=F,mt=q;q.all=pt,q.race=At,q.resolve=at,q.reject=vt,q._setScheduler=a,q._setAsap=s,q._asap=z,q.prototype={constructor:q,then:ot,"catch":function(t){return this.then(null,t)}};var gt=Y;Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===ut&&n<t;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===at){var i=y(t);if(i===ot&&t._state!==ut)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===mt){var o=new n(m);P(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n(function(e){e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===ut&&(this._remaining--,t===ft?T(r,n):this._result[e]=n),0===this._remaining&&C(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;B(t,void 0,function(t){n._settledAt(ct,e,t)},function(t){n._settledAt(ft,e,t)})};var wt=H,yt={Promise:mt,polyfill:wt};"function"==typeof define&&define.amd?define(function(){return yt}):"undefined"!=typeof e&&e.exports?e.exports=yt:"undefined"!=typeof this&&(this.ES6Promise=yt),wt()}).call(this)}).call(this,t("pBGvAp"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{pBGvAp:2}],2:[function(t,e,n){function r(){}var i=e.exports={};i.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=r,i.addListener=r,i.once=r,i.off=r,i.removeListener=r,i.removeAllListeners=r,i.emit=r,i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")}},{}],3:[function(t,e,n){"use strict";var r=function(){this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[],this.play=function(){i||o||(this.rewind(),i=!0,requestAnimationFrame(s))},this.rewind=function(){e=0,n=0,r=null,i=!1,o=!1},this.addContext=function(t){if(a.length>0){var e=a[0].getImageData(0,0,this.width,this.height);t.putImageData(e,0,0)}a.push(t),t._apng_animation=this},this.removeContext=function(t){var e=a.indexOf(t);e!==-1&&(a.splice(e,1),0===a.length&&this.rewind(),"_apng_animation"in t&&delete t._apng_animation)},this.isPlayed=function(){return i},this.isFinished=function(){return o};var t=this,e=0,n=0,r=null,i=!1,o=!1,a=[],s=function(t){for(;i&&e<=t;)u(t);i&&requestAnimationFrame(s)},u=function(s){var u=n++%t.frames.length,c=t.frames[u];if(0==u&&(a.forEach(function(e){e.clearRect(0,0,t.width,t.height)}),r=null,2==c.disposeOp&&(c.disposeOp=1)),r&&1==r.disposeOp?a.forEach(function(t){t.clearRect(r.left,r.top,r.width,r.height)}):r&&2==r.disposeOp&&a.forEach(function(t){t.putImageData(r.iData,r.left,r.top)}),r=c,r.iData=null,2==r.disposeOp&&(r.iData=a[0].getImageData(c.left,c.top,c.width,c.height)),0==c.blendOp&&a.forEach(function(t){t.clearRect(c.left,c.top,c.width,c.height)}),a.forEach(function(t){t.drawImage(c.img,c.left,c.top)}),0==t.numPlays||n/t.frames.length<t.numPlays){for(0==e&&(e=s);s>e+t.playTime;)e+=t.playTime;e+=c.delay}else i=!1,o=!1}};e.exports=r},{}],4:[function(t,e,n){"use strict";for(var r=new Uint32Array(256),i=0;i<256;i++){for(var o=i,a=0;a<8;a++)o=1&o?3988292384^o>>>1:o>>>1;r[i]=o}e.exports=function(t,e,n){e=e||0,n=n||t.length-e;for(var i=-1,o=e,a=e+n;o<a;o++)i=i>>>8^r[255&(i^t[o])];return i^-1}},{}],5:[function(t,e,n){(function(e){"use strict";var n=t("./support-test"),r=t("./parser"),i=t("./loader"),o=e.APNG={};o.checkNativeFeatures=n.checkNativeFeatures,o.ifNeeded=n.ifNeeded,o.parseBuffer=function(t){return r(t)};var a={};o.parseURL=function(t){return t in a||(a[t]=i(t).then(r)),a[t]},o.animateContext=function(t,e){return o.parseURL(t).then(function(t){return t.addContext(e),t.play(),t})},o.animateImage=function(t){return t.setAttribute("data-is-apng","progress"),o.parseURL(t.src).then(function(e){t.setAttribute("data-is-apng","yes");var n=document.createElement("canvas");n.width=e.width,n.height=e.height,Array.prototype.slice.call(t.attributes).forEach(function(t){["alt","src","usemap","ismap","data-is-apng","width","height"].indexOf(t.nodeName)==-1&&n.setAttributeNode(t.cloneNode(!1))}),n.setAttribute("data-apng-src",t.src),""!=t.alt&&n.appendChild(document.createTextNode(t.alt));var r="",i="",o=0,a="";""!=t.style.width&&"auto"!=t.style.width?r=t.style.width:t.hasAttribute("width")&&(r=t.getAttribute("width")+"px"),""!=t.style.height&&"auto"!=t.style.height?i=t.style.height:t.hasAttribute("height")&&(i=t.getAttribute("height")+"px"),""!=r&&""==i&&(o=parseFloat(r),a=r.match(/\D+$/)[0],i=Math.round(n.height*o/n.width)+a),""!=i&&""==r&&(o=parseFloat(i),a=i.match(/\D+$/)[0],r=Math.round(n.width*o/n.height)+a),n.style.width=r,n.style.height=i;var s=t.parentNode;s.insertBefore(n,t),s.removeChild(t),e.addContext(n.getContext("2d")),e.play()},function(){t.setAttribute("data-is-apng","no")})},o.releaseCanvas=function(t){var e=t.getContext("2d");"_apng_animation"in e&&e._apng_animation.removeContext(e)}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./loader":6,"./parser":7,"./support-test":8}],6:[function(t,e,n){"use strict";var r=r||t("es6-promise").Promise;e.exports=function(t){return new r(function(e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="arraybuffer",r.onload=function(){200==this.status?e(this.response):n(this)},r.send()})}},{"es6-promise":1}],7:[function(t,e,n){"use strict";var r=r||t("es6-promise").Promise,i=t("./animation"),o=t("./crc32"),a=new Uint8Array([137,80,78,71,13,10,26,10]);e.exports=function(t){var e=new Uint8Array(t);return new r(function(t,n){for(var r=0;r<a.length;r++)if(a[r]!=e[r])return void n("Not a PNG file (invalid file signature)");var o=!1;if(s(e,function(t){return"acTL"!=t||(o=!0,!1)}),!o)return void n("Not an animated PNG");var l=[],p=[],v=null,m=null,g=new i;if(s(e,function(t,e,n,r){switch(t){case"IHDR":v=e.subarray(n+8,n+8+r),g.width=u(e,n+8),g.height=u(e,n+12);break;case"acTL":g.numPlays=u(e,n+8+4);break;case"fcTL":m&&g.frames.push(m),m={},m.width=u(e,n+8+4),m.height=u(e,n+8+8),m.left=u(e,n+8+12),m.top=u(e,n+8+16);var i=c(e,n+8+20),o=c(e,n+8+22);0==o&&(o=100),m.delay=1e3*i/o,m.delay<=10&&(m.delay=100),g.playTime+=m.delay,m.disposeOp=f(e,n+8+24),m.blendOp=f(e,n+8+25),m.dataParts=[];break;case"fdAT":m&&m.dataParts.push(e.subarray(n+8+4,n+8+r));break;case"IDAT":m&&m.dataParts.push(e.subarray(n+8,n+8+r));break;case"IEND":p.push(h(e,n,12+r));break;default:l.push(h(e,n,12+r))}}),m&&g.frames.push(m),0==g.frames.length)return void n("Not an animated PNG");for(var w=0,y=new Blob(l),_=new Blob(p),b=0;b<g.frames.length;b++){m=g.frames[b];var E=[];E.push(a),v.set(d(m.width),0),v.set(d(m.height),4),E.push(A("IHDR",v)),E.push(y);for(var P=0;P<m.dataParts.length;P++)E.push(A("IDAT",m.dataParts[P]));E.push(_);var x=URL.createObjectURL(new Blob(E,{type:"image/png"}));delete m.dataParts,E=null,m.img=document.createElement("img"),m.img.onload=function(){URL.revokeObjectURL(this.src),w++,w==g.frames.length&&t(g)},m.img.onerror=function(){n("Image creation error")},m.img.src=x}})};var s=function(t,e){var n=8;do{var r=u(t,n),i=l(t,n+4,4),o=e(i,t,n,r);n+=12+r}while(o!==!1&&"IEND"!=i&&n<t.length)},u=function(t,e){var n=0;n+=t[0+e]<<24>>>0;for(var r=1;r<4;r++)n+=t[r+e]<<8*(3-r);return n},c=function(t,e){for(var n=0,r=0;r<2;r++)n+=t[r+e]<<8*(1-r);return n},f=function(t,e){return t[e]},h=function(t,e,n){var r=new Uint8Array(n);return r.set(t.subarray(e,e+n)),r},l=function(t,e,n){var r=Array.prototype.slice.call(t.subarray(e,e+n));return String.fromCharCode.apply(String,r)},d=function(t){return[t>>>24&255,t>>>16&255,t>>>8&255,255&t]},p=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t.charCodeAt(n));return e},A=function(t,e){var n=t.length+e.length,r=new Uint8Array(new ArrayBuffer(n+8));r.set(d(e.length),0),r.set(p(t),4),r.set(e,8);var i=o(r,4,n);return r.set(d(i),n+4),r}},{"./animation":3,"./crc32":4,"es6-promise":1}],8:[function(t,e,n){(function(n){"use strict";var r=r||t("es6-promise").Promise,i=function(t){var e=null;return function(n){return e||(e=new r(t)),n&&e.then(n),e}},o=i(function(t){var e=document.createElement("canvas"),r={TypedArrays:"ArrayBuffer"in n,BlobURLs:"URL"in n,requestAnimationFrame:"requestAnimationFrame"in n,pageProtocol:"http:"==location.protocol||"https:"==location.protocol,canvas:"getContext"in document.createElement("canvas"),APNG:!1};if(r.canvas){var i=new Image;i.onload=function(){var n=e.getContext("2d");n.drawImage(i,0,0),r.APNG=0===n.getImageData(0,0,1,1).data[3],t(r)},i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg=="}else t(r)}),a=function(t){return"undefined"==typeof t&&(t=!1),o().then(function(e){if(e.APNG&&!t)reject();else{var n=!0;for(var r in e)e.hasOwnProperty(r)&&"APNG"!=r&&(n=n&&e[r])}})};e.exports={checkNativeFeatures:o,ifNeeded:a}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":1}]},{},[5]);