=d)u-=d,l-=d,c=5,h=null,m=m&&m.removeBefore(r,0,u);else if(u>o||d>>c&i;if(_!==d>>>c&i)break;_&&(f+=(1<o&&(h=h.removeBefore(r,c,u-f)),h&&d>>5<<5}var dn,vn=function(t){function e(t){return null===t||void 0===t?yn():at(t)?t:yn().withMutations((function(e){var n=E(t);qt(n.size),n.forEach((function(t,n){return e.set(n,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):yn()},e.prototype.set=function(t,e){return gn(this,t,e)},e.prototype.remove=function(t){return gn(this,t,o)},e.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},e.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],n)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?mn(e,n,t,this.__hash):0===this.size?yn():(this.__ownerID=t,this._map=e,this._list=n,this)},e}(Ae);function mn(t,e,n,r){var i=Object.create(vn.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function yn(){return dn||(dn=mn(He(),un()))}function gn(t,e,n){var i,a,s=t._map,u=t._list,l=s.get(e),c=void 0!==l;if(n===o){if(!c)return t;u.size>=r&&u.size>=2*s.size?(i=(a=u.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(i.__ownerID=a.__ownerID=t.__ownerID)):(i=s.remove(e),a=l===u.size-1?u.pop():u.set(l,void 0))}else if(c){if(n===u.get(l)[1])return t;i=s,a=u.set(l,[e,n])}else i=s.set(e,u.size),a=u.set(u.size,[e,n]);return t.__ownerID?(t.size=i.size,t._map=i,t._list=a,t.__hash=void 0,t):mn(i,a)}vn.isOrderedMap=at,vn.prototype[M]=!0,vn.prototype.delete=vn.prototype.remove;var bn="@@__IMMUTABLE_STACK__@@";function _n(t){return Boolean(t&&t[bn])}var xn=function(t){function e(t){return null===t||void 0===t?Sn():_n(t)?t:Sn().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var n=this._head;for(t=l(this,t);n&&t--;)n=n.next;return n?n.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:t[r],next:n};return this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):En(e,n)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&_n(e))return e;qt(e.size);var n=this.size,r=this._head;return e.__iterate((function(t){n++,r={value:t,next:r}}),!0),this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):En(n,r)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Sn()},e.prototype.slice=function(e,n){if(h(e,n,this.size))return this;var r=f(e,this.size);if(p(n,this.size)!==this.size)return t.prototype.slice.call(this,e,n);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):En(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?En(this.size,this._head,t,this.__hash):0===this.size?Sn():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var n=this;if(e)return new Q(this.toArray()).__iterate((function(e,r){return t(e,r,n)}),e);for(var r=0,i=this._head;i&&!1!==t(i.value,r++,this);)i=i.next;return r},e.prototype.__iterator=function(t,e){if(e)return new Q(this.toArray()).__iterator(t,e);var n=0,r=this._head;return new F((function(){if(r){var e=r.value;return r=r.next,U(t,n++,e)}return{value:void 0,done:!0}}))},e}(S);xn.isStack=_n;var wn,Tn=xn.prototype;function En(t,e,n,r){var i=Object.create(Tn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Sn(){return wn||(wn=En(0))}Tn[bn]=!0,Tn.shift=Tn.pop,Tn.unshift=Tn.push,Tn.unshiftAll=Tn.pushAll,Tn.withMutations=Pe,Tn.wasAltered=Ce,Tn.asImmutable=Ie,Tn["@@transducer/init"]=Tn.asMutable=Oe,Tn["@@transducer/step"]=function(t,e){return t.unshift(e)},Tn["@@transducer/result"]=function(t){return t.asImmutable()};var Pn="@@__IMMUTABLE_SET__@@";function On(t){return Boolean(t&&t[Pn])}function In(t){return On(t)&&R(t)}function Cn(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||b(t)!==b(e)||x(t)!==x(e)||R(t)!==R(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!w(t);if(R(t)){var r=t.entries();return e.every((function(t,e){var i=r.next().value;return i&&ut(i[1],t)&&(n||ut(i[0],e))}))&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"===typeof t.cacheResult&&t.cacheResult();else{i=!0;var a=t;t=e,e=a}var s=!0,u=e.__iterate((function(e,r){if(n?!t.has(e):i?!ut(e,t.get(r,o)):!ut(t.get(r,o),e))return s=!1,!1}));return s&&t.size===u}function An(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function kn(t){if(!t||"object"!==typeof t)return t;if(!y(t)){if(!$t(t))return t;t=V(t)}if(b(t)){var e={};return t.__iterate((function(t,n){e[n]=kn(t)})),e}var n=[];return t.__iterate((function(t){n.push(kn(t))})),n}var Mn=function(t){function e(e){return null===e||void 0===e?Fn():On(e)&&!R(e)?e:Fn().withMutations((function(n){var r=t(e);qt(r.size),r.forEach((function(t){return n.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(E(t).keySeq())},e.intersect=function(t){return(t=T(t).toArray()).length?Dn.intersect.apply(e(t.pop()),t):Fn()},e.union=function(t){return(t=T(t).toArray()).length?Dn.union.apply(e(t.pop()),t):Fn()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Nn(this,this._map.set(t,t))},e.prototype.remove=function(t){return Nn(this,this._map.remove(t))},e.prototype.clear=function(){return Nn(this,this._map.clear())},e.prototype.map=function(t,e){var n=this,r=[],i=[];return this.forEach((function(o){var a=t.call(e,o,o,n);a!==o&&(r.push(o),i.push(a))})),this.withMutations((function(t){r.forEach((function(e){return t.remove(e)})),i.forEach((function(e){return t.add(e)}))}))},e.prototype.union=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(n){for(var r=0;r=0&&e=0&&n>>-15,461845907),e=lt(e<<13|e>>>-13,5),e=lt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=ct((e=lt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(n?e?function(t,e){r=31*r+tr(ft(t),ft(e))|0}:function(t,e){r=r+tr(ft(t),ft(e))|0}:e?function(t){r=31*r+ft(t)|0}:function(t){r=r+ft(t)|0}),r)}(this))}});var Wn=T.prototype;Wn[m]=!0,Wn[L]=Wn.values,Wn.toJSON=Wn.toArray,Wn.__toStringMapper=Zt,Wn.inspect=Wn.toSource=function(){return this.toString()},Wn.chain=Wn.flatMap,Wn.contains=Wn.includes,An(E,{flip:function(){return Bt(this,It(this))},mapEntries:function(t,e){var n=this,r=0;return Bt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],r++,n)})).fromEntrySeq())},mapKeys:function(t,e){var n=this;return Bt(this,this.toSeq().flip().map((function(r,i){return t.call(e,r,i,n)})).flip())}});var Gn=E.prototype;Gn[g]=!0,Gn[L]=Wn.entries,Gn.toJSON=Xn,Gn.__toStringMapper=function(t,e){return Zt(e)+": "+Zt(t)},An(S,{toKeyedSeq:function(){return new Et(this,!1)},filter:function(t,e){return Bt(this,kt(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Bt(this,At(this,!1))},slice:function(t,e){return Bt(this,Mt(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(e||0,0),0===n||2===n&&!e)return this;t=f(t,t<0?this.count():this.size);var r=this.slice(0,t);return Bt(this,1===n?r:r.concat(Vt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Bt(this,Nt(this,t,!1))},get:function(t,e){return(t=l(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,n){return n===t}),void 0,e)},has:function(t){return(t=l(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function tr(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Vn[_]=!0,Vn[M]=!0,An(P,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),P.prototype.has=Wn.includes,P.prototype.contains=P.prototype.includes,An(Y,E.prototype),An(q,S.prototype),An(K,P.prototype);var er=function(t){function e(t){return null===t||void 0===t?or():In(t)?t:or().withMutations((function(e){var n=P(t);qt(n.size),n.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Mn);er.isOrderedSet=In;var nr,rr=er.prototype;function ir(t,e){var n=Object.create(rr);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function or(){return nr||(nr=ir(yn()))}rr[M]=!0,rr.zip=Vn.zip,rr.zipWith=Vn.zipWith,rr.__empty=or,rr.__make=ir;var ar=function(t,e){var n,r=function(o){var a=this;if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var s=Object.keys(t),u=i._indices={};i._name=e,i._keys=s,i._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function vr(t,e,n,r,i,o){var a=Array.isArray(n)?q:Qt(n)?Y:null;if(a){if(~t.indexOf(n))throw new TypeError("Cannot convert circular structure to Immutable");t.push(n),i&&""!==r&&i.push(r);var s=e.call(o,r,a(n).map((function(r,o){return vr(t,e,r,o,i,n)})),i&&i.slice());return t.pop(),i&&i.pop(),s}return n}function mr(t,e){return b(e)?e.toMap():e.toList()}var yr="4.0.0-rc.11",gr={version:yr,Collection:T,Iterable:T,Seq:V,Map:Ae,OrderedMap:vn,List:tn,Stack:xn,Set:Mn,OrderedSet:er,Record:ar,Range:jn,Repeat:pr,is:ut,fromJS:dr,hash:ft,isImmutable:k,isCollection:y,isKeyed:b,isIndexed:x,isAssociative:w,isOrdered:R,isValueObject:st,isSeq:I,isList:Je,isMap:ot,isOrderedMap:at,isStack:_n,isSet:On,isOrderedSet:In,isRecord:A,get:te,getIn:Bn,has:Jt,hasIn:Hn,merge:me,mergeDeep:ge,mergeWith:ye,mergeDeepWith:be,remove:ne,removeIn:ue,set:re,setIn:ae,update:ce,updateIn:ie},br=T;e.default=gr},function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return s}));var r=n(30),i=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function a(t){if("object"!==typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function s(t,e,n){var i;if("function"===typeof e&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"===typeof e&&"undefined"===typeof n&&(n=e,e=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(t,e)}if("function"!==typeof t)throw new Error("Expected the reducer to be a function.");var u=t,l=e,c=[],h=c,f=!1;function p(){h===c&&(h=c.slice())}function d(){if(f)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return l}function v(t){if("function"!==typeof t)throw new Error("Expected the listener to be a function.");if(f)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var e=!0;return p(),h.push(t),function(){if(e){if(f)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");e=!1,p();var n=h.indexOf(t);h.splice(n,1),c=null}}}function m(t){if(!a(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(f)throw new Error("Reducers may not dispatch actions.");try{f=!0,l=u(l,t)}finally{f=!1}for(var e=c=h,n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=n(64);function b(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o127?R+="x":R+=M[D];if(!R.match(p)){var L=A.slice(0,O),F=A.slice(O+1),U=M.match(d);U&&(L.push(U[1]),F.unshift(U[2])),F.length&&(b="/"+F.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=r.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),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(O=0,k=c.length;O0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift());return n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!T.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=T.slice(-1)[0],P=(n.host||t.host||T.length>1)&&("."===S||".."===S)||""===S,O=0,I=T.length;I>=0;I--)"."===(S=T[I])?T.splice(I,1):".."===S?(T.splice(I,1),O++):O&&(T.splice(I,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,A=""===T[0]||T[0]&&"/"===T[0].charAt(0);E&&(n.hostname=n.host=A?"":T.length?T.shift():"",(C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=C.shift(),n.host=n.hostname=C.shift()));return(x=x||n.host&&T.length)&&!A&&T.unshift(""),T.length?n.pathname=T.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=s.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,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(18);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combineReducers=void 0;var r,i=n(71),o=(r=i)&&r.__esModule?r:{default:r};e.combineReducers=o.default},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(14);function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";t.exports=n(56)},function(t,e,n){var r=n(26),i=n(75),o=n(77),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,l,c,h,f,p,d=0,v=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=u,r=l;return u=l=void 0,d=e,h=t.apply(r,n)}function b(t){return d=t,f=setTimeout(x,e),v?g(t):h}function _(t){var n=t-p;return void 0===p||n>=e||n<0||m&&t-d>=c}function x(){var t=i();if(_(t))return w(t);f=setTimeout(x,function(t){var n=e-(t-p);return m?s(n,c-(t-d)):n}(t))}function w(t){return f=void 0,y&&u?g(t):(u=l=void 0,h)}function T(){var t=i(),n=_(t);if(u=arguments,l=this,p=t,n){if(void 0===f)return b(p);if(m)return clearTimeout(f),f=setTimeout(x,e),g(p)}return void 0===f&&(f=setTimeout(x,e)),h}return e=o(e)||0,r(n)&&(v=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,e):c,y="trailing"in n?!!n.trailing:y),T.cancel=function(){void 0!==f&&clearTimeout(f),d=0,u=p=l=f=void 0},T.flush=function(){return void 0===f?h:w(i())},T}},function(t,e,n){"use strict";var r=n(27),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,d=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(d){var i=p(n);i&&i!==d&&t(e,i,r)}var a=c(n);h&&(a=a.concat(h(n)));for(var s=u(e),v=u(n),m=0;m80*n){r=u=t[0],s=l=t[1];for(var _=n;_u&&(u=c),p>l&&(l=p);d=0!==(d=Math.max(u-r,l-s))?1/d:0}return a(g,b,n,r,s,d),b}function i(t,e,n,r,i){var o,a;if(i===I(t,e,n,r)>0)for(o=e;o=e;o-=r)a=S(o,t[o],t[o+1],a);return a&&b(a,a.next)&&(P(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(P(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,h,f){if(t){!f&&h&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=d(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,h);for(var p,v,m=t;t.prev!==t.next;)if(p=t.prev,v=t.next,h?u(t,r,i,h):s(t))e.push(p.i/n),e.push(t.i/n),e.push(v.i/n),P(t),t=v.next,m=v.next;else if((t=v)===m){f?1===f?a(t=l(o(t),e,n),e,n,r,i,h,2):2===f&&c(t,e,n,r,i,h):a(o(t),e,n,r,i,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(g(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&g(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,n,r){var i=t.prev,o=t,a=t.next;if(g(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=d(s,u,e,n,r),f=d(l,c,e,n,r),p=t.prevZ,v=t.nextZ;p&&p.z>=h&&v&&v.z<=f;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=f;){if(v!==t.prev&&v!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!b(i,a)&&_(i,r,r.next,a)&&T(i,a)&&T(a,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(a.i/n),P(r),P(r.next),r=t=a),r=r.next}while(r!==t);return o(r)}function c(t,e,n,r,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&y(u,l)){var c=E(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,n,r,i,s),void a(c,e,n,r,i,s)}l=l.next}u=u.next}while(u!==t)}function h(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&i!==r.x&&m(on.x||r.x===n.x&&p(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e)){var n=E(e,t);o(e,e.next),o(n,n.next)}}function p(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function v(t){var e=t,n=t;do{(e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&_(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||b(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,n,r){var i=w(g(t,e,n)),o=w(g(t,e,r)),a=w(g(n,r,t)),s=w(g(n,r,e));return i!==o&&a!==s||(!(0!==i||!x(t,n,e))||(!(0!==o||!x(t,r,e))||(!(0!==a||!x(n,t,r))||!(0!==s||!x(n,e,r)))))}function x(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.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 n=new O(t.i,t.x,t.y),r=new O(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(t,e,n,r){var i=new O(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}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,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,n,r){for(var i=0,o=e,a=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t&&"@@redux/INIT"===t.type?"initialState argument passed to createStore":"previous state received by the reducer"},t.exports=e.default},function(t,e,n){var r=n(76),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){var r=n(38).Symbol;t.exports=r},function(t,e,n){"use strict";function r(t){var e,n=t.Symbol;return"function"===typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(i){return"function"===typeof i?i(n,r,t):e(i)}}}}var i=r();i.withExtraArgument=r,e.a=i},function(t,e,n){"use strict";e.__esModule=!0;var r=Object.assign||function(t){for(var e=1;e=this.viewport.threshold}},{key:"move",value:function(t){if(!this.viewport.pause&&this.viewport.worldVisible){var e=this.viewport.plugins.move(t);if(this.clickedAvailable){var n=t.data.global.x-this.last.x,r=t.data.global.y-this.last.y;(this.checkThreshold(n)||this.checkThreshold(r))&&(this.clickedAvailable=!1)}e&&this.viewport.options.stopPropagation&&t.stopPropagation()}}},{key:"up",value:function(t){if(!this.viewport.pause&&this.viewport.worldVisible){"mouse"===t.data.pointerType&&(this.isMouseDown=!1),"mouse"!==t.data.pointerType&&this.remove(t.data.pointerId);var e=this.viewport.plugins.up(t);this.clickedAvailable&&0===this.count()&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation()}}},{key:"getPointerPosition",value:function(t){var e=new f.Point;return this.viewport.options.interaction?this.viewport.options.interaction.mapPositionToPoint(e,t.clientX,t.clientY):(e.x=t.clientX,e.y=t.clientY),e}},{key:"handleWheel",value:function(t){if(!this.viewport.pause&&this.viewport.worldVisible){var e=this.viewport.toLocal(this.getPointerPosition(t));if(this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom)this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault()}}},{key:"pause",value:function(){this.touches=[],this.isMouseDown=!1}},{key:"get",value:function(t){var e,n=Object(l.a)(this.touches);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.id===t)return r}}catch(i){n.e(i)}finally{n.f()}return null}},{key:"remove",value:function(t){for(var e=0;e2&&void 0!==arguments[2]?arguments[2]:d.length;this.plugins[t]=e;var r=d.indexOf(t);-1!==r&&d.splice(r,1),d.splice(n,0,t),this.sort()}},{key:"get",value:function(t,e){return e&&"undefined"!==typeof this.plugins[t]&&this.plugins[t].paused?null:this.plugins[t]}},{key:"update",value:function(t){var e,n=Object(l.a)(this.list);try{for(n.s();!(e=n.n()).done;){e.value.update(t)}}catch(r){n.e(r)}finally{n.f()}}},{key:"resize",value:function(){var t,e=Object(l.a)(this.list);try{for(e.s();!(t=e.n()).done;){t.value.resize()}}catch(n){e.e(n)}finally{e.f()}}},{key:"reset",value:function(){var t,e=Object(l.a)(this.list);try{for(e.s();!(t=e.n()).done;){t.value.reset()}}catch(n){e.e(n)}finally{e.f()}}},{key:"remove",value:function(t){this.plugins[t]&&(this.plugins[t]=null,this.viewport.emit(t+"-remove"),this.sort())}},{key:"pause",value:function(t){this.plugins[t]&&this.plugins[t].pause()}},{key:"resume",value:function(t){this.plugins[t]&&this.plugins[t].resume()}},{key:"sort",value:function(){this.list=[];var t,e=Object(l.a)(d);try{for(e.s();!(t=e.n()).done;){var n=t.value;this.plugins[n]&&this.list.push(this.plugins[n])}}catch(r){e.e(r)}finally{e.f()}}},{key:"down",value:function(t){var e,n=!1,r=Object(l.a)(this.list);try{for(r.s();!(e=r.n()).done;){e.value.down(t)&&(n=!0)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"move",value:function(t){var e,n=!1,r=Object(l.a)(this.viewport.plugins.list);try{for(r.s();!(e=r.n()).done;){e.value.move(t)&&(n=!0)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"up",value:function(t){var e,n=!1,r=Object(l.a)(this.list);try{for(r.s();!(e=r.n()).done;){e.value.up(t)&&(n=!0)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"wheel",value:function(t){var e,n=!1,r=Object(l.a)(this.list);try{for(r.s();!(e=r.n()).done;){e.value.wheel(t)&&(n=!0)}}catch(i){r.e(i)}finally{r.f()}return n}}]),t}(),m=function(){function t(e){Object(c.a)(this,t),this.parent=e,this.paused=!1}return Object(h.a)(t,[{key:"destroy",value:function(){}},{key:"down",value:function(){return!1}},{key:"move",value:function(){return!1}},{key:"up",value:function(){return!1}},{key:"wheel",value:function(){return!1}},{key:"update",value:function(){}},{key:"resize",value:function(){}},{key:"reset",value:function(){}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}}]),t}(),y={direction:"all",pressDrag:!0,wheel:!0,wheelScroll:1,reverse:!1,clampWheel:!1,underflow:"center",factor:1,mouseButtons:"all",keyToPress:null,ignoreKeyToPressOnTouch:!1},g=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},y,i),r.moved=!1,r.reverse=r.options.reverse?1:-1,r.xDirection=!r.options.direction||"all"===r.options.direction||"x"===r.options.direction,r.yDirection=!r.options.direction||"all"===r.options.direction||"y"===r.options.direction,r.keyIsPressed=!1,r.parseUnderflow(),r.mouseButtons(r.options.mouseButtons),r.options.keyToPress&&r.handleKeyPresses(r.options.keyToPress),r}return Object(h.a)(n,[{key:"handleKeyPresses",value:function(t){var e=this;parent.addEventListener("keydown",(function(n){t.includes(n.code)&&(e.keyIsPressed=!0)})),parent.addEventListener("keyup",(function(n){t.includes(n.code)&&(e.keyIsPressed=!1)}))}},{key:"mouseButtons",value:function(t){this.mouse=t&&"all"!==t?[-1!==t.indexOf("left"),-1!==t.indexOf("middle"),-1!==t.indexOf("right")]:[!0,!0,!0]}},{key:"parseUnderflow",value:function(){var t=this.options.underflow.toLowerCase();"center"===t?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0)}},{key:"checkButtons",value:function(t){var e="mouse"===t.data.pointerType,n=this.parent.input.count();return!(!(1===n||n>1&&!this.parent.plugins.get("pinch",!0))||e&&!this.mouse[t.data.button])}},{key:"checkKeyPress",value:function(t){return!!(!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&"touch"===t.data.pointerType)}},{key:"down",value:function(t){if(!this.paused&&this.options.pressDrag)return this.checkButtons(t)&&this.checkKeyPress(t)?(this.last={x:t.data.global.x,y:t.data.global.y},this.current=t.data.pointerId,!0):void(this.last=null)}},{key:"move",value:function(t){if(!this.paused&&this.options.pressDrag&&this.last&&this.current===t.data.pointerId){var e=t.data.global.x,n=t.data.global.y,r=this.parent.input.count();if(1===r||r>1&&!this.parent.plugins.get("pinch",!0)){var i=e-this.last.x,o=n-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(i)||this.yDirection&&this.parent.input.checkThreshold(o)){var a={x:e,y:n};return this.xDirection&&(this.parent.x+=(a.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(a.y-this.last.y)*this.options.factor),this.last=a,this.moved||this.parent.emit("drag-start",{event:t,screen:new f.Point(this.last.x,this.last.y),world:this.parent.toWorld(new f.Point(this.last.x,this.last.y)),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}}},{key:"up",value:function(t){if(!this.paused){var e=this.parent.input.touches;if(1===e.length){var n=e[0];return n.last&&(this.last={x:n.last.x,y:n.last.y},this.current=n.id),this.moved=!1,!0}if(this.last&&this.moved){var r=new f.Point(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:t,screen:r,world:this.parent.toWorld(r),viewport:this.parent}),this.last=null,this.moved=!1,!0}}}},{key:"wheel",value:function(t){if(!this.paused&&this.options.wheel){var e=this.parent.plugins.get("wheel",!0);if(!e)return this.xDirection&&(this.parent.x+=t.deltaX*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=t.deltaY*this.options.wheelScroll*this.reverse),this.options.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.options.passiveWheel||t.preventDefault(),!0}}},{key:"resume",value:function(){this.last=null,this.paused=!1}},{key:"clamp",value:function(){var t=this.parent.plugins.get("decelerate",!0)||{};if("y"!==this.options.clampWheel)if(this.parent.screenWorldWidththis.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.options.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}},{key:"active",get:function(){return this.moved}}]),n}(m),b={noDrag:!1,percent:1,center:null,factor:1},_=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},b,i),r}return Object(h.a)(n,[{key:"down",value:function(){if(this.parent.input.count()>=2)return this.active=!0,!0}},{key:"move",value:function(t){if(!this.paused&&this.active){var e=t.data.global.x,n=t.data.global.y,r=this.parent.input.touches;if(r.length>=2){var i=r[0],o=r[1],a=i.last&&o.last?Math.sqrt(Math.pow(o.last.x-i.last.x,2)+Math.pow(o.last.y-i.last.y,2)):null;if(i.id===t.data.pointerId?i.last={x:e,y:n,data:t.data}:o.id===t.data.pointerId&&(o.last={x:e,y:n,data:t.data}),a){var s,u={x:i.last.x+(o.last.x-i.last.x)/2,y:i.last.y+(o.last.y-i.last.y)/2};this.options.center||(s=this.parent.toLocal(u));var l=Math.sqrt(Math.pow(o.last.x-i.last.x,2)+Math.pow(o.last.y-i.last.y,2)),c=(1-a/(l=0===l?l=1e-10:l))*this.options.percent*this.parent.scale.x;this.parent.scale.x+=c,this.parent.scale.y+=c,this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:u});var h=this.parent.plugins.get("clamp-zoom",!0);if(h&&h.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{var f=this.parent.toGlobal(s);this.parent.x+=(u.x-f.x)*this.options.factor,this.parent.y+=(u.y-f.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(u.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(u.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=u,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}}}},{key:"up",value:function(){if(this.pinching&&this.parent.input.touches.length<=1)return this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0}}]),n}(m),x={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"},w=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},x,i),r.options.direction&&(r.options.left="x"===r.options.direction||"all"===r.options.direction||null,r.options.right="x"===r.options.direction||"all"===r.options.direction||null,r.options.top="y"===r.options.direction||"all"===r.options.direction||null,r.options.bottom="y"===r.options.direction||"all"===r.options.direction||null),r.parseUnderflow(),r.last={x:null,y:null,scaleX:null,scaleY:null},r.update(),r}return Object(h.a)(n,[{key:"parseUnderflow",value:function(){var t=this.options.underflow.toLowerCase();"none"===t?this.noUnderflow=!0:"center"===t?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0,this.noUnderflow=!1)}},{key:"move",value:function(){return this.update(),!1}},{key:"update",value:function(){if(!this.paused&&(this.parent.x!==this.last.x||this.parent.y!==this.last.y||this.parent.scale.x!==this.last.scaleX||this.parent.scale.y!==this.last.scaleY)){var t={x:this.parent.x,y:this.parent.y},e=this.parent.plugins.decelerate||{};if(null!==this.options.left||null!==this.options.right){var n=!1;if(this.parent.screenWorldWidth(!0===this.options.right?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(!0===this.options.right?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,e.x=0,n=!0);n&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(null!==this.options.top||null!==this.options.bottom){var r=!1;if(this.parent.screenWorldHeight(!0===this.options.bottom?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(!0===this.options.bottom?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,e.y=0,r=!0);r&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}}},{key:"reset",value:function(){this.update()}}]),n}(m),T={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null},E=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},T,i),r.clamp(),r}return Object(h.a)(n,[{key:"resize",value:function(){this.clamp()}},{key:"clamp",value:function(){if(!this.paused)if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){var t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(null!==this.options.minWidth&&tthis.options.maxWidth){var r=this.parent.scale.x;this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/r,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(null!==this.options.minHeight&ðis.options.maxHeight){var o=this.parent.scale.y;this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/o,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}else{var a=this.parent.scale.x;null!==this.options.minScale&&athis.options.maxScale&&(a=this.options.maxScale),a!==this.parent.scale.x&&(this.parent.scale.set(a),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}},{key:"reset",value:function(){this.clamp()}}]),n}(m),S={friction:.95,bounce:.8,minSpeed:.01},P=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},S,i),r.saved=[],r.reset(),r.parent.on("moved",(function(t){return r.moved(t)})),r}return Object(h.a)(n,[{key:"destroy",value:function(){this.parent}},{key:"down",value:function(){this.saved=[],this.x=this.y=!1}},{key:"isActive",value:function(){return this.x||this.y}},{key:"move",value:function(){if(!this.paused){var t=this.parent.input.count();(1===t||t>1&&!this.parent.plugins.get("pinch",!0))&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30))}}},{key:"moved",value:function(t){if(this.saved.length){var e=this.saved[this.saved.length-1];"clamp-x"===t.type?e.x===t.original.x&&(e.x=this.parent.x):"clamp-y"===t.type&&e.y===t.original.y&&(e.y=this.parent.y)}}},{key:"up",value:function(){if(0===this.parent.input.count()&&this.saved.length){var t,e=performance.now(),n=Object(l.a)(this.saved);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.time>=e-100){var i=e-r.time;this.x=(this.parent.x-r.x)/i,this.y=(this.parent.y-r.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction;break}}}catch(o){n.e(o)}finally{n.f()}}}},{key:"activate",value:function(t){"undefined"!==typeof(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.options.friction),"undefined"!==typeof t.y&&(this.y=t.y,this.percentChangeY=this.options.friction)}},{key:"update",value:function(t){var e;this.paused||(this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},A,i),r.ease=C(r.options.ease,"easeInOutSine"),r.options.sides&&("all"===r.options.sides?r.top=r.bottom=r.left=r.right=!0:"horizontal"===r.options.sides?r.right=r.left=!0:"vertical"===r.options.sides?r.top=r.bottom=!0:(r.top=-1!==r.options.sides.indexOf("top"),r.bottom=-1!==r.options.sides.indexOf("bottom"),r.left=-1!==r.options.sides.indexOf("left"),r.right=-1!==r.options.sides.indexOf("right"))),r.parseUnderflow(),r.last={},r.reset(),r}return Object(h.a)(n,[{key:"parseUnderflow",value:function(){var t=this.options.underflow.toLowerCase();"center"===t?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0)}},{key:"isActive",value:function(){return null!==this.toX||null!==this.toY}},{key:"down",value:function(){this.toX=this.toY=null}},{key:"up",value:function(){this.bounce()}},{key:"update",value:function(t){if(!this.paused){if(this.bounce(),this.toX){var e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)}if(this.toY){var n=this.toY;n.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),n.time>=this.options.time?(this.parent.y=n.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(n.time,n.start,n.delta,this.options.time)}}}},{key:"calcUnderflowX",value:function(){var t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}},{key:"calcUnderflowY",value:function(){var t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}},{key:"oob",value:function(){var t=this.options.bounceBox;if(t){var e="undefined"===typeof t.x?0:t.x,n="undefined"===typeof t.y?0:t.y,r="undefined"===typeof t.width?this.parent.worldWidth:t.width,i="undefined"===typeof t.height?this.parent.worldHeight:t.height;return{left:this.parent.leftr,top:this.parent.topi,topLeft:new f.Point(e*this.parent.scale.x,n*this.parent.scale.y),bottomRight:new f.Point(r*this.parent.scale.x-this.parent.screenWidth,i*this.parent.scale.y-this.parent.screenHeight)}}return{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new f.Point(0,0),bottomRight:new f.Point(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}},{key:"bounce",value:function(){if(!this.paused){var t,e=this.parent.plugins.get("decelerate",!0);e&&(e.x||e.y)&&(e.x&&e.percentChangeX===e.options.friction||e.y&&e.percentChangeY===e.options.friction)&&(((t=this.oob()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.options.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.options.friction));var n=this.parent.plugins.get("drag",!0)||{},r=this.parent.plugins.get("pinch",!0)||{};if(e=e||{},!n.active&&!r.active&&(!this.toX||!this.toY)&&(!e.x||!e.y)){var i=(t=t||this.oob()).topLeft,o=t.bottomRight;if(!this.toX&&!e.x){var a=null;t.left&&this.left?a=this.parent.screenWorldWidth3&&void 0!==arguments[3]?arguments[3]:{};return Object(c.a)(this,n),(o=e.call(this,t)).options=Object.assign({},M,a),o.ease=C(a.ease,"easeInOutSine"),o.x=r,o.y=i,o.options.forceStart&&o.snapStart(),o}return Object(h.a)(n,[{key:"snapStart",value:function(){this.percent=0,this.snapping={time:0};var t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.y,this.parent.emit("snap-start",this.parent)}},{key:"wheel",value:function(){this.options.removeOnInterrupt&&this.parent.plugins.remove("snap")}},{key:"down",value:function(){this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null)}},{key:"up",value:function(){if(0===this.parent.input.count()){var t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction)}}},{key:"update",value:function(t){if(!this.paused&&(!this.options.interrupt||0===this.parent.input.count()))if(this.snapping){var e,n,r,i=this.snapping;if(i.time+=t,i.time>this.options.time)e=!0,n=this.startX+this.deltaX,r=this.startY+this.deltaY;else{var o=this.ease(i.time,0,1,this.options.time);n=this.startX+this.deltaX*o,r=this.startY+this.deltaY*o}this.options.topLeft?this.parent.moveCorner(n,r):this.parent.moveCenter(n,r),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),e&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.options.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),n}(m),D={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupts:!1,forceStart:!1,noMove:!1},N=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},D,i),r.ease=C(r.options.ease),r.options.width>0&&(r.xScale=t.screenWidth/r.options.width),r.options.height>0&&(r.yScale=t.screenHeight/r.options.height),r.xIndependent=!!r.xScale,r.yIndependent=!!r.yScale,r.xScale=r.xIndependent?r.xScale:r.yScale,r.yScale=r.yIndependent?r.yScale:r.xScale,0===r.options.time?(t.container.scale.x=r.xScale,t.container.scale.y=r.yScale,r.options.removeOnComplete&&r.parent.plugins.remove("snap-zoom")):i.forceStart&&r.createSnapping(),r}return Object(h.a)(n,[{key:"createSnapping",value:function(){this.parent.scale;var t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,n=this.parent.screenWidth/this.xScale,r=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:t,startY:e,deltaX:n-t,deltaY:r-e},this.parent.emit("snap-zoom-start",this.parent)}},{key:"resize",value:function(){this.snapping=null,this.options.width>0&&(this.xScale=this.parent.screenWidth/this.options.width),this.options.height>0&&(this.yScale=this.parent.screenHeight/this.options.height),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale}},{key:"wheel",value:function(){this.options.removeOnInterrupt&&this.parent.plugins.remove("snap-zoom")}},{key:"down",value:function(){this.options.removeOnInterrupt?this.parent.plugins.remove("snap-zoom"):this.options.interrupt&&(this.snapping=null)}},{key:"update",value:function(t){var e;if(!this.paused&&(!this.options.interrupt||0===this.parent.input.count()))if(this.options.center||this.options.noMove||(e=this.parent.center),this.snapping){if(this.snapping){var n=this.snapping;if(n.time+=t,n.time>=this.options.time)this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var r=this.snapping,i=this.ease(r.time,r.startX,r.deltaX,this.options.time),o=this.ease(r.time,r.startY,r.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/i,this.parent.scale.y=this.parent.screenHeight/o}var a=this.parent.plugins.get("clamp-zoom",!0);a&&a.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(e))}}else this.parent.scale.x===this.xScale&&this.parent.scale.y===this.yScale||this.createSnapping()}},{key:"resume",value:function(){this.snapping=null,Object(o.a)(Object(a.a)(n.prototype),"resume",this).call(this)}}]),n}(m),L={speed:0,acceleration:null,radius:null},F=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(c.a)(this,n),(i=e.call(this,t)).target=r,i.options=Object.assign({},L,o),i.velocity={x:0,y:0},i}return Object(h.a)(n,[{key:"update",value:function(t){if(!this.paused){var e=this.parent.center,n=this.target.x,r=this.target.y;if(this.options.radius){if(!(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.options.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);n=this.target.x-Math.cos(i)*this.options.radius,r=this.target.y-Math.sin(i)*this.options.radius}var o=n-e.x,a=r-e.y;if(o||a)if(this.options.speed)if(this.options.acceleration){var s=Math.atan2(r-e.y,n-e.x),u=Math.sqrt(Math.pow(o,2)+Math.pow(a,2));if(u){var l=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);this.velocity=u>l?{x:Math.min(this.velocity.x+this.options.acceleration*t,this.options.speed),y:Math.min(this.velocity.y+this.options.acceleration*t,this.options.speed)}:{x:Math.max(this.velocity.x-this.options.acceleration*this.options.speed,0),y:Math.max(this.velocity.y-this.options.acceleration*this.options.speed,0)};var c=Math.cos(s)*this.velocity.x,h=Math.sin(s)*this.velocity.y,f=Math.abs(c)>Math.abs(o)?n:e.x+c,p=Math.abs(h)>Math.abs(a)?r:e.y+h;this.parent.moveCenter(f,p),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{var d=Math.atan2(r-e.y,n-e.x),v=Math.cos(d)*this.options.speed,m=Math.sin(d)*this.options.speed,y=Math.abs(v)>Math.abs(o)?n:e.x+v,g=Math.abs(m)>Math.abs(a)?r:e.y+m;this.parent.moveCenter(y,g),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(n,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}(m),U={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20},j=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},U,i),r}return Object(h.a)(n,[{key:"down",value:function(){this.options.interrupt&&(this.smoothing=null)}},{key:"update",value:function(){if(this.smoothing){var t,e=this.smoothingCenter,n=this.smoothing;this.options.center||(t=this.parent.toLocal(e)),this.parent.scale.x+=n.x,this.parent.scale.y+=n.y,this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var r=this.parent.plugins.get("clamp-zoom",!0);if(r&&r.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{var i=this.parent.toGlobal(t);this.parent.x+=e.x-i.x,this.parent.y+=e.y-i.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}},{key:"wheel",value:function(t){if(!this.paused){var e=this.parent.input.getPointerPosition(t),n=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,r=Math.pow(2,(1+this.options.percent)*n);if(this.options.smooth){var i={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+i.x)*r-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+i.y)*r-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{var o;this.options.center||(o=this.parent.toLocal(e)),this.parent.scale.x*=r,this.parent.scale.y*=r,this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var a=this.parent.plugins.get("clamp-zoom",!0);if(a&&a.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{var s=this.parent.toGlobal(o);this.parent.x+=e.x-s.x,this.parent.y+=e.y-s.y}}return this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent}),!this.parent.options.passiveWheel||void 0}}}]),n}(m),B={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1},z=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},B,i),r.reverse=r.options.reverse?1:-1,r.radiusSquared=Math.pow(r.options.radius,2),r.resize(),r}return Object(h.a)(n,[{key:"resize",value:function(){var t=this.options.distance;null!==t?(this.left=t,this.top=t,this.right=this.parent.worldScreenWidth-t,this.bottom=this.parent.worldScreenHeight-t):this.radius||(this.left=this.options.left,this.top=this.options.top,this.right=null===this.options.right?null:this.parent.worldScreenWidth-this.options.right,this.bottom=null===this.options.bottom?null:this.parent.worldScreenHeight-this.options.bottom)}},{key:"down",value:function(){this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null)}},{key:"move",value:function(t){if(!this.paused&&!("mouse"!==t.data.pointerType&&1!==t.data.identifier||!this.options.allowButtons&&0!==t.data.buttons)){var e=t.data.global.x,n=t.data.global.y;if(this.radiusSquared){var r=this.parent.toScreen(this.parent.center);if(Math.pow(r.x-e,2)+Math.pow(r.y-n,2)>=this.radiusSquared){var i=Math.atan2(r.y-n,r.x-e);this.options.linear?(this.horizontal=Math.round(Math.cos(i))*this.options.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(i))*this.options.speed*this.reverse*.06):(this.horizontal=Math.cos(i)*this.options.speed*this.reverse*.06,this.vertical=Math.sin(i)*this.options.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else null!==this.left&ðis.right?this.horizontal=-1*this.reverse*this.options.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),null!==this.top&&nthis.bottom?this.vertical=-1*this.reverse*this.options.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null)}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),n}(m),H={removeOnInterrupt:!1,ease:"linear",time:1e3},X=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(c.a)(this,n),(r=e.call(this,t)).options=Object.assign({},H,i),r.options.ease=C(r.options.ease),r.setupPosition(),r.setupZoom(),r}return Object(h.a)(n,[{key:"setupPosition",value:function(){"undefined"!==typeof this.options.position?(this.startX=this.parent.center.x,this.startY=this.parent.center.y,this.deltaX=this.options.position.x-this.parent.center.x,this.deltaY=this.options.position.y-this.parent.center.y,this.keepCenter=!1):this.keepCenter=!0}},{key:"setupZoom",value:function(){this.width=null,this.height=null,"undefined"!==typeof this.options.scale?this.width=this.parent.screenWidth/this.options.scale:"undefined"!==typeof this.options.scaleX||"undefined"!==typeof this.options.scaleY?("undefined"!==typeof this.options.scaleX&&(this.width=this.parent.screenWidth/this.options.scaleX),"undefined"!==typeof this.options.scaleY&&(this.height=this.parent.screenHeight/this.options.scaleY)):("undefined"!==typeof this.options.width&&(this.width=this.options.width),"undefined"!==typeof this.options.height&&(this.height=this.options.height)),null!==typeof this.width&&(this.startWidth=this.parent.screenWidthInWorldPixels,this.deltaWidth=this.width-this.startWidth),null!==typeof this.height&&(this.startHeight=this.parent.screenHeightInWorldPixels,this.deltaHeight=this.height-this.startHeight),this.time=0}},{key:"down",value:function(){this.options.removeOnInterrupt&&this.parent.plugins.remove("animate")}},{key:"complete",value:function(){this.parent.plugins.remove("animate"),null!==this.width&&this.parent.fitWidth(this.width,this.keepCenter,null===this.height),null!==this.height&&this.parent.fitHeight(this.height,this.keepCenter,null===this.width),this.keepCenter||this.parent.moveCenter(this.options.position.x,this.options.position.y),this.parent.emit("animate-end",this.parent),this.options.callbackOnComplete&&this.options.callbackOnComplete(this.parent)}},{key:"update",value:function(t){if(!this.paused)if(this.time+=t,this.time>=this.options.time)this.complete();else{var e=new f.Point(this.parent.scale.x,this.parent.scale.y),n=this.options.ease(this.time,0,1,this.options.time);if(null!==this.width&&this.parent.fitWidth(this.startWidth+this.deltaWidth*n,this.keepCenter,null===this.height),null!==this.height&&this.parent.fitHeight(this.startHeight+this.deltaHeight*n,this.keepCenter,null===this.width),null===this.width?this.parent.scale.x=this.parent.scale.y:null===this.height&&(this.parent.scale.y=this.parent.scale.x),!this.keepCenter){var r=new f.Point(this.parent.x,this.parent.y);this.parent.moveCenter(this.startX+this.deltaX*n,this.startY+this.deltaY*n),this.parent.emit("moved",{viewport:this.parent,original:r,type:"animate"})}(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"}),this.keepCenter}}}]),n}(m),W={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,interaction:null,disableOnContextMenu:!1},G=function(t){Object(s.a)(n,t);var e=Object(u.a)(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(c.a)(this,n),(t=e.call(this)).options=Object.assign({},W,i),i.ticker)t.options.ticker=i.ticker;else{var o,a=f;o=parseInt(/^(\d+)\./.exec(f.VERSION)[1])<5?a.ticker.shared:a.Ticker.shared,t.options.ticker=i.ticker||o}return t.screenWidth=t.options.screenWidth,t.screenHeight=t.options.screenHeight,t._worldWidth=t.options.worldWidth,t._worldHeight=t.options.worldHeight,t.forceHitArea=t.options.forceHitArea,t.threshold=t.options.threshold,t.options.divWheel=t.options.divWheel||document.body,t.options.disableOnContextMenu&&(t.options.divWheel.oncontextmenu=function(t){return t.preventDefault()}),t.options.noTicker||(t.tickerFunction=function(){return t.update(t.options.ticker.elapsedMS)},t.options.ticker.add(t.tickerFunction)),t.input=new p(Object(r.a)(t)),t.plugins=new v(Object(r.a)(t)),t}return Object(h.a)(n,[{key:"destroy",value:function(t){this.options.noTicker||this.options.ticker.remove(this.tickerFunction),this.input.destroy(),Object(o.a)(Object(a.a)(n.prototype),"destroy",this).call(this,t)}},{key:"update",value:function(t){this.pause||(this.plugins.update(t),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new f.Rectangle(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.innerWidth,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.innerHeight,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;this.screenWidth=t,this.screenHeight=e,"undefined"!==typeof n&&(this._worldWidth=n),"undefined"!==typeof r&&(this._worldHeight=r),this.plugins.resize(),this.dirty=!0}},{key:"getVisibleBounds",value:function(){return new f.Rectangle(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}},{key:"toWorld",value:function(t,e){return 2===arguments.length?this.toLocal(new f.Point(t,e)):this.toLocal(t)}},{key:"toScreen",value:function(t,e){return 2===arguments.length?this.toGlobal(new f.Point(t,e)):this.toGlobal(t)}},{key:"moveCenter",value:function(){var t,e;return isNaN(arguments[0])?(t=arguments[0].x,e=arguments[0].y):(t=arguments[0],e=arguments[1]),this.position.set((this.worldScreenWidth/2-t)*this.scale.x,(this.worldScreenHeight/2-e)*this.scale.y),this.plugins.reset(),this.dirty=!0,this}},{key:"moveCorner",value:function(t,e){return 1===arguments.length?this.position.set(-t.x*this.scale.x,-t.y*this.scale.y):this.position.set(-t*this.scale.x,-e*this.scale.y),this.plugins.reset(),this}},{key:"findFitWidth",value:function(t){return this.screenWidth/t}},{key:"findFitHeight",value:function(t){return this.screenHeight/t}},{key:"findFit",value:function(t,e){var n=this.screenWidth/t,r=this.screenHeight/e;return Math.min(n,r)}},{key:"findCover",value:function(t,e){var n=this.screenWidth/t,r=this.screenHeight/e;return Math.max(n,r)}},{key:"fitWidth",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;e&&(n=this.center),this.scale.x=this.screenWidth/t,r&&(this.scale.y=this.scale.x);var o=this.plugins.get("clamp-zoom",!0);return!i&&o&&o.clamp(),e&&this.moveCenter(n),this}},{key:"fitHeight",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;e&&(n=this.center),this.scale.y=this.screenHeight/t,r&&(this.scale.x=this.scale.y);var o=this.plugins.get("clamp-zoom",!0);return!i&&o&&o.clamp(),e&&this.moveCenter(n),this}},{key:"fitWorld",value:function(t){var e;t&&(e=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x1&&void 0!==arguments[1]?arguments[1]:this.worldWidth,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.worldHeight;t&&(e=this.center),this.scale.x=this.screenWidth/n,this.scale.y=this.screenHeight/r,this.scale.xthis.worldWidth,top:this.top<0,bottom:this.bottom>this._worldHeight,cornerPoint:new f.Point(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}},{key:"drag",value:function(t){return this.plugins.add("drag",new g(this,t)),this}},{key:"clamp",value:function(t){return this.plugins.add("clamp",new w(this,t)),this}},{key:"decelerate",value:function(t){return this.plugins.add("decelerate",new P(this,t)),this}},{key:"bounce",value:function(t){return this.plugins.add("bounce",new k(this,t)),this}},{key:"pinch",value:function(t){return this.plugins.add("pinch",new _(this,t)),this}},{key:"snap",value:function(t,e,n){return this.plugins.add("snap",new R(this,t,e,n)),this}},{key:"follow",value:function(t,e){return this.plugins.add("follow",new F(this,t,e)),this}},{key:"wheel",value:function(t){return this.plugins.add("wheel",new j(this,t)),this}},{key:"animate",value:function(t){return this.plugins.add("animate",new X(this,t)),this}},{key:"clampZoom",value:function(t){return this.plugins.add("clamp-zoom",new E(this,t)),this}},{key:"mouseEdges",value:function(t){return this.plugins.add("mouse-edges",new z(this,t)),this}},{key:"ensureVisible",value:function(t,e,n,r,i){i&&(n>this.worldScreenWidth||r>this.worldScreenHeight)&&(this.fit(!0,n,r),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));var o=!1;tthis.right&&(this.right=t+n,o=!0),ethis.bottom&&(this.bottom=e+r,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width/this.scale.x},set:function(t){this._worldWidth=t,this.plugins.resize()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height/this.scale.y},set:function(t){this._worldHeight=t,this.plugins.resize()}},{key:"worldScreenWidth",get:function(){return this.screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this.screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this.worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this.worldHeight*this.scale.y}},{key:"center",get:function(){return new f.Point(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return new f.Point(-this.x/this.scale.x,-this.y/this.scale.y)},set:function(t){this.moveCorner(t)}},{key:"screenWidthInWorldPixels",get:function(){return this.screenWidth/this.scale.x}},{key:"screenHeightInWorldPixels",get:function(){return this.screenHeight/this.scale.y}},{key:"visible",set:function(t){t||this.input.clear(),Object(i.a)(Object(a.a)(n.prototype),"visible",t,this,!0)}},{key:"scaled",set:function(t){this.setZoom(t,!0)},get:function(){return this.scale.x}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this.plugins.reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this.plugins.reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new f.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}}]),n}(f.Container)}).call(this,n(11))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(25),i=n(23);function o(t,e,n,a){return(o="undefined"!==typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,o){var a,s=Object(r.a)(t,e);if(s){if((a=Object.getOwnPropertyDescriptor(s,e)).set)return a.set.call(o,n),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(o,e)){if(!a.writable)return!1;a.value=n,Object.defineProperty(o,e,a)}else Object(i.a)(o,e,n);return!0})(t,e,n,a)}function a(t,e,n,r,i){if(!o(t,e,n,r||t)&&i)throw new Error("failed to set property");return n}},function(t,e,n){"use strict";(function(t){var n=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;a.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),x="undefined"!==typeof WeakMap?new WeakMap:new n,w=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new _(e,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){w.prototype[t]=function(){var e;return(e=x.get(this))[t].apply(e,arguments)}}));var T="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:w;e.a=T}).call(this,n(11))},function(t,e,n){var r=n(28),i=n(26);t.exports=function(t,e,n){var o=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return i(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:o,maxWait:e,trailing:a})}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(1),i=60103;if(e.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),e.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,n){var r,o={},l=null,c=null;for(r in void 0!==n&&(l=""+n),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(c=e.ref),e)s.call(e,r)&&!u.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:i,type:t,key:l,ref:c,props:o,_owner:a.current}}e.jsx=l,e.jsxs=l},function(t,e,n){"use strict";var r=n(20),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,h=i?Symbol.for("react.context"):60110,f=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,d=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,m="function"===typeof Symbol&&Symbol.iterator;function y(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;nA.length&&A.push(t)}function R(t,e,n,r){var i=typeof t;"undefined"!==i&&"boolean"!==i||(t=null);var s=!1;if(null===t)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return n(r,t,""===e?"."+N(t,0):e),1;if(s=0,e=""===e?".":e+":",Array.isArray(t))for(var u=0;ue}return!1}(e,n,i,r)&&(n=null),r||null===i?function(t){return!!X.call(G,t)||!X.call(W,t)&&(H.test(t)?G[t]=!0:(W[t]=!0,!1))}(e)&&(null===n?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=null===n?3!==i.type&&"":n:(e=i.attributeName,r=i.attributeNamespace,null===n?t.removeAttribute(e):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}Q.hasOwnProperty("ReactCurrentDispatcher")||(Q.ReactCurrentDispatcher={current:null}),Q.hasOwnProperty("ReactCurrentBatchConfig")||(Q.ReactCurrentBatchConfig={suspense:null});var Z=/^(.*)[\\\/]/,J="function"===typeof Symbol&&Symbol.for,tt=J?Symbol.for("react.element"):60103,et=J?Symbol.for("react.portal"):60106,nt=J?Symbol.for("react.fragment"):60107,rt=J?Symbol.for("react.strict_mode"):60108,it=J?Symbol.for("react.profiler"):60114,ot=J?Symbol.for("react.provider"):60109,at=J?Symbol.for("react.context"):60110,st=J?Symbol.for("react.concurrent_mode"):60111,ut=J?Symbol.for("react.forward_ref"):60112,lt=J?Symbol.for("react.suspense"):60113,ct=J?Symbol.for("react.suspense_list"):60120,ht=J?Symbol.for("react.memo"):60115,ft=J?Symbol.for("react.lazy"):60116,pt=J?Symbol.for("react.block"):60121,dt="function"===typeof Symbol&&Symbol.iterator;function vt(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=dt&&t[dt]||t["@@iterator"])?t:null}function mt(t){if(null==t)return null;if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case nt:return"Fragment";case et:return"Portal";case it:return"Profiler";case rt:return"StrictMode";case lt:return"Suspense";case ct:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case at:return"Context.Consumer";case ot:return"Context.Provider";case ut:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case ht:return mt(t.type);case pt:return mt(t.render);case ft:if(t=1===t._status?t._result:null)return mt(t)}return null}function yt(t){var e="";do{t:switch(t.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break t;default:var r=t._debugOwner,i=t._debugSource,o=mt(t.type);n=null,r&&(n=mt(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(Z,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n in "+(r||"Unknown")+o}e+=n,t=t.return}while(t);return e}function gt(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function bt(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function _t(t){t._valueTracker||(t._valueTracker=function(t){var e=bt(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){r=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(t){r=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function xt(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=bt(t)?t.checked?"true":"false":t.value),(t=r)!==n&&(e.setValue(t),!0)}function wt(t,e){var n=e.checked;return i({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:t._wrapperState.initialChecked})}function Tt(t,e){var n=null==e.defaultValue?"":e.defaultValue,r=null!=e.checked?e.checked:e.defaultChecked;n=gt(null!=e.value?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function Et(t,e){null!=(e=e.checked)&&$(t,"checked",e,!1)}function St(t,e){Et(t,e);var n=gt(e.value),r=e.type;if(null!=n)"number"===r?(0===n&&""===t.value||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if("submit"===r||"reset"===r)return void t.removeAttribute("value");e.hasOwnProperty("value")?Ot(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ot(t,e.type,gt(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function Pt(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!("submit"!==r&&"reset"!==r||void 0!==e.value&&null!==e.value))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}""!==(n=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==n&&(t.name=n)}function Ot(t,e,n){"number"===e&&t.ownerDocument.activeElement===t||(null==n?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function It(t,e){return t=i({children:void 0},e),(e=function(t){var e="";return r.Children.forEach(t,(function(t){null!=t&&(e+=t)})),e}(e.children))&&(t.children=e),t}function Ct(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i=n.length))throw Error(a(93));n=n[0]}e=n}null==e&&(e=""),n=e}t._wrapperState={initialValue:gt(n)}}function Mt(t,e){var n=gt(e.value),r=gt(e.defaultValue);null!=n&&((n=""+n)!==t.value&&(t.value=n),null==e.defaultValue&&t.defaultValue!==n&&(t.defaultValue=n)),null!=r&&(t.defaultValue=""+r)}function Rt(t){var e=t.textContent;e===t._wrapperState.initialValue&&""!==e&&null!==e&&(t.value=e)}var Dt="http://www.w3.org/1999/xhtml",Nt="http://www.w3.org/2000/svg";function Lt(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ft(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?Lt(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}var Ut,jt,Bt=(jt=function(t,e){if(t.namespaceURI!==Nt||"innerHTML"in t)t.innerHTML=e;else{for((Ut=Ut||document.createElement("div")).innerHTML="",e=Ut.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,e,n,r){MSApp.execUnsafeLocalFunction((function(){return jt(t,e)}))}:jt);function zt(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}function Ht(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Xt={animationend:Ht("Animation","AnimationEnd"),animationiteration:Ht("Animation","AnimationIteration"),animationstart:Ht("Animation","AnimationStart"),transitionend:Ht("Transition","TransitionEnd")},Wt={},Gt={};function Vt(t){if(Wt[t])return Wt[t];if(!Xt[t])return t;var e,n=Xt[t];for(e in n)if(n.hasOwnProperty(e)&&e in Gt)return Wt[t]=n[e];return t}O&&(Gt=document.createElement("div").style,"AnimationEvent"in window||(delete Xt.animationend.animation,delete Xt.animationiteration.animation,delete Xt.animationstart.animation),"TransitionEvent"in window||delete Xt.transitionend.transition);var Yt=Vt("animationend"),qt=Vt("animationiteration"),Kt=Vt("animationstart"),Qt=Vt("transitionend"),$t="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Zt=new("function"===typeof WeakMap?WeakMap:Map);function Jt(t){var e=Zt.get(t);return void 0===e&&(e=new Map,Zt.set(t,e)),e}function te(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!==(1026&(e=t).effectTag)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function ee(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&(null!==(t=t.alternate)&&(e=t.memoizedState)),null!==e)return e.dehydrated}return null}function ne(t){if(te(t)!==t)throw Error(a(188))}function re(t){if(!(t=function(t){var e=t.alternate;if(!e){if(null===(e=te(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return ne(i),t;if(o===r)return ne(i),e;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}(t)))return null;for(var e=t;;){if(5===e.tag||6===e.tag)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function ie(t,e){if(null==e)throw Error(a(30));return null==t?e:Array.isArray(t)?Array.isArray(e)?(t.push.apply(t,e),t):(t.push(e),t):Array.isArray(e)?[t].concat(e):[t,e]}function oe(t,e,n){Array.isArray(t)?t.forEach(e,n):t&&e.call(n,t)}var ae=null;function se(t){if(t){var e=t._dispatchListeners,n=t._dispatchInstances;if(Array.isArray(e))for(var r=0;rhe.length&&he.push(t)}function pe(t,e,n,r){if(he.length){var i=he.pop();return i.topLevelType=t,i.eventSystemFlags=r,i.nativeEvent=e,i.targetInst=n,i}return{topLevelType:t,eventSystemFlags:r,nativeEvent:e,targetInst:n,ancestors:[]}}function de(t){var e=t.targetInst,n=e;do{if(!n){t.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(e=n.tag)&&6!==e||t.ancestors.push(n),n=kn(r)}while(n);for(n=0;n=e)return{node:r,offset:e-t};t=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=fn(r)}}function dn(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?dn(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function vn(){for(var t=window,e=hn();e instanceof t.HTMLIFrameElement;){try{var n="string"===typeof e.contentWindow.location.href}catch(r){n=!1}if(!n)break;e=hn((t=e.contentWindow).document)}return e}function mn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}var yn="$?",gn="$!",bn=null,_n=null;function xn(t,e){switch(t){case"button":case"input":case"select":case"textarea":return!!e.autoFocus}return!1}function wn(t,e){return"textarea"===t||"option"===t||"noscript"===t||"string"===typeof e.children||"number"===typeof e.children||"object"===typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var Tn="function"===typeof setTimeout?setTimeout:void 0,En="function"===typeof clearTimeout?clearTimeout:void 0;function Sn(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break}return t}function Pn(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var n=t.data;if("$"===n||n===gn||n===yn){if(0===e)return t;e--}else"/$"===n&&e++}t=t.previousSibling}return null}var On=Math.random().toString(36).slice(2),In="__reactInternalInstance$"+On,Cn="__reactEventHandlers$"+On,An="__reactContainere$"+On;function kn(t){var e=t[In];if(e)return e;for(var n=t.parentNode;n;){if(e=n[An]||n[In]){if(n=e.alternate,null!==e.child||null!==n&&null!==n.child)for(t=Pn(t);null!==t;){if(n=t[In])return n;t=Pn(t)}return e}n=(t=n).parentNode}return null}function Mn(t){return!(t=t[In]||t[An])||5!==t.tag&&6!==t.tag&&13!==t.tag&&3!==t.tag?null:t}function Rn(t){if(5===t.tag||6===t.tag)return t.stateNode;throw Error(a(33))}function Dn(t){return t[Cn]||null}function Nn(t){do{t=t.return}while(t&&5!==t.tag);return t||null}function Ln(t,e){var n=t.stateNode;if(!n)return null;var r=d(n);if(!r)return null;n=r[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!r;break t;default:t=!1}if(t)return null;if(n&&"function"!==typeof n)throw Error(a(231,e,typeof n));return n}function Fn(t,e,n){(e=Ln(t,n.dispatchConfig.phasedRegistrationNames[e]))&&(n._dispatchListeners=ie(n._dispatchListeners,e),n._dispatchInstances=ie(n._dispatchInstances,t))}function Un(t){if(t&&t.dispatchConfig.phasedRegistrationNames){for(var e=t._targetInst,n=[];e;)n.push(e),e=Nn(e);for(e=n.length;0this.eventPool.length&&this.eventPool.push(t)}function $n(t){t.eventPool=[],t.getPooled=Kn,t.release=Qn}i(qn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!==typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=Vn)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!==typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){this.isPersistent=Vn},isPersistent:Yn,destructor:function(){var t,e=this.constructor.Interface;for(t in e)this[t]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Yn,this._dispatchInstances=this._dispatchListeners=null}}),qn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},qn.extend=function(t){function e(){}function n(){return r.apply(this,arguments)}var r=this;e.prototype=r.prototype;var o=new e;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,t),n.extend=r.extend,$n(n),n},$n(qn);var Zn=qn.extend({data:null}),Jn=qn.extend({data:null}),tr=[9,13,27,32],er=O&&"CompositionEvent"in window,nr=null;O&&"documentMode"in document&&(nr=document.documentMode);var rr=O&&"TextEvent"in window&&!nr,ir=O&&(!er||nr&&8=nr),or=String.fromCharCode(32),ar={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},sr=!1;function ur(t,e){switch(t){case"keyup":return-1!==tr.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function lr(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var cr=!1;var hr={eventTypes:ar,extractEvents:function(t,e,n,r){var i;if(er)t:{switch(t){case"compositionstart":var o=ar.compositionStart;break t;case"compositionend":o=ar.compositionEnd;break t;case"compositionupdate":o=ar.compositionUpdate;break t}o=void 0}else cr?ur(t,n)&&(o=ar.compositionEnd):"keydown"===t&&229===n.keyCode&&(o=ar.compositionStart);return o?(ir&&"ko"!==n.locale&&(cr||o!==ar.compositionStart?o===ar.compositionEnd&&cr&&(i=Gn()):(Xn="value"in(Hn=r)?Hn.value:Hn.textContent,cr=!0)),o=Zn.getPooled(o,e,n,r),i?o.data=i:null!==(i=lr(n))&&(o.data=i),zn(o),i=o):i=null,(t=rr?function(t,e){switch(t){case"compositionend":return lr(e);case"keypress":return 32!==e.which?null:(sr=!0,or);case"textInput":return(t=e.data)===or&&sr?null:t;default:return null}}(t,n):function(t,e){if(cr)return"compositionend"===t||!er&&ur(t,e)?(t=Gn(),Wn=Xn=Hn=null,cr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=document.documentMode,Gr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Vr=null,Yr=null,qr=null,Kr=!1;function Qr(t,e){var n=e.window===e?e.document:9===e.nodeType?e:e.ownerDocument;return Kr||null==Vr||Vr!==hn(n)?null:("selectionStart"in(n=Vr)&&mn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},qr&&Xr(qr,n)?null:(qr=n,(t=qn.getPooled(Gr.select,Yr,t,e)).type="select",t.target=Vr,zn(t),t))}var $r={eventTypes:Gr,extractEvents:function(t,e,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){t:{i=Jt(i),o=S.onSelect;for(var a=0;ahi||(t.current=ci[hi],ci[hi]=null,hi--)}function pi(t,e){hi++,ci[hi]=t.current,t.current=e}var di={},vi={current:di},mi={current:!1},yi=di;function gi(t,e){var n=t.type.contextTypes;if(!n)return di;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function bi(t){return null!==(t=t.childContextTypes)&&void 0!==t}function _i(){fi(mi),fi(vi)}function xi(t,e,n){if(vi.current!==di)throw Error(a(168));pi(vi,e),pi(mi,n)}function wi(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(a(108,mt(e)||"Unknown",o));return i({},n,{},r)}function Ti(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||di,yi=vi.current,pi(vi,t),pi(mi,mi.current),!0}function Ei(t,e,n){var r=t.stateNode;if(!r)throw Error(a(169));n?(t=wi(t,e,yi),r.__reactInternalMemoizedMergedChildContext=t,fi(mi),fi(vi),pi(vi,t)):fi(mi),pi(mi,n)}var Si=o.unstable_runWithPriority,Pi=o.unstable_scheduleCallback,Oi=o.unstable_cancelCallback,Ii=o.unstable_requestPaint,Ci=o.unstable_now,Ai=o.unstable_getCurrentPriorityLevel,ki=o.unstable_ImmediatePriority,Mi=o.unstable_UserBlockingPriority,Ri=o.unstable_NormalPriority,Di=o.unstable_LowPriority,Ni=o.unstable_IdlePriority,Li={},Fi=o.unstable_shouldYield,Ui=void 0!==Ii?Ii:function(){},ji=null,Bi=null,zi=!1,Hi=Ci(),Xi=1e4>Hi?Ci:function(){return Ci()-Hi};function Wi(){switch(Ai()){case ki:return 99;case Mi:return 98;case Ri:return 97;case Di:return 96;case Ni:return 95;default:throw Error(a(332))}}function Gi(t){switch(t){case 99:return ki;case 98:return Mi;case 97:return Ri;case 96:return Di;case 95:return Ni;default:throw Error(a(332))}}function Vi(t,e){return t=Gi(t),Si(t,e)}function Yi(t,e,n){return t=Gi(t),Pi(t,e,n)}function qi(t){return null===ji?(ji=[t],Bi=Pi(ki,Qi)):ji.push(t),Li}function Ki(){if(null!==Bi){var t=Bi;Bi=null,Oi(t)}Qi()}function Qi(){if(!zi&&null!==ji){zi=!0;var t=0;try{var e=ji;Vi(99,(function(){for(;t=e&&(Da=!0),t.firstContext=null)}function so(t,e){if(no!==t&&!1!==e&&0!==e)if("number"===typeof e&&1073741823!==e||(no=t,e=1073741823),e={context:t,observedBits:e,next:null},null===eo){if(null===to)throw Error(a(308));eo=e,to.dependencies={expirationTime:0,firstContext:e,responders:null}}else eo=eo.next=e;return t._currentValue}var uo=!1;function lo(t){t.updateQueue={baseState:t.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function co(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,baseQueue:t.baseQueue,shared:t.shared,effects:t.effects})}function ho(t,e){return(t={expirationTime:t,suspenseConfig:e,tag:0,payload:null,callback:null,next:null}).next=t}function fo(t,e){if(null!==(t=t.updateQueue)){var n=(t=t.shared).pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}}function po(t,e){var n=t.alternate;null!==n&&co(n,t),null===(n=(t=t.updateQueue).baseQueue)?(t.baseQueue=e.next=e,e.next=e):(e.next=n.next,n.next=e)}function vo(t,e,n,r){var o=t.updateQueue;uo=!1;var a=o.baseQueue,s=o.shared.pending;if(null!==s){if(null!==a){var u=a.next;a.next=s.next,s.next=u}a=s,o.shared.pending=null,null!==(u=t.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=s))}if(null!==a){u=a.next;var l=o.baseState,c=0,h=null,f=null,p=null;if(null!==u)for(var d=u;;){if((s=d.expirationTime)c&&(c=s)}else{null!==p&&(p=p.next={expirationTime:1073741823,suspenseConfig:d.suspenseConfig,tag:d.tag,payload:d.payload,callback:d.callback,next:null}),pu(s,d.suspenseConfig);t:{var m=t,y=d;switch(s=e,v=n,y.tag){case 1:if("function"===typeof(m=y.payload)){l=m.call(v,l,s);break t}l=m;break t;case 3:m.effectTag=-4097&m.effectTag|64;case 0:if(null===(s="function"===typeof(m=y.payload)?m.call(v,l,s):m)||void 0===s)break t;l=i({},l,s);break t;case 2:uo=!0}}null!==d.callback&&(t.effectTag|=32,null===(s=o.effects)?o.effects=[d]:s.push(d))}if(null===(d=d.next)||d===u){if(null===(s=o.shared.pending))break;d=a.next=s.next,s.next=u,o.baseQueue=a=s,o.shared.pending=null}}null===p?h=l:p.next=f,o.baseState=h,o.baseQueue=p,du(c),t.expirationTime=c,t.memoizedState=l}}function mo(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;ev?(m=h,h=null):m=h.sibling;var y=p(i,h,s[v],u);if(null===y){null===h&&(h=m);break}t&&h&&null===y.alternate&&e(i,h),a=o(y,a,v),null===c?l=y:c.sibling=y,c=y,h=m}if(v===s.length)return n(i,h),l;if(null===h){for(;vm?(y=v,v=null):y=v.sibling;var b=p(i,v,g.value,l);if(null===b){null===v&&(v=y);break}t&&v&&null===b.alternate&&e(i,v),s=o(b,s,m),null===h?c=b:h.sibling=b,h=b,v=y}if(g.done)return n(i,v),c;if(null===v){for(;!g.done;m++,g=u.next())null!==(g=f(i,g.value,l))&&(s=o(g,s,m),null===h?c=g:h.sibling=g,h=g);return c}for(v=r(i,v);!g.done;m++,g=u.next())null!==(g=d(v,i,m,g.value,l))&&(t&&null!==g.alternate&&v.delete(null===g.key?m:g.key),s=o(g,s,m),null===h?c=g:h.sibling=g,h=g);return t&&v.forEach((function(t){return e(i,t)})),c}return function(t,r,o,u){var l="object"===typeof o&&null!==o&&o.type===nt&&null===o.key;l&&(o=o.props.children);var c="object"===typeof o&&null!==o;if(c)switch(o.$$typeof){case tt:t:{for(c=o.key,l=r;null!==l;){if(l.key===c){switch(l.tag){case 7:if(o.type===nt){n(t,l.sibling),(r=i(l,o.props.children)).return=t,t=r;break t}break;default:if(l.elementType===o.type){n(t,l.sibling),(r=i(l,o.props)).ref=Po(t,l,o),r.return=t,t=r;break t}}n(t,l);break}e(t,l),l=l.sibling}o.type===nt?((r=Lu(o.props.children,t.mode,u,o.key)).return=t,t=r):((u=Nu(o.type,o.key,o.props,null,t.mode,u)).ref=Po(t,r,o),u.return=t,t=u)}return s(t);case et:t:{for(l=o.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(t,r.sibling),(r=i(r,o.children||[])).return=t,t=r;break t}n(t,r);break}e(t,r),r=r.sibling}(r=Uu(o,t.mode,u)).return=t,t=r}return s(t)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(t,r.sibling),(r=i(r,o)).return=t,t=r):(n(t,r),(r=Fu(o,t.mode,u)).return=t,t=r),s(t);if(So(o))return v(t,r,o,u);if(vt(o))return m(t,r,o,u);if(c&&Oo(t,o),"undefined"===typeof o&&!l)switch(t.tag){case 1:case 0:throw t=t.type,Error(a(152,t.displayName||t.name||"Component"))}return n(t,r)}}var Co=Io(!0),Ao=Io(!1),ko={},Mo={current:ko},Ro={current:ko},Do={current:ko};function No(t){if(t===ko)throw Error(a(174));return t}function Lo(t,e){switch(pi(Do,e),pi(Ro,t),pi(Mo,ko),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ft(null,"");break;default:e=Ft(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}fi(Mo),pi(Mo,e)}function Fo(){fi(Mo),fi(Ro),fi(Do)}function Uo(t){No(Do.current);var e=No(Mo.current),n=Ft(e,t.type);e!==n&&(pi(Ro,t),pi(Mo,n))}function jo(t){Ro.current===t&&(fi(Mo),fi(Ro))}var Bo={current:0};function zo(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===yn||n.data===gn))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(64&e.effectTag))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Ho(t,e){return{responder:t,props:e}}var Xo=Q.ReactCurrentDispatcher,Wo=Q.ReactCurrentBatchConfig,Go=0,Vo=null,Yo=null,qo=null,Ko=!1;function Qo(){throw Error(a(321))}function $o(t,e){if(null===e)return!1;for(var n=0;no))throw Error(a(301));o+=1,qo=Yo=null,e.updateQueue=null,Xo.current=Ta,t=n(r,i)}while(e.expirationTime===Go)}if(Xo.current=_a,e=null!==Yo&&null!==Yo.next,Go=0,qo=Yo=Vo=null,Ko=!1,e)throw Error(a(300));return t}function Jo(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===qo?Vo.memoizedState=qo=t:qo=qo.next=t,qo}function ta(){if(null===Yo){var t=Vo.alternate;t=null!==t?t.memoizedState:null}else t=Yo.next;var e=null===qo?Vo.memoizedState:qo.next;if(null!==e)qo=e,Yo=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Yo=t).memoizedState,baseState:Yo.baseState,baseQueue:Yo.baseQueue,queue:Yo.queue,next:null},null===qo?Vo.memoizedState=qo=t:qo=qo.next=t}return qo}function ea(t,e){return"function"===typeof e?e(t):e}function na(t){var e=ta(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=Yo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var u=s=o=null,l=i;do{var c=l.expirationTime;if(cVo.expirationTime&&(Vo.expirationTime=c,du(c))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),pu(c,l.suspenseConfig),r=l.eagerReducer===t?l.eagerState:t(r,l.action);l=l.next}while(null!==l&&l!==i);null===u?o=r:u.next=s,zr(r,e.memoizedState)||(Da=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=u,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function ra(t){var e=ta(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=t(o,s.action),s=s.next}while(s!==i);zr(o,e.memoizedState)||(Da=!0),e.memoizedState=o,null===e.baseQueue&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function ia(t){var e=Jo();return"function"===typeof t&&(t=t()),e.memoizedState=e.baseState=t,t=(t=e.queue={pending:null,dispatch:null,lastRenderedReducer:ea,lastRenderedState:t}).dispatch=ba.bind(null,Vo,t),[e.memoizedState,t]}function oa(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===(e=Vo.updateQueue)?(e={lastEffect:null},Vo.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function aa(){return ta().memoizedState}function sa(t,e,n,r){var i=Jo();Vo.effectTag|=t,i.memoizedState=oa(1|e,n,void 0,void 0===r?null:r)}function ua(t,e,n,r){var i=ta();r=void 0===r?null:r;var o=void 0;if(null!==Yo){var a=Yo.memoizedState;if(o=a.destroy,null!==r&&$o(r,a.deps))return void oa(e,n,o,r)}Vo.effectTag|=t,i.memoizedState=oa(1|e,n,o,r)}function la(t,e){return sa(516,4,t,e)}function ca(t,e){return ua(516,4,t,e)}function ha(t,e){return ua(4,2,t,e)}function fa(t,e){return"function"===typeof e?(t=t(),e(t),function(){e(null)}):null!==e&&void 0!==e?(t=t(),e.current=t,function(){e.current=null}):void 0}function pa(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,ua(4,2,fa.bind(null,e,t),n)}function da(){}function va(t,e){return Jo().memoizedState=[t,void 0===e?null:e],t}function ma(t,e){var n=ta();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&$o(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function ya(t,e){var n=ta();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&$o(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function ga(t,e,n){var r=Wi();Vi(98>r?98:r,(function(){t(!0)})),Vi(97<\/script>",t=t.removeChild(t.firstChild)):"string"===typeof r.is?t=u.createElement(o,{is:r.is}):(t=u.createElement(o),"select"===o&&(u=t,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):t=u.createElementNS(t,o),t[In]=e,t[Cn]=r,Wa(t,e),e.stateNode=t,u=sn(o,r),o){case"iframe":case"object":case"embed":qe("load",t),l=r;break;case"video":case"audio":for(l=0;l<$t.length;l++)qe($t[l],t);l=r;break;case"source":qe("error",t),l=r;break;case"img":case"image":case"link":qe("error",t),qe("load",t),l=r;break;case"form":qe("reset",t),qe("submit",t),l=r;break;case"details":qe("toggle",t),l=r;break;case"input":Tt(t,r),l=wt(t,r),qe("invalid",t),ln(n,"onChange");break;case"option":l=It(t,r);break;case"select":t._wrapperState={wasMultiple:!!r.multiple},l=i({},r,{value:void 0}),qe("invalid",t),ln(n,"onChange");break;case"textarea":kt(t,r),l=At(t,r),qe("invalid",t),ln(n,"onChange");break;default:l=r}an(o,l);var c=l;for(s in c)if(c.hasOwnProperty(s)){var h=c[s];"style"===s?rn(t,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&&Bt(t,h):"children"===s?"string"===typeof h?("textarea"!==o||""!==h)&&zt(t,h):"number"===typeof h&&zt(t,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(E.hasOwnProperty(s)?null!=h&&ln(n,s):null!=h&&$(t,s,h,u))}switch(o){case"input":_t(t),Pt(t,r,!1);break;case"textarea":_t(t),Rt(t);break;case"option":null!=r.value&&t.setAttribute("value",""+gt(r.value));break;case"select":t.multiple=!!r.multiple,null!=(n=r.value)?Ct(t,!!r.multiple,n,!1):null!=r.defaultValue&&Ct(t,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof l.onClick&&(t.onclick=cn)}xn(o,r)&&(e.effectTag|=4)}null!==e.ref&&(e.effectTag|=128)}return null;case 6:if(t&&null!=e.stateNode)Va(0,e,t.memoizedProps,r);else{if("string"!==typeof r&&null===e.stateNode)throw Error(a(166));n=No(Do.current),No(Mo.current),ka(e)?(n=e.stateNode,r=e.memoizedProps,n[In]=e,n.nodeValue!==r&&(e.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[In]=e,e.stateNode=n)}return null;case 13:return fi(Bo),r=e.memoizedState,0!==(64&e.effectTag)?(e.expirationTime=n,e):(n=null!==r,r=!1,null===t?void 0!==e.memoizedProps.fallback&&ka(e):(r=null!==(o=t.memoizedState),n||null===o||null!==(o=t.child.sibling)&&(null!==(s=e.firstEffect)?(e.firstEffect=o,o.nextEffect=s):(e.firstEffect=e.lastEffect=o,o.nextEffect=null),o.effectTag=8)),n&&!r&&0!==(2&e.mode)&&(null===t&&!0!==e.memoizedProps.unstable_avoidThisFallback||0!==(1&Bo.current)?Ns===Is&&(Ns=Cs):(Ns!==Is&&Ns!==Cs||(Ns=As),0!==Bs&&null!==Ms&&(zu(Ms,Ds),Hu(Ms,Bs)))),(n||r)&&(e.effectTag|=4),null);case 4:return Fo(),null;case 10:return io(e),null;case 17:return bi(e.type)&&_i(),null;case 19:if(fi(Bo),null===(r=e.memoizedState))return null;if(o=0!==(64&e.effectTag),null===(s=r.rendering)){if(o)Ja(r,!1);else if(Ns!==Is||null!==t&&0!==(64&t.effectTag))for(s=e.child;null!==s;){if(null!==(t=zo(s))){for(e.effectTag|=64,Ja(r,!1),null!==(o=t.updateQueue)&&(e.updateQueue=o,e.effectTag|=4),null===r.lastEffect&&(e.firstEffect=null),e.lastEffect=r.lastEffect,r=e.child;null!==r;)s=n,(o=r).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(t=o.alternate)?(o.childExpirationTime=0,o.expirationTime=s,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=t.childExpirationTime,o.expirationTime=t.expirationTime,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,s=t.dependencies,o.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),r=r.sibling;return pi(Bo,1&Bo.current|2),e.child}s=s.sibling}}else{if(!o)if(null!==(t=zo(s))){if(e.effectTag|=64,o=!0,null!==(n=t.updateQueue)&&(e.updateQueue=n,e.effectTag|=4),Ja(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate)return null!==(e=e.lastEffect=r.lastEffect)&&(e.nextEffect=null),null}else 2*Xi()-r.renderingStartTime>r.tailExpiration&&1e)&&Qs.set(t,e))}}function ru(t,e){t.expirationTime=(t=n>(t=t.nextKnownPendingLevel)?n:t)&&e!==t?0:t}function ou(t){if(0!==t.lastExpiredTime)t.callbackExpirationTime=1073741823,t.callbackPriority=99,t.callbackNode=qi(su.bind(null,t));else{var e=iu(t),n=t.callbackNode;if(0===e)null!==n&&(t.callbackNode=null,t.callbackExpirationTime=0,t.callbackPriority=90);else{var r=tu();if(1073741823===e?r=99:1===e||2===e?r=95:r=0>=(r=10*(1073741821-e)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=t.callbackPriority;if(t.callbackExpirationTime===e&&i>=r)return;n!==Li&&Oi(n)}t.callbackExpirationTime=e,t.callbackPriority=r,e=1073741823===e?qi(su.bind(null,t)):Yi(r,au.bind(null,t),{timeout:10*(1073741821-e)-Xi()}),t.callbackNode=e}}}function au(t,e){if(Js=0,e)return Xu(t,e=tu()),ou(t),null;var n=iu(t);if(0!==n){if(e=t.callbackNode,0!==(48&ks))throw Error(a(327));if(Tu(),t===Ms&&n===Ds||cu(t,n),null!==Rs){var r=ks;ks|=Ps;for(var i=fu();;)try{mu();break}catch(u){hu(t,u)}if(ro(),ks=r,Es.current=i,1===Ns)throw e=Ls,cu(t,n),zu(t,n),ou(t),e;if(null===Rs)switch(i=t.finishedWork=t.current.alternate,t.finishedExpirationTime=n,r=Ns,Ms=null,r){case Is:case 1:throw Error(a(345));case 2:Xu(t,2=n){t.lastPingedTime=n,cu(t,n);break}}if(0!==(o=iu(t))&&o!==n)break;if(0!==r&&r!==n){t.lastPingedTime=r;break}t.timeoutHandle=Tn(_u.bind(null,t),i);break}_u(t);break;case As:if(zu(t,n),n===(r=t.lastSuspendedTime)&&(t.nextKnownPendingLevel=bu(i)),zs&&(0===(i=t.lastPingedTime)||i>=n)){t.lastPingedTime=n,cu(t,n);break}if(0!==(i=iu(t))&&i!==n)break;if(0!==r&&r!==n){t.lastPingedTime=r;break}if(1073741823!==Us?r=10*(1073741821-Us)-Xi():1073741823===Fs?r=0:(r=10*(1073741821-Fs)-5e3,0>(r=(i=Xi())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ts(r/1960))-r)&&(r=n)),10=(r=0|s.busyMinDurationMs)?r=0:(i=0|s.busyDelayMs,r=(o=Xi()-(10*(1073741821-o)-(0|s.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+yt(a))}5!==Ns&&(Ns=2),s=ns(s,a),h=o;do{switch(h.tag){case 3:u=s,h.effectTag|=4096,h.expirationTime=e,po(h,_s(h,u,e));break t;case 1:u=s;var _=h.type,x=h.stateNode;if(0===(64&h.effectTag)&&("function"===typeof _.getDerivedStateFromError||null!==x&&"function"===typeof x.componentDidCatch&&(null===Vs||!Vs.has(x)))){h.effectTag|=4096,h.expirationTime=e,po(h,xs(h,u,e));break t}}h=h.return}while(null!==h)}Rs=gu(Rs)}catch(w){e=w;continue}break}}function fu(){var t=Es.current;return Es.current=_a,null===t?_a:t}function pu(t,e){tBs&&(Bs=t)}function vu(){for(;null!==Rs;)Rs=yu(Rs)}function mu(){for(;null!==Rs&&!Fi();)Rs=yu(Rs)}function yu(t){var e=ws(t.alternate,t,Ds);return t.memoizedProps=t.pendingProps,null===e&&(e=gu(t)),Ss.current=null,e}function gu(t){Rs=t;do{var e=Rs.alternate;if(t=Rs.return,0===(2048&Rs.effectTag)){if(e=ts(e,Rs,Ds),1===Ds||1!==Rs.childExpirationTime){for(var n=0,r=Rs.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}Rs.childExpirationTime=n}if(null!==e)return e;null!==t&&0===(2048&t.effectTag)&&(null===t.firstEffect&&(t.firstEffect=Rs.firstEffect),null!==Rs.lastEffect&&(null!==t.lastEffect&&(t.lastEffect.nextEffect=Rs.firstEffect),t.lastEffect=Rs.lastEffect),1(t=t.childExpirationTime)?e:t}function _u(t){var e=Wi();return Vi(99,xu.bind(null,t,e)),null}function xu(t,e){do{Tu()}while(null!==qs);if(0!==(48&ks))throw Error(a(327));var n=t.finishedWork,r=t.finishedExpirationTime;if(null===n)return null;if(t.finishedWork=null,t.finishedExpirationTime=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackExpirationTime=0,t.callbackPriority=90,t.nextKnownPendingLevel=0;var i=bu(n);if(t.firstPendingTime=i,r<=t.lastSuspendedTime?t.firstSuspendedTime=t.lastSuspendedTime=t.nextKnownPendingLevel=0:r<=t.firstSuspendedTime&&(t.firstSuspendedTime=r-1),r<=t.lastPingedTime&&(t.lastPingedTime=0),r<=t.lastExpiredTime&&(t.lastExpiredTime=0),t===Ms&&(Rs=Ms=null,Ds=0),1u&&(c=u,u=s,s=c),c=pn(_,s),h=pn(_,u),c&&h&&(1!==w.rangeCount||w.anchorNode!==c.node||w.anchorOffset!==c.offset||w.focusNode!==h.node||w.focusOffset!==h.offset)&&((x=x.createRange()).setStart(c.node,c.offset),w.removeAllRanges(),s>u?(w.addRange(x),w.extend(h.node,h.offset)):(x.setEnd(h.node,h.offset),w.addRange(x))))),x=[];for(w=_;w=w.parentNode;)1===w.nodeType&&x.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"===typeof _.focus&&_.focus(),_=0;_=n?qa(t,e,n):(pi(Bo,1&Bo.current),null!==(e=Za(t,e,n))?e.sibling:null);pi(Bo,1&Bo.current);break;case 19:if(r=e.childExpirationTime>=n,0!==(64&t.effectTag)){if(r)return $a(t,e,n);e.effectTag|=64}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null),pi(Bo,Bo.current),!r)return null}return Za(t,e,n)}Da=!1}}else Da=!1;switch(e.expirationTime=0,e.tag){case 2:if(r=e.type,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,i=gi(e,vi.current),ao(e,n),i=Zo(null,e,r,t,i,n),e.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,bi(r)){var o=!0;Ti(e)}else o=!1;e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,lo(e);var s=r.getDerivedStateFromProps;"function"===typeof s&&bo(e,r,s,t),i.updater=_o,e.stateNode=i,i._reactInternalFiber=e,Eo(e,r,t,n),e=Ha(null,e,r,!0,o,n)}else e.tag=0,Na(null,e,i,n),e=e.child;return e;case 16:t:{if(i=e.elementType,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,function(t){if(-1===t._status){t._status=0;var e=t._ctor;e=e(),t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,e.type=i,o=e.tag=function(t){if("function"===typeof t)return Ru(t)?1:0;if(void 0!==t&&null!==t){if((t=t.$$typeof)===ut)return 11;if(t===ht)return 14}return 2}(i),t=Zi(i,t),o){case 0:e=Ba(null,e,i,t,n);break t;case 1:e=za(null,e,i,t,n);break t;case 11:e=La(null,e,i,t,n);break t;case 14:e=Fa(null,e,i,Zi(i.type,t),r,n);break t}throw Error(a(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,Ba(t,e,r,i=e.elementType===r?i:Zi(r,i),n);case 1:return r=e.type,i=e.pendingProps,za(t,e,r,i=e.elementType===r?i:Zi(r,i),n);case 3:if(Xa(e),r=e.updateQueue,null===t||null===r)throw Error(a(282));if(r=e.pendingProps,i=null!==(i=e.memoizedState)?i.element:null,co(t,e),vo(e,r,null,n),(r=e.memoizedState.element)===i)Ma(),e=Za(t,e,n);else{if((i=e.stateNode.hydrate)&&(Sa=Sn(e.stateNode.containerInfo.firstChild),Ea=e,i=Pa=!0),i)for(n=Ao(e,null,r,n),e.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Na(t,e,r,n),Ma();e=e.child}return e;case 5:return Uo(e),null===t&&Ca(e),r=e.type,i=e.pendingProps,o=null!==t?t.memoizedProps:null,s=i.children,wn(r,i)?s=null:null!==o&&wn(r,o)&&(e.effectTag|=16),ja(t,e),4&e.mode&&1!==n&&i.hidden?(e.expirationTime=e.childExpirationTime=1,e=null):(Na(t,e,s,n),e=e.child),e;case 6:return null===t&&Ca(e),null;case 13:return qa(t,e,n);case 4:return Lo(e,e.stateNode.containerInfo),r=e.pendingProps,null===t?e.child=Co(e,null,r,n):Na(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,La(t,e,r,i=e.elementType===r?i:Zi(r,i),n);case 7:return Na(t,e,e.pendingProps,n),e.child;case 8:case 12:return Na(t,e,e.pendingProps.children,n),e.child;case 10:t:{r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value;var u=e.type._context;if(pi(Ji,u._currentValue),u._currentValue=o,null!==s)if(u=s.value,0===(o=zr(u,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(s.children===i.children&&!mi.current){e=Za(t,e,n);break t}}else for(null!==(u=e.child)&&(u.return=e);null!==u;){var l=u.dependencies;if(null!==l){s=u.child;for(var c=l.firstContext;null!==c;){if(c.context===r&&0!==(c.observedBits&o)){1===u.tag&&((c=ho(n,null)).tag=2,fo(u,c)),u.expirationTime=e&&t<=e}function zu(t,e){var n=t.firstSuspendedTime,r=t.lastSuspendedTime;ne||0===n)&&(t.lastSuspendedTime=e),e<=t.lastPingedTime&&(t.lastPingedTime=0),e<=t.lastExpiredTime&&(t.lastExpiredTime=0)}function Hu(t,e){e>t.firstPendingTime&&(t.firstPendingTime=e);var n=t.firstSuspendedTime;0!==n&&(e>=n?t.firstSuspendedTime=t.lastSuspendedTime=t.nextKnownPendingLevel=0:e>=t.lastSuspendedTime&&(t.lastSuspendedTime=e+1),e>t.nextKnownPendingLevel&&(t.nextKnownPendingLevel=e))}function Xu(t,e){var n=t.lastExpiredTime;(0===n||n>e)&&(t.lastExpiredTime=e)}function Wu(t,e,n,r){var i=e.current,o=tu(),s=yo.suspense;o=eu(o,i,s);t:if(n){e:{if(te(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(bi(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var l=n.type;if(bi(l)){n=wi(n,l,u);break t}}n=u}else n=di;return null===e.context?e.context=n:e.pendingContext=n,(e=ho(o,s)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),fo(i,e),nu(i,o),o}function Gu(t){if(!(t=t.current).child)return null;switch(t.child.tag){case 5:default:return t.child.stateNode}}function Vu(t,e){null!==(t=t.memoizedState)&&null!==t.dehydrated&&t.retryTime=w},s=function(){},e.unstable_forceFrameRate=function(t){0>t||125>>1,i=t[r];if(!(void 0!==i&&0I(a,n))void 0!==u&&0>I(u,a)?(t[r]=u,t[s]=n,r=s):(t[r]=a,t[o]=n,r=o);else{if(!(void 0!==u&&0>I(u,n)))break t;t[r]=u,t[s]=n,r=s}}}return e}return null}function I(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}var C=[],A=[],k=1,M=null,R=3,D=!1,N=!1,L=!1;function F(t){for(var e=P(A);null!==e;){if(null===e.callback)O(A);else{if(!(e.startTime<=t))break;O(A),e.sortIndex=e.expirationTime,S(C,e)}e=P(A)}}function U(t){if(L=!1,F(t),!N)if(null!==P(C))N=!0,r(j);else{var e=P(A);null!==e&&i(U,e.startTime-t)}}function j(t,n){N=!1,L&&(L=!1,o()),D=!0;var r=R;try{for(F(n),M=P(C);null!==M&&(!(M.expirationTime>n)||t&&!a());){var s=M.callback;if(null!==s){M.callback=null,R=M.priorityLevel;var u=s(M.expirationTime<=n);n=e.unstable_now(),"function"===typeof u?M.callback=u:M===P(C)&&O(C),F(n)}else O(C);M=P(C)}if(null!==M)var l=!0;else{var c=P(A);null!==c&&i(U,c.startTime-n),l=!1}return l}finally{M=null,R=r,D=!1}}function B(t){switch(t){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var z=s;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){N||D||(N=!0,r(j))},e.unstable_getCurrentPriorityLevel=function(){return R},e.unstable_getFirstCallbackNode=function(){return P(C)},e.unstable_next=function(t){switch(R){case 1:case 2:case 3:var e=3;break;default:e=R}var n=R;R=e;try{return t()}finally{R=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=z,e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=R;R=t;try{return e()}finally{R=n}},e.unstable_scheduleCallback=function(t,n,a){var s=e.unstable_now();if("object"===typeof a&&null!==a){var u=a.delay;u="number"===typeof u&&0s?(t.sortIndex=u,S(A,t),null===P(C)&&t===P(A)&&(L?o():L=!0,i(U,u-s))):(t.sortIndex=a,S(C,t),N||D||(N=!0,r(j))),t},e.unstable_shouldYield=function(){var t=e.unstable_now();F(t);var n=P(C);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTime=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(59),e.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i=1,o={},a=!1,s=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){c(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"===typeof n.data&&0===n.data.indexOf(e)&&c(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),r=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){c(t.data)},r=function(e){t.port2.postMessage(e)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var t=s.documentElement;r=function(e){var n=s.createElement("script");n.onreadystatechange=function(){c(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():r=function(t){setTimeout(c,0,t)},u.setImmediate=function(t){"function"!==typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,v=String.fromCharCode;function m(t){throw new RangeError(p[t])}function y(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function g(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+y((t=t.replace(f,".")).split("."),e).join(".")}function b(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=v((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=v(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,n){var r=0;for(t=n?d(t/700):t>>1,t+=d(t/e);t>455;r+=l)t=d(t/35);return d(r+36*t/(t+38))}function T(t){var e,n,r,i,o,a,s,c,h,f,p,v=[],y=t.length,g=0,b=128,x=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&m("not-basic"),v.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=y&&m("invalid-input"),((c=(p=t.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:l)>=l||c>d((u-g)/a))&&m("overflow"),g+=c*a,!(c<(h=s<=x?1:s>=x+26?26:s-x));s+=l)a>d(u/(f=l-h))&&m("overflow"),a*=f;x=w(g-o,e=v.length+1,0==o),d(g/e)>u-b&&m("overflow"),b+=d(g/e),g%=e,v.splice(g++,0,b)}return _(v)}function E(t){var e,n,r,i,o,a,s,c,h,f,p,y,g,_,T,E=[];for(y=(t=b(t)).length,e=128,n=0,o=72,a=0;a=e&&pd((u-n)/(g=r+1))&&m("overflow"),n+=(s-e)*g,e=s,a=0;au&&m("overflow"),p==e){for(c=n,h=l;!(c<(f=h<=o?1:h>=o+26?26:h-o));h+=l)T=c-f,_=l-f,E.push(v(x(f+T%_,0))),c=d(T/_);E.push(v(x(c,0))),o=w(n,g,r==i),n=0,++r}++n,++e}return E.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:_},decode:T,encode:E,toASCII:function(t){return g(t,(function(t){return h.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return g(t,(function(t){return c.test(t)?T(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(62)(t),n(11))},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,n){"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,n){"use strict";e.decode=e.parse=n(65),e.encode=e.stringify=n(66)},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,n,o){e=e||"&",n=n||"=";var a={};if("string"!==typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var u=1e3;o&&"number"===typeof o.maxKeys&&(u=o.maxKeys);var l=t.length;u>0&&l>u&&(l=u);for(var c=0;c=0?(h=v.substr(0,m),f=v.substr(m+1)):(h=v,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),r(a,p)?i(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=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,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"===typeof t?o(a(t),(function(a){var s=encodeURIComponent(r(a))+n;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(r(t))})).join(e):s+encodeURIComponent(r(t[a]))})).join(e):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(t)):""};var i=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 n=[],r=0;r0&&r.length<3,"The property `%s` is a PIXI.Point or PIXI.ObservablePoint and must be set to a comma-separated string of either 1 or 2 coordinates, a 1 or 2 element array containing coordinates, or a PIXI Point/ObservablePoint. If only one coordinate is given then X and Y will be set to the provided value. Received: `%s` of type `%s`.",e,JSON.stringify(n),c(n)),t[e].set(r.shift(),r.shift())}else t[e]=n}var X={};function W(t,e){return function(n,r,i){if(null!=n[r]){var o='"'.concat(r,'" property of "').concat(i,'" has been deprecated.\n').concat(e);X[o]||(k(!1,o),X[o]=!0)}for(var a=arguments.length,s=new Array(a>3?a-3:0),u=3;u Element'."))}},width:a.number}),children:a.node,height:W(a.number,"Pass `height` in `options` prop instead."),width:W(a.number,"Pass `height` in `options` prop instead.")},V=L(Object.keys(D).concat(N)),Y=L(Object.keys(G)),q=function(t){return!V(t)&&!Y(t)},K=function(t){return U(t,q)};var Q=new Map;function $(t){return function(e,r,i,o){var a=Q.get(r);return a||(a=t.createContainer(r),Q.set(r,a),t.injectIntoDevTools({findFiberByHostInstance:t.findFiberByHostInstance,bundleType:0,version:n(1).version,rendererPackageName:"react-pixi-fiber"})),t.updateContainer(e,a,o,i),t.getPublicRootInstance(a)}}function Z(t){return function(e){var n=Q.get(e);w(n,"ReactPixiFiber did not render into container provided"),t.updateContainer(null,n)}}var J="undefined"!=typeof window?window:"undefined"!=typeof t?t:"undefined"!=typeof self?self:{};function tt(t,e){return t(e={exports:{}},e.exports),e.exports}var et=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;function it(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var ot=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={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,i=it(t),o=1;oOt||(t.current=Pt[Ot],Pt[Ot]=null,Ot--)}function Ct(t,e){Pt[++Ot]=t.current,t.current=e}var At={},kt={current:At},Mt={current:!1},Rt=At;function Dt(t,e){var n=t.type.contextTypes;if(!n)return At;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function Nt(t){return null!=t.childContextTypes}function Lt(t){It(Mt),It(kt)}function Ft(t){It(Mt),It(kt)}function Ut(t,e,n){if(kt.current!==At)throw s(Error(168));Ct(kt,e),Ct(Mt,n)}function jt(t,e,n){var i=t.stateNode;if(t=e.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var o in i=i.getChildContext())if(!(o in t))throw s(Error(108),P(e)||"Unknown",o);return r({},n,i)}function Bt(t){var e=t.stateNode;return e=e&&e.__reactInternalMemoizedMergedChildContext||At,Rt=kt.current,Ct(kt,e),Ct(Mt,Mt.current),!0}function zt(t,e,n){var r=t.stateNode;if(!r)throw s(Error(169));n?(e=jt(t,e,Rt),r.__reactInternalMemoizedMergedChildContext=e,It(Mt),It(kt),Ct(kt,e)):It(Mt),Ct(Mt,n)}var Ht=a.unstable_runWithPriority,Xt=a.unstable_scheduleCallback,Wt=a.unstable_cancelCallback,Gt=a.unstable_shouldYield,Vt=a.unstable_requestPaint,Yt=a.unstable_now,qt=a.unstable_getCurrentPriorityLevel,Kt=a.unstable_ImmediatePriority,Qt=a.unstable_UserBlockingPriority,$t=a.unstable_NormalPriority,Zt=a.unstable_LowPriority,Jt=a.unstable_IdlePriority,te={},ee=void 0!==Vt?Vt:function(){},ne=null,re=null,ie=!1,oe=Yt(),ae=1e4>oe?Yt:function(){return Yt()-oe};function se(){switch(qt()){case Kt:return 99;case Qt:return 98;case $t:return 97;case Zt:return 96;case Jt:return 95;default:throw s(Error(332))}}function ue(t){switch(t){case 99:return Kt;case 98:return Qt;case 97:return $t;case 96:return Zt;case 95:return Jt;default:throw s(Error(332))}}function le(t,e){return t=ue(t),Ht(t,e)}function ce(t,e,n){return t=ue(t),Xt(t,e,n)}function he(t){return null===ne?(ne=[t],re=Xt(Kt,pe)):ne.push(t),te}function fe(){null!==re&&Wt(re),pe()}function pe(){if(!ie&&null!==ne){ie=!0;var t=0;try{var e=ne;le(99,(function(){for(;t=(t=10*(1073741821-e)-10*(1073741821-t))?99:250>=t?98:5250>=t?97:95}function ve(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e}var me=Object.prototype.hasOwnProperty;function ye(t,e){if(ve(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r=e&&(er=!0),t.firstContext=null)}function Ie(t,e){if(we!==t&&!1!==e&&0!==e)if("number"==typeof e&&1073741823!==e||(we=t,e=1073741823),e={context:t,observedBits:e,next:null},null===xe){if(null===_e)throw s(Error(308));xe=e,_e.dependencies={expirationTime:0,firstContext:e,responders:null}}else xe=xe.next=e;return V?t._currentValue:t._currentValue2}var Ce=!1;function Ae(t){return{baseState:t,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function ke(t){return{baseState:t.baseState,firstUpdate:t.firstUpdate,lastUpdate:t.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Me(t,e){return{expirationTime:t,suspenseConfig:e,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Re(t,e){null===t.lastUpdate?t.firstUpdate=t.lastUpdate=e:(t.lastUpdate.next=e,t.lastUpdate=e)}function De(t,e){var n=t.alternate;if(null===n){var r=t.updateQueue,i=null;null===r&&(r=t.updateQueue=Ae(t.memoizedState))}else r=t.updateQueue,i=n.updateQueue,null===r?null===i?(r=t.updateQueue=Ae(t.memoizedState),i=n.updateQueue=Ae(n.memoizedState)):r=t.updateQueue=ke(i):null===i&&(i=n.updateQueue=ke(r));null===i||r===i?Re(r,e):null===r.lastUpdate||null===i.lastUpdate?(Re(r,e),Re(i,e)):(Re(r,e),i.lastUpdate=e)}function Ne(t,e){var n=t.updateQueue;null===(n=null===n?t.updateQueue=Ae(t.memoizedState):Le(t,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=e:(n.lastCapturedUpdate.next=e,n.lastCapturedUpdate=e)}function Le(t,e){var n=t.alternate;return null!==n&&e===n.updateQueue&&(e=t.updateQueue=ke(e)),e}function Fe(t,e,n,i,o,a){switch(n.tag){case 1:return"function"==typeof(t=n.payload)?t.call(a,i,o):t;case 3:t.effectTag=-2049&t.effectTag|64;case 0:if(null==(o="function"==typeof(t=n.payload)?t.call(a,i,o):t))break;return r({},i,o);case 2:Ce=!0}return i}function Ue(t,e,n,r,i){Ce=!1;for(var o=(e=Le(t,e)).baseState,a=null,s=0,u=e.firstUpdate,l=o;null!==u;){var c=u.expirationTime;cf?(p=h,h=null):p=h.sibling;var d=m(i,h,s[f],u);if(null===d){null===h&&(h=p);break}t&&h&&null===d.alternate&&e(i,h),a=o(d,a,f),null===c?l=d:c.sibling=d,c=d,h=p}if(f===s.length)return n(i,h),l;if(null===h){for(;fp?(d=f,f=null):d=f.sibling;var b=m(i,f,g.value,l);if(null===b){null===f&&(f=d);break}t&&f&&null===b.alternate&&e(i,f),a=o(b,a,p),null===h?c=b:h.sibling=b,h=b,f=d}if(g.done)return n(i,f),c;if(null===f){for(;!g.done;p++,g=u.next())null!==(g=v(i,g.value,l))&&(a=o(g,a,p),null===h?c=g:h.sibling=g,h=g);return c}for(f=r(i,f);!g.done;p++,g=u.next())null!==(g=y(f,i,p,g.value,l))&&(t&&null!==g.alternate&&f.delete(null===g.key?p:g.key),a=o(g,a,p),null===h?c=g:h.sibling=g,h=g);return t&&f.forEach((function(t){return e(i,t)})),c}return function(t,r,o,u){var l="object"==typeof o&&null!==o&&o.type===p&&null===o.key;l&&(o=o.props.children);var c="object"==typeof o&&null!==o;if(c)switch(o.$$typeof){case h:t:{for(c=o.key,l=r;null!==l;){if(l.key===c){if(7===l.tag?o.type===p:l.elementType===o.type){n(t,l.sibling),(r=i(l,o.type===p?o.props.children:o.props)).ref=Qe(t,l,o),r.return=t,t=r;break t}n(t,l);break}e(t,l),l=l.sibling}o.type===p?((r=Ui(o.props.children,t.mode,u,o.key)).return=t,t=r):((u=Fi(o.type,o.key,o.props,null,t.mode,u)).ref=Qe(t,r,o),u.return=t,t=u)}return a(t);case f:t:{for(l=o.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(t,r.sibling),(r=i(r,o.children||[])).return=t,t=r;break t}n(t,r);break}e(t,r),r=r.sibling}(r=Bi(o,t.mode,u)).return=t,t=r}return a(t)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(t,r.sibling),(r=i(r,o)).return=t,t=r):(n(t,r),(r=ji(o,t.mode,u)).return=t,t=r),a(t);if(Ke(o))return g(t,r,o,u);if(S(o))return b(t,r,o,u);if(c&&$e(t,o),void 0===o&&!l)switch(t.tag){case 1:case 0:throw t=t.type,s(Error(152),t.displayName||t.name||"Component")}return n(t,r)}}var Je=Ze(!0),tn=Ze(!1),en={},nn={current:en},rn={current:en},on={current:en};function an(t){if(t===en)throw s(Error(174));return t}function sn(t,e){Ct(on,e),Ct(rn,t),Ct(nn,en),e=M(e),It(nn),Ct(nn,e)}function un(t){It(nn),It(rn),It(on)}function ln(t){var e=an(on.current),n=an(nn.current);n!==(e=R(n,t.type,e))&&(Ct(rn,t),Ct(nn,e))}function cn(t){rn.current===t&&(It(nn),It(rn))}var hn={current:0};function fn(t){for(var e=t;null!==e;){if(13===e.tag){if(null!==e.memoizedState)return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(64&e.effectTag))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function pn(t,e){return{responder:t,props:e}}var dn=u.ReactCurrentDispatcher,vn=0,mn=null,yn=null,gn=null,bn=null,_n=null,xn=null,wn=0,Tn=null,En=0,Sn=!1,Pn=null,On=0;function In(){throw s(Error(321))}function Cn(t,e){if(null===e)return!1;for(var n=0;nwn&&(wn=h)):(wi(h,l.suspenseConfig),o=l.eagerReducer===t?l.eagerState:t(o,l.action)),a=l,l=l.next}while(null!==l&&l!==r);c||(u=a,i=o),ve(o,e.memoizedState)||(er=!0),e.memoizedState=o,e.baseUpdate=u,e.baseState=i,n.lastRenderedState=o}return[e.memoizedState,n.dispatch]}function Ln(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===Tn?(Tn={lastEffect:null}).lastEffect=t.next=t:null===(e=Tn.lastEffect)?Tn.lastEffect=t.next=t:(n=e.next,e.next=t,t.next=n,Tn.lastEffect=t),t}function Fn(t,e,n,r){var i=Mn();En|=t,i.memoizedState=Ln(e,n,void 0,void 0===r?null:r)}function Un(t,e,n,r){var i=Rn();r=void 0===r?null:r;var o=void 0;if(null!==yn){var a=yn.memoizedState;if(o=a.destroy,null!==r&&Cn(r,a.deps))return void Ln(0,n,o,r)}En|=t,i.memoizedState=Ln(e,n,o,r)}function jn(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function Bn(){}function zn(t,e,n){if(!(25>On))throw s(Error(301));var r=t.alternate;if(t===mn||null!==r&&r===mn)if(Sn=!0,t={expirationTime:vn,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Pn&&(Pn=new Map),void 0===(n=Pn.get(e)))Pn.set(e,t);else{for(e=n;null!==e.next;)e=e.next;e.next=t}else{var i=pi(),o=ze.suspense;o={expirationTime:i=di(i,t,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var a=e.last;if(null===a)o.next=o;else{var u=a.next;null!==u&&(o.next=u),a.next=o}if(e.last=o,0===t.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=e.lastRenderedReducer))try{var l=e.lastRenderedState,c=r(l,n);if(o.eagerReducer=r,o.eagerState=c,ve(c,l))return}catch(t){}mi(t,i)}}var Hn={readContext:Ie,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useLayoutEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useResponder:In},Xn={readContext:Ie,useCallback:function(t,e){return Mn().memoizedState=[t,void 0===e?null:e],t},useContext:Ie,useEffect:function(t,e){return Fn(516,192,t,e)},useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Fn(4,36,jn.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Fn(4,36,t,e)},useMemo:function(t,e){var n=Mn();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Mn();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,t=(t=r.queue={last:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e}).dispatch=zn.bind(null,mn,t),[r.memoizedState,t]},useRef:function(t){return t={current:t},Mn().memoizedState=t},useState:function(t){var e=Mn();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t=(t=e.queue={last:null,dispatch:null,lastRenderedReducer:Dn,lastRenderedState:t}).dispatch=zn.bind(null,mn,t),[e.memoizedState,t]},useDebugValue:Bn,useResponder:pn},Wn={readContext:Ie,useCallback:function(t,e){var n=Rn();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&Cn(e,r[1])?r[0]:(n.memoizedState=[t,e],t)},useContext:Ie,useEffect:function(t,e){return Un(516,192,t,e)},useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Un(4,36,jn.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Un(4,36,t,e)},useMemo:function(t,e){var n=Rn();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&Cn(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)},useReducer:Nn,useRef:function(){return Rn().memoizedState},useState:function(t){return Nn(Dn)},useDebugValue:Bn,useResponder:pn},Gn=null,Vn=null,Yn=!1;function qn(t,e){var n=Di(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.effectTag=8,null!==t.lastEffect?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function Kn(t,e){switch(t.tag){case 5:return null!==(e=gt(e,t.type,t.pendingProps))&&(t.stateNode=e,!0);case 6:return null!==(e=bt(e,t.pendingProps))&&(t.stateNode=e,!0);case 13:default:return!1}}function Qn(t){if(Yn){var e=Vn;if(e){var n=e;if(!Kn(t,e)){if(!(e=_t(n))||!Kn(t,e))return t.effectTag|=2,Yn=!1,void(Gn=t);qn(Gn,n)}Gn=t,Vn=xt(e)}else t.effectTag|=2,Yn=!1,Gn=t}}function $n(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&18!==t.tag;)t=t.return;Gn=t}function Zn(t){if(!K||t!==Gn)return!1;if(!Yn)return $n(t),Yn=!0,!1;var e=t.type;if(5!==t.tag||"head"!==e&&"body"!==e&&!B(e,t.memoizedProps))for(e=Vn;e;)qn(t,e),e=_t(e);return $n(t),Vn=Gn?_t(t.stateNode):null,!0}function Jn(){K&&(Vn=Gn=null,Yn=!1)}var tr=u.ReactCurrentOwner,er=!1;function nr(t,e,n,r){e.child=null===t?tn(e,null,n,r):Je(e,t.child,n,r)}function rr(t,e,n,r,i){n=n.render;var o=e.ref;return Oe(e,i),r=An(t,e,n,r,o,i),null===t||er?(e.effectTag|=1,nr(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.effectTag&=-517,t.expirationTime<=i&&(t.expirationTime=0),vr(t,e,i))}function ir(t,e,n,r,i,o){if(null===t){var a=n.type;return"function"!=typeof a||Ni(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=Fi(n.type,null,r,null,e.mode,o)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=a,or(t,e,a,r,i,o))}return a=t.child,ie)&&li.set(t,e))}}function yi(t,e){t.expirationTimei.firstPendingTime&&(i.firstPendingTime=e),0===(t=i.lastPendingTime)||e component higher in the tree to provide a loading indicator or placeholder to display."+St(l))}4!==Kr&&(Kr=1),c=Er(c,l),l=u;do{switch(l.tag){case 3:l.effectTag|=2048,l.expirationTime=h,Ne(l,h=Ur(l,c,h));break t;case 1:if(f=c,a=l.type,u=l.stateNode,0==(64&l.effectTag)&&("function"==typeof a.getDerivedStateFromError||null!==u&&"function"==typeof u.componentDidCatch&&(null===ii||!ii.has(u)))){l.effectTag|=2048,l.expirationTime=h,Ne(l,h=jr(l,f,h));break t}}l=l.return}while(null!==l)}Yr=Ei(o)}if(Gr=r,Te(),zr.current=i,null!==Yr)return xi.bind(null,t,e)}if(t.finishedWork=t.current.alternate,t.finishedExpirationTime=e,function(t,e){var n=t.firstBatch;return!!(null!==n&&n._defer&&n._expirationTime>=e)&&(ce(97,(function(){return n._onComplete(),null})),!0)}(t,e))return null;switch(Vr=null,Kr){case 0:throw s(Error(328));case 1:return(r=t.lastPendingTime)(n=(r=ae())-n)&&(n=0),(e=10*(1073741821-e)-r)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Br(n/1960))-n)&&(n=e)),10=(e=0|(i=Zr).busyMinDurationMs)?e=0:(n=0|i.busyDelayMs,e=(r=ae()-(10*(1073741821-r)-(0|i.timeoutMs||5e3)))<=n?0:n+e-r),10i.tailExpiration&&1r&&(r=o),(a=i.childExpirationTime)>r&&(r=a),i=i.sibling;n.childExpirationTime=r}if(null!==e)return e;null!==t&&0==(1024&t.effectTag)&&(null===t.firstEffect&&(t.firstEffect=Yr.firstEffect),null!==Yr.lastEffect&&(null!==t.lastEffect&&(t.lastEffect.nextEffect=Yr.firstEffect),t.lastEffect=Yr.lastEffect),1i?o:i,t.firstPendingTime=i,i=n?fr(t,e,n):(Ct(hn,1&hn.current),null!==(e=vr(t,e,n))?e.sibling:null);Ct(hn,1&hn.current);break;case 19:if(r=e.childExpirationTime>=n,0!=(64&t.effectTag)){if(r)return dr(t,e,n);e.effectTag|=64}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null),Ct(hn,hn.current),!r)return null}return vr(t,e,n)}}else er=!1;switch(e.expirationTime=0,e.tag){case 2:if(r=e.type,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,i=Dt(e,kt.current),Oe(e,n),i=An(null,e,r,t,i,n),e.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(e.tag=1,kn(),Nt(r)){var o=!0;Bt(e)}else o=!1;e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var a=r.getDerivedStateFromProps;"function"==typeof a&&Xe(e,r,a,t),i.updater=We,e.stateNode=i,i._reactInternalFiber=e,qe(e,r,t,n),e=lr(null,e,r,!0,o,n)}else e.tag=0,nr(null,e,i,n),e=e.child;return e;case 16:switch(i=e.elementType,null!==t&&(t.alternate=null,e.alternate=null,e.effectTag|=2),t=e.pendingProps,i=function(t){var e=t._result;switch(t._status){case 1:return e;case 2:case 0:throw e;default:switch(t._status=0,(e=(e=t._ctor)()).then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)})),t._status){case 1:return t._result;case 2:throw t._result}throw t._result=e,e}}(i),e.type=i,o=e.tag=function(t){if("function"==typeof t)return Ni(t)?1:0;if(null!=t){if((t=t.$$typeof)===b)return 11;if(t===w)return 14}return 2}(i),t=ge(i,t),o){case 0:e=sr(null,e,i,t,n);break;case 1:e=ur(null,e,i,t,n);break;case 11:e=rr(null,e,i,t,n);break;case 14:e=ir(null,e,i,ge(i.type,t),r,n);break;default:throw s(Error(306),i,"")}return e;case 0:return r=e.type,i=e.pendingProps,sr(t,e,r,i=e.elementType===r?i:ge(r,i),n);case 1:return r=e.type,i=e.pendingProps,ur(t,e,r,i=e.elementType===r?i:ge(r,i),n);case 3:if(cr(e),null===(r=e.updateQueue))throw s(Error(282));return i=null!==(i=e.memoizedState)?i.element:null,Ue(e,r,e.pendingProps,null,n),(r=e.memoizedState.element)===i?(Jn(),e=vr(t,e,n)):(i=e.stateNode,(i=(null===t||null===t.child)&&i.hydrate)&&(K?(Vn=xt(e.stateNode.containerInfo),Gn=e,i=Yn=!0):i=!1),i?(e.effectTag|=2,e.child=tn(e,null,r,n)):(nr(t,e,r,n),Jn()),e=e.child),e;case 5:return ln(e),null===t&&Qn(e),r=e.type,i=e.pendingProps,o=null!==t?t.memoizedProps:null,a=i.children,B(r,i)?a=null:null!==o&&B(r,o)&&(e.effectTag|=16),ar(t,e),4&e.mode&&1!==n&&z(r,i)?(e.expirationTime=e.childExpirationTime=1,e=null):(nr(t,e,a,n),e=e.child),e;case 6:return null===t&&Qn(e),null;case 13:return fr(t,e,n);case 4:return sn(e,e.stateNode.containerInfo),r=e.pendingProps,null===t?e.child=Je(e,null,r,n):nr(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,rr(t,e,r,i=e.elementType===r?i:ge(r,i),n);case 7:return nr(t,e,e.pendingProps,n),e.child;case 8:case 12:return nr(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,Ee(e,o=i.value),null!==a){var u=a.value;if(0===(o=ve(u,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(a.children===i.children&&!Mt.current){e=vr(t,e,n);break t}}else for(null!==(u=e.child)&&(u.return=e);null!==u;){var l=u.dependencies;if(null!==l){a=u.child;for(var c=l.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===u.tag&&((c=Me(n,null)).tag=2,De(u,c)),u.expirationTime1)for(var n=1;n0,r=void 0===e.renderable||!0===e.renderable,i=void 0===e.visible||!0===e.visible;return!(n&&r&&i)},shouldSetTextContent:function(t,e){return!1},supportsMutation:!0},Kt=st(m({},qt,{isPrimaryRenderer:!0})),Qt=st(m({},qt,{isPrimaryRenderer:!1})),$t=Kt.batchedUpdates;function Zt(){return i.useContext(e.AppContext)}function Jt(t){var e=t.app;w(null==e||e instanceof s.Application,"Provided `app` has to be an instance of PIXI.Application");var n=t.options,r=t.width,a=t.height,u=x(i.useState(null),2),l=u[0],c=u[1],h=i.useRef(),f=function(t,e){var n=t.app,r=t.options;if(void 0!==r&&r.view)return null;if(n instanceof s.Application)return null;var i=K(t);return o.createElement("canvas",v({ref:e},i))}(t,h);return i.useLayoutEffect((function(){var t=Z(Qt),i=h.current,o=e||B(m({height:a,width:r,view:i},n));return c(o),function(){t(o.stage),e instanceof s.Application||o.destroy()}}),[e,n,r,a]),{app:l,canvas:f}}var te=$(Qt),ee=Z(Qt),ne=(L(Object.keys(D).concat(N)),function(t,e,n){var r=o.createElement(O,{app:t},e.children),i=function(t){return U(t,V)}(e);Wt(t.stage,{},i),"object"===c(n)?te(r,t.stage,void 0,n):te(r,t.stage)}),re=function(t){var e=t.options,n=t.width,r=t.height;return[e&&e.width||n,e&&e.height||r]},ie=function(t,e,n){var r=x(re(e),2),i=r[0],o=r[1],a=x(re(n),2),s=a[0],u=a[1];u===o&&s===i||t.renderer.resize(s,u)};function oe(){var t=function(t){function e(){return h(this,e),_(this,g(e).apply(this,arguments))}return y(e,o.Component),p(e,[{key:"componentDidMount",value:function(){var t=this.props,e=t.app,n=t.height,r=t.options,i=t.width,o=this._canvas;w(null==e||e instanceof s.Application,"Provided `app` has to be an instance of PIXI.Application"),this._app=e||B(m({height:n,width:i,view:o},r)),ne(this._app,this.props,this)}},{key:"componentDidUpdate",value:function(t){var e=this.props.app;ne(this._app,this.props,this),e instanceof s.Application||ie(this._app,t,this.props)}},{key:"componentWillUnmount",value:function(){var t=this.props.app;ee(this._app.stage),t instanceof s.Application||this._app.destroy()}},{key:"render",value:function(){var t=this,e=this.props,n=e.app,r=e.options;if(void 0!==r&&r.view)return null;if(n instanceof s.Application)return null;var i=K(this.props);return o.createElement("canvas",v({ref:function(e){return t._canvas=e}},i))}}]),e}();return t.propTypes=G,t}var ae="function"==typeof i.useState?function(){function t(t){var e=t.app,n=Jt(t),r=n.app,o=n.canvas,a=function(t){var e=i.useRef({});return i.useEffect((function(){e.current=t})),e.current}(t);return i.useLayoutEffect((function(){r&&r.stage&&(ne(r,t),e instanceof s.Application||ie(r,a,t))})),o}return t.propTypes=G,t}():oe(),se=$(Kt),ue=Z(Kt),le=Nt,ce=Lt,he=Ft,fe=Ut,pe=jt,de=Bt,ve=zt,me=Ht;e.AppProvider=O,e.CustomPIXIComponent=function(t,e){return w("string"==typeof e,"Invalid argument `type` of type `%s` supplied to `CustomPIXIComponent`, expected `string`.",c(e)),function(t,e){return T[t]=e,t}(e,t)},e.Stage=ae,e.applyProps=Wt,e.createStageClass=oe,e.render=se,e.unmount=ue,e.withApp=I,e.usePixiApp=Zt,e.usePixiTicker=function(t){var e=Zt().ticker;i.useEffect((function(){return e.add(t),function(){e.remove(t)}}),[t,e])},e.usePixiAppCreator=Jt,e.unstable_batchedUpdates=$t,e.BitmapText=le,e.Container=ce,e.Graphics=he,e.NineSlicePlane=fe,e.ParticleContainer=pe,e.Sprite=de,e.Text=ve,e.TilingSprite=me}).call(this,n(11))},function(t,e,n){"use strict";t.exports=n(69)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=void 0,i=void 0,o=void 0,a=void 0,s=void 0;if(e.unstable_now=void 0,e.unstable_forceFrameRate=void 0,"undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,l=null,c=function t(){if(null!==u)try{var n=e.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(t,0),r}};e.unstable_now=function(){return Date.now()},r=function(t){null!==u?setTimeout(r,0,t):(u=t,setTimeout(c,0))},i=function(t,e){l=setTimeout(t,e)},o=function(){clearTimeout(l)},a=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var h=window.performance,f=window.Date,p=window.setTimeout,d=window.clearTimeout,v=window.requestAnimationFrame,m=window.cancelAnimationFrame;"undefined"!==typeof console&&("function"!==typeof v&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),e.unstable_now="object"===typeof h&&"function"===typeof h.now?function(){return h.now()}:function(){return f.now()};var y=!1,g=null,b=-1,_=-1,x=33.33,w=-1,T=-1,E=0,S=!1;a=function(){return e.unstable_now()>=E},s=function(){},e.unstable_forceFrameRate=function(t){0>t||125(x=rs){if(a=u,null===k)k=t.next=t.previous=t;else{n=null;var l=k;do{if(a1&&void 0!==arguments[1]?arguments[1]:o.default.Map,n=Object.keys(t);return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e(),i=arguments[1];return r.withMutations((function(e){n.forEach((function(n){var r=(0,t[n])(e.get(n),i);(0,a.validateNextState)(r,n,i),e.set(n,r)}))}))}},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateNextState=e.getUnexpectedInvocationParameterMessage=e.getStateName=void 0;var r=a(n(37)),i=a(n(73)),o=a(n(74));function a(t){return t&&t.__esModule?t:{default:t}}e.getStateName=r.default,e.getUnexpectedInvocationParameterMessage=i.default,e.validateNextState=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=o(n(13)),i=o(n(37));function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e,n){var o=Object.keys(e);if(!o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var a=(0,i.default)(n);if(r.default.isImmutable?!r.default.isImmutable(t):!r.default.Iterable.isIterable(t))return"The "+a+' is of unexpected type. Expected argument to be an instance of Immutable.Collection or Immutable.Record with the following properties: "'+o.join('", "')+'".';var s=t.toSeq().keySeq().toArray().filter((function(t){return!e.hasOwnProperty(t)}));return s.length>0?"Unexpected "+(1===s.length?"property":"properties")+' "'+s.join('", "')+'" found in '+a+'. Expected to find one of the known reducer property names instead: "'+o.join('", "')+'". Unexpected properties will be ignored.':null},t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){if(void 0===t)throw new Error('Reducer "'+e+'" returned undefined when handling "'+n.type+'" action. To ignore an action, you must explicitly return the previous state.')},t.exports=e.default},function(t,e,n){var r=n(38);t.exports=function(){return r.Date.now()}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(11))},function(t,e,n){var r=n(26),i=n(78),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||u.test(t)?l(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(79),i=n(82);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(39),i=n(80),o=n(81),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(39),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(u){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},,,,,,function(t,e,n){"use strict";var r=n(1),i=n.n(r),o=n(12),a=n(46),s=function(t){var e=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function g(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{handleWidth:!0,handleHeight:!0},n=function(n){R(a,n);var o=N(a);function a(){var t;A(this,a);for(var e=arguments.length,n=new Array(e),i=0;i Date.now() - startTime;\n}\n\n// requestAnimationFrame\nlet lastTime = Date.now();\nconst vendors = ['ms', 'moz', 'webkit', 'o'];\n\nfor (let x = 0; x < vendors.length && !window.requestAnimationFrame; ++x)\n{\n const p = vendors[x];\n\n window.requestAnimationFrame = (window as any)[`${p}RequestAnimationFrame`];\n window.cancelAnimationFrame = (window as any)[`${p}CancelAnimationFrame`]\n || (window as any)[`${p}CancelRequestAnimationFrame`];\n}\n\nif (!window.requestAnimationFrame)\n{\n window.requestAnimationFrame = (callback: (...parms: any[]) => void): number =>\n {\n if (typeof callback !== 'function')\n {\n throw new TypeError(`${callback}is not a function`);\n }\n\n const currentTime = Date.now();\n let delay = ONE_FRAME_TIME + lastTime - currentTime;\n\n if (delay < 0)\n {\n delay = 0;\n }\n\n lastTime = currentTime;\n\n return window.setTimeout(() =>\n {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\n\nif (!window.cancelAnimationFrame)\n{\n window.cancelAnimationFrame = (id: number): void => clearTimeout(id);\n}\n","// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\nif (!Math.sign)\n{\n Math.sign = function mathSign(x): number\n {\n x = Number(x);\n\n if (x === 0 || isNaN(x))\n {\n return x;\n }\n\n return x > 0 ? 1 : -1;\n };\n}\n","// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\n\nif (!Number.isInteger)\n{\n Number.isInteger = function numberIsInteger(value): boolean\n {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n };\n}\n","import '@pixi/polyfill';\n\nimport * as utils from '@pixi/utils';\nimport { AccessibilityManager } from '@pixi/accessibility';\nimport { InteractionManager } from '@pixi/interaction';\nimport { Application } from '@pixi/app';\nimport { Renderer, BatchRenderer } from '@pixi/core';\nimport { Extract } from '@pixi/extract';\nimport { Loader, AppLoaderPlugin } from '@pixi/loaders';\nimport { ParticleRenderer } from '@pixi/particles';\nimport { Prepare } from '@pixi/prepare';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nimport { TilingSpriteRenderer } from '@pixi/sprite-tiling';\nimport { BitmapFontLoader } from '@pixi/text-bitmap';\nimport { TickerPlugin } from '@pixi/ticker';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilter, BlurFilterPass } from '@pixi/filter-blur';\nimport { ColorMatrixFilter } from '@pixi/filter-color-matrix';\nimport { DisplacementFilter } from '@pixi/filter-displacement';\nimport { FXAAFilter } from '@pixi/filter-fxaa';\nimport { NoiseFilter } from '@pixi/filter-noise';\nimport '@pixi/mixin-cache-as-bitmap';\nimport '@pixi/mixin-get-child-by-name';\nimport '@pixi/mixin-get-global-position';\n\n// Export deprecations so Rollup can call it\n// in the footer after global is defined\n// other module must call this manually\nimport { useDeprecated } from './useDeprecated';\n\n// Install renderer plugins\nRenderer.registerPlugin('accessibility', AccessibilityManager);\nRenderer.registerPlugin('extract', Extract);\nRenderer.registerPlugin('interaction', InteractionManager);\nRenderer.registerPlugin('particle', ParticleRenderer);\nRenderer.registerPlugin('prepare', Prepare);\nRenderer.registerPlugin('batch', BatchRenderer);\nRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\n\nLoader.registerPlugin(BitmapFontLoader);\nLoader.registerPlugin(SpritesheetLoader);\n\nApplication.registerPlugin(TickerPlugin);\nApplication.registerPlugin(AppLoaderPlugin);\n\n/**\n * String of the current PIXI version.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name VERSION\n * @type {string}\n */\nexport const VERSION = '__VERSION__';\n\n/**\n * @namespace PIXI\n */\n\n/**\n * This namespace contains WebGL-only display filters that can be applied\n * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters\n * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the\n * PixiJS Filters repository.\n *\n * All filters must extend {@link PIXI.Filter}.\n *\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n *\n * // Draw a green rectangle\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add a blur filter\n * rect.filters = [new PIXI.filters.BlurFilter()];\n *\n * // Display rectangle\n * app.stage.addChild(rect);\n * document.body.appendChild(app.view);\n * @namespace PIXI.filters\n */\nexport const filters = {\n AlphaFilter,\n BlurFilter,\n BlurFilterPass,\n ColorMatrixFilter,\n DisplacementFilter,\n FXAAFilter,\n NoiseFilter,\n};\n\n// Export ES for those importing specifically by name,\nexport * from '@pixi/accessibility';\nexport * from '@pixi/app';\nexport * from '@pixi/constants';\nexport * from '@pixi/core';\nexport * from '@pixi/display';\nexport * from '@pixi/extract';\nexport * from '@pixi/graphics';\nexport * from '@pixi/loaders';\nexport * from '@pixi/interaction';\nexport * from '@pixi/math';\nexport * from '@pixi/mesh';\nexport * from '@pixi/mesh-extras';\nexport * from '@pixi/particles';\nexport * from '@pixi/prepare';\nexport * from '@pixi/runner';\nexport * from '@pixi/sprite';\nexport * from '@pixi/spritesheet';\nexport * from '@pixi/sprite-animated';\nexport * from '@pixi/sprite-tiling';\nexport * from '@pixi/text';\nexport * from '@pixi/text-bitmap';\nexport * from '@pixi/ticker';\nexport * from '@pixi/settings';\nexport {\n utils,\n useDeprecated,\n};\n","var appleIphone = /iPhone/i;\nvar appleIpod = /iPod/i;\nvar appleTablet = /iPad/i;\nvar appleUniversal = /\\biOS-universal(?:.+)Mac\\b/i;\nvar androidPhone = /\\bAndroid(?:.+)Mobile\\b/i;\nvar androidTablet = /Android/i;\nvar amazonPhone = /(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i;\nvar amazonTablet = /Silk/i;\nvar windowsPhone = /Windows Phone/i;\nvar windowsTablet = /\\bWindows(?:.+)ARM\\b/i;\nvar otherBlackBerry = /BlackBerry/i;\nvar otherBlackBerry10 = /BB10/i;\nvar otherOpera = /Opera Mini/i;\nvar otherChrome = /\\b(CriOS|Chrome)(?:.+)Mobile/i;\nvar otherFirefox = /Mobile(?:.+)Firefox\\b/i;\nvar isAppleTabletOnIos13 = function (navigator) {\n return (typeof navigator !== 'undefined' &&\n navigator.platform === 'MacIntel' &&\n typeof navigator.maxTouchPoints === 'number' &&\n navigator.maxTouchPoints > 1 &&\n typeof MSStream === 'undefined');\n};\nfunction createMatch(userAgent) {\n return function (regex) { return regex.test(userAgent); };\n}\nexport default function isMobile(param) {\n var nav = {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n if (!param && typeof navigator !== 'undefined') {\n nav = {\n userAgent: navigator.userAgent,\n platform: navigator.platform,\n maxTouchPoints: navigator.maxTouchPoints || 0\n };\n }\n else if (typeof param === 'string') {\n nav.userAgent = param;\n }\n else if (param && param.userAgent) {\n nav = {\n userAgent: param.userAgent,\n platform: param.platform,\n maxTouchPoints: param.maxTouchPoints || 0\n };\n }\n var userAgent = nav.userAgent;\n var tmp = userAgent.split('[FBAN');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n tmp = userAgent.split('Twitter');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n var match = createMatch(userAgent);\n var result = {\n apple: {\n phone: match(appleIphone) && !match(windowsPhone),\n ipod: match(appleIpod),\n tablet: !match(appleIphone) &&\n (match(appleTablet) || isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone),\n universal: match(appleUniversal),\n device: (match(appleIphone) ||\n match(appleIpod) ||\n match(appleTablet) ||\n match(appleUniversal) ||\n isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone)\n },\n amazon: {\n phone: match(amazonPhone),\n tablet: !match(amazonPhone) && match(amazonTablet),\n device: match(amazonPhone) || match(amazonTablet)\n },\n android: {\n phone: (!match(windowsPhone) && match(amazonPhone)) ||\n (!match(windowsPhone) && match(androidPhone)),\n tablet: !match(windowsPhone) &&\n !match(amazonPhone) &&\n !match(androidPhone) &&\n (match(amazonTablet) || match(androidTablet)),\n device: (!match(windowsPhone) &&\n (match(amazonPhone) ||\n match(amazonTablet) ||\n match(androidPhone) ||\n match(androidTablet))) ||\n match(/\\bokhttp\\b/i)\n },\n windows: {\n phone: match(windowsPhone),\n tablet: match(windowsTablet),\n device: match(windowsPhone) || match(windowsTablet)\n },\n other: {\n blackberry: match(otherBlackBerry),\n blackberry10: match(otherBlackBerry10),\n opera: match(otherOpera),\n firefox: match(otherFirefox),\n chrome: match(otherChrome),\n device: match(otherBlackBerry) ||\n match(otherBlackBerry10) ||\n match(otherOpera) ||\n match(otherFirefox) ||\n match(otherChrome)\n },\n any: false,\n phone: false,\n tablet: false\n };\n result.any =\n result.apple.device ||\n result.android.device ||\n result.windows.device ||\n result.other.device;\n result.phone =\n result.apple.phone || result.android.phone || result.windows.phone;\n result.tablet =\n result.apple.tablet || result.android.tablet || result.windows.tablet;\n return result;\n}\n//# sourceMappingURL=isMobile.js.map","// The ESM/CJS versions of ismobilejs only\n// exports the function for executing\n// designed for Node-only environments\nimport isMobileCall from 'ismobilejs';\n\nconst isMobile = isMobileCall(window.navigator);\n\nexport { isMobile };\n","import { settings } from '@pixi/settings';\n\n/**\n * Default number of uploads per frame using prepare plugin.\n *\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\nsettings.UPLOADS_PER_FRAME = 4;\n\nexport { settings };\n","import { isMobile } from './isMobile';\n\n/**\n * The maximum recommended texture units to use.\n * In theory the bigger the better, and for desktop we'll use as many as we can.\n * But some mobile devices slow down if there is to many branches in the shader.\n * So in practice there seems to be a sweet spot size that varies depending on the device.\n *\n * In v4, all mobile devices were limited to 4 texture units because for this.\n * In v5, we allow all texture units to be used on modern Apple or Android devices.\n *\n * @private\n * @param {number} max\n * @returns {number}\n */\nexport function maxRecommendedTextures(max: number): number\n{\n let allowMax = true;\n\n if (isMobile.tablet || isMobile.phone)\n {\n if (isMobile.apple.device)\n {\n const match = (navigator.userAgent).match(/OS (\\d+)_(\\d+)?/);\n\n if (match)\n {\n const majorVersion = parseInt(match[1], 10);\n\n // Limit texture units on devices below iOS 11, which will be older hardware\n if (majorVersion < 11)\n {\n allowMax = false;\n }\n }\n }\n if (isMobile.android.device)\n {\n const match = (navigator.userAgent).match(/Android\\s([0-9.]*)/);\n\n if (match)\n {\n const majorVersion = parseInt(match[1], 10);\n\n // Limit texture units on devices below Android 7 (Nougat), which will be older hardware\n if (majorVersion < 7)\n {\n allowMax = false;\n }\n }\n }\n }\n\n return allowMax ? max : 4;\n}\n","import { isMobile } from './isMobile';\n\n/**\n * Uploading the same buffer multiple times in a single frame can cause performance issues.\n * Apparent on iOS so only check for that at the moment\n * This check may become more complex if this issue pops up elsewhere.\n *\n * @private\n * @returns {boolean}\n */\nexport function canUploadSameBuffer(): boolean\n{\n return !isMobile.apple.device;\n}\n","let saidHello = false;\nconst VERSION = '__VERSION__';\n\n/**\n * Skips the hello message of renderers that are created after this is run.\n *\n * @function skipHello\n * @memberof PIXI.utils\n */\nexport function skipHello(): void\n{\n saidHello = true;\n}\n\n/**\n * Logs out the version and renderer information for this running instance of PIXI.\n * If you don't want to see this message you can run `PIXI.utils.skipHello()` before\n * creating your renderer. Keep in mind that doing that will forever make you a jerk face.\n *\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @param {string} type - The string renderer type to log.\n */\nexport function sayHello(type: string): void\n{\n if (saidHello)\n {\n return;\n }\n\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)\n {\n const args = [\n `\\n %c %c %c PixiJS ${VERSION} - ✰ ${type} ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \\n\\n`,\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff66a5; background: #030307; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ffc3dc; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n ];\n\n window.console.log(...args);\n }\n else if (window.console)\n {\n window.console.log(`PixiJS ${VERSION} - ${type} - http://www.pixijs.com/`);\n }\n\n saidHello = true;\n}\n","import { settings } from '../settings';\n\nlet supported: boolean|undefined;\n\n/**\n * Helper for checking for WebGL support.\n *\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @return {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(): boolean\n{\n if (typeof supported === 'undefined')\n {\n supported = (function supported(): boolean\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,\n };\n\n try\n {\n if (!window.WebGLRenderingContext)\n {\n return false;\n }\n\n const canvas = document.createElement('canvas');\n let gl = (\n canvas.getContext('webgl', contextOptions)\n || canvas.getContext('experimental-webgl', contextOptions)\n ) as WebGLRenderingContext;\n\n const success = !!(gl && gl.getContextAttributes().stencil);\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n }\n\n return supported;\n}\n","/**\n * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n *\n * @example\n * PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1]\n * @memberof PIXI.utils\n * @function hex2rgb\n * @param {number} hex - The hexadecimal number to convert\n * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one\n * @return {number[]} An array representing the [R, G, B] of the color where all values are floats.\n */\nexport function hex2rgb(hex: number, out: Array | Float32Array = []): Array | Float32Array\n{\n out[0] = ((hex >> 16) & 0xFF) / 255;\n out[1] = ((hex >> 8) & 0xFF) / 255;\n out[2] = (hex & 0xFF) / 255;\n\n return out;\n}\n\n/**\n * Converts a hexadecimal color number to a string.\n *\n * @example\n * PIXI.utils.hex2string(0xffffff); // returns \"#ffffff\"\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex (e.g., `0xffffff`)\n * @return {string} The string color (e.g., `\"#ffffff\"`).\n */\nexport function hex2string(hex: number): string\n{\n let hexString = hex.toString(16);\n\n hexString = '000000'.substr(0, 6 - hexString.length) + hexString;\n\n return `#${hexString}`;\n}\n\n/**\n * Converts a hexadecimal string to a hexadecimal color number.\n *\n * @example\n * PIXI.utils.string2hex(\"#ffffff\"); // returns 0xffffff\n * @memberof PIXI.utils\n * @function string2hex\n * @param {string} string - The string color (e.g., `\"#ffffff\"`)\n * @return {number} Number in hexadecimal.\n */\nexport function string2hex(string: string): number\n{\n if (typeof string === 'string' && string[0] === '#')\n {\n string = string.substr(1);\n }\n\n return parseInt(string, 16);\n}\n\n/**\n * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.\n *\n * @example\n * PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.\n * @return {number} Number in hexadecimal.\n */\nexport function rgb2hex(rgb: number[] | Float32Array): number\n{\n return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255 | 0));\n}\n","import { BLEND_MODES } from '@pixi/constants';\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n *\n * @memberof PIXI.utils\n * @function mapPremultipliedBlendModes\n * @private\n * @return {Array} Mapped modes.\n */\nfunction mapPremultipliedBlendModes(): number[][]\n{\n const pm = [];\n const npm = [];\n\n for (let i = 0; i < 32; i++)\n {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;\n pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;\n pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;\n\n npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;\n npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;\n npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;\n\n const array: number[][] = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @const premultiplyBlendMode\n * @type {Array}\n */\nexport const premultiplyBlendMode = mapPremultipliedBlendModes();\n\n/**\n * changes blendMode according to texture format\n *\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode - supposed blend mode\n * @param {boolean} premultiplied - whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nexport function correctBlendMode(blendMode: number, premultiplied: boolean): number\n{\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n\n/**\n * combines rgb and alpha to out array\n *\n * @memberof PIXI.utils\n * @function premultiplyRgba\n * @param {Float32Array|number[]} rgb - input rgb\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] - output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nexport function premultiplyRgba(\n rgb: Float32Array|number[],\n alpha: number,\n out: Float32Array,\n premultiply: boolean\n): Float32Array\n{\n out = out || new Float32Array(4);\n if (premultiply || premultiply === undefined)\n {\n out[0] = rgb[0] * alpha;\n out[1] = rgb[1] * alpha;\n out[2] = rgb[2] * alpha;\n }\n else\n {\n out[0] = rgb[0];\n out[1] = rgb[1];\n out[2] = rgb[2];\n }\n out[3] = alpha;\n\n return out;\n}\n\n/**\n * premultiplies tint\n *\n * @memberof PIXI.utils\n * @function premultiplyTint\n * @param {number} tint - integer RGB\n * @param {number} alpha - floating point alpha (0.0-1.0)\n * @returns {number} tint multiplied by alpha\n */\nexport function premultiplyTint(tint: number, alpha: number): number\n{\n if (alpha === 1.0)\n {\n return (alpha * 255 << 24) + tint;\n }\n if (alpha === 0.0)\n {\n return 0;\n }\n let R = ((tint >> 16) & 0xFF);\n let G = ((tint >> 8) & 0xFF);\n let B = (tint & 0xFF);\n\n R = ((R * alpha) + 0.5) | 0;\n G = ((G * alpha) + 0.5) | 0;\n B = ((B * alpha) + 0.5) | 0;\n\n return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;\n}\n\n/**\n * converts integer tint and float alpha to vec4 form, premultiplies by default\n *\n * @memberof PIXI.utils\n * @function premultiplyTintToRgba\n * @param {number} tint - input tint\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nexport function premultiplyTintToRgba(tint: number, alpha: number, out: Float32Array, premultiply: boolean): Float32Array\n{\n out = out || new Float32Array(4);\n out[0] = ((tint >> 16) & 0xFF) / 255.0;\n out[1] = ((tint >> 8) & 0xFF) / 255.0;\n out[2] = (tint & 0xFF) / 255.0;\n if (premultiply || premultiply === undefined)\n {\n out[0] *= alpha;\n out[1] *= alpha;\n out[2] *= alpha;\n }\n out[3] = alpha;\n\n return out;\n}\n","/**\n * Generic Mask Stack data structure\n *\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @return {Uint16Array|Uint32Array} - Resulting index buffer\n */\nexport function createIndicesForQuads(size: number, outBuffer: Uint16Array|Uint32Array = null): Uint16Array|Uint32Array\n{\n // the total number of indices in our array, there are 6 points per quad.\n const totalIndices = size * 6;\n\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n\n if (outBuffer.length !== totalIndices)\n {\n throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);\n }\n\n // fill the indices with the quads to draw\n for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n\n return outBuffer;\n}\n","import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(array: ITypedArray): 'Float32Array'|'Uint32Array'|'Int32Array'|'Uint16Array'|'Uint8Array'|null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n","import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array|Uint32Array|Int32Array|Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n","// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n *\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @return {number}\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n *\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @return {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n *\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @return {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n","/**\n * Remove items from a javascript array without generating garbage\n *\n * @function removeItems\n * @memberof PIXI.utils\n * @param {Array} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n","/**\n * Returns sign of number\n *\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1|0|1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n","let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n *\n * @memberof PIXI.utils\n * @function uid\n * @return {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n","import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict = {};\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n *\n * @memberof PIXI.utils\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicat\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n","import type { Program, Texture, BaseTexture } from '@pixi/core';\n\n/**\n * @todo Describe property usage\n *\n * @static\n * @name ProgramCache\n * @memberof PIXI.utils\n * @type {Object}\n */\nexport const ProgramCache: {[key: string]: Program} = {};\n\n/**\n * @todo Describe property usage\n *\n * @static\n * @name TextureCache\n * @memberof PIXI.utils\n * @type {Object}\n */\nexport const TextureCache: {[key: string]: Texture} = Object.create(null);\n\n/**\n * @todo Describe property usage\n *\n * @static\n * @name BaseTextureCache\n * @memberof PIXI.utils\n * @type {Object}\n */\nexport const BaseTextureCache: {[key: string]: BaseTexture} = Object.create(null);\n\n/**\n * Destroys all texture in the cache\n *\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nexport function destroyTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache)\n {\n BaseTextureCache[key].destroy();\n }\n}\n\n/**\n * Removes all textures from cache, but does not destroy them\n *\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nexport function clearTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache)\n {\n delete BaseTextureCache[key];\n }\n}\n","import { settings } from '@pixi/settings';\n\n/**\n * Creates a Canvas element of the given size to be used as a target for rendering to.\n *\n * @class\n * @memberof PIXI.utils\n */\nexport class CanvasRenderTarget\n{\n public canvas: HTMLCanvasElement;\n\n public context: CanvasRenderingContext2D;\n\n public resolution: number;\n\n /**\n * @param {number} width - the width for the newly created canvas\n * @param {number} height - the height for the newly created canvas\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the canvas\n */\n constructor(width: number, height: number, resolution: number)\n {\n /**\n * The Canvas object that belongs to this CanvasRenderTarget.\n *\n * @member {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas');\n\n /**\n * A CanvasRenderingContext2D object representing a two-dimensional rendering context.\n *\n * @member {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d');\n\n this.resolution = resolution || settings.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n *\n * @private\n */\n clear(): void\n {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n /**\n * Resizes the canvas to the specified width and height.\n *\n * @param {number} width - the new width of the canvas\n * @param {number} height - the new height of the canvas\n */\n resize(width: number, height: number): void\n {\n this.canvas.width = width * this.resolution;\n this.canvas.height = height * this.resolution;\n }\n\n /**\n * Destroys this canvas.\n *\n */\n destroy(): void\n {\n this.context = null;\n this.canvas = null;\n }\n\n /**\n * The width of the canvas buffer in pixels.\n *\n * @member {number}\n */\n get width(): number\n {\n return this.canvas.width;\n }\n\n set width(val: number)\n {\n this.canvas.width = val;\n }\n\n /**\n * The height of the canvas buffer in pixels.\n *\n * @member {number}\n */\n get height(): number\n {\n return this.canvas.height;\n }\n\n set height(val: number)\n {\n this.canvas.height = val;\n }\n}\n","interface Inset {\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\n/**\n * Trim transparent borders from a canvas\n *\n * @memberof PIXI.utils\n * @function trimCanvas\n * @param {HTMLCanvasElement} canvas - the canvas to trim\n * @returns {object} Trim data\n */\nexport function trimCanvas(canvas: HTMLCanvasElement): {width: number; height: number; data?: ImageData}\n{\n // https://gist.github.com/remy/784508\n\n let width = canvas.width;\n let height = canvas.height;\n\n const context = canvas.getContext('2d');\n const imageData = context.getImageData(0, 0, width, height);\n const pixels = imageData.data;\n const len = pixels.length;\n\n const bound: Inset = {\n top: null,\n left: null,\n right: null,\n bottom: null,\n };\n let data = null;\n let i;\n let x;\n let y;\n\n for (i = 0; i < len; i += 4)\n {\n if (pixels[i + 3] !== 0)\n {\n x = (i / 4) % width;\n y = ~~((i / 4) / width);\n\n if (bound.top === null)\n {\n bound.top = y;\n }\n\n if (bound.left === null)\n {\n bound.left = x;\n }\n else if (x < bound.left)\n {\n bound.left = x;\n }\n\n if (bound.right === null)\n {\n bound.right = x + 1;\n }\n else if (bound.right < x)\n {\n bound.right = x + 1;\n }\n\n if (bound.bottom === null)\n {\n bound.bottom = y;\n }\n else if (bound.bottom < y)\n {\n bound.bottom = y;\n }\n }\n }\n\n if (bound.top !== null)\n {\n width = bound.right - bound.left;\n height = bound.bottom - bound.top + 1;\n data = context.getImageData(bound.left, bound.top, width, height);\n }\n\n return {\n height,\n width,\n data,\n };\n}\n","/**\n * Constants that define the type of gradient on text.\n *\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nexport enum TEXT_GRADIENT {\n LINEAR_VERTICAL = 0,\n LINEAR_HORIZONTAL = 1\n}\n","import * as _url from 'url';\n\nlet tempAnchor: HTMLAnchorElement|undefined;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n *\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nexport function determineCrossOrigin(url: string, loc: Location = window.location): string\n{\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0)\n {\n return '';\n }\n\n // default is window.location\n loc = loc || window.location;\n\n if (!tempAnchor)\n {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n const parsedUrl = _url.parse(tempAnchor.href);\n\n const samePort = (!parsedUrl.port && loc.port === '') || (parsedUrl.port === loc.port);\n\n // if cross origin\n if (parsedUrl.hostname !== loc.hostname || !samePort || parsedUrl.protocol !== loc.protocol)\n {\n return 'anonymous';\n }\n\n return '';\n}\n","import { DATA_URI } from '../const';\n\nexport interface DecomposedDataUri {\n mediaType: string;\n subType: string;\n charset: string;\n encoding: string;\n data: string;\n}\n\n/**\n * @memberof PIXI.utils\n * @interface DecomposedDataUri\n */\n\n/**\n * type, eg. `image`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} mediaType\n */\n\n/**\n * Sub type, eg. `png`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} subType\n */\n\n/**\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} charset\n */\n\n/**\n * Data encoding, eg. `base64`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} encoding\n */\n\n/**\n * The actual data\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} data\n */\n\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n *\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @return {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nexport function decomposeDataUri(dataUri: string): DecomposedDataUri\n{\n const dataUriMatch = DATA_URI.exec(dataUri);\n\n if (dataUriMatch)\n {\n return {\n mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : undefined,\n data: dataUriMatch[5],\n };\n }\n\n return undefined;\n}\n","import { settings } from '../settings';\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n *\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @return {number} resolution / device pixel ratio of an asset\n */\nexport function getResolutionOfUrl(url: string, defaultValue?: number): number\n{\n const resolution = settings.RETINA_PREFIX.exec(url);\n\n if (resolution)\n {\n return parseFloat(resolution[1]);\n }\n\n return defaultValue !== undefined ? defaultValue : 1;\n}\n","import { SHAPES } from '../const';\n\n/**\n * Size object, contains width and height\n *\n * @memberof PIXI\n * @typedef {object} ISize\n * @property {number} width - Width component\n * @property {number} height - Height component\n */\n\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n *\n * @class\n * @memberof PIXI\n */\nexport class Rectangle\n{\n public x: number;\n public y: number;\n public width: number;\n public height: number;\n public readonly type: SHAPES.RECT;\n\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle\n * @param {number} [width=0] - The overall width of this rectangle\n * @param {number} [height=0] - The overall height of this rectangle\n */\n constructor(x = 0, y = 0, width = 0, height = 0)\n {\n /**\n * @member {number}\n * @default 0\n */\n this.x = Number(x);\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = Number(y);\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = Number(width);\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = Number(height);\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.RECT\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RECT;\n }\n\n /**\n * returns the left edge of the rectangle\n *\n * @member {number}\n */\n get left(): number\n {\n return this.x;\n }\n\n /**\n * returns the right edge of the rectangle\n *\n * @member {number}\n */\n get right(): number\n {\n return this.x + this.width;\n }\n\n /**\n * returns the top edge of the rectangle\n *\n * @member {number}\n */\n get top(): number\n {\n return this.y;\n }\n\n /**\n * returns the bottom edge of the rectangle\n *\n * @member {number}\n */\n get bottom(): number\n {\n return this.y + this.height;\n }\n\n /**\n * A constant empty rectangle.\n *\n * @static\n * @constant\n * @member {PIXI.Rectangle}\n * @return {PIXI.Rectangle} An empty rectangle\n */\n static get EMPTY(): Rectangle\n {\n return new Rectangle(0, 0, 0, 0);\n }\n\n /**\n * Creates a clone of this Rectangle\n *\n * @return {PIXI.Rectangle} a copy of the rectangle\n */\n clone(): Rectangle\n {\n return new Rectangle(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Copies another rectangle to this one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy from.\n * @return {PIXI.Rectangle} Returns itself.\n */\n copyFrom(rectangle: Rectangle): Rectangle\n {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n\n return this;\n }\n\n /**\n * Copies this rectangle to another one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy to.\n * @return {PIXI.Rectangle} Returns given parameter.\n */\n copyTo(rectangle: Rectangle): Rectangle\n {\n rectangle.x = this.x;\n rectangle.y = this.y;\n rectangle.width = this.width;\n rectangle.height = this.height;\n\n return rectangle;\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rectangle\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n if (x >= this.x && x < this.x + this.width)\n {\n if (y >= this.y && y < this.y + this.height)\n {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Pads the rectangle making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n *\n * @param {number} [paddingX=0] - The horizontal padding amount.\n * @param {number} [paddingY=0] - The vertical padding amount.\n * @return {PIXI.Rectangle} Returns itself.\n */\n pad(paddingX = 0, paddingY = paddingX): this\n {\n this.x -= paddingX;\n this.y -= paddingY;\n\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n\n return this;\n }\n\n /**\n * Fits this rectangle around the passed one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to fit.\n * @return {PIXI.Rectangle} Returns itself.\n */\n fit(rectangle: Rectangle): this\n {\n const x1 = Math.max(this.x, rectangle.x);\n const x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.max(this.y, rectangle.y);\n const y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n\n return this;\n }\n\n /**\n * Enlarges rectangle that way its corners lie on grid\n *\n * @param {number} [resolution=1] resolution\n * @param {number} [eps=0.001] precision\n * @return {PIXI.Rectangle} Returns itself.\n */\n ceil(resolution = 1, eps = 0.001): this\n {\n const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n const y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n\n return this;\n }\n\n /**\n * Enlarges this rectangle to include the passed rectangle.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to include.\n * @return {PIXI.Rectangle} Returns itself.\n */\n enlarge(rectangle: Rectangle): this\n {\n const x1 = Math.min(this.x, rectangle.x);\n const x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.min(this.y, rectangle.y);\n const y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n\n return this;\n }\n}\n","import { SHAPES } from './../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nexport class Circle\n{\n public x: number;\n public y: number;\n public radius: number;\n public readonly type: SHAPES.CIRC;\n\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n constructor(x = 0, y = 0, radius = 0)\n {\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n clone(): Circle\n {\n return new Circle(this.x, this.y, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n contains(x: number, y: number): boolean\n {\n if (this.radius <= 0)\n {\n return false;\n }\n\n const r2 = this.radius * this.radius;\n let dx = (this.x - x);\n let dy = (this.y - y);\n\n dx *= dx;\n dy *= dy;\n\n return (dx + dy <= r2);\n }\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n }\n}\n","import { Rectangle } from './Rectangle';\nimport { SHAPES } from '../const';\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nexport class Ellipse\n{\n public x: number;\n public y: number;\n public width: number;\n public height: number;\n public readonly type: SHAPES.ELIP;\n\n /**\n * @param {number} [x=0] - The X coordinate of the center of this ellipse\n * @param {number} [y=0] - The Y coordinate of the center of this ellipse\n * @param {number} [halfWidth=0] - The half width of this ellipse\n * @param {number} [halfHeight=0] - The half height of this ellipse\n */\n constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0)\n {\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = halfWidth;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = halfHeight;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n clone(): Ellipse\n {\n return new Ellipse(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n let normx = ((x - this.x) / this.width);\n let normy = ((y - this.y) / this.height);\n\n normx *= normx;\n normy *= normy;\n\n return (normx + normy <= 1);\n }\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n }\n}\n","import { SHAPES } from '../const';\nimport type { IPoint } from '../IPoint';\n\n/**\n * A class to define a shape via user defined co-orinates.\n *\n * @class\n * @memberof PIXI\n */\nexport class Polygon\n{\n public points: number[];\n public closeStroke: boolean;\n public readonly type: SHAPES.POLY;\n\n constructor(points: IPoint[]|number[]);\n constructor(...points: IPoint[]|number[]);\n /**\n * @param {PIXI.IPoint[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n constructor(...points: any[])\n {\n let flat: IPoint[]|number[] = Array.isArray(points[0]) ? points[0] : points;\n\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number')\n {\n const p: number[] = [];\n\n for (let i = 0, il = flat.length; i < il; i++)\n {\n p.push((flat[i] as IPoint).x, (flat[i] as IPoint).y);\n }\n\n flat = p;\n }\n\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = flat as number[];\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.POLY;\n\n /**\n * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.\n * @member {boolean}\n * @default true\n */\n this.closeStroke = true;\n }\n\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n clone(): Polygon\n {\n const points = this.points.slice();\n const polygon = new Polygon(points);\n\n polygon.closeStroke = this.closeStroke;\n\n return polygon;\n }\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n contains(x: number, y: number): boolean\n {\n let inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n const length = this.points.length / 2;\n\n for (let i = 0, j = length - 1; i < length; j = i++)\n {\n const xi = this.points[i * 2];\n const yi = this.points[(i * 2) + 1];\n const xj = this.points[j * 2];\n const yj = this.points[(j * 2) + 1];\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n\n if (intersect)\n {\n inside = !inside;\n }\n }\n\n return inside;\n }\n}\n","import { SHAPES } from '../const';\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nexport class RoundedRectangle\n{\n public x: number;\n public y: number;\n public width: number;\n public height: number;\n public radius: number;\n public readonly type: SHAPES.RREC;\n\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n constructor(x = 0, y = 0, width = 0, height = 0, radius = 20)\n {\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RREC;\n }\n\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n clone(): RoundedRectangle\n {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width)\n {\n if (y >= this.y && y <= this.y + this.height)\n {\n if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)\n || (x >= this.x + this.radius && x <= this.x + this.width - this.radius))\n {\n return true;\n }\n let dx = x - (this.x + this.radius);\n let dy = y - (this.y + this.radius);\n const radius2 = this.radius * this.radius;\n\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dx = x - (this.x + this.radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n","import type { IPoint } from './IPoint';\nimport type { IPointData } from './IPointData';\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nexport class Point implements IPoint\n{\n public x: number;\n public y: number;\n\n /**\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n *\n * @return {PIXI.Point} a copy of the point\n */\n clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from\n * @returns {this} Returns itself.\n */\n copyFrom(p: IPointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n copyTo(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n set(x = 0, y = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n}\n","import type { IPointData } from './IPointData';\nimport type { IPoint } from './IPoint';\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * An ObservablePoint is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nexport class ObservablePoint implements IPoint\n{\n public cb: (this: T) => any;\n public scope: any;\n _x: number;\n _y: number;\n\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(cb: (this: T) => any, scope: T, x = 0, y = 0)\n {\n this._x = x;\n this._y = y;\n\n this.cb = cb;\n this.scope = scope;\n }\n\n /**\n * Creates a clone of this point.\n * The callback and scope params can be overidden otherwise they will default\n * to the clone object's values.\n *\n * @override\n * @param {Function} [cb=null] - callback when changed\n * @param {object} [scope=null] - owner of callback\n * @return {PIXI.ObservablePoint} a copy of the point\n */\n clone(cb = this.cb, scope = this.scope): ObservablePoint\n {\n return new ObservablePoint(cb, scope, this._x, this._y);\n }\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n set(x = 0, y = x): this\n {\n if (this._x !== x || this._y !== y)\n {\n this._x = x;\n this._y = y;\n this.cb.call(this.scope);\n }\n\n return this;\n }\n\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from.\n * @returns {this} Returns itself.\n */\n copyFrom(p: IPointData): this\n {\n if (this._x !== p.x || this._y !== p.y)\n {\n this._x = p.x;\n this._y = p.y;\n this.cb.call(this.scope);\n }\n\n return this;\n }\n\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n copyTo(p: T): T\n {\n p.set(this._x, this._y);\n\n return p;\n }\n\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this._x) && (p.y === this._y);\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get x(): number\n {\n return this._x;\n }\n\n set x(value: number)\n {\n if (this._x !== value)\n {\n this._x = value;\n this.cb.call(this.scope);\n }\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get y(): number\n {\n return this._y;\n }\n\n set y(value: number)\n {\n if (this._y !== value)\n {\n this._y = value;\n this.cb.call(this.scope);\n }\n }\n}\n","import { Point } from './Point';\nimport { PI_2 } from './const';\n\nimport type { Transform } from './Transform';\nimport type { IPointData } from './IPointData';\n\n/**\n * The PixiJS Matrix as a class makes it a lot faster.\n *\n * Here is a representation of it:\n * ```js\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n * ```\n * @class\n * @memberof PIXI\n */\nexport class Matrix\n{\n public a: number;\n public b: number;\n public c: number;\n public d: number;\n public tx: number;\n public ty: number;\n\n public array: Float32Array|null = null;\n\n /**\n * @param {number} [a=1] - x scale\n * @param {number} [b=0] - x skew\n * @param {number} [c=0] - y skew\n * @param {number} [d=1] - y scale\n * @param {number} [tx=0] - x translation\n * @param {number} [ty=0] - y translation\n */\n constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0)\n {\n /**\n * @member {number}\n * @default 1\n */\n this.a = a;\n\n /**\n * @member {number}\n * @default 0\n */\n this.b = b;\n\n /**\n * @member {number}\n * @default 0\n */\n this.c = c;\n\n /**\n * @member {number}\n * @default 1\n */\n this.d = d;\n\n /**\n * @member {number}\n * @default 0\n */\n this.tx = tx;\n\n /**\n * @member {number}\n * @default 0\n */\n this.ty = ty;\n }\n\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n *\n * @param {number[]} array - The array that the matrix will be populated from.\n */\n fromArray(array: number[]): void\n {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n }\n\n /**\n * sets the matrix properties\n *\n * @param {number} a - Matrix component\n * @param {number} b - Matrix component\n * @param {number} c - Matrix component\n * @param {number} d - Matrix component\n * @param {number} tx - Matrix component\n * @param {number} ty - Matrix component\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n set(a: number, b: number, c: number, d: number, tx: number, ty: number): this\n {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n\n return this;\n }\n\n /**\n * Creates an array from the current Matrix object.\n *\n * @param {boolean} transpose - Whether we need to transpose the matrix or not\n * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @return {number[]} the newly created array which contains the matrix\n */\n toArray(transpose: boolean, out?: Float32Array): Float32Array\n {\n if (!this.array)\n {\n this.array = new Float32Array(9);\n }\n\n const array = out || this.array;\n\n if (transpose)\n {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else\n {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n\n return array;\n }\n\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, transformed through this matrix\n */\n apply(pos: IPointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n\n return newPos;\n }\n\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n applyInverse
(pos: IPointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const id = 1 / ((this.a * this.d) + (this.c * -this.b));\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n\n return newPos;\n }\n\n /**\n * Translates the matrix on the x and y.\n *\n * @param {number} x - How much to translate x by\n * @param {number} y - How much to translate y by\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n translate(x: number, y: number): this\n {\n this.tx += x;\n this.ty += y;\n\n return this;\n }\n\n /**\n * Applies a scale transformation to the matrix.\n *\n * @param {number} x - The amount to scale horizontally\n * @param {number} y - The amount to scale vertically\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n scale(x: number, y: number): this\n {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n\n return this;\n }\n\n /**\n * Applies a rotation transformation to the matrix.\n *\n * @param {number} angle - The angle in radians.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n rotate(angle: number): this\n {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\n\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n\n return this;\n }\n\n /**\n * Appends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to append.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n append(matrix: Matrix): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n\n return this;\n }\n\n /**\n * Sets the matrix based on all the available properties\n *\n * @param {number} x - Position on the x axis\n * @param {number} y - Position on the y axis\n * @param {number} pivotX - Pivot on the x axis\n * @param {number} pivotY - Pivot on the y axis\n * @param {number} scaleX - Scale on the x axis\n * @param {number} scaleY - Scale on the y axis\n * @param {number} rotation - Rotation in radians\n * @param {number} skewX - Skew on the x axis\n * @param {number} skewY - Skew on the y axis\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number,\n scaleY: number, rotation: number, skewX: number, skewY: number): this\n {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n\n return this;\n }\n\n /**\n * Prepends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to prepend\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n prepend(matrix: Matrix): this\n {\n const tx1 = this.tx;\n\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1)\n {\n const a1 = this.a;\n const c1 = this.c;\n\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n\n return this;\n }\n\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n *\n * @param {PIXI.Transform} transform - The transform to apply the properties to.\n * @return {PIXI.Transform} The transform with the newly applied properties\n */\n decompose(transform: Transform): Transform\n {\n // sort out rotation / skew..\n const a = this.a;\n const b = this.b;\n const c = this.c;\n const d = this.d;\n\n const skewX = -Math.atan2(-c, d);\n const skewY = Math.atan2(b, a);\n\n const delta = Math.abs(skewX + skewY);\n\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001)\n {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else\n {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n\n // next set position\n transform.position.x = this.tx;\n transform.position.y = this.ty;\n\n return transform;\n }\n\n /**\n * Inverts this matrix\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n invert(): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n const tx1 = this.tx;\n const n = (a1 * d1) - (b1 * c1);\n\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n\n return this;\n }\n\n /**\n * Resets this Matrix to an identity (default) matrix.\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n identity(): this\n {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n\n return this;\n }\n\n /**\n * Creates a new Matrix object with the same values as this one.\n *\n * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.\n */\n clone(): Matrix\n {\n const matrix = new Matrix();\n\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy to.\n * @return {PIXI.Matrix} The matrix given in parameter with its values updated.\n */\n copyTo(matrix: Matrix): Matrix\n {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @return {PIXI.Matrix} this\n */\n copyFrom(matrix: Matrix): this\n {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n\n return this;\n }\n\n /**\n * A default (identity) matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n static get IDENTITY(): Matrix\n {\n return new Matrix();\n }\n\n /**\n * A temp matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n static get TEMP_MATRIX(): Matrix\n {\n return new Matrix();\n }\n}\n","// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n//\n// This file implements the dihedral group of order 16, also called\n// of degree 8. That's why its called groupD8.\n\nimport { Matrix } from './Matrix';\n\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\n\nconst ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nconst uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n *\n * @type number[][]\n * @private\n */\nconst rotationCayley: number[][] = [];\n\n/**\n * Matrices for each `GD8Symmetry` rotation.\n *\n * @type Matrix[]\n * @private\n */\nconst rotationMatrices: Matrix[] = [];\n\n/*\n * Alias for {@code Math.sign}.\n */\nconst signum = Math.sign;\n\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init(): void\n{\n for (let i = 0; i < 16; i++)\n {\n const row: number[] = [];\n\n rotationCayley.push(row);\n\n for (let j = 0; j < 16; j++)\n {\n /* Multiplies rotation matrices i and j. */\n const _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n const _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n const _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n const _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n\n /* Finds rotation matrix matching the product and pushes it. */\n for (let k = 0; k < 16; k++)\n {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy)\n {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (let i = 0; i < 16; i++)\n {\n const mat = new Matrix();\n\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\n\ninit();\n\ntype GD8Symmetry = number;\n/**\n * @memberof PIXI\n * @typedef {number} GD8Symmetry\n * @see PIXI.groupD8\n */\n\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n *\n * **Origin:**
\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @see PIXI.groupD8.E\n * @see PIXI.groupD8.SE\n * @see PIXI.groupD8.S\n * @see PIXI.groupD8.SW\n * @see PIXI.groupD8.W\n * @see PIXI.groupD8.NW\n * @see PIXI.groupD8.N\n * @see PIXI.groupD8.NE\n * @author Ivan @ivanpopelyshev\n * @namespace PIXI.groupD8\n * @memberof PIXI\n */\nexport const groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n E: 0,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SE: 1,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n S: 2,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SW: 3,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n W: 4,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NW: 5,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n N: 6,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NE: 7,\n\n /**\n * Reflection about Y-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n\n /**\n * Reflection about the main diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n\n /**\n * Reflection about X-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n\n /**\n * Reflection about reverse diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: (ind: GD8Symmetry): GD8Symmetry => ux[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: (ind: GD8Symmetry): GD8Symmetry => uy[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: (ind: GD8Symmetry): GD8Symmetry => vx[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: (ind: GD8Symmetry): GD8Symmetry => vy[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @return {PIXI.GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: (rotation: GD8Symmetry): GD8Symmetry =>\n {\n if (rotation & 8)// true only if between 8 & 15 (reflections)\n {\n return rotation & 15;// or rotation % 16\n }\n\n return (-rotation) & 7;// or (8 - rotation) % 8\n },\n\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @return {PIXI.GD8Symmetry} Composed operation\n */\n add: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][rotationFirst]\n ),\n\n /**\n * Reverse of `add`.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation\n * @return {PIXI.GD8Symmetry} Result\n */\n sub: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]\n ),\n\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n *\n * @memberof PIXI.groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: (rotation: number): number => rotation ^ 4,\n\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: (rotation: GD8Symmetry): boolean => (rotation & 3) === 2, // rotation % 4 === 2\n\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n *\n * @memberof PIXI.groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @return {PIXI.GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: (dx: number, dy: number): GD8Symmetry =>\n {\n if (Math.abs(dx) * 2 <= Math.abs(dy))\n {\n if (dy >= 0)\n {\n return groupD8.S;\n }\n\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx))\n {\n if (dx > 0)\n {\n return groupD8.E;\n }\n\n return groupD8.W;\n }\n else if (dy > 0)\n {\n if (dx > 0)\n {\n return groupD8.SE;\n }\n\n return groupD8.SW;\n }\n else if (dx > 0)\n {\n return groupD8.NE;\n }\n\n return groupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: (matrix: Matrix, rotation: GD8Symmetry, tx = 0, ty = 0): void =>\n {\n // Packer used \"rotation\", we use \"inv(rotation)\"\n const mat: Matrix = rotationMatrices[groupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n};\n","import { ObservablePoint } from './ObservablePoint';\nimport { Matrix } from './Matrix';\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @memberof PIXI\n */\nexport class Transform\n{\n /**\n * A default (identity) transform\n *\n * @static\n * @constant\n * @member {PIXI.Transform}\n */\n public static readonly IDENTITY = new Transform();\n\n public worldTransform: Matrix;\n public localTransform: Matrix;\n public position: ObservablePoint;\n public scale: ObservablePoint;\n public pivot: ObservablePoint;\n public skew: ObservablePoint;\n public _parentID: number;\n _worldID: number;\n\n protected _rotation: number;\n protected _cx: number;\n protected _sx: number;\n protected _cy: number;\n protected _sy: number;\n protected _localID: number;\n protected _currentLocalID: number;\n\n constructor()\n {\n /**\n * The world transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.worldTransform = new Matrix();\n\n /**\n * The local transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.localTransform = new Matrix();\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.position = new ObservablePoint(this.onChange, this, 0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n\n /**\n * The pivot point of the displayObject that it rotates around.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n\n /**\n * The rotation amount.\n *\n * @protected\n * @member {number}\n */\n this._rotation = 0;\n\n /**\n * The X-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cx = 1;\n\n /**\n * The Y-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sx = 0;\n\n /**\n * The X-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cy = 0;\n\n /**\n * The Y-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sy = 1;\n\n /**\n * The locally unique ID of the local transform.\n *\n * @protected\n * @member {number}\n */\n this._localID = 0;\n\n /**\n * The locally unique ID of the local transform\n * used to calculate the current local transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._currentLocalID = 0;\n\n /**\n * The locally unique ID of the world transform.\n *\n * @protected\n * @member {number}\n */\n this._worldID = 0;\n\n /**\n * The locally unique ID of the parent's world transform\n * used to calculate the current world transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._parentID = 0;\n }\n\n /**\n * Called when a value changes.\n *\n * @protected\n */\n protected onChange(): void\n {\n this._localID++;\n }\n\n /**\n * Called when the skew or the rotation changes.\n *\n * @protected\n */\n protected updateSkew(): void\n {\n this._cx = Math.cos(this._rotation + this.skew.y);\n this._sx = Math.sin(this._rotation + this.skew.y);\n this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2\n\n this._localID++;\n }\n\n /**\n * Updates the local transformation matrix.\n */\n updateLocalTransform(): void\n {\n const lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID)\n {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n }\n\n /**\n * Updates the local and the world transformation matrices.\n *\n * @param {PIXI.Transform} parentTransform - The parent transform\n */\n updateTransform(parentTransform: Transform): void\n {\n const lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID)\n {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n\n if (this._parentID !== parentTransform._worldID)\n {\n // concat the parent matrix with the objects transform.\n const pt = parentTransform.worldTransform;\n const wt = this.worldTransform;\n\n wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n\n this._parentID = parentTransform._worldID;\n\n // update the id of the transform..\n this._worldID++;\n }\n }\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n setFromMatrix(matrix: Matrix): void\n {\n matrix.decompose(this);\n this._localID++;\n }\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n get rotation(): number\n {\n return this._rotation;\n }\n\n set rotation(value: number)\n {\n if (this._rotation !== value)\n {\n this._rotation = value;\n this.updateSkew();\n }\n }\n}\n","import { Rectangle } from '@pixi/math';\n\nimport type { IPointData, Transform, Matrix } from '@pixi/math';\n\n/**\n * 'Builder' pattern for bounds rectangles.\n *\n * This could be called an Axis-Aligned Bounding Box.\n * It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.\n *\n * @class\n * @memberof PIXI\n */\nexport class Bounds\n{\n public minX: number;\n public minY: number;\n public maxX: number;\n public maxY: number;\n public rect: Rectangle;\n public updateID: number;\n\n constructor()\n {\n /**\n * @member {number}\n * @default 0\n */\n this.minX = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.minY = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxX = -Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxY = -Infinity;\n\n this.rect = null;\n\n /**\n * It is updated to _boundsID of corresponding object to keep bounds in sync with content.\n * Updated from outside, thus public modifier.\n *\n * @member {number}\n * @public\n */\n this.updateID = -1;\n }\n\n /**\n * Checks if bounds are empty.\n *\n * @return {boolean} True if empty.\n */\n isEmpty(): boolean\n {\n return this.minX > this.maxX || this.minY > this.maxY;\n }\n\n /**\n * Clears the bounds and resets.\n *\n */\n clear(): void\n {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n }\n\n /**\n * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle\n * It is not guaranteed that it will return tempRect\n *\n * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty\n * @returns {PIXI.Rectangle} A rectangle of the bounds\n */\n getRectangle(rect?: Rectangle): Rectangle\n {\n if (this.minX > this.maxX || this.minY > this.maxY)\n {\n return Rectangle.EMPTY;\n }\n\n rect = rect || new Rectangle(0, 0, 1, 1);\n\n rect.x = this.minX;\n rect.y = this.minY;\n rect.width = this.maxX - this.minX;\n rect.height = this.maxY - this.minY;\n\n return rect;\n }\n\n /**\n * This function should be inlined when its possible.\n *\n * @param {PIXI.IPointData} point - The point to add.\n */\n addPoint(point: IPointData): void\n {\n this.minX = Math.min(this.minX, point.x);\n this.maxX = Math.max(this.maxX, point.x);\n this.minY = Math.min(this.minY, point.y);\n this.maxY = Math.max(this.maxY, point.y);\n }\n\n /**\n * Adds a quad, not transformed\n *\n * @param {Float32Array} vertices - The verts to add.\n */\n addQuad(vertices: Float32Array): void\n {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n let x = vertices[0];\n let y = vertices[1];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[2];\n y = vertices[3];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[4];\n y = vertices[5];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[6];\n y = vertices[7];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds sprite frame, transformed.\n *\n * @param {PIXI.Transform} transform - transform to apply\n * @param {number} x0 - left X of frame\n * @param {number} y0 - top Y of frame\n * @param {number} x1 - right X of frame\n * @param {number} y1 - bottom Y of frame\n */\n addFrame(transform: Transform, x0: number, y0: number, x1: number, y1: number): void\n {\n this.addFrameMatrix(transform.worldTransform, x0, y0, x1, y1);\n }\n\n /**\n * Adds sprite frame, multiplied by matrix\n *\n * @param {PIXI.Matrix} matrix - matrix to apply\n * @param {number} x0 - left X of frame\n * @param {number} y0 - top Y of frame\n * @param {number} x1 - right X of frame\n * @param {number} y1 - bottom Y of frame\n */\n addFrameMatrix(matrix: Matrix, x0: number, y0: number, x1: number, y1: number): void\n {\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n let x = (a * x0) + (c * y0) + tx;\n let y = (b * x0) + (d * y0) + ty;\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x1) + (c * y0) + tx;\n y = (b * x1) + (d * y0) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x0) + (c * y1) + tx;\n y = (b * x0) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x1) + (c * y1) + tx;\n y = (b * x1) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds screen vertices from array\n *\n * @param {Float32Array} vertexData - calculated vertices\n * @param {number} beginOffset - begin offset\n * @param {number} endOffset - end offset, excluded\n */\n addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number): void\n {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n for (let i = beginOffset; i < endOffset; i += 2)\n {\n const x = vertexData[i];\n const y = vertexData[i + 1];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Add an array of mesh vertices\n *\n * @param {PIXI.Transform} transform - mesh transform\n * @param {Float32Array} vertices - mesh coordinates in array\n * @param {number} beginOffset - begin offset\n * @param {number} endOffset - end offset, excluded\n */\n addVertices(transform: Transform, vertices: Float32Array, beginOffset: number, endOffset: number): void\n {\n this.addVerticesMatrix(transform.worldTransform, vertices, beginOffset, endOffset);\n }\n\n /**\n * Add an array of mesh vertices.\n *\n * @param {PIXI.Matrix} matrix - mesh matrix\n * @param {Float32Array} vertices - mesh coordinates in array\n * @param {number} beginOffset - begin offset\n * @param {number} endOffset - end offset, excluded\n * @param {number} [padX=0] - x padding\n * @param {number} [padY=0] - y padding\n */\n addVerticesMatrix(matrix: Matrix, vertices: Float32Array, beginOffset: number,\n endOffset: number, padX = 0, padY = padX): void\n {\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n for (let i = beginOffset; i < endOffset; i += 2)\n {\n const rawX = vertices[i];\n const rawY = vertices[i + 1];\n const x = (a * rawX) + (c * rawY) + tx;\n const y = (d * rawY) + (b * rawX) + ty;\n\n minX = Math.min(minX, x - padX);\n maxX = Math.max(maxX, x + padX);\n minY = Math.min(minY, y - padY);\n maxY = Math.max(maxY, y + padY);\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds other Bounds.\n *\n * @param {PIXI.Bounds} bounds - The Bounds to be added\n */\n addBounds(bounds: Bounds): void\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = bounds.minX < minX ? bounds.minX : minX;\n this.minY = bounds.minY < minY ? bounds.minY : minY;\n this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX;\n this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY;\n }\n\n /**\n * Adds other Bounds, masked with Bounds.\n *\n * @param {PIXI.Bounds} bounds - The Bounds to be added.\n * @param {PIXI.Bounds} mask - TODO\n */\n addBoundsMask(bounds: Bounds, mask: Bounds): void\n {\n const _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX;\n const _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY;\n const _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX;\n const _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY;\n\n if (_minX <= _maxX && _minY <= _maxY)\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n }\n\n /**\n * Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.\n *\n * @param {PIXI.Bounds} bounds - other bounds\n * @param {PIXI.Matrix} matrix - multiplicator\n */\n addBoundsMatrix(bounds: Bounds, matrix: Matrix): void\n {\n this.addFrameMatrix(matrix, bounds.minX, bounds.minY, bounds.maxX, bounds.maxY);\n }\n\n /**\n * Adds other Bounds, masked with Rectangle.\n *\n * @param {PIXI.Bounds} bounds - TODO\n * @param {PIXI.Rectangle} area - TODO\n */\n addBoundsArea(bounds: Bounds, area: Rectangle): void\n {\n const _minX = bounds.minX > area.x ? bounds.minX : area.x;\n const _minY = bounds.minY > area.y ? bounds.minY : area.y;\n const _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : (area.x + area.width);\n const _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : (area.y + area.height);\n\n if (_minX <= _maxX && _minY <= _maxY)\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n }\n\n /**\n * Pads bounds object, making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n *\n * @param {number} [paddingX=0] - The horizontal padding amount.\n * @param {number} [paddingY=0] - The vertical padding amount.\n */\n pad(paddingX = 0, paddingY = paddingX): void\n {\n if (!this.isEmpty())\n {\n this.minX -= paddingX;\n this.maxX += paddingX;\n this.minY -= paddingY;\n this.maxY += paddingY;\n }\n }\n\n /**\n * Adds padded frame. (x0, y0) should be strictly less than (x1, y1)\n *\n * @param {number} x0 - left X of frame\n * @param {number} y0 - top Y of frame\n * @param {number} x1 - right X of frame\n * @param {number} y1 - bottom Y of frame\n * @param {number} padX - padding X\n * @param {number} padY - padding Y\n */\n addFramePad(x0: number, y0: number, x1: number, y1: number, padX: number, padY: number): void\n {\n x0 -= padX;\n y0 -= padY;\n x1 += padX;\n y1 += padY;\n\n this.minX = this.minX < x0 ? this.minX : x0;\n this.maxX = this.maxX > x1 ? this.maxX : x1;\n this.minY = this.minY < y0 ? this.minY : y0;\n this.maxY = this.maxY > y1 ? this.maxY : y1;\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { DEG_TO_RAD, Matrix, Point, RAD_TO_DEG, Rectangle, Transform } from '@pixi/math';\nimport { EventEmitter } from '@pixi/utils';\nimport { Container } from './Container';\nimport { Bounds } from './Bounds';\n\nimport type { Filter, MaskData, Renderer } from '@pixi/core';\nimport type { IPointData, ObservablePoint } from '@pixi/math';\nimport type { Dict } from '@pixi/utils';\n\nexport interface IDestroyOptions {\n children?: boolean;\n texture?: boolean;\n baseTexture?: boolean;\n}\n\nexport interface DisplayObject extends GlobalMixins.DisplayObject, EventEmitter {}\n\n/**\n * The base class for all objects that are rendered on the screen.\n *\n * This is an abstract class and should not be used on its own; rather it should b e extended.\n *\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nexport abstract class DisplayObject extends EventEmitter\n{\n abstract sortDirty: boolean;\n\n public parent: DisplayObject;\n public worldAlpha: number;\n public transform: Transform;\n public alpha: number;\n public visible: boolean;\n public renderable: boolean;\n public filterArea: Rectangle;\n public filters: Filter[];\n public isSprite: boolean;\n public isMask: boolean;\n public _lastSortedIndex: number;\n public _mask: Container|MaskData;\n public _bounds: Bounds;\n public _localBounds: Bounds;\n\n protected _zIndex: number;\n protected _enabledFilters: Filter[];\n protected _boundsID: number;\n protected _boundsRect: Rectangle;\n protected _localBoundsRect: Rectangle;\n protected _destroyed: boolean;\n\n private tempDisplayObjectParent: TemporaryDisplayObject;\n public displayObjectUpdateTransform: () => void;\n\n /**\n * Mixes all enumerable properties and methods from a source object to DisplayObject.\n *\n * @param {object} source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict): void\n {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(DisplayObject.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i)\n {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n DisplayObject.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName)\n );\n }\n }\n\n constructor()\n {\n super();\n\n this.tempDisplayObjectParent = null;\n\n // TODO: need to create Transform from factory\n /**\n * World transform and local transform of this object.\n * This will become read-only later, please do not assign anything there unless you know what are you doing.\n *\n * @member {PIXI.Transform}\n */\n this.transform = new Transform();\n\n /**\n * The opacity of the object.\n *\n * @member {number}\n */\n this.alpha = 1;\n\n /**\n * The visibility of the object. If false the object will not be drawn, and\n * the updateTransform function will not be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.\n *\n * @member {boolean}\n */\n this.visible = true;\n\n /**\n * Can this object be rendered, if false the object will not be drawn but the updateTransform\n * methods will still be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds manually.\n *\n * @member {boolean}\n */\n this.renderable = true;\n\n /**\n * The display object container that contains this display object.\n *\n * @member {PIXI.Container}\n */\n this.parent = null;\n\n /**\n * The multiplied alpha of the displayObject.\n *\n * @member {number}\n * @readonly\n */\n this.worldAlpha = 1;\n\n /**\n * Which index in the children array the display component was before the previous zIndex sort.\n * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.\n *\n * @member {number}\n * @protected\n */\n this._lastSortedIndex = 0;\n\n /**\n * The zIndex of the displayObject.\n * A higher value will mean it will be rendered on top of other displayObjects within the same container.\n *\n * @member {number}\n * @protected\n */\n this._zIndex = 0;\n\n /**\n * The area the filter is applied to. This is used as more of an optimization\n * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.\n *\n * Also works as an interaction mask.\n *\n * @member {?PIXI.Rectangle}\n */\n this.filterArea = null;\n\n /**\n * Sets the filters for the displayObject.\n * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * To remove filters simply set this property to `'null'`.\n *\n * @member {?PIXI.Filter[]}\n */\n this.filters = null;\n\n /**\n * Currently enabled filters\n * @member {PIXI.Filter[]}\n * @protected\n */\n this._enabledFilters = null;\n\n /**\n * The bounds object, this is used to calculate and store the bounds of the displayObject.\n *\n * @member {PIXI.Bounds}\n */\n this._bounds = new Bounds();\n\n /**\n * Local bounds object, swapped with `_bounds` when using `getLocalBounds()`.\n *\n * @member {PIXI.Bounds}\n */\n this._localBounds = null;\n\n /**\n * Flags the cached bounds as dirty.\n *\n * @member {number}\n * @protected\n */\n this._boundsID = 0;\n\n /**\n * Cache of this display-object's bounds-rectangle.\n *\n * @member {PIXI.Bounds}\n * @protected\n */\n this._boundsRect = null;\n\n /**\n * Cache of this display-object's local-bounds rectangle.\n *\n * @member {PIXI.Bounds}\n * @protected\n */\n this._localBoundsRect = null;\n\n /**\n * The original, cached mask of the object.\n *\n * @member {PIXI.Container|PIXI.MaskData|null}\n * @protected\n */\n this._mask = null;\n\n /**\n * Fired when this DisplayObject is added to a Container.\n *\n * @event PIXI.DisplayObject#added\n * @param {PIXI.Container} container - The container added to.\n */\n\n /**\n * Fired when this DisplayObject is removed from a Container.\n *\n * @event PIXI.DisplayObject#removed\n * @param {PIXI.Container} container - The container removed from.\n */\n\n /**\n * If the object has been destroyed via destroy(). If true, it should not be used.\n *\n * @member {boolean}\n * @protected\n */\n this._destroyed = false;\n\n /**\n * used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n this.isSprite = false;\n\n /**\n * Does any other displayObject use this object as a mask?\n * @member {boolean}\n */\n this.isMask = false;\n }\n\n /**\n * Recalculates the bounds of the display object.\n */\n abstract calculateBounds(): void;\n\n abstract removeChild(child: DisplayObject): void;\n\n /**\n * Renders the object using the WebGL renderer.\n *\n * @param {PIXI.Renderer} renderer - The renderer.\n */\n abstract render(renderer: Renderer): void;\n\n /**\n * Recursively updates transform of all objects from the root to this one\n * internal function for toLocal()\n */\n protected _recursivePostUpdateTransform(): void\n {\n if (this.parent)\n {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n }\n else\n {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n }\n\n /**\n * Updates the object transform for rendering.\n *\n * TODO - Optimization pass!\n */\n updateTransform(): void\n {\n this._boundsID++;\n\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n }\n\n /**\n * Retrieves the bounds of the displayObject as a rectangle object.\n *\n * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.\n * @return {PIXI.Rectangle} The rectangular bounding area.\n */\n getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle\n {\n if (!skipUpdate)\n {\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else\n {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n\n if (this._bounds.updateID !== this._boundsID)\n {\n this.calculateBounds();\n this._bounds.updateID = this._boundsID;\n }\n\n if (!rect)\n {\n if (!this._boundsRect)\n {\n this._boundsRect = new Rectangle();\n }\n\n rect = this._boundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n *\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.\n * @return {PIXI.Rectangle} The rectangular bounding area.\n */\n getLocalBounds(rect?: Rectangle): Rectangle\n {\n if (!rect)\n {\n if (!this._localBoundsRect)\n {\n this._localBoundsRect = new Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n if (!this._localBounds)\n {\n this._localBounds = new Bounds();\n }\n\n const transformRef = this.transform;\n const parentRef = this.parent;\n\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n\n const worldBounds = this._bounds;\n const worldBoundsID = this._boundsID;\n\n this._bounds = this._localBounds;\n\n const bounds = this.getBounds(false, rect);\n\n this.parent = parentRef;\n this.transform = transformRef;\n\n this._bounds = worldBounds;\n this._bounds.updateID += this._boundsID - worldBoundsID;// reflect side-effects\n\n return bounds;\n }\n\n /**\n * Calculates the global position of the display object.\n *\n * @param {PIXI.IPointData} position - The world origin to calculate from.\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform.\n * @return {PIXI.Point} A point object representing the position of this object.\n */\n toGlobal(position: IPointData, point?: P, skipUpdate = false): P\n {\n if (!skipUpdate)\n {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else\n {\n this.displayObjectUpdateTransform();\n }\n }\n\n // don't need to update the lot\n return this.worldTransform.apply
(position, point);\n }\n\n /**\n * Calculates the local position of the display object relative to another point.\n *\n * @param {PIXI.IPointData} position - The world origin to calculate from.\n * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform\n * @return {PIXI.Point} A point object representing the position of this object\n */\n toLocal
(position: IPointData, from: DisplayObject, point?: P, skipUpdate?: boolean): P\n {\n if (from)\n {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n if (!skipUpdate)\n {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else\n {\n this.displayObjectUpdateTransform();\n }\n }\n\n // simply apply the matrix..\n return this.worldTransform.applyInverse
(position, point);\n }\n\n /**\n * Set the parent Container of this DisplayObject.\n *\n * @param {PIXI.Container} container - The Container to add this DisplayObject to.\n * @return {PIXI.Container} The Container that this DisplayObject was added to.\n */\n setParent(container: Container): Container\n {\n if (!container || !container.addChild)\n {\n throw new Error('setParent: Argument must be a Container');\n }\n\n container.addChild(this);\n\n return container;\n }\n\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n *\n * @param {number} [x=0] - The X position\n * @param {number} [y=0] - The Y position\n * @param {number} [scaleX=1] - The X scale value\n * @param {number} [scaleY=1] - The Y scale value\n * @param {number} [rotation=0] - The rotation\n * @param {number} [skewX=0] - The X skew value\n * @param {number} [skewY=0] - The Y skew value\n * @param {number} [pivotX=0] - The X pivot value\n * @param {number} [pivotY=0] - The Y pivot value\n * @return {PIXI.DisplayObject} The DisplayObject instance\n */\n setTransform(x = 0, y = 0, scaleX = 1, scaleY = 1, rotation = 0, skewX = 0, skewY = 0, pivotX = 0, pivotY = 0): this\n {\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n\n return this;\n }\n\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy()`.\n *\n */\n destroy(_options?: IDestroyOptions|boolean): void\n {\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this.removeAllListeners();\n this.transform = null;\n\n this.parent = null;\n this._bounds = null;\n this._mask = null;\n\n this.filters = null;\n this.filterArea = null;\n this.hitArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n\n this._destroyed = true;\n }\n\n /**\n * @protected\n * @member {PIXI.Container}\n */\n get _tempDisplayObjectParent(): TemporaryDisplayObject\n {\n if (this.tempDisplayObjectParent === null)\n {\n // eslint-disable-next-line no-use-before-define\n this.tempDisplayObjectParent = new TemporaryDisplayObject();\n }\n\n return this.tempDisplayObjectParent;\n }\n\n /**\n * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root\n *\n * ```\n * const cacheParent = elem.enableTempParent();\n * elem.updateTransform();\n * elem.disableTempParent(cacheParent);\n * ```\n *\n * @returns {PIXI.DisplayObject} current parent\n */\n enableTempParent(): DisplayObject\n {\n const myParent = this.parent;\n\n this.parent = this._tempDisplayObjectParent;\n\n return myParent;\n }\n\n /**\n * Pair method for `enableTempParent`\n * @param {PIXI.DisplayObject} cacheParent actual parent of element\n */\n disableTempParent(cacheParent: DisplayObject): void\n {\n this.parent = cacheParent;\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n *\n * @member {number}\n */\n get x(): number\n {\n return this.position.x;\n }\n\n set x(value: number)\n {\n this.transform.position.x = value;\n }\n\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n *\n * @member {number}\n */\n get y(): number\n {\n return this.position.y;\n }\n\n set y(value: number)\n {\n this.transform.position.y = value;\n }\n\n /**\n * Current transform of the object based on world (parent) factors.\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n get worldTransform(): Matrix\n {\n return this.transform.worldTransform;\n }\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff.\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n get localTransform(): Matrix\n {\n return this.transform.localTransform;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n get position(): ObservablePoint\n {\n return this.transform.position;\n }\n\n set position(value: ObservablePoint)\n {\n this.transform.position.copyFrom(value);\n }\n\n /**\n * The scale factor of the object.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n get scale(): ObservablePoint\n {\n return this.transform.scale;\n }\n\n set scale(value: ObservablePoint)\n {\n this.transform.scale.copyFrom(value);\n }\n\n /**\n * The pivot point of the displayObject that it rotates around.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n get pivot(): ObservablePoint\n {\n return this.transform.pivot;\n }\n\n set pivot(value: ObservablePoint)\n {\n this.transform.pivot.copyFrom(value);\n }\n\n /**\n * The skew factor for the object in radians.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n get skew(): ObservablePoint\n {\n return this.transform.skew;\n }\n\n set skew(value: ObservablePoint)\n {\n this.transform.skew.copyFrom(value);\n }\n\n /**\n * The rotation of the object in radians.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n *\n * @member {number}\n */\n get rotation(): number\n {\n return this.transform.rotation;\n }\n\n set rotation(value: number)\n {\n this.transform.rotation = value;\n }\n\n /**\n * The angle of the object in degrees.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n *\n * @member {number}\n */\n get angle(): number\n {\n return this.transform.rotation * RAD_TO_DEG;\n }\n\n set angle(value: number)\n {\n this.transform.rotation = value * DEG_TO_RAD;\n }\n\n /**\n * The zIndex of the displayObject.\n * If a container has the sortableChildren property set to true, children will be automatically\n * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,\n * and thus rendered on top of other displayObjects within the same container.\n *\n * @member {number}\n */\n get zIndex(): number\n {\n return this._zIndex;\n }\n\n set zIndex(value: number)\n {\n this._zIndex = value;\n if (this.parent)\n {\n this.parent.sortDirty = true;\n }\n }\n\n /**\n * Indicates if the object is globally visible.\n *\n * @member {boolean}\n * @readonly\n */\n get worldVisible(): boolean\n {\n let item = this as DisplayObject;\n\n do\n {\n if (!item.visible)\n {\n return false;\n }\n\n item = item.parent;\n } while (item);\n\n return true;\n }\n\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PixiJS a regular mask must be a\n * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it\n * utilities shape clipping. To remove a mask, set this property to `null`.\n *\n * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.\n * @example\n * const graphics = new PIXI.Graphics();\n * graphics.beginFill(0xFF3300);\n * graphics.drawRect(50, 250, 100, 100);\n * graphics.endFill();\n *\n * const sprite = new PIXI.Sprite(texture);\n * sprite.mask = graphics;\n * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n *\n * @member {PIXI.Container|PIXI.MaskData|null}\n */\n get mask(): Container|MaskData|null\n {\n return this._mask;\n }\n\n set mask(value: Container|MaskData|null)\n {\n if (this._mask)\n {\n const maskObject = ((this._mask as MaskData).maskObject || this._mask) as Container;\n\n maskObject.renderable = true;\n maskObject.isMask = false;\n }\n\n this._mask = value;\n\n if (this._mask)\n {\n const maskObject = ((this._mask as MaskData).maskObject || this._mask) as Container;\n\n maskObject.renderable = false;\n maskObject.isMask = true;\n }\n }\n}\n\nexport class TemporaryDisplayObject extends DisplayObject\n{\n calculateBounds: () => null;\n removeChild: (child: DisplayObject) => null;\n render: (renderer: Renderer) => null;\n sortDirty: boolean = null;\n}\n\n/**\n * DisplayObject default updateTransform, does not update children of container.\n * Will crash if there's no parent element.\n *\n * @memberof PIXI.DisplayObject#\n * @function displayObjectUpdateTransform\n */\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n","import { settings } from '@pixi/settings';\nimport { removeItems } from '@pixi/utils';\nimport { DisplayObject } from './DisplayObject';\nimport { Rectangle } from '@pixi/math';\n\nimport type { MaskData, Renderer } from '@pixi/core';\nimport type { IDestroyOptions } from './DisplayObject';\n\nfunction sortChildren(a: DisplayObject, b: DisplayObject): number\n{\n if (a.zIndex === b.zIndex)\n {\n return a._lastSortedIndex - b._lastSortedIndex;\n }\n\n return a.zIndex - b.zIndex;\n}\n\nexport interface Container extends GlobalMixins.Container, DisplayObject {}\n\n/**\n * A Container represents a collection of display objects.\n *\n * It is the base class of all display objects that act as a container for other objects (like Sprites).\n *\n *```js\n * let container = new PIXI.Container();\n * container.addChild(sprite);\n * ```\n *\n * @class\n * @extends PIXI.DisplayObject\n * @memberof PIXI\n */\nexport class Container extends DisplayObject\n{\n public readonly children: DisplayObject[];\n public sortableChildren: boolean;\n public sortDirty: boolean;\n public containerUpdateTransform: () => void;\n\n protected _width: number;\n protected _height: number;\n\n constructor()\n {\n super();\n\n /**\n * The array of children of this container.\n *\n * @member {PIXI.DisplayObject[]}\n * @readonly\n */\n this.children = [];\n\n /**\n * If set to true, the container will sort its children by zIndex value\n * when updateTransform() is called, or manually if sortChildren() is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as @link https://github.com/pixijs/pixi-display\n *\n * Also be aware of that this may not work nicely with the addChildAt() function,\n * as the zIndex sorting may cause the child to automatically sorted to another position.\n *\n * @see PIXI.settings.SORTABLE_CHILDREN\n *\n * @member {boolean}\n */\n this.sortableChildren = settings.SORTABLE_CHILDREN;\n\n /**\n * Should children be sorted by zIndex at the next updateTransform call.\n * Will get automatically set to true if a new child is added, or if a child's zIndex changes.\n *\n * @member {boolean}\n */\n this.sortDirty = false;\n\n /**\n * Fired when a DisplayObject is added to this Container.\n *\n * @event PIXI.Container#childAdded\n * @param {PIXI.DisplayObject} child - The child added to the Container.\n * @param {PIXI.Container} container - The container that added the child.\n * @param {number} index - The children's index of the added child.\n */\n\n /**\n * Fired when a DisplayObject is removed from this Container.\n *\n * @event PIXI.DisplayObject#removedFrom\n * @param {PIXI.DisplayObject} child - The child removed from the Container.\n * @param {PIXI.Container} container - The container that removed removed the child.\n * @param {number} index - The former children's index of the removed child\n */\n }\n\n /**\n * Overridable method that can be used by Container subclasses whenever the children array is modified\n *\n * @protected\n */\n protected onChildrenChange(_length: number): void\n {\n /* empty */\n }\n\n /**\n * Adds one or more children to the container.\n *\n * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`\n *\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container\n * @return {PIXI.DisplayObject} The first child that was added.\n */\n addChild(...children: T): T[0]\n {\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1)\n {\n // loop through the array and add all children\n for (let i = 0; i < children.length; i++)\n {\n // eslint-disable-next-line prefer-rest-params\n this.addChild(children[i]);\n }\n }\n else\n {\n const child = children[0];\n // if the child has a parent then lets remove it as PixiJS objects can only exist in one place\n\n if (child.parent)\n {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n this.sortDirty = true;\n\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.push(child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(this.children.length - 1);\n this.emit('childAdded', child, this, this.children.length - 1);\n child.emit('added', this);\n }\n\n return children[0];\n }\n\n /**\n * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown\n *\n * @param {PIXI.DisplayObject} child - The child to add\n * @param {number} index - The index to place the child in\n * @return {PIXI.DisplayObject} The child that was added.\n */\n addChildAt(child: T, index: number): T\n {\n if (index < 0 || index > this.children.length)\n {\n throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n if (child.parent)\n {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n this.sortDirty = true;\n\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.splice(index, 0, child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('added', this);\n this.emit('childAdded', child, this, index);\n\n return child;\n }\n\n /**\n * Swaps the position of 2 Display Objects within this container.\n *\n * @param {PIXI.DisplayObject} child - First display object to swap\n * @param {PIXI.DisplayObject} child2 - Second display object to swap\n */\n swapChildren(child: DisplayObject, child2: DisplayObject): void\n {\n if (child === child2)\n {\n return;\n }\n\n const index1 = this.getChildIndex(child);\n const index2 = this.getChildIndex(child2);\n\n this.children[index1] = child2;\n this.children[index2] = child;\n this.onChildrenChange(index1 < index2 ? index1 : index2);\n }\n\n /**\n * Returns the index position of a child DisplayObject instance\n *\n * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify\n * @return {number} The index position of the child display object to identify\n */\n getChildIndex(child: DisplayObject): number\n {\n const index = this.children.indexOf(child);\n\n if (index === -1)\n {\n throw new Error('The supplied DisplayObject must be a child of the caller');\n }\n\n return index;\n }\n\n /**\n * Changes the position of an existing child in the display object container\n *\n * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number\n * @param {number} index - The resulting index number for the child display object\n */\n setChildIndex(child: DisplayObject, index: number): void\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n const currentIndex = this.getChildIndex(child);\n\n removeItems(this.children, currentIndex, 1); // remove from old position\n this.children.splice(index, 0, child); // add at new position\n\n this.onChildrenChange(index);\n }\n\n /**\n * Returns the child at the specified index\n *\n * @param {number} index - The index to get the child at\n * @return {PIXI.DisplayObject} The child at the given index, if any.\n */\n getChildAt(index: number): DisplayObject\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`getChildAt: Index (${index}) does not exist.`);\n }\n\n return this.children[index];\n }\n\n /**\n * Removes one or more children from the container.\n *\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove\n * @return {PIXI.DisplayObject} The first child that was removed.\n */\n removeChild(...children: T): T[0]\n {\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1)\n {\n // loop through the arguments property and remove all children\n for (let i = 0; i < children.length; i++)\n {\n this.removeChild(children[i]);\n }\n }\n else\n {\n const child = children[0];\n const index = this.children.indexOf(child);\n\n if (index === -1) return null;\n\n child.parent = null;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n }\n\n return children[0];\n }\n\n /**\n * Removes a child from the specified index position.\n *\n * @param {number} index - The index to get the child from\n * @return {PIXI.DisplayObject} The child that was removed.\n */\n removeChildAt(index: number): DisplayObject\n {\n const child = this.getChildAt(index);\n\n // ensure child transform will be recalculated..\n child.parent = null;\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n\n return child;\n }\n\n /**\n * Removes all children from this container that are within the begin and end indexes.\n *\n * @param {number} [beginIndex=0] - The beginning position.\n * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.\n * @returns {PIXI.DisplayObject[]} List of removed children\n */\n removeChildren(beginIndex = 0, endIndex = this.children.length): DisplayObject[]\n {\n const begin = beginIndex;\n const end = endIndex;\n const range = end - begin;\n let removed;\n\n if (range > 0 && range <= end)\n {\n removed = this.children.splice(begin, range);\n\n for (let i = 0; i < removed.length; ++i)\n {\n removed[i].parent = null;\n if (removed[i].transform)\n {\n removed[i].transform._parentID = -1;\n }\n }\n\n this._boundsID++;\n\n this.onChildrenChange(beginIndex);\n\n for (let i = 0; i < removed.length; ++i)\n {\n removed[i].emit('removed', this);\n this.emit('childRemoved', removed[i], this, i);\n }\n\n return removed;\n }\n else if (range === 0 && this.children.length === 0)\n {\n return [];\n }\n\n throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n }\n\n /**\n * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.\n */\n sortChildren(): void\n {\n let sortRequired = false;\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n child._lastSortedIndex = i;\n\n if (!sortRequired && child.zIndex !== 0)\n {\n sortRequired = true;\n }\n }\n\n if (sortRequired && this.children.length > 1)\n {\n this.children.sort(sortChildren);\n }\n\n this.sortDirty = false;\n }\n\n /**\n * Updates the transform on all children of this container for rendering\n */\n updateTransform(): void\n {\n if (this.sortableChildren && this.sortDirty)\n {\n this.sortChildren();\n }\n\n this._boundsID++;\n\n this.transform.updateTransform(this.parent.transform);\n\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n child.updateTransform();\n }\n }\n }\n\n /**\n * Recalculates the bounds of the container.\n *\n */\n calculateBounds(): void\n {\n this._bounds.clear();\n\n this._calculateBounds();\n\n for (let i = 0; i < this.children.length; i++)\n {\n const child = this.children[i];\n\n if (!child.visible || !child.renderable)\n {\n continue;\n }\n\n child.calculateBounds();\n\n // TODO: filter+mask, need to mask both somehow\n if (child._mask)\n {\n const maskObject = ((child._mask as MaskData).maskObject || child._mask) as Container;\n\n maskObject.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, maskObject._bounds);\n }\n else if (child.filterArea)\n {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n }\n else\n {\n this._bounds.addBounds(child._bounds);\n }\n }\n\n this._bounds.updateID = this._boundsID;\n }\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n *\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.\n * @param {boolean} [skipChildrenUpdate=false] - Setting to `true` will stop re-calculation of children transforms,\n * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.\n * @return {PIXI.Rectangle} The rectangular bounding area.\n */\n public getLocalBounds(rect?: Rectangle, skipChildrenUpdate = false): Rectangle\n {\n const result = super.getLocalBounds(rect);\n\n if (!skipChildrenUpdate)\n {\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n child.updateTransform();\n }\n }\n }\n\n return result;\n }\n\n /**\n * Recalculates the bounds of the object. Override this to\n * calculate the bounds of the specific object (not including children).\n *\n * @protected\n */\n protected _calculateBounds(): void\n {\n // FILL IN//\n }\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.Renderer} renderer - The renderer\n */\n render(renderer: Renderer): void\n {\n // if the object is not visible or the alpha is 0 then no need to render this element\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n {\n return;\n }\n\n // do a quick check to see if this element has a mask or a filter.\n if (this._mask || (this.filters && this.filters.length))\n {\n this.renderAdvanced(renderer);\n }\n else\n {\n this._render(renderer);\n\n // simple render children!\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n this.children[i].render(renderer);\n }\n }\n }\n\n /**\n * Render the object using the WebGL renderer and advanced features.\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n protected renderAdvanced(renderer: Renderer): void\n {\n renderer.batch.flush();\n\n const filters = this.filters;\n const mask = this._mask;\n\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (filters)\n {\n if (!this._enabledFilters)\n {\n this._enabledFilters = [];\n }\n\n this._enabledFilters.length = 0;\n\n for (let i = 0; i < filters.length; i++)\n {\n if (filters[i].enabled)\n {\n this._enabledFilters.push(filters[i]);\n }\n }\n\n if (this._enabledFilters.length)\n {\n renderer.filter.push(this, this._enabledFilters);\n }\n }\n\n if (mask)\n {\n renderer.mask.push(this, this._mask);\n }\n\n // add this object to the batch, only rendered if it has a texture.\n this._render(renderer);\n\n // now loop through the children and make sure they get rendered\n for (let i = 0, j = this.children.length; i < j; i++)\n {\n this.children[i].render(renderer);\n }\n\n renderer.batch.flush();\n\n if (mask)\n {\n renderer.mask.pop(this);\n }\n\n if (filters && this._enabledFilters && this._enabledFilters.length)\n {\n renderer.filter.pop();\n }\n }\n\n /**\n * To be overridden by the subclasses.\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n protected _render(_renderer: Renderer): void // eslint-disable-line no-unused-vars\n {\n // this is where content itself gets rendered...\n }\n\n /**\n * Removes all internal references and listeners as well as removes children from the display list.\n * Do not use a Container after calling `destroy`.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n destroy(options?: IDestroyOptions|boolean): void\n {\n super.destroy();\n\n this.sortDirty = false;\n\n const destroyChildren = typeof options === 'boolean' ? options : options && options.children;\n\n const oldChildren = this.removeChildren(0, this.children.length);\n\n if (destroyChildren)\n {\n for (let i = 0; i < oldChildren.length; ++i)\n {\n oldChildren[i].destroy(options);\n }\n }\n }\n\n /**\n * The width of the Container, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get width(): number\n {\n return this.scale.x * this.getLocalBounds().width;\n }\n\n set width(value: number)\n {\n const width = this.getLocalBounds().width;\n\n if (width !== 0)\n {\n this.scale.x = value / width;\n }\n else\n {\n this.scale.x = 1;\n }\n\n this._width = value;\n }\n\n /**\n * The height of the Container, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get height(): number\n {\n return this.scale.y * this.getLocalBounds().height;\n }\n\n set height(value: number)\n {\n const height = this.getLocalBounds().height;\n\n if (height !== 0)\n {\n this.scale.y = value / height;\n }\n else\n {\n this.scale.y = 1;\n }\n\n this._height = value;\n }\n}\n\n/**\n * Container default updateTransform, does update children of container.\n * Will crash if there's no parent element.\n *\n * @memberof PIXI.Container#\n * @function containerUpdateTransform\n */\nContainer.prototype.containerUpdateTransform = Container.prototype.updateTransform;\n","import type { DisplayObject } from '@pixi/display';\n\nexport type PointerEvents = 'auto'\n| 'none'\n| 'visiblePainted'\n| 'visibleFill'\n| 'visibleStroke'\n| 'visible'\n| 'painted'\n| 'fill'\n| 'stroke'\n| 'all'\n| 'inherit';\n\nexport interface IAccessibleTarget {\n accessible: boolean;\n accessibleTitle: string;\n accessibleHint: string;\n tabIndex: number;\n _accessibleActive: boolean;\n _accessibleDiv: IAccessibleHTMLElement;\n accessibleType: string;\n accessiblePointerEvents: PointerEvents;\n accessibleChildren: true;\n renderId: number;\n}\n\nexport interface IAccessibleHTMLElement extends HTMLElement {\n type?: string;\n displayObject?: DisplayObject;\n}\n\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.AccessibilityManager}.\n *\n * @private\n * @function accessibleTarget\n * @memberof PIXI\n * @type {Object}\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibleTarget\n * );\n */\nexport const accessibleTarget: IAccessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n accessible: false,\n\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {?string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleTitle: null,\n\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleHint: null,\n\n /**\n * @member {number}\n * @memberof PIXI.DisplayObject#\n * @private\n * @todo Needs docs.\n */\n tabIndex: 0,\n\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleActive: false,\n\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleDiv: null,\n\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'button'\n */\n accessibleType: 'button',\n\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @default true\n */\n accessibleChildren: true,\n\n renderId: -1,\n};\n","import { DisplayObject } from '@pixi/display';\nimport { isMobile, removeItems } from '@pixi/utils';\nimport { accessibleTarget } from './accessibleTarget';\n\nimport type { Rectangle } from '@pixi/math';\nimport type { Container } from '@pixi/display';\nimport type { Renderer, AbstractRenderer } from '@pixi/core';\nimport type { IAccessibleHTMLElement } from './accessibleTarget';\n\n// add some extra variables to the container..\nDisplayObject.mixin(accessibleTarget);\n\nconst KEY_CODE_TAB = 9;\n\nconst DIV_TOUCH_SIZE = 100;\nconst DIV_TOUCH_POS_X = 0;\nconst DIV_TOUCH_POS_Y = 0;\nconst DIV_TOUCH_ZINDEX = 2;\n\nconst DIV_HOOK_SIZE = 1;\nconst DIV_HOOK_POS_X = -1000;\nconst DIV_HOOK_POS_Y = -1000;\nconst DIV_HOOK_ZINDEX = 2;\n\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen readers.\n * This is very important as it can possibly help people with disabilities access PixiJS content.\n *\n * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`\n *\n * @class\n * @memberof PIXI\n */\nexport class AccessibilityManager\n{\n public debug: boolean;\n public renderer: AbstractRenderer|Renderer;\n\n private _isActive: boolean;\n private _isMobileAccessibility: boolean;\n private _hookDiv: HTMLElement;\n private div: HTMLElement;\n private pool: IAccessibleHTMLElement[];\n private renderId: number;\n private children: DisplayObject[];\n private androidUpdateCount: number;\n private androidUpdateFrequency: number;\n\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n */\n constructor(renderer: AbstractRenderer|Renderer)\n {\n /**\n * @type {?HTMLElement}\n * @private\n */\n this._hookDiv = null;\n\n if (isMobile.tablet || isMobile.phone)\n {\n this.createTouchHook();\n }\n\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n const div = document.createElement('div');\n\n div.style.width = `${DIV_TOUCH_SIZE}px`;\n div.style.height = `${DIV_TOUCH_SIZE}px`;\n div.style.position = 'absolute';\n div.style.top = `${DIV_TOUCH_POS_X}px`;\n div.style.left = `${DIV_TOUCH_POS_Y}px`;\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n\n /**\n * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n\n /**\n * Setting this to true will visually show the divs.\n *\n * @type {boolean}\n */\n this.debug = false;\n\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.AbstractRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onMouseMove = this._onMouseMove.bind(this);\n\n this._isActive = false;\n\n this._isMobileAccessibility = false;\n\n /**\n * count to throttle div updates on android devices\n * @type number\n * @private\n */\n this.androidUpdateCount = 0;\n\n /**\n * the frequency to update the div elements ()\n * @private\n */\n this.androidUpdateFrequency = 500; // 2fps\n\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get isActive(): boolean\n {\n return this._isActive;\n }\n\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get isMobileAccessibility(): boolean\n {\n return this._isMobileAccessibility;\n }\n\n /**\n * Creates the touch hooks.\n *\n * @private\n */\n private createTouchHook(): void\n {\n const hookDiv = document.createElement('button');\n\n hookDiv.style.width = `${DIV_HOOK_SIZE}px`;\n hookDiv.style.height = `${DIV_HOOK_SIZE}px`;\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = `${DIV_HOOK_POS_X}px`;\n hookDiv.style.left = `${DIV_HOOK_POS_Y}px`;\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'select to enable accessability for this content';\n\n hookDiv.addEventListener('focus', () =>\n {\n this._isMobileAccessibility = true;\n this.activate();\n this.destroyTouchHook();\n });\n\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n }\n\n /**\n * Destroys the touch hooks.\n *\n * @private\n */\n private destroyTouchHook(): void\n {\n if (!this._hookDiv)\n {\n return;\n }\n document.body.removeChild(this._hookDiv);\n this._hookDiv = null;\n }\n\n /**\n * Activating will cause the Accessibility layer to be shown.\n * This is called when a user presses the tab key.\n *\n * @private\n */\n private activate(): void\n {\n if (this._isActive)\n {\n return;\n }\n\n this._isActive = true;\n\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n\n // TODO: Remove casting when CanvasRenderer is converted\n (this.renderer as AbstractRenderer).on('postrender', this.update, this);\n\n if ((this.renderer as AbstractRenderer).view.parentNode)\n {\n (this.renderer as AbstractRenderer).view.parentNode.appendChild(this.div);\n }\n }\n\n /**\n * Deactivating will cause the Accessibility layer to be hidden.\n * This is called when a user moves the mouse.\n *\n * @private\n */\n private deactivate(): void\n {\n if (!this._isActive || this._isMobileAccessibility)\n {\n return;\n }\n\n this._isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n // TODO: Remove casting when CanvasRenderer is converted\n (this.renderer as AbstractRenderer).off('postrender', this.update);\n\n if (this.div.parentNode)\n {\n this.div.parentNode.removeChild(this.div);\n }\n }\n\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n private updateAccessibleObjects(displayObject: Container): void\n {\n if (!displayObject.visible || !displayObject.accessibleChildren)\n {\n return;\n }\n\n if (displayObject.accessible && displayObject.interactive)\n {\n if (!displayObject._accessibleActive)\n {\n this.addChild(displayObject);\n }\n\n displayObject.renderId = this.renderId;\n }\n\n const children = displayObject.children;\n\n for (let i = 0; i < children.length; i++)\n {\n this.updateAccessibleObjects(children[i] as Container);\n }\n }\n\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n private update(): void\n {\n /* On Android default web browser, tab order seems to be calculated by position rather than tabIndex,\n * moving buttons can cause focus to flicker between two buttons making it hard/impossible to navigate,\n * so I am just running update every half a second, seems to fix it.\n */\n const now = performance.now();\n\n if (isMobile.android.device && now < this.androidUpdateCount)\n {\n return;\n }\n\n this.androidUpdateCount = now + this.androidUpdateFrequency;\n\n if (!(this.renderer as Renderer).renderingToScreen)\n {\n return;\n }\n\n // update children...\n if (this.renderer._lastObjectRendered)\n {\n this.updateAccessibleObjects(this.renderer._lastObjectRendered as Container);\n }\n\n // TODO: Remove casting when CanvasRenderer is converted\n const rect = (this.renderer as AbstractRenderer).view.getBoundingClientRect();\n\n const resolution = this.renderer.resolution;\n\n const sx = (rect.width / (this.renderer as AbstractRenderer).width) * resolution;\n const sy = (rect.height / (this.renderer as AbstractRenderer).height) * resolution;\n\n let div = this.div;\n\n div.style.left = `${rect.left}px`;\n div.style.top = `${rect.top}px`;\n div.style.width = `${(this.renderer as AbstractRenderer).width}px`;\n div.style.height = `${(this.renderer as AbstractRenderer).height}px`;\n\n for (let i = 0; i < this.children.length; i++)\n {\n const child = this.children[i];\n\n if (child.renderId !== this.renderId)\n {\n child._accessibleActive = false;\n\n removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n\n i--;\n }\n else\n {\n // map div to display..\n div = child._accessibleDiv;\n let hitArea = child.hitArea as Rectangle;\n const wt = child.worldTransform;\n\n if (child.hitArea)\n {\n div.style.left = `${(wt.tx + (hitArea.x * wt.a)) * sx}px`;\n div.style.top = `${(wt.ty + (hitArea.y * wt.d)) * sy}px`;\n\n div.style.width = `${hitArea.width * wt.a * sx}px`;\n div.style.height = `${hitArea.height * wt.d * sy}px`;\n }\n else\n {\n hitArea = child.getBounds();\n\n this.capHitArea(hitArea);\n\n div.style.left = `${hitArea.x * sx}px`;\n div.style.top = `${hitArea.y * sy}px`;\n\n div.style.width = `${hitArea.width * sx}px`;\n div.style.height = `${hitArea.height * sy}px`;\n\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null)\n {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null)\n {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n\n // the title or index may have changed, if so lets update it!\n if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex)\n {\n div.title = child.accessibleTitle;\n div.tabIndex = child.tabIndex;\n if (this.debug) this.updateDebugHTML(div);\n }\n }\n }\n\n // increment the render id..\n this.renderId++;\n }\n\n /**\n * private function that will visually add the information to the\n * accessability div\n *\n * @param {HTMLElement} div\n */\n public updateDebugHTML(div: IAccessibleHTMLElement): void\n {\n div.innerHTML = `type: ${div.type} title : ${div.title} tabIndex: ${div.tabIndex}`;\n }\n\n /**\n * Adjust the hit area based on the bounds of a display object\n *\n * @param {PIXI.Rectangle} hitArea - Bounds of the child\n */\n public capHitArea(hitArea: Rectangle): void\n {\n if (hitArea.x < 0)\n {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n\n if (hitArea.y < 0)\n {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n\n // TODO: Remove casting when CanvasRenderer is converted\n if (hitArea.x + hitArea.width > (this.renderer as AbstractRenderer).width)\n {\n hitArea.width = (this.renderer as AbstractRenderer).width - hitArea.x;\n }\n\n if (hitArea.y + hitArea.height > (this.renderer as AbstractRenderer).height)\n {\n hitArea.height = (this.renderer as AbstractRenderer).height - hitArea.y;\n }\n }\n\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {PIXI.DisplayObject} displayObject - The child to make accessible.\n */\n private addChild(displayObject: T): void\n {\n // this.activate();\n\n let div = this.pool.pop();\n\n if (!div)\n {\n div = document.createElement('button');\n\n div.style.width = `${DIV_TOUCH_SIZE}px`;\n div.style.height = `${DIV_TOUCH_SIZE}px`;\n div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n div.style.borderStyle = 'none';\n\n // ARIA attributes ensure that button title and hint updates are announced properly\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)\n {\n // Chrome doesn't need aria-live to work as intended; in fact it just gets more confused.\n div.setAttribute('aria-live', 'off');\n }\n else\n {\n div.setAttribute('aria-live', 'polite');\n }\n\n if (navigator.userAgent.match(/rv:.*Gecko\\//))\n {\n // FireFox needs this to announce only the new button name\n div.setAttribute('aria-relevant', 'additions');\n }\n else\n {\n // required by IE, other browsers don't much care\n div.setAttribute('aria-relevant', 'text');\n }\n\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n\n // set pointer events\n div.style.pointerEvents = displayObject.accessiblePointerEvents;\n // set the type, this defaults to button!\n div.type = displayObject.accessibleType;\n\n if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null)\n {\n div.title = displayObject.accessibleTitle;\n }\n else if (!displayObject.accessibleHint\n || displayObject.accessibleHint === null)\n {\n div.title = `displayObject ${displayObject.tabIndex}`;\n }\n\n if (displayObject.accessibleHint\n && displayObject.accessibleHint !== null)\n {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n\n if (this.debug) this.updateDebugHTML(div);\n\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n }\n\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n private _onClick(e: MouseEvent): void\n {\n // TODO: Remove casting when CanvasRenderer is converted\n const interactionManager = (this.renderer as AbstractRenderer).plugins.interaction;\n\n interactionManager.dispatchEvent(\n (e.target as IAccessibleHTMLElement).displayObject, 'click', interactionManager.eventData\n );\n interactionManager.dispatchEvent(\n (e.target as IAccessibleHTMLElement).displayObject, 'pointertap', interactionManager.eventData\n );\n interactionManager.dispatchEvent(\n (e.target as IAccessibleHTMLElement).displayObject, 'tap', interactionManager.eventData\n );\n }\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n private _onFocus(e: FocusEvent): void\n {\n if (!(e.target as Element).getAttribute('aria-live'))\n {\n (e.target as Element).setAttribute('aria-live', 'assertive');\n }\n\n // TODO: Remove casting when CanvasRenderer is converted\n const interactionManager = (this.renderer as AbstractRenderer).plugins.interaction;\n\n interactionManager.dispatchEvent(\n (e.target as IAccessibleHTMLElement).displayObject, 'mouseover', interactionManager.eventData\n );\n }\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n private _onFocusOut(e: FocusEvent): void\n {\n if (!(e.target as Element).getAttribute('aria-live'))\n {\n (e.target as Element).setAttribute('aria-live', 'polite');\n }\n\n // TODO: Remove casting when CanvasRenderer is converted\n const interactionManager = (this.renderer as AbstractRenderer).plugins.interaction;\n\n interactionManager.dispatchEvent((e.target as any).displayObject, 'mouseout', interactionManager.eventData);\n }\n\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n private _onKeyDown(e: KeyboardEvent): void\n {\n if (e.keyCode !== KEY_CODE_TAB)\n {\n return;\n }\n\n this.activate();\n }\n\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n * @param {MouseEvent} e - The mouse event.\n */\n private _onMouseMove(e: MouseEvent): void\n {\n if (e.movementX === 0 && e.movementY === 0)\n {\n return;\n }\n\n this.deactivate();\n }\n\n /**\n * Destroys the accessibility manager\n *\n */\n public destroy(): void\n {\n this.destroyTouchHook();\n this.div = null;\n\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }\n}\n","import { TickerCallback } from './Ticker';\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n *\n * @private\n * @class\n * @memberof PIXI\n */\nexport class TickerListener\n{\n public priority: number;\n public next: TickerListener;\n public previous: TickerListener;\n\n private fn: TickerCallback;\n private context: T;\n private once: boolean;\n private _destroyed: boolean;\n\n /**\n * Constructor\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {*} [context=null] - The listener context\n * @param {number} [priority=0] - The priority for emitting\n * @param {boolean} [once=false] - If the handler should fire once\n */\n constructor(fn: TickerCallback, context: T = null, priority = 0, once = false)\n {\n /**\n * The handler function to execute.\n * @private\n * @member {Function}\n */\n this.fn = fn;\n\n /**\n * The calling to execute.\n * @private\n * @member {*}\n */\n this.context = context;\n\n /**\n * The current priority.\n * @private\n * @member {number}\n */\n this.priority = priority;\n\n /**\n * If this should only execute once.\n * @private\n * @member {boolean}\n */\n this.once = once;\n\n /**\n * The next item in chain.\n * @private\n * @member {TickerListener}\n */\n this.next = null;\n\n /**\n * The previous item in chain.\n * @private\n * @member {TickerListener}\n */\n this.previous = null;\n\n /**\n * `true` if this listener has been destroyed already.\n * @member {boolean}\n * @private\n */\n this._destroyed = false;\n }\n\n /**\n * Simple compare function to figure out if a function and context match.\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {any} [context] - The listener context\n * @return {boolean} `true` if the listener match the arguments\n */\n match(fn: TickerCallback