text: !function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=17)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(e,r,i){void 0===r&&(r=!1),n(this,t),this._fn=e,this._once=r,this._thisArg=i,this._next=this._prev=this._owner=null}return i(t,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),t}();function s(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var a=function(){function t(){n(this,t),this._head=this._tail=void 0}return i(t,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r}},{key:"has",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,arguments),t=t._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return s(this,new o(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return s(this,new o(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),t}();a.MiniSignalBinding=o,e.default=a,t.exports=e.default},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var i=r(11),n=r(13);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=_,e.resolve=function(t,e){return _(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?_(t,!1,!0).resolveObject(e):e},e.format=function(t){n.isString(t)&&(t=_(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=r(14);function _(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var _=t=u.join(a);if(_=_.trim(),!r&&1===t.split("#").length){var b=h.exec(_);if(b)return this.path=_,this.href=_,this.pathname=b[1],b[2]?(this.search=b[2],this.query=e?g.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=s.exec(_);if(x){var w=(x=x[0]).toLowerCase();this.protocol=w,_=_.substr(x.length)}if(r||x||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===_.substr(0,2);!T||x&&v[x]||(_=_.substr(2),this.slashes=!0)}if(!v[x]&&(T||x&&!m[x])){for(var E,S,P=-1,O=0;O<f.length;O++){-1!==(A=_.indexOf(f[O]))&&(-1===P||A<P)&&(P=A)}-1!==(S=-1===P?_.lastIndexOf("@"):_.lastIndexOf("@",P))&&(E=_.slice(0,S),_=_.slice(S+1),this.auth=decodeURIComponent(E)),P=-1;for(O=0;O<c.length;O++){var A;-1!==(A=_.indexOf(c[O]))&&(-1===P||A<P)&&(P=A)}-1===P&&(P=_.length),this.host=_.slice(0,P),_=_.slice(P),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var I=this.hostname.split(/\./),R=(O=0,I.length);O<R;O++){var M=I[O];if(M&&!M.match(p)){for(var D="",L=0,N=M.length;L<N;L++)M.charCodeAt(L)>127?D+="x":D+=M[L];if(!D.match(p)){var k=I.slice(0,O),F=I.slice(O+1),U=M.match(d);U&&(k.push(U[1]),F.unshift(U[2])),F.length&&(_="/"+F.join(".")+_),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=i.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!y[w])for(O=0,R=l.length;O<R;O++){var H=l[O];if(-1!==_.indexOf(H)){var G=encodeURIComponent(H);G===H&&(G=escape(H)),_=_.split(H).join(G)}}var X=_.indexOf("#");-1!==X&&(this.hash=_.substr(X),_=_.slice(0,X));var z=_.indexOf("?");if(-1!==z?(this.search=_.substr(z),this.query=_.substr(z+1),e&&(this.query=g.parse(this.query)),_=_.slice(0,z)):e&&(this.search="",this.query={}),_&&(this.pathname=_),m[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var Y=this.search||"";this.path=j+Y}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&n.isObject(this.query)&&Object.keys(this.query).length&&(s=g.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||m[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+i},o.prototype.resolve=function(t){return this.resolveObject(_(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(n.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,i=Object.keys(this),s=0;s<i.length;s++){var a=i[s];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(r[l]=t[l])}return m[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!m[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var p=c[f];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",g=r.search||"";r.path=y+g}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=b||_||r.host&&t.pathname,w=x,T=r.pathname&&r.pathname.split("/")||[],E=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!m[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),x=x&&(""===d[0]||""===T[0])),b)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=t.search,r.query=t.query;else if(!n.isNullOrUndefined(t.search)){if(E)r.hostname=r.host=T.shift(),(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift());return r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=T.slice(-1)[0],P=(r.host||t.host||T.length>1)&&("."===S||".."===S)||""===S,O=0,A=T.length;A>=0;A--)"."===(S=T[A])?T.splice(A,1):".."===S?(T.splice(A,1),O++):O&&(T.splice(A,1),O--);if(!x&&!w)for(;O--;O)T.unshift("..");!x||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),P&&"/"!==T.join("/").substr(-1)&&T.push("");var C,I=""===T[0]||T[0]&&"/"===T[0].charAt(0);E&&(r.hostname=r.host=I?"":T.length?T.shift():"",(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift()));return(x=x||r.host&&T.length)&&!I&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){"use strict";t.exports=function(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,(function(t,e,i){e&&(n[r.q.name][e]=i)})),n}},function(t,e,r){"use strict";var i=Object.prototype.hasOwnProperty,n="~";function o(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function a(t,e,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new s(r,i||t,o),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function u(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},u.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},u.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},u.prototype.emit=function(t,e,r,i,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,s),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var f,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;case 4:l[u].fn.call(l[u].context,e,r,i);break;default:if(!h)for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];l[u].fn.apply(l[u].context,h)}}return!0},u.prototype.on=function(t,e,r){return a(this,t,e,r,!1)},u.prototype.once=function(t,e,r){return a(this,t,e,r,!0)},u.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return h(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||h(this,o);else{for(var a=0,u=[],l=s.length;a<l;a++)(s[a].fn!==e||i&&!s[a].once||r&&s[a].context!==r)&&u.push(s[a]);u.length?this._events[o]=1===u.length?u[0]:u:h(this,o)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&h(this,e)):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u},function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i,a,h,u,l,p,d,v=e&&e.length,m=v?e[0]*r:t.length,g=n(t,0,m,r,!0),_=[];if(!g||g.next===g.prev)return _;if(v&&(g=function(t,e,r,i){var s,a,h,u,l,p=[];for(s=0,a=e.length;s<a;s++)h=e[s]*i,u=s<a-1?e[s+1]*i:t.length,(l=n(t,h,u,i,!1))===l.next&&(l.steiner=!0),p.push(y(l));for(p.sort(c),s=0;s<p.length;s++)f(p[s],r),r=o(r,r.next);return r}(t,e,g,r)),t.length>80*r){i=h=t[0],a=u=t[1];for(var b=r;b<m;b+=r)(l=t[b])<i&&(i=l),(p=t[b+1])<a&&(a=p),l>h&&(h=l),p>u&&(u=p);d=0!==(d=Math.max(h-i,u-a))?1/d:0}return s(g,_,r,i,a,d),_}function n(t,e,r,i,n){var o,s;if(n===A(t,e,r,i)>0)for(o=e;o<r;o+=i)s=S(o,t[o],t[o+1],s);else for(o=r-i;o>=e;o-=i)s=S(o,t[o],t[o+1],s);return s&&_(s,s.next)&&(P(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!_(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(P(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,i,n,c,f){if(t){!f&&c&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=d(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e<u&&(a++,i=i.nextZ);e++);for(h=u;a>0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,c);for(var p,y,v=t;t.prev!==t.next;)if(p=t.prev,y=t.next,c?h(t,i,n,c):a(t))e.push(p.i/r),e.push(t.i/r),e.push(y.i/r),P(t),t=y.next,v=y.next;else if((t=y)===v){f?1===f?s(t=u(o(t),e,r),e,r,i,n,c,2):2===f&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(v(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(g(n,o,s)>=0)return!1;for(var a=n.x<o.x?n.x<s.x?n.x:s.x:o.x<s.x?o.x:s.x,h=n.y<o.y?n.y<s.y?n.y:s.y:o.y<s.y?o.y:s.y,u=n.x>o.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=d(a,h,e,r,i),f=d(u,l,e,r,i),p=t.prevZ,y=t.nextZ;p&&p.z>=c&&y&&y.z<=f;){if(p!==t.prev&&p!==t.next&&v(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,y!==t.prev&&y!==t.next&&v(n.x,n.y,o.x,o.y,s.x,s.y,y.x,y.y)&&g(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&v(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;y&&y.z<=f;){if(y!==t.prev&&y!==t.next&&v(n.x,n.y,o.x,o.y,s.x,s.y,y.x,y.y)&&g(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!_(n,s)&&b(n,i,i.next,s)&&T(n,s)&&T(s,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(s.i/r),P(i),P(i.next),i=t=s),i=i.next}while(i!==t);return o(i)}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&m(h,u)){var l=E(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===s)return r;var h,u=r,l=r.x,c=r.y,f=1/0;i=r;do{n>=i.x&&i.x>=l&&n!==i.x&&v(o<c?n:s,o,l,c,o<c?s:n,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(n-i.x),T(i,t)&&(h<f||h===f&&(i.x>r.x||i.x===r.x&&p(r,i)))&&(r=i,f=h)),i=i.next}while(i!==u);return r}(t,e)){var r=E(e,t);o(e,e.next),o(r,r.next)}}function p(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function v(t,e,r,i,n,o,s,a){return(n-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||_(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,i){var n=w(g(t,e,r)),o=w(g(t,e,i)),s=w(g(r,i,t)),a=w(g(r,i,e));return n!==o&&s!==a||(!(0!==n||!x(t,r,e))||(!(0!==o||!x(t,i,e))||(!(0!==s||!x(r,t,i))||!(0!==a||!x(r,e,i)))))}function x(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function T(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function E(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function S(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function P(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}t.exports=i,t.exports.default=i,i.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(A(t,0,o,r));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*r,l=a<h-1?e[a+1]*r:t.length;s-=Math.abs(A(t,u,l,r))}var c=0;for(a=0;a<i.length;a+=3){var f=i[a]*r,p=i[a+1]*r,d=i[a+2]*r;c+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r}},function(t,e,r){(function(i,n){var o;!function(i){var s=i.Promise,a=s&&"resolve"in s&&"reject"in s&&"all"in s&&"race"in s&&function(){var t;return new s((function(e){t=e})),"function"==typeof t}();e?(e.Promise=a?s:T,e.Polyfill=T):void 0===(o=function(){return a?s:T}.call(e,r,e,t))||(t.exports=o);var h=function(){};function u(t){return"[object Array]"===Object.prototype.toString.call(t)}var l,c=void 0!==n?n:setTimeout,f=[];function p(){for(var t=0;t<f.length;t++)f[t][0](f[t][1]);f=[],l=!1}function d(t,e){f.push([t,e]),l||(l=!0,c(p,0))}function y(t){var e=t.owner,r=e.state_,i=e.data_,n=t[r],o=t.then;if("function"==typeof n){r="fulfilled";try{i=n(i)}catch(t){_(o,t)}}v(o,i)||("fulfilled"===r&&m(o,i),"rejected"===r&&_(o,i))}function v(t,e){var r;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var i=e.then;if("function"==typeof i)return i.call(e,(function(i){r||(r=!0,e!==i?m(t,i):g(t,i))}),(function(e){r||(r=!0,_(t,e))})),!0}}catch(e){return r||_(t,e),!0}return!1}function m(t,e){t!==e&&v(t,e)||g(t,e)}function g(t,e){"pending"===t.state_&&(t.state_="sealed",t.data_=e,d(x,t))}function _(t,e){"pending"===t.state_&&(t.state_="sealed",t.data_=e,d(w,t))}function b(t){var e=t.then_;t.then_=void 0;for(var r=0;r<e.length;r++)y(e[r])}function x(t){t.state_="fulfilled",b(t)}function w(t){t.state_="rejected",b(t)}function T(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof T==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],function(t,e){function r(t){_(e,t)}try{t((function(t){m(e,t)}),r)}catch(t){r(t)}}(t,this)}T.prototype={constructor:T,state_:"pending",then_:null,data_:void 0,then:function(t,e){var r={owner:this,then:new this.constructor(h),fulfilled:t,rejected:e};return"fulfilled"===this.state_||"rejected"===this.state_?d(y,r):this.then_.push(r),r.then},catch:function(t){return this.then(null,t)}},T.all=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.all().");return new this((function(e,r){var i=[],n=0;function o(t){return n++,function(r){i[t]=r,--n||e(i)}}for(var s,a=0;a<t.length;a++)(s=t[a])&&"function"==typeof s.then?s.then(o(a),r):i[a]=s;n||e(i)}))},T.race=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.race().");return new this((function(e,r){for(var i,n=0;n<t.length;n++)(i=t[n])&&"function"==typeof i.then?i.then(e,r):e(i)}))},T.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this((function(e){e(t)}))},T.reject=function(t){return new this((function(e,r){r(t)}))}}("undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:this)}).call(this,r(1),r(8).setImmediate)},function(t,e,r){"use strict";
  /*
  object-assign
  (c) Sindre Sorhus
  @license MIT
  */var i=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,h=s(t),u=1;u<arguments.length;u++){for(var l in r=Object(arguments[u]))n.call(r,l)&&(h[l]=r[l]);if(i){a=i(r);for(var c=0;c<a.length;c++)o.call(r,a[c])&&(h[a[c]]=r[a[c]])}}return h}},function(t,e,r){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(9),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(1))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var i,n,o,s,a,h=1,u={},l=!1,c=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},i=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,i=function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):i=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var n={callback:t,args:e};return u[h]=n,i(h),h++},f.clearImmediate=p}function p(t){delete u[t]}function d(t){if(l)setTimeout(d,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(1),r(10))},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,u=[],l=!1,c=-1;function f(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,r){(function(t,i){var n;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof i&&i;s.global!==s&&s.window!==s&&s.self;var a,h=2147483647,u=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(t){throw RangeError(f[t])}function v(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function m(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+v((t=t.replace(c,".")).split("."),e).join(".")}function g(t){for(var e,r,i=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function _(t){return v(t,(function(t){var e="";return t>65535&&(e+=d((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=d(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var i=0;for(t=r?p(t/700):t>>1,t+=p(t/e);t>455;i+=36)t=p(t/35);return p(i+36*t/(t+38))}function w(t){var e,r,i,n,o,s,a,u,l,c,f,d=[],v=t.length,m=0,g=128,b=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&y("not-basic"),d.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<v;){for(o=m,s=1,a=36;n>=v&&y("invalid-input"),((u=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>p((h-m)/s))&&y("overflow"),m+=u*s,!(u<(l=a<=b?1:a>=b+26?26:a-b));a+=36)s>p(h/(c=36-l))&&y("overflow"),s*=c;b=x(m-o,e=d.length+1,0==o),p(m/e)>h-g&&y("overflow"),g+=p(m/e),m%=e,d.splice(m++,0,g)}return _(d)}function T(t){var e,r,i,n,o,s,a,u,l,c,f,v,m,_,w,T=[];for(v=(t=g(t)).length,e=128,r=0,o=72,s=0;s<v;++s)(f=t[s])<128&&T.push(d(f));for(i=n=T.length,n&&T.push("-");i<v;){for(a=h,s=0;s<v;++s)(f=t[s])>=e&&f<a&&(a=f);for(a-e>p((h-r)/(m=i+1))&&y("overflow"),r+=(a-e)*m,e=a,s=0;s<v;++s)if((f=t[s])<e&&++r>h&&y("overflow"),f==e){for(u=r,l=36;!(u<(c=l<=o?1:l>=o+26?26:l-o));l+=36)w=u-c,_=36-c,T.push(d(b(c+w%_,0))),u=p(w/_);T.push(d(b(u,0))),o=x(r,m,i==n),r=0,++i}++r,++e}return T.join("")}a={version:"1.3.2",ucs2:{decode:g,encode:_},decode:w,encode:T,toASCII:function(t){return m(t,(function(t){return l.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return m(t,(function(t){return u.test(t)?w(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()}).call(this,r(12)(t),r(1))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(15),e.encode=e.stringify=r(16)},function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,f,p,d,y=t[l].replace(a,"%20"),v=y.indexOf(r);v>=0?(c=y.substr(0,v),f=y.substr(v+1)):(c=y,f=""),p=decodeURIComponent(c),d=decodeURIComponent(f),i(s,p)?n(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),(function(s){var a=encodeURIComponent(i(s))+r;return n(t[s])?o(t[s],(function(t){return a+encodeURIComponent(i(t))})).join(e):a+encodeURIComponent(i(t[s]))})).join(e):a?encodeURIComponent(i(a))+r+encodeURIComponent(i(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";r.r(e);var i=r(6),n=r(7),o=r.n(n);
  /*!
   * @pixi/polyfill - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/polyfill is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  window.Promise||(window.Promise=i.Polyfill),Object.assign||(Object.assign=o.a);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!window.performance||!window.performance.now){var s=Date.now();window.performance||(window.performance={}),window.performance.now=function(){return Date.now()-s}}for(var a=Date.now(),h=["ms","moz","webkit","o"],u=0;u<h.length&&!window.requestAnimationFrame;++u){var l=h[u];window.requestAnimationFrame=window[l+"RequestAnimationFrame"],window.cancelAnimationFrame=window[l+"CancelAnimationFrame"]||window[l+"CancelRequestAnimationFrame"]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+a-e;return r<0&&(r=0),a=e,window.setTimeout((function(){a=Date.now(),t(performance.now())}),r)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var c=/iPhone/i,f=/iPod/i,p=/iPad/i,d=/\biOS-universal(?:.+)Mac\b/i,y=/\bAndroid(?:.+)Mobile\b/i,v=/Android/i,m=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,g=/Silk/i,_=/Windows Phone/i,b=/\bWindows(?:.+)ARM\b/i,x=/BlackBerry/i,w=/BB10/i,T=/Opera Mini/i,E=/\b(CriOS|Chrome)(?:.+)Mobile/i,S=/Mobile(?:.+)Firefox\b/i,P=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};
  /*!
   * @pixi/settings - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/settings is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var O=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(c)&&!n(_),ipod:n(f),tablet:!n(c)&&(n(p)||P(e))&&!n(_),universal:n(d),device:(n(c)||n(f)||n(p)||n(d)||P(e))&&!n(_)},amazon:{phone:n(m),tablet:!n(m)&&n(g),device:n(m)||n(g)},android:{phone:!n(_)&&n(m)||!n(_)&&n(y),tablet:!n(_)&&!n(m)&&!n(y)&&(n(g)||n(v)),device:!n(_)&&(n(m)||n(g)||n(y)||n(v))||n(/\bokhttp\b/i)},windows:{phone:n(_),tablet:n(b),device:n(_)||n(b)},other:{blackberry:n(x),blackberry10:n(w),opera:n(T),firefox:n(S),chrome:n(E),device:n(x)||n(w)||n(T)||n(S)||n(E)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(window.navigator);var A,C,I,R,M,D,L,N,k,F,U,j,B,H,G,X,z,Y={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(O.tablet||O.phone){var r;if(O.apple.device)if(r=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(r[1],10)<11&&(e=!1);if(O.android.device)if(r=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(r[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:O.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!O.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},V=r(4),W=r.n(V),q=r(5),K=r.n(q),Z=r(2),J=r.n(Z);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(A||(A={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(C||(C={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(I||(I={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(R||(R={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(M||(M={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(D||(D={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(L||(L={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(N||(N={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(k||(k={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(F||(F={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(U||(U={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(j||(j={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(B||(B={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(H||(H={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(G||(G={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(X||(X={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(z||(z={})),
  /*!
   * @pixi/utils - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/utils is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Y.RETINA_PREFIX=/@([0-9\.]+)x/,Y.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var Q,$=!1;function tt(t){var e;if(!$){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 5.3.2 - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=window.console).log.apply(e,r)}else window.console&&window.console.log("PixiJS 5.3.2 - "+t+" - http://www.pixijs.com/");$=!0}}function et(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function rt(t){var e=t.toString(16);return"#"+(e="000000".substr(0,6-e.length)+e)}function it(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function nt(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var ot=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[R.NORMAL_NPM]=R.NORMAL,t[R.ADD_NPM]=R.ADD,t[R.SCREEN_NPM]=R.SCREEN,e[R.NORMAL]=R.NORMAL_NPM,e[R.ADD]=R.ADD_NPM,e[R.SCREEN]=R.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function st(t,e){return ot[e?1:0][t]}function at(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function ht(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}Float32Array,Uint32Array,Int32Array,Uint8Array;function ut(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function lt(t){return!(t&t-1||!t)}function ct(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function ft(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}}function pt(t){return 0===t?0:t<0?-1:1}var dt=0;function yt(){return++dt}var vt={};function mt(t,e,r){if(void 0===r&&(r=3),!vt[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),vt[e]=!0}}var gt={},_t=Object.create(null),bt=Object.create(null);var xt=function(){function t(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||Y.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t},enumerable:!1,configurable:!0}),t}();var wt;function Tt(t,e){var r=Y.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}
  /*!
   * @pixi/math - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/math is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */var Et,St=2*Math.PI,Pt=180/Math.PI,Ot=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(Et||(Et={}));var At=function(){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=Et.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this},t}(),Ct=function(){function t(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=t,this.y=e,this.radius=r,this.type=Et.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},t.prototype.getBounds=function(){return new At(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),It=function(){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=r,this.height=i,this.type=Et.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.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},t.prototype.getBounds=function(){return new At(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Rt=function(){function t(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var i=Array.isArray(e[0])?e[0]:e;if("number"!=typeof i[0]){for(var n=[],o=0,s=i.length;o<s;o++)n.push(i[o].x,i[o].y);i=n}this.points=i,this.type=Et.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r},t}(),Mt=function(){function t(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=Et.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},t}(),Dt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t}(),Lt=function(){function t(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Nt=function(){function t(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return t.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]},t.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new Dt;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new Dt;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.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},t.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},t.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},t.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.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},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=-Math.atan2(-i,n),s=Math.atan2(r,e),a=Math.abs(o+s);return a<1e-5||Math.abs(St-a)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx,t.position.y=this.ty,t},t.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},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=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},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),kt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ft=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ut=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],jt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Bt=[],Ht=[],Gt=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];Bt.push(e);for(var r=0;r<16;r++)for(var i=Gt(kt[t]*kt[r]+Ut[t]*Ft[r]),n=Gt(Ft[t]*kt[r]+jt[t]*Ft[r]),o=Gt(kt[t]*Ut[r]+Ut[t]*jt[r]),s=Gt(Ft[t]*Ut[r]+jt[t]*jt[r]),a=0;a<16;a++)if(kt[a]===i&&Ft[a]===n&&Ut[a]===o&&jt[a]===s){e.push(a);break}}for(t=0;t<16;t++){var h=new Nt;h.set(kt[t],Ft[t],Ut[t],jt[t],0,0),Ht.push(h)}}();var Xt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return kt[t]},uY:function(t){return Ft[t]},vX:function(t){return Ut[t]},vY:function(t){return jt[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Bt[t][e]},sub:function(t,e){return Bt[t][Xt.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Xt.S:Xt.N:2*Math.abs(e)<=Math.abs(t)?t>0?Xt.E:Xt.W:e>0?t>0?Xt.SE:Xt.SW:t>0?Xt.NE:Xt.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ht[Xt.inv(e)];n.tx=r,n.ty=i,t.append(n)}},zt=function(){function t(){this.worldTransform=new Nt,this.localTransform=new Nt,this.position=new Lt(this.onChange,this,0,0),this.scale=new Lt(this.onChange,this,1,1),this.pivot=new Lt(this.onChange,this,0,0),this.skew=new Lt(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();
  /*!
   * @pixi/display - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/display is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Y.SORTABLE_CHILDREN=!1;var Yt=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?At.EMPTY:((t=t||new At(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=o>i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},t.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,f=this.minY,p=this.maxX,d=this.maxY,y=o*e+a*r+u,v=s*e+h*r+l;c=y<c?y:c,f=v<f?v:f,p=y>p?y:p,d=v>d?v:d,c=(y=o*i+a*r+u)<c?y:c,f=(v=s*i+h*r+l)<f?v:f,p=y>p?y:p,d=v>d?v:d,c=(y=o*e+a*n+u)<c?y:c,f=(v=s*e+h*n+l)<f?v:f,p=y>p?y:p,d=v>d?v:d,c=(y=o*i+a*n+u)<c?y:c,f=(v=s*i+h*n+l)<f?v:f,p=y>p?y:p,d=v>d?v:d,this.minX=c,this.minY=f,this.maxX=p,this.maxY=d},t.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var h=t[a],u=t[a+1];i=h<i?h:i,n=u<n?u:n,o=h>o?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},t.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,f=this.minX,p=this.minY,d=this.maxX,y=this.maxY,v=r;v<i;v+=2){var m=e[v],g=e[v+1],_=s*m+h*g+l,b=u*g+a*m+c;f=Math.min(f,_-n),d=Math.max(d,_+n),p=Math.min(p,b-o),y=Math.max(y,b+o)}this.minX=f,this.minY=p,this.maxX=d,this.maxY=y},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i},t}(),Vt=function(t,e){return(Vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */function Wt(t,e){function r(){this.constructor=t}Vt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var qt=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new zt,e.alpha=1,e.visible=!0,e.renderable=!0,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new Yt,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return Wt(e,t),e.mixin=function(t){for(var r=Object.keys(t),i=0;i<r.length;++i){var n=r[i];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new At),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new At),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Yt);var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var i=this._bounds,n=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-n,o},e.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this._mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new Kt),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*Pt},set:function(t){this.transform.rotation=t*Ot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){var e;this._mask&&((e=this._mask.maskObject||this._mask).renderable=!0,e.isMask=!1);(this._mask=t,this._mask)&&((e=this._mask.maskObject||this._mask).renderable=!1,e.isMask=!0)},enumerable:!1,configurable:!0}),e}(W.a),Kt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return Wt(e,t),e}(qt);function Zt(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}qt.prototype.displayObjectUpdateTransform=qt.prototype.updateTransform;var Jt=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=Y.SORTABLE_CHILDREN,e.sortDirty=!1,e}return Wt(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.addChild(e[i]);else{var n=e[0];n.parent&&n.parent.removeChild(n),n.parent=this,this.sortDirty=!0,n.transform._parentID=-1,this.children.push(n),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},e.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},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);ft(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.removeChild(e[i]);else{var n=e[0],o=this.children.indexOf(n);if(-1===o)return null;n.parent=null,n.transform._parentID=-1,ft(this.children,o,1),this._boundsID++,this.onChildrenChange(o),n.emit("removed",this),this.emit("childRemoved",n,this,o)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,ft(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var r,i=t,n=e-i;if(n>0&&n<=e){r=this.children.splice(i,n);for(var o=0;o<r.length;++o)r[o].parent=null,r[o].transform&&(r[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<r.length;++o)r[o].emit("removed",this),this.emit("childRemoved",r[o],this,o);return r}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var i=this.children[e];i._lastSortedIndex=e,t||0===i.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(Zt),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var r=e._mask.maskObject||e._mask;r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,r){void 0===r&&(r=!1);var i=t.prototype.getLocalBounds.call(this,e);if(!r)for(var n=0,o=this.children.length;n<o;++n){var s=this.children[n];s.visible&&s.updateTransform()}return i},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}r&&t.mask.push(this,this._mask),this._render(t);i=0;for(var n=this.children.length;i<n;i++)this.children[i].render(t);t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(r)for(var n=0;n<i.length;++n)i[n].destroy(e)},Object.defineProperty(e.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},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"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},enumerable:!1,configurable:!0}),e}(qt);Jt.prototype.containerUpdateTransform=Jt.prototype.updateTransform;qt.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Qt,$t=function(){function t(t){this._hookDiv=null,(O.tablet||O.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=t,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._isActive=!1,this._isMobileAccessibility=!1,this.androidUpdateCount=0,this.androidUpdateFrequency=500,window.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessability for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){this._isActive||(this._isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},t.prototype.deactivate=function(){this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},t.prototype.update=function(){var t=performance.now();if(!(O.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),r=this.renderer.resolution,i=e.width/this.renderer.width*r,n=e.height/this.renderer.height*r,o=this.div;o.style.left=e.left+"px",o.style.top=e.top+"px",o.style.width=this.renderer.width+"px",o.style.height=this.renderer.height+"px";for(var s=0;s<this.children.length;s++){var a=this.children[s];if(a.renderId!==this.renderId)a._accessibleActive=!1,ft(this.children,s,1),this.div.removeChild(a._accessibleDiv),this.pool.push(a._accessibleDiv),a._accessibleDiv=null,s--;else{o=a._accessibleDiv;var h=a.hitArea,u=a.worldTransform;a.hitArea?(o.style.left=(u.tx+h.x*u.a)*i+"px",o.style.top=(u.ty+h.y*u.d)*n+"px",o.style.width=h.width*u.a*i+"px",o.style.height=h.height*u.d*n+"px"):(h=a.getBounds(),this.capHitArea(h),o.style.left=h.x*i+"px",o.style.top=h.y*n+"px",o.style.width=h.width*i+"px",o.style.height=h.height*n+"px",o.title!==a.accessibleTitle&&null!==a.accessibleTitle&&(o.title=a.accessibleTitle),o.getAttribute("aria-label")!==a.accessibleHint&&null!==a.accessibleHint&&o.setAttribute("aria-label",a.accessibleHint)),a.accessibleTitle===o.title&&a.tabIndex===o.tabIndex||(o.title=a.accessibleTitle,o.tabIndex=a.tabIndex,this.debug&&this.updateDebugHTML(o))}}this.renderId++}},t.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData),e.dispatchEvent(t.target.displayObject,"pointertap",e.eventData),e.dispatchEvent(t.target.displayObject,"tap",e.eventData)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}();
  /*!
   * @pixi/ticker - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/ticker is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Y.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(Qt||(Qt={}));var te=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.fn=t,this.context=e,this.priority=r,this.once=i,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),ee=function(){function t(){var t=this;this._head=new te(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/Y.TARGET_FPMS,this.elapsedMS=1/Y.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,r){return void 0===r&&(r=Qt.NORMAL),this._addListener(new te(t,e,r))},t.prototype.addOnce=function(t,e,r){return void 0===r&&(r=Qt.NORMAL),this._addListener(new te(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*Y.TARGET_FPMS;for(var i=this._head,n=i.next;n;)n=n.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,Y.TARGET_FPMS);this._maxElapsedMS=1/r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),re=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Qt.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ee.shared:new ee,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t}(),ie=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Dt,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),ne=function(t,e){return(ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var oe=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),se=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),ae=function(){function t(){this._tempPoint=new Dt}return t.prototype.recursiveFindHit=function(t,e,r,i,n){if(!e||!e.visible)return!1;var o=t.data.global,s=!1,a=n=e.interactive||n,h=!0;if(e.hitArea?(i&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:(i=!1,h=!1)),a=!1):e._mask&&i&&(e._mask.containsPoint&&e._mask.containsPoint(o)||(i=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],f=this.recursiveFindHit(t,c,r,i,a);if(f){if(!c.parent)continue;a=!1,f&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},t.prototype.findHit=function(t,e,r,i){this.recursiveFindHit(t,e,r,i,!1)},t}(),he={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};qt.mixin(he);var ue={target:null,data:{global:null}},le=function(t){function e(e,r){var i=t.call(this)||this;return r=r||{},i.renderer=e,i.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,i.interactionFrequency=r.interactionFrequency||10,i.mouse=new ie,i.mouse.identifier=1,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[1]=i.mouse,i.interactionDataPool=[],i.eventData=new oe,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!1,i.supportsTouchEvents="ontouchstart"in window,i.supportsPointerEvents=!!window.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new ae,i._tempDisplayObject=new Kt,i._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return function(t,e){function r(){this.constructor=t}ne(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return ue.target=null,ue.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(ue,e,null,!0),ue.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(ee.system.add(this.tickerUpdate,this,Qt.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(ee.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var r=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){if(t=t||"default",this.currentCursorMode!==t){this.currentCursorMode=t;var e=this.cursorStyles[t];if(e)switch(typeof e){case"string":this.interactionDOMElement.style.cursor=e;break;case"function":e(t);break;case"object":Object.assign(this.interactionDOMElement.style,e)}else"string"!=typeof t||Object.prototype.hasOwnProperty.call(this.cursorStyles,t)||(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,r){r.stopPropagationHint&&t!==r.stopsPropagatingAt||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},e.prototype.delayDispatchEvent=function(t,e,r){this.delayedEvents.push({displayObject:t,eventString:e,eventData:r})},e.prototype.mapPositionToPoint=function(t,e,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=1/this.resolution;t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)*n,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},e.prototype.processInteractive=function(t,e,r,i){var n=this.search.findHit(t,e,r,i),o=this.delayedEvents;if(!o.length)return n;t.stopPropagationHint=!1;var s=o.length;this.delayedEvents=[];for(var a=0;a<s;a++){var h=o[a],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return n},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,r){var i=t.data,n=t.data.identifier;if(r)if(e.trackedPointers[n]||(e.trackedPointers[n]=new se(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===i.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,r){for(var i=this.normalizeToPointerData(t),n=i.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=i[s],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,r,e||!o),this.emit(e?"pointercancel":"pointerup"+o,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+o:"mouseup"+o,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,u),this.releaseInteractionDataForPointerId(a.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var r=t.data,i=t.data.identifier;void 0!==e.trackedPointers[i]&&(delete e.trackedPointers[i],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,r){var i=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===i.pointerType,a="mouse"===i.pointerType||"pen"===i.pointerType,h=!1;if(a){var u=2===i.button,l=se.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,f=void 0!==o&&o.flags&c;r?(this.dispatchEvent(e,u?"rightup":"mouseup",t),f&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):f&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),o&&(u?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!h||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,r){var i=t.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},e.prototype.processPointerOverOut=function(t,e,r){var i=t.data,n=t.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,s=e.trackedPointers[n];r&&!s&&(s=e.trackedPointers[n]=new se(n)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",i)},e.prototype.getInteractionDataForPointerId=function(t){var e,r=t.pointerId;return 1===r||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[r]?e=this.activeInteractionData[r]:((e=this.interactionDataPool.pop()||new ie).identifier=r,this.activeInteractionData[r]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,i=t.changedTouches.length;r<i;r++){var n=t.changedTouches[r];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else if(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof window.PointerEvent)e.push(t);else{var o=t;void 0===o.isPrimary&&(o.isPrimary=!0),void 0===o.width&&(o.width=1),void 0===o.height&&(o.height=1),void 0===o.tiltX&&(o.tiltX=0),void 0===o.tiltY&&(o.tiltY=0),void 0===o.pointerType&&(o.pointerType="mouse"),void 0===o.pointerId&&(o.pointerId=1),void 0===o.pressure&&(o.pressure=.5),void 0===o.twist&&(o.twist=0),void 0===o.tangentialPressure&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e}(W.a),ce=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this,u=h.name,l=h.items;this._aliasCount++;for(var c=0,f=l.length;c<f;c++)l[c][u](t,e,r,i,n,o,s,a);return l===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(ce.prototype,{dispatch:{value:ce.prototype.emit},run:{value:ce.prototype.emit}}),
  /*!
   * @pixi/core - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/core is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Y.PREFER_ENV=O.any?A.WEBGL:A.WEBGL2,Y.STRICT_TEXTURE_CACHE=!1;var fe=[];function pe(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=fe.length-1;n>=0;--n){var o=fe[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */var de=function(t,e){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function ye(t,e){function r(){this.constructor=t}de(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var ve=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new ce("setRealSize"),this.onUpdate=new ce("update"),this.onError=new ce("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,r){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),me=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return(i=t.call(this,o,s)||this).data=e,i}return ye(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===j.UNPACK),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,r.internalFormat,e.width,e.height,0,e.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(ve),ge={scaleMode:k.NEAREST,format:D.RGBA,alphaMode:j.NPM},_e=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var i=t.call(this)||this,n=(r=r||{}).alphaMode,o=r.mipmap,s=r.anisotropicLevel,a=r.scaleMode,h=r.width,u=r.height,l=r.wrapMode,c=r.format,f=r.type,p=r.target,d=r.resolution,y=r.resourceOptions;return!e||e instanceof ve||((e=pe(e,y)).internal=!0),i.width=h||0,i.height=u||0,i.resolution=d||Y.RESOLUTION,i.mipmap=void 0!==o?o:Y.MIPMAP_TEXTURES,i.anisotropicLevel=void 0!==s?s:Y.ANISOTROPIC_LEVEL,i.wrapMode=l||Y.WRAP_MODE,i.scaleMode=void 0!==a?a:Y.SCALE_MODE,i.format=c||D.RGBA,i.type=f||N.UNSIGNED_BYTE,i.target=p||L.TEXTURE_2D,i.alphaMode=void 0!==n?n:j.UNPACK,void 0!==r.premultiplyAlpha&&(i.premultiplyAlpha=r.premultiplyAlpha),i.uid=yt(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=h>0&&u>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(e),i}return ye(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.ceil(this.width*this.resolution-1e-4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.ceil(this.height*this.resolution-1e-4)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=lt(this.realWidth)&&lt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete bt[this.cacheId],delete _t[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,r,i){void 0===i&&(i=Y.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;n?o=t:(t._pixiId||(t._pixiId="pixiid_"+yt()),o=t._pixiId);var s=bt[o];if(n&&i&&!s)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return s||((s=new e(t,r)).cacheId=o,e.addToCache(s,o)),s},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new me(t,{width:r,height:i}),s=t instanceof Float32Array?N.FLOAT:N.UNSIGNED_BYTE;return new e(o,Object.assign(ge,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),bt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),bt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=bt[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete bt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete bt[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(W.a),be=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;(i=t.call(this,o,s)||this).items=[],i.itemDirtyIds=[];for(var a=0;a<e;a++){var h=new _e;i.items.push(h),i.itemDirtyIds.push(-2)}return i.length=e,i._load=null,i.baseTexture=null,i}return ye(e,t),e.prototype.initFromArray=function(t,e){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof ve?this.addResourceAt(t[r],r):this.addResourceAt(pe(t[r],e),r))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],r=e.realWidth,i=e.realHeight;return t.resize(r,i),Promise.resolve(t)})),this._load},e}(ve),xe=function(t){function e(e,r){var i,n,o=this,s=r||{},a=s.width,h=s.height;return Array.isArray(e)?(i=e,n=e.length):n=e,o=t.call(this,n,{width:a,height:h})||this,i&&o.initFromArray(i,r),o}return ye(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=L.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,r){var i=this.length,n=this.itemDirtyIds,o=this.items,s=t.gl;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,e.format,this._width,this._height,i,0,e.format,e.type,null);for(var a=0;a<i;a++){var h=o[a];n[a]<h.dirtyId&&(n[a]=h.dirtyId,h.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,a,h.resource.width,h.resource.height,1,e.format,e.type,h.resource.source))}return!0},e}(be),we=function(t){function e(e){var r=this,i=e,n=i.naturalWidth||i.videoWidth||i.width,o=i.naturalHeight||i.videoHeight||i.height;return(r=t.call(this,n,o)||this).source=e,r.noSubImage=!1,r}return ye(e,t),e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=function(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,wt||(wt=document.createElement("a")),wt.href=t;var r=Object(Z.parse)(wt.href),i=!r.port&&""===e.port||r.port===e.port;return r.hostname===e.hostname&&i&&r.protocol===e.protocol?"":"anonymous"}(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===j.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||r.width!==o||r.height!==s?(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(ve),Te=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ye(e,t),e.test=function(t){var e=window.OffscreenCanvas;return!!(e&&t instanceof e)||t instanceof HTMLCanvasElement},e}(we),Ee=function(t){function e(r,i){var n=this,o=i||{},s=o.width,a=o.height,h=o.autoLoad,u=o.linkBaseTexture;if(r&&r.length!==e.SIDES)throw new Error("Invalid length. Got "+r.length+", expected 6");n=t.call(this,6,{width:s,height:a})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=L.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=!1!==u,r&&n.initFromArray(r,i),!1!==h&&n.load(),n}return ye(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=L.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,r){if(void 0===r&&(r=this.linkBaseTexture),!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=L.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,r,i){for(var n=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];n[o]<s.dirtyId&&(s.valid&&s.resource?(s.resource.upload(t,s,i),n[o]=s.dirtyId):n[o]<-1&&(t.gl.texImage2D(s.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),n[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(be),Se=function(t){function e(e,r){var i=this;if(r=r||{},!(e instanceof HTMLImageElement)){var n=new Image;we.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}return i=t.call(this,e)||this,!e.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=e.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(void 0!==r.createBitmap?r.createBitmap:Y.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,i.alphaMode="number"==typeof r.alphaMode?r.alphaMode:null,void 0!==r.premultiplyAlpha&&(i.premultiplyAlpha=r.premultiplyAlpha),i.bitmap=null,i._load=null,!1!==r.autoLoad&&i.load(),i}return ye(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var i=e.source;e.url=i.src;var n=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?n():(i.onload=n,i.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(e,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===j.UNPACK?"premultiply":"none"}).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if("number"==typeof this.alphaMode&&(r.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0,o=r._glTextures;for(var s in o){var a=o[s];if(a!==i&&a.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(we),Pe=function(t){function e(e,r){var i=this;return r=r||{},(i=t.call(this,document.createElement("canvas"))||this)._width=0,i._height=0,i.svg=e,i.scale=r.scale||1,i._overrideWidth=r.width,i._overrideHeight=r.height,i._resolve=null,i._crossorigin=r.crossorigin,i._load=null,!1!==r.autoLoad&&i.load(),i}return ye(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(e){if(t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},/^\<svg/.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;we.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(r){t._resolve&&(e.onerror=null,t.onError.emit(r))},e.onload=function(){if(t._resolve){var r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=r*t.scale,o=i*t.scale;(t._overrideWidth||t._overrideHeight)&&(n=t._overrideWidth||t._overrideHeight/i*r,o=t._overrideHeight||t._overrideWidth/r*i),n=Math.round(n),o=Math.round(o);var s=t.source;s.width=n,s.height=o,s._pixiId="canvas_"+yt(),s.getContext("2d").drawImage(e,0,0,r,i,0,0,n,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var r=e.SVG_SIZE.exec(t),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,e){return"svg"===e||"string"==typeof t&&0===t.indexOf("data:image/svg+xml;base64")||"string"==typeof t&&0===t.indexOf("<svg")},e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(we),Oe=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];we.crossOrigin(o,s,i.crossorigin);for(var a=0;a<r.length;++a){var h=document.createElement("source"),u=r[a],l=u.src,c=u.mime,f=(l=l||r[a]).split("?").shift().toLowerCase(),p=f.substr(f.lastIndexOf(".")+1);c=c||e.MIME_TYPES[p]||"video/"+p,h.src=l,h.type=c,o.appendChild(h)}r=o}return(n=t.call(this,r)||this).noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=!1!==i.autoPlay,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),!1!==i.autoLoad&&n.load(),n}return ye(e,t),e.prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var r=ee.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(r){t.valid?r(t):(t._resolve=r,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ee.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ee.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&ee.shared.remove(this.update,this);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(ee.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ee.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(we),Ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ye(e,t),e.test=function(t){return!!window.createImageBitmap&&t instanceof ImageBitmap},e}(we);fe.push(Se,Ae,Te,Oe,Pe,me,Ee,xe);var Ce={Resource:ve,BaseImageResource:we,INSTALLED:fe,autoDetectResource:pe,AbstractMultiResource:be,ArrayResource:xe,BufferResource:me,CanvasResource:Te,CubeResource:Ee,ImageResource:Se,SVGResource:Pe,VideoResource:Oe,ImageBitmapResource:Ae},Ie=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),Re=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ye(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===j.UNPACK),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,1===t.context.webGLVersion?i.DEPTH_COMPONENT:i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(me),Me=function(){function t(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new ce("disposeFramebuffer"),this.multisample=z.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new _e(null,{scaleMode:k.NEAREST,resolution:1,mipmap:U.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new _e(new Re(null,{width:this.width,height:this.height}),{scaleMode:k.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:U.OFF,format:D.DEPTH_COMPONENT,type:N.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(t/n,e/n)}if(this.depthTexture){n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,e/n)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),De=function(t){function e(e){var r=this;if("number"==typeof e){var i=arguments[0],n=arguments[1],o=arguments[2],s=arguments[3];e={width:i,height:n,scaleMode:o,resolution:s}}r=t.call(this,null,e)||this;var a=e||{},h=a.width,u=a.height;return r.mipmap=0,r.width=Math.ceil(h)||100,r.height=Math.ceil(u)||100,r.valid=!0,r.clearColor=[0,0,0,0],r.framebuffer=new Me(r.width*r.resolution,r.height*r.resolution).addColorTexture(0,r),r.maskStack=[],r.filterStack=[{}],r}return ye(e,t),e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),this.framebuffer.resize(t*this.resolution,e*this.resolution)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(_e),Le=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,h=t.y/n+s;r=Xt.add(r,Xt.NW),this.x0=a+o*Xt.uX(r),this.y0=h+s*Xt.uY(r),r=Xt.add(r,2),this.x1=a+o*Xt.uX(r),this.y1=h+s*Xt.uY(r),r=Xt.add(r,2),this.x2=a+o*Xt.uX(r),this.y2=h+s*Xt.uY(r),r=Xt.add(r,2),this.x3=a+o*Xt.uX(r),this.y3=h+s*Xt.uY(r)}else 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;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t}(),Ne=new Le,ke=function(t){function e(r,i,n,o,s,a){var h=t.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new At(0,0,1,1)),r instanceof e&&(r=r.baseTexture),h.baseTexture=r,h._frame=i,h.trim=o,h.valid=!1,h._uvs=Ne,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(s||0),!0===s)h._rotate=2;else if(h._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=a?new Dt(a.x,a.y):new Dt(0,0),h._updateID=0,h.textureCacheIds=[],r.valid?h.noFrame?r.valid&&h.onBaseTextureUpdated(r):h.frame=i:r.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&r.on("update",h.onBaseTextureUpdated,h),h}return ye(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var r=this.baseTexture;r&&r.url&&_t[r.url]&&e.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){return new e(this.baseTexture,this.frame.clone(),this.orig.clone(),this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor)},e.prototype.updateUvs=function(){this._uvs===Ne&&(this._uvs=new Le),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,r,i){void 0===r&&(r={}),void 0===i&&(i=Y.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;n?o=t:(t._pixiId||(t._pixiId="pixiid_"+yt()),o=t._pixiId);var s=_t[o];if(n&&i&&!s)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return s||(r.resolution||(r.resolution=Tt(t)),(s=new e(new _e(t,r))).baseTexture.cacheId=o,_e.addToCache(s.baseTexture,o),e.addToCache(s,o)),s},e.fromURL=function(t,r){var i=Object.assign({autoLoad:!1},null==r?void 0:r.resourceOptions),n=e.from(t,Object.assign({resourceOptions:i},r),!1),o=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):o.load().then((function(){return Promise.resolve(n)}))},e.fromBuffer=function(t,r,i,n){return new e(_e.fromBuffer(t,r,i,n))},e.fromLoader=function(t,r,i){var n=new Se(t);n.url=r;var o=new e(new _e(n,{scaleMode:Y.SCALE_MODE,resolution:Tt(r)}));return i||(i=r),_e.addToCache(o.baseTexture,i),e.addToCache(o,i),i!==r&&(_e.addToCache(o.baseTexture,r),e.addToCache(o,r)),o},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),_t[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),_t[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=_t[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete _t[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)_t[t.textureCacheIds[i]]===t&&delete _t[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(W.a);function Fe(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}ke.EMPTY=new ke(new _e),Fe(ke.EMPTY),Fe(ke.EMPTY.baseTexture),ke.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new ke(new _e(new Te(t)))}(),Fe(ke.WHITE),Fe(ke.WHITE.baseTexture);var Ue=function(t){function e(e,r){var i=this,n=null;if(!(e instanceof De)){var o=arguments[1],s=arguments[2],a=arguments[3],h=arguments[4];console.warn("Please use RenderTexture.create("+o+", "+s+") instead of the ctor directly."),n=arguments[0],r=null,e=new De({width:o,height:s,scaleMode:a,resolution:h})}return(i=t.call(this,e,r)||this).legacyRenderer=n,i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return ye(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new De(t))},e}(ke),je=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e){var r=new De(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new Ue(r)},t.prototype.getOptimalTexture=function(e,r,i){void 0===i&&(i=1);var n=t.SCREEN_KEY;e*=i,r*=i,this.enableFullScreen&&e===this._pixelsWidth&&r===this._pixelsHeight||(n=(65535&(e=ut(e)))<<16|65535&(r=ut(r))),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(e,r)),o.filterPoolKey=n,o.setResolution(i),o},t.prototype.getFilterTexture=function(t,e){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(e){if(e.width!==this._pixelsWidth||e.height!==this._pixelsHeight){var r=t.SCREEN_KEY,i=this.texturePool[r];if(this.enableFullScreen=e.width>0&&e.height>0,i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[r]=[],this._pixelsWidth=e.width,this._pixelsHeight=e.height}},t.SCREEN_KEY="screen",t}(),Be=function(){function t(t,e,r,i,n,o,s){void 0===e&&(e=0),void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,r,i,n,o){return new t(e,r,i,n,o)},t}(),He=0,Ge=function(){function t(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=He++,this.disposeRunner=new ce("disposeBuffer")}return t.prototype.update=function(t){this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}();function Xe(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}var ze={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ye={5126:4,5123:2,5121:1},Ve=0,We={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},qe=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ve++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new ce("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===r&&(r=0),void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Ge||(e instanceof Array&&(e=new Float32Array(e)),e=new Ge(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,r,i,n);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new Be(l,r,i,n,o,s,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof Ge||(t instanceof Array&&(t=new Uint16Array(t)),t=new Ge(t)),t.index=!0,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],i=new Ge;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),r.push(n.size*Ye[n.type]/4),n.buffer=0}for(i.data=function(t,e){for(var r=0,i=0,n={},o=0;o<t.length;o++)i+=e[o],r+=t[o].length;var s=new ArrayBuffer(4*r),a=null,h=0;for(o=0;o<t.length;o++){var u=e[o],l=t[o],c=Xe(l);n[c]||(n[c]=new ze[c](s)),a=n[c];for(var f=0;f<l.length;f++){a[(f/u|0)*i+h+f%u]=l[f]}h+=u}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,r=0;r<this.buffers.length;r++)e.buffers[r]=new Ge(this.buffers[r].data.slice(0));for(var r in this.attributes){var i=this.attributes[r];e.attributes[r]=new Be(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.index=!0),e},t.merge=function(e){for(var r,i=new t,n=[],o=[],s=[],a=0;a<e.length;a++){r=e[a];for(var h=0;h<r.buffers.length;h++)o[h]=o[h]||0,o[h]+=r.buffers[h].data.length,s[h]=0}for(a=0;a<r.buffers.length;a++)n[a]=new(We[Xe(r.buffers[a].data)])(o[a]),i.buffers[a]=new Ge(n[a]);for(a=0;a<e.length;a++){r=e[a];for(h=0;h<r.buffers.length;h++)n[h].set(r.buffers[h].data,s[h]),s[h]+=r.buffers[h].data.length}if(i.attributes=r.attributes,r.indexBuffer){i.indexBuffer=i.buffers[r.buffers.indexOf(r.indexBuffer)],i.indexBuffer.index=!0;var u=0,l=0,c=0,f=0;for(a=0;a<r.buffers.length;a++)if(r.buffers[a]!==r.indexBuffer){f=a;break}for(var a in r.attributes){var p=r.attributes[a];(0|p.buffer)===f&&(l+=p.size*Ye[p.type]/4)}for(a=0;a<e.length;a++){var d=e[a].indexBuffer.data;for(h=0;h<d.length;h++)i.indexBuffer.data[h+c]+=u;u+=r.buffers[f].data.length/l,c+=d.length}}return i},t}(),Ke=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return ye(e,t),e}(qe),Ze=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new Ge(e.vertices),e.uvBuffer=new Ge(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return ye(e,t),e.prototype.map=function(t,e){var r=0,i=0;return 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.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(qe),Je=0,Qe=function(){function t(t,e){this.uniforms=t,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Je++,this.static=!!e}return t.prototype.update=function(){this.dirtyId++},t.prototype.add=function(e,r,i){this.uniforms[e]=new t(r,i)},t.from=function(e,r){return new t(e,r)},t}(),$e=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new At,this.destinationFrame=new At,this.filters=[]}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),tr=function(t){function e(e){var r=t.call(this,e)||this;return r.defaultFilterStack=[{}],r.texturePool=new je,r.texturePool.setScreenSize(e.view),r.statePool=[],r.quad=new Ke,r.quadUv=new Ze,r.tempRect=new At,r.activeState={},r.globalUniforms=new Qe({outputFrame:r.tempRect,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),r.forceClear=!1,r.useMaxPadding=!1,r}return ye(e,t),e.prototype.push=function(t,e){for(var r=this.renderer,i=this.defaultFilterStack,n=this.statePool.pop()||new $e,o=e[0].resolution,s=e[0].padding,a=e[0].autoFit,h=e[0].legacy,u=1;u<e.length;u++){var l=e[u];o=Math.min(o,l.resolution),s=this.useMaxPadding?Math.max(s,l.padding):s+l.padding,a=a||l.autoFit,h=h||l.legacy}1===i.length&&(this.defaultFilterStack[0].renderTexture=r.renderTexture.current),i.push(n),n.resolution=o,n.legacy=h,n.target=t,n.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),n.sourceFrame.pad(s),a&&n.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),n.sourceFrame.ceil(o),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,o),n.filters=e,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height;var c=this.tempRect;c.width=n.sourceFrame.width,c.height=n.sourceFrame.height,n.renderTexture.filterFrame=n.sourceFrame,r.renderTexture.bind(n.renderTexture,n.sourceFrame,c),r.renderTexture.clear()},e.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var n=i.inputSize,o=i.inputPixel,s=i.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=n[0]*e.resolution,o[1]=n[1]*e.resolution,o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=i.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(e.renderTexture.framebuffer.multisample>1&&this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,B.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var u=e.renderTexture,l=this.getOptimalFilterTexture(u.width,u.height,e.resolution);l.filterFrame=u.filterFrame;var c=0;for(c=0;c<r.length-1;++c){r[c].apply(this,u,l,B.CLEAR,e);var f=u;u=l,l=f}r[c].apply(this,u,h.renderTexture,B.BLEND,e),this.returnFilterTexture(u),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},e.prototype.bindAndClear=function(t,e){if(void 0===e&&(e=B.CLEAR),t&&t.filterFrame){var r=this.tempRect;r.width=t.filterFrame.width,r.height=t.filterFrame.height,this.renderer.renderTexture.bind(t,t.filterFrame,r)}else this.renderer.renderTexture.bind(t);"boolean"==typeof e&&(e=e?B.CLEAR:B.BLEND,mt("5.2.1","Use CLEAR_MODES when using clear applyFilter option")),(e===B.CLEAR||e===B.BLIT&&this.forceClear)&&this.renderer.renderTexture.clear()},e.prototype.applyFilter=function(t,e,r,i){var n=this.renderer;this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.state.set(t.state),n.shader.bind(t),t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(M.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(M.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(Nt.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},e.prototype.destroy=function(){this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(t,e,r){return void 0===r&&(r=1),this.texturePool.getOptimalTexture(t,e,r)},e.prototype.getFilterTexture=function(t,e){if("number"==typeof t){var r=t;t=e,e=r}t=t||this.activeState.renderTexture;var i=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution);return i.filterFrame=t.filterFrame,i},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e}(Ie),er=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),rr=function(t){function e(e){var r=t.call(this,e)||this;return r.emptyRenderer=new er(e),r.currentRenderer=r.emptyRenderer,r}return ye(e,t),e.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},e.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h<s;h++){var u=n[h],l=u._batchLocation;if(l>=0&&l<i&&e[l]===u)o[h]=l;else for(;a<i;){var c=e[a];if(!c||c._batchEnabled!==r||c._batchLocation!==a){o[h]=a,u._batchLocation=a,e[a]=u;break}a++}}},e}(Ie),ir=0,nr=function(t){function e(e){var r=t.call(this,e)||this;return r.webGLVersion=1,r.extensions={},r.supports={uint32Indices:!1},r.handleContextLost=r.handleContextLost.bind(r),r.handleContextRestored=r.handleContextRestored.bind(r),e.view.addEventListener("webglcontextlost",r.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",r.handleContextRestored,!1),r}return ye(e,t),Object.defineProperty(e.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),e.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=ir++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},e.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=ir++,this.renderer.runners.contextChange.emit(t)},e.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},e.prototype.createContext=function(t,e){var r;if(Y.PREFER_ENV>=A.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var e="WebGL2RenderingContext"in window&&t instanceof window.WebGL2RenderingContext||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=e,e||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(Ie),or=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=z.NONE,this.msaaBuffer=null,this.blitFramebuffer=null},sr=new At,ar=function(t){function e(e){var r=t.call(this,e)||this;return r.managedFramebuffers=[],r.unknownFramebuffer=new Me(10,10),r.msaaSamples=null,r}return ye(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new At,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;Y.PREFER_ENV===A.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n<t.colorTextures.length;n++){var o=t.colorTextures[n];this.renderer.texture.unbind(o.parentTextureArray||o)}t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,t.width,t.height)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,r,i){var n=this.viewport;n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(t,e,r,i,n){void 0===n&&(n=I.COLOR|I.DEPTH);var o=this.gl;o.clearColor(t,e,r,i),o.clear(n)},e.prototype.initFramebuffer=function(t){var e=this.gl,r=new or(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));for(var i=t.colorTextures,n=0;n<i.length;n++)this.renderer.texture.bind(i[n],0);t.depthTexture&&this.renderer.texture.bind(t.depthTexture,0)},e.prototype.updateFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID],i=t.colorTextures.length;e.drawBuffers||(i=Math.min(i,1)),r.multisample>1&&(r.msaaBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,r.msaaBuffer));for(var n=[],o=0;o<i;o++)if(!(0===o&&r.multisample>1)){var s=t.colorTextures[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,s.target,a._glTextures[this.CONTEXT_UID].texture,0),n.push(e.COLOR_ATTACHMENT0+o)}if((n.length>1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var h=t.depthTexture;this.renderer.texture.bind(h,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil))},e.prototype.detectSamples=function(t){var e=this.msaaSamples,r=z.NONE;if(t<=1||null===e)return r;for(var i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=z.NONE),r},e.prototype.blit=function(t,e,r){var i=this.current,n=this.renderer,o=this.gl,s=this.CONTEXT_UID;if(2===n.context.webGLVersion&&i){var a=i.glFramebuffers[s];if(a){if(!t){if(a.multisample<=1)return;a.blitFramebuffer||(a.blitFramebuffer=new Me(i.width,i.height),a.blitFramebuffer.addColorTexture(0,i.colorTextures[0])),(t=a.blitFramebuffer).width=i.width,t.height=i.height}e||((e=sr).width=i.width,e.height=i.height),r||(r=e);var h=e.width===r.width&&e.height===r.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,a.framebuffer),o.blitFramebuffer(e.x,e.y,e.width,e.height,r.x,r.y,r.width,r.height,o.COLOR_BUFFER_BIT,h?o.NEAREST:o.LINEAR)}}},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)},e.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.enableStencil();var r=t.width,i=t.height,n=this.gl,o=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,o),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,r,i),e.stencil=o,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,o)}}},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new At},e}(Ie),hr=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},ur={5126:4,5123:2,5121:1},lr=function(t){function e(e){var r=t.call(this,e)||this;return r._activeGeometry=null,r._activeVao=null,r.hasVao=!0,r.hasInstance=!0,r.canUseUInt32ElementIndex=!1,r.managedGeometries={},r.managedBuffers={},r}return ye(e,t),e.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,!t.createVertexArray){var r=this.renderer.context.extensions.vertexArrayObject;Y.PREFER_ENV===A.WEBGL_LEGACY&&(r=null),r?(t.createVertexArray=function(){return r.createVertexArrayOES()},t.bindVertexArray=function(t){return r.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return r.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(!t.vertexAttribDivisor){var i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=function(t,e){return i.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,r,n,o){return i.drawElementsInstancedANGLE(t,e,r,n,o)},t.drawArraysInstanced=function(t,e,r,n){return i.drawArraysInstancedANGLE(t,e,r,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},e.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID];i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={});var n=i[e.program.id]||this.initGeometryVao(t,e.program);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()},e.prototype.reset=function(){this.unbind()},e.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.gl,r=0;r<t.buffers.length;r++){var i=t.buffers[r],n=i._glBuffers[this.CONTEXT_UID];if(i._updateID!==n.updateID){n.updateID=i._updateID;var o=i.index?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;if(e.bindBuffer(o,n.buffer),this._boundBuffer=n,n.byteLength>=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var c in h)!h[c].size&&e.attributeData[c]?h[c].size=e.attributeData[c].size:h[c].size||console.warn("PIXI Geometry attribute '"+c+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[c].buffer]+=h[c].size*ur[h[c].type];for(var c in h){var f=h[c],p=f.size;void 0===f.stride&&(u[f.buffer]===p*ur[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=p*ur[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var d=0;d<a.length;d++){var y=a[d];y._glBuffers[i]||(y._glBuffers[i]=new hr(r.createBuffer()),this.managedBuffers[y.id]=y,y.disposeRunner.add(this)),y._glBuffers[i].refCount++}return this.activateVao(t,e),this._activeVao=s,o[e.id]=s,o[n]=s,s},e.prototype.disposeBuffer=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeGeometry=function(t,e){if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var r=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,n=t.buffers;if(t.disposeRunner.remove(this),r){for(var o=0;o<n.length;o++){var s=n[o]._glBuffers[this.CONTEXT_UID];s.refCount--,0!==s.refCount||e||this.disposeBuffer(n[o],e)}if(!e)for(var a in r)if("g"===a[0]){var h=r[a];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t);e=Object.keys(this.managedBuffers);for(r=0;r<e.length;r++)this.disposeBuffer(this.managedBuffers[e[r]],t)},e.prototype.activateVao=function(t,e){var r=this.gl,i=this.CONTEXT_UID,n=t.buffers,o=t.attributes;t.indexBuffer&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.indexBuffer._glBuffers[i].buffer);var s=null;for(var a in o){var h=o[a],u=n[h.buffer]._glBuffers[i];if(e.attributeData[a]){s!==u&&(r.bindBuffer(r.ARRAY_BUFFER,u.buffer),s=u);var l=e.attributeData[a].location;if(r.enableVertexAttribArray(l),r.vertexAttribPointer(l,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(l,1)}}}},e.prototype.draw=function(t,e,r,i){var n=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(r||0)*s,i||1):n.drawElements(t,e||o.indexBuffer.data.length,a,(r||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?n.drawArraysInstanced(t,r,e||o.getSize(),i||1):n.drawArrays(t,r,e||o.getSize());return this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(Ie),cr=function(){function t(t){void 0===t&&(t=null),this.type=X.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._target=null}return t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=X.NONE,this.autoDetect=!0),this._target=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function fr(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function pr(t,e,r,i){var n=fr(t,t.VERTEX_SHADER,e),o=fr(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,o),i)for(var a in i)t.bindAttribLocation(s,i[a],a);return t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||(t.getShaderParameter(n,t.COMPILE_STATUS)||(console.warn(e),console.error(t.getShaderInfoLog(n))),t.getShaderParameter(o,t.COMPILE_STATUS)||(console.warn(r),console.error(t.getShaderInfoLog(o))),console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(s,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(s)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(s)),t.deleteProgram(s),s=null),t.deleteShader(n),t.deleteShader(o),s}function dr(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}function yr(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return dr(2*e);case"bvec3":return dr(3*e);case"bvec4":return dr(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var vr,mr={},gr=mr;function _r(){if(gr===mr||gr&&gr.isContextLost()){var t=document.createElement("canvas"),e=void 0;Y.PREFER_ENV>=A.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),gr=e}return gr}function br(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===G.HIGH&&r!==G.HIGH&&(i=G.MEDIUM),"precision "+i+" float;\n"+t}return r!==G.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var xr={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function wr(t){return xr[t]}var Tr=null,Er={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Sr(t,e){if(!Tr){var r=Object.keys(Er);Tr={};for(var i=0;i<r.length;++i){var n=r[i];Tr[t[n]]=Er[n]}}return Tr[e]}var Pr=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n            if(uv["'+t+'"] !== ud["'+t+'"].value)\n            {\n                ud["'+t+'"].value = uv["'+t+'"]\n                gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n            }\n            '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n            renderer.texture.bind(uv["'+t+'"], t);\n\n            if(ud["'+t+'"].value !== t)\n            {\n                ud["'+t+'"].value = t;\n                gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n            }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n            gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n            '}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n                }'}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n                }\n            '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n                }'}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n                }'}}],Or={float:"\n    if(cv !== v)\n    {\n        cv.v = v;\n        gl.uniform1f(location, v)\n    }",vec2:"\n    if(cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"gl.uniform4f(location, v[0], v[1], v[2], v[3])",int:"gl.uniform1i(location, v)",ivec2:"gl.uniform2i(location, v[0], v[1])",ivec3:"gl.uniform3i(location, v[0], v[1], v[2])",ivec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",bool:"gl.uniform1i(location, v)",bvec2:"gl.uniform2i(location, v[0], v[1])",bvec3:"gl.uniform3i(location, v[0], v[1], v[2])",bvec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},Ar={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var Cr,Ir=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function Rr(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var Mr=0,Dr={},Lr=function(){function t(e,r,i){void 0===i&&(i="pixi-shader"),this.id=Mr++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),Dr[i]?(Dr[i]++,i+="-"+Dr[i]):Dr[i]=1,this.vertexSrc="#define SHADER_NAME "+i+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+"\n"+this.fragmentSrc,this.vertexSrc=br(this.vertexSrc,Y.PRECISION_VERTEX,G.HIGH),this.fragmentSrc=br(this.fragmentSrc,Y.PRECISION_FRAGMENT,function(){if(!vr){vr=G.MEDIUM;var t=_r();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);vr=e.precision?G.HIGH:G.MEDIUM}}return vr}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null}return t.prototype.extractData=function(t,e){var r=_r();if(r){var i=pr(r,t,e);this.attributeData=this.getAttributeData(i,r),this.uniformData=this.getUniformData(i,r),r.deleteProgram(i)}else this.uniformData={},this.attributeData={}},t.prototype.getAttributeData=function(t,e){for(var r={},i=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var s=e.getActiveAttrib(t,o),a=Sr(e,s.type),h={type:a,name:s.name,size:wr(a),location:0};r[s.name]=h,i.push(h)}i.sort((function(t,e){return t.name>e.name?1:-1}));for(o=0;o<i.length;o++)i[o].location=o;return r},t.prototype.getUniformData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]$/,""),a=o.name.match(/\[.*?\]$/),h=Sr(e,o.type);r[s]={type:h,size:o.size,isArray:a,value:yr(h,o.size)}}return r},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,r,i){var n=e+r,o=gt[n];return o||(gt[n]=o=new t(e,r,i)),o},t}(),Nr=function(){function t(t,e){for(var r in this.program=t,this.uniformGroup=e?e instanceof Qe?e:new Qe(e):new Qe({}),t.uniformData)this.uniformGroup.uniforms[r]instanceof Array&&(this.uniformGroup.uniforms[r]=new Float32Array(this.uniformGroup.uniforms[r]))}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,r,i){return new t(Lr.from(e,r),i)},t}(),kr=function(){function t(){this.data=0,this.blendMode=R.NORMAL,this.polygonOffset=0,this.blend=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==R.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),Fr=function(t){function e(r,i,n){var o=this,s=Lr.from(r||e.defaultVertexSrc,i||e.defaultFragmentSrc);return(o=t.call(this,s,n)||this).padding=0,o.resolution=Y.FILTER_RESOLUTION,o.enabled=!0,o.autoFit=!0,o.legacy=!!o.program.attributeData.aTextureCoord,o.state=new kr,o}return ye(e,t),e.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(Nr),Ur=new Nt,jr=function(){function t(t,e){this._texture=t,this.mapCoord=new Nt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(Ur.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(Ur));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,h=this.clampOffset;return s[0]=(e._frame.x+a+h)/o.width,s[1]=(e._frame.y+a+h)/o.height,s[2]=(e._frame.x+e._frame.width-a+h)/o.width,s[3]=(e._frame.y+e._frame.height-a+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},t}(),Br=function(t){function e(e){var r=this,i=new Nt;return r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n")||this,e.renderable=!1,r.maskSprite=e,r.maskMatrix=i,r}return ye(e,t),e.prototype.apply=function(t,e,r,i){var n=this.maskSprite,o=n._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new jr(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))},e}(Fr),Hr=function(t){function e(e){var r=t.call(this,e)||this;return r.enableScissor=!1,r.alphaMaskPool=[],r.maskDataPool=[],r.maskStack=[],r.alphaMaskIndex=0,r}return ye(e,t),e.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},e.prototype.push=function(t,e){var r=e;if(!r.isMaskData){var i=this.maskDataPool.pop()||new cr;i.pooled=!0,i.maskObject=e,r=i}switch(r.autoDetect&&this.detect(r),r.copyCountersOrReset(this.maskStack[this.maskStack.length-1]),r._target=t,r.type){case X.SCISSOR:this.maskStack.push(r),this.renderer.scissor.push(r);break;case X.STENCIL:this.maskStack.push(r),this.renderer.stencil.push(r);break;case X.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r),this.maskStack.push(r)}},e.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){switch(e.type){case X.SCISSOR:this.renderer.scissor.pop();break;case X.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case X.SPRITE:this.popSpriteMask()}e.reset(),e.pooled&&this.maskDataPool.push(e)}},e.prototype.detect=function(t){var e=t.maskObject;if(e.isSprite)t.type=X.SPRITE;else if(t.type=X.STENCIL,this.enableScissor&&e.isFastRect&&e.isFastRect()){var r=e.worldTransform,i=Math.atan2(r.b,r.a),n=Math.atan2(r.d,r.c);i=Math.round(i*(180/Math.PI)*100),n=((n=Math.round(n*(180/Math.PI)*100)-i)%18e3+18e3)%18e3,0===(i=(i%9e3+9e3)%9e3)&&9e3===n&&(t.type=X.SCISSOR)}},e.prototype.pushSpriteMask=function(t){var e=t.maskObject,r=t._target,i=this.alphaMaskPool[this.alphaMaskIndex];i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Br(e)]),i[0].resolution=this.renderer.resolution,i[0].maskSprite=e;var n=r.filterArea;r.filterArea=e.getBounds(!0),this.renderer.filter.push(r,i),r.filterArea=n,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e}(Ie),Gr=function(t){function e(e){var r=t.call(this,e)||this;return r.maskStack=[],r.glConst=0,r}return ye(e,t),e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.maskStack=null},e}(Ie),Xr=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.SCISSOR_TEST,r}return ye(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.push=function(t){var e=t.maskObject;e.renderable=!0;var r=t._scissorRect,i=e.getBounds(!0),n=this.renderer.gl;e.renderable=!1,r?i.fit(r):n.enable(n.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=i,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*s+o.x,h=(t.y-n.y)*s+o.y,u=t.width*s,l=t.height*s;i&&(a+=i.tx*s,h+=i.ty*s),e||(h=this.renderer.height-l-h),this.renderer.gl.scissor(a,h,u,l)},e}(Gr),zr=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return ye(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.getStackLength())-1},e}(Gr),Yr=function(t){function e(e){var r=t.call(this,e)||this;return r.destinationFrame=null,r.sourceFrame=null,r.defaultFrame=null,r.projectionMatrix=new Nt,r.transform=null,r}return ye(e,t),e.prototype.update=function(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/e.width*2,n.d=o*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-o-e.y*n.d},e.prototype.setTransform=function(t){},e}(Ie),Vr=new At,Wr=new At,qr=new At,Kr=function(t){function e(e){var r=t.call(this,e)||this;return r.clearColor=e._backgroundColorRgba,r.defaultMaskStack=[],r.current=null,r.sourceFrame=new At,r.destinationFrame=new At,r}return ye(e,t),e.prototype.bind=function(t,e,r){void 0===t&&(t=null);var i,n,o,s=this.renderer;this.current=t,t?(o=(i=t.baseTexture).resolution,e||(Vr.width=t.frame.width,Vr.height=t.frame.height,e=Vr),r||(Wr.x=t.frame.x,Wr.y=t.frame.y,Wr.width=e.width,Wr.height=e.height,r=Wr),n=i.framebuffer):(o=s.resolution,e||(Vr.width=s.screen.width,Vr.height=s.screen.height,e=Vr),r||((r=Vr).width=e.width,r.height=e.height)),qr.x=r.x*o,qr.y=r.y*o,qr.width=r.width*o,qr.height=r.height*o,this.renderer.framebuffer.bind(n,qr),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor,this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e)},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e}(Ie),Zr=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null},t}(),Jr=0,Qr={textureCount:0},$r=function(t){function e(e){var r=t.call(this,e)||this;return r.destroyed=!1,r.systemCheck(),r.gl=null,r.shader=null,r.program=null,r.cache={},r.id=Jr++,r}return ye(e,t),e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof Cr)return Cr;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");Cr=!0===t({a:"b"},"a","b")}catch(t){Cr=!1}return Cr}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(t){this.gl=t,this.reset()},e.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||(Qr.textureCount=0,this.syncUniformGroup(t.uniformGroup,Qr)),i},e.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},e.prototype.syncUniformGroup=function(t,e){var r=this.getglProgram();t.static&&t.dirtyId===r.uniformGroups[t.id]||(r.uniformGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))},e.prototype.syncUniforms=function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)},e.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData);return this.cache[e]||(this.cache[e]=function(t,e){var r=["\n        var v = null;\n        var cv = null\n        var t = 0;\n        var gl = renderer.gl\n    "];for(var i in t.uniforms){var n=e[i];if(n){for(var o=t.uniforms[i],s=!1,a=0;a<Pr.length;a++)if(Pr[a].test(n,o)){r.push(Pr[a].code(i,o)),s=!0;break}if(!s){var h=(1===n.size?Or:Ar)[n.type].replace("location",'ud["'+i+'"].location');r.push('\n            cv = ud["'+i+'"].value;\n            v = uv["'+i+'"];\n            '+h+";")}}else t.uniforms[i].group&&r.push('\n                    renderer.shader.syncUniformGroup(uv["'+i+'"], syncData);\n                ')}return new Function("ud","uv","renderer","syncData",r.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},e.prototype.getSignature=function(t,e){var r=t.uniforms,i=[];for(var n in r)i.push(n),e[n]&&i.push(e[n].type);return i.join("-")},e.prototype.getglProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateShader=function(t){var e=this.gl,r=t.program,i={};for(var n in r.attributeData)i[n]=r.attributeData[n].location;var o=pr(e,r.vertexSrc,r.fragmentSrc,i),s={};for(var n in r.uniformData){var a=r.uniformData[n];s[n]={location:e.getUniformLocation(o,n),value:yr(a.type,a.size)}}var h=new Zr(o,s);return r.glPrograms[this.renderer.CONTEXT_UID]=h,h},e.prototype.reset=function(){this.program=null,this.shader=null},e.prototype.destroy=function(){this.destroyed=!0},e}(Ie);var ti=function(t){function e(e){var r=t.call(this,e)||this;return r.gl=null,r.stateId=0,r.polygonOffset=0,r.blendMode=R.NONE,r._blendEq=!1,r.map=[],r.map[0]=r.setBlend,r.map[1]=r.setOffset,r.map[2]=r.setCullFace,r.map[3]=r.setDepthTest,r.map[4]=r.setFrontFace,r.checks=[],r.defaultState=new kr,r.defaultState.blend=!0,r}return ye(e,t),e.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[R.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.ADD]=[t.ONE,t.ONE],e[R.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.NONE]=[0,0],e[R.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[R.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[R.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[R.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[R.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[R.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[R.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[R.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[R.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[R.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[R.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},e.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(r=0;r<this.checks.length;r++)this.checks[r](this,t)},e.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},e.prototype.setBlend=function(t){this.updateCheck(e.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},e.prototype.setOffset=function(t){this.updateCheck(e.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},e.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},e.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},e.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},e.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},e.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},e.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},e.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},e.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},e.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},e}(Ie),ei=function(t){function e(e){var r=t.call(this,e)||this;return r.count=0,r.checkCount=0,r.maxIdle=Y.GC_MAX_IDLE,r.checkCountMax=Y.GC_MAX_CHECK_COUNT,r.mode=Y.GC_MODE,r}return ye(e,t),e.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==H.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i<e.length;i++)null!==e[i]&&(e[o++]=e[i]);e.length=o}},e.prototype.unload=function(t){var e,r=this.renderer.texture;(null===(e=t._texture)||void 0===e?void 0:e.framebuffer)&&r.destroyTexture(t._texture);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},e}(Ie),ri=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121},ii=function(t){function e(e){var r=t.call(this,e)||this;return r.boundTextures=[],r.currentLocation=-1,r.managedTextures=[],r._unknownBoundTextures=!1,r.unknownTexture=new _e,r}return ye(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new ri(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new ri(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(r=0;r<this.boundTextures.length;r++)this.bind(null,r)},e.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if(t){if((t=t.castToBaseTexture()).parentTextureArray)return;if(t.valid){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},e.prototype.reset=function(){this._unknownBoundTextures=!0,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},e.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(i=0;i<r.length;i++)r[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[t.target].texture),r[i]=null)},e.prototype.initTexture=function(t){var e=new ri(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(t,e){if(e.internalFormat=t.format,e.type=t.type,2===this.webGLVersion){var r=this.renderer.gl;t.type===r.FLOAT&&t.format===r.RGBA&&(e.internalFormat=r.RGBA32F),t.type===N.HALF_FLOAT&&(e.type=r.HALF_FLOAT),e.type===r.HALF_FLOAT&&t.format===r.RGBA&&(e.internalFormat=r.RGBA16F)}},e.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var r=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(r,t,e));else{var i=t.realWidth,n=t.realHeight,o=r.gl;(e.width!==i||e.height!==n||e.dirtyId<0)&&(e.width=i,e.height=n,o.texImage2D(t.target,0,e.internalFormat,i,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},e.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&ft(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==U.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=F.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;if(e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===k.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===k.LINEAR){var n=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===k.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===k.LINEAR?r.LINEAR:r.NEAREST)},e}(Ie),ni=new Nt,oi=function(t){function e(e,r){void 0===e&&(e=C.UNKNOWN);var i=t.call(this)||this;return(r=Object.assign({},Y.RENDER_OPTIONS,r)).roundPixels&&(Y.ROUND_PIXELS=r.roundPixels,mt("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),i.options=r,i.type=e,i.screen=new At(0,0,r.width,r.height),i.view=r.view||document.createElement("canvas"),i.resolution=r.resolution||Y.RESOLUTION,i.transparent=r.transparent,i.autoDensity=r.autoDensity||r.autoResize||!1,i.preserveDrawingBuffer=r.preserveDrawingBuffer,i.clearBeforeRender=r.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,0],i._backgroundColorString="#000000",i.backgroundColor=r.backgroundColor||i._backgroundColor,i._lastObjectRendered=null,i.plugins={},i}return ye(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px"),this.emit("resize",t,e)},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds(null,!0)).width&&(i.width=1),0===i.height&&(i.height=1);var n=Ue.create({width:0|i.width,height:0|i.height,scaleMode:e,resolution:r});return ni.tx=-i.x,ni.ty=-i.y,this.render(t,n,!1,ni,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);this.plugins=null,this.type=C.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=rt(t),et(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),e}(W.a),si=function(t){function e(r){var i=t.call(this,C.WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new ce("destroy"),contextChange:new ce("contextChange"),reset:new ce("reset"),update:new ce("update"),postrender:new ce("postrender"),prerender:new ce("prerender"),resize:new ce("resize")},i.globalUniforms=new Qe({projectionMatrix:new Nt},!0),i.addSystem(Hr,"mask").addSystem(nr,"context").addSystem(ti,"state").addSystem($r,"shader").addSystem(ii,"texture").addSystem(lr,"geometry").addSystem(ar,"framebuffer").addSystem(Xr,"scissor").addSystem(zr,"stencil").addSystem(Yr,"projection").addSystem(ei,"textureGC").addSystem(tr,"filter").addSystem(Kr,"renderTexture").addSystem(rr,"batch"),i.initPlugins(e.__plugins),r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.transparent,antialias:r.antialias,premultipliedAlpha:i.transparent&&"notMultiplied"!==i.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,tt(2===i.context.webGLVersion?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return ye(e,t),e.create=function(t){if(void 0===Q&&(Q=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:Y.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Q)return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(e,r)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(oi);var ai="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n",hi=function(){this.texArray=null,this.blend=0,this.type=M.TRIANGLES,this.start=0,this.size=0,this.data=null},ui=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),li=function(){function t(t){this.rawBinaryData=new ArrayBuffer(t),this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),ci=function(t){function e(e){var r=t.call(this,e)||this;return r.shaderGenerator=null,r.geometryClass=null,r.vertexSize=null,r.state=kr.for2d(),r.size=4*Y.SPRITE_BATCH_SIZE,r._vertexCount=0,r._indexCount=0,r._bufferedElements=[],r._bufferedTextures=[],r._bufferSize=0,r._shader=null,r._packedGeometries=[],r._packedGeometryPoolSize=2,r._flushId=0,r._aBuffers={},r._iBuffers={},r.MAX_TEXTURES=1,r.renderer.on("prerender",r.onPrerender,r),e.runners.contextChange.add(r),r._dcIndex=0,r._aIndex=0,r._iIndex=0,r._attributeBuffer=null,r._indexBuffer=null,r._tempBoundTextures=[],r}return ye(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;Y.PREFER_ENV===A.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Y.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var i=Ir.replace(/%forloop%/gi,Rr(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,r=e._textureArrayPool,i=this.size/4,n=Math.floor(i/this.MAX_TEXTURES)+1;t.length<i;)t.push(new hi);for(;r.length<n;)r.push(new ui);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,r=this.MAX_TEXTURES,i=e._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++_e._globalBatch,h=0,u=i[0],l=0;n.copyBoundTextures(o,r);for(var c=0;c<this._bufferSize;++c){var f=t[c];t[c]=null,f._batchEnabled!==a&&(u.count>=r&&(n.boundArray(u,o,a,r),this.buildDrawCalls(u,l,c),l=c,u=i[++h],++a),f._batchEnabled=a,f.touched=s,u.elements[u.count++]=f)}u.count>0&&(n.boundArray(u,o,a,r),this.buildDrawCalls(u,l,this._bufferSize),++h,++a);for(c=0;c<o.length;c++)o[c]=null;_e._globalBatch=a},e.prototype.buildDrawCalls=function(t,r,i){var n=this._bufferedElements,o=this._attributeBuffer,s=this._indexBuffer,a=this.vertexSize,h=e._drawCallPool,u=this._dcIndex,l=this._aIndex,c=this._iIndex,f=h[u];f.start=this._iIndex,f.texArray=t;for(var p=r;p<i;++p){var d=n[p],y=d._texture.baseTexture,v=ot[y.alphaMode?1:0][d.blendMode];n[p]=null,r<p&&f.blend!==v&&(f.size=c-f.start,r=p,(f=h[++u]).texArray=t,f.start=c),this.packInterleavedGeometry(d,o,s,l,c),l+=d.vertexData.length/2*a,c+=d.indices.length,f.blend=v}r<i&&(f.size=c-f.start,++u),this._dcIndex=u,this._aIndex=l,this._iIndex=c},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this._packedGeometries,e=this._attributeBuffer,r=this._indexBuffer;Y.CAN_UPLOAD_SAME_BUFFER?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,r=this.renderer,i=r.gl,n=r.state,o=e._drawCallPool,s=null,a=0;a<t;a++){var h=o[a],u=h.texArray,l=h.type,c=h.size,f=h.start,p=h.blend;s!==u&&(s=u,this.bindAndClearTexArray(u)),this.state.blendMode=p,n.set(this.state),i.drawElements(l,c,i.UNSIGNED_SHORT,2*f)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.shader.bind(this._shader),Y.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=ut(Math.ceil(t/8)),r=ct(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new li(i*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=ut(Math.ceil(t/12)),r=ct(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.packInterleavedGeometry=function(t,e,r,i,n){for(var o=e.uint32View,s=e.float32View,a=i/this.vertexSize,h=t.uvs,u=t.indices,l=t.vertexData,c=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),p=f<1&&t._texture.baseTexture.alphaMode?at(t._tintRGB,f):t._tintRGB+(255*f<<24),d=0;d<l.length;d+=2)s[i++]=l[d],s[i++]=l[d+1],s[i++]=h[d],s[i++]=h[d+1],o[i++]=p,s[i++]=c;for(d=0;d<u.length;d++)r[n++]=a+u[d]},e._drawCallPool=[],e._textureArrayPool=[],e}(er),fi=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=Qe.from({uSamplers:e},!0);var i=this.fragTemplate;i=(i=i.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Lr(this.vertexSrc,i)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new Nt,default:this.defaultGroupCache[t]};return new Nr(this.programCache[t],n)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),pi=function(t){function e(e){void 0===e&&(e=!1);var r=t.call(this)||this;return r._buffer=new Ge(null,e,!1),r._indexBuffer=new Ge(null,e,!0),r.addAttribute("aVertexPosition",r._buffer,2,!1,N.FLOAT).addAttribute("aTextureCoord",r._buffer,2,!1,N.FLOAT).addAttribute("aColor",r._buffer,4,!0,N.UNSIGNED_BYTE).addAttribute("aTextureId",r._buffer,1,!0,N.FLOAT).addIndex(r._indexBuffer),r}return ye(e,t),e}(qe),di="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n",yi="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n",vi=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:di,fragment:yi,geometryClass:pi,vertexSize:6},t),r=e.vertex,i=e.fragment,n=e.vertexSize,o=e.geometryClass;return function(t){function e(e){var s=t.call(this,e)||this;return s.shaderGenerator=new fi(r,i),s.geometryClass=o,s.vertexSize=n,s}return ye(e,t),e}(ci)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return di},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return yi},enumerable:!1,configurable:!0}),t}().create(),mi=function(){function t(e){var r=this;e=Object.assign({forceCanvas:!1},e),this.renderer=function(t){return si.create(t)}(e),this.stage=new Jt,t._plugins.forEach((function(t){t.init.call(r,e)}))}return t.registerPlugin=function(e){t._plugins.push(e)},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,r){var i=this,n=t._plugins.slice(0);n.reverse(),n.forEach((function(t){t.destroy.call(i)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null},t}();mi._plugins=[];var gi=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){window.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(window.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,r;if(e.cancelResize(),e._resizeTo===window)t=window.innerWidth,r=window.innerHeight;else{var i=e._resizeTo;t=i.clientWidth,r=i.clientHeight}e.renderer.resize(t,r)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t}();mi.registerPlugin(gi);
  /*!
   * @pixi/extract - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/extract is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var _i=new At,bi=function(){function t(t){this.renderer=t,t.extract=this}return t.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(e){var r,i,n,o=this.renderer,s=!1,a=!1;e&&(e instanceof Ue?n=e:(n=this.renderer.generateTexture(e),a=!0)),n?(r=n.baseTexture.resolution,i=n.frame,s=!1,o.renderTexture.bind(n)):(r=this.renderer.resolution,s=!0,(i=_i).width=this.renderer.width,i.height=this.renderer.height,o.renderTexture.bind(null));var h=Math.floor(i.width*r+1e-4),u=Math.floor(i.height*r+1e-4),l=new xt(h,u,1),c=new Uint8Array(4*h*u),f=o.gl;f.readPixels(i.x*r,i.y*r,h,u,f.RGBA,f.UNSIGNED_BYTE,c);var p=l.context.getImageData(0,0,h,u);if(t.arrayPostDivide(c,p.data),l.context.putImageData(p,0,0),s){var d=new xt(l.width,l.height,1);d.context.scale(1,-1),d.context.drawImage(l.canvas,0,-u),l.destroy(),l=d}return a&&n.destroy(!0),l.canvas},t.prototype.pixels=function(e){var r,i,n,o=this.renderer,s=!1;e&&(e instanceof Ue?n=e:(n=this.renderer.generateTexture(e),s=!0)),n?(r=n.baseTexture.resolution,i=n.frame,o.renderTexture.bind(n)):(r=o.resolution,(i=_i).width=o.width,i.height=o.height,o.renderTexture.bind(null));var a=i.width*r,h=i.height*r,u=new Uint8Array(4*a*h),l=o.gl;return l.readPixels(i.x*r,i.y*r,a,h,l.RGBA,l.UNSIGNED_BYTE,u),s&&n.destroy(!0),t.arrayPostDivide(u,u),u},t.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},t.arrayPostDivide=function(t,e){for(var r=0;r<t.length;r+=4){var i=e[r+3]=t[r+3];0!==i?(e[r]=Math.round(Math.min(255*t[r]/i,255)),e[r+1]=Math.round(Math.min(255*t[r+1]/i,255)),e[r+2]=Math.round(Math.min(255*t[r+2]/i,255))):(e[r]=t[r],e[r+1]=t[r+1],e[r+2]=t[r+2])}},t}(),xi=r(3),wi=r.n(xi),Ti=r(0),Ei=r.n(Ti);
  /*!
   * resource-loader - v3.0.1
   * https://github.com/pixijs/pixi-sound
   * Compiled Tue, 02 Jul 2019 14:06:18 UTC
   *
   * resource-loader is licensed under the MIT license.
   * http://www.opensource.org/licenses/mit-license
   */
  function Si(){}function Pi(t,e,r,i){var n=0,o=t.length;!function s(a){a||n===o?r&&r(a):i?setTimeout((function(){e(t[n++],s)}),1):e(t[n++],s)}()}function Oi(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function Ai(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var r=0,i={_tasks:[],concurrency:e,saturated:Si,unsaturated:Si,buffer:e/4,empty:Si,drain:Si,error:Si,started:!1,paused:!1,push:function(t,e){n(t,!1,e)},kill:function(){r=0,i.drain=Si,i.started=!1,i._tasks=[]},unshift:function(t,e){n(t,!0,e)},process:function(){for(;!i.paused&&r<i.concurrency&&i._tasks.length;){var e=i._tasks.shift();0===i._tasks.length&&i.empty(),(r+=1)===i.concurrency&&i.saturated(),t(e.data,Oi(o(e)))}},length:function(){return i._tasks.length},running:function(){return r},idle:function(){return i._tasks.length+r===0},pause:function(){!0!==i.paused&&(i.paused=!0)},resume:function(){if(!1!==i.paused){i.paused=!1;for(var t=1;t<=i.concurrency;t++)i.process()}}};function n(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(i.started=!0,null==t&&i.idle())setTimeout((function(){return i.drain()}),1);else{var n={data:t,callback:"function"==typeof r?r:Si};e?i._tasks.unshift(n):i._tasks.push(n),setTimeout((function(){return i.process()}),1)}}function o(t){return function(){r-=1,t.callback.apply(t,arguments),null!=arguments[0]&&i.error(arguments[0],t.data),r<=i.concurrency-i.buffer&&i.unsaturated(),i.idle()&&i.drain(),i.process()}}return i}var Ci={};function Ii(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ri(t,e,r){return e&&Ii(t.prototype,e),r&&Ii(t,r),t}var Mi=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),Di=null;function Li(){}var Ni=function(){function t(e,r,i){if("string"!=typeof e||"string"!=typeof r)throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===r.indexOf("data:")),this.name=e,this.url=r,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===i.crossOrigin?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=Li,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new Ei.a,this.onProgress=new Ei.a,this.onComplete=new Ei.a,this.onAfterMiddleware=new Ei.a}t.setExtensionLoadType=function(e,r){ki(t._loadTypeMap,e,r)},t.setExtensionXhrType=function(e,r){ki(t._xhrTypeMap,e,r)};var e=t.prototype;return e.complete=function(){this._clearEvents(),this._finish()},e.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},e.load=function(e){var r=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout((function(){return e(r)}),1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:Mi&&this.crossOrigin?this._loadXdr():this._loadXhr()}},e._hasFlag=function(t){return 0!=(this._flags&t)},e._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},e._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},e._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},e._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(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),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},e._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(i)?i[0]:i))}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(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},e._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},e._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},e._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},e._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},e._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},e._onTimeout=function(){this.abort("Load timed out.")},e._xhrOnError=function(){var t=this.xhr;this.abort(Fi(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},e._xhrOnTimeout=function(){var t=this.xhr;this.abort(Fi(t)+" Request timed out.")},e._xhrOnAbort=function(){var t=this.xhr;this.abort(Fi(t)+" Request was aborted by the user.")},e._xhrOnLoad=function(){var e=this.xhr,r="",i=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(r=e.responseText),0===i&&(r.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},e._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,Di||(Di=document.createElement("a")),Di.href=t;var r=!(t=wi()(Di.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&i===e.protocol?"":"anonymous"},e._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},e._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},e._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},e._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},Ri(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function ki(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function Fi(t){return t.toString().replace("object ","")}Ni.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},Ni.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},Ni.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},Ni.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},Ni._loadTypeMap={gif:Ni.LOAD_TYPE.IMAGE,png:Ni.LOAD_TYPE.IMAGE,bmp:Ni.LOAD_TYPE.IMAGE,jpg:Ni.LOAD_TYPE.IMAGE,jpeg:Ni.LOAD_TYPE.IMAGE,tif:Ni.LOAD_TYPE.IMAGE,tiff:Ni.LOAD_TYPE.IMAGE,webp:Ni.LOAD_TYPE.IMAGE,tga:Ni.LOAD_TYPE.IMAGE,svg:Ni.LOAD_TYPE.IMAGE,"svg+xml":Ni.LOAD_TYPE.IMAGE,mp3:Ni.LOAD_TYPE.AUDIO,ogg:Ni.LOAD_TYPE.AUDIO,wav:Ni.LOAD_TYPE.AUDIO,mp4:Ni.LOAD_TYPE.VIDEO,webm:Ni.LOAD_TYPE.VIDEO},Ni._xhrTypeMap={xhtml:Ni.XHR_RESPONSE_TYPE.DOCUMENT,html:Ni.XHR_RESPONSE_TYPE.DOCUMENT,htm:Ni.XHR_RESPONSE_TYPE.DOCUMENT,xml:Ni.XHR_RESPONSE_TYPE.DOCUMENT,tmx:Ni.XHR_RESPONSE_TYPE.DOCUMENT,svg:Ni.XHR_RESPONSE_TYPE.DOCUMENT,tsx:Ni.XHR_RESPONSE_TYPE.DOCUMENT,gif:Ni.XHR_RESPONSE_TYPE.BLOB,png:Ni.XHR_RESPONSE_TYPE.BLOB,bmp:Ni.XHR_RESPONSE_TYPE.BLOB,jpg:Ni.XHR_RESPONSE_TYPE.BLOB,jpeg:Ni.XHR_RESPONSE_TYPE.BLOB,tif:Ni.XHR_RESPONSE_TYPE.BLOB,tiff:Ni.XHR_RESPONSE_TYPE.BLOB,webp:Ni.XHR_RESPONSE_TYPE.BLOB,tga:Ni.XHR_RESPONSE_TYPE.BLOB,json:Ni.XHR_RESPONSE_TYPE.JSON,text:Ni.XHR_RESPONSE_TYPE.TEXT,txt:Ni.XHR_RESPONSE_TYPE.TEXT,ttf:Ni.XHR_RESPONSE_TYPE.BUFFER,otf:Ni.XHR_RESPONSE_TYPE.BUFFER},Ni.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";var Ui=window.URL||window.webkitURL;var ji={caching:function(t,e){var r=this;Ci[t.url]?(t.data=Ci[t.url],t.complete()):t.onComplete.once((function(){return Ci[r.url]=r.data})),e()},parsing:function(t,e){if(t.data){if(t.xhr&&t.xhrType===Ni.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=Ui.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=r,t.type=Ni.TYPE.IMAGE,void(t.data.onload=function(){Ui.revokeObjectURL(r),t.data.onload=null,e()})}}else{var i=t.xhr.getResponseHeader("content-type");if(i&&0===i.indexOf("image"))return t.data=new Image,t.data.src="data:"+i+";base64,"+function(t){for(var e="",r=0;r<t.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<t.length?i[o]=255&t.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var s=0;s<n.length;++s)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n[s])}return e}(t.xhr.responseText),t.type=Ni.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}},Bi=/(#[\w-]+)?$/,Hi=function(){function t(e,r){var i=this;void 0===e&&(e=""),void 0===r&&(r=10),this.baseUrl=e,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return i._loadResource(t,e)},this._queue=Ai(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new Ei.a,this.onError=new Ei.a,this.onLoad=new Ei.a,this.onStart=new Ei.a,this.onComplete=new Ei.a;for(var n=0;n<t._defaultBeforeMiddleware.length;++n)this.pre(t._defaultBeforeMiddleware[n]);for(var o=0;o<t._defaultAfterMiddleware.length;++o)this.use(t._defaultAfterMiddleware[o])}var e=t.prototype;return e.add=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);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.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new Ni(t,e,r),"function"==typeof i&&this.resources[t].onAfterMiddleware.once(i),this.loading){for(var o=r.parentResource,s=[],a=0;a<o.children.length;++a)o.children[a].isComplete||s.push(o.children[a]);var h=o.progressChunk*(s.length+1)/(s.length+2);o.children.push(this.resources[t]),o.progressChunk=h;for(var u=0;u<s.length;++u)s[u].progressChunk=h;this.resources[t].progressChunk=h}return this._queue.push(this.resources[t]),this},e.pre=function(t){return this._beforeMiddleware.push(t),this},e.use=function(t){return this._afterMiddleware.push(t),this},e.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort()}return this.resources={},this},e.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},e._prepareUrl=function(t){var e,r=wi()(t,{strictMode:!0});if(e=r.protocol||!r.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var i=Bi.exec(e)[0];-1!==(e=e.substr(0,e.length-i.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=i}return e},e._loadResource=function(t,e){var r=this;t._dequeue=e,Pi(this._beforeMiddleware,(function(e,i){e.call(r,t,(function(){i(t.isComplete?{}:null)}))}),(function(){t.isComplete?r._onLoad(t):(t._onLoadBinding=t.onComplete.once(r._onLoad,r),t.load())}),!0)},e._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},e._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},e._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),Pi(this._afterMiddleware,(function(r,i){r.call(e,t,i)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},Ri(t,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),t}();Hi._defaultBeforeMiddleware=[],Hi._defaultAfterMiddleware=[],Hi.pre=function(t){return Hi._defaultBeforeMiddleware.push(t),Hi},Hi.use=function(t){return Hi._defaultAfterMiddleware.push(t),Hi};
  /*!
   * @pixi/loaders - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/loaders is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var Gi=Ni,Xi=function(t,e){return(Xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */var zi=function(){function t(){}return t.use=function(t,e){t.data&&t.type===Ni.TYPE.IMAGE&&(t.texture=ke.fromLoader(t.data,t.url,t.name)),e()},t}(),Yi=function(t){function e(r,i){for(var n=t.call(this,r,i)||this,o=0;o<e._plugins.length;++o){var s=e._plugins[o],a=s.pre,h=s.use;a&&n.pre(a),h&&n.use(h)}return n._protected=!1,n}return function(t,e){function r(){this.constructor=t}Xi(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(e,"shared",{get:function(){var t=e._shared;return t||((t=new e)._protected=!0,e._shared=t),t},enumerable:!1,configurable:!0}),e.registerPlugin=function(t){return e._plugins.push(t),t.add&&t.add(),e},e._plugins=[],e}(Hi);Yi.registerPlugin({use:ji.parsing}),Yi.registerPlugin(zi);var Vi=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Yi.shared:new Yi},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t}(),Wi=function(t,e){return(Wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};
  /*!
   * @pixi/particles - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/particles is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */function qi(t,e){function r(){this.constructor=t}Wi(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Ki,Zi,Ji=function(t){function e(e,r,i,n){void 0===e&&(e=1500),void 0===i&&(i=16384),void 0===n&&(n=!1);var o=t.call(this)||this;return i>16384&&(i=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=e,o._batchSize=i,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=R.NORMAL,o.autoResize=n,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return qi(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,et(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(Jt),Qi=function(){function t(t,e,r){this.geometry=new qe,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<t.length;++i){var n=t[i];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||N.FLOAT,offset:n.offset},e[i]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new Ge(function(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i<r;i+=6,n+=4)e[i+0]=n+0,e[i+1]=n+1,e[i+2]=n+2,e[i+3]=n+0,e[i+4]=n+2,e[i+5]=n+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var r=0;r<this.dynamicProperties.length;++r){(s=this.dynamicProperties[r]).offset=e,e+=s.size,this.dynamicStride+=s.size}var i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new Ge(this.dynamicData,!1,!1);var n=0;this.staticStride=0;for(r=0;r<this.staticProperties.length;++r){(s=this.staticProperties[r]).offset=n,n+=s.size,this.staticStride+=s.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new Ge(this.staticData,!0,!1);for(r=0;r<this.dynamicProperties.length;++r){var s=this.dynamicProperties[r];t.addAttribute(s.attributeName,this.dynamicBuffer,0,s.type===N.UNSIGNED_BYTE,s.type,4*this.dynamicStride,4*s.offset)}for(r=0;r<this.staticProperties.length;++r){s=this.staticProperties[r];t.addAttribute(s.attributeName,this.staticBuffer,0,s.type===N.UNSIGNED_BYTE,s.type,4*this.staticStride,4*s.offset)}},t.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,n.type===N.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,n.type===N.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),$i=function(t){function e(e){var r=t.call(this,e)||this;return r.shader=null,r.properties=null,r.tempMatrix=new Nt,r.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:r.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:r.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:r.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:r.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:N.UNSIGNED_BYTE,uploadFunction:r.uploadTint,offset:0}],r.shader=Nr.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n    vec2 v = vec2(x, y);\n    v = v + aPositionCoord;\n\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n    gl_FragColor = color;\n}",{}),r.state=kr.for2d(),r}return qi(e,t),e.prototype.render=function(t){var e=t.children,r=t._maxSize,i=t._batchSize,n=this.renderer,o=e.length;if(0!==o){o>r&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=st(t.blendMode,a.alphaMode),n.state.set(this.state);var h,u,l,c,f=n.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=(h=t.tintRgb,u=t.worldAlpha,l=this.shader.uniforms.uColor,c=a.alphaMode,l=l||new Float32Array(4),c||void 0===c?(l[0]=h[0]*u,l[1]=h[1]*u,l[2]=h[2]*u):(l[0]=h[0],l[1]=h[1],l[2]=h[2]),l[3]=u,l),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var d=!1,y=0,v=0;y<o;y+=i,v+=1){var m=o-y;m>i&&(m=i),v>=s.length&&s.push(this._generateOneMoreBuffer(t));var g=s[v];g.uploadDynamic(e,y,m);var _=t._bufferUpdateIDs[v]||0;(d=d||g._updateID<_)&&(g._updateID=t._updateID,g.uploadStatic(e,y,m)),n.geometry.bind(g.geometry),f.drawElements(f.TRIANGLES,6*m,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,i=t._batchSize,n=t._properties,o=0;o<r;o+=i)e.push(new Qi(this.properties,n,i));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,r=t._properties;return new Qi(this.properties,r,e)},e.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s=0,a=0,h=0,u=0,l=0;l<r;++l){var c=t[e+l],f=c._texture,p=c.scale.x,d=c.scale.y,y=f.trim,v=f.orig;y?(s=(a=y.x-c.anchor.x*v.width)+y.width,h=(u=y.y-c.anchor.y*v.height)+y.height):(s=v.width*(1-c.anchor.x),a=v.width*-c.anchor.x,h=v.height*(1-c.anchor.y),u=v.height*-c.anchor.y),i[o]=a*p,i[o+1]=u*d,i[o+n]=s*p,i[o+n+1]=u*d,i[o+2*n]=s*p,i[o+2*n+1]=h*d,i[o+3*n]=a*p,i[o+3*n+1]=h*d,o+=4*n}},e.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;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}},e.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;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}},e.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;++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)}},e.prototype.uploadTint=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s],h=a._texture.baseTexture.alphaMode>0,u=a.alpha,l=u<1&&h?at(a._tintRGB,u):a._tintRGB+(255*u<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(er);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(Ki||(Ki={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(Zi||(Zi={}));var tn={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},en=function(){function t(){this.color=16777215,this.alpha=1,this.texture=ke.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=ke.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),rn=function(t,e){return(rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function nn(t,e){function r(){this.constructor=t}rn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var on={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){for(var s=[],a=0;a<i.length;a++){var h=i[a];s.push(r.length/2),r=r.concat(h.points)}var u=K()(r,s,2);if(!u)return;var l=n.length/2;for(a=0;a<u.length;a+=3)o.push(u[a]+l),o.push(u[a+1]+l),o.push(u[a+2]+l);for(a=0;a<r.length;a++)n.push(r[a])}}},sn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===Et.CIRC)e=i.radius,r=i.radius;else{var a=t.shape;e=a.width,r=a.height}if(0!==e&&0!==r){var h=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(e+r));h/=2.3;for(var u=2*Math.PI/h,l=0;l<h-.5;l++)n.push(o+Math.sin(-u*l)*e,s+Math.cos(-u*l)*r);n.push(n[0],n[1])}},triangulate:function(t,e){var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=o,a=t.shape,h=t.matrix,u=a.x,l=a.y;i.push(t.matrix?h.a*u+h.c*l+h.tx:u,t.matrix?h.b*u+h.d*l+h.ty:l);for(var c=0;c<r.length;c+=2)i.push(r[c],r[c+1]),n.push(o++,s,o)}},an={build:function(t){var e=t.shape,r=e.x,i=e.y,n=e.width,o=e.height,s=t.points;s.length=0,s.push(r,i,r+n,i,r+n,i+o,r,i+o)},triangulate:function(t,e){var r=t.points,i=e.points,n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function hn(t,e,r){return t+(e-t)*r}function un(t,e,r,i,n,o,s){void 0===s&&(s=[]);for(var a=s,h=0,u=0,l=0,c=0,f=0,p=0,d=0,y=0;d<=20;++d)h=hn(t,r,y=d/20),u=hn(e,i,y),l=hn(r,n,y),c=hn(i,o,y),f=hn(h,l,y),p=hn(u,c,y),a.push(f,p);return a}var ln={build:function(t){var e=t.shape,r=t.points,i=e.x,n=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));r.length=0,a?(un(i,n+a,i,n,i+a,n,r),un(i+o-a,n,i+o,n,i+o,n+a,r),un(i+o,n+s-a,i+o,n+s,i+o-a,n+s,r),un(i+a,n+s,i,n+s,i,n+s-a,r)):r.push(i,n,i+o,n,i+o,n+s,i,n+s)},triangulate:function(t,e){for(var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=K()(r,null,2),a=0,h=s.length;a<h;a+=3)n.push(s[a]+o),n.push(s[a+1]+o),n.push(s[a+2]+o);for(a=0,h=r.length;a<h;a++)i.push(r[a],r[++a])}};function cn(t,e,r,i,n,o,s,a){var h,u;s?(h=i,u=-r):(h=-i,u=r);var l=t-r*n+h,c=e-i*n+u,f=t+r*o+h,p=e+i*o+u;return a.push(l,c),a.push(f,p),2}function fn(t,e,r,i,n,o,s,a){var h=r-t,u=i-e,l=Math.atan2(h,u),c=Math.atan2(n-t,o-e);a&&l<c?l+=2*Math.PI:!a&&l>c&&(c+=2*Math.PI);var f=l,p=c-l,d=Math.abs(p),y=Math.sqrt(h*h+u*u),v=1+(15*d*Math.sqrt(y)/Math.PI>>0),m=p/v;if(f+=m,a){s.push(t,e),s.push(r,i);for(var g=1,_=f;g<v;g++,_+=m)s.push(t,e),s.push(t+Math.sin(_)*y,e+Math.cos(_)*y);s.push(t,e),s.push(n,o)}else{s.push(r,i),s.push(t,e);for(g=1,_=f;g<v;g++,_+=m)s.push(t+Math.sin(_)*y,e+Math.cos(_)*y),s.push(t,e);s.push(n,o),s.push(t,e)}return 2*v}function pn(t,e){t.lineStyle.native?function(t,e){var r=0,i=t.shape,n=t.points||i.points,o=i.type!==Et.POLY||i.closeStroke;if(0!==n.length){var s=e.points,a=e.indices,h=n.length/2,u=s.length/2,l=u;for(s.push(n[0],n[1]),r=1;r<h;r++)s.push(n[2*r],n[2*r+1]),a.push(l,l+1),l++;o&&a.push(l,u)}}(t,e):function(t,e){var r=t.shape,i=t.points||r.points.slice(),n=e.closePointEps;if(0!==i.length){var o=t.lineStyle,s=new Dt(i[0],i[1]),a=new Dt(i[i.length-2],i[i.length-1]),h=r.type!==Et.POLY||r.closeStroke,u=Math.abs(s.x-a.x)<n&&Math.abs(s.y-a.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var l=.5*(s.x+a.x),c=.5*(a.y+s.y);i.unshift(l,c),i.push(l,c)}var f=e.points,p=i.length/2,d=i.length,y=f.length/2,v=o.width/2,m=v*v,g=o.miterLimit*o.miterLimit,_=i[0],b=i[1],x=i[2],w=i[3],T=0,E=0,S=-(b-w),P=_-x,O=0,A=0,C=Math.sqrt(S*S+P*P);S/=C,P/=C,S*=v,P*=v;var I=o.alignment,R=2*(1-I),M=2*I;h||(o.cap===Zi.ROUND?d+=fn(_-S*(R-M)*.5,b-P*(R-M)*.5,_-S*R,b-P*R,_+S*M,b+P*M,f,!0)+2:o.cap===Zi.SQUARE&&(d+=cn(_,b,S,P,R,M,!0,f))),f.push(_-S*R,b-P*R),f.push(_+S*M,b+P*M);for(var D=1;D<p-1;++D){_=i[2*(D-1)],b=i[2*(D-1)+1],x=i[2*D],w=i[2*D+1],T=i[2*(D+1)],E=i[2*(D+1)+1],S=-(b-w),P=_-x,S/=C=Math.sqrt(S*S+P*P),P/=C,S*=v,P*=v,O=-(w-E),A=x-T,O/=C=Math.sqrt(O*O+A*A),A/=C,O*=v,A*=v;var L=x-_,N=b-w,k=x-T,F=E-w,U=N*k-F*L,j=U<0;if(Math.abs(U)<.1)f.push(x-S*R,w-P*R),f.push(x+S*M,w+P*M);else{var B=(-S+_)*(-P+w)-(-S+x)*(-P+b),H=(-O+T)*(-A+w)-(-O+x)*(-A+E),G=(L*H-k*B)/U,X=(F*B-N*H)/U,z=(G-x)*(G-x)+(X-w)*(X-w),Y=x+(G-x)*R,V=w+(X-w)*R,W=x-(G-x)*M,q=w-(X-w)*M;o.join===Ki.BEVEL||z/m>g?(j?(f.push(Y,V),f.push(x+S*M,w+P*M),f.push(Y,V),f.push(x+O*M,w+A*M)):(f.push(x-S*R,w-P*R),f.push(W,q),f.push(x-O*R,w-A*R),f.push(W,q)),d+=2):o.join===Ki.ROUND?j?(f.push(Y,V),f.push(x+S*M,w+P*M),d+=fn(x,w,x+S*M,w+P*M,x+O*M,w+A*M,f,!0)+4,f.push(Y,V),f.push(x+O*M,w+A*M)):(f.push(x-S*R,w-P*R),f.push(W,q),d+=fn(x,w,x-S*R,w-P*R,x-O*R,w-A*R,f,!1)+4,f.push(x-O*R,w-A*R),f.push(W,q)):(f.push(Y,V),f.push(W,q))}}_=i[2*(p-2)],b=i[2*(p-2)+1],x=i[2*(p-1)],S=-(b-(w=i[2*(p-1)+1])),P=_-x,S/=C=Math.sqrt(S*S+P*P),P/=C,S*=v,P*=v,f.push(x-S*R,w-P*R),f.push(x+S*M,w+P*M),h||(o.cap===Zi.ROUND?d+=fn(x-S*(R-M)*.5,w-P*(R-M)*.5,x-S*R,w-P*R,x+S*M,w+P*M,f,!1)+2:o.cap===Zi.SQUARE&&(d+=cn(x,w,S,P,R,M,!1,f)));var K=e.indices,Z=tn.epsilon*tn.epsilon;for(D=y;D<d+y-2;++D)_=f[2*D],b=f[2*D+1],x=f[2*(D+1)],w=f[2*(D+1)+1],T=f[2*(D+2)],E=f[2*(D+2)+1],Math.abs(_*(w-E)+x*(E-b)+T*(b-w))<Z||K.push(D,D+1,D+2)}}(t,e)}var dn,yn=function(t){function e(e,r,i,n,o,s){void 0===s&&(s=0);o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=St/h,l=[],c=0;c<h;c++){var f=c%2?o:n,p=c*u+a;l.push(e+f*Math.cos(p),r+f*Math.sin(p))}return t.call(this,l)||this}return nn(e,t),e}(Rt),vn=function(){function t(){}return t.curveTo=function(t,e,r,i,n,o){var s=o[o.length-2],a=o[o.length-1]-e,h=s-t,u=i-e,l=r-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var f=a*a+h*h,p=u*u+l*l,d=a*u+h*l,y=n*Math.sqrt(f)/c,v=n*Math.sqrt(p)/c,m=y*d/f,g=v*d/p,_=y*l+v*h,b=y*u+v*a,x=h*(v+m),w=a*(v+m),T=l*(y+g),E=u*(y+g);return{cx:_+t,cy:b+e,radius:n,startAngle:Math.atan2(w-b,x-_),endAngle:Math.atan2(E-b,T-_),anticlockwise:h*u>l*a}},t.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=tn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/St)),c=u/(2*l),f=2*c,p=Math.cos(c),d=Math.sin(c),y=l-1,v=y%1/y,m=0;m<=y;++m){var g=c+o+f*(m+v*m),_=Math.cos(g),b=-Math.sin(g);h.push((p*_+d*b)*n+r,(p*-b+d*_)*n+i)}},t}(),mn=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,f=0,p=0,d=0,y=0,v=0,m=0,g=0,_=t,b=e,x=1;x<=10;++x)m=_-(y=(d=(p=(f=1-(u=x/10))*f)*f)*t+3*p*u*r+3*f*(l=u*u)*n+(c=l*u)*s),g=b-(v=d*e+3*p*u*i+3*f*l*o+c*a),_=y,b=v,h+=Math.sqrt(m*m+g*g);return h},t.curveTo=function(e,r,i,n,o,s,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=tn._segmentsCount(t.curveLength(h,u,e,r,i,n,o,s)),c=0,f=0,p=0,d=0,y=0;a.push(h,u);for(var v=1,m=0;v<=l;++v)p=(f=(c=1-(m=v/l))*c)*c,y=(d=m*m)*m,a.push(p*h+3*f*m*e+3*c*d*i+y*o,p*u+3*f*m*r+3*c*d*n+y*s)},t}(),gn=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,h=2*r-2*t,u=2*i-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),f=h*h+u*u,p=2*Math.sqrt(l+c+f),d=Math.sqrt(l),y=2*l*d,v=2*Math.sqrt(f),m=c/d;return(y*p+d*c*(p-v)+(4*f*l-c*c)*Math.log((2*d+m+p)/(m+v)))/(4*y)},t.curveTo=function(e,r,i,n,o){for(var s=o[o.length-2],a=o[o.length-1],h=tn._segmentsCount(t.curveLength(s,a,e,r,i,n)),u=0,l=0,c=1;c<=h;++c){var f=c/h;u=s+(e-s)*f,l=a+(r-a)*f,o.push(u+(e+(i-e)*f-u)*f,l+(r+(n-r)*f-l)*f)}},t}(),_n=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),bn=((dn={})[Et.POLY]=on,dn[Et.CIRC]=sn,dn[Et.ELIP]=sn,dn[Et.RECT]=an,dn[Et.RREC]=ln,dn),xn=[],wn=[],Tn=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),En=new Dt,Sn=new Yt,Pn=function(t){function e(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new Yt,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return nn(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),wn.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),xn.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new Tn(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new Tn(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,r=0;r<e.length;++r){var i=e[r];if(i.fillStyle.visible&&(i.shape&&(i.matrix?i.matrix.applyInverse(t,En):En.copyFrom(t),i.shape.contains(En.x,En.y)))){var n=!1;if(i.holes)for(var o=0;o<i.holes.length;o++){if(i.holes[o].shape.contains(En.x,En.y)){n=!0;break}}if(!n)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,r=this.graphicsData,i=null,n=null;this.batches.length>0&&(n=(i=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o<r.length;o++){this.shapeIndex++;var s=r[o],a=s.fillStyle,h=s.lineStyle;bn[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix);for(var u=0;u<2;u++){var l=0===u?a:h;if(l.visible){var c=l.texture.baseTexture,f=this.indices.length,p=this.points.length/2;c.wrapMode=F.REPEAT,0===u?this.processFill(s):this.processLine(s);var d=this.points.length/2-p;0!==d&&(i&&!this._compareStyles(n,l)&&(i.end(f,p),i=null),i||((i=xn.pop()||new _n).begin(l,f,p),this.batches.push(i),n=l),this.addUvs(this.points,e,l.texture,p,d,l.matrix))}}}var y=this.indices.length,v=this.points.length/2;if(i&&i.end(y,v),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var m=v>65535&&t;this.indicesUint16=m?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,r=t.length;e<r;e++)for(var i=t[e],n=0;n<i.size;n++){var o=i.start+n;this.indicesUint16[o]=this.indicesUint16[o]-i.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,r=0;r<t.length;r++)if(t[r].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++_e._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),wn.push(this.drawCalls[e]);this.drawCalls.length=0;var r=this.colors,i=this.textureIds,n=wn.pop();n||((n=new hi).texArray=new ui),n.texArray.count=0,n.start=0,n.size=0,n.type=M.TRIANGLES;var o=0,s=null,a=0,h=!1,u=M.TRIANGLES,l=0;this.drawCalls.push(n);for(e=0;e<this.batches.length;e++){var c=this.batches[e],f=c.style,p=f.texture.baseTexture;h!==!!f.native&&(u=(h=!!f.native)?M.LINES:M.TRIANGLES,s=null,o=8,t++),s!==p&&(s=p,p._batchEnabled!==t&&(8===o&&(t++,o=0,n.size>0&&((n=wn.pop())||((n=new hi).texArray=new ui),this.drawCalls.push(n)),n.start=l,n.size=0,n.texArray.count=0,n.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=o,p.wrapMode=10497,n.texArray.elements[n.texArray.count++]=p,o++)),n.size+=c.size,l+=c.size,a=p._batchLocation,this.addColors(r,f.color,f.alpha,c.attribSize),this.addTextureIds(i,a,c.attribSize)}_e._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(3*t.length*4),o=new Float32Array(n),s=new Uint32Array(n),a=0,h=0;h<t.length/2;h++)o[a++]=t[2*h],o[a++]=t[2*h+1],o[a++]=e[2*h],o[a++]=e[2*h+1],s[a++]=r[h],o[a++]=i[h];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),on.triangulate(t,this)):bn[t.type].triangulate(t,this)},e.prototype.processLine=function(t){pn(t,this);for(var e=0;e<t.holes.length;e++)pn(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var r=t[e];bn[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,e=Sn,r=Nt.IDENTITY;this._bounds.clear(),e.clear();for(var i=0;i<this.graphicsData.length;i++){var n=this.graphicsData[i],o=n.shape,s=n.type,a=n.lineStyle,h=n.matrix||Nt.IDENTITY,u=0;if(a&&a.visible){var l=a.alignment;u=a.width,s===Et.POLY?u*=.5+Math.abs(.5-l):u*=Math.max(0,l)}if(r!==h&&(e.isEmpty()||(t.addBoundsMatrix(e,r),e.clear()),r=h),s===Et.RECT||s===Et.RREC){var c=o;e.addFramePad(c.x,c.y,c.x+c.width,c.y+c.height,u,u)}else if(s===Et.CIRC){var f=o;e.addFramePad(f.x,f.y,f.x,f.y,f.radius+u,f.radius+u)}else if(s===Et.ELIP){var p=o;e.addFramePad(p.x,p.y,p.x,p.y,p.width+u,p.height+u)}else{var d=o;t.addVerticesMatrix(r,d.points,0,d.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,r),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var r=0;r<t.length/2;r++){var i=t[2*r],n=t[2*r+1];t[2*r]=e.a*i+e.c*n+e.tx,t[2*r+1]=e.b*i+e.d*n+e.ty}},e.prototype.addColors=function(t,e,r,i){for(var n=at((e>>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){void 0===o&&(o=null);for(var s=0,a=e.length,h=r.frame;s<n;){var u=t[2*(i+s)],l=t[2*(i+s)+1];if(o){var c=o.a*u+o.c*l+o.tx;l=o.b*u+o.d*l+o.ty,u=c}s++,e.push(u/h.width,l/h.height)}var f=r.baseTexture;(h.width<f.width||h.height<f.height)&&this.adjustUvs(e,r,a,n)},e.prototype.adjustUvs=function(t,e,r,i){for(var n=e.baseTexture,o=1e-6,s=r+2*i,a=e.frame,h=a.width/n.width,u=a.height/n.height,l=a.x/a.width,c=a.y/a.height,f=Math.floor(t[r]+o),p=Math.floor(t[r+1]+o),d=r+2;d<s;d+=2)f=Math.min(f,Math.floor(t[d]+o)),p=Math.min(p,Math.floor(t[d+1]+o));l-=f,c-=p;for(d=r;d<s;d+=2)t[d]=(t[d]+l)*h,t[d+1]=(t[d+1]+c)*u},e.BATCHABLE_SIZE=100,e}(pi),On=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Zi.BUTT,e.join=Ki.MITER,e.miterLimit=10,e}return nn(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(en),An=new Float32Array(3),Cn={},In=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this;return r._geometry=e||new Pn,r._geometry.refCount++,r.shader=null,r.state=kr.for2d(),r._fillStyle=new en,r._lineStyle=new On,r._matrix=null,r._holeMode=!1,r.currentPath=null,r.batches=[],r.batchTint=-1,r.batchDirty=-1,r.vertexData=null,r.pluginName="batch",r._transformID=-1,r.tint=16777215,r.blendMode=R.NORMAL,r}return nn(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t){if(void 0===t&&(t=null),"number"==typeof t){var e=arguments;t={width:e[0]||0,color:e[1]||0,alpha:void 0!==e[2]?e[2]:1,alignment:void 0!==e[3]?e[3]:.5,native:!!e[4]}}return this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){if("number"==typeof t){mt("v5.2.0","Please use object-based options for Graphics#lineTextureStyle");var e=arguments,r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6];t={width:r,texture:i,color:n,alpha:o,matrix:s,alignment:a,native:h},Object.keys(t).forEach((function(e){return void 0===t[e]&&delete t[e]}))}t=Object.assign({width:0,texture:ke.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Zi.BUTT,join:Ki.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var u=t.width>0&&t.alpha>0;return u?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:u},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Rt,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Rt,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),gn.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),mn.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=vn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,f=s.anticlockwise;this.arc(a,h,u,l,c,f)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=St:o&&i<=n&&(i+=St),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-s),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(s,a)}else this.moveTo(s,a),u=this.currentPath.points;return vn.arc(s,a,t,e,r,i,n,o,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:ke.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){if(t instanceof ke){mt("v5.2.0","Please use object-based options for Graphics#beginTextureFill");var e=arguments,r=e[0],i=e[1],n=e[2],o=e[3];t={texture:r,color:i,alpha:n,matrix:o},Object.keys(t).forEach((function(e){return void 0===t[e]&&delete t[e]}))}t=Object.assign({texture:ke.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var s=t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new At(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Mt(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new Ct(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new It(t,e,r,i))},e.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],i=0;i<arguments.length;i++)r[i]=e[i];var n=!0,o=r[0];o.points?(n=o.closeStroke,t=o.points):t=Array.isArray(r[0])?r[0]:r;var s=new Rt(t);return s.closeStroke=n,this.drawShape(s),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.drawStar=function(t,e,r,i,n,o){return void 0===o&&(o=0),this.drawPolygon(new yn(t,e,r,i,n,o))},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return 1===t.length&&t[0].shape.type===Et.RECT&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry,r=t.context.supports.uint32Indices;e.updateBatches(r),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(var i=0;i<r;i++){var n=t.batches[i],o=n.style.color,s=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:s,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:et(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,r=this.batches.length;e<r;e++){var i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),r=this._geometry,i=this.tint,n=this.worldAlpha,o=e.uniforms,s=r.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(i>>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,h=s.length;a<h;a++)this._renderDrawCallDirect(t,r.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var r=e.texArray,i=e.type,n=e.size,o=e.start,s=r.count,a=0;a<s;a++)t.texture.bind(r.elements[a],a);t.geometry.draw(i,n,o)},e.prototype._resolveDirectShader=function(t){var e=this.shader,r=this.pluginName;if(!e){if(!Cn[r]){for(var i=new Int32Array(16),n=0;n<16;n++)i[n]=n;var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new Nt,default:Qe.from({uSamplers:i},!0)},s=t.plugins[r]._shader.program;Cn[r]=new Nr(s,o)}e=Cn[r]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,r=e.minX,i=e.minY,n=e.maxX,o=e.maxY;this._bounds.addFrame(this.transform,r,i,n,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=et(this.tint,An),e=0;e<this.batches.length;e++){var r=this.batches[e],i=r._batchRGB,n=(t[0]*i[0]*255<<16)+(t[1]*i[1]*255<<8)+(0|t[2]*i[2]*255);r._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c<h.length;c+=2){var f=h[c],p=h[c+1];u[l++]=r*f+n*p+s,u[l++]=o*p+i*f+a}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},e._TEMP_POINT=new Dt,e}(Jt),Rn=function(t,e){return(Rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var Mn,Dn=new Dt,Ln=new Uint16Array([0,1,2,0,2,3]),Nn=function(t){function e(e){var r=t.call(this)||this;return r._anchor=new Lt(r._onAnchorUpdate,r,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),r._texture=null,r._width=0,r._height=0,r._tint=null,r._tintRGB=null,r.tint=16777215,r.blendMode=R.NORMAL,r._cachedTint=16777215,r.uvs=null,r.texture=e||ke.EMPTY,r.vertexData=new Float32Array(8),r.vertexTrimmedData=null,r._transformID=-1,r._textureID=-1,r._transformTrimmedID=-1,r._textureTrimmedID=-1,r.indices=Ln,r.pluginName="batch",r.isSprite=!0,r._roundPixels=Y.ROUND_PIXELS,r}return function(t,e){function r(){this.constructor=t}Rn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=pt(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=pt(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,f=0,p=0,d=0,y=0;if(u?(f=(p=u.x-c._x*l.width)+u.width,d=(y=u.y-c._y*l.height)+u.height):(f=(p=-c._x*l.width)+l.width,d=(y=-c._y*l.height)+l.height),h[0]=r*p+n*y+s,h[1]=o*y+i*p+a,h[2]=r*f+n*y+s,h[3]=o*y+i*f+a,h[4]=r*f+n*d+s,h[5]=o*d+i*f+a,h[6]=r*p+n*d+s,h[7]=o*d+i*p+a,this._roundPixels)for(var v=Y.RESOLUTION,m=0;m<h.length;++m)h[m]=Math.round((h[m]*v|0)/v)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-i._x*r.width,f=c+r.width,p=-i._y*r.height,d=p+r.height;e[0]=o*c+a*p+u,e[1]=h*p+s*c+l,e[2]=o*f+a*p+u,e[3]=h*p+s*f+l,e[4]=o*f+a*d+u,e[5]=h*d+s*f+l,e[6]=o*c+a*d+u,e[7]=h*d+s*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new At),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Dn);var e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x,n=0;return Dn.x>=i&&Dn.x<i+e&&(n=-r*this.anchor.y,Dn.y>=n&&Dn.y<n+r)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var r="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!r)}this._texture=null},e.from=function(t,r){return new e(t instanceof ke?t:ke.from(t,r))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=pt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=pt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||ke.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(Jt),kn=function(t,e){return(kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(Mn||(Mn={}));var Fn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Mn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Un=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jn=function(){function t(t){this.styleID=0,this.reset(),Gn(this,t,t)}return t.prototype.clone=function(){var e={};return Gn(e,this,Fn),new t(e)},t.prototype.reset=function(){Gn(this,Fn,Fn)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=Hn(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=Hn(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=Hn(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;r>=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Un.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function Bn(t){return"number"==typeof t?rt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Hn(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=Bn(t[e]);return t}return Bn(t)}function Gn(t,e,r){for(var i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}var Xn=function(){function t(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h}return t.measureText=function(e,r,i,n){void 0===n&&(n=t._canvas),i=null==i?r.wordWrap:i;var o=r.toFontString(),s=t.measureFont(o);0===s.fontSize&&(s.fontSize=r.fontSize,s.ascent=r.fontSize);var a=n.getContext("2d");a.font=o;for(var h=(i?t.wordWrap(e,r,n):e).split(/(?:\r\n|\r|\n)/),u=new Array(h.length),l=0,c=0;c<h.length;c++){var f=a.measureText(h[c]).width+(h[c].length-1)*r.letterSpacing;u[c]=f,l=Math.max(l,f)}var p=l+r.strokeThickness;r.dropShadow&&(p+=r.dropShadowDistance);var d=r.lineHeight||s.fontSize+r.strokeThickness,y=Math.max(d,s.fontSize+r.strokeThickness)+(h.length-1)*(d+r.leading);return r.dropShadow&&(y+=r.dropShadowDistance),new t(e,r,p,y,h,u,d+r.leading,l,s)},t.wordWrap=function(e,r,i){void 0===i&&(i=t._canvas);for(var n=i.getContext("2d"),o=0,s="",a="",h={},u=r.letterSpacing,l=r.whiteSpace,c=t.collapseSpaces(l),f=t.collapseNewlines(l),p=!c,d=r.wordWrapWidth+u,y=t.tokenize(e),v=0;v<y.length;v++){var m=y[v];if(t.isNewline(m)){if(!f){a+=t.addLine(s),p=!c,s="",o=0;continue}m=" "}if(c){var g=t.isBreakingSpace(m),_=t.isBreakingSpace(s[s.length-1]);if(g&&_)continue}var b=t.getFromCache(m,u,h,n);if(b>d)if(""!==s&&(a+=t.addLine(s),s="",o=0),t.canBreakWords(m,r.breakWords))for(var x=t.wordWrapSplit(m),w=0;w<x.length;w++){for(var T=x[w],E=1;x[w+E];){var S=x[w+E],P=T[T.length-1];if(t.canBreakChars(P,S,m,w,r.breakWords))break;T+=S,E++}w+=T.length-1;var O=t.getFromCache(T,u,h,n);O+o>d&&(a+=t.addLine(s),p=!1,s="",o=0),s+=T,o+=O}else{s.length>0&&(a+=t.addLine(s),s="",o=0);var A=v===y.length-1;a+=t.addLine(m,!A),p=!1,s="",o=0}else b+o>d&&(p=!1,a+=t.addLine(s),s="",o=0),(s.length>0||!t.isBreakingSpace(m)||p)&&(s+=m,o+=b)}return a+=t.addLine(s,!1)},t.addLine=function(e,r){return void 0===r&&(r=!0),e=t.trimRight(e),e=r?e+"\n":e},t.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],i="";if("string"!=typeof e)return r;for(var n=0;n<e.length;n++){var o=e[n];t.isBreakingSpace(o)||t.isNewline(o)?(""!==i&&(r.push(i),i=""),r.push(o)):i+=o}return""!==i&&r.push(i),r},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,r,i,n){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var r={ascent:0,descent:0,fontSize:0},i=t._canvas,n=t._context;n.font=e;var o=t.METRICS_STRING+t.BASELINE_SYMBOL,s=Math.ceil(n.measureText(o).width),a=Math.ceil(n.measureText(t.BASELINE_SYMBOL).width),h=2*a;a=a*t.BASELINE_MULTIPLIER|0,i.width=s,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,s,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(o,0,a);var u=n.getImageData(0,0,s,h).data,l=u.length,c=4*s,f=0,p=0,d=!1;for(f=0;f<a;++f){for(var y=0;y<c;y+=4)if(255!==u[p+y]){d=!0;break}if(d)break;p+=c}for(r.ascent=a-f,p=l-c,d=!1,f=h;f>a;--f){for(y=0;y<c;y+=4)if(255!==u[p+y]){d=!0;break}if(d)break;p-=c}return r.descent=f-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},t}(),zn=function(){try{var t=new OffscreenCanvas(0,0),e=t.getContext("2d");return e&&e.measureText?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}}();zn.width=zn.height=10,Xn._canvas=zn,Xn._context=zn.getContext("2d"),Xn._fonts={},Xn.METRICS_STRING="|ÉqÅ",Xn.BASELINE_SYMBOL="M",Xn.BASELINE_MULTIPLIER=1.4,Xn._newlines=[10,13],Xn._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Yn={texture:!0,children:!1,baseTexture:!0},Vn=function(t){function e(e,r,i){var n=this,o=!1;i||(i=document.createElement("canvas"),o=!0),i.width=3,i.height=3;var s=ke.from(i);return s.orig=new At,s.trim=new At,(n=t.call(this,s)||this)._ownCanvas=o,n.canvas=i,n.context=n.canvas.getContext("2d"),n._resolution=Y.RESOLUTION,n._autoResolution=!0,n._text=null,n._style=null,n._styleListener=null,n._font="",n.text=e,n.style=r,n.localStyleID=-1,n}return function(t,e){function r(){this.constructor=t}kn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var r,i,n=this.context,o=Xn.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=o.width,a=o.height,h=o.lines,u=o.lineHeight,l=o.lineWidths,c=o.maxLineWidth,f=o.fontProperties;this.canvas.width=Math.ceil((Math.max(1,s)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,a)+2*e.padding)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=e.strokeThickness,n.textBaseline=e.textBaseline,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit;for(var p=e.dropShadow?2:1,d=0;d<p;++d){var y=e.dropShadow&&0===d,v=y?2*a:0,m=v*this.resolution;if(y){n.fillStyle="black",n.strokeStyle="black";var g=e.dropShadowColor,_=et("number"==typeof g?g:it(g));n.shadowColor="rgba("+255*_[0]+","+255*_[1]+","+255*_[2]+","+e.dropShadowAlpha+")",n.shadowBlur=e.dropShadowBlur,n.shadowOffsetX=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,n.shadowOffsetY=Math.sin(e.dropShadowAngle)*e.dropShadowDistance+m}else n.fillStyle=this._generateFillStyle(e,h,o),n.strokeStyle=e.stroke,n.shadowColor="0",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;for(var b=0;b<h.length;b++)r=e.strokeThickness/2,i=e.strokeThickness/2+b*u+f.ascent,"right"===e.align?r+=c-l[b]:"center"===e.align&&(r+=(c-l[b])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[b],r+e.padding,i+e.padding-v,!0),e.fill&&this.drawLetterSpacing(h[b],r+e.padding,i+e.padding-v)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,r,i){void 0===i&&(i=!1);var n=this._style.letterSpacing;if(0!==n)for(var o=e,s=Array.from?Array.from(t):t.split(""),a=this.context.measureText(t).width,h=0,u=0;u<s.length;++u){var l=s[u];i?this.context.strokeText(l,o,r):this.context.fillText(l,o,r),o+=a-(h=this.context.measureText(t.substring(u+1)).width)+n,a=h}else i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(r=e/4%n,i=~~(e/4/n),null===u.top&&(u.top=i),(null===u.left||r<u.left)&&(u.left=r),(null===u.right||u.right<r)&&(u.right=r+1),(null===u.bottom||u.bottom<i)&&(u.bottom=i));return null!==u.top&&(n=u.right-u.left,o=u.bottom-u.top+1,l=s.getImageData(u.left,u.top,n,o)),{height:o,width:n,data:l}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;r.trim.width=r._frame.width=Math.ceil(t.width/this._resolution),r.trim.height=r._frame.height=Math.ceil(t.height/this._resolution),r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),this._recursivePostUpdateTransform(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,r){var i,n=t.fill;if(!Array.isArray(n))return n;if(1===n.length)return n[0];var o=t.dropShadow?t.dropShadowDistance:0,s=t.padding||0,a=Math.ceil(this.canvas.width/this._resolution)-o-2*s,h=Math.ceil(this.canvas.height/this._resolution)-o-2*s,u=n.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,f=1;f<c;++f)l.push(f/c);if(u.unshift(n[0]),l.unshift(0),u.push(n[n.length-1]),l.push(1),t.fillGradientType===Mn.LINEAR_VERTICAL){i=this.context.createLinearGradient(a/2,s,a/2,h+s);var p=0,d=(r.fontProperties.fontSize+t.strokeThickness)/h;for(f=0;f<e.length;f++)for(var y=r.lineHeight*f,v=0;v<u.length;v++){var m=y/h+("number"==typeof l[v]?l[v]:v/u.length)*d,g=Math.max(p,m);g=Math.min(g,1),i.addColorStop(g,u[v]),p=g}}else{i=this.context.createLinearGradient(s,h/2,a+s,h/2);var _=u.length+1,b=1;for(f=0;f<u.length;f++){var x=void 0;x="number"==typeof l[f]?l[f]:b/_,i.addColorStop(x,u[f]),b++}}return i},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},Yn,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=pt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=pt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof jn?t:new jn(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e}(Nn);
  /*!
   * @pixi/prepare - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/prepare is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Y.UPLOADS_PER_FRAME=4;
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var Wn=function(t,e){return(Wn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var qn=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function Kn(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof ke){var n=t._textures[i].baseTexture;-1===e.indexOf(n)&&(e.push(n),r=!0)}return r}function Zn(t,e){if(t.baseTexture instanceof _e){var r=t.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function Jn(t,e){if(t._texture&&t._texture instanceof ke){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function Qn(t,e){return e instanceof Vn&&(e.updateText(!0),!0)}function $n(t,e){if(e instanceof jn){var r=e.toFontString();return Xn.measureFont(r),!0}return!1}function to(t,e){if(t instanceof Vn){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function eo(t,e){return t instanceof jn&&(-1===e.indexOf(t)&&e.push(t),!0)}var ro=function(){function t(t){var e=this;this.limiter=new qn(Y.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(to),this.registerFindHook(eo),this.registerFindHook(Kn),this.registerFindHook(Zn),this.registerFindHook(Jn),this.registerUploadHook(Qn),this.registerUploadHook($n)}return t.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,ee.system.addOnce(this.tick,this,Qt.UTILITY))):e&&e()},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)ee.system.addOnce(this.tick,this,Qt.UTILITY);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(r=0,i=n.length;r<i;r++)n[r]()}},t.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},t.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},t.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Jt)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&ee.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function io(t,e){return e instanceof _e&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function no(t,e){if(!(e instanceof In))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var i=r.batches,n=0;n<i.length;n++){var o=i[n].style.texture;o&&io(t,o.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function oo(t,e){return t instanceof In&&(e.push(t),!0)}var so=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r.renderer,r.registerFindHook(oo),r.registerUploadHook(io),r.registerUploadHook(no),r}return function(t,e){function r(){this.constructor=t}Wn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(ro),ao=(function(){function t(t){this.maxMilliseconds=t,this.frameStart=0}t.prototype.beginFrame=function(){this.frameStart=Date.now()},t.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds}}(),function(){function t(t,e,r){void 0===r&&(r=null),this._texture=t instanceof ke?t:null,this.baseTexture=t instanceof _e?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var i=this.baseTexture.resource;this.resolution=this._updateResolution(r||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,r=Tt(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&this.baseTexture.setResolution(r),r},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var r=e,i=t.BATCH_SIZE;r-e<i&&r<this._frameKeys.length;){var n=this._frameKeys[r],o=this._frames[n],s=o.frame;if(s){var a=null,h=null,u=!1!==o.trimmed&&o.sourceSize?o.sourceSize:o.frame,l=new At(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);a=o.rotated?new At(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new At(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==o.trimmed&&o.spriteSourceSize&&(h=new At(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[n]=new ke(this.baseTexture,a,l,h,o.rotated?2:0,o.anchor),ke.addToCache(this.textures[n],n)}r++}},t.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var r=0;r<t[e].length;r++){var i=t[e][r];this.animations[e].push(this.textures[i])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((function(){e._batchIndex*t.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())}),0)},t.prototype.destroy=function(t){var e;for(var r in void 0===t&&(t=!1),this.textures)this.textures[r].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},t.BATCH_SIZE=1e3,t}()),ho=function(){function t(){}return t.use=function(e,r){var i=e.name+"_image";if(e.data&&e.type===Gi.TYPE.JSON&&e.data.frames&&!this.resources[i]){var n={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},o=t.getResourcePath(e,this.baseUrl);this.add(i,o,n,(function(t){if(t.error)r(t.error);else{var i=new ao(t.texture,e.data,e.url);i.parse((function(){e.spritesheet=i,e.textures=i.textures,r()}))}}))}else r()},t.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:J.a.resolve(t.url.replace(e,""),t.data.meta.image)},t}(),uo=function(t,e){return(uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function lo(t,e){function r(){this.constructor=t}uo(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var co=new Dt,fo=function(t){function e(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100);var n=t.call(this,e)||this;return n.tileTransform=new zt,n._width=r,n._height=i,n.uvMatrix=e.uvMatrix||new jr(e),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return lo(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new At),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,co);var e=this._width,r=this._height,i=-e*this.anchor._x;if(co.x>=i&&co.x<i+e){var n=-r*this.anchor._y;if(co.y>=n&&co.y<n+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r){return"number"==typeof r&&(mt("5.3.0","TilingSprite.from use options instead of width and height args"),r={width:r,height:arguments[2]}),new e(ke.from(t,r),r.width,r.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(Nn),po="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",yo=new Nt,vo=function(t){function e(e){var r=t.call(this,e)||this,i={globals:r.renderer.globalUniforms};return r.shader=Nr.from(po,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord - floor(vTextureCoord - uClampOffset);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 texSample = texture2D(uSampler, coord);\n    gl_FragColor = texSample * uColor;\n}\n",i),r.simpleShader=Nr.from(po,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 sample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = sample * uColor;\n}\n",i),r.quad=new Ze,r.state=kr.for2d(),r}return lo(e,t),e.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-t.anchor.x,i[1]=i[3]=-t.anchor.y,i[2]=i[4]=1-t.anchor.x,i[5]=i[7]=1-t.anchor.y),r.invalidate();var n=t._texture,o=n.baseTexture,s=t.tileTransform.localTransform,a=t.uvMatrix,h=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;h&&(o._glTextures[e.CONTEXT_UID]?h=o.wrapMode!==F.CLAMP:o.wrapMode===F.CLAMP&&(o.wrapMode=F.REPEAT));var u=h?this.simpleShader:this.shader,l=n.width,c=n.height,f=t._width,p=t._height;yo.set(s.a*l/f,s.b*l/p,s.c*c/f,s.d*c/p,s.tx/f,s.ty/p),yo.invert(),h?yo.prepend(a.mapCoord):(u.uniforms.uMapCoord=a.mapCoord.toArray(!0),u.uniforms.uClampFrame=a.uClampFrame,u.uniforms.uClampOffset=a.uClampOffset),u.uniforms.uTransform=yo.toArray(!0),u.uniforms.uColor=ht(t.tint,t.worldAlpha,u.uniforms.uColor,o.alphaMode),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.uSampler=n,e.shader.bind(u),e.geometry.bind(r),this.state.blendMode=st(t.blendMode,o.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(er),mo=function(t,e){return(mo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function go(t,e){function r(){this.constructor=t}mo(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var _o=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),bo=new Dt,xo=new Rt,wo=function(t){function e(e,r,i,n){void 0===n&&(n=M.TRIANGLES);var o=t.call(this)||this;return o.geometry=e,e.refCount++,o.shader=r,o.state=i||kr.for2d(),o.drawMode=n,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=0,o._transformID=-1,o.tint=16777215,o.blendMode=R.NORMAL,o._roundPixels=Y.ROUND_PIXELS,o.batchUvs=null,o}return go(e,t),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this.shader.tint},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===M.TRIANGLES&&r.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var r=this.transform.worldTransform,i=r.a,n=r.b,o=r.c,s=r.d,a=r.tx,h=r.ty,u=this.vertexData,l=0;l<u.length/2;l++){var c=e[2*l],f=e[2*l+1];u[2*l]=i*c+o*f+a,u[2*l+1]=n*c+s*f+h}if(this._roundPixels){var p=Y.RESOLUTION;for(l=0;l<u.length;++l)u[l]=Math.round((u[l]*p|0)/p)}this.vertexDirty=t.vertexDirtyId}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new _o(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,bo);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=xo.points,i=this.geometry.getIndex().data,n=i.length,o=4===this.drawMode?3:1,s=0;s+2<n;s+=o){var a=2*i[s],h=2*i[s+1],u=2*i[s+2];if(r[0]=e[a],r[1]=e[a+1],r[2]=e[h],r[3]=e[h+1],r[4]=e[u],r[5]=e[u+1],xo.contains(bo.x,bo.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(Jt),To=function(t){function e(e,r){var i=this,n={uSampler:e,alpha:1,uTextureMatrix:Nt.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r)).uniforms&&Object.assign(n,r.uniforms),(i=t.call(this,r.program||Lr.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),n)||this)._colorDirty=!1,i.uvMatrix=new jr(e),i.batchable=void 0===r.program,i.pluginName=r.pluginName,i.tint=r.tint,i.alpha=r.alpha,i}return go(e,t),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;ht(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(Nr),Eo=function(t){function e(e,r,i){var n=t.call(this)||this,o=new Ge(e),s=new Ge(r,!0),a=new Ge(i,!0,!0);return n.addAttribute("aVertexPosition",o,2,!1,N.FLOAT).addAttribute("aTextureCoord",s,2,!1,N.FLOAT).addIndex(a),n._updateId=-1,n}return go(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(qe),So=function(t,e){return(So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var Po=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]},Oo=[function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],o=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var h=o[a].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),f=isNaN(c)?l:c;s[u]=f}r[n].push(s)}var p=new Po;return r.info.forEach((function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),p},t}(),function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new Po,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=0;a<r.length;a++)e.info.push({face:r[a].getAttribute("face"),size:parseInt(r[a].getAttribute("size"),10)});for(a=0;a<i.length;a++)e.common.push({lineHeight:parseInt(i[a].getAttribute("lineHeight"),10)});for(a=0;a<n.length;a++)e.page.push({id:parseInt(n[a].getAttribute("id"),10)||0,file:n[a].getAttribute("file")});for(a=0;a<o.length;a++){var h=o[a];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(a=0;a<s.length;a++)e.kerning.push({first:parseInt(s[a].getAttribute("first"),10),second:parseInt(s[a].getAttribute("second"),10),amount:parseInt(s[a].getAttribute("amount"),10)});return e},t}()];function Ao(t){for(var e=0;e<Oo.length;e++)if(Oo[e].test(t))return Oo[e];return null}function Co(t,e,r,i,n,o){var s,a=r.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];var h=r.dropShadow?r.dropShadowDistance:0,u=r.padding||0,l=Math.ceil(t.width/i)-h-2*u,c=Math.ceil(t.height/i)-h-2*u,f=a.slice(),p=r.fillGradientStops.slice();if(!p.length)for(var d=f.length+1,y=1;y<d;++y)p.push(y/d);if(f.unshift(a[0]),p.unshift(0),f.push(a[a.length-1]),p.push(1),r.fillGradientType===Mn.LINEAR_VERTICAL){s=e.createLinearGradient(l/2,u,l/2,c+u);var v=0,m=(o.fontProperties.fontSize+r.strokeThickness)/c;for(y=0;y<n.length;y++)for(var g=o.lineHeight*y,_=0;_<f.length;_++){var b=g/c+("number"==typeof p[_]?p[_]:_/f.length)*m,x=Math.max(v,b);x=Math.min(x,1),s.addColorStop(x,f[_]),v=x}}else{s=e.createLinearGradient(u,c/2,l+u,c/2);var w=f.length+1,T=1;for(y=0;y<f.length;y++){var E=void 0;E="number"==typeof p[y]?p[y]:T/w,s.addColorStop(E,f[y]),T++}}return s}function Io(t,e,r,i,n,o,s){var a=r.text,h=r.fontProperties;e.translate(i,n),e.scale(o,o);var u=s.strokeThickness/2,l=-s.strokeThickness/2;e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=Co(t,e,s,o,[a],r),e.strokeStyle=s.stroke,e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=Co(t,e,s,o,[a],r),e.strokeStyle=s.stroke;var c=s.dropShadowColor,f=et("number"==typeof c?c:it(c));s.dropShadow?(e.shadowColor="rgba("+255*f[0]+","+255*f[1]+","+255*f[2]+","+s.dropShadowAlpha+")",e.shadowBlur=s.dropShadowBlur,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*s.dropShadowDistance,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*s.dropShadowDistance):(e.shadowColor="0",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),s.stroke&&s.strokeThickness&&e.strokeText(a,u,l+r.lineHeight-h.descent),s.fill&&e.fillText(a,u,l+r.lineHeight-h.descent),e.setTransform(),e.fillStyle="rgba(0, 0, 0, 0)"}var Ro=function(){function t(t,e){var r=t.info[0],i=t.common[0],n=Tt(t.page[0].file),o={};for(var s in this.font=r.face,this.size=r.size,this.lineHeight=i.lineHeight/n,this.chars={},this.pageTextures=o,t.page){var a=t.page[s],h=a.id,u=a.file;o[h]=e instanceof Array?e[s]:e[u]}for(var s in t.char){var l=t.char[s],c=(h=l.id,l.page),f=t.char[s],p=f.x,d=f.y,y=f.width,v=f.height,m=f.xoffset,g=f.yoffset,_=f.xadvance;d/=n,y/=n,v/=n,m/=n,g/=n,_/=n;var b=new At((p/=n)+o[c].frame.x/n,d+o[c].frame.y/n,y,v);this.chars[h]={xOffset:m,yOffset:g,xAdvance:_,kerning:{},texture:new ke(o[c].baseTexture,b),page:c}}for(var s in t.kerning){var x=t.kerning[s],w=x.first,T=x.second,E=x.amount;w/=n,T/=n,E/=n,this.chars[T]&&(this.chars[T].kerning[w]=E)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r){var i;if(e instanceof Po)i=e;else{var n=Ao(e);if(!n)throw new Error("Unrecognized data format for font.");i=n.parse(e)}r instanceof ke&&(r=[r]);var o=new t(i,r);return t.available[o.font]=o,o},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),o=n.chars,s=n.padding,a=n.resolution,h=n.textureWidth,u=n.textureHeight,l=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var o=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<o)throw new Error("[BitmapFont]: Invalid character range.");for(var a=o,h=s;a<=h;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,n.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),c=r instanceof jn?r:new jn(r),f=h,p=new Po;p.info[0]={face:c.fontFamily,size:c.fontSize},p.common[0]={lineHeight:c.fontSize};for(var d,y,v,m=0,g=0,_=0,b=[],x=0;x<l.length;x++){d||((d=document.createElement("canvas")).width=h,d.height=u,y=d.getContext("2d"),v=new _e(d,{resolution:a}),b.push(new ke(v)),p.page.push({id:b.length-1,file:""}));var w=Xn.measureText(l[x],c,!1,d),T=w.width,E=Math.ceil(w.height),S=Math.ceil(("italic"===c.fontStyle?2:1)*T);if(g>=u-E*a){if(0===g)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+c.fontSize+"px fonts");d=null,y=null,v=null,g=0,m=0,_=0}else if(_=Math.max(E+w.fontProperties.descent,_),S*a+m>=f)--x,g+=_*a,g=Math.ceil(g),m=0,_=0;else{Io(d,y,w,m,g,a,c);var P=w.text.charCodeAt(0);p.char[P]={id:P,page:b.length-1,x:m/a,y:g/a,width:S,height:E,xoffset:0,yoffset:0,xadvance:Math.ceil(T-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))},m+=(S+2*s)*a,m=Math.ceil(m)}}var O=new t(p,b);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=O,O},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),Mo=[],Do=[],Lo=function(t){function e(r,i){void 0===i&&(i={});var n=t.call(this)||this;n._tint=16777215,i.font&&(mt("5.3.0","PIXI.BitmapText constructor style.font property is deprecated."),n._upgradeStyle(i));var o=Object.assign({},e.styleDefaults,i),s=o.align,a=o.tint,h=o.maxWidth,u=o.letterSpacing,l=o.fontName,c=o.fontSize;if(!Ro.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=s,n._tint=a,n._fontName=l,n._fontSize=c||Ro.available[l].size,n._text=r,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=u,n._anchor=new Lt((function(){n.dirty=!0}),n,0,0),n.roundPixels=Y.ROUND_PIXELS,n.dirty=!0,n}return function(t,e){function r(){this.constructor=t}So(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.updateText=function(){for(var t,e=Ro.available[this._fontName],r=this._fontSize/e.size,i=new Dt,n=[],o=[],s=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",a=s.length,h=this._maxWidth*e.size/this._fontSize,u=null,l=0,c=0,f=0,p=-1,d=0,y=0,v=0,m=0;m<a;m++){var g=s.charCodeAt(m),_=s.charAt(m);if(/(?:\s)/.test(_)&&(p=m,d=l),"\r"!==_&&"\n"!==_){var b=e.chars[g];if(b){u&&b.kerning[u]&&(i.x+=b.kerning[u]);var x=Do.pop()||{texture:ke.EMPTY,line:0,charCode:0,position:new Dt};x.texture=b.texture,x.line=f,x.charCode=g,x.position.x=i.x+b.xOffset+this._letterSpacing/2,x.position.y=i.y+b.yOffset,n.push(x),i.x+=b.xAdvance+this._letterSpacing,l=i.x,v=Math.max(v,b.yOffset+b.texture.height),u=g,-1!==p&&h>0&&i.x>h&&(ft(n,1+p-++y,1+m-p),m=p,p=-1,o.push(d),c=Math.max(c,d),f++,i.x=0,i.y+=e.lineHeight,u=null)}}else o.push(l),c=Math.max(c,l),++f,++y,i.x=0,i.y+=e.lineHeight,u=null}var w=s.charAt(s.length-1);"\r"!==w&&"\n"!==w&&(/(?:\s)/.test(w)&&(l=d),o.push(l),c=Math.max(c,l));var T=[];for(m=0;m<=f;m++){var E=0;"right"===this._align?E=c-o[m]:"center"===this._align&&(E=(c-o[m])/2),T.push(E)}var S=n.length,P={},O=[],A=this._activePagesMeshData;for(m=0;m<A.length;m++)Mo.push(A[m]);for(m=0;m<S;m++){var C=(D=n[m].texture).baseTexture.uid;if(!P[C]){if(!(B=Mo.pop())){var I=new Eo,R=new To(ke.EMPTY);B={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new wo(I,R),vertices:null,uvs:null,indices:null}}B.index=0,B.indexCount=0,B.vertexCount=0,B.uvsCount=0,B.total=0,B.mesh.texture=new ke(D.baseTexture),B.mesh.tint=this._tint,O.push(B),P[C]=B}P[C].total++}for(m=0;m<A.length;m++)-1===O.indexOf(A[m])&&this.removeChild(A[m].mesh);for(m=0;m<O.length;m++)O[m].mesh.parent!==this&&this.addChild(O[m].mesh);for(var m in this._activePagesMeshData=O,P){var M=(B=P[m]).total;(null===(t=B.indices)||void 0===t?void 0:t.length)>6*M&&!(B.vertices.length<2*wo.BATCHABLE_SIZE)||(B.vertices=new Float32Array(8*M),B.uvs=new Float32Array(8*M),B.indices=new Uint16Array(6*M)),B.mesh.size=6*M}for(m=0;m<S;m++){var D,L=((_=n[m]).position.x+T[_.line])*r,N=_.position.y*r,k=P[(D=_.texture).baseTexture.uid],F=D.frame,U=D._uvs,j=k.index++;k.indices[6*j+0]=0+4*j,k.indices[6*j+1]=1+4*j,k.indices[6*j+2]=2+4*j,k.indices[6*j+3]=0+4*j,k.indices[6*j+4]=2+4*j,k.indices[6*j+5]=3+4*j,k.vertices[8*j+0]=L,k.vertices[8*j+1]=N,k.vertices[8*j+2]=L+F.width*r,k.vertices[8*j+3]=N,k.vertices[8*j+4]=L+F.width*r,k.vertices[8*j+5]=N+F.height*r,k.vertices[8*j+6]=L,k.vertices[8*j+7]=N+F.height*r,k.uvs[8*j+0]=U.x0,k.uvs[8*j+1]=U.y0,k.uvs[8*j+2]=U.x1,k.uvs[8*j+3]=U.y1,k.uvs[8*j+4]=U.x2,k.uvs[8*j+5]=U.y2,k.uvs[8*j+6]=U.x3,k.uvs[8*j+7]=U.y3}for(var m in this._textWidth=c*r,this._textHeight=(i.y+e.lineHeight)*r,P){var B=P[m];if(0!==this.anchor.x||0!==this.anchor.y)for(var H=0,G=this._textWidth*this.anchor.x,X=this._textHeight*this.anchor.y,z=0;z<B.total;z++)B.vertices[H++]-=G,B.vertices[H++]-=X,B.vertices[H++]-=G,B.vertices[H++]-=X,B.vertices[H++]-=G,B.vertices[H++]-=X,B.vertices[H++]-=G,B.vertices[H++]-=X;this._maxLineHeight=v*r;var Y=B.mesh.geometry.getBuffer("aVertexPosition"),V=B.mesh.geometry.getBuffer("aTextureCoord"),W=B.mesh.geometry.getIndex();Y.data=B.vertices,V.data=B.uvs,W.data=B.indices,Y.update(),V.update(),W.update()}for(m=0;m<n.length;m++)Do.push(n[m])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!Ro.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype._upgradeStyle=function(t){if("string"==typeof t.font){var e=t.font.split(" ");t.fontName=1===e.length?e[0]:e.slice(1).join(" "),e.length>=2&&(t.fontSize=parseInt(e[0],10))}else t.fontName=t.font.name,t.fontSize="number"==typeof t.font.size?t.font.size:parseInt(t.font.size,10)},e.registerFont=function(t,e){return mt("5.3.0","PIXI.BitmapText.registerFont is deprecated, use PIXI.BitmapFont.install"),Ro.install(t,e)},Object.defineProperty(e,"fonts",{get:function(){return mt("5.3.0","PIXI.BitmapText.fonts is deprecated, use PIXI.BitmapFont.available"),Ro.available},enumerable:!1,configurable:!0}),e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(Jt),No=function(){function t(){}return t.add=function(){Gi.setExtensionXhrType("fnt",Gi.XHR_RESPONSE_TYPE.DOCUMENT)},t.use=function(e,r){var i=Ao(e.data);if(i)for(var n=t.getBaseUrl(this,e),o=i.parse(e.data),s={},a=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===o.page.length&&(e.bitmapFont=Ro.install(o,s),r())},h=0;h<o.page.length;++h){var u=o.page[h].file,l=n+u,c=!1;for(var f in this.resources){var p=this.resources[f];if(p.url===l){p.metadata.pageFile=u,p.texture?a(p):p.onAfterMiddleware.add(a),c=!0;break}}if(!c){var d={crossOrigin:e.crossOrigin,loadType:Gi.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,d,a)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}(),ko=function(t,e){return(ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var Fo=function(t){function e(e){void 0===e&&(e=1);var r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return r.alpha=e,r}return function(t,e){function r(){this.constructor=t}ko(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Fr),Uo=function(t,e){return(Uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function jo(t,e){function r(){this.constructor=t}Uo(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Bo,Ho,Go,Xo,zo,Yo,Vo,Wo,qo,Ko,Zo,Jo,Qo,$o,ts,es,rs,is={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},ns=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(Bo||(Bo={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(Ho||(Ho={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(Go||(Go={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(Xo||(Xo={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(zo||(zo={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Yo||(Yo={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Vo||(Vo={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(Wo||(Wo={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(qo||(qo={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Ko||(Ko={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(Zo||(Zo={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(Jo||(Jo={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(Qo||(Qo={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}($o||($o={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(ts||(ts={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(es||(es={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(rs||(rs={}));var os=function(t){function e(e,r,i,n,o){void 0===r&&(r=8),void 0===i&&(i=4),void 0===n&&(n=Y.RESOLUTION),void 0===o&&(o=5);var s=this,a=function(t,e){var r,i=Math.ceil(t/2),n="\n    attribute vec2 aVertexPosition;\n\n    uniform mat3 projectionMatrix;\n\n    uniform float strength;\n\n    varying vec2 vBlurTexCoords[%size%];\n\n    uniform vec4 inputSize;\n    uniform vec4 outputFrame;\n\n    vec4 filterVertexPosition( void )\n    {\n        vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n        return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n    }\n\n    vec2 filterTextureCoord( void )\n    {\n        return aVertexPosition * (outputFrame.zw * inputSize.zw);\n    }\n\n    void main(void)\n    {\n        gl_Position = filterVertexPosition();\n\n        vec2 textureCoord = filterTextureCoord();\n        %blur%\n    }",o="";r=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=r.replace("%index%",s.toString());o+=a=a.replace("%sampleIndex%",s-(i-1)+".0"),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o,e),h=function(t){for(var e,r=is[t],i=r.length,n=ns,o="",s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());e=s,s>=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(s=t.call(this,a,h)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=i,s.blur=r,s}return jo(e,t),e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,Qo.CLEAR);for(var h=1;h<this.passes-1;h++){t.bindAndClear(s,Qo.BLIT),this.uniforms.uSampler=a;var u=a;a=s,s=u,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,i),t.returnFilterTexture(n)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(Fr),ss=function(t){function e(e,r,i,n){void 0===e&&(e=8),void 0===r&&(r=4),void 0===i&&(i=Y.RESOLUTION),void 0===n&&(n=5);var o=t.call(this)||this;return o.blurXFilter=new os(!0,e,r,i,n),o.blurYFilter=new os(!1,e,r,i,n),o.resolution=i,o.quality=r,o.blur=e,o.repeatEdgePixels=!1,o}return jo(e,t),e.prototype.apply=function(t,e,r,i){var n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,Qo.CLEAR),this.blurYFilter.apply(t,s,r,i),t.returnFilterTexture(s)}else o?this.blurYFilter.apply(t,e,r,i):this.blurXFilter.apply(t,e,r,i)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e}(Fr),as=function(t,e){return(as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var hs=function(t){function e(){var e=this,r={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,ai,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n",r)||this).alpha=1,e}return function(t,e){function r(){this.constructor=t}as(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Fr);hs.prototype.grayscale=hs.prototype.greyscale;
  /*!
   * @pixi/filter-displacement - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/filter-displacement is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var us=function(t,e){return(us=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var ls=function(t){function e(e,r){var i=this,n=new Nt;return e.renderable=!1,(i=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\n\n  map -= 0.5;\n  map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=n,null==r&&(r=20),i.scale=new Dt(r,r),i}return function(t,e){function r(){this.constructor=t}us(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(Fr),cs=function(t,e){return(cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var fs=function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\n               out vec2 v_rgbM) {\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n    v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n   gl_Position = filterVertexPosition();\n\n   vFragCoord = aVertexPosition * outputFrame.zw;\n\n   texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX     8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n          vec2 v_rgbNW, vec2 v_rgbNE,\n          vec2 v_rgbSW, vec2 v_rgbSE,\n          vec2 v_rgbM) {\n    vec4 color;\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n    vec4 texColor = texture2D(tex, v_rgbM);\n    vec3 rgbM  = texColor.xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n    mediump vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                  dir * rcpDirMin)) * inverseVP;\n\n    vec3 rgbA = 0.5 * (\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, texColor.a);\n    else\n        color = vec4(rgbB, texColor.a);\n    return color;\n}\n\nvoid main() {\n\n      vec4 color;\n\n      color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n      gl_FragColor = color;\n}\n')||this}return function(t,e){function r(){this.constructor=t}cs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Fr),ps=function(t,e){return(ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var ds=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var i=t.call(this,ai,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n    vec4 color = texture2D(uSampler, vTextureCoord);\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\n    float diff = (randomValue - 0.5) * uNoise;\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (color.a > 0.0) {\n        color.rgb /= color.a;\n    }\n\n    color.r += diff;\n    color.g += diff;\n    color.b += diff;\n\n    // Premultiply alpha again.\n    color.rgb *= color.a;\n\n    gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return i.noise=e,i.seed=r,i}return function(t,e){function r(){this.constructor=t}ps(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(Fr),ys=new Nt;qt.prototype._cacheAsBitmap=!1,qt.prototype._cacheData=null;var vs=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(qt.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new vs),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),qt.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},qt.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds(null,!0).clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(Y.RESOLUTION);var n=t.renderTexture.current,o=t.renderTexture.sourceFrame.clone(),s=t.projection.transform,a=Ue.create({width:r.width,height:r.height}),h="cacheAsBitmap_"+yt();this._cacheData.textureCacheId=h,_e.addToCache(a.baseTexture,h),ke.addToCache(a,h);var u=this.transform.localTransform.copyTo(ys).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,a,!0,u,!1),t.projection.transform=s,t.renderTexture.bind(n,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var l=new Nn(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-r.x/r.width,l.anchor.y=-r.y/r.height,l.alpha=e,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=l.containsPoint.bind(l)}},qt.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},qt.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var i=t.context,n=t._projTransform;e.ceil(Y.RESOLUTION);var o=Ue.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+yt();this._cacheData.textureCacheId=s,_e.addToCache(o.baseTexture,s),ke.addToCache(o,s);var a=ys;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,o,!0,a,!1),t.context=i,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Nn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=r,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},qt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},qt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},qt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,_e.removeFromCache(this._cacheData.textureCacheId),ke.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},qt.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},
  /*!
   * @pixi/mixin-get-child-by-name - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/mixin-get-child-by-name is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  qt.prototype.name=null,Jt.prototype.getChildByName=function(t,e){for(var r=0,i=this.children.length;r<i;r++)if(this.children[r].name===t)return this.children[r];if(e)for(r=0,i=this.children.length;r<i;r++){if(this.children[r].getChildByName){var n=this.children[r].getChildByName(t,!0);if(n)return n}}return null},
  /*!
   * @pixi/mixin-get-global-position - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/mixin-get-global-position is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  qt.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new Dt),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};
  /*!
   * @pixi/mesh-extras - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/mesh-extras is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var ms=function(t,e){return(ms=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function gs(t,e){function r(){this.constructor=t}ms(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var _s=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10);var o=t.call(this)||this;return o.segWidth=i,o.segHeight=n,o.width=e,o.height=r,o.build(),o}return gs(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*s,l*a),r.push(u/n,l/o)}var c=n*o;for(h=0;h<c;h++){var f=h%n,p=h/n|0,d=p*this.segWidth+f,y=p*this.segWidth+f+1,v=(p+1)*this.segWidth+f,m=(p+1)*this.segWidth+f+1;i.push(d,y,v,y,m,v)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Eo),bs=function(t){function e(e,r,i){void 0===e&&(e=200),void 0===i&&(i=0);var n=t.call(this,new Float32Array(4*r.length),new Float32Array(4*r.length),new Uint16Array(6*(r.length-1)))||this;return n.points=r,n._width=e,n.textureScale=i,n.build(),n}return gs(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),r.data=new Float32Array(4*t.length),i.data=new Uint16Array(6*(t.length-1)));var n=r.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var s=0,a=t[0],h=this._width*this.textureScale,u=t.length,l=0;l<u;l++){var c=4*l;if(this.textureScale>0){var f=a.x-t[l].x,p=a.y-t[l].y,d=Math.sqrt(f*f+p*p);a=t[l],s+=d/h}else s=l/(u-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}var y=0;for(l=0;l<u-1;l++){c=2*l;o[y++]=c,o[y++]=c+1,o[y++]=c+2,o[y++]=c+2,o[y++]=c+1,o[y++]=c+3}r.update(),i.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,r=t[0],i=0,n=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var h=t[a],u=4*a;n=-((e=a<t.length-1?t[a+1]:h).x-r.x),i=e.y-r.y;var l=Math.sqrt(i*i+n*n),c=this.textureScale>0?this.textureScale*this._width/2:this._width/2;i/=l,n/=l,i*=c,n*=c,o[u]=h.x+i,o[u+1]=h.y+n,o[u+2]=h.x-i,o[u+3]=h.y-n,r=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Eo),xs=function(t){function e(e,r,i){void 0===i&&(i=0);var n=this,o=new bs(e.height,r,i),s=new To(e);return i>0&&(e.baseTexture.wrapMode=F.REPEAT),(n=t.call(this,o,s)||this).autoUpdate=!0,n}return gs(e,t),e.prototype._render=function(e){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),t.prototype._render.call(this,e)},e}(wo),ws=function(t){function e(e,r,i){var n=this,o=new _s(e.width,e.height,r,i),s=new To(ke.WHITE);return(n=t.call(this,o,s)||this).texture=e,n}return gs(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry;t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build()},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e}(wo),Ts=function(t){function e(e,r,i,n,o){void 0===e&&(e=ke.EMPTY);var s=this,a=new Eo(r,i,n);a.getBuffer("aVertexPosition").static=!1;var h=new To(e);return(s=t.call(this,a,h,null,o)||this).autoUpdate=!0,s}return gs(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(wo),Es=function(t){function e(e,r,i,n,o){void 0===r&&(r=10),void 0===i&&(i=10),void 0===n&&(n=10),void 0===o&&(o=10);var s=t.call(this,ke.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=n,s._topHeight=i,s._bottomHeight=o,s.texture=e,s}return gs(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,i=this._height>r?1:this._height/r;return Math.min(e,i)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(ws),Ss=function(t,e){return(Ss=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var Ps=function(t){function e(e,r){void 0===r&&(r=!0);var i=t.call(this,e[0]instanceof ke?e[0]:e[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=r,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=e,i}return function(t,e){function r(){this.constructor=t}Ss(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(ee.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(ee.shared.add(this.update,this,Qt.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<r||this.animationSpeed<0&&this.currentFrame>r)&&this.onLoop(),this.updateTexture())},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;i<t.length;++i)r.push(ke.from(t[i]));return new e(r)},e.fromImages=function(t){for(var r=[],i=0;i<t.length;++i)r.push(ke.from(t[i]));return new e(r)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof ke)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(ee.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(ee.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e}(Nn);
  /*!
   * pixi.js - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * pixi.js is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */si.registerPlugin("accessibility",$t),si.registerPlugin("extract",bi),si.registerPlugin("interaction",le),si.registerPlugin("particle",$i),si.registerPlugin("prepare",so),si.registerPlugin("batch",vi),si.registerPlugin("tilingSprite",vo),Yi.registerPlugin(No),Yi.registerPlugin(ho),mi.registerPlugin(re),mi.registerPlugin(Vi);var Os={AlphaFilter:Fo,BlurFilter:ss,BlurFilterPass:os,ColorMatrixFilter:hs,DisplacementFilter:ls,FXAAFilter:fs,NoiseFilter:ds},As=function(t,e){return(As=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var Cs=function(){function t(t){this.renderer=t,this._foundShapes=[]}return t.prototype.pushMask=function(t){var e=this.renderer,r=t.maskObject||t;e.context.save();var i=this._foundShapes;if(this.recursiveFindShapes(r,i),i.length>0){var n=e.context;n.beginPath();for(var o=0;o<i.length;o++){var s=i[o],a=s.transform.worldTransform;this.renderer.setContextTransform(a),this.renderGraphicsShape(s)}i.length=0,n.clip()}},t.prototype.recursiveFindShapes=function(t,e){t.geometry&&t.geometry.graphicsData&&e.push(t);var r=t.children;if(r)for(var i=0;i<r.length;i++)this.recursiveFindShapes(r[i],e)},t.prototype.renderGraphicsShape=function(t){t.finishPoly();var e=this.renderer.context,r=t.geometry.graphicsData,i=r.length;if(0!==i)for(var n=0;n<i;n++){var o=r[n].shape;if(o.type===Et.POLY){var s=o.points;e.moveTo(s[0],s[1]);for(var a=1;a<s.length/2;a++)e.lineTo(s[2*a],s[2*a+1]);s[0]===s[s.length-2]&&s[1]===s[s.length-1]&&e.closePath()}else if(o.type===Et.RECT)e.rect(o.x,o.y,o.width,o.height),e.closePath();else if(o.type===Et.CIRC)e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.closePath();else if(o.type===Et.ELIP){var h=2*o.width,u=2*o.height,l=o.x-h/2,c=o.y-u/2,f=h/2*.5522848,p=u/2*.5522848,d=l+h,y=c+u,v=l+h/2,m=c+u/2;e.moveTo(l,m),e.bezierCurveTo(l,m-p,v-f,c,v,c),e.bezierCurveTo(v+f,c,d,m-p,d,m),e.bezierCurveTo(d,m+p,v+f,y,v,y),e.bezierCurveTo(v-f,y,l,m+p,l,m),e.closePath()}else if(o.type===Et.RREC){var g=o.x,_=o.y,b=o.width,x=o.height,w=o.radius,T=Math.min(b,x)/2|0;w=w>T?T:w,e.moveTo(g,_+w),e.lineTo(g,_+x-w),e.quadraticCurveTo(g,_+x,g+w,_+x),e.lineTo(g+b-w,_+x),e.quadraticCurveTo(g+b,_+x,g+b,_+x-w),e.lineTo(g+b,_+w),e.quadraticCurveTo(g+b,_,g+b-w,_),e.lineTo(g+w,_),e.quadraticCurveTo(g,_,g,_+w),e.closePath()}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();function Is(t){var e=document.createElement("canvas");e.width=6,e.height=1;var r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}function Rs(){if("undefined"==typeof document)return!1;var t=Is("#ff00ff"),e=Is("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var i=r.getContext("2d");i.globalCompositeOperation="multiply",i.drawImage(t,0,0),i.drawImage(e,2,0);var n=i.getImageData(2,0,1,1);if(!n)return!1;var o=n.data;return 255===o[0]&&0===o[1]&&0===o[2]}var Ms=new Nt,Ds=function(t){function e(r){var i,n=t.call(this,C.CANVAS,r)||this;if(n.rootContext=n.view.getContext("2d",{alpha:n.transparent}),n.context=n.rootContext,n.refresh=!0,n.maskManager=new Cs(n),n.smoothProperty="imageSmoothingEnabled",!n.rootContext.imageSmoothingEnabled){var o=n.rootContext;o.webkitImageSmoothingEnabled?n.smoothProperty="webkitImageSmoothingEnabled":o.mozImageSmoothingEnabled?n.smoothProperty="mozImageSmoothingEnabled":o.oImageSmoothingEnabled?n.smoothProperty="oImageSmoothingEnabled":o.msImageSmoothingEnabled&&(n.smoothProperty="msImageSmoothingEnabled")}return n.initPlugins(e.__plugins),n.blendModes=(void 0===i&&(i=[]),Rs()?(i[R.NORMAL]="source-over",i[R.ADD]="lighter",i[R.MULTIPLY]="multiply",i[R.SCREEN]="screen",i[R.OVERLAY]="overlay",i[R.DARKEN]="darken",i[R.LIGHTEN]="lighten",i[R.COLOR_DODGE]="color-dodge",i[R.COLOR_BURN]="color-burn",i[R.HARD_LIGHT]="hard-light",i[R.SOFT_LIGHT]="soft-light",i[R.DIFFERENCE]="difference",i[R.EXCLUSION]="exclusion",i[R.HUE]="hue",i[R.SATURATION]="saturate",i[R.COLOR]="color",i[R.LUMINOSITY]="luminosity"):(i[R.NORMAL]="source-over",i[R.ADD]="lighter",i[R.MULTIPLY]="source-over",i[R.SCREEN]="source-over",i[R.OVERLAY]="source-over",i[R.DARKEN]="source-over",i[R.LIGHTEN]="source-over",i[R.COLOR_DODGE]="source-over",i[R.COLOR_BURN]="source-over",i[R.HARD_LIGHT]="source-over",i[R.SOFT_LIGHT]="source-over",i[R.DIFFERENCE]="source-over",i[R.EXCLUSION]="source-over",i[R.HUE]="source-over",i[R.SATURATION]="source-over",i[R.COLOR]="source-over",i[R.LUMINOSITY]="source-over"),i[R.NORMAL_NPM]=i[R.NORMAL],i[R.ADD_NPM]=i[R.ADD],i[R.SCREEN_NPM]=i[R.SCREEN],i[R.SRC_IN]="source-in",i[R.SRC_OUT]="source-out",i[R.SRC_ATOP]="source-atop",i[R.DST_OVER]="destination-over",i[R.DST_IN]="destination-in",i[R.DST_OUT]="destination-out",i[R.DST_ATOP]="destination-atop",i[R.XOR]="xor",i[R.SUBTRACT]="source-over",i),n._activeBlendMode=null,n._outerBlend=!1,n._projTransform=null,n.renderingToScreen=!1,tt("Canvas"),n.resize(n.options.width,n.options.height),n}return function(t,e){function r(){this.constructor=t}As(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.castToBaseTexture())._canvasRenderTarget||(e._canvasRenderTarget=new xt(e.width,e.height,e.resolution),e.resource=new Ce.CanvasResource(e._canvasRenderTarget.canvas),e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(this._projTransform=i||null,e||(this._lastObjectRendered=t),!n){var a=t.enableTempParent();t.updateTransform(),t.disableTempParent(a)}if(s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=R.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[R.NORMAL],void 0!==r?r:this.clearBeforeRender)if(this.renderingToScreen)this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height));else{(e=e)._canvasRenderTarget.clear();var h=e.clearColor;h[3]>0&&(s.fillStyle=rt(nt(h)),s.fillRect(0,0,e.realWidth,e.realHeight))}var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this._projTransform=null,this.emit("postrender")}},e.prototype.setContextTransform=function(t,e,r){var i=t,n=this._projTransform,o=this.resolution;r=r||o,n&&((i=Ms).copyFrom(t),i.prepend(n)),e?this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o|0,i.ty*o|0):this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o,i.ty*o)},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var r=t===R.SRC_IN||t===R.SRC_OUT||t===R.DST_IN||t===R.DST_ATOP;!e&&r&&(t=R.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=Y.SCALE_MODE===k.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(oi),Ls={canvas:null,getTintedCanvas:function(t,e){var r=t.texture,i="#"+("00000"+(0|(e=Ls.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=document.createElement("canvas");if(Ls.tintMethod(r,e,n),n.tintId=r._updateID,Ls.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n;return n},getTintedPattern:function(t,e){var r="#"+("00000"+(0|(e=Ls.roundColor(e))).toString(16)).substr(-6);t.patternCache=t.patternCache||{};var i=t.patternCache[r];return i&&i.tintId===t._updateID||(Ls.canvas||(Ls.canvas=document.createElement("canvas")),Ls.tintMethod(t,e,Ls.canvas),(i=Ls.canvas.getContext("2d").createPattern(Ls.canvas,"repeat")).tintId=t._updateID,t.patternCache[r]=i),i},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),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.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=et(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,f=0;f<c.length;f+=4)c[f+0]*=a,c[f+1]*=h,c[f+2]*=u;i.putImageData(l,0,0)},roundColor:function(t){var e=Ls.cacheStepsPerColorChannel,r=et(t);return r[0]=Math.min(255,r[0]/e*e),r[1]=Math.min(255,r[1]/e*e),r[2]=Math.min(255,r[2]/e*e),nt(r)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:Rs(),tintMethod:null};Ls.tintMethod=Ls.canUseMultiply?Ls.tintWithMultiply:Ls.tintWithPerPixel;var Ns=si.create;si.create=function(t){if(!(t&&t.forceCanvas))try{return Ns(t)}catch(t){}return new Ds(t)},_e.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:null},De.prototype._canvasRenderTarget=null,ke.prototype.patternCache=null,ke.prototype.tintCache=null;
  /*!
   * @pixi/canvas-mesh - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-mesh is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var ks=function(){function t(t){this._cachedTint=16777215,this._tintedCanvas=null,this.renderer=t}return t.prototype.render=function(t){var e=this.renderer,r=t.worldTransform;e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),e.setContextTransform(r,t.roundPixels),t.drawMode!==M.TRIANGLES?this._renderTriangleMesh(t):this._renderTriangles(t)},t.prototype._renderTriangleMesh=function(t){for(var e=t.geometry.buffers[0].data.length,r=0;r<e-2;r++){var i=2*r;this._renderDrawTriangle(t,i,i+2,i+4)}},t.prototype._renderTriangles=function(t){for(var e=t.geometry.getIndex().data,r=e.length,i=0;i<r;i+=3){var n=2*e[i],o=2*e[i+1],s=2*e[i+2];this._renderDrawTriangle(t,n,o,s)}},t.prototype._renderDrawTriangle=function(t,e,r,i){var n=this.renderer.context,o=t.geometry.buffers[0].data,s=t.uvs,a=t.texture;if(a.valid){var h=16777215!==t.tint,u=a.baseTexture,l=u.width,c=u.height;h&&this._cachedTint!==t.tint&&(this._cachedTint=t.tint,this._tintedCanvas=Ls.getTintedCanvas(t,t.tint));var f=h?this._tintedCanvas:u.getDrawableSource(),p=s[e]*u.width,d=s[r]*u.width,y=s[i]*u.width,v=s[e+1]*u.height,m=s[r+1]*u.height,g=s[i+1]*u.height,_=o[e],b=o[r],x=o[i],w=o[e+1],T=o[r+1],E=o[i+1],S=t.canvasPadding/this.renderer.resolution;if(S>0){var P=S/Math.abs(t.worldTransform.a),O=S/Math.abs(t.worldTransform.d),A=(_+b+x)/3,C=(w+T+E)/3,I=_-A,R=w-C,M=Math.sqrt(I*I+R*R);_=A+I/M*(M+P),w=C+R/M*(M+O),R=T-C,b=A+(I=b-A)/(M=Math.sqrt(I*I+R*R))*(M+P),T=C+R/M*(M+O),R=E-C,x=A+(I=x-A)/(M=Math.sqrt(I*I+R*R))*(M+P),E=C+R/M*(M+O)}n.save(),n.beginPath(),n.moveTo(_,w),n.lineTo(b,T),n.lineTo(x,E),n.closePath(),n.clip();var D=p*m+v*y+d*g-m*y-v*d-p*g,L=_*m+v*x+b*g-m*x-v*b-_*g,N=p*b+_*y+d*x-b*y-_*d-p*x,k=p*m*x+v*b*y+_*d*g-_*m*y-v*d*x-p*b*g,F=w*m+v*E+T*g-m*E-v*T-w*g,U=p*T+w*y+d*E-T*y-w*d-p*E,j=p*m*E+v*T*y+w*d*g-w*m*y-v*d*E-p*T*g;n.transform(L/D,F/D,N/D,U/D,k/D,j/D),n.drawImage(f,0,0,l*u.resolution,c*u.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},t.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n<i-2;++n){var o=2*n,s=r[o],a=r[o+1],h=r[o+2],u=r[o+3],l=r[o+4],c=r[o+5];e.moveTo(s,a),e.lineTo(h,u),e.lineTo(l,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},t.prototype.destroy=function(){this.renderer=null},t}();Y.MESH_CANVAS_PADDING=0,To.prototype._renderCanvas=function(t,e){t.plugins.mesh.render(e)},Es.prototype._cachedTint=16777215,Es.prototype._tintedCanvas=null,Es.prototype._canvasUvs=null,Es.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,i=16777215!==this.tint,n=this.texture;if(n.valid){i&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedCanvas=Ls.getTintedCanvas(this,this.tint));var o=i?this._tintedCanvas:n.baseTexture.getDrawableSource();this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,a=this._canvasUvs,h=i?0:n.frame.x,u=i?0:n.frame.y,l=h+n.frame.width,c=u+n.frame.height;a[0]=h,a[1]=h+this._leftWidth,a[2]=l-this._rightWidth,a[3]=l,a[4]=u,a[5]=u+this._topHeight,a[6]=c-this._bottomHeight,a[7]=c;for(var f=0;f<8;f++)a[f]*=n.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.setContextTransform(r,this.roundPixels);for(var p=0;p<3;p++)for(var d=0;d<3;d++){var y=2*d+8*p,v=Math.max(1,a[d+1]-a[d]),m=Math.max(1,a[p+5]-a[p+4]),g=Math.max(1,s[y+10]-s[y]),_=Math.max(1,s[y+11]-s[y+1]);e.drawImage(o,a[d],a[p+4],v,m,s[y],s[y+1],g,_)}}};var Fs=!1;wo.prototype._renderCanvas=function(t){this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.material._renderCanvas?this.material._renderCanvas(t,this):Fs||(Fs=!0,window.console&&console.warn("Mesh with custom shaders are not supported in CanvasRenderer."))},wo.prototype._canvasPadding=null,Object.defineProperty(wo.prototype,"canvasPadding",{get:function(){return null!==this._canvasPadding?this._canvasPadding:Y.MESH_CANVAS_PADDING},set:function(t){this._canvasPadding=t}}),Ts.prototype._renderCanvas=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)},xs.prototype._renderCanvas=function(t){(this.autoUpdate||this.geometry._width!==this.shader.texture.height)&&(this.geometry._width=this.shader.texture.height,this.geometry.update()),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)};
  /*!
   * @pixi/canvas-graphics - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-graphics is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var Us,js=function(){function t(t){this.renderer=t,this._svgMatrix=null,this._tempMatrix=new Nt}return t.prototype._calcCanvasStyle=function(t,e){var r;return t.texture?t.texture.valid?(r=Ls.getTintedPattern(t.texture,e),this.setPatternTransform(r,t.matrix||Nt.IDENTITY)):r="#808080":r="#"+("00000"+(0|e).toString(16)).substr(-6),r},t.prototype.render=function(t){var e=this.renderer,r=e.context,i=t.worldAlpha,n=t.transform.worldTransform;e.setContextTransform(n),e.setBlendMode(t.blendMode);for(var o,s,a=t.geometry.graphicsData,h=(t.tint>>16&255)/255,u=(t.tint>>8&255)/255,l=(255&t.tint)/255,c=0;c<a.length;c++){var f=a[c],p=f.shape,d=f.fillStyle,y=f.lineStyle,v=0|f.fillStyle.color,m=0|f.lineStyle.color;if(f.matrix&&e.setContextTransform(n.copyTo(this._tempMatrix).append(f.matrix)),d.visible){var g=((v>>16&255)/255*h*255<<16)+((v>>8&255)/255*u*255<<8)+(255&v)/255*l*255;o=this._calcCanvasStyle(d,g)}if(y.visible){var _=((m>>16&255)/255*h*255<<16)+((m>>8&255)/255*u*255<<8)+(255&m)/255*l*255;s=this._calcCanvasStyle(y,_)}if(r.lineWidth=y.width,r.lineCap=y.cap,r.lineJoin=y.join,r.miterLimit=y.miterLimit,f.type===Et.POLY){r.beginPath();var b=(A=p).points,x=f.holes,w=void 0,T=void 0,E=void 0,S=void 0;r.moveTo(b[0],b[1]);for(var P=2;P<b.length;P+=2)r.lineTo(b[P],b[P+1]);if(A.closeStroke&&r.closePath(),x.length>0){w=0,E=b[0],S=b[1];for(P=2;P+2<b.length;P+=2)w+=(b[P]-E)*(b[P+3]-S)-(b[P+2]-E)*(b[P+1]-S);for(var O=0;O<x.length;O++)if(b=x[O].shape.points){T=0,E=b[0],S=b[1];for(P=2;P+2<b.length;P+=2)T+=(b[P]-E)*(b[P+3]-S)-(b[P+2]-E)*(b[P+1]-S);if(T*w<0){r.moveTo(b[0],b[1]);for(P=2;P<b.length;P+=2)r.lineTo(b[P],b[P+1])}else{r.moveTo(b[b.length-2],b[b.length-1]);for(P=b.length-4;P>=0;P-=2)r.lineTo(b[P],b[P+1])}x[O].shape.closeStroke&&r.closePath()}}d.visible&&(r.globalAlpha=d.alpha*i,r.fillStyle=o,r.fill()),y.visible&&(r.globalAlpha=y.alpha*i,r.strokeStyle=s,r.stroke())}else if(f.type===Et.RECT){var A=p;d.visible&&(r.globalAlpha=d.alpha*i,r.fillStyle=o,r.fillRect(A.x,A.y,A.width,A.height)),y.visible&&(r.globalAlpha=y.alpha*i,r.strokeStyle=s,r.strokeRect(A.x,A.y,A.width,A.height))}else if(f.type===Et.CIRC){A=p;r.beginPath(),r.arc(A.x,A.y,A.radius,0,2*Math.PI),r.closePath(),d.visible&&(r.globalAlpha=d.alpha*i,r.fillStyle=o,r.fill()),y.visible&&(r.globalAlpha=y.alpha*i,r.strokeStyle=s,r.stroke())}else if(f.type===Et.ELIP){var C=2*(A=p).width,I=2*A.height,R=A.x-C/2,M=A.y-I/2;r.beginPath();var D=C/2*.5522848,L=I/2*.5522848,N=R+C,k=M+I,F=R+C/2,U=M+I/2;r.moveTo(R,U),r.bezierCurveTo(R,U-L,F-D,M,F,M),r.bezierCurveTo(F+D,M,N,U-L,N,U),r.bezierCurveTo(N,U+L,F+D,k,F,k),r.bezierCurveTo(F-D,k,R,U+L,R,U),r.closePath(),d.visible&&(r.globalAlpha=d.alpha*i,r.fillStyle=o,r.fill()),y.visible&&(r.globalAlpha=y.alpha*i,r.strokeStyle=s,r.stroke())}else if(f.type===Et.RREC){var j=(A=p).x,B=A.y,H=A.width,G=A.height,X=A.radius,z=Math.min(H,G)/2|0;X=X>z?z:X,r.beginPath(),r.moveTo(j,B+X),r.lineTo(j,B+G-X),r.quadraticCurveTo(j,B+G,j+X,B+G),r.lineTo(j+H-X,B+G),r.quadraticCurveTo(j+H,B+G,j+H,B+G-X),r.lineTo(j+H,B+X),r.quadraticCurveTo(j+H,B,j+H-X,B),r.lineTo(j+X,B),r.quadraticCurveTo(j,B,j,B+X),r.closePath(),d.visible&&(r.globalAlpha=d.alpha*i,r.fillStyle=o,r.fill()),y.visible&&(r.globalAlpha=y.alpha*i,r.strokeStyle=s,r.stroke())}}},t.prototype.setPatternTransform=function(t,e){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!t.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=e.a,this._svgMatrix.b=e.b,this._svgMatrix.c=e.c,this._svgMatrix.d=e.d,this._svgMatrix.e=e.tx,this._svgMatrix.f=e.ty,t.setTransform(this._svgMatrix.inverse())}},t.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},t}(),Bs=new Nt;In.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=Ue.create({width:r.width,height:r.height,scaleMode:t,resolution:e});Us||(Us=new Ds),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Bs),Bs.invert(),Bs.tx-=r.x,Bs.ty-=r.y,Us.render(this,i,!0,Bs);var n=ke.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.setResolution(e),n},In.prototype.cachedGraphicsData=[],In.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};
  /*!
   * @pixi/canvas-sprite - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-sprite is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var Hs=new Nt,Gs=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&e.valid&&u&&e.valid){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===k.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==l&&(i[r.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(Hs),s=Hs,Xt.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,r.setContextTransform(s,t.roundPixels,1),t.roundPixels&&(a|=0,h|=0);var c=e.baseTexture.resolution,f=r._outerBlend;f&&(i.save(),i.beginPath(),i.rect(a*r.resolution,h*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=Ls.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,Math.floor(n*c),Math.floor(o*c),Math.floor(a*r.resolution),Math.floor(h*r.resolution),Math.floor(n*r.resolution),Math.floor(o*r.resolution))):i.drawImage(u,e._frame.x*c,e._frame.y*c,Math.floor(n*c),Math.floor(o*c),Math.floor(a*r.resolution),Math.floor(h*r.resolution),Math.floor(n*r.resolution),Math.floor(o*r.resolution)),f&&i.restore(),r.setBlendMode(R.NORMAL)}},t.prototype.destroy=function(){this.renderer=null},t}();Nn.prototype._tintedCanvas=null,Nn.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};
  /*!
   * @pixi/canvas-extract - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-extract is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  var Xs=new At,zs=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof Ue?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=Xs).width=this.renderer.width,i.height=this.renderer.height);var s=Math.floor(i.width*r+1e-4),a=Math.floor(i.height*r+1e-4),h=new xt(s,a,1),u=e.getImageData(i.x*r,i.y*r,s,a);return h.context.putImageData(u,0,0),h.canvas},t.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;return t&&(n=t instanceof Ue?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,(i=Xs).width=o.width,i.height=o.height),e.getImageData(0,0,i.width*r,i.height*r).data},t.prototype.destroy=function(){this.renderer=null},t}();Object.defineProperty(Ds.prototype,"extract",{get:function(){return mt("v5.3.0","CanvasRenderer#extract is deprecated, use CanvasRenderer#plugins.extract"),this.plugins.extract}});
  /*!
   * @pixi/canvas-prepare - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-prepare is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation. All rights reserved.
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  this file except in compliance with the License. You may obtain a copy of the
  License at http://www.apache.org/licenses/LICENSE-2.0
  
  THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  MERCHANTABLITY OR NON-INFRINGEMENT.
  
  See the Apache Version 2.0 License for specific language governing permissions
  and limitations under the License.
  ***************************************************************************** */
  var Ys=function(t,e){return(Ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function Vs(t,e){var r=t;if(e instanceof _e){var i=e.source,n=0===i.width?r.canvas.width:Math.min(r.canvas.width,i.width),o=0===i.height?r.canvas.height:Math.min(r.canvas.height,i.height);return r.ctx.drawImage(i,0,0,n,o,0,0,r.canvas.width,r.canvas.height),!0}return!1}var Ws=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r,r.canvas=document.createElement("canvas"),r.canvas.width=16,r.canvas.height=16,r.ctx=r.canvas.getContext("2d"),r.registerUploadHook(Vs),r}return function(t,e){function r(){this.constructor=t}Ys(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(ro);
  /*!
   * @pixi/canvas-sprite-tiling - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-sprite-tiling is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */fo.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=e.baseTexture,o=n.getDrawableSource(),s=n.resolution,a=this.tilePosition.x/this.tileScale.x%e._frame.width*s,h=this.tilePosition.y/this.tileScale.y%e._frame.height*s;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var u=new xt(e._frame.width,e._frame.height,s);16777215!==this.tint?(this._tintedCanvas=Ls.getTintedCanvas(this,this.tint),u.context.drawImage(this._tintedCanvas,0,0)):u.context.drawImage(o,-e._frame.x*s,-e._frame.y*s),this._cachedTint=this.tint,this._canvasPattern=u.context.createPattern(u.canvas,"repeat")}r.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.setContextTransform(i),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/s,this.tileScale.y/s);var l=this.anchor.x*-this._width,c=this.anchor.y*-this._height;this.uvRespectAnchor?(r.translate(a,h),r.fillRect(-a+l,-h+c,this._width/this.tileScale.x*s,this._height/this.tileScale.y*s)):(r.translate(a+l,h+c),r.fillRect(-a,-h,this._width/this.tileScale.x*s,this._height/this.tileScale.y*s))}},
  /*!
   * @pixi/canvas-particles - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-particles is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Ji.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h<this.children.length;++h){var u=this.children[h];if(u.visible&&u._texture.valid){var l=u._texture.frame;if(e.globalAlpha=this.worldAlpha*u.alpha,u.rotation%(2*Math.PI)==0)i&&(t.setContextTransform(r,!1,1),i=!1),n=u.anchor.x*(-l.width*u.scale.x)+u.position.x+.5,o=u.anchor.y*(-l.height*u.scale.y)+u.position.y+.5,s=l.width*u.scale.x,a=l.height*u.scale.y;else{i||(i=!0),u.displayObjectUpdateTransform();var c=u.worldTransform;t.setContextTransform(c,this.roundPixels,1),n=u.anchor.x*-l.width+.5,o=u.anchor.y*-l.height+.5,s=l.width,a=l.height}var f=u._texture.baseTexture.resolution;e.drawImage(u._texture.baseTexture.getDrawableSource(),l.x*f,l.y*f,l.width*f,l.height*f,n*t.resolution,o*t.resolution,s*t.resolution,a*t.resolution)}}}},
  /*!
   * @pixi/canvas-display - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-display is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Jt.prototype._renderCanvas=function(t){},Jt.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask),this._renderCanvas(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},qt.prototype.renderCanvas=function(t){},
  /*!
   * @pixi/canvas-text - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * @pixi/canvas-text is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Vn.prototype._renderCanvas=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),Nn.prototype._renderCanvas.call(this,t)},
  /*!
   * pixi.js-legacy - v5.3.2
   * Compiled Mon, 27 Jul 2020 16:20:05 UTC
   *
   * pixi.js-legacy is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */
  Ds.registerPlugin("accessibility",$t),Ds.registerPlugin("extract",zs),Ds.registerPlugin("graphics",js),Ds.registerPlugin("interaction",le),Ds.registerPlugin("mesh",ks),Ds.registerPlugin("prepare",Ws),Ds.registerPlugin("sprite",Gs);
  /*!
   * pixi-sound - v3.0.5
   * https://github.com/pixijs/pixi-sound
   * Compiled Thu, 09 Jul 2020 17:33:34 UTC
   *
   * pixi-sound is licensed under the MIT license.
   * http://www.opensource.org/licenses/mit-license
   */
  var qs=function(){function t(t,e){this._output=e,this._input=t}return Object.defineProperty(t.prototype,"destination",{get:function(){return this._input},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._filters},set:function(t){var e=this;if(this._filters&&(this._filters.forEach((function(t){t&&t.disconnect()})),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();var r=null;t.forEach((function(t){null===r?e._input.connect(t.destination):r.connect(t.destination),r=t})),r.connect(this._output)}},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.filters=null,this._input=null,this._output=null},t}(),Ks=function(){function t(t,e){this.init(t,e)}return t.prototype.init=function(t,e){this.destination=t,this.source=e||t},t.prototype.connect=function(t){this.source.connect(t)},t.prototype.disconnect=function(){this.source.disconnect()},t.prototype.destroy=function(){this.disconnect(),this.destination=null,this.source=null},t}(),Zs=function(t,e){return(Zs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function Js(t,e){function r(){this.constructor=t}Zs(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Qs,$s=function(){return($s=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function ta(){return Qs}var ea,ra,ia,na,oa=function(){function t(){}return t.setParamValue=function(t,e){if(t.setValueAtTime){var r=ta().context;t.setValueAtTime(e,r.audioContext.currentTime)}else t.value=e;return e},t}(),sa=0,aa=function(t){function e(e){var r=t.call(this)||this;return r.id=sa++,r._media=null,r._paused=!1,r._muted=!1,r._elapsed=0,r.init(e),r}return Js(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name "+t+" does not exist.");return this[t]=e,this},e.prototype.stop=function(){this._source&&(this._internalStop(),this.emit("stop"))},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh(),this._update(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){if(this._source){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var r=t.volume*(t.muted?0:1),i=e.volume*(e.muted?0:1),n=this._volume*(this._muted?0:1);oa.setParamValue(this._gain.gain,n*i*r),oa.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed)}},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,r=this._paused||e.paused||t.paused;r!==this._pausedReal&&(this._pausedReal=r,r?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",r))},e.prototype.play=function(t){var e=t.start,r=t.end,i=t.speed,n=t.loop,o=t.volume,s=t.muted;this._paused=!1;var a=this._media.nodes.cloneBufferSource(),h=a.source,u=a.gain;this._source=h,this._gain=u,this._speed=i,this._volume=o,this._loop=!!n,this._muted=s,this.refresh();var l=this._source.buffer.duration;this._duration=l,this._end=r,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=r,this._source.loopStart=e,this._source.start(0,e)):r?this._source.start(0,e,r-e):this._source.start(0,e),this.emit("start"),this._update(!0),this._enabled=!0},e.prototype._toSec=function(t){return t>10&&(t/=1e3),t||0},Object.defineProperty(e.prototype,"_enabled",{set:function(t){ee.shared.remove(this._updateListener,this),t&&ee.shared.add(this._updateListener,this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},e.prototype.toString=function(){return"[WebAudioInstance id="+this.id+"]"},e.prototype._now=function(){return this._media.context.audioContext.currentTime},e.prototype._updateListener=function(){this._update()},e.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),r=e-this._lastUpdate;if(r>0||t){var i=this._source.playbackRate.value;this._elapsed+=r*i,this._lastUpdate=e;var n=this._duration,o=void 0;if(this._source.loopStart){var s=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%s)/n}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n)}}},e.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},e.prototype._internalStop=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.stop(0),this._source.disconnect(),this._source=null)},e.prototype._onComplete=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.disconnect()),this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},e}(W.a),ha=function(t){function e(e){var r=this,i=e.audioContext,n=i.createBufferSource(),o=i.createGain(),s=i.createAnalyser();return n.connect(s),s.connect(o),o.connect(e.destination),(r=t.call(this,s,o)||this).context=e,r.bufferSource=n,r.gain=o,r.analyser=s,r}return Js(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,oa.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var r=this.context.audioContext.createGain();return e.connect(r),r.connect(this.destination),{source:e,gain:r}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!0,configurable:!0}),e.BUFFER_SIZE=0,e}(qs),ua=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new ha(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null,this._source=null,this.source=null},t.prototype.create=function(){return new aa(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,r=new XMLHttpRequest,i=this.parent.url;r.open("GET",i,!0),r.responseType="arraybuffer",r.onload=function(){e.source=r.response,e._decode(r.response,t)},r.send()},t.prototype._decode=function(t,e){var r=this;this.parent.context.decode(t,(function(t,i){if(t)e&&e(t);else{r.parent.isLoaded=!0,r.buffer=i;var n=r.parent.autoPlayStart();e&&e(null,r.parent,n)}}))},t}(),la=function(t){function e(){var r=this,i=window,n=new e.AudioContext,o=n.createDynamicsCompressor(),s=n.createAnalyser();return s.connect(o),o.connect(n.destination),(r=t.call(this,s,o)||this)._ctx=n,r._offlineCtx=new e.OfflineAudioContext(1,2,i.OfflineAudioContext?n.sampleRate:44100),r._unlocked=!1,r.compressor=o,r.analyser=s,r.events=new W.a,r.volume=1,r.speed=1,r.muted=!1,r.paused=!1,"running"!==n.state&&(r._unlock(),r._unlock=r._unlock.bind(r),document.addEventListener("mousedown",r._unlock,!0),document.addEventListener("touchstart",r._unlock,!0),document.addEventListener("touchend",r._unlock,!0)),r}return Js(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){this._offlineCtx.decodeAudioData(t,(function(t){e(null,t)}),(function(t){e(new Error(t.message||"Unable to decode file"))}))},e}(qs),ca={WebAudioMedia:ua,WebAudioInstance:aa,WebAudioNodes:ha,WebAudioContext:la,WebAudioUtils:oa},fa={Filter:Ks,EqualizerFilter:function(t){function e(r,i,n,o,s,a,h,u,l,c){void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),void 0===u&&(u=0),void 0===l&&(l=0),void 0===c&&(c=0);var f=this;if(!ta().useLegacy){var p=[{f:e.F32,type:"lowshelf",gain:r},{f:e.F64,type:"peaking",gain:i},{f:e.F125,type:"peaking",gain:n},{f:e.F250,type:"peaking",gain:o},{f:e.F500,type:"peaking",gain:s},{f:e.F1K,type:"peaking",gain:a},{f:e.F2K,type:"peaking",gain:h},{f:e.F4K,type:"peaking",gain:u},{f:e.F8K,type:"peaking",gain:l},{f:e.F16K,type:"highshelf",gain:c}].map((function(t){var e=ta().context.audioContext.createBiquadFilter();return e.type=t.type,oa.setParamValue(e.Q,1),e.frequency.value=t.f,oa.setParamValue(e.gain,t.gain),e}));(f=t.call(this,p[0],p[p.length-1])||this).bands=p,f.bandsMap={};for(var d=0;d<f.bands.length;d++){var y=f.bands[d];d>0&&f.bands[d-1].connect(y),f.bandsMap[y.frequency.value]=y}return f}f=t.call(this,null)||this}return Js(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency "+t);oa.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency "+t);return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.bands.forEach((function(t){oa.setParamValue(t.gain,0)}))},e.prototype.destroy=function(){this.bands.forEach((function(t){t.disconnect()})),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(Ks),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var r=this;if(!ta().useLegacy){var i=ta().context.audioContext.createWaveShaper();return(r=t.call(this,i)||this)._distortion=i,r.amount=e,r}r=t.call(this,null)||this}return Js(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){t*=1e3,this._amount=t;for(var e,r=new Float32Array(44100),i=Math.PI/180,n=0;n<44100;++n)e=2*n/44100-1,r[n]=(3+t)*e*20*i/(Math.PI+t*Math.abs(e));this._distortion.curve=r,this._distortion.oversample="4x"},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(Ks),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var r=this;if(!ta().useLegacy){var i,n,o,s=ta().context.audioContext;return s.createStereoPanner?o=i=s.createStereoPanner():((n=s.createPanner()).panningModel="equalpower",o=n),(r=t.call(this,o)||this)._stereo=i,r._panner=n,r.pan=e,r}r=t.call(this,null)||this}return Js(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?oa.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(Ks),ReverbFilter:function(t){function e(e,r,i){void 0===e&&(e=3),void 0===r&&(r=2),void 0===i&&(i=!1);var n=this;if(!ta().useLegacy)return(n=t.call(this,null)||this)._seconds=n._clamp(e,1,50),n._decay=n._clamp(r,0,100),n._reverse=i,n._rebuild(),n;n=t.call(this,null)||this}return Js(e,t),e.prototype._clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!0,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=ta().context.audioContext,r=e.sampleRate,i=r*this._seconds,n=e.createBuffer(2,i,r),o=n.getChannelData(0),s=n.getChannelData(1),a=0;a<i;a++)t=this._reverse?i-a:a,o[a]=(2*Math.random()-1)*Math.pow(1-t/i,this._decay),s[a]=(2*Math.random()-1)*Math.pow(1-t/i,this._decay);var h=ta().context.audioContext.createConvolver();h.buffer=n,this.init(h)},e}(Ks),MonoFilter:function(t){function e(){var e=this;if(!ta().useLegacy){var r=ta().context.audioContext,i=r.createChannelSplitter(),n=r.createChannelMerger();return n.connect(i),(e=t.call(this,n,i)||this)._merger=n,e}e=t.call(this,null)||this}return Js(e,t),e.prototype.destroy=function(){this._merger.disconnect(),this._merger=null,t.prototype.destroy.call(this)},e}(Ks),TelephoneFilter:function(t){function e(){if(!ta().useLegacy){var e=ta().context.audioContext,r=e.createBiquadFilter(),i=e.createBiquadFilter(),n=e.createBiquadFilter(),o=e.createBiquadFilter();return r.type="lowpass",oa.setParamValue(r.frequency,2e3),i.type="lowpass",oa.setParamValue(i.frequency,2e3),n.type="highpass",oa.setParamValue(n.frequency,500),o.type="highpass",oa.setParamValue(o.frequency,500),r.connect(i),i.connect(n),n.connect(o),t.call(this,r,o)||this}t.call(this,null)}return Js(e,t),e}(Ks)},pa=0,da=function(t){function e(e){var r=t.call(this)||this;return r.id=pa++,r.init(e),r}return Js(e,t),e.prototype.set=function(t,e){if(void 0===this[t])throw new Error("Property with name "+t+" does not exist.");return this[t]=e,this},Object.defineProperty(e.prototype,"progress",{get:function(){return this._source.currentTime/this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),e.prototype._onPlay=function(){this._playing=!0},e.prototype._onPause=function(){this._playing=!1},e.prototype.init=function(t){this._playing=!1,this._duration=t.source.duration;var e=this._source=t.source.cloneNode(!1);e.src=t.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),t.context.on("refresh",this.refresh,this),t.context.on("refreshPaused",this.refreshPaused,this),this._media=t},e.prototype._internalStop=function(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())},e.prototype.stop=function(){this._internalStop(),this._source&&this.emit("stop")},Object.defineProperty(e.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){var t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;var r=t.volume*(t.muted?0:1),i=e.volume*(e.muted?0:1),n=this._volume*(this._muted?0:1);this._source.volume=n*r*i,this._source.playbackRate=this._speed*t.speed*e.speed},e.prototype.refreshPaused=function(){var t=this._media.context,e=this._media.parent,r=this._paused||e.paused||t.paused;r!==this._pausedReal&&(this._pausedReal=r,r?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",r))},e.prototype.play=function(t){var r=this,i=t.start,n=t.end,o=t.speed,s=t.loop,a=t.volume,h=t.muted;this._speed=o,this._volume=a,this._loop=!!s,this._muted=h,this.refresh(),this.loop&&null!==n&&(this.loop=!1),this._start=i,this._end=n||this._duration,this._start=Math.max(0,this._start-e.PADDING),this._end=Math.min(this._end+e.PADDING,this._duration),this._source.onloadedmetadata=function(){r._source&&(r._source.currentTime=i,r._source.onloadedmetadata=null,r.emit("progress",i,r._duration),ee.shared.add(r._onUpdate,r))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")},e.prototype._onUpdate=function(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete()},e.prototype._onComplete=function(){ee.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},e.prototype.destroy=function(){ee.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},e.prototype.toString=function(){return"[HTMLAudioInstance id="+this.id+"]"},e.PADDING=.1,e}(W.a),ya=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Js(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new da(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),e.prototype.load=function(t){var e=this._source,r=this.parent;if(4!==e.readyState){if(!r.url)return t(new Error("sound.url or sound.source must be set"));e.src=r.url;var i=function(){e.removeEventListener("canplaythrough",n),e.removeEventListener("load",n),e.removeEventListener("abort",o),e.removeEventListener("error",s)},n=function(){i(),r.isLoaded=!0;var e=r.autoPlayStart();t&&t(null,r,e)},o=function(){i(),t&&t(new Error("Sound loading has been aborted"))},s=function(){i();var r="Failed to load audio element (code: "+e.error.code+")";t&&t(new Error(r))};e.addEventListener("canplaythrough",n,!1),e.addEventListener("load",n,!1),e.addEventListener("abort",o,!1),e.addEventListener("error",s,!1),e.load()}else{r.isLoaded=!0;var a=r.autoPlayStart();t&&setTimeout((function(){t(null,r,a)}),0)}},e}(W.a),va=function(t){function e(){var e=t.call(this)||this;return e.speed=1,e.volume=1,e.muted=!1,e.paused=!1,e}return Js(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(W.a),ma={HTMLAudioMedia:ya,HTMLAudioInstance:da,HTMLAudioContext:va},ga=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid"],_a=(ea={m4a:"mp4",oga:"ogg"},ra=document.createElement("audio"),ia={},na=/^no$/,ga.forEach((function(t){var e=ea[t]||t,r=ra.canPlayType("audio/"+t).replace(na,""),i=ra.canPlayType("audio/"+e).replace(na,"");ia[t]=!!r||!!i})),Object.freeze(ia)),ba=/\.(\{([^\}]+)\})(\?.*)?$/;function xa(t){var e=ba,r="string"==typeof t?t:t.url;if(e.test(r)){for(var i=e.exec(r),n=i[2].split(","),o=n[n.length-1],s=0,a=n.length;s<a;s++){var h=n[s];if(_a[h]){o=h;break}}var u=r.replace(i[1],o);return"string"!=typeof t&&(t.extension=o,t.url=u),u}return r}var wa,Ta=function(){function t(){}return t.add=function(){t.legacy=ta().useLegacy},Object.defineProperty(t,"legacy",{set:function(t){var e=ga;t?e.forEach((function(t){Gi.setExtensionXhrType(t,Gi.XHR_RESPONSE_TYPE.DEFAULT),Gi.setExtensionLoadType(t,Gi.LOAD_TYPE.AUDIO)})):e.forEach((function(t){Gi.setExtensionXhrType(t,Gi.XHR_RESPONSE_TYPE.BUFFER),Gi.setExtensionLoadType(t,Gi.LOAD_TYPE.XHR)}))},enumerable:!0,configurable:!0}),t.pre=function(t,e){xa(t),e()},t.use=function(t,e){t.data&&ga.indexOf(t.extension)>-1?t.sound=ta().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},t}(),Ea=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),Sa=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var r=e.complete;this._autoPlayOptions=r?{complete:r}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var r={};return"string"==typeof e?r.url=e:e instanceof ArrayBuffer||e instanceof HTMLAudioElement?r.source=e:r=e,(r=$s({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},r)).url&&(r.url=xa(r.url)),Object.freeze(r),new t(ta().useLegacy?new ya:new ua,r)},Object.defineProperty(t.prototype,"context",{get:function(){return ta().context},enumerable:!0,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!0,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var r={};for(var i in t)r[i]=this.addSprites(i,t[i]);return r}if("string"==typeof t){var n=new Ea(this,e);return this._sprites[t]=n,n}},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var r in this._sprites)this.removeSprites(r);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!0,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var r,i=this;if("string"==typeof t?r={sprite:o=t,loop:this.loop,complete:e}:"function"==typeof t?(r={}).complete=t:r=t,(r=$s({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},r||{})).sprite){var n=r.sprite,o=this._sprites[n];r.start=o.start,r.end=o.end,r.speed=o.speed||1,r.loop=o.loop||r.loop,delete r.sprite}if(r.offset&&(r.start=r.offset),!this.isLoaded)return new Promise((function(t,e){i.autoPlay=!0,i._autoPlayOptions=r,i._preload((function(i,n,o){i?e(i):(r.loaded&&r.loaded(i,n,o),t(o))}))}));this.singleInstance&&this._removeInstances();var s=this._createInstance();return this._instances.push(s),this.isPlaying=!0,s.once("end",(function(){r.complete&&r.complete(i),i._onComplete(s)})),s.once("stop",(function(){i._onComplete(s)})),s.play(r),s},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e<t;e++)this._instances[e].refresh()},t.prototype.refreshPaused=function(){for(var t=this._instances.length,e=0;e<t;e++)this._instances[e].refreshPaused()},Object.defineProperty(t.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"muted",{get:function(){return this._muted},set:function(t){this._muted=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this.refresh()},enumerable:!0,configurable:!0}),t.prototype._preload=function(t){this.media.load(t)},Object.defineProperty(t.prototype,"instances",{get:function(){return this._instances},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sprites",{get:function(){return this._sprites},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.media.duration},enumerable:!0,configurable:!0}),t.prototype.autoPlayStart=function(){var t;return this.autoPlay&&(t=this.play(this._autoPlayOptions)),t},t.prototype._removeInstances=function(){for(var t=this._instances.length-1;t>=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),Pa=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new la),this._htmlAudioContext=new va,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==la.AudioContext},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var r={};for(var i in t){var n=this._getOptions(t[i],e);r[i]=this.add(i,n)}return r}if("string"==typeof t){if(e instanceof Sa)return this._sounds[t]=e,e;n=this._getOptions(e);var o=Sa.from(n);return this._sounds[t]=o,o}},t.prototype._getOptions=function(t,e){var r;return r="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof HTMLAudioElement?{source:t}:t,$s({},r,e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){Ta.legacy=t,this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!0,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!0,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var r=this.find(t);return void 0!==e&&(r.volume=e),r.volume},t.prototype.speed=function(t,e){var r=this.find(t);return void 0!==e&&(r.speed=e),r.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),Oa=0,Aa={get PLAY_ID(){return Oa},playOnce:function(t,e){var r="alias"+Oa++;return ta().add(r,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(ta().remove(r),e&&e(t))},complete:function(){ta().remove(r),e&&e(null)}}),r},render:function(t,e){var r=document.createElement("canvas");e=$s({width:512,height:128,fill:"black"},e||{}),r.width=e.width,r.height=e.height;var i=_e.from(r);if(!(t.media instanceof ua))return i;var n=t.media,o=r.getContext("2d");o.fillStyle=e.fill;for(var s=n.buffer.getChannelData(0),a=Math.ceil(s.length/e.width),h=e.height/2,u=0;u<e.width;u++){for(var l=1,c=-1,f=0;f<a;f++){var p=s[u*a+f];p<l&&(l=p),p>c&&(c=p)}o.fillRect(u,(1+l)*h,1,Math.max(1,(c-l)*h))}return i},resolveUrl:xa,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var r=Sa.from({singleInstance:!0});if(!(r.media instanceof ua))return r;for(var i=r.media,n=r.context.audioContext.createBuffer(1,48e3*e,48e3),o=n.getChannelData(0),s=0;s<o.length;s++){var a=t*(s/n.sampleRate)*Math.PI;o[s]=2*Math.sin(a)}return i.buffer=n,r.isLoaded=!0,r},extensions:ga,supported:_a},Ca=(wa=new Pa,Qs=wa,wa);Yi.registerPlugin(Ta),Object.defineProperties(Ca,{Filterable:{get:function(){return qs}},filters:{get:function(){return fa}},htmlaudio:{get:function(){return ma}},Sound:{get:function(){return Sa}},SoundLibrary:{get:function(){return Pa}},SoundSprite:{get:function(){return Ea}},utils:{get:function(){return Aa}},webaudio:{get:function(){return ca}},sound:{get:function(){return Ca}}});var Ia=mi,Ra=In,Ma=ke,Da=Jt,La=Ji,Na=Yi.shared,ka=Na.resources,Fa=Nn,Ua=fo,ja=Ps,Ba=Lo,Ha=Os;function Ga(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Xa=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateStack=e,this.context=r,this.container=new Da,r.stage.addChild(this.container)}var e,r,i;return e=t,(r=[{key:"handleEvent",value:function(t){t.preventDefault()}},{key:"update",value:function(){return!1}}])&&Ga(e.prototype,r),i&&Ga(e,i),t}(),za=function(t){function e(r){var i=Object.assign({},e.defaults,r),n=i.distance,o=i.outerStrength,s=i.innerStrength,a=i.color,h=i.knockout,u=i.quality;n=Math.round(n),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nuniform float outerStrength;\nuniform float innerStrength;\n\nuniform vec4 glowColor;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform bool knockout;\n\nconst float PI = 3.14159265358979323846264;\n\nconst float DIST = __DIST__;\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\n\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\n\nvoid main(void) {\n    vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\n\n    float totalAlpha = 0.0;\n\n    vec2 direction;\n    vec2 displaced;\n    vec4 curColor;\n\n    for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\n       direction = vec2(cos(angle), sin(angle)) * px;\n\n       for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\n           displaced = clamp(vTextureCoord + direction * \n                   (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\n\n           curColor = texture2D(uSampler, displaced);\n\n           totalAlpha += (DIST - curDistance) * curColor.a;\n       }\n    }\n    \n    curColor = texture2D(uSampler, vTextureCoord);\n\n    float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\n\n    float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\n    float innerGlowStrength = min(1.0, innerGlowAlpha);\n    \n    vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\n\n    float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\n    float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\n\n    vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;\n    \n    if (knockout) {\n      float resultAlpha = outerGlowAlpha + innerGlowAlpha;\n      gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\n    }\n    else {\n      gl_FragColor = innerColor + outerGlowColor;\n    }\n}\n".replace(/__ANGLE_STEP_SIZE__/gi,""+(1/u/n).toFixed(7)).replace(/__DIST__/gi,n.toFixed(0)+".0")),this.uniforms.glowColor=new Float32Array([0,0,0,1]),Object.assign(this,{color:a,outerStrength:o,innerStrength:s,padding:n,knockout:h})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={color:{configurable:!0},outerStrength:{configurable:!0},innerStrength:{configurable:!0},knockout:{configurable:!0}};return r.color.get=function(){return nt(this.uniforms.glowColor)},r.color.set=function(t){et(t,this.uniforms.glowColor)},r.outerStrength.get=function(){return this.uniforms.outerStrength},r.outerStrength.set=function(t){this.uniforms.outerStrength=t},r.innerStrength.get=function(){return this.uniforms.innerStrength},r.innerStrength.set=function(t){this.uniforms.innerStrength=t},r.knockout.get=function(){return this.uniforms.knockout},r.knockout.set=function(t){this.uniforms.knockout=t},Object.defineProperties(e.prototype,r),e}(Fr);
  /*!
   * @pixi/filter-glow - v3.1.0
   * Compiled Wed, 11 Mar 2020 20:38:18 UTC
   *
   * @pixi/filter-glow is licensed under the MIT License.
   * http://www.opensource.org/licenses/mit-license
   */function Ya(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}za.defaults={distance:10,outerStrength:4,innerStrength:0,color:16777215,quality:.1,knockout:!1};var Va=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,i;return e=t,i=[{key:"setup",value:function(t,e){t.interactive=!0;var r=new za(12,2,1,16751001,.5);t.on("mouseover",(function(){t.filters=[r]})).on("mouseout",(function(){t.filters=[]})).on("click",e)}}],(r=null)&&Ya(e.prototype,r),i&&Ya(e,i),t}();function Wa(t){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qa(t,e){return(qa=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ka(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Qa(t);if(e){var n=Qa(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Za(this,r)}}function Za(t,e){return!e||"object"!==Wa(e)&&"function"!=typeof e?Ja(t):e}function Ja(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qa(t){return(Qa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $a=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qa(t,e)}(r,t);var e=Ka(r);function r(t,i,n){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(o=e.call(this,t,i)).anchor.x=.5,Va.setup(Ja(o),n),o}return r}(Ba),th="72 pixie-font",eh="64px pixie-font",rh="48px pixie-font",ih="32px pixie-font",nh=["pop","die","fail","metal","pickup","extralife","invincibility","tada","whoosh"],oh=["hyperfun","dance_of_the_sugar_plum_fairy","frost_waltz"],sh=["AboutState","GameOverState","GameState","HintState","HowToState","PauseState","TitleState"];function ah(t){return(ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function uh(t,e){return(uh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=fh(t);if(e){var n=fh(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return ch(this,r)}}function ch(t,e){return!e||"object"!==ah(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function fh(t){return(fh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ph=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&uh(t,e)}(o,t);var e,r,i,n=lh(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTexts(),r}return e=o,(r=[{key:"createTexts",value:function(){var t=this,e=new Da;this.container.addChild(e);for(var r=["Pixie Perilousness! is an original concept from the","awesome tutorial Learn Pixi.js, available at","github.com/kittykatattack/learnPixiJS.","Please see","github.com/onewittygrassblade/pixi-js-pixie-perilousness","for full credits and source code."],i=35,n=0;n<r.length;n++){var o=new Ba(r[n],{font:ih});o.anchor.x=.5,o.y=i,i+=o.height+30,e.addChild(o)}var s=new $a("Back",{font:rh},(function(){t.stateStack.popState(),t.stateStack.pushState("TitleState")}));s.anchor.x=.5,s.y=392,e.addChild(s),e.x=455,e.y=256-e.height/2}}])&&hh(e.prototype,r),i&&hh(e,i),o}(Xa);function dh(t){return(dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function vh(t,e,r){return(vh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bh(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function mh(t,e){return(mh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=bh(t);if(e){var n=bh(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return _h(this,r)}}function _h(t,e){return!e||"object"!==dh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function bh(t){return(bh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mh(t,e)}(o,t);var e,r,i,n=gh(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTexts(e.gameStatus,e.score),"failure"===e.gameStatus?e.sounds.fail.play():e.sounds.tada.play(),r.context.musicPlayer.play("hyperfun"),r}return e=o,(r=[{key:"handleEvent",value:function(t){return vh(bh(o.prototype),"handleEvent",this).call(this,t),"keyup"===t.type&&32===t.keyCode&&(this.context.gameStatus="",this.context.level=0,this.context.score=0,this.stateStack.clearStates(),this.stateStack.pushState("TitleState")),!1}},{key:"createTexts",value:function(t,e){var r=new Da;this.container.addChild(r);var i=new Ba("Whoops!",{font:eh});"success"===t&&(i.text="Congratulations!"),i.anchor.x=.5,r.addChild(i);var n=i.height+40;if("success"===t){var o=new Da;r.addChild(o);var s=new Ba("You got Pixie home and collected ".concat(e," stars"),{font:ih});o.addChild(s);var a=new Fa(this.context.textures["pixie-0.png"]);a.x=s.width+10,a.y=-4,o.addChild(a),o.x-=o.width/2,o.y=n,n+=s.height+40;var h=new Da,u=new Ha.ColorMatrixFilter;u.desaturate(!1);var l=new Ha.ColorMatrixFilter;l.saturate(1,!1);for(var c=0;c<3;c++){var f=new Fa(this.context.textures["star.png"]);f.x=c*(f.width+10),f.filters=e<10*(c+1)+10?[u]:[l],h.addChild(f)}h.x-=h.width/2,h.y=n,r.addChild(h),n+=h.height+40}var p=new Ba("Press space to go back to menu",{font:ih});p.anchor.x=.5,p.y=n,r.addChild(p),r.x=455,r.y=256-r.height/2}}])&&yh(e.prototype,r),i&&yh(e,i),o}(Xa);function wh(t,e){return Math.floor(Math.random()*(e-t+1))+t}function Th(t,e){return Math.random()*(e-t)+t}function Eh(t){return(Eh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sh(t){return function(t){if(Array.isArray(t))return Ph(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Ph(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ph(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ph(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Oh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ah(t,e){return(Ah=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ch(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Rh(t);if(e){var n=Rh(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Ih(this,r)}}function Ih(t,e){return!e||"object"!==Eh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Rh(t){return(Rh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Mh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ah(t,e)}(o,t);var e,r,i,n=Ch(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=n.call(this)).create(t),e}return e=o,(r=[{key:"create",value:function(t){for(var e=4,r=0;r<15;r++){var i=new Da;this.addChild(i),i.x=384*r,i.gapSize=e;for(var n=0;n<8-e;n++){var o=new Fa(t);o.y=64*n,i.addChild(o);var s=new Fa(t);s.y=64*(n+8),i.addChild(s)}r>0&&r%5==0&&(e-=1)}}},{key:"getAllBlocks",value:function(){var t=[];return this.children.forEach((function(e){t.push.apply(t,Sh(e.children))})),t}},{key:"randomizeYPositions",value:function(){this.children.forEach((function(t){t.y=64*wh(0,8-t.gapSize)*-1}))}},{key:"randomizeYSpeeds",value:function(){this.children.forEach((function(t){t.vy=.06*(Math.random()<.5?-1:1)}))}},{key:"slide",value:function(t){this.children.forEach((function(e){e.y+=e.vy*t,(e.y>0||e.y<64*(8-e.gapSize)*-1)&&(e.vy*=-1)}))}},{key:"reset",value:function(){this.children.forEach((function(t){t.children.forEach((function(t){t.visible=!0}))})),this.randomizeYPositions(),this.randomizeYSpeeds()}}])&&Oh(e.prototype,r),i&&Oh(e,i),o}(Da);function Dh(t){return(Dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Nh(t,e){return(Nh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Uh(t);if(e){var n=Uh(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Fh(this,r)}}function Fh(t,e){return!e||"object"!==Dh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Uh(t){return(Uh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nh(t,e)}(o,t);var e,r,i,n=kh(o);function o(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(e=n.call(this)).create(t),e}return e=o,(r=[{key:"create",value:function(t){for(var e=0;e<15;e++){var r=new Fa(t);r.x=384*e+208,this.addChild(r)}}},{key:"randomizeYPositions",value:function(){this.children.forEach((function(t){t.y=wh(50,462)}))}},{key:"reset",value:function(){this.children.forEach((function(t){t.visible=!0})),this.randomizeYPositions()}}])&&Lh(e.prototype,r),i&&Lh(e,i),o}(Da);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Xh(t,e){return(Xh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Vh(t);if(e){var n=Vh(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Yh(this,r)}}function Yh(t,e){return!e||"object"!==Bh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Vh(t){return(Vh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xh(t,e)}(o,t);var e,r,i,n=zh(o);function o(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0;return Hh(this,o),(e=n.call(this,t)).x=r,e.y=i,e.vx=s,e.vy=a,e.ax=h,e.ay=u,e.halfWidth=e.width/2,e.halfHeight=e.height/2,e.anchor.set(.5,.5),e.anchorOffsetX=e.anchor.x*e.width,e.anchorOffsetY=e.anchor.y*e.height,e.rotation=l,e.rotationVelocity=c,e.rotationAcceleration=f,e.nodeChildren=[],e}return e=o,(r=[{key:"addNodeChild",value:function(t,e,r){this.nodeChildren.push(t),t.offsetX=e,t.offsetY=r}},{key:"updatePosition",value:function(t){var e=this;this.vx+=this.ax*t,this.x+=this.vx*t,this.vy+=this.ay*t,this.y+=this.vy*t,this.nodeChildren.forEach((function(t){t.x=e.x+t.offsetX,t.y=e.y+t.offsetY}))}},{key:"updateRotation",value:function(t){this.rotationVelocity+=this.rotationAcceleration*t,this.rotation+=this.rotationVelocity*t}}])&&Gh(e.prototype,r),i&&Gh(e,i),o}(ja);function qh(t){return(qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zh(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Jh(t,e){return(Jh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Qh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=tu(t);if(e){var n=tu(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return $h(this,r)}}function $h(t,e){return!e||"object"!==qh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function tu(t){return(tu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var eu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jh(t,e)}(o,t);var e,r,i,n=Qh(o);function o(t,e){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0;return Kh(this,o),r=n.call(this,t,s,a,h,u,0,l,0,c),i&&(r.width=i,r.height=i),r.totalFrames>0&&r.gotoAndStop(wh(0,r.totalFrames-1)),r.shrinkVelocity=f,r.lifetime=e,r.currentLifetime=0,r}return e=o,(r=[{key:"updateCurrent",value:function(t){this.updatePosition(t),this.updateRotation(t),this.scale.x-this.shrinkVelocity*t>0&&(this.scale.x-=this.shrinkVelocity*t),this.scale.y-this.shrinkVelocity*t>0&&(this.scale.y-=this.shrinkVelocity*t),this.alpha=1-this.currentLifetime/this.lifetime,this.currentLifetime+=t}}])&&Zh(e.prototype,r),i&&Zh(e,i),o}(Wh);function ru(t){return(ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function nu(t,e){return(nu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ou(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=au(t);if(e){var n=au(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return su(this,r)}}function su(t,e){return!e||"object"!==ru(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function au(t){return(au=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nu(t,e)}(o,t);var e,r,i,n=ou(o);function o(t,e,r,i,s,a){var h;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(h=n.call(this,t,e,r,0,0,0,3e-4)).animationSpeed=.4,h.invincible=!1,h.flapping=!1,h.weight=new Fa(i),h.weight.anchor.set(.5,.5),h.weight.visible=!1,h.addNodeChild(h.weight,0,35),h.balloon=new Fa(s),h.balloon.anchor.set(.5,.5),h.balloon.visible=!1,h.addNodeChild(h.balloon,0,-35),h.star=new eu([a],1e3),h.star.shrinkVelocity=-7e-4,h.star.visible=!1,h.addNodeChild(h.star,0,-45),h.glowFilter=new za(10,1.5,.5,16776421,.5),h.filterChangeTimer=0,h}return e=o,(r=[{key:"flapWings",value:function(){this.play(),this.flapping||(this.ay+=-.001,this.flapping=!0)}},{key:"stopFlapping",value:function(){this.gotoAndStop(0),this.flapping&&(this.ay-=-.001,this.flapping=!1)}},{key:"gainInvincibility",value:function(){this.invincible=!0,this.filters=[this.glowFilter]}},{key:"resetInvincibility",value:function(){this.invincible=!1,this.filters=null,this.filterChangeTimer=0}},{key:"gainWeight",value:function(){this.weight.visible=!0,this.ay+=25e-5}},{key:"resetWeight",value:function(){this.weight.visible=!1,this.ay-=25e-5}},{key:"gainBalloon",value:function(){this.balloon.visible=!0,this.ay+=-15e-5}},{key:"resetBalloon",value:function(){this.balloon.visible=!1,this.ay-=-15e-5}},{key:"resetProperties",value:function(){this.resetInvincibility(),this.flapping=!1,this.ay=3e-4,this.weight.visible=!1,this.balloon.visible=!1}},{key:"showStar",value:function(){this.star.width=20,this.star.height=20,this.star.visible=!0}},{key:"updateCurrent",value:function(t){this.updatePosition(t),this.star.visible&&(this.star.updateCurrent(t),this.star.currentLifetime>=this.star.lifetime&&(this.star.currentLifetime=0,this.star.visible=!1)),this.invincible&&(this.filterChangeTimer+=t,this.filterChangeTimer>75&&(this.glowFilter.outerStrength=Th(.8,1.8),this.filterChangeTimer-=75))}}])&&iu(e.prototype,r),i&&iu(e,i),o}(Wh);function uu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var lu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.particles=[],this.container=new La(15e3,{alpha:!0,scale:!0,rotation:!0,uvs:!0})}var e,r,i;return e=t,(r=[{key:"addParticle",value:function(t){this.particles.push(t),this.container.addChild(t)}},{key:"clear",value:function(){this.container.removeChildren(),this.particles=[]}},{key:"update",value:function(t){for(;this.particles.length>0&&this.particles[0].currentLifetime>=this.particles[0].lifetime;)this.container.removeChild(this.particles[0]),this.particles.shift();this.particles.forEach((function(e){e.updateCurrent(t)}))}}])&&uu(e.prototype,r),i&&uu(e,i),t}();function cu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var pu=function(){function t(e,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,h=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,c=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,f=arguments.length>11&&void 0!==arguments[11]?arguments[11]:1e3,p=arguments.length>12&&void 0!==arguments[12]?arguments[12]:1e3,d=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,y=arguments.length>14&&void 0!==arguments[14]?arguments[14]:6.28,v=!(arguments.length>15&&void 0!==arguments[15])||arguments[15],m=arguments.length>16&&void 0!==arguments[16]&&arguments[16],g=arguments.length>17&&void 0!==arguments[17]?arguments[17]:30,_=arguments.length>18&&void 0!==arguments[18]?arguments[18]:1;cu(this,t),this.textureFrames=e,this.minSize=r,this.maxSize=i,this.minInitialSpeed=n,this.maxInitialSpeed=o,this.minGravity=s,this.maxGravity=a,this.minRotationVelocity=h,this.maxRotationVelocity=u,this.minShrinkVelocity=l,this.maxShrinkVelocity=c,this.minLifetime=f,this.maxLifetime=p,this.minDirectionAngle=d,this.maxDirectionAngle=y,this.randomSpacing=v,this.emitting=m,this.emissionPeriod=1e3/g,this.accumulatedTime=0,this.numberOfParticlesPerEmit=_,this.particleSystem=new lu}var e,r,i;return e=t,(r=[{key:"emit",value:function(){this.emitting=!0}},{key:"stop",value:function(){this.emitting=!1,this.accumulatedTime=0}},{key:"burst",value:function(t,e,r){var i,n=(this.maxDirectionAngle-this.minDirectionAngle)/(t-1);this.randomSpacing||(i=this.minDirectionAngle);for(var o=0;o<t;o++){this.randomSpacing&&(i=Th(this.minDirectionAngle,this.maxDirectionAngle));var s=Th(this.minInitialSpeed,this.maxInitialSpeed);this.particleSystem.addParticle(new eu(this.textureFrames,wh(this.minLifetime,this.maxLifetime),wh(this.minSize,this.maxSize),e,r,s*Math.cos(i),s*Math.sin(i)*-1,Th(this.minGravity,this.maxGravity),Th(this.minRotationVelocity,this.maxRotationVelocity),Th(this.minShrinkVelocity,this.maxShrinkVelocity))),this.randomSpacing||(i+=n)}}},{key:"update",value:function(t){if(this.emitting)for(this.accumulatedTime+=t;this.accumulatedTime>this.emissionPeriod;)this.accumulatedTime-=this.emissionPeriod,this.burst(this.numberOfParticlesPerEmit);this.particleSystem.update(t)}}])&&fu(e.prototype,r),i&&fu(e,i),t}();function du(t){return(du="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function mu(t,e,r){return(mu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xu(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function gu(t,e){return(gu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=xu(t);if(e){var n=xu(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return bu(this,r)}}function bu(t,e){return!e||"object"!==du(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function xu(t){return(xu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gu(t,e)}(o,t);var e,r,i,n=_u(o);function o(t,e,r,i){var s,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,y=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,v=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,m=arguments.length>14&&void 0!==arguments[14]?arguments[14]:1e3,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1e3,_=arguments.length>16&&void 0!==arguments[16]?arguments[16]:0,b=arguments.length>17&&void 0!==arguments[17]?arguments[17]:6.28,x=!(arguments.length>18&&void 0!==arguments[18])||arguments[18],w=arguments.length>19&&void 0!==arguments[19]&&arguments[19],T=arguments.length>20&&void 0!==arguments[20]?arguments[20]:30,E=arguments.length>21&&void 0!==arguments[21]?arguments[21]:1;return yu(this,o),(s=n.call(this,t,e,r,u,l,c,f,p,d,y,v,m,g,_,b,x,w,T,E)).parent=i,s.offsetX=a,s.offsetY=h,s}return e=o,(r=[{key:"burst",value:function(t){mu(xu(o.prototype),"burst",this).call(this,t,this.parent.x+this.offsetX,this.parent.y+this.offsetY)}}])&&vu(e.prototype,r),i&&vu(e,i),o}(pu);function Tu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Eu=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.canvas=document.createElement("canvas"),this.canvas.width=e,this.canvas.height=r,this.ctx=this.canvas.getContext("2d")}var e,r,i;return e=t,(r=[{key:"renderGradient",value:function(t,e){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);var r=this.ctx.createRadialGradient(t,e,230,t,e,30);r.addColorStop(0,"white"),r.addColorStop(1,"black"),this.ctx.fillStyle=r,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.sprite?this.sprite.texture.update():this.sprite=new Fa(new Ma.from(this.canvas))}}])&&Tu(e.prototype,r),i&&Tu(e,i),t}();function Su(t){return(Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ou(t,e){return(Ou=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Au(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Iu(t);if(e){var n=Iu(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Cu(this,r)}}function Cu(t,e){return!e||"object"!==Su(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Iu(t){return(Iu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ou(t,e)}(o,t);var e,r,i,n=Au(o);function o(t,e,r,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(s=n.call(this)).beginFill(3363),s.drawRect(0,0,t,e),s.endFill(),s.light=new Eu(t,e),s.renderGradient(r,i),s.mask=s.light.sprite,s}return e=o,(r=[{key:"renderGradient",value:function(t,e){this.light.renderGradient(t,e)}}])&&Pu(e.prototype,r),i&&Pu(e,i),o}(Ra);function Mu(t){return(Mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Du(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Lu(t,e){return(Lu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Fu(t);if(e){var n=Fu(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return ku(this,r)}}function ku(t,e){return!e||"object"!==Mu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Fu(t){return(Fu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Lu(t,e)}(o,t);var e,r,i,n=Nu(o);function o(t,e,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(i=n.call(this,t,e,r,Th(-.15,-.22),Th(.15,.2),0,0)).anchor.set(.5,.5),i.rotation=Th(0,6.28),i}return e=o,(r=[{key:"updateCurrent",value:function(t){this.updatePosition(t)}}])&&Du(e.prototype,r),i&&Du(e,i),o}(Wh);function ju(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Bu=function(){function t(e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e,this.textureFrames=r,this.frequency=i,this.timer=0,this.iceShards=[]}var e,r,i;return e=t,(r=[{key:"update",value:function(t){if(this.timer+=t,this.iceShards.forEach((function(e){e.updateCurrent(t)})),this.timer>this.frequency){var e=new Uu(this.textureFrames,Th(455,682.5),0);this.iceShards.push(e),this.container.addChild(e),this.timer=0}}},{key:"reset",value:function(){var t=this;this.iceShards.forEach((function(e){t.container.removeChild(e)})),this.iceShards=[],this.timer=0}}])&&ju(e.prototype,r),i&&ju(e,i),t}();function Hu(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.halfWidth||(t.halfWidth=t.width/2),t.halfHeight||(t.halfHeight=t.height/2),t.anchorOffsetX||(t.anchorOffsetX=t.anchor.x*t.width),t.anchorOffsetY||(t.anchorOffsetY=t.anchor.y*t.height),e.halfWidth||(e.halfWidth=e.width/2),e.halfHeight||(e.halfHeight=e.height/2),e.anchorOffsetX||(e.anchorOffsetX=e.anchor.x*e.width),e.anchorOffsetY||(e.anchorOffsetY=e.anchor.y*e.height),r?(t.centerX=t.getGlobalPosition().x+t.halfWidth-t.anchorOffsetX,t.centerY=t.getGlobalPosition().y+t.halfHeight-t.anchorOffsetY,e.centerX=e.getGlobalPosition().x+e.halfWidth-e.anchorOffsetX,e.centerY=e.getGlobalPosition().y+e.halfHeight-e.anchorOffsetY):(t.centerX=t.x+t.halfWidth-t.anchorOffsetX,t.centerY=t.y+t.halfHeight-t.anchorOffsetY,e.centerX=e.x+e.halfWidth-e.anchorOffsetX,e.centerY=e.y+e.halfHeight-e.anchorOffsetY),Math.abs(t.centerX-e.centerX)<t.halfWidth+e.halfWidth&&Math.abs(t.centerY-e.centerY)<t.halfHeight+e.halfHeight}function Gu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Xu=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.timers=[]}var e,r,i;return e=t,(r=[{key:"setTimeout",value:function(t,e){this.timers.push({time:0,finalTime:e,callback:t})}},{key:"update",value:function(t){var e=this;this.timers.forEach((function(r){r.time<r.finalTime?r.time+=t:(r.callback(),e.timers.splice(e.timers.indexOf(r),1))}))}},{key:"clear",value:function(){this.timers=[]}}])&&Gu(e.prototype,r),i&&Gu(e,i),t}();function zu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Yu=function(){function t(e,r,i,n,o){var s=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e,this.textures=i,this.sounds=n,this.levelData=o,this.pixieHasCrashed=!1,this.hasAlivePlayer=!0,this.playerHasReachedEnd=!1,this.numberOfLives=3,this.timeManager=new Xu,this.numberOfStars=0,this.numberOfStarsForLevel=0,this.layers={foreground:new Da,player:new Da,weatherEffect:new Da,infoDisplay:new Da},this.background=r,this.createForeground(),this.createPixie(),this.createNight(),this.createInfoDisplay(),this.createPickUpActions(),Object.keys(this.layers).forEach((function(t){s.container.addChild(s.layers[t])})),this.iceShardsManager=new Bu(this.layers.weatherEffect,[this.textures["ice-shard.png"]],3e3)}var e,r,i;return e=t,(r=[{key:"createForeground",value:function(){this.createPillars(this.textures["green-block.png"]),this.createPickUps(this.textures["gift.png"]),this.createFinish()}},{key:"createPillars",value:function(t){this.pillars=new Mh(t),this.pillars.x=512,this.layers.foreground.addChild(this.pillars),this.pillars.randomizeYPositions(),this.pillars.randomizeYSpeeds()}},{key:"createPickUps",value:function(t){this.pickUps=new jh(t),this.pickUps.x=512,this.layers.foreground.addChild(this.pickUps),this.pickUps.randomizeYPositions()}},{key:"createFinish",value:function(){this.finish=new Ba("To next level!",{font:th}),this.finish.x=6272,this.finish.y=192,this.layers.foreground.addChild(this.finish)}},{key:"createPixie",value:function(){this.pixie=new hu([this.textures["pixie-0.png"],this.textures["pixie-1.png"],this.textures["pixie-2.png"]],232,256,this.textures["weight.png"],this.textures["balloon.png"],this.textures["star.png"]),this.pixieEmitter=new wu([this.textures["pink.png"],this.textures["yellow.png"],this.textures["green.png"],this.textures["violet.png"]],18,24,this.pixie,0,16,0,.1,1e-4,3e-4,-.00628,.00628,1e-4,5e-4,500,2e3,3.5,5.1,!0,!1,10,3),this.layers.player.addChild(this.pixieEmitter.particleSystem.container),this.layers.player.addChild(this.pixie.weight),this.layers.player.addChild(this.pixie.balloon),this.layers.player.addChild(this.pixie.star),this.layers.player.addChild(this.pixie)}},{key:"createNight",value:function(){this.night=new Ru(910,512,this.pixie.x,this.pixie.y),this.layers.weatherEffect.addChild(this.night),this.levelData.night||(this.night.visible=!1)}},{key:"createInfoDisplay",value:function(){this.livesContainer=new Da,this.layers.infoDisplay.addChild(this.livesContainer);for(var t=0;t<this.numberOfLives;t++){var e=new Fa(this.textures["pixie-0.png"]);e.x=t*(e.width+10),this.livesContainer.addChild(e)}this.livesContainer.x=910-this.livesContainer.width;var r=new Da;this.layers.infoDisplay.addChild(r);var i=new Fa(this.textures["star.png"]);i.width=33,i.height=32,r.addChild(i),this.numberOfStarsText=new Ba(this.numberOfStars.toString(),{font:ih}),this.numberOfStarsText.x=46,this.numberOfStarsText.y=6,r.addChild(this.numberOfStarsText),r.x=822,r.y=40}},{key:"resetAfterCrash",value:function(){this.resetWorld(),this.pixie.visible=!0,this.pixieHasCrashed=!1,this.hasAlivePlayer=!0}},{key:"resetForNextLevel",value:function(){this.resetWorld(),this.playerHasReachedEnd=!1}},{key:"resetWorld",value:function(){this.resetPixie(),this.resetScene(),this.resetEmitter(),this.resetPickUpActions(),this.timeManager.clear()}},{key:"resetPixie",value:function(){this.pixie.stopFlapping(),this.pixie.vy=0,this.pixie.y=256,this.pixie.resetProperties()}},{key:"resetScene",value:function(){this.layers.foreground.x=0,this.pillars.reset(),this.pickUps.reset(),this.numberOfStarsText.text=this.numberOfStars.toString(),this.levelData.night?(this.night.visible=!0,this.night.renderGradient(this.pixie.x,this.pixie.y)):this.night.visible=!1,this.iceShardsManager.reset(),this.levelData.winter?this.background.winterize():this.background.summerize()}},{key:"resetEmitter",value:function(){this.pixieEmitter.stop(),this.pixieEmitter.particleSystem.clear(),this.pixieEmitter.minInitialSpeed=0,this.pixieEmitter.maxInitialSpeed=.1,this.pixieEmitter.minDirectionAngle=2.4,this.pixieEmitter.maxDirectionAngle=3.6}},{key:"createPickUpActions",value:function(){var t=[{action:this.gainLife.bind(this),weight:1},{action:this.gainInvincibility.bind(this),weight:1},{action:this.gainWeight.bind(this),weight:1},{action:this.gainBalloon.bind(this),weight:1},{action:this.gainStar.bind(this),weight:8}];this.pickUpActions=[];for(var e=0;e<t.length;e++)for(var r=0;r<t[e].weight;r++)this.pickUpActions.push(t[e].action)}},{key:"resetPickUpActions",value:function(){this.pickUpActions[1]=this.gainInvincibility.bind(this),this.pickUpActions[2]=this.gainWeight.bind(this),this.pickUpActions[3]=this.gainBalloon.bind(this)}},{key:"gainLife",value:function(){var t=new Fa(this.textures["pixie-0.png"]);t.x=this.numberOfLives*(t.width+10),this.livesContainer.addChild(t),this.livesContainer.x=910-this.livesContainer.width,this.numberOfLives+=1,this.sounds.extralife.play(),5===this.numberOfLives&&(this.pickUpActions[0]=this.gainStar.bind(this))}},{key:"loseLife",value:function(){this.livesContainer.removeChildAt(this.livesContainer.children.length-1),this.livesContainer.x=910-this.livesContainer.width,this.numberOfLives-=1,this.pickUpActions[0]=this.gainLife.bind(this)}},{key:"hasLives",value:function(){return this.numberOfLives>0}},{key:"gainInvincibility",value:function(){var t=this;this.pixie.gainInvincibility(),this.sounds.invincibility.play(),this.pickUpActions[1]=this.gainStar.bind(this),this.timeManager.setTimeout((function(){t.pixie.resetInvincibility(),t.pickUpActions[1]=t.gainInvincibility.bind(t)}),8e3)}},{key:"gainWeight",value:function(){var t=this;this.pixie.gainWeight(),this.sounds.metal.play(),this.pickUpActions[2]=this.gainStar.bind(this),this.pickUpActions[3]=this.gainStar.bind(this),this.timeManager.setTimeout((function(){t.pixie.resetWeight(),t.pickUpActions[2]=t.gainWeight.bind(t),t.pickUpActions[3]=t.gainBalloon.bind(t)}),8e3)}},{key:"gainBalloon",value:function(){var t=this;this.pixie.gainBalloon(),this.sounds.whoosh.play(),this.pickUpActions[2]=this.gainStar.bind(this),this.pickUpActions[3]=this.gainStar.bind(this),this.timeManager.setTimeout((function(){t.pixie.resetBalloon(),t.pickUpActions[2]=t.gainWeight.bind(t),t.pickUpActions[3]=t.gainBalloon.bind(t)}),8e3)}},{key:"gainStar",value:function(){this.pixie.showStar(),this.sounds.pickup.play(),this.numberOfStarsForLevel+=1,this.numberOfStarsText.text=(this.numberOfStars+this.numberOfStarsForLevel).toString()}},{key:"handleEvent",value:function(t){if(!this.pixieHasCrashed&&32===t.keyCode)switch(t.type){case"keydown":this.pixie.flapWings(),this.pixieEmitter.emit();break;case"keyup":this.pixie.stopFlapping(),this.pixieEmitter.stop()}}},{key:"update",value:function(t){this.scroll(t),this.pixieHasCrashed||(this.pixie.updateCurrent(t),this.levelData.night&&this.night.renderGradient(this.pixie.x,this.pixie.y)),this.pixieEmitter.update(t),this.timeManager.update(t),this.levelData.sliding&&this.pillars.slide(t),this.levelData.winter&&this.iceShardsManager.update(t),this.containPixie(),this.pixie.visible&&this.checkCollisions()}},{key:"scroll",value:function(t){this.background.updateCurrent(.04,t),this.finish.getGlobalPosition().x>220&&(this.layers.foreground.x-=.08*t)}},{key:"containPixie",value:function(){var t,e,r,i=(t=this.pixie,e={x:0,y:0,width:910,height:512},r=new Set,t.anchorOffsetX||(t.anchorOffsetX=t.anchor.x*t.width),t.anchorOffsetY||(t.anchorOffsetY=t.anchor.y*t.height),t.x-t.anchorOffsetX<e.x&&(t.x=e.x,r.add("left")),t.x+t.width-t.anchorOffsetX>e.x+e.width&&(t.x=e.x+e.width-t.width+t.anchorOffsetX,r.add("right")),t.y-t.anchorOffsetY<e.y&&(t.y=e.y+t.anchorOffsetY,r.add("top")),t.y+t.height-t.anchorOffsetY>e.y+e.height&&(t.y=e.y+e.height-t.height+t.anchorOffsetY,r.add("bottom")),0===r.size&&(r=void 0),r);i&&(i.has("bottom")||i.has("top"))&&(this.pixie.vy=0)}},{key:"checkCollisions",value:function(){var t=this,e=this.pillars.getAllBlocks().find((function(e){return e.visible&&Hu(t.pixie,e,!0)}));e&&(this.pixie.invincible?(e.visible=!1,this.sounds.pop.play()):this.pixieHasCrashed=!0);var r=this.iceShardsManager.iceShards.find((function(e){return e.visible&&Hu(t.pixie,e,!0)}));r&&(this.pixie.invincible?(r.visible=!1,this.sounds.pop.play()):this.pixieHasCrashed=!0),this.pixieHasCrashed&&(this.pixieExplosion(),this.timeManager.setTimeout((function(){t.loseLife(),t.hasAlivePlayer=!1}),1e3),this.numberOfStarsForLevel=0),this.pickUps.children.forEach((function(e){e.visible&&Hu(t.pixie,e,!0)&&(e.visible=!1,t.pickUpActions[wh(0,11)]())})),Hu(this.pixie,this.finish,!0)&&(this.resetPixie(),this.playerHasReachedEnd=!0,this.numberOfStars+=this.numberOfStarsForLevel,this.numberOfStarsForLevel=0)}},{key:"pixieExplosion",value:function(){this.sounds.die.play(),this.pixie.resetProperties(),this.pixie.visible=!1,this.emitterExplosion()}},{key:"emitterExplosion",value:function(){this.pixieEmitter.stop(),this.pixieEmitter.minInitialSpeed=.1,this.pixieEmitter.maxInitialSpeed=.3,this.pixieEmitter.minDirectionAngle=0,this.pixieEmitter.maxDirectionAngle=6.28,this.pixieEmitter.burst(50)}},{key:"setFinishTextForFinalLevel",value:function(){this.finish.text="To home!"}}])&&zu(e.prototype,r),i&&zu(e,i),t}(),Vu=[{hint:"Hello Pixie!",music:"hyperfun",world:{sliding:!1,night:!1,winter:!1}},{hint:"Sliding pillars!",music:"hyperfun",world:{sliding:!0,night:!1,winter:!1}},{hint:"Night time",music:"dance_of_the_sugar_plum_fairy",world:{sliding:!1,night:!0,winter:!1}},{hint:"Winter!",music:"frost_waltz",world:{sliding:!1,night:!1,winter:!0}}];function Wu(t){return(Wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qu(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ku(t,e,r){return(Ku="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$u(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function Zu(t,e){return(Zu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ju(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=$u(t);if(e){var n=$u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Qu(this,r)}}function Qu(t,e){return!e||"object"!==Wu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $u(t){return($u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var tl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zu(t,e)}(o,t);var e,r,i,n=Ju(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).context.gameStatus="running",r.world=new Yu(r.container,e.background,e.textures,e.sounds,Vu[0].world),r}return e=o,(r=[{key:"handleEvent",value:function(t){return Ku($u(o.prototype),"handleEvent",this).call(this,t),this.world.handleEvent(t),"keyup"===t.type&&27===t.keyCode&&(this.world.pixie.stopFlapping(),this.world.pixieEmitter.stop(),this.stateStack.pushState("PauseState")),!1}},{key:"update",value:function(t){return this.world.update(t),this.world.hasAlivePlayer||(this.world.hasLives()?(this.world.resetAfterCrash(),this.stateStack.pushState("HintState")):(this.context.gameStatus="failure",this.gameOver())),this.world.playerHasReachedEnd&&(this.context.level+=1,this.context.sounds.tada.play(),this.context.level<Vu.length?(this.world.levelData=Vu[this.context.level].world,this.world.resetForNextLevel(),this.context.level===Vu.length-1&&this.world.setFinishTextForFinalLevel(),this.context.musicPlayer.play(Vu[this.context.level].music),this.stateStack.pushState("HintState")):(this.context.gameStatus="success",this.context.score=this.world.numberOfStars,this.gameOver())),!1}},{key:"gameOver",value:function(){this.context.background.summerize(),this.stateStack.popState(),this.stateStack.pushState("GameOverState")}}])&&qu(e.prototype,r),i&&qu(e,i),o}(Xa);function el(t){return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function il(t,e,r){return(il="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=al(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function nl(t,e){return(nl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ol(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=al(t);if(e){var n=al(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return sl(this,r)}}function sl(t,e){return!e||"object"!==el(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function al(t){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nl(t,e)}(o,t);var e,r,i,n=ol(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTexts(Vu[e.level].hint),r}return e=o,(r=[{key:"handleEvent",value:function(t){return il(al(o.prototype),"handleEvent",this).call(this,t),"keyup"===t.type&&32===t.keyCode&&this.stateStack.popState(),!1}},{key:"createTexts",value:function(t){var e=new Ba(t,{font:eh});e.anchor.x=.5,this.container.addChild(e);var r=new Ba("Press space to start",{font:ih});r.anchor.x=.5,r.y=e.y+e.height+40,this.container.addChild(r),this.container.x=455,this.container.y=256-this.container.height/2}}])&&rl(e.prototype,r),i&&rl(e,i),o}(Xa);function ul(t){return(ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ll(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function cl(t,e){return(cl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=dl(t);if(e){var n=dl(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return pl(this,r)}}function pl(t,e){return!e||"object"!==ul(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function dl(t){return(dl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cl(t,e)}(o,t);var e,r,i,n=fl(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTexts(),r}return e=o,(r=[{key:"createTexts",value:function(){var t=this,e=new Da;this.container.addChild(e);for(var r=[{text:"Help Pixie get home!",sprite:null,yOffset:50},{text:"Press space to make Pixie flap her wings",sprite:new Fa(this.context.textures["pixie-0.png"]),yOffset:50},{text:"Avoid the green blocks",sprite:new Fa(this.context.textures["green-block.png"]),yOffset:80},{text:"Pick up presents to get surprises",sprite:new Fa(this.context.textures["gift.png"]),yOffset:100}],i=35,n=0;n<r.length;n++){var o=new Ba(r[n].text,{font:ih});if(r[n].sprite){o.x=r[n].sprite.width+20,o.y=r[n].sprite.height/2-o.height/2;var s=new Da;s.addChild(r[n].sprite),s.addChild(o),s.x=455-s.width/2,s.y=i,e.addChild(s)}else o.x=455-o.width/2,o.y=i,e.addChild(o);i+=o.height+r[n].yOffset}var a=new $a("Back",{font:rh},(function(){t.stateStack.popState(),t.stateStack.pushState("TitleState")}));a.x=455,a.y=392,e.addChild(a),e.y=256-e.height/2}}])&&ll(e.prototype,r),i&&ll(e,i),o}(Xa);function vl(t){return(vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ml(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function gl(t,e,r){return(gl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wl(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function _l(t,e){return(_l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function bl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=wl(t);if(e){var n=wl(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return xl(this,r)}}function xl(t,e){return!e||"object"!==vl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function wl(t){return(wl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Tl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_l(t,e)}(o,t);var e,r,i,n=bl(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTexts(),r.context.musicPlayer.togglePause(!0),r}return e=o,(r=[{key:"handleEvent",value:function(t){return gl(wl(o.prototype),"handleEvent",this).call(this,t),"keyup"===t.type&&27===t.keyCode&&(this.stateStack.popState(),this.context.musicPlayer.togglePause(!1)),!1}},{key:"createTexts",value:function(){var t=new Ba("Game paused",{font:eh});t.anchor.x=.5,this.container.addChild(t);var e=new Ba("Press ESC to resume",{font:ih});e.anchor.x=.5,e.y=t.y+t.height+40,this.container.addChild(e),this.container.x=455,this.container.y=256-this.container.height/2}}])&&ml(e.prototype,r),i&&ml(e,i),o}(Xa);function El(t){return(El="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Pl(t,e){return(Pl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ol(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Cl(t);if(e){var n=Cl(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return Al(this,r)}}function Al(t,e){return!e||"object"!==El(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Cl(t){return(Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Il=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pl(t,e)}(o,t);var e,r,i,n=Ol(o);function o(t,e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),(r=n.call(this,t,e)).createTitle(),r.createMenu(),r.context.musicPlayer.play("hyperfun"),r}return e=o,(r=[{key:"createTitle",value:function(){var t=new Ba("Pixie Perilousness!",{font:th});t.x=455-t.width/2,t.y=120,this.container.addChild(t)}},{key:"createMenu",value:function(){var t=this,e=new Da;e.x=455-e.width/2,e.y=256-e.height/2,this.container.addChild(e);var r=[{title:"Play",callback:this.startGame.bind(this)},{title:"How to play",callback:function(){t.stateStack.popState(),t.stateStack.pushState("HowToState")}},{title:"About",callback:function(){t.stateStack.popState(),t.stateStack.pushState("AboutState")}}],i=0;r.forEach((function(t){var r=new $a(t.title,{font:rh},t.callback);r.y=i,i+=r.height+20,e.addChild(r)}))}},{key:"startGame",value:function(){this.stateStack.popState(),this.stateStack.pushState("GameState"),this.stateStack.pushState("HintState")}}])&&Sl(e.prototype,r),i&&Sl(e,i),o}(Xa);function Rl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ml=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.topics={}}var e,r,i;return e=t,(r=[{key:"subscribe",value:function(t,e){var r=this;this.topics.topic||(this.topics[t]=[]);var i=this.topics[t].push(e)-1;return function(){return delete r.topics[t][i]}}},{key:"publish",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];this.topics[t]&&this.topics[t].forEach((function(t){t.apply(void 0,r)}))}}])&&Rl(e.prototype,r),i&&Rl(e,i),t}());function Dl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ll={AboutState:ph,GameOverState:xh,GameState:tl,HintState:hl,HowToState:yl,PauseState:Tl,TitleState:Il},Nl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.stack=[],this.pendingList=[],this.stateFactories=new Map}var e,r,i;return e=t,(r=[{key:"registerState",value:function(t){var e=this;this.stateFactories.set(t,(function(){return new Ll[t](e,e.context)}))}},{key:"createState",value:function(t){return this.stateFactories.get(t)()}},{key:"pushState",value:function(t){this.pendingList.push({action:"push",stateName:t})}},{key:"popState",value:function(){this.pendingList.push({action:"pop"})}},{key:"clearStates",value:function(){this.pendingList.push({action:"clear"})}},{key:"applyPendingChanges",value:function(){var t=this;this.pendingList.forEach((function(e){switch(e.action){case"push":t.stack.push(t.createState(e.stateName)),Ml.publish("pushState");break;case"pop":t.context.stage.removeChild(t.stack.pop().container);break;case"clear":for(;t.stack.length;)t.context.stage.removeChild(t.stack.pop().container)}})),this.pendingList=[]}},{key:"handleEvent",value:function(t){for(var e=this.stack.length-1;e>=0&&this.stack[e].handleEvent(t);e--);}},{key:"update",value:function(t){for(var e=this.stack.length-1;e>=0&&this.stack[e].update(t);e--);this.applyPendingChanges()}}])&&Dl(e.prototype,r),i&&Dl(e,i),t}();function kl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Fl=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.musics=e,this.playing=null,this.muted=!1}var e,r,i;return e=t,(r=[{key:"play",value:function(t){this.playing?this.playing&&this.playing!==this.musics[t]&&(this.playing.stop(),this.startPlaying(t)):this.startPlaying(t)}},{key:"startPlaying",value:function(t){this.playing=this.musics[t],this.playing.muted=this.muted,this.playing.play({loop:!0})}},{key:"togglePause",value:function(t){t?this.playing.pause():this.playing.resume()}},{key:"toggleMuted",value:function(){this.muted=!this.muted,this.playing.muted=this.muted}},{key:"isMuted",value:function(){return this.playing.muted}}])&&kl(e.prototype,r),i&&kl(e,i),t}();function Ul(t){return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Hl(t,e,r){return(Hl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yl(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(r):n.value}})(t,e,r||t)}function Gl(t,e){return(Gl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Yl(t);if(e){var n=Yl(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return zl(this,r)}}function zl(t,e){return!e||"object"!==Ul(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yl(t){return(Yl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gl(t,e)}(o,t);var e,r,i,n=Xl(o);function o(t,e,r,i,s,a,h){var u,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,p=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,y=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0,v=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0,m=arguments.length>14&&void 0!==arguments[14]?arguments[14]:0,g=arguments.length>15&&void 0!==arguments[15]?arguments[15]:1e3,_=arguments.length>16&&void 0!==arguments[16]?arguments[16]:1e3,b=arguments.length>17&&void 0!==arguments[17]?arguments[17]:0,x=arguments.length>18&&void 0!==arguments[18]?arguments[18]:6.28,w=!(arguments.length>19&&void 0!==arguments[19])||arguments[19],T=arguments.length>20&&void 0!==arguments[20]&&arguments[20],E=arguments.length>21&&void 0!==arguments[21]?arguments[21]:30,S=arguments.length>22&&void 0!==arguments[22]?arguments[22]:1;return jl(this,o),(u=n.call(this,t,e,r,l,c,f,p,d,y,v,m,g,_,b,x,w,T,E,S)).minX=i,u.maxX=s,u.minY=a,u.maxY=h,u}return e=o,(r=[{key:"burst",value:function(t){Hl(Yl(o.prototype),"burst",this).call(this,t,wh(this.minX,this.maxX),wh(this.minY,this.maxY))}}])&&Bl(e.prototype,r),i&&Bl(e,i),o}(pu);function Wl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var ql=function(){function t(e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=new Da,this.sprite=new Ua(e,r,i),this.container.addChild(this.sprite),this.colorMatrix=new Ha.ColorMatrixFilter,this.colorMatrix.saturate(-.5,!1);var n=new Ra;n.beginFill(16777215),n.drawCircle(0,0,18),n.endFill(),this.emitter=new Vl([n.generateCanvasTexture()],4,10,0,r,0,0,.15,.25,0,0,0,0,0,0,1e4,1e4,4.2,4.2,!1,!1,9,1),this.container.addChild(this.emitter.particleSystem.container)}var e,r,i;return e=t,(r=[{key:"winterize",value:function(){this.sprite.filters=[this.colorMatrix],this.emitter.emit()}},{key:"summerize",value:function(){this.sprite.filters=[],this.emitter.stop()}},{key:"updateCurrent",value:function(t,e){this.sprite.tilePosition.x-=t*e,this.emitter.update(e)}}])&&Wl(e.prototype,r),i&&Wl(e,i),t}();function Kl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#2C3539",r=(window.innerWidth-t.offsetWidth)/2,i=(window.innerHeight-t.offsetHeight)/2;t.style.margin="".concat(i,"px ").concat(r,"px"),document.body.style.backgroundColor=e}function Zl(t){return(Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jl(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ql(t,e,r){return e&&Jl(t.prototype,e),r&&Jl(t,r),t}function $l(t,e){return($l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=rc(t);if(e){var n=rc(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return ec(this,r)}}function ec(t,e){return!e||"object"!==Zl(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function rc(t){return(rc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$l(t,e)}(r,t);var e=tc(r);function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),e.call(this,{width:910,height:512})}return Ql(r,null,[{key:"loadAssets",value:function(){return new Promise((function(t,e){nh.forEach((function(t){Na.add(t,"sounds/".concat(t,".mp3"))})),oh.forEach((function(t){Na.add(t,"music/".concat(t,".mp3"))})),Na.add("images/pixie-perilousness.json").add("fonts/pixie-font.fnt").on("error",e).load(t)}))}}]),Ql(r,[{key:"boot",value:function(){var t=this;document.getElementById("root").appendChild(this.view),Kl(this.view),window.addEventListener("resize",(function(){Kl(t.view)})),nh.forEach((function(t){Na.add(t,"sounds/".concat(t,".mp3"))})),oh.forEach((function(t){Na.add(t,"music/".concat(t,".mp3"))})),Na.add("images/pixie-perilousness.json").add("fonts/pixie-font.fnt").load(this.handleLoadComplete.bind(this)),Na.onError.add((function(){console.err("Loading error")}))}},{key:"handleLoadComplete",value:function(){var t=this;this.events=[],window.addEventListener("keydown",(function(e){return t.events.push(e)}),!1),window.addEventListener("keyup",(function(e){return t.events.push(e)}),!1);var e=ka["images/pixie-perilousness.json"].textures,r=nh.reduce((function(t,e){return t[e]=ka[e].sound,t}),{}),i=oh.reduce((function(t,e){return t[e]=ka[e].sound,t}),{}),n=new ql(e["clouds.png"],910,512);this.stage.addChild(n.container);var o={stage:this.stage,textures:e,background:n,sounds:r,musicPlayer:new Fl(i),gameStatus:"",level:0,score:0};this.stateStack=new Nl(o),sh.forEach((function(e){t.stateStack.registerState(e)}));var s=new Fa(o.textures["volume-loud.png"]);Va.setup(s,(function(){var t;o.musicPlayer.toggleMuted(),t=o.musicPlayer.isMuted()?"mute":"loud",s.texture=o.textures["volume-".concat(t,".png")]})),s.position.set(10),Ml.subscribe("pushState",(function(){t.stage.addChild(s)})),this.ticker.add((function(e){t.processInput(),t.stateStack.update(1e3*e/60)})),this.stateStack.pushState("TitleState")}},{key:"processInput",value:function(){for(;this.events.length;)this.stateStack.handleEvent(this.events[0]),this.events.shift()}}]),r}(Ia))).boot()}]);