diff --git a/examples/shader-battle-scene-transitions/assets/images/bg.png b/examples/shader-battle-scene-transitions/assets/images/bg.png new file mode 100644 index 0000000..cd371bb Binary files /dev/null and b/examples/shader-battle-scene-transitions/assets/images/bg.png differ diff --git a/examples/shader-battle-scene-transitions/assets/js/index-59Ya1GAK.js b/examples/shader-battle-scene-transitions/assets/js/index-59Ya1GAK.js new file mode 100644 index 0000000..c8142a2 --- /dev/null +++ b/examples/shader-battle-scene-transitions/assets/js/index-59Ya1GAK.js @@ -0,0 +1,6484 @@ +var On=Object.defineProperty;var Dn=(w,S,A)=>S in w?On(w,S,{enumerable:!0,configurable:!0,writable:!0,value:A}):w[S]=A;var ji=(w,S,A)=>(Dn(w,typeof S!="symbol"?S+"":S,A),A),bn=(w,S,A)=>{if(!S.has(w))throw TypeError("Cannot "+A)};var si=(w,S,A)=>{if(S.has(w))throw TypeError("Cannot add the same private member more than once");S instanceof WeakSet?S.add(w):S.set(w,A)};var zt=(w,S,A)=>(bn(w,S,"access private method"),A);(function(){const S=document.createElement("link").relList;if(S&&S.supports&&S.supports("modulepreload"))return;for(const W of document.querySelectorAll('link[rel="modulepreload"]'))b(W);new MutationObserver(W=>{for(const J of W)if(J.type==="childList")for(const p of J.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&b(p)}).observe(document,{childList:!0,subtree:!0});function A(W){const J={};return W.integrity&&(J.integrity=W.integrity),W.referrerPolicy&&(J.referrerPolicy=W.referrerPolicy),W.crossOrigin==="use-credentials"?J.credentials="include":W.crossOrigin==="anonymous"?J.credentials="omit":J.credentials="same-origin",J}function b(W){if(W.ep)return;W.ep=!0;const J=A(W);fetch(W.href,J)}})();var Bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function In(w){return w&&w.__esModule&&Object.prototype.hasOwnProperty.call(w,"default")?w.default:w}var As={exports:{}};(function(w,S){(function(b,W){w.exports=W()})(Bn,()=>(()=>{var A={50792:p=>{var C=Object.prototype.hasOwnProperty,t="~";function d(){}Object.create&&(d.prototype=Object.create(null),new d().__proto__||(t=!1));function c(e,s,h){this.fn=e,this.context=s,this.once=h||!1}function a(e,s,h,i,o){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new c(h,i||e,o),l=t?t+s:s;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],f]:e._events[l].push(f):(e._events[l]=f,e._eventsCount++),e}function r(e,s){--e._eventsCount===0?e._events=new d:delete e._events[s]}function n(){this._events=new d,this._eventsCount=0}n.prototype.eventNames=function(){var s=[],h,i;if(this._eventsCount===0)return s;for(i in h=this._events)C.call(h,i)&&s.push(t?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(h)):s},n.prototype.listeners=function(s){var h=t?t+s:s,i=this._events[h];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,f=i.length,l=new Array(f);o{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(38829),c=function(a,r,n,e){for(var s=a[0],h=1;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"angle",r,n,e,s)};p.exports=c},60757:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){for(var a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){c===void 0&&(c=0);for(var a=c;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){c===void 0&&(c=0);for(var a=t.length-1;a>=c;a--){var r=t[a],n=!0;for(var e in d)r[e]!==d[e]&&(n=!1);if(n)return r}return null};p.exports=C},94420:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(11879),c=t(60461),a=t(95540),r=t(29747),n=t(41481),e=new n({sys:{queueDepthSort:r,events:{once:r}}},0,0,1,1).setOrigin(0,0),s=function(h,i){i===void 0&&(i={});var o=i.hasOwnProperty("width"),f=i.hasOwnProperty("height"),l=a(i,"width",-1),u=a(i,"height",-1),v=a(i,"cellWidth",1),m=a(i,"cellHeight",v),x=a(i,"position",c.TOP_LEFT),g=a(i,"x",0),y=a(i,"y",0),T=0,E=0,P=l*v,R=u*m;e.setPosition(g,y),e.setSize(v,m);for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"alpha",r,n,e,s)};p.exports=c},67285:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"x",r,n,e,s)};p.exports=c},9074:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"x",r,e,h,i),d(a,"y",n,s,h,i)};p.exports=c},75222:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"y",r,n,e,s)};p.exports=c},22983:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c===void 0&&(c=0),a===void 0&&(a=6.28);for(var r=c,n=(a-c)/t.length,e=d.x,s=d.y,h=d.radius,i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c===void 0&&(c=0),a===void 0&&(a=6.28);for(var r=c,n=(a-c)/t.length,e=d.width/2,s=d.height/2,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(15258),c=t(26708),a=function(r,n,e){var s;e?s=c(n,e,r.length):s=d(n,r.length);for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(14649),c=t(86003),a=t(49498),r=function(n,e,s){s===void 0&&(s=0);var h=d(e,!1,n.length);s>0?c(h,s):s<0&&a(h,Math.abs(s));for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(84993),c=function(a,r,n){var e=d({x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},n),s=d({x1:r.x2,y1:r.y2,x2:r.x3,y2:r.y3},n),h=d({x1:r.x3,y1:r.y3,x2:r.x1,y2:r.y1},n);e.pop(),s.pop(),h.pop(),e=e.concat(s,h);for(var i=e.length/a.length,o=0,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){for(var a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n){a===void 0&&(a=0),r===void 0&&(r=0),n===void 0&&(n=1);var e,s=0,h=t.length;if(n===1)for(e=r;e=0;e--)t[e][d]+=c+s*a,s++;return t};p.exports=C},43967:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n){a===void 0&&(a=0),r===void 0&&(r=0),n===void 0&&(n=1);var e,s=0,h=t.length;if(n===1)for(e=r;e=0;e--)t[e][d]=c+s*a,s++;return t};p.exports=C},88926:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(28176),c=function(a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(24820),c=function(a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65822),c=function(a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26597),c=function(a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(90260),c=function(a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"rotation",r,n,e,s)};p.exports=c},91051:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(1163),c=t(20339),a=function(r,n,e){for(var s=n.x,h=n.y,i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(1163),c=function(a,r,n,e){var s=r.x,h=r.y;if(e===0)return a;for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"scaleX",r,n,e,s)};p.exports=c},94868:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"scaleX",r,e,h,i),d(a,"scaleY",n,s,h,i)};p.exports=c},95532:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66979),c=function(a,r,n,e,s){return d(a,"scaleY",r,n,e,s)};p.exports=c},8689:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"alpha",r,n,e,s)};p.exports=c},2645:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e){return d(a,"blendMode",r,0,n,e)};p.exports=c},32372:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"depth",r,n,e,s)};p.exports=c},85373:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){for(var a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"originX",r,e,h,i),d(a,"originY",n,s,h,i),a.forEach(function(o){o.updateDisplayOrigin()}),a};p.exports=c},79939:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"rotation",r,n,e,s)};p.exports=c},2699:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"scaleX",r,e,h,i),d(a,"scaleY",n,s,h,i)};p.exports=c},98739:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"scaleX",r,n,e,s)};p.exports=c},98476:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"scaleY",r,n,e,s)};p.exports=c},6207:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"scrollFactorX",r,e,h,i),d(a,"scrollFactorY",n,s,h,i)};p.exports=c},6607:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"scrollFactorX",r,n,e,s)};p.exports=c},72248:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"scrollFactorY",r,n,e,s)};p.exports=c},14036:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e){return d(a,"visible",r,0,n,e)};p.exports=c},77597:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"x",r,n,e,s)};p.exports=c},83194:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s,h,i){return n==null&&(n=r),d(a,"x",r,e,h,i),d(a,"y",n,s,h,i)};p.exports=c},67678:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43967),c=function(a,r,n,e,s){return d(a,"y",r,n,e,s)};p.exports=c},35850:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s){e===void 0&&(e=0),s===void 0&&(s=new d);var h,i,o=a.length;if(o===1)h=a[0].x,i=a[0].y,a[0].x=r,a[0].y=n;else{var f=1,l=0;e===0&&(l=o-1,f=o-2),h=a[l].x,i=a[l].y,a[l].x=r,a[l].y=n;for(var u=0;u=o||f===-1)){var v=a[f],m=v.x,x=v.y;v.x=h,v.y=i,h=m,i=x,e===0?f--:f++}}return s.x=h,s.y=i,s};p.exports=c},8628:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33680),c=function(a){return d(a)};p.exports=c},21837:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7602),c=function(a,r,n,e,s){s===void 0&&(s=!1);var h=Math.abs(e-n)/a.length,i;if(s)for(i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54261),c=function(a,r,n,e,s){s===void 0&&(s=!1);var h=Math.abs(e-n)/a.length,i;if(s)for(i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){if(r===void 0&&(r=!1),t.length===0)return t;if(t.length===1)return r?t[0][d]+=(a+c)/2:t[0][d]=(a+c)/2,t;var n=Math.abs(a-c)/(t.length-1),e;if(r)for(e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=0;d{/** + * @author Richard Davey + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(15994),c=function(a,r,n){n===void 0&&(n=0);for(var e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AlignTo:t(11517),Angle:t(80318),Call:t(60757),GetFirst:t(69927),GetLast:t(32265),GridAlign:t(94420),IncAlpha:t(41721),IncX:t(67285),IncXY:t(9074),IncY:t(75222),PlaceOnCircle:t(22983),PlaceOnEllipse:t(95253),PlaceOnLine:t(88505),PlaceOnRectangle:t(41346),PlaceOnTriangle:t(11575),PlayAnimation:t(29953),PropertyValueInc:t(66979),PropertyValueSet:t(43967),RandomCircle:t(88926),RandomEllipse:t(33286),RandomLine:t(96e3),RandomRectangle:t(28789),RandomTriangle:t(97154),Rotate:t(20510),RotateAround:t(91051),RotateAroundDistance:t(76332),ScaleX:t(61619),ScaleXY:t(94868),ScaleY:t(95532),SetAlpha:t(8689),SetBlendMode:t(2645),SetDepth:t(32372),SetHitArea:t(85373),SetOrigin:t(81583),SetRotation:t(79939),SetScale:t(2699),SetScaleX:t(98739),SetScaleY:t(98476),SetScrollFactor:t(6207),SetScrollFactorX:t(6607),SetScrollFactorY:t(72248),SetTint:t(14036),SetVisible:t(50159),SetX:t(77597),SetXY:t(83194),SetY:t(67678),ShiftPosition:t(35850),Shuffle:t(8628),SmootherStep:t(21910),SmoothStep:t(21837),Spread:t(62054),ToggleVisible:t(79815),WrapInRectangle:t(39665)}},42099:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(74943),r=t(81957),n=t(41138),e=t(35154),s=t(90126),h=new c({initialize:function(o,f,l){this.manager=o,this.key=f,this.type="frame",this.frames=this.getFrames(o.textureManager,e(l,"frames",[]),e(l,"defaultTextureKey",null),e(l,"sortFrames",!0)),this.frameRate=e(l,"frameRate",null),this.duration=e(l,"duration",null),this.msPerFrame,this.skipMissedFrames=e(l,"skipMissedFrames",!0),this.delay=e(l,"delay",0),this.repeat=e(l,"repeat",0),this.repeatDelay=e(l,"repeatDelay",0),this.yoyo=e(l,"yoyo",!1),this.showBeforeDelay=e(l,"showBeforeDelay",!1),this.showOnStart=e(l,"showOnStart",!1),this.hideOnComplete=e(l,"hideOnComplete",!1),this.randomFrame=e(l,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(i,o,f,l){f===null&&l===null?(i.frameRate=24,i.duration=24/o*1e3):f&&l===null?(i.duration=f,i.frameRate=o/(f/1e3)):(i.frameRate=l,i.duration=o/l*1e3),i.msPerFrame=1e3/i.frameRate},addFrame:function(i){return this.addFrameAt(this.frames.length,i)},addFrameAt:function(i,o){var f=this.getFrames(this.manager.textureManager,o);if(f.length>0){if(i===0)this.frames=f.concat(this.frames);else if(i===this.frames.length)this.frames=this.frames.concat(f);else{var l=this.frames.slice(0,i),u=this.frames.slice(i);this.frames=l.concat(f,u)}this.updateFrameSequence()}return this},checkFrame:function(i){return i>=0&&i0){m.isLast=!0,m.nextFrame=u[0],u[0].prevFrame=m;var O=1/(u.length-1);for(g=0;g0?i.inReverse&&i.forward?i.forward=!1:this.repeatAnimation(i):i.complete():this.updateAndGetNextTick(i,o.nextFrame)},handleYoyoFrame:function(i,o){if(o||(o=!1),i.inReverse===!o&&i.repeatCounter>0){(i.repeatDelay===0||i.pendingRepeat)&&(i.forward=o),this.repeatAnimation(i);return}if(i.inReverse!==o&&i.repeatCounter===0){i.complete();return}i.forward=o;var f=o?i.currentFrame.nextFrame:i.currentFrame.prevFrame;this.updateAndGetNextTick(i,f)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(i){var o=i.currentFrame;o.isFirst?i.yoyo?this.handleYoyoFrame(i,!0):i.repeatCounter>0?i.inReverse&&!i.forward?this.repeatAnimation(i):(i.forward=!0,this.repeatAnimation(i)):i.complete():this.updateAndGetNextTick(i,o.prevFrame)},updateAndGetNextTick:function(i,o){i.setCurrentFrame(o),this.getNextTick(i)},removeFrame:function(i){var o=this.frames.indexOf(i);return o!==-1&&this.removeFrameAt(o),this},removeFrameAt:function(i){return this.frames.splice(i,1),this.updateFrameSequence(),this},repeatAnimation:function(i){if(i._pendingStop===2){if(i._pendingStopValue===0)return i.stop();i._pendingStopValue--}i.repeatDelay>0&&!i.pendingRepeat?(i.pendingRepeat=!0,i.accumulator-=i.nextTick,i.nextTick+=i.repeatDelay):(i.repeatCounter--,i.forward?i.setCurrentFrame(i.currentFrame.nextFrame):i.setCurrentFrame(i.currentFrame.prevFrame),i.isPlaying&&(this.getNextTick(i),i.handleRepeat()))},toJSON:function(){var i={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(o){i.frames.push(o.toJSON())}),i},updateFrameSequence:function(){for(var i=this.frames.length,o=1/(i-1),f,l=0;l1?(f.isLast=!0,f.prevFrame=this.frames[i-2],f.nextFrame=this.frames[0]):i>1&&(f.prevFrame=this.frames[l-1],f.nextFrame=this.frames[l+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(a.PAUSE_ALL,this.pause,this),this.manager.off(a.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s,h){h===void 0&&(h=!1),this.textureKey=r,this.textureFrame=n,this.index=e,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=h},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});p.exports=c},60848:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(42099),c=t(83419),a=t(90330),r=t(50792),n=t(74943),e=t(8443),s=t(95540),h=t(35154),i=t(36383),o=t(20283),f=t(41836),l=new c({Extends:r,initialize:function(v){r.call(this),this.game=v,this.textureManager=null,this.globalTimeScale=1,this.anims=new a,this.mixes=new a,this.paused=!1,this.name="AnimationManager",v.events.once(e.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(e.DESTROY,this.destroy,this)},addMix:function(u,v,m){var x=this.anims,g=this.mixes,y=typeof u=="string"?u:u.key,T=typeof v=="string"?v:v.key;if(x.has(y)&&x.has(T)){var E=g.get(y);E||(E={}),E[T]=m,g.set(y,E)}return this},removeMix:function(u,v){var m=this.mixes,x=typeof u=="string"?u:u.key,g=m.get(x);if(g)if(v){var y=typeof v=="string"?v:v.key;g.hasOwnProperty(y)&&delete g[y]}else v||m.delete(x);return this},getMix:function(u,v){var m=this.mixes,x=typeof u=="string"?u:u.key,g=typeof v=="string"?v:v.key,y=m.get(x);return y&&y.hasOwnProperty(g)?y[g]:0},add:function(u,v){return this.anims.has(u)?(console.warn("Animation key exists: "+u),this):(v.key=u,this.anims.set(u,v),this.emit(n.ADD_ANIMATION,u,v),this)},exists:function(u){return this.anims.has(u)},createFromAseprite:function(u,v,m){var x=[],g=this.game.cache.json.get(u);if(!g)return console.warn("No Aseprite data found for: "+u),x;var y=this,T=h(g,"meta",null),E=h(g,"frames",null);if(T&&E){var P=h(T,"frameTags",[]);P.forEach(function(R){var M=[],L=s(R,"name",null),O=s(R,"from",0),D=s(R,"to",0),I=s(R,"direction","forward");if(L&&(!v||v&&v.indexOf(L)>-1)){for(var V=0,X=O;X<=D;X++){var H=X.toString(),G=E[H];if(G){var U=s(G,"duration",i.MAX_SAFE_INTEGER);M.push({key:u,frame:H,duration:U}),V+=U}}I==="reverse"&&(M=M.reverse());var F={key:L,frames:M,duration:V,yoyo:I==="pingpong"},B;m?m.anims&&(B=m.anims.create(F)):B=y.create(F),B&&x.push(B)}})}return x},create:function(u){var v=u.key,m=!1;return v&&(m=this.get(v),m?console.warn("AnimationManager key already exists: "+v):(m=new d(this,v,u),this.anims.set(v,m),this.emit(n.ADD_ANIMATION,v,m))),m},fromJSON:function(u,v){v===void 0&&(v=!1),v&&this.anims.clear(),typeof u=="string"&&(u=JSON.parse(u));var m=[];if(u.hasOwnProperty("anims")&&Array.isArray(u.anims)){for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(42099),c=t(30976),a=t(83419),r=t(90330),n=t(74943),e=t(95540),s=new a({initialize:function(i){this.parent=i,this.animationManager=i.scene.sys.anims,this.animationManager.on(n.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(h){var i=this.parent;if(h===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,i;Array.isArray(h)||(h=[h]);for(var o=0;ol&&(m=0),this.randomFrame&&(m=c(0,l-1));var x=f.frames[m];m===0&&!this.forward&&(x=f.getLastFrame()),this.currentFrame=x}return this.parent},pause:function(h){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),h!==void 0&&this.setCurrentFrame(h),this.parent},resume:function(h){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),h!==void 0&&this.setCurrentFrame(h),this.parent},playAfterDelay:function(h,i){if(!this.isPlaying)this.delayCounter=i,this.play(h,!0);else{var o=this.nextAnim,f=this.nextAnimsQueue;o&&f.unshift(o),this.nextAnim=h,this._pendingStop=1,this._pendingStopValue=i}return this.parent},playAfterRepeat:function(h,i){if(i===void 0&&(i=1),!this.isPlaying)this.play(h);else{var o=this.nextAnim,f=this.nextAnimsQueue;o&&f.unshift(o),this.repeatCounter!==-1&&i>this.repeatCounter&&(i=this.repeatCounter),this.nextAnim=h,this._pendingStop=2,this._pendingStopValue=i}return this.parent},play:function(h,i){i===void 0&&(i=!1);var o=this.currentAnim,f=this.parent,l=typeof h=="string"?h:h.key;if(i&&this.isPlaying&&o.key===l)return f;if(o&&this.isPlaying){var u=this.animationManager.getMix(o.key,h);if(u>0)return this.playAfterDelay(h,u)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h)},playReverse:function(h,i){i===void 0&&(i=!1);var o=typeof h=="string"?h:h.key;return i&&this.isPlaying&&this.currentAnim.key===o?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h))},startAnimation:function(h){this.load(h);var i=this.currentAnim,o=this.parent;return i&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,i.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,this.delayCounter===0?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame)),o},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(n.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(n.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(n.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(n.ANIMATION_COMPLETE,n.ANIMATION_COMPLETE_KEY)},emitEvents:function(h,i){var o=this.currentAnim;if(o){var f=this.currentFrame,l=this.parent,u=f.textureFrame;l.emit(h,o,f,l,u),i&&l.emit(i+o.key,o,f,l,u)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var h=this.currentFrame;if(!h)return 0;var i=h.progress;return this.inReverse&&(i*=-1),i},setProgress:function(h){return this.forward||(h=1-h),this.setCurrentFrame(this.currentAnim.getFrameByProgress(h)),this.parent},setRepeat:function(h){return this.repeatCounter=h===-1?Number.MAX_VALUE:h,this.parent},globalRemove:function(h,i){i===void 0&&(i=this.currentAnim),this.isPlaying&&i.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(h,i){h===void 0&&(h=!1),i===void 0&&(i=!1);var o=this.currentAnim,f=this.parent;return o?(i&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),o.getFirstTick(this),this.emitEvents(n.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!h,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(o.frames[0]),this.parent):f},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(h)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(h)}return this.parent},stopAfterDelay:function(h){return this._pendingStop=1,this._pendingStopValue=h,this.parent},stopAfterRepeat:function(h){return h===void 0&&(h=1),this.repeatCounter!==-1&&h>this.repeatCounter&&(h=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=h,this.parent},stopOnFrame:function(h){return this._pendingStop=3,this._pendingStopValue=h,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(h,i){var o=this.currentAnim;if(!(!this.isPlaying||!o||o.paused)){if(this.accumulator+=i*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=i,this._pendingStopValue<=0))return this.stop();if(!this.hasStarted)this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart());else if(this.accumulator>=this.nextTick&&(this.forward?o.nextFrame(this):o.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var f=0;do this.forward?o.nextFrame(this):o.previousFrame(this),f++;while(this.isPlaying&&this.accumulator>this.nextTick&&f<60)}}},setCurrentFrame:function(h){var i=this.parent;return this.currentFrame=h,i.texture=h.frame.texture,i.frame=h.frame,i.isCropped&&i.frame.updateCropUVs(i._crop,i.flipX,i.flipY),h.setAlpha&&(i.alpha=h.alpha),i.setSizeToFrame(),i._originComponent&&(h.frame.customPivot?i.setOrigin(h.frame.pivotX,h.frame.pivotY):i.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(n.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===h&&this.stop()),i},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(h){return this.anims?this.anims.get(h):null},exists:function(h){return this.anims?this.anims.has(h):!1},create:function(h){var i=h.key,o=!1;return i&&(o=this.get(i),o?console.warn("Animation key already exists: "+i):(o=new d(this,i,h),this.anims||(this.anims=new r),this.anims.set(i,o))),o},createFromAseprite:function(h,i){return this.animationManager.createFromAseprite(h,i,this.parent)},generateFrameNames:function(h,i){return this.animationManager.generateFrameNames(h,i)},generateFrameNumbers:function(h,i){return this.animationManager.generateFrameNumbers(h,i)},remove:function(h){var i=this.get(h);return i&&(this.currentAnim===i&&this.stop(),this.anims.delete(h)),i},destroy:function(){this.animationManager.off(n.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});p.exports=s},57090:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="add"},25312:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationcomplete"},89580:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationcomplete-"},52860:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationrepeat"},63850:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationrestart"},99085:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationstart"},28087:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationstop"},1794:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="animationupdate"},52562:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pauseall"},57953:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="remove"},68339:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resumeall"},74943:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADD_ANIMATION:t(57090),ANIMATION_COMPLETE:t(25312),ANIMATION_COMPLETE_KEY:t(89580),ANIMATION_REPEAT:t(52860),ANIMATION_RESTART:t(63850),ANIMATION_START:t(99085),ANIMATION_STOP:t(28087),ANIMATION_UPDATE:t(1794),PAUSE_ALL:t(52562),REMOVE_ANIMATION:t(57953),RESUME_ALL:t(68339)}},60421:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Animation:t(42099),AnimationFrame:t(41138),AnimationManager:t(60848),AnimationState:t(9674),Events:t(74943)}},2161:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(90330),a=t(50792),r=t(24736),n=new d({initialize:function(){this.entries=new c,this.events=new a},add:function(e,s){return this.entries.set(e,s),this.events.emit(r.ADD,this,e,s),this},has:function(e){return this.entries.has(e)},exists:function(e){return this.entries.has(e)},get:function(e){return this.entries.get(e)},remove:function(e){var s=this.get(e);return s&&(this.entries.delete(e),this.events.emit(r.REMOVE,this,e,s.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});p.exports=n},24047:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2161),c=t(83419),a=t(8443),r=new c({initialize:function(e){this.game=e,this.binary=new d,this.bitmapFont=new d,this.json=new d,this.physics=new d,this.shader=new d,this.audio=new d,this.video=new d,this.text=new d,this.html=new d,this.obj=new d,this.tilemap=new d,this.xml=new d,this.custom={},this.game.events.once(a.DESTROY,this.destroy,this)},addCustom:function(n){return this.custom.hasOwnProperty(n)||(this.custom[n]=new d),this.custom[n]},destroy:function(){for(var n=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="add"},59261:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="remove"},24736:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADD:t(51464),REMOVE:t(59261)}},83388:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BaseCache:t(2161),CacheManager:t(24047),Events:t(24736)}},71911:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(39506),r=t(50792),n=t(19715),e=t(87841),s=t(61340),h=t(80333),i=t(26099),o=new d({Extends:r,Mixins:[c.AlphaSingle,c.Visible],initialize:function(l,u,v,m){l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=0),m===void 0&&(m=0),r.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new e,this.dirty=!0,this._x=l,this._y=u,this._width=v,this._height=m,this._bounds=new e,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new s,this.transparent=!0,this.backgroundColor=h("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new i(v/2,m/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(f){this.renderList.push(f)},setOrigin:function(f,l){return f===void 0&&(f=.5),l===void 0&&(l=f),this.originX=f,this.originY=l,this},getScroll:function(f,l,u){u===void 0&&(u=new i);var v=this.width*.5,m=this.height*.5;return u.x=f-v,u.y=l-m,this.useBounds&&(u.x=this.clampX(u.x),u.y=this.clampY(u.y)),u},centerOnX:function(f){var l=this.width*.5;return this.midPoint.x=f,this.scrollX=f-l,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(f){var l=this.height*.5;return this.midPoint.y=f,this.scrollY=f-l,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(f,l){return this.centerOnX(f),this.centerOnY(l),this},centerToBounds:function(){if(this.useBounds){var f=this._bounds,l=this.width*.5,u=this.height*.5;this.midPoint.set(f.centerX,f.centerY),this.scrollX=f.centerX-l,this.scrollY=f.centerY-u}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(f){if(this.disableCull)return f;var l=this.matrix.matrix,u=l[0],v=l[1],m=l[2],x=l[3],g=u*x-v*m;if(!g)return f;var y=l[4],T=l[5],E=this.scrollX,P=this.scrollY,R=this.width,M=this.height,L=this.y,O=L+M,D=this.x,I=D+R,V=this.culledObjects,X=f.length;g=1/g,V.length=0;for(var H=0;HD&&zL&&Ym&&(f=m),f},clampY:function(f){var l=this._bounds,u=this.displayHeight,v=l.y+(u-this.height)/2,m=Math.max(v,v+l.height-u);return fm&&(f=m),f},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(f){return f===void 0&&(f=0),this.rotation=a(f),this},setBackgroundColor:function(f){return f===void 0&&(f="rgba(0,0,0,0)"),this.backgroundColor=h(f),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(f,l,u,v,m){return m===void 0&&(m=!1),this._bounds.setTo(f,l,u,v),this.dirty=!0,this.useBounds=!0,m?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(f){f===void 0&&(f=new e);var l=this._bounds;return f.setTo(l.x,l.y,l.width,l.height),f},setName:function(f){return f===void 0&&(f=""),this.name=f,this},setPosition:function(f,l){return l===void 0&&(l=f),this.x=f,this.y=l,this},setRotation:function(f){return f===void 0&&(f=0),this.rotation=f,this},setRoundPixels:function(f){return this.roundPixels=f,this},setScene:function(f,l){l===void 0&&(l=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=f,this.isSceneCamera=l;var u=f.sys;return this.sceneManager=u.game.scene,this.scaleManager=u.scale,this.cameraManager=u.cameras,this.updateSystem(),this},setScroll:function(f,l){return l===void 0&&(l=f),this.scrollX=f,this.scrollY=l,this},setSize:function(f,l){return l===void 0&&(l=f),this.width=f,this.height=l,this},setViewport:function(f,l,u,v){return this.x=f,this.y=l,this.width=u,this.height=v,this},setZoom:function(f,l){return f===void 0&&(f=1),l===void 0&&(l=f),f===0&&(f=.001),l===0&&(l=.001),this.zoomX=f,this.zoomY=l,this},setMask:function(f,l){return l===void 0&&(l=!0),this.mask=f,this._maskCamera=l?this.cameraManager.default:this,this},clearMask:function(f){return f===void 0&&(f=!1),f&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var f={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(f.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),f},update:function(){},setIsSceneCamera:function(f){return this.isSceneCamera=f,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var f=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,l=this.sceneManager;f&&!this._customViewport?l.customViewports++:!f&&this._customViewport&&l.customViewports--,this.dirty=!0,this._customViewport=f}},destroy:function(){this.emit(n.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(f){this._x=f,this.updateSystem()}},y:{get:function(){return this._y},set:function(f){this._y=f,this.updateSystem()}},width:{get:function(){return this._width},set:function(f){this._width=f,this.updateSystem()}},height:{get:function(){return this._height},set:function(f){this._height=f,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(f){f!==this._scrollX&&(this._scrollX=f,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(f){f!==this._scrollY&&(this._scrollY=f,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(f){this._zoomX=f,this._zoomY=f,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(f){this._zoomX=f,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(f){this._zoomY=f,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(f){this._rotation=f,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});p.exports=o},38058:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(71911),c=t(67502),a=t(45319),r=t(83419),n=t(31401),e=t(20052),s=t(19715),h=t(28915),i=t(87841),o=t(26099),f=new r({Extends:d,Mixins:[n.PostPipeline],initialize:function(u,v,m,x){d.call(this,u,v,m,x),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new e.Fade(this),this.flashEffect=new e.Flash(this),this.shakeEffect=new e.Shake(this),this.panEffect=new e.Pan(this),this.rotateToEffect=new e.RotateTo(this),this.zoomEffect=new e.Zoom(this),this.lerp=new o(1,1),this.followOffset=new o,this.deadzone=null,this._follow=null},setDeadzone:function(l,u){if(l===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=l,this.deadzone.height=u):this.deadzone=new i(0,0,l,u),this._follow){var v=this.width/2,m=this.height/2,x=this._follow.x-this.followOffset.x,g=this._follow.y-this.followOffset.y;this.midPoint.set(x,g),this.scrollX=x-v,this.scrollY=g-m}c(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(l,u,v,m,x,g){return this.fadeEffect.start(!1,l,u,v,m,!0,x,g)},fadeOut:function(l,u,v,m,x,g){return this.fadeEffect.start(!0,l,u,v,m,!0,x,g)},fadeFrom:function(l,u,v,m,x,g,y){return this.fadeEffect.start(!1,l,u,v,m,x,g,y)},fade:function(l,u,v,m,x,g,y){return this.fadeEffect.start(!0,l,u,v,m,x,g,y)},flash:function(l,u,v,m,x,g,y){return this.flashEffect.start(l,u,v,m,x,g,y)},shake:function(l,u,v,m,x){return this.shakeEffect.start(l,u,v,m,x)},pan:function(l,u,v,m,x,g,y){return this.panEffect.start(l,u,v,m,x,g,y)},rotateTo:function(l,u,v,m,x,g,y){return this.rotateToEffect.start(l,u,v,m,x,g,y)},zoomTo:function(l,u,v,m,x,g){return this.zoomEffect.start(l,u,v,m,x,g)},preRender:function(){this.renderList.length=0;var l=this.width,u=this.height,v=l*.5,m=u*.5,x=this.zoom,g=this.matrix,y=l*this.originX,T=u*this.originY,E=this._follow,P=this.deadzone,R=this.scrollX,M=this.scrollY;P&&c(P,this.midPoint.x,this.midPoint.y);var L=!1;if(E&&!this.panEffect.isRunning){var O=this.lerp,D=E.x-this.followOffset.x,I=E.y-this.followOffset.y;P?(DP.right&&(R=h(R,R+(D-P.right),O.x)),IP.bottom&&(M=h(M,M+(I-P.bottom),O.y))):(R=h(R,D-y,O.x),M=h(M,I-T,O.y)),L=!0}this.useBounds&&(R=this.clampX(R),M=this.clampY(M)),this.scrollX=R,this.scrollY=M;var V=R+v,X=M+m;this.midPoint.set(V,X);var H=l/x,G=u/x,U=Math.floor(V-H/2),F=Math.floor(X-G/2);this.worldView.setTo(U,F,H,G),g.applyITRS(Math.floor(this.x+y),Math.floor(this.y+T),this.rotation,x,x),g.translate(-y,-T),this.shakeEffect.preRender(),L&&this.emit(s.FOLLOW_UPDATE,this,E)},setLerp:function(l,u){return l===void 0&&(l=1),u===void 0&&(u=l),this.lerp.set(l,u),this},setFollowOffset:function(l,u){return l===void 0&&(l=0),u===void 0&&(u=0),this.followOffset.set(l,u),this},startFollow:function(l,u,v,m,x,g){u===void 0&&(u=!1),v===void 0&&(v=1),m===void 0&&(m=v),x===void 0&&(x=0),g===void 0&&(g=x),this._follow=l,this.roundPixels=u,v=a(v,0,1),m=a(m,0,1),this.lerp.set(v,m),this.followOffset.set(x,g);var y=this.width/2,T=this.height/2,E=l.x-x,P=l.y-g;return this.midPoint.set(E,P),this.scrollX=E-y,this.scrollY=P-T,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(l,u){this.visible&&(this.rotateToEffect.update(l,u),this.panEffect.update(l,u),this.zoomEffect.update(l,u),this.shakeEffect.update(l,u),this.flashEffect.update(l,u),this.fadeEffect.update(l,u))},destroy:function(){this.resetFX(),d.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});p.exports=f},32743:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(38058),c=t(83419),a=t(95540),r=t(37277),n=t(37303),e=t(97480),s=t(44594),h=new c({initialize:function(o){this.scene=o,this.systems=o.sys,this.roundPixels=o.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,o.sys.events.once(s.BOOT,this.boot,this),o.sys.events.on(s.START,this.start,this)},boot:function(){var i=this.systems;i.settings.cameras?this.fromJSON(i.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new d(0,0,i.scale.width,i.scale.height).setScene(this.scene),i.game.scale.on(e.RESIZE,this.onResize,this),this.systems.events.once(s.DESTROY,this.destroy,this)},start:function(){if(!this.main){var i=this.systems;i.settings.cameras?this.fromJSON(i.settings.cameras):this.add(),this.main=this.cameras[0]}var o=this.systems.events;o.on(s.UPDATE,this.update,this),o.once(s.SHUTDOWN,this.shutdown,this)},add:function(i,o,f,l,u,v){i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=this.scene.sys.scale.width),l===void 0&&(l=this.scene.sys.scale.height),u===void 0&&(u=!1),v===void 0&&(v="");var m=new d(i,o,f,l);return m.setName(v),m.setScene(this.scene),m.setRoundPixels(this.roundPixels),m.id=this.getNextID(),this.cameras.push(m),u&&(this.main=m),m},addExisting:function(i,o){o===void 0&&(o=!1);var f=this.cameras.indexOf(i);return f===-1?(i.id=this.getNextID(),i.setRoundPixels(this.roundPixels),this.cameras.push(i),o&&(this.main=i),i):null},getNextID:function(){for(var i=this.cameras,o=1,f=0;f<32;f++){for(var l=!1,u=0;u0){v.preRender();var m=this.getVisibleChildren(o.getChildren(),v);i.render(f,m,v)}}},getVisibleChildren:function(i,o){return i.filter(function(f){return f.willRender(o)})},resetAll:function(){for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(19715),r=new c({initialize:function(e){this.camera=e,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(n,e,s,h,i,o,f,l){if(n===void 0&&(n=!0),e===void 0&&(e=1e3),s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=!1),f===void 0&&(f=null),l===void 0&&(l=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=n,this.progress=0,this.red=s,this.green=h,this.blue=i,this.alpha=n?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=f,this._onUpdateScope=l;var u=n?a.FADE_OUT_START:a.FADE_IN_START;return this.camera.emit(u,this.camera,this,e,s,h,i),this.camera},update:function(n,e){this.isRunning&&(this._elapsed+=e,this.progress=d(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(19715),r=new c({initialize:function(e){this.camera=e,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(n,e,s,h,i,o,f){return n===void 0&&(n=250),e===void 0&&(e=255),s===void 0&&(s=255),h===void 0&&(h=255),i===void 0&&(i=!1),o===void 0&&(o=null),f===void 0&&(f=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=n,this.progress=0,this.red=e,this.green=s,this.blue=h,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=f,this.camera.emit(a.FLASH_START,this.camera,this,n,e,s,h),this.camera)},update:function(n,e){this.isRunning&&(this._elapsed+=e,this.progress=d(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(62640),r=t(19715),n=t(26099),e=new c({initialize:function(h){this.camera=h,this.isRunning=!1,this.duration=0,this.source=new n,this.current=new n,this.destination=new n,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(s,h,i,o,f,l,u){i===void 0&&(i=1e3),o===void 0&&(o=a.Linear),f===void 0&&(f=!1),l===void 0&&(l=null),u===void 0&&(u=this.camera.scene);var v=this.camera;return!f&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(v.scrollX,v.scrollY),this.destination.set(s,h),v.getScroll(s,h,this.current),typeof o=="string"&&a.hasOwnProperty(o)?this.ease=a[o]:typeof o=="function"&&(this.ease=o),this._elapsed=0,this._onUpdate=l,this._onUpdateScope=u,this.camera.emit(r.PAN_START,this.camera,this,i,s,h)),v},update:function(s,h){if(this.isRunning){this._elapsed+=h;var i=d(this._elapsed/this.duration,0,1);this.progress=i;var o=this.camera;if(this._elapsed{/** + * @author Jason Nicholls + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */var d=t(45319),c=t(83419),a=t(19715),r=t(62640),n=new c({initialize:function(s){this.camera=s,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(e,s,h,i,o,f,l){h===void 0&&(h=1e3),i===void 0&&(i=r.Linear),o===void 0&&(o=!1),f===void 0&&(f=null),l===void 0&&(l=this.camera.scene),s===void 0&&(s=!1),this.shortestPath=s;var u=e;e<0?(u=-1*e,this.clockwise=!1):this.clockwise=!0;var v=360*Math.PI/180;u=u-Math.floor(u/v)*v;var m=this.camera;if(!o&&this.isRunning)return m;if(this.isRunning=!0,this.duration=h,this.progress=0,this.source=m.rotation,this.destination=u,typeof i=="string"&&r.hasOwnProperty(i)?this.ease=r[i]:typeof i=="function"&&(this.ease=i),this._elapsed=0,this._onUpdate=f,this._onUpdateScope=l,this.shortestPath){var x=0,g=0;this.destination>this.source?x=Math.abs(this.destination-this.source):x=Math.abs(this.destination+v)-this.source,this.source>this.destination?g=Math.abs(this.source-this.destination):g=Math.abs(this.source+v)-this.destination,xg&&(this.clockwise=!1)}return this.camera.emit(a.ROTATE_START,this.camera,this,h,u),m},update:function(e,s){if(this.isRunning){this._elapsed+=s;var h=d(this._elapsed/this.duration,0,1);this.progress=h;var i=this.camera;if(this._elapsed=v?f=Math.abs(u-v):f=Math.abs(u+l)-v;var m=0;this.clockwise?m=i.rotation+f*o:m=i.rotation-f*o,i.rotation=m,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,i,h,m)}else i.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,i,h,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});p.exports=n},30330:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(19715),r=t(26099),n=new c({initialize:function(s){this.camera=s,this.isRunning=!1,this.duration=0,this.intensity=new r,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(e,s,h,i,o){return e===void 0&&(e=100),s===void 0&&(s=.05),h===void 0&&(h=!1),i===void 0&&(i=null),o===void 0&&(o=this.camera.scene),!h&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=e,this.progress=0,typeof s=="number"?this.intensity.set(s):this.intensity.set(s.x,s.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=i,this._onUpdateScope=o,this.camera.emit(a.SHAKE_START,this.camera,this,e,s),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(e,s){if(this.isRunning)if(this._elapsed+=s,this.progress=d(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(62640),r=t(19715),n=new c({initialize:function(s){this.camera=s,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(e,s,h,i,o,f){s===void 0&&(s=1e3),h===void 0&&(h=a.Linear),i===void 0&&(i=!1),o===void 0&&(o=null),f===void 0&&(f=this.camera.scene);var l=this.camera;return!i&&this.isRunning||(this.isRunning=!0,this.duration=s,this.progress=0,this.source=l.zoom,this.destination=e,typeof h=="string"&&a.hasOwnProperty(h)?this.ease=a[h]:typeof h=="function"&&(this.ease=h),this._elapsed=0,this._onUpdate=o,this._onUpdateScope=f,this.camera.emit(r.ZOOM_START,this.camera,this,s,e)),l},update:function(e,s){this.isRunning&&(this._elapsed+=s,this.progress=d(this._elapsed/this.duration,0,1),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Fade:t(5020),Flash:t(10662),Pan:t(20359),Shake:t(30330),RotateTo:t(34208),Zoom:t(45641)}},16438:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="cameradestroy"},32726:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerafadeincomplete"},87807:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerafadeinstart"},45917:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerafadeoutcomplete"},95666:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerafadeoutstart"},47056:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="cameraflashcomplete"},91261:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="cameraflashstart"},45047:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="followupdate"},81927:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerapancomplete"},74264:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerapanstart"},54419:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="postrender"},79330:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="prerender"},93183:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerarotatecomplete"},80112:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerarotatestart"},62252:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerashakecomplete"},86017:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerashakestart"},539:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerazoomcomplete"},51892:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="camerazoomstart"},19715:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={DESTROY:t(16438),FADE_IN_COMPLETE:t(32726),FADE_IN_START:t(87807),FADE_OUT_COMPLETE:t(45917),FADE_OUT_START:t(95666),FLASH_COMPLETE:t(47056),FLASH_START:t(91261),FOLLOW_UPDATE:t(45047),PAN_COMPLETE:t(81927),PAN_START:t(74264),POST_RENDER:t(54419),PRE_RENDER:t(79330),ROTATE_COMPLETE:t(93183),ROTATE_START:t(80112),SHAKE_COMPLETE:t(62252),SHAKE_START:t(86017),ZOOM_COMPLETE:t(539),ZOOM_START:t(51892)}},87969:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Camera:t(38058),BaseCamera:t(71911),CameraManager:t(32743),Effects:t(20052),Events:t(19715)}},63091:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(35154),a=new d({initialize:function(n){this.camera=c(n,"camera",null),this.left=c(n,"left",null),this.right=c(n,"right",null),this.up=c(n,"up",null),this.down=c(n,"down",null),this.zoomIn=c(n,"zoomIn",null),this.zoomOut=c(n,"zoomOut",null),this.zoomSpeed=c(n,"zoomSpeed",.01),this.minZoom=c(n,"minZoom",.001),this.maxZoom=c(n,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=c(n,"speed",null);typeof e=="number"?(this.speedX=e,this.speedY=e):(this.speedX=c(n,"speed.x",0),this.speedY=c(n,"speed.y",0)),this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(r){return this.camera=r,this},update:function(r){if(this.active){r===void 0&&(r=1);var n=this.camera;this.up&&this.up.isDown?n.scrollY-=this.speedY*r|0:this.down&&this.down.isDown&&(n.scrollY+=this.speedY*r|0),this.left&&this.left.isDown?n.scrollX-=this.speedX*r|0:this.right&&this.right.isDown&&(n.scrollX+=this.speedX*r|0),this.zoomIn&&this.zoomIn.isDown?(n.zoom-=this.zoomSpeed,n.zoomthis.maxZoom&&(n.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});p.exports=a},58818:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(35154),a=new d({initialize:function(n){this.camera=c(n,"camera",null),this.left=c(n,"left",null),this.right=c(n,"right",null),this.up=c(n,"up",null),this.down=c(n,"down",null),this.zoomIn=c(n,"zoomIn",null),this.zoomOut=c(n,"zoomOut",null),this.zoomSpeed=c(n,"zoomSpeed",.01),this.minZoom=c(n,"minZoom",.001),this.maxZoom=c(n,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=c(n,"acceleration",null);typeof e=="number"?(this.accelX=e,this.accelY=e):(this.accelX=c(n,"acceleration.x",0),this.accelY=c(n,"acceleration.y",0)),this.dragX=0,this.dragY=0;var s=c(n,"drag",null);typeof s=="number"?(this.dragX=s,this.dragY=s):(this.dragX=c(n,"drag.x",0),this.dragY=c(n,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var h=c(n,"maxSpeed",null);typeof h=="number"?(this.maxSpeedX=h,this.maxSpeedY=h):(this.maxSpeedX=c(n,"maxSpeed.x",0),this.maxSpeedY=c(n,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(r){return this.camera=r,this},update:function(r){if(this.active){r===void 0&&(r=1);var n=this.camera;this._speedX>0?(this._speedX-=this.dragX*r,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*r,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*r,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*r,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,this._speedX!==0&&(n.scrollX-=this._speedX*r|0),this._speedY!==0&&(n.scrollY-=this._speedY*r|0),this._zoom!==0&&(n.zoom+=this._zoom,n.zoomthis.maxZoom&&(n.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});p.exports=a},38865:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={FixedKeyControl:t(63091),SmoothedKeyControl:t(58818)}},26638:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Controls:t(38865),Scene2D:t(87969)}},8054:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={VERSION:"3.80.0",BlendModes:t(10312),ScaleModes:t(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};p.exports=d},69547:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(8054),a=t(42363),r=t(82264),n=t(95540),e=t(35154),s=t(41212),h=t(29747),i=t(75508),o=t(36060),f=t(80333),l=new d({initialize:function(v){v===void 0&&(v={});var m=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],x="#ffffff",g=e(v,"scale",null);this.width=e(g,"width",1024,v),this.height=e(g,"height",768,v),this.zoom=e(g,"zoom",1,v),this.parent=e(g,"parent",void 0,v),this.scaleMode=e(g,g?"mode":"scaleMode",0,v),this.expandParent=e(g,"expandParent",!0,v),this.autoRound=e(g,"autoRound",!1,v),this.autoCenter=e(g,"autoCenter",0,v),this.resizeInterval=e(g,"resizeInterval",500,v),this.fullscreenTarget=e(g,"fullscreenTarget",null,v),this.minWidth=e(g,"min.width",0,v),this.maxWidth=e(g,"max.width",0,v),this.minHeight=e(g,"min.height",0,v),this.maxHeight=e(g,"max.height",0,v),this.snapWidth=e(g,"snap.width",0,v),this.snapHeight=e(g,"snap.height",0,v),this.renderType=e(v,"type",c.AUTO),this.canvas=e(v,"canvas",null),this.context=e(v,"context",null),this.canvasStyle=e(v,"canvasStyle",null),this.customEnvironment=e(v,"customEnvironment",!1),this.sceneConfig=e(v,"scene",null),this.seed=e(v,"seed",[(Date.now()*Math.random()).toString()]),i.RND=new i.RandomDataGenerator(this.seed),this.gameTitle=e(v,"title",""),this.gameURL=e(v,"url","https://phaser.io"),this.gameVersion=e(v,"version",""),this.autoFocus=e(v,"autoFocus",!0),this.stableSort=e(v,"stableSort",-1),this.stableSort===-1&&(this.stableSort=r.browser.es2019?1:0),r.features.stableSort=this.stableSort,this.domCreateContainer=e(v,"dom.createContainer",!1),this.domPointerEvents=e(v,"dom.pointerEvents","none"),this.inputKeyboard=e(v,"input.keyboard",!0),this.inputKeyboardEventTarget=e(v,"input.keyboard.target",window),this.inputKeyboardCapture=e(v,"input.keyboard.capture",[]),this.inputMouse=e(v,"input.mouse",!0),this.inputMouseEventTarget=e(v,"input.mouse.target",null),this.inputMousePreventDefaultDown=e(v,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=e(v,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=e(v,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=e(v,"input.mouse.preventDefaultWheel",!0),this.inputTouch=e(v,"input.touch",r.input.touch),this.inputTouchEventTarget=e(v,"input.touch.target",null),this.inputTouchCapture=e(v,"input.touch.capture",!0),this.inputActivePointers=e(v,"input.activePointers",1),this.inputSmoothFactor=e(v,"input.smoothFactor",0),this.inputWindowEvents=e(v,"input.windowEvents",!0),this.inputGamepad=e(v,"input.gamepad",!1),this.inputGamepadEventTarget=e(v,"input.gamepad.target",window),this.disableContextMenu=e(v,"disableContextMenu",!1),this.audio=e(v,"audio",{}),this.hideBanner=e(v,"banner",null)===!1,this.hidePhaser=e(v,"banner.hidePhaser",!1),this.bannerTextColor=e(v,"banner.text",x),this.bannerBackgroundColor=e(v,"banner.background",m),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=e(v,"fps",null),this.disablePreFX=e(v,"disablePreFX",!1),this.disablePostFX=e(v,"disablePostFX",!1);var y=e(v,"render",null);this.pipeline=e(y,"pipeline",null,v),this.autoMobilePipeline=e(y,"autoMobilePipeline",!0,v),this.defaultPipeline=e(y,"defaultPipeline",o.MULTI_PIPELINE,v),this.antialias=e(y,"antialias",!0,v),this.antialiasGL=e(y,"antialiasGL",!0,v),this.mipmapFilter=e(y,"mipmapFilter","",v),this.desynchronized=e(y,"desynchronized",!1,v),this.roundPixels=e(y,"roundPixels",!0,v),this.pixelArt=e(y,"pixelArt",this.zoom!==1,v),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=e(y,"transparent",!1,v),this.clearBeforeRender=e(y,"clearBeforeRender",!0,v),this.preserveDrawingBuffer=e(y,"preserveDrawingBuffer",!1,v),this.premultipliedAlpha=e(y,"premultipliedAlpha",!0,v),this.failIfMajorPerformanceCaveat=e(y,"failIfMajorPerformanceCaveat",!1,v),this.powerPreference=e(y,"powerPreference","default",v),this.batchSize=e(y,"batchSize",4096,v),this.maxTextures=e(y,"maxTextures",-1,v),this.maxLights=e(y,"maxLights",10,v);var T=e(v,"backgroundColor",0);this.backgroundColor=f(T),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=e(v,"callbacks.preBoot",h),this.postBoot=e(v,"callbacks.postBoot",h),this.physics=e(v,"physics",{}),this.defaultPhysicsSystem=e(this.physics,"default",!1),this.loaderBaseURL=e(v,"loader.baseURL",""),this.loaderPath=e(v,"loader.path",""),this.loaderMaxParallelDownloads=e(v,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=e(v,"loader.crossOrigin",void 0),this.loaderResponseType=e(v,"loader.responseType",""),this.loaderAsync=e(v,"loader.async",!0),this.loaderUser=e(v,"loader.user",""),this.loaderPassword=e(v,"loader.password",""),this.loaderTimeout=e(v,"loader.timeout",0),this.loaderWithCredentials=e(v,"loader.withCredentials",!1),this.loaderImageLoadType=e(v,"loader.imageLoadType","XHR"),this.loaderLocalScheme=e(v,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=e(v,"fx.glow.quality",.1),this.glowFXDistance=e(v,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var E=e(v,"plugins",null),P=a.DefaultScene;E&&(Array.isArray(E)?this.defaultPlugins=E:s(E)&&(this.installGlobalPlugins=n(E,"global",[]),this.installScenePlugins=n(E,"scene",[]),Array.isArray(E.default)?P=E.default:Array.isArray(E.defaultMerge)&&(P=P.concat(E.defaultMerge)))),this.defaultPlugins=P;var R="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=e(v,"images.default",R+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=e(v,"images.missing",R+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=e(v,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=c.WEBGL:window.FORCE_CANVAS&&(this.renderType=c.CANVAS))}});p.exports=l},86054:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20623),c=t(27919),a=t(8054),r=t(89357),n=function(e){var s=e.config;if((s.customEnvironment||s.canvas)&&s.renderType===a.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!s.customEnvironment&&!s.canvas&&s.renderType!==a.HEADLESS)if(s.renderType===a.AUTO&&(s.renderType=r.webGL?a.WEBGL:a.CANVAS),s.renderType===a.WEBGL){if(!r.webGL)throw new Error("Cannot create WebGL context, aborting.")}else if(s.renderType===a.CANVAS){if(!r.canvas)throw new Error("Cannot create Canvas context, aborting.")}else throw new Error("Unknown value for renderer type: "+s.renderType);s.antialias||c.disableSmoothing();var h=e.scale.baseSize,i=h.width,o=h.height;if(s.canvas?(e.canvas=s.canvas,e.canvas.width=i,e.canvas.height=o):e.canvas=c.create(e,i,o,s.renderType),s.canvasStyle&&(e.canvas.style=s.canvasStyle),s.antialias||d.setCrisp(e.canvas),s.renderType!==a.HEADLESS){var f,l;f=t(68627),l=t(74797),s.renderType===a.WEBGL?e.renderer=new l(e):(e.renderer=new f(e),e.context=e.renderer.gameContext)}};p.exports=n},96391:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8054),c=function(a){var r=a.config;if(!r.hideBanner){var n="WebGL";r.renderType===d.CANVAS?n="Canvas":r.renderType===d.HEADLESS&&(n="Headless");var e=r.audio,s=a.device.audio,h;if(s.webAudio&&!e.disableWebAudio?h="Web Audio":e.noAudio||!s.webAudio&&!s.audioData?h="No Audio":h="HTML5 Audio",a.device.browser.ie)window.console&&console.log("Phaser v"+d.VERSION+" / https://phaser.io");else{var i="",o=[i];if(Array.isArray(r.bannerBackgroundColor)){var f;r.bannerBackgroundColor.forEach(function(u){i=i.concat("%c "),o.push("background: "+u),f=u}),o[o.length-1]="color: "+r.bannerTextColor+"; background: "+f}else i=i.concat("%c "),o.push("color: "+r.bannerTextColor+"; background: "+r.bannerBackgroundColor);o.push("background: transparent"),r.gameTitle&&(i=i.concat(r.gameTitle),r.gameVersion&&(i=i.concat(" v"+r.gameVersion)),r.hidePhaser||(i=i.concat(" / ")));var l="";r.hidePhaser||(i=i.concat("Phaser v"+d.VERSION+l+" ("+n+" | "+h+")")),i=i.concat(" %c "+r.gameURL),o[0]=i,console.log.apply(console,o)}}};p.exports=c},50127:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40366),c=t(60848),a=t(24047),r=t(27919),n=t(83419),e=t(69547),s=t(83719),h=t(86054),i=t(45893),o=t(96391),f=t(82264),l=t(57264),u=t(50792),v=t(8443),m=t(7003),x=t(37277),g=t(77332),y=t(76531),T=t(60903),E=t(69442),P=t(17130),R=t(65898),M=t(51085),L=t(14747),O=new n({initialize:function(I){this.config=new e(I),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new u,this.anims=new c(this),this.textures=new P(this),this.cache=new a(this),this.registry=new i(this,new u),this.input=new m(this,this.config),this.scene=new T(this,this.config.sceneConfig),this.device=f,this.scale=new y(this,this.config),this.sound=null,this.sound=L.create(this),this.loop=new R(this,this.config.fps),this.plugins=new g(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,l(this.boot.bind(this))},boot:function(){if(!x.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),h(this),s(this),o(this),d(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(v.BOOT)},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),M(this);var D=this.events;D.on(v.HIDDEN,this.onHidden,this),D.on(v.VISIBLE,this.onVisible,this),D.on(v.BLUR,this.onBlur,this),D.on(v.FOCUS,this.onFocus,this)},step:function(D,I){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var V=this.events;V.emit(v.PRE_STEP,D,I),V.emit(v.STEP,D,I),this.scene.update(D,I),V.emit(v.POST_STEP,D,I);var X=this.renderer;X.preRender(),V.emit(v.PRE_RENDER,X,D,I),this.scene.render(X),X.postRender(),V.emit(v.POST_RENDER,X,D,I)}},headlessStep:function(D,I){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var V=this.events;V.emit(v.PRE_STEP,D,I),V.emit(v.STEP,D,I),this.scene.update(D,I),V.emit(v.POST_STEP,D,I),this.scene.isProcessing=!1,V.emit(v.PRE_RENDER,null,D,I),V.emit(v.POST_RENDER,null,D,I)}},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},pause:function(){var D=this.isPaused;this.isPaused=!0,D||this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},resume:function(){var D=this.isPaused;this.isPaused=!1,D&&this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(D,I){I===void 0&&(I=!1),this.pendingDestroy=!0,this.removeCanvas=D,this.noReturn=I},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(r.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});p.exports=O},65898:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(35154),a=t(29747),r=t(43092),n=new d({initialize:function(s,h){this.game=s,this.raf=new r,this.started=!1,this.running=!1,this.minFps=c(h,"min",5),this.targetFps=c(h,"target",60),this.fpsLimit=c(h,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=a,this.forceSetTimeOut=c(h,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=c(h,"deltaHistory",10),this.panicMax=c(h,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=c(h,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var e=window.performance.now();this.time=e,this.lastTime=e,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0;for(var s=0;s0||!this.inFocus)&&(this._coolDown--,e=Math.min(e,this._target)),e>this._min&&(e=h[s],e=Math.min(e,this._min)),h[s]=e,this.deltaIndex++,this.deltaIndex>=i&&(this.deltaIndex=0);for(var o=0,f=0;f=this.nextFpsUpdate&&this.updateFPS(e),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(e,this.delta),this.delta=0),this.lastTime=e,this.frame++},step:function(e){this.now=e;var s=Math.max(0,e-this.lastTime);this.rawDelta=s,this.time+=this.rawDelta,this.smoothStep&&(s=this.smoothDelta(s)),this.delta=s,e>=this.nextFpsUpdate&&this.updateFPS(e),this.framesThisSecond++,this.callback(e,s),this.lastTime=e,this.frame++},tick:function(){var e=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(e):this.step(e)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(e){e===void 0&&(e=!1);var s=window.performance.now();if(!this.running){e&&(this.startTime+=-this.lastTime+(this.lastTime+s));var h=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(h,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=s+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});p.exports=n},51085:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8443),c=function(a){var r,n=a.events;if(document.hidden!==void 0)r="visibilitychange";else{var e=["webkit","moz","ms"];e.forEach(function(h){document[h+"Hidden"]!==void 0&&(document.hidden=function(){return document[h+"Hidden"]},r=h+"visibilitychange")})}var s=function(h){document.hidden||h.type==="pause"?n.emit(d.HIDDEN):n.emit(d.VISIBLE)};r&&document.addEventListener(r,s,!1),window.onblur=function(){n.emit(d.BLUR)},window.onfocus=function(){n.emit(d.FOCUS)},window.focus&&a.config.autoFocus&&window.focus()};p.exports=c},97217:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="blur"},47548:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="boot"},19814:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="contextlost"},68446:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},41700:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="focus"},25432:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="hidden"},65942:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},59211:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="postrender"},47789:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="poststep"},39066:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="prerender"},460:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="prestep"},16175:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="ready"},42331:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},11966:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="step"},32969:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="systemready"},94830:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="visible"},8443:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BLUR:t(97217),BOOT:t(47548),CONTEXT_LOST:t(19814),DESTROY:t(68446),FOCUS:t(41700),HIDDEN:t(25432),PAUSE:t(65942),POST_RENDER:t(59211),POST_STEP:t(47789),PRE_RENDER:t(39066),PRE_STEP:t(460),READY:t(16175),RESUME:t(42331),STEP:t(11966),SYSTEM_READY:t(32969),VISIBLE:t(94830)}},42857:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Config:t(69547),CreateRenderer:t(86054),DebugHeader:t(96391),Events:t(8443),TimeStep:t(65898),VisibilityHandler:t(51085)}},99584:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(5290),c=t(27919),a=t(35154),r=function(n){var e=a(n,"data",[]),s=a(n,"canvas",null),h=a(n,"palette",d),i=a(n,"pixelWidth",1),o=a(n,"pixelHeight",i),f=a(n,"resizeCanvas",!0),l=a(n,"clearCanvas",!0),u=a(n,"preRender",null),v=a(n,"postRender",null),m=Math.floor(Math.abs(e[0].length*i)),x=Math.floor(Math.abs(e.length*o));s||(s=c.create2D(this,m,x),f=!1,l=!1),f&&(s.width=m,s.height=x);var g=s.getContext("2d",{willReadFrequently:!0});l&&g.clearRect(0,0,m,x),u&&u(s,g);for(var y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={GenerateTexture:t(99584),Palettes:t(57763)}},5290:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},23816:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},9866:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},77552:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},92259:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},57763:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ARNE16:t(5290),C64:t(23816),CGA:t(9866),JMP:t(77552),MSX:t(92259)}},46728:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(36316),a=t(80021),r=t(26099),n=new d({Extends:a,initialize:function(s,h,i,o){a.call(this,"CubicBezierCurve"),Array.isArray(s)&&(o=new r(s[6],s[7]),i=new r(s[4],s[5]),h=new r(s[2],s[3]),s=new r(s[0],s[1])),this.p0=s,this.p1=h,this.p2=i,this.p3=o},getStartPoint:function(e){return e===void 0&&(e=new r),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,s){s===void 0&&(s=new r);var h=this.p0,i=this.p1,o=this.p2,f=this.p3;return s.set(c(e,h.x,i.x,o.x,f.x),c(e,h.y,i.y,o.y,f.y))},draw:function(e,s){s===void 0&&(s=32);var h=this.getPoints(s);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var i=1;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(19217),a=t(87841),r=t(26099),n=new d({initialize:function(s){this.type=s,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new r,this._tmpVec2B=new r},draw:function(e,s){return s===void 0&&(s=32),e.strokePoints(this.getPoints(s))},getBounds:function(e,s){e||(e=new a),s===void 0&&(s=16);var h=this.getLength();s>h&&(s=h/2);var i=Math.max(1,Math.round(h/s));return c(this.getSpacedPoints(i),e)},getDistancePoints:function(e){var s=this.getLength(),h=Math.max(1,s/e);return this.getSpacedPoints(h)},getEndPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(1,e)},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var s=[],h,i=this.getPoint(0,this._tmpVec2A),o=0;s.push(0);for(var f=1;f<=e;f++)h=this.getPoint(f/e,this._tmpVec2B),o+=h.distance(i),s.push(o),i.copy(h);return this.cacheArcLengths=s,s},getPointAt:function(e,s){var h=this.getUtoTmapping(e);return this.getPoint(h,s)},getPoints:function(e,s,h){h===void 0&&(h=[]),e||(s?e=this.getLength()/s:e=this.defaultDivisions);for(var i=0;i<=e;i++)h.push(this.getPoint(i/e));return h},getRandomPoint:function(e){return e===void 0&&(e=new r),this.getPoint(Math.random(),e)},getSpacedPoints:function(e,s,h){h===void 0&&(h=[]),e||(s?e=this.getLength()/s:e=this.defaultDivisions);for(var i=0;i<=e;i++){var o=this.getUtoTmapping(i/e,null,e);h.push(this.getPoint(o))}return h},getStartPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(0,e)},getTangent:function(e,s){s===void 0&&(s=new r);var h=1e-4,i=e-h,o=e+h;return i<0&&(i=0),o>1&&(o=1),this.getPoint(i,this._tmpVec2A),this.getPoint(o,s),s.subtract(this._tmpVec2A).normalize()},getTangentAt:function(e,s){var h=this.getUtoTmapping(e);return this.getTangent(h,s)},getTFromDistance:function(e,s){return e<=0?0:this.getUtoTmapping(0,e,s)},getUtoTmapping:function(e,s,h){var i=this.getLengths(h),o=0,f=i.length,l;s?l=Math.min(s,i[f-1]):l=e*i[f-1];for(var u=0,v=f-1,m;u<=v;)if(o=Math.floor(u+(v-u)/2),m=i[o]-l,m<0)u=o+1;else if(m>0)v=o-1;else{v=o;break}if(o=v,i[o]===l)return o/(f-1);var x=i[o],g=i[o+1],y=g-x,T=(l-x)/y;return(o+T)/(f-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});p.exports=n},73825:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(80021),a=t(39506),r=t(35154),n=t(43396),e=t(26099),s=new d({Extends:c,initialize:function(i,o,f,l,u,v,m,x){if(typeof i=="object"){var g=i;i=r(g,"x",0),o=r(g,"y",0),f=r(g,"xRadius",0),l=r(g,"yRadius",f),u=r(g,"startAngle",0),v=r(g,"endAngle",360),m=r(g,"clockwise",!1),x=r(g,"rotation",0)}else l===void 0&&(l=f),u===void 0&&(u=0),v===void 0&&(v=360),m===void 0&&(m=!1),x===void 0&&(x=0);c.call(this,"EllipseCurve"),this.p0=new e(i,o),this._xRadius=f,this._yRadius=l,this._startAngle=a(u),this._endAngle=a(v),this._clockwise=m,this._rotation=a(x)},getStartPoint:function(h){return h===void 0&&(h=new e),this.getPoint(0,h)},getResolution:function(h){return h*2},getPoint:function(h,i){i===void 0&&(i=new e);for(var o=Math.PI*2,f=this._endAngle-this._startAngle,l=Math.abs(f)o;)f-=o;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(80021),a=t(19217),r=t(87841),n=t(26099),e=new d({Extends:c,initialize:function(h,i){c.call(this,"LineCurve"),Array.isArray(h)&&(i=new n(h[2],h[3]),h=new n(h[0],h[1])),this.p0=h,this.p1=i,this.arcLengthDivisions=1},getBounds:function(s){return s===void 0&&(s=new r),a([this.p0,this.p1],s)},getStartPoint:function(s){return s===void 0&&(s=new n),s.copy(this.p0)},getResolution:function(s){return s===void 0&&(s=1),s},getPoint:function(s,h){return h===void 0&&(h=new n),s===1?h.copy(this.p1):(h.copy(this.p1).subtract(this.p0).scale(s).add(this.p0),h)},getPointAt:function(s,h){return this.getPoint(s,h)},getTangent:function(s,h){return h===void 0&&(h=new n),h.copy(this.p1).subtract(this.p0).normalize(),h},getUtoTmapping:function(s,h,i){var o;if(h){var f=this.getLengths(i),l=f[f.length-1],u=Math.min(h,l);o=u/l}else o=s;return o},draw:function(s){return s.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),s},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});e.fromJSON=function(s){var h=s.points,i=new n(h[0],h[1]),o=new n(h[2],h[3]);return new e(i,o)},p.exports=e},14744:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(80021),a=t(32112),r=t(26099),n=new d({Extends:c,initialize:function(s,h,i){c.call(this,"QuadraticBezierCurve"),Array.isArray(s)&&(i=new r(s[4],s[5]),h=new r(s[2],s[3]),s=new r(s[0],s[1])),this.p0=s,this.p1=h,this.p2=i},getStartPoint:function(e){return e===void 0&&(e=new r),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,s){s===void 0&&(s=new r);var h=this.p0,i=this.p1,o=this.p2;return s.set(a(e,h.x,i.x,o.x),a(e,h.y,i.y,o.y))},draw:function(e,s){s===void 0&&(s=32);var h=this.getPoints(s);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var i=1;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87842),c=t(83419),a=t(80021),r=t(26099),n=new c({Extends:a,initialize:function(s){s===void 0&&(s=[]),a.call(this,"SplineCurve"),this.points=[],this.addPoints(s)},addPoints:function(e){for(var s=0;sh.length-2?h.length-1:o+1],m=h[o>h.length-3?h.length-1:o+2];return s.set(d(f,l.x,u.x,v.x,m.x),d(f,l.y,u.y,v.y,m.y))},toJSON:function(){for(var e=[],s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Path:t(46669),MoveTo:t(68618),CubicBezier:t(46728),Curve:t(80021),Ellipse:t(73825),Line:t(33951),QuadraticBezier:t(14744),Spline:t(42534)}},68618:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(26099),a=new d({initialize:function(n,e){this.active=!1,this.p0=new c(n,e)},getPoint:function(r,n){return n===void 0&&(n=new c),n.copy(this.p0)},getPointAt:function(r,n){return this.getPoint(r,n)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});p.exports=a},46669:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(46728),a=t(73825),r=t(39429),n=t(33951),e=t(68618),s=t(14744),h=t(87841),i=t(42534),o=t(26099),f=t(36383),l=new d({initialize:function(v,m){v===void 0&&(v=0),m===void 0&&(m=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new o,this._tmpVec2A=new o,this._tmpVec2B=new o,typeof v=="object"?this.fromJSON(v):this.startPoint.set(v,m)},add:function(u){return this.curves.push(u),this},circleTo:function(u,v,m){return v===void 0&&(v=!1),this.ellipseTo(u,u,0,360,v,m)},closePath:function(){var u=this.curves[0].getPoint(0),v=this.curves[this.curves.length-1].getPoint(1);return u.equals(v)||this.curves.push(new n(v,u)),this},cubicBezierTo:function(u,v,m,x,g,y){var T=this.getEndPoint(),E,P,R;return u instanceof o?(E=u,P=v,R=m):(E=new o(m,x),P=new o(g,y),R=new o(u,v)),this.add(new c(T,E,P,R))},quadraticBezierTo:function(u,v,m,x){var g=this.getEndPoint(),y,T;return u instanceof o?(y=u,T=v):(y=new o(m,x),T=new o(u,v)),this.add(new s(g,y,T))},draw:function(u,v){for(var m=0;m=v)return this.curves[x];x++}return null},getEndPoint:function(u){return u===void 0&&(u=new o),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,u):u.copy(this.startPoint),u},getLength:function(){var u=this.getCurveLengths();return u[u.length-1]},getPoint:function(u,v){v===void 0&&(v=new o);for(var m=u*this.getLength(),x=this.getCurveLengths(),g=0;g=m){var y=x[g]-m,T=this.curves[g],E=T.getLength(),P=E===0?0:1-y/E;return T.getPointAt(P,v)}g++}return null},getPoints:function(u,v){!u&&!v&&(u=this.defaultDivisions);for(var m=[],x,g=0;g1&&!m[m.length-1].equals(m[0])&&m.push(m[0]),m},getRandomPoint:function(u){return u===void 0&&(u=new o),this.getPoint(Math.random(),u)},getSpacedPoints:function(u){u===void 0&&(u=40);for(var v=[],m=0;m<=u;m++)v.push(this.getPoint(m/u));return this.autoClose&&v.push(v[0]),v},getStartPoint:function(u){return u===void 0&&(u=new o),u.copy(this.startPoint)},getTangent:function(u,v){v===void 0&&(v=new o);for(var m=u*this.getLength(),x=this.getCurveLengths(),g=0;g=m){var y=x[g]-m,T=this.curves[g],E=T.getLength(),P=E===0?0:1-y/E;return T.getTangentAt(P,v)}g++}return null},lineTo:function(u,v){u instanceof o?this._tmpVec2B.copy(u):typeof u=="object"?this._tmpVec2B.setFromObject(u):this._tmpVec2B.set(u,v);var m=this.getEndPoint(this._tmpVec2A);return this.add(new n([m.x,m.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(u){return u.unshift(this.getEndPoint()),this.add(new i(u))},moveTo:function(u,v){return u instanceof o?this.add(new e(u.x,u.y)):this.add(new e(u,v))},toJSON:function(){for(var u=[],v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(24882),a=new d({initialize:function(n,e){this.parent=n,this.events=e,e||(this.events=n.events?n.events:n),this.list={},this.values={},this._frozen=!1,!n.hasOwnProperty("sys")&&this.events&&this.events.once(c.DESTROY,this.destroy,this)},get:function(r){var n=this.list;if(Array.isArray(r)){for(var e=[],s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(45893),a=t(37277),r=t(44594),n=new d({Extends:c,initialize:function(s){c.call(this,s,s.sys.events),this.scene=s,this.systems=s.sys,s.sys.events.once(r.BOOT,this.boot,this),s.sys.events.on(r.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){c.prototype.destroy.call(this),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null}});a.register("DataManagerPlugin",n,"data"),p.exports=n},10700:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="changedata"},93608:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="changedata-"},60883:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},69780:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="removedata"},22166:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="setdata"},24882:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CHANGE_DATA:t(10700),CHANGE_DATA_KEY:t(93608),DESTROY:t(60883),REMOVE_DATA:t(69780),SET_DATA:t(22166)}},44965:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={DataManager:t(45893),DataManagerPlugin:t(63646),Events:t(24882)}},7098:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(84148),c={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};function a(){if(typeof importScripts=="function")return c;c.audioData=!!window.Audio,c.webAudio=!!(window.AudioContext||window.webkitAudioContext);var r=document.createElement("audio"),n=!!r.canPlayType;try{if(n){var e=function(i,o){var f=r.canPlayType("audio/"+i).replace(/^no$/,"");return o?!!(f||r.canPlayType("audio/"+o).replace(/^no$/,"")):!!f};if(c.ogg=e('ogg; codecs="vorbis"'),c.opus=e('ogg; codecs="opus"',"opus"),c.mp3=e("mpeg"),c.wav=e("wav"),c.m4a=e("x-m4a"),c.aac=e("aac"),c.flac=e("flac","x-flac"),c.webm=e('webm; codecs="vorbis"'),r.canPlayType('audio/mp4; codecs="ec-3"')!==""){if(d.edge)c.dolby=!0;else if(d.safari&&d.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var s=parseInt(RegExp.$1,10),h=parseInt(RegExp.$2,10);(s===10&&h>=11||s>10)&&(c.dolby=!0)}}}}catch{}return c}p.exports=a()},84148:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25892),c={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};function a(){var r=navigator.userAgent;return/Edg\/\d+/.test(r)?(c.edge=!0,c.es2019=!0):/OPR/.test(r)?(c.opera=!0,c.es2019=!0):/Chrome\/(\d+)/.test(r)&&!d.windowsPhone?(c.chrome=!0,c.chromeVersion=parseInt(RegExp.$1,10),c.es2019=c.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(c.firefox=!0,c.firefoxVersion=parseInt(RegExp.$1,10),c.es2019=c.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&d.iOS?(c.mobileSafari=!0,c.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(c.ie=!0,c.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!d.windowsPhone?(c.safari=!0,c.safariVersion=parseInt(RegExp.$1,10),c.es2019=c.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(c.ie=!0,c.trident=!0,c.tridentVersion=parseInt(RegExp.$1,10),c.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(c.silk=!0),c}p.exports=a()},89289:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c={supportInverseAlpha:!1,supportNewBlendModes:!1};function a(){var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",h=new Image;return h.onload=function(){var i=new Image;i.onload=function(){var o=d.create2D(i,6),f=o.getContext("2d",{willReadFrequently:!0});if(f.globalCompositeOperation="multiply",f.drawImage(h,0,0),f.drawImage(i,2,0),!f.getImageData(2,0,1,1))return!1;var l=f.getImageData(2,0,1,1).data;d.remove(i),c.supportNewBlendModes=l[0]===255&&l[1]===0&&l[2]===0},i.src=e+"/wCKxvRF"+s},h.src=e+"AP804Oa6"+s,!1}function r(){var e=d.create2D(this,2),s=e.getContext("2d",{willReadFrequently:!0});s.fillStyle="rgba(10, 20, 30, 0.5)",s.fillRect(0,0,1,1);var h=s.getImageData(0,0,1,1);if(h===null)return!1;s.putImageData(h,1,0);var i=s.getImageData(1,0,1,1),o=i.data[0]===h.data[0]&&i.data[1]===h.data[1]&&i.data[2]===h.data[2]&&i.data[3]===h.data[3];return d.remove(this),o}function n(){return typeof importScripts!="function"&&document!==void 0&&(c.supportNewBlendModes=a(),c.supportInverseAlpha=r()),c}p.exports=n()},89357:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25892),c=t(84148),a=t(27919),r={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};function n(){var s=new ArrayBuffer(4),h=new Uint8Array(s),i=new Uint32Array(s);return h[0]=161,h[1]=178,h[2]=195,h[3]=212,i[0]===3569595041?!0:i[0]===2712847316?!1:null}function e(){if(typeof importScripts=="function")return r;r.canvas=!!window.CanvasRenderingContext2D;try{r.localStorage=!!localStorage.getItem}catch{r.localStorage=!1}r.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob,r.fileSystem=!!window.requestFileSystem;var s=!1,h=function(){if(window.WebGLRenderingContext)try{var i=a.createWebGL(this),o=i.getContext("webgl")||i.getContext("experimental-webgl"),f=a.create2D(this),l=f.getContext("2d",{willReadFrequently:!0}),u=l.createImageData(1,1);return s=u.data instanceof Uint8ClampedArray,a.remove(i),a.remove(f),!!o}catch{return!1}return!1};return r.webGL=h(),r.worker=!!window.Worker,r.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,r.getUserMedia=r.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,c.firefox&&c.firefoxVersion<21&&(r.getUserMedia=!1),!d.iOS&&(c.ie||c.firefox||c.chrome)&&(r.canvasBitBltShift=!0),(c.safari||c.mobileSafari)&&(r.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(r.vibration=!0),typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint32Array<"u"&&(r.littleEndian=n()),r.support32bit=typeof ArrayBuffer<"u"&&typeof Uint8ClampedArray<"u"&&typeof Int32Array<"u"&&r.littleEndian!==null&&s,r}p.exports=e()},91639:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={available:!1,cancel:"",keyboard:!1,request:""};function t(){if(typeof importScripts=="function")return C;var d,c="Fullscreen",a="FullScreen",r=["request"+c,"request"+a,"webkitRequest"+c,"webkitRequest"+a,"msRequest"+c,"msRequest"+a,"mozRequest"+a,"mozRequest"+c];for(d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(84148),c={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};function a(){return typeof importScripts=="function"||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(c.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(c.mspointer=!0),navigator.getGamepads&&(c.gamepads=!0),"onwheel"in window||d.ie&&"WheelEvent"in window?c.wheelEvent="wheel":"onmousewheel"in window?c.wheelEvent="mousewheel":d.firefox&&"MouseScrollEvent"in window&&(c.wheelEvent="DOMMouseScroll")),c}p.exports=a()},25892:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};function t(){if(typeof importScripts=="function")return C;var d=navigator.userAgent;/Windows/.test(d)?C.windows=!0:/Mac OS/.test(d)&&!/like Mac OS/.test(d)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(C.iOS=!0,C.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),C.iOSVersion=parseInt(RegExp.$1,10)):C.macOS=!0:/Android/.test(d)?C.android=!0:/Linux/.test(d)?C.linux=!0:/iP[ao]d|iPhone/i.test(d)?(C.iOS=!0,navigator.appVersion.match(/OS (\d+)/),C.iOSVersion=parseInt(RegExp.$1,10),C.iPhone=d.toLowerCase().indexOf("iphone")!==-1,C.iPad=d.toLowerCase().indexOf("ipad")!==-1):/Kindle/.test(d)||/\bKF[A-Z][A-Z]+/.test(d)||/Silk.*Mobile Safari/.test(d)?C.kindle=!0:/CrOS/.test(d)&&(C.chromeOS=!0),(/Windows Phone/i.test(d)||/IEMobile/i.test(d))&&(C.android=!1,C.iOS=!1,C.macOS=!1,C.windows=!0,C.windowsPhone=!0);var c=/Silk/.test(d);return(C.windows||C.macOS||C.linux&&!c||C.chromeOS)&&(C.desktop=!0),(C.windowsPhone||/Windows NT/i.test(d)&&/Touch/i.test(d))&&(C.desktop=!1),navigator.standalone&&(C.webApp=!0),typeof importScripts!="function"&&(window.cordova!==void 0&&(C.cordova=!0),window.ejecta!==void 0&&(C.ejecta=!0)),typeof process<"u"&&process.versions&&process.versions.node&&(C.node=!0),C.node&&typeof process.versions=="object"&&(C.nodeWebkit=!!process.versions["node-webkit"],C.electron=!!process.versions.electron),/Crosswalk/.test(d)&&(C.crosswalk=!0),C.pixelRatio=window.devicePixelRatio||1,C}p.exports=t()},43267:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};function a(){if(typeof importScripts=="function")return c;var r=document.createElement("video"),n=!!r.canPlayType,e=/^no$/;try{n&&(r.canPlayType('video/ogg; codecs="theora"').replace(e,"")&&(c.ogg=!0),r.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(e,"")&&(c.h264=!0,c.mp4=!0),r.canPlayType("video/x-m4v").replace(e,"")&&(c.m4v=!0),r.canPlayType('video/webm; codecs="vp8, vorbis"').replace(e,"")&&(c.webm=!0),r.canPlayType('video/webm; codecs="vp9"').replace(e,"")&&(c.vp9=!0),r.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(e,"")&&(c.hls=!0))}catch{}return r.parentNode&&r.parentNode.removeChild(r),c.getVideoURL=function(s){Array.isArray(s)||(s=[s]);for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={os:t(25892),browser:t(84148),features:t(89357),input:t(31784),audio:t(7098),video:t(43267),fullscreen:t(91639),canvasFeatures:t(89289)}},89422:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new Float32Array(20),a=new d({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(r){return this._matrix.set(r),this._dirty=!0,this},reset:function(){var r=this._matrix;return r.fill(0),r[0]=1,r[6]=1,r[12]=1,r[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var r=this._data;return this._dirty&&(r.set(this._matrix),r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,this._dirty=!1),r},brightness:function(r,n){r===void 0&&(r=0),n===void 0&&(n=!1);var e=r;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0],n)},saturate:function(r,n){r===void 0&&(r=0),n===void 0&&(n=!1);var e=r*2/3+1,s=(e-1)*-.5;return this.multiply([e,s,s,0,0,s,e,s,0,0,s,s,e,0,0,0,0,0,1,0],n)},desaturate:function(r){return r===void 0&&(r=!1),this.saturate(-1,r)},hue:function(r,n){r===void 0&&(r=0),n===void 0&&(n=!1),r=r/180*Math.PI;var e=Math.cos(r),s=Math.sin(r),h=.213,i=.715,o=.072;return this.multiply([h+e*(1-h)+s*-h,i+e*-i+s*-i,o+e*-o+s*(1-o),0,0,h+e*-h+s*.143,i+e*(1-i)+s*.14,o+e*-o+s*-.283,0,0,h+e*-h+s*-(1-h),i+e*-i+s*i,o+e*(1-o)+s*o,0,0,0,0,0,1,0],n)},grayscale:function(r,n){return r===void 0&&(r=1),n===void 0&&(n=!1),this.saturate(-r,n)},blackWhite:function(r){return r===void 0&&(r=!1),this.multiply(a.BLACK_WHITE,r)},contrast:function(r,n){r===void 0&&(r=0),n===void 0&&(n=!1);var e=r+1,s=-.5*(e-1);return this.multiply([e,0,0,0,s,0,e,0,0,s,0,0,e,0,s,0,0,0,1,0],n)},negative:function(r){return r===void 0&&(r=!1),this.multiply(a.NEGATIVE,r)},desaturateLuminance:function(r){return r===void 0&&(r=!1),this.multiply(a.DESATURATE_LUMINANCE,r)},sepia:function(r){return r===void 0&&(r=!1),this.multiply(a.SEPIA,r)},night:function(r,n){return r===void 0&&(r=.1),n===void 0&&(n=!1),this.multiply([r*-2,-r,0,0,0,-r,0,r,0,0,0,r,r*2,0,0,0,0,0,1,0],n)},lsd:function(r){return r===void 0&&(r=!1),this.multiply(a.LSD,r)},brown:function(r){return r===void 0&&(r=!1),this.multiply(a.BROWN,r)},vintagePinhole:function(r){return r===void 0&&(r=!1),this.multiply(a.VINTAGE,r)},kodachrome:function(r){return r===void 0&&(r=!1),this.multiply(a.KODACHROME,r)},technicolor:function(r){return r===void 0&&(r=!1),this.multiply(a.TECHNICOLOR,r)},polaroid:function(r){return r===void 0&&(r=!1),this.multiply(a.POLAROID,r)},shiftToBGR:function(r){return r===void 0&&(r=!1),this.multiply(a.SHIFT_BGR,r)},multiply:function(r,n){n===void 0&&(n=!1),n||this.reset();var e=this._matrix,s=c;return s.set(e),e.set([s[0]*r[0]+s[1]*r[5]+s[2]*r[10]+s[3]*r[15],s[0]*r[1]+s[1]*r[6]+s[2]*r[11]+s[3]*r[16],s[0]*r[2]+s[1]*r[7]+s[2]*r[12]+s[3]*r[17],s[0]*r[3]+s[1]*r[8]+s[2]*r[13]+s[3]*r[18],s[0]*r[4]+s[1]*r[9]+s[2]*r[14]+s[3]*r[19]+s[4],s[5]*r[0]+s[6]*r[5]+s[7]*r[10]+s[8]*r[15],s[5]*r[1]+s[6]*r[6]+s[7]*r[11]+s[8]*r[16],s[5]*r[2]+s[6]*r[7]+s[7]*r[12]+s[8]*r[17],s[5]*r[3]+s[6]*r[8]+s[7]*r[13]+s[8]*r[18],s[5]*r[4]+s[6]*r[9]+s[7]*r[14]+s[8]*r[19]+s[9],s[10]*r[0]+s[11]*r[5]+s[12]*r[10]+s[13]*r[15],s[10]*r[1]+s[11]*r[6]+s[12]*r[11]+s[13]*r[16],s[10]*r[2]+s[11]*r[7]+s[12]*r[12]+s[13]*r[17],s[10]*r[3]+s[11]*r[8]+s[12]*r[13]+s[13]*r[18],s[10]*r[4]+s[11]*r[9]+s[12]*r[14]+s[13]*r[19]+s[14],s[15]*r[0]+s[16]*r[5]+s[17]*r[10]+s[18]*r[15],s[15]*r[1]+s[16]*r[6]+s[17]*r[11]+s[18]*r[16],s[15]*r[2]+s[16]*r[7]+s[17]*r[12]+s[18]*r[17],s[15]*r[3]+s[16]*r[8]+s[17]*r[13]+s[18]*r[18],s[15]*r[4]+s[16]*r[9]+s[17]*r[14]+s[18]*r[19]+s[19]]),this._dirty=!0,this}});a.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],a.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],a.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],a.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],a.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],a.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],a.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],a.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],a.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],a.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],a.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],p.exports=a},51767:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(29747),a=new d({initialize:function(n,e,s){this._rgb=[0,0,0],this.onChangeCallback=c,this.dirty=!1,this.set(n,e,s)},set:function(r,n,e){return r===void 0&&(r=0),n===void 0&&(n=0),e===void 0&&(e=0),this._rgb=[r,n,e],this.onChange(),this},equals:function(r,n,e){var s=this._rgb;return s[0]===r&&s[1]===n&&s[2]===e},onChange:function(){this.dirty=!0;var r=this._rgb;this.onChangeCallback.call(this,r[0],r[1],r[2])},r:{get:function(){return this._rgb[0]},set:function(r){this._rgb[0]=r,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(r){this._rgb[1]=r,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(r){this._rgb[2]=r,this.onChange()}},destroy:function(){this.onChangeCallback=null}});p.exports=a},60461:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12};p.exports=C},54312:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(35893),a=t(86327),r=t(88417),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)+h),a(e,d(s)+i),e};p.exports=n},46768:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(26541),a=t(86327),r=t(385),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)-h),a(e,d(s)+i),e};p.exports=n},35827:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(54380),a=t(86327),r=t(40136),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)+h),a(e,d(s)+i),e};p.exports=n},46871:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66786),c=t(35893),a=t(7702),r=function(n,e,s,h){return s===void 0&&(s=0),h===void 0&&(h=0),d(n,c(e)+s,a(e)+h),n};p.exports=r},5198:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7702),c=t(26541),a=t(20786),r=t(385),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)-h),a(e,d(s)+i),e};p.exports=n},11879:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(60461),c=[];c[d.BOTTOM_CENTER]=t(54312),c[d.BOTTOM_LEFT]=t(46768),c[d.BOTTOM_RIGHT]=t(35827),c[d.CENTER]=t(46871),c[d.LEFT_CENTER]=t(5198),c[d.RIGHT_CENTER]=t(80503),c[d.TOP_CENTER]=t(89698),c[d.TOP_LEFT]=t(922),c[d.TOP_RIGHT]=t(21373),c[d.LEFT_BOTTOM]=c[d.BOTTOM_LEFT],c[d.LEFT_TOP]=c[d.TOP_LEFT],c[d.RIGHT_BOTTOM]=c[d.BOTTOM_RIGHT],c[d.RIGHT_TOP]=c[d.TOP_RIGHT];var a=function(r,n,e,s,h){return c[e](r,n,s,h)};p.exports=a},80503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7702),c=t(54380),a=t(20786),r=t(40136),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)+h),a(e,d(s)+i),e};p.exports=n},89698:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35893),c=t(17717),a=t(88417),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,d(s)+h),r(e,c(s)-i),e};p.exports=n},922:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26541),c=t(17717),a=t(385),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,d(s)-h),r(e,c(s)-i),e};p.exports=n},21373:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54380),c=t(17717),a=t(40136),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,d(s)+h),r(e,c(s)-i),e};p.exports=n},91660:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BottomCenter:t(54312),BottomLeft:t(46768),BottomRight:t(35827),Center:t(46871),LeftCenter:t(5198),QuickSet:t(11879),RightCenter:t(80503),TopCenter:t(89698),TopLeft:t(922),TopRight:t(21373)}},71926:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(60461),c=t(79291),a={In:t(91660),To:t(16694)};a=c(!1,a,d),p.exports=a},21578:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(35893),a=t(88417),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,c(s)+h),r(e,d(s)+i),e};p.exports=n},10210:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(26541),a=t(385),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,c(s)-h),r(e,d(s)+i),e};p.exports=n},82341:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(54380),a=t(40136),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,c(s)+h),r(e,d(s)+i),e};p.exports=n},87958:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(26541),a=t(86327),r=t(40136),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)-h),a(e,d(s)+i),e};p.exports=n},40080:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7702),c=t(26541),a=t(20786),r=t(40136),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)-h),a(e,d(s)+i),e};p.exports=n},88466:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26541),c=t(17717),a=t(40136),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,d(s)-h),r(e,c(s)-i),e};p.exports=n},38829:(p,C,t)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(60461),c=[];c[d.BOTTOM_CENTER]=t(21578),c[d.BOTTOM_LEFT]=t(10210),c[d.BOTTOM_RIGHT]=t(82341),c[d.LEFT_BOTTOM]=t(87958),c[d.LEFT_CENTER]=t(40080),c[d.LEFT_TOP]=t(88466),c[d.RIGHT_BOTTOM]=t(19211),c[d.RIGHT_CENTER]=t(34609),c[d.RIGHT_TOP]=t(48741),c[d.TOP_CENTER]=t(49440),c[d.TOP_LEFT]=t(81288),c[d.TOP_RIGHT]=t(61323);var a=function(r,n,e,s,h){return c[e](r,n,s,h)};p.exports=a},19211:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(54380),a=t(86327),r=t(385),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)+h),a(e,d(s)+i),e};p.exports=n},34609:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7702),c=t(54380),a=t(20786),r=t(385),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,c(s)+h),a(e,d(s)+i),e};p.exports=n},48741:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54380),c=t(17717),a=t(385),r=t(66737),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),a(e,d(s)+h),r(e,c(s)-i),e};p.exports=n},49440:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35893),c=t(17717),a=t(86327),r=t(88417),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,d(s)+h),a(e,c(s)-i),e};p.exports=n},81288:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26541),c=t(17717),a=t(86327),r=t(385),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,d(s)-h),a(e,c(s)-i),e};p.exports=n},61323:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54380),c=t(17717),a=t(86327),r=t(40136),n=function(e,s,h,i){return h===void 0&&(h=0),i===void 0&&(i=0),r(e,d(s)+h),a(e,c(s)-i),e};p.exports=n},16694:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BottomCenter:t(21578),BottomLeft:t(10210),BottomRight:t(82341),LeftBottom:t(87958),LeftCenter:t(40080),LeftTop:t(88466),QuickSet:t(38829),RightBottom:t(19211),RightCenter:t(34609),RightTop:t(48741),TopCenter:t(49440),TopLeft:t(81288),TopRight:t(61323)}},66786:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(88417),c=t(20786),a=function(r,n,e){return d(r,n),c(r,e)};p.exports=a},62235:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.y+t.height-t.height*t.originY};p.exports=C},72873:(p,C,t)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62235),c=t(26541),a=t(54380),r=t(17717),n=t(87841),e=function(s,h){h===void 0&&(h=new n);var i=c(s),o=r(s);return h.x=i,h.y=o,h.width=a(s)-i,h.height=d(s)-o,h};p.exports=e},35893:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x-t.width*t.originX+t.width*.5};p.exports=C},7702:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.y-t.height*t.originY+t.height*.5};p.exports=C},26541:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x-t.width*t.originX};p.exports=C},87431:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.width*t.originX};p.exports=C},46928:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.height*t.originY};p.exports=C},54380:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x+t.width-t.width*t.originX};p.exports=C},17717:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.y-t.height*t.originY};p.exports=C},86327:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.y=d-t.height+t.height*t.originY,t};p.exports=C},88417:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.width*t.originX;return t.x=d+c-t.width*.5,t};p.exports=C},20786:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.height*t.originY;return t.y=d+c-t.height*.5,t};p.exports=C},385:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x=d+t.width*t.originX,t};p.exports=C},40136:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x=d-t.width+t.width*t.originX,t};p.exports=C},66737:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.y=d+t.height*t.originY,t};p.exports=C},58724:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CenterOn:t(66786),GetBottom:t(62235),GetBounds:t(72873),GetCenterX:t(35893),GetCenterY:t(7702),GetLeft:t(26541),GetOffsetX:t(87431),GetOffsetY:t(46928),GetRight:t(54380),GetTop:t(17717),SetBottom:t(86327),SetCenterX:t(88417),SetCenterY:t(20786),SetLeft:t(385),SetRight:t(40136),SetTop:t(66737)}},20623:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setCrisp:function(t){var d=["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"];return d.forEach(function(c){t.style["image-rendering"]=c}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}};p.exports=C},27919:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8054),c=t(68703),a=[],r=!1,n=function(){var e=function(m,x,g,y,T){x===void 0&&(x=1),g===void 0&&(g=1),y===void 0&&(y=d.CANVAS),T===void 0&&(T=!1);var E,P=i(y);return P===null?(P={parent:m,canvas:document.createElement("canvas"),type:y},y===d.CANVAS&&a.push(P),E=P.canvas):(P.parent=m,E=P.canvas),T&&(P.parent=E),E.width=x,E.height=g,r&&y===d.CANVAS&&c.disable(E.getContext("2d",{willReadFrequently:!1})),E},s=function(m,x,g){return e(m,x,g,d.CANVAS)},h=function(m,x,g){return e(m,x,g,d.WEBGL)},i=function(m){if(m===void 0&&(m=d.CANVAS),m===d.WEBGL)return null;for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C="",t=function(){var d=function(n){for(var e=["i","webkitI","msI","mozI","oI"],s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d="none"),t.style.msTouchAction=d,t.style["ms-touch-action"]=d,t.style["touch-action"]=d,t};p.exports=C},91610:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d="none");var c=["-webkit-","-khtml-","-moz-","-ms-",""];return c.forEach(function(a){t.style[a+"user-select"]=d}),t.style["-webkit-touch-callout"]=d,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t};p.exports=C},26253:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CanvasInterpolation:t(20623),CanvasPool:t(27919),Smoothing:t(68703),TouchAction:t(65208),UserSelect:t(91610)}},40987:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(37589),a=t(1e3),r=t(7537),n=t(87837),e=new d({initialize:function(h,i,o,f){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(h,i,o,f)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(s,h,i,o,f){return o===void 0&&(o=255),f===void 0&&(f=!0),this._locked=!0,this.red=s,this.green=h,this.blue=i,this.alpha=o,this._locked=!1,this.update(f)},setGLTo:function(s,h,i,o){return o===void 0&&(o=1),this._locked=!0,this.redGL=s,this.greenGL=h,this.blueGL=i,this.alphaGL=o,this._locked=!1,this.update(!0)},setFromRGB:function(s){return this._locked=!0,this.red=s.r,this.green=s.g,this.blue=s.b,s.hasOwnProperty("a")&&(this.alpha=s.a),this._locked=!1,this.update(!0)},setFromHSV:function(s,h,i){return r(s,h,i,this)},update:function(s){if(s===void 0&&(s=!1),this._locked)return this;var h=this.r,i=this.g,o=this.b,f=this.a;return this._color=c(h,i,o),this._color32=a(h,i,o,f),this._rgba="rgba("+h+","+i+","+o+","+f/255+")",s&&n(h,i,o,this),this},updateHSV:function(){var s=this.r,h=this.g,i=this.b;return n(s,h,i,this),this},clone:function(){return new e(this.r,this.g,this.b,this.a)},gray:function(s){return this.setTo(s,s,s)},random:function(s,h){s===void 0&&(s=0),h===void 0&&(h=255);var i=Math.floor(s+Math.random()*(h-s)),o=Math.floor(s+Math.random()*(h-s)),f=Math.floor(s+Math.random()*(h-s));return this.setTo(i,o,f)},randomGray:function(s,h){s===void 0&&(s=0),h===void 0&&(h=255);var i=Math.floor(s+Math.random()*(h-s));return this.setTo(i,i,i)},saturate:function(s){return this.s+=s/100,this},desaturate:function(s){return this.s-=s/100,this},lighten:function(s){return this.v+=s/100,this},darken:function(s){return this.v-=s/100,this},brighten:function(s){var h=this.r,i=this.g,o=this.b;return h=Math.max(0,Math.min(255,h-Math.round(255*-(s/100)))),i=Math.max(0,Math.min(255,i-Math.round(255*-(s/100)))),o=Math.max(0,Math.min(255,o-Math.round(255*-(s/100)))),this.setTo(h,i,o)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(s){this.gl[0]=Math.min(Math.abs(s),1),this.r=Math.floor(this.gl[0]*255),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(s){this.gl[1]=Math.min(Math.abs(s),1),this.g=Math.floor(this.gl[1]*255),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(s){this.gl[2]=Math.min(Math.abs(s),1),this.b=Math.floor(this.gl[2]*255),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(s){this.gl[3]=Math.min(Math.abs(s),1),this.a=Math.floor(this.gl[3]*255),this.update()}},red:{get:function(){return this.r},set:function(s){s=Math.floor(Math.abs(s)),this.r=Math.min(s,255),this.gl[0]=s/255,this.update(!0)}},green:{get:function(){return this.g},set:function(s){s=Math.floor(Math.abs(s)),this.g=Math.min(s,255),this.gl[1]=s/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(s){s=Math.floor(Math.abs(s)),this.b=Math.min(s,255),this.gl[2]=s/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(s){s=Math.floor(Math.abs(s)),this.a=Math.min(s,255),this.gl[3]=s/255,this.update()}},h:{get:function(){return this._h},set:function(s){this._h=s,r(s,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(s){this._s=s,r(this._h,s,this._v,this)}},v:{get:function(){return this._v},set:function(s){this._v=s,r(this._h,this._s,s,this)}}});p.exports=e},92728:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37589),c=function(a){a===void 0&&(a=1024);var r=[],n=255,e,s=255,h=0,i=0;for(e=0;e<=n;e++)r.push({r:s,g:e,b:i,color:d(s,e,i)});for(h=255,e=n;e>=0;e--)r.push({r:e,g:h,b:i,color:d(e,h,i)});for(s=0,e=0;e<=n;e++,h--)r.push({r:s,g:h,b:e,color:d(s,h,e)});for(h=0,i=255,e=0;e<=n;e++,i--,s++)r.push({r:s,g:h,b:i,color:d(s,h,i)});if(a===1024)return r;var o=[],f=0,l=1024/a;for(e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d={r:t>>16&255,g:t>>8&255,b:t&255,a:255};return t>16777215&&(d.a=t>>>24),d};p.exports=C},62957:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=t.toString(16);return d.length===1?"0"+d:d};p.exports=C},37589:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t<<16|d<<8|c};p.exports=C},1e3:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return a<<24|t<<16|d<<8|c};p.exports=C},62183:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987),c=t(89528),a=function(r,n,e){var s=e,h=e,i=e;if(n!==0){var o=e<.5?e*(1+n):e+n-e*n,f=2*e-o;s=c(f,o,r+1/3),h=c(f,o,r),i=c(f,o,r-1/3)}var l=new d;return l.setGLTo(s,h,i,1)};p.exports=a},27939:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7537),c=function(a,r){a===void 0&&(a=1),r===void 0&&(r=1);for(var n=[],e=0;e<=359;e++)n.push(d(e/359,a,r));return n};p.exports=c},7537:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37589);function c(r,n,e,s){var h=(r+n*6)%6,i=Math.min(h,4-h,1);return Math.round(255*(s-s*e*Math.max(0,i)))}var a=function(r,n,e,s){n===void 0&&(n=1),e===void 0&&(e=1);var h=c(5,r,n,e),i=c(3,r,n,e),o=c(1,r,n,e);return s?s.setTo?s.setTo(h,i,o,s.alpha,!0):(s.r=h,s.g=i,s.b=o,s.color=d(h,i,o),s):{r:h,g:i,b:o,color:d(h,i,o)}};p.exports=a},70238:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987),c=function(a){var r=new d;a=a.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(i,o,f,l){return o+o+f+f+l+l});var n=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);if(n){var e=parseInt(n[1],16),s=parseInt(n[2],16),h=parseInt(n[3],16);r.setTo(e,s,h)}return r};p.exports=c},89528:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?t+(d-t)*6*c:c<.5?d:c<.6666666666666666?t+(d-t)*(.6666666666666666-c)*6:t};p.exports=C},30100:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987),c=t(90664),a=function(r){var n=c(r);return new d(n.r,n.g,n.b,n.a)};p.exports=a},90664:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:t&255}:{a:255,r:t>>16&255,g:t>>8&255,b:t&255}};p.exports=C},13699:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(28915),c=function(n,e,s,h,i,o,f,l){f===void 0&&(f=100),l===void 0&&(l=0);var u=l/f;return{r:d(n,h,u),g:d(e,i,u),b:d(s,o,u)}},a=function(n,e,s,h){return s===void 0&&(s=100),h===void 0&&(h=0),c(n.r,n.g,n.b,e.r,e.g,e.b,s,h)},r=function(n,e,s,h,i,o){return i===void 0&&(i=100),o===void 0&&(o=0),c(n.r,n.g,n.b,e,s,h,i,o)};p.exports={RGBWithRGB:c,ColorWithRGB:r,ColorWithColor:a}},68957:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987),c=function(a){return new d(a.r,a.g,a.b,a.a)};p.exports=c},87388:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987),c=function(a){var r=new d,n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(a.toLowerCase());if(n){var e=parseInt(n[1],10),s=parseInt(n[2],10),h=parseInt(n[3],10),i=n[4]!==void 0?parseFloat(n[4]):1;r.setTo(e,s,h,i*255)}return r};p.exports=c},87837:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){a===void 0&&(a={h:0,s:0,v:0}),t/=255,d/=255,c/=255;var r=Math.min(t,d,c),n=Math.max(t,d,c),e=n-r,s=0,h=n===0?0:e/n,i=n;return n!==r&&(n===t?s=(d-c)/e+(d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62957),c=function(a,r,n,e,s){return e===void 0&&(e=255),s===void 0&&(s="#"),s==="#"?"#"+((1<<24)+(a<<16)+(r<<8)+n).toString(16).slice(1,7):"0x"+d(e)+d(a)+d(r)+d(n)};p.exports=c},85386:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30976),c=t(40987),a=function(r,n){return r===void 0&&(r=0),n===void 0&&(n=255),new c(d(r,n),d(r,n),d(r,n))};p.exports=a},80333:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70238),c=t(30100),a=t(68957),r=t(87388),n=function(e){var s=typeof e;switch(s){case"string":return e.substr(0,3).toLowerCase()==="rgb"?r(e):d(e);case"number":return c(e);case"object":return a(e)}};p.exports=n},3956:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40987);d.ColorSpectrum=t(92728),d.ColorToRGBA=t(91588),d.ComponentToHex=t(62957),d.GetColor=t(37589),d.GetColor32=t(1e3),d.HexStringToColor=t(70238),d.HSLToColor=t(62183),d.HSVColorWheel=t(27939),d.HSVToRGB=t(7537),d.HueToComponent=t(89528),d.IntegerToColor=t(30100),d.IntegerToRGB=t(90664),d.Interpolate=t(13699),d.ObjectToColor=t(68957),d.RandomRGB=t(85386),d.RGBStringToColor=t(87388),d.RGBToHSV=t(87837),d.RGBToString=t(75723),d.ValueToColor=t(80333),p.exports=d},27460:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Align:t(71926),BaseShader:t(73894),Bounds:t(58724),Canvas:t(26253),Color:t(3956),ColorMatrix:t(89422),Masks:t(69781),RGB:t(51767)}},6858:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(39429),a=new d({initialize:function(n,e,s,h,i,o){e||(e=n.sys.make.image({x:s,y:h,key:i,frame:o,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(r){this.bitmapMask=r},preRenderWebGL:function(r,n,e){r.pipelines.BITMAPMASK_PIPELINE.beginMask(this,n,e)},postRenderWebGL:function(r,n,e){r.pipelines.BITMAPMASK_PIPELINE.endMask(this,n,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});c.register("bitmapMask",function(r,n,e,s,h){return new a(this.scene,r,n,e,s,h)}),p.exports=a},80661:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n){this.geometryMask=n,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(a){return this.geometryMask=a,this},setInvertAlpha:function(a){return a===void 0&&(a=!0),this.invertAlpha=a,this},preRenderWebGL:function(a,r,n){var e=a.gl;a.flush(),a.maskStack.length===0&&(e.enable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),a.maskCount=0),a.currentCameraMask.mask!==this&&(a.currentMask.mask=this),a.maskStack.push({mask:this,camera:n}),this.applyStencil(a,n,!0),a.maskCount++},applyStencil:function(a,r,n){var e=a.gl,s=this.geometryMask,h=a.maskCount,i=255;e.colorMask(!1,!1,!1,!1),n?(e.stencilFunc(e.EQUAL,h,i),e.stencilOp(e.KEEP,e.KEEP,e.INCR),h++):(e.stencilFunc(e.EQUAL,h+1,i),e.stencilOp(e.KEEP,e.KEEP,e.DECR)),this.level=h,s.renderWebGL(a,s,r),a.flush(),e.colorMask(!0,!0,!0,!0),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),this.invertAlpha?e.stencilFunc(e.NOTEQUAL,h,i):e.stencilFunc(e.EQUAL,h,i)},postRenderWebGL:function(a){var r=a.gl;a.maskStack.pop(),a.maskCount--,a.flush();var n=a.currentMask;if(a.maskStack.length===0)n.mask=null,r.disable(r.STENCIL_TEST);else{var e=a.maskStack[a.maskStack.length-1];e.mask.applyStencil(a,e.camera,!1),a.currentCameraMask.mask!==e.mask?(n.mask=e.mask,n.camera=e.camera):n.mask=null}},preRenderCanvas:function(a,r,n){var e=this.geometryMask;a.currentContext.save(),e.renderCanvas(a,e,n,null,null,!0),a.currentContext.clip()},postRenderCanvas:function(a){a.currentContext.restore()},destroy:function(){this.geometryMask=null}});p.exports=c},69781:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BitmapMask:t(6858),GeometryMask:t(80661)}},73894:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s){(!n||n==="")&&(n=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join(` +`)),(!e||e==="")&&(e=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join(` +`)),s===void 0&&(s=null),this.key=r,this.fragmentSrc=n,this.vertexSrc=e,this.uniforms=s}});p.exports=c},40366:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c;if(d)typeof d=="string"?c=document.getElementById(d):typeof d=="object"&&d.nodeType===1&&(c=d);else if(t.parentElement||d===null)return t;return c||(c=document.body),c.appendChild(t),t};p.exports=C},83719:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40366),c=function(a){var r=a.config;if(!(!r.parent||!r.domCreateContainer)){var n=document.createElement("div");n.style.cssText=["display: block;","width: "+a.scale.width+"px;","height: "+a.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+r.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),a.domContainer=n,d(n,r.parent)}};p.exports=c},57264:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25892),c=function(a){if(document.readyState==="complete"||document.readyState==="interactive"){a();return}var r=function(){document.removeEventListener("deviceready",r,!0),document.removeEventListener("DOMContentLoaded",r,!0),window.removeEventListener("load",r,!0),a()};document.body?d.cordova?document.addEventListener("deviceready",r,!1):(document.addEventListener("DOMContentLoaded",r,!0),window.addEventListener("load",r,!0)):window.setTimeout(r,20)};p.exports=c},57811:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){if(!t)return window.innerHeight;var d=Math.abs(window.orientation),c={w:0,h:0},a=document.createElement("div");return a.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(a),c.w=d===90?a.offsetHeight:window.innerWidth,c.h=d===90?window.innerWidth:a.offsetHeight,document.documentElement.removeChild(a),a=null,Math.abs(window.orientation)!==90?c.h:c.w};p.exports=C},45818:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13560),c=function(a,r){var n=window.screen,e=n?n.orientation||n.mozOrientation||n.msOrientation:!1;if(e&&typeof e.type=="string")return e.type;if(typeof e=="string")return e;if(typeof window.orientation=="number")return window.orientation===0||window.orientation===180?d.ORIENTATION.PORTRAIT:d.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return d.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return d.ORIENTATION.LANDSCAPE}else return r>a?d.ORIENTATION.PORTRAIT:d.ORIENTATION.LANDSCAPE};p.exports=c},74403:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d;return t!==""&&(typeof t=="string"?d=document.getElementById(t):t&&t.nodeType===1&&(d=t)),d||(d=document.body),d};p.exports=C},56836:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d="";try{if(window.DOMParser){var c=new DOMParser;d=c.parseFromString(t,"text/xml")}else d=new ActiveXObject("Microsoft.XMLDOM"),d.loadXML(t)}catch{d=null}return!d||!d.documentElement||d.getElementsByTagName("parsererror").length?null:d};p.exports=C},35846:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){t.parentNode&&t.parentNode.removeChild(t)};p.exports=C},43092:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(29747),a=new d({initialize:function(){this.isRunning=!1,this.callback=c,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var n=this;this.step=function e(s){n.callback(s),n.isRunning&&(n.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){n.isRunning&&(n.timeOutID=window.setTimeout(e,n.delay)),n.callback(window.performance.now())}},start:function(r,n,e){this.isRunning||(this.callback=r,this.isSetTimeOut=n,this.delay=e,this.isRunning=!0,this.timeOutID=n?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=c}});p.exports=a},84902:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={AddToDOM:t(40366),DOMContentLoaded:t(57264),GetInnerHeight:t(57811),GetScreenOrientation:t(45818),GetTarget:t(74403),ParseXML:t(56836),RemoveFromDOM:t(35846),RequestAnimationFrame:t(43092)};p.exports=d},47565:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(37277),r=new d({Extends:c,initialize:function(){c.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});a.register("EventEmitter",r,"events"),p.exports=r},93055:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={EventEmitter:t(47565)}},20122:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s){s===void 0&&(s=1),c.call(this,a.BARREL,e),this.amount=s}});p.exports=r},32251:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l){h===void 0&&(h=1),i===void 0&&(i=1),o===void 0&&(o=1),f===void 0&&(f=1),l===void 0&&(l=4),c.call(this,a.BLOOM,e),this.steps=l,this.offsetX=h,this.offsetY=i,this.blurStrength=o,this.strength=f,this.glcolor=[1,1,1],s!=null&&(this.color=s)},color:{get:function(){var n=this.glcolor;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}}});p.exports=r},9047:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l){s===void 0&&(s=0),h===void 0&&(h=2),i===void 0&&(i=2),o===void 0&&(o=1),l===void 0&&(l=4),c.call(this,a.BLUR,e),this.quality=s,this.x=h,this.y=i,this.steps=l,this.strength=o,this.glcolor=[1,1,1],f!=null&&(this.color=f)},color:{get:function(){var n=this.glcolor;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}}});p.exports=r},27885:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l,u){s===void 0&&(s=.5),h===void 0&&(h=1),i===void 0&&(i=.2),o===void 0&&(o=!1),f===void 0&&(f=1),l===void 0&&(l=1),u===void 0&&(u=1),c.call(this,a.BOKEH,e),this.radius=s,this.amount=h,this.contrast=i,this.isTiltShift=o,this.strength=u,this.blurX=f,this.blurY=l}});p.exports=r},12578:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f){s===void 0&&(s=8),o===void 0&&(o=1),f===void 0&&(f=.005),c.call(this,a.CIRCLE,e),this.scale=o,this.feather=f,this.thickness=s,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],h!=null&&(this.color=h),i!=null&&(this.backgroundColor=i)},color:{get:function(){var n=this.glcolor;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}},backgroundColor:{get:function(){var n=this.glcolor2;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor2;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(n){this.glcolor2[3]=n}}});p.exports=r},15802:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(89422),a=t(14811),r=new d({Extends:c,initialize:function(e){c.call(this),this.type=a.COLOR_MATRIX,this.gameObject=e,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});p.exports=r},72898:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n){this.type=r,this.gameObject=n,this.active=!0},setActive:function(a){return this.active=a,this},destroy:function(){this.gameObject=null,this.active=!1}});p.exports=c},44553:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i){s===void 0&&(s="__WHITE"),h===void 0&&(h=.005),i===void 0&&(i=.005),c.call(this,a.DISPLACEMENT,e),this.x=h,this.y=i,this.glTexture,this.setTexture(s)},setTexture:function(n){var e=this.gameObject.scene.sys.textures.getFrame(n);return e&&(this.glTexture=e.glTexture),this}});p.exports=r},68531:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o){h===void 0&&(h=4),i===void 0&&(i=0),o===void 0&&(o=!1),c.call(this,a.GLOW,e),this.outerStrength=h,this.innerStrength=i,this.knockout=o,this.glcolor=[1,1,1,1],s!==void 0&&(this.color=s)},color:{get:function(){var n=this.glcolor;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}}});p.exports=r},37102:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l,u,v){i===void 0&&(i=.2),o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=1),v===void 0&&(v=0),c.call(this,a.GRADIENT,e),this.alpha=i,this.size=v,this.fromX=o,this.fromY=f,this.toX=l,this.toY=u,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],s!=null&&(this.color1=s),h!=null&&(this.color2=h)},color1:{get:function(){var n=this.glcolor1;return(n[0]<<16)+(n[1]<<8)+(n[2]|0)},set:function(n){var e=this.glcolor1;e[0]=n>>16&255,e[1]=n>>8&255,e[2]=n&255}},color2:{get:function(){var n=this.glcolor2;return(n[0]<<16)+(n[1]<<8)+(n[2]|0)},set:function(n){var e=this.glcolor2;e[0]=n>>16&255,e[1]=n>>8&255,e[2]=n&255}}});p.exports=r},86886:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s){s===void 0&&(s=1),c.call(this,a.PIXELATE,e),this.amount=s}});p.exports=r},92322:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l,u){s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=.1),o===void 0&&(o=1),l===void 0&&(l=6),u===void 0&&(u=1),c.call(this,a.SHADOW,e),this.x=s,this.y=h,this.decay=i,this.power=o,this.glcolor=[0,0,0,1],this.samples=l,this.intensity=u,f!==void 0&&(this.color=f)},color:{get:function(){var n=this.glcolor;return(n[0]*255<<16)+(n[1]*255<<8)+(n[2]*255|0)},set:function(n){var e=this.glcolor;e[0]=(n>>16&255)/255,e[1]=(n>>8&255)/255,e[2]=(n&255)/255}}});p.exports=r},39563:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o){s===void 0&&(s=.5),h===void 0&&(h=.5),i===void 0&&(i=3),o===void 0&&(o=!1),c.call(this,a.SHINE,e),this.speed=s,this.lineWidth=h,this.gradient=i,this.reveal=o}});p.exports=r},56448:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o){s===void 0&&(s=.5),h===void 0&&(h=.5),i===void 0&&(i=.5),o===void 0&&(o=.5),c.call(this,a.VIGNETTE,e),this.x=s,this.y=h,this.radius=i,this.strength=o}});p.exports=r},38433:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72898),a=t(14811),r=new d({Extends:c,initialize:function(e,s,h,i,o){s===void 0&&(s=.1),h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=!1),c.call(this,a.WIPE,e),this.progress=0,this.wipeWidth=s,this.direction=h,this.axis=i,this.reveal=o}});p.exports=r},14811:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19};p.exports=C},66064:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=t(14811),a={Barrel:t(20122),Controller:t(72898),Bloom:t(32251),Blur:t(9047),Bokeh:t(27885),Circle:t(12578),ColorMatrix:t(15802),Displacement:t(44553),Glow:t(68531),Gradient:t(37102),Pixelate:t(86886),Shadow:t(92322),Shine:t(39563),Vignette:t(56448),Wipe:t(38433)};a=d(!1,a,c),p.exports=a},25305:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(23568),a=function(r,n,e){n.x=c(e,"x",0),n.y=c(e,"y",0),n.depth=c(e,"depth",0),n.flipX=c(e,"flipX",!1),n.flipY=c(e,"flipY",!1);var s=c(e,"scale",null);typeof s=="number"?n.setScale(s):s!==null&&(n.scaleX=c(s,"x",1),n.scaleY=c(s,"y",1));var h=c(e,"scrollFactor",null);typeof h=="number"?n.setScrollFactor(h):h!==null&&(n.scrollFactorX=c(h,"x",1),n.scrollFactorY=c(h,"y",1)),n.rotation=c(e,"rotation",0);var i=c(e,"angle",null);i!==null&&(n.angle=i),n.alpha=c(e,"alpha",1);var o=c(e,"origin",null);if(typeof o=="number")n.setOrigin(o);else if(o!==null){var f=c(o,"x",.5),l=c(o,"y",.5);n.setOrigin(f,l)}n.blendMode=c(e,"blendMode",d.NORMAL),n.visible=c(e,"visible",!0);var u=c(e,"add",!0);return u&&r.sys.displayList.add(n),n.preUpdate&&r.sys.updateList.add(n),n};p.exports=a},13059:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23568),c=function(a,r){var n=d(r,"anims",null);if(n===null)return a;if(typeof n=="string")a.anims.play(n);else if(typeof n=="object"){var e=a.anims,s=d(n,"key",void 0);if(s){var h=d(n,"startFrame",void 0),i=d(n,"delay",0),o=d(n,"repeat",0),f=d(n,"repeatDelay",0),l=d(n,"yoyo",!1),u=d(n,"play",!1),v=d(n,"delayedPlay",0),m={key:s,delay:i,repeat:o,repeatDelay:f,yoyo:l,startFrame:h};u?e.play(m):v>0?e.playAfterDelay(m,v):e.load(m)}}return a};p.exports=c},8050:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(73162),a=t(37277),r=t(51708),n=t(44594),e=t(19186),s=new d({Extends:c,initialize:function(i){c.call(this,i),this.sortChildrenFlag=!1,this.scene=i,this.systems=i.sys,this.events=i.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.events.once(n.DESTROY,this.destroy,this)},addChildCallback:function(h){h.displayList&&h.displayList!==this&&h.removeFromDisplayList(),h.parentContainer&&h.parentContainer.remove(h),h.displayList||(this.queueDepthSort(),h.displayList=this,h.emit(r.ADDED_TO_SCENE,h,this.scene),this.events.emit(n.ADDED_TO_SCENE,h,this.scene))},removeChildCallback:function(h){this.queueDepthSort(),h.displayList=null,h.emit(r.REMOVED_FROM_SCENE,h,this.scene),this.events.emit(n.REMOVED_FROM_SCENE,h,this.scene)},start:function(){this.events.once(n.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(e(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(h,i){return h._depth-i._depth},getChildren:function(){return this.list},shutdown:function(){for(var h=this.list;h.length;)h[0].destroy(!0);this.events.off(n.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(n.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});a.register("DisplayList",s,"displayList"),p.exports=s},95643:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(53774),a=t(45893),r=t(50792),n=t(51708),e=t(44594),s=new d({Extends:r,initialize:function(i,o){r.call(this),this.scene=i,this.displayList=null,this.type=o,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(n.ADDED_TO_SCENE,this.addedToScene,this),this.on(n.REMOVED_FROM_SCENE,this.removedFromScene,this),i.sys.queueDepthSort()},setActive:function(h){return this.active=h,this},setName:function(h){return this.name=h,this},setState:function(h){return this.state=h,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(h,i){return this.data||(this.data=new a(this)),this.data.set(h,i),this},incData:function(h,i){return this.data||(this.data=new a(this)),this.data.inc(h,i),this},toggleData:function(h){return this.data||(this.data=new a(this)),this.data.toggle(h),this},getData:function(h){return this.data||(this.data=new a(this)),this.data.get(h)},setInteractive:function(h,i,o){return this.scene.sys.input.enable(this,h,i,o),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return c(this)},willRender:function(h){var i=this.displayList&&this.displayList.active?this.displayList.willRender(h):!0;return!(!i||s.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&h.id)},getIndexList:function(){for(var h=this,i=this.parentContainer,o=[];i&&(o.unshift(i.getIndex(h)),h=i,i.parentContainer);)i=i.parentContainer;return this.displayList?o.unshift(this.displayList.getIndex(h)):o.unshift(this.scene.sys.displayList.getIndex(h)),o},addToDisplayList:function(h){return h===void 0&&(h=this.scene.sys.displayList),this.displayList&&this.displayList!==h&&this.removeFromDisplayList(),h.exists(this)||(this.displayList=h,h.add(this,!0),h.queueDepthSort(),this.emit(n.ADDED_TO_SCENE,this,this.scene),h.events.emit(e.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var h=this.displayList||this.scene.sys.displayList;return h&&h.exists(this)&&(h.remove(this,!0),h.queueDepthSort(),this.displayList=null,this.emit(n.REMOVED_FROM_SCENE,this,this.scene),h.events.emit(e.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(h){!this.scene||this.ignoreDestroy||(h===void 0&&(h=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(n.DESTROY,this,h),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});s.RENDER_MASK=15,p.exports=s},44603:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(37277),a=t(44594),r=new d({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});r.register=function(n,e){r.prototype.hasOwnProperty(n)||(r.prototype[n]=e)},r.remove=function(n){r.prototype.hasOwnProperty(n)&&delete r.prototype[n]},c.register("GameObjectCreator",r,"make"),p.exports=r},39429:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(37277),a=t(44594),r=new d({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},existing:function(n){return(n.renderCanvas||n.renderWebGL)&&this.displayList.add(n),n.preUpdate&&this.updateList.add(n),n},shutdown:function(){this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});r.register=function(n,e){r.prototype.hasOwnProperty(n)||(r.prototype[n]=e)},r.remove=function(n){r.prototype.hasOwnProperty(n)&&delete r.prototype[n]},c.register("GameObjectFactory",r,"add"),p.exports=r},91296:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61340),c=new d,a=new d,r=new d,n={camera:c,sprite:a,calc:r},e=function(s,h,i){var o=c,f=a,l=r;return f.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY),o.copyFrom(h.matrix),i?(o.multiplyWithOffset(i,-h.scrollX*s.scrollFactorX,-h.scrollY*s.scrollFactorY),f.e=s.x,f.f=s.y):(f.e-=h.scrollX*s.scrollFactorX,f.f-=h.scrollY*s.scrollFactorY),o.multiply(f,l),n};p.exports=e},45027:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(25774),a=t(37277),r=t(44594),n=new d({Extends:c,initialize:function(s){c.call(this),this.checkQueue=!0,this.scene=s,this.systems=s.sys,s.sys.events.once(r.BOOT,this.boot,this),s.sys.events.on(r.START,this.start,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){var e=this.systems.events;e.on(r.PRE_UPDATE,this.update,this),e.on(r.UPDATE,this.sceneUpdate,this),e.once(r.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(e,s){for(var h=this._active,i=h.length,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n,e,s,h,i,o,f,l,u,v){var m=c.x-d.displayOriginX+r,x=c.y-d.displayOriginY+n,g=m+c.w,y=x+c.h,T=e.getXRound(m,x,s),E=e.getYRound(m,x,s),P=e.getXRound(m,y,s),R=e.getYRound(m,y,s),M=e.getXRound(g,y,s),L=e.getYRound(g,y,s),O=e.getXRound(g,x,s),D=e.getYRound(g,x,s);t.batchQuad(d,T,E,P,R,M,L,O,D,a.u0,a.v0,a.u1,a.v1,h,i,o,f,l,u,v)};p.exports=C},53048:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){if(c===void 0&&(c=!1),a===void 0)return a={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0},a;var r=t.text,n=r.length,e=t.maxWidth,s=t.wordWrapCharCode,h=Number.MAX_VALUE,i=Number.MAX_VALUE,o=0,f=0,l=t.fontData.chars,u=t.fontData.lineHeight,v=t.letterSpacing,m=t.lineSpacing,x=0,g=0,y=0,T=null,E=t._align,P=0,R=0,M=t.fontSize/t.fontData.size,L=M*t.scaleX,O=M*t.scaleY,D=null,I=0,V=[],X=Number.MAX_VALUE,H=0,G=0,U=0,F,B=[],N=[],z=null;if(e>0){for(F=0;Fe||et>e?(Q.push($.i-1),$.cr?(Q.push($.i+$.word.length),Z=0,K=null):K=$):$.cr&&(Q.push($.i+$.word.length),Z=0,K=null)}var nt=function(pt,At,Mt){return pt.substr(0,At)+Mt+pt.substr(At+1)};for(F=Q.length-1;F>=0;F--)r=nt(r,Q[F],` +`);a.wrappedText=r,n=r.length,B=[],z=null}var at=0;for(F=0;FH&&(H=U),UP&&(h=P),i>R&&(i=R);var tt=P+T.xAdvance,st=R+u;oH&&(H=U),U0)for(var ot=0;ot{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(21859),c=function(a,r,n,e,s,h,i){var o=a.sys.textures.get(n),f=o.get(e),l=a.sys.cache.xml.get(s);if(f&&l){var u=d(l,f,h,i,o);return a.sys.cache.bitmapFont.add(r,{data:u,texture:n,frame:e,fromAtlas:!0}),!0}else return!1};p.exports=c},6925:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35154),c=function(a,r){var n=r.width,e=r.height,s=Math.floor(n/2),h=Math.floor(e/2),i=d(r,"chars","");if(i!==""){var o=d(r,"image",""),f=a.sys.textures.getFrame(o),l=f.cutX,u=f.cutY,v=f.source.width,m=f.source.height,x=d(r,"offset.x",0),g=d(r,"offset.y",0),y=d(r,"spacing.x",0),T=d(r,"spacing.y",0),E=d(r,"lineSpacing",0),P=d(r,"charsPerRow",null);P===null&&(P=v/n,P>i.length&&(P=i.length));for(var R=x,M=g,L={retroFont:!0,font:o,size:n,lineHeight:e+E,chars:{}},O=0,D=0;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(d,c){return parseInt(d.getAttribute(c),10)}var t=function(d,c,a,r,n){a===void 0&&(a=0),r===void 0&&(r=0);var e=c.cutX,s=c.cutY,h=c.source.width,i=c.source.height,o=c.sourceIndex,f={},l=d.getElementsByTagName("info")[0],u=d.getElementsByTagName("common")[0];f.font=l.getAttribute("face"),f.size=C(l,"size"),f.lineHeight=C(u,"lineHeight")+r,f.chars={};var v=d.getElementsByTagName("char"),m=c!==void 0&&c.trimmed;if(m)var x=c.height,g=c.width;for(var y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87662),c=t(79291),a={Parse:t(6925)};a=c(!1,a,d),p.exports=a},87662:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ`,TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:`ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' `,TEXT_SET7:`AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39`,TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:`ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!`,TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:`ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789`};p.exports=C},2638:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22186),c=t(83419),a=t(12310),r=new c({Extends:d,Mixins:[a],initialize:function(e,s,h,i,o,f,l){d.call(this,e,s,h,i,o,f,l),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(n,e){return this.cropWidth=n,this.cropHeight=e,this},setDisplayCallback:function(n){return this.displayCallback=n,this},setScrollX:function(n){return this.scrollX=n,this},setScrollY:function(n){return this.scrollY=n,this}});p.exports=r},86741:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20926),c=function(a,r,n,e){var s=r._text,h=s.length,i=a.currentContext;if(!(h===0||!d(a,i,r,n,e))){n.addToRenderList(r);var o=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.displayCallback,l=r.callbackData,u=r.fontData.chars,v=r.fontData.lineHeight,m=r._letterSpacing,x=0,g=0,y=0,T=null,E=0,P=0,R=0,M=0,L=0,O=0,D=null,I=0,V=r.frame.source.image,X=o.cutX,H=o.cutY,G=0,U=0,F=r._fontSize/r.fontData.size,B=r._align,N=0,z=0;r.getTextBounds(!1);var Y=r._bounds.lines;B===1?z=(Y.longest-Y.lengths[0])/2:B===2&&(z=Y.longest-Y.lengths[0]),i.translate(-r.displayOriginX,-r.displayOriginY);var K=n.roundPixels;r.cropWidth>0&&r.cropHeight>0&&(i.beginPath(),i.rect(0,0,r.cropWidth,r.cropHeight),i.clip());for(var Z=0;Z{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2638),c=t(25305),a=t(44603),r=t(23568);a.register("dynamicBitmapText",function(n,e){n===void 0&&(n={});var s=r(n,"font",""),h=r(n,"text",""),i=r(n,"size",!1),o=new d(this.scene,0,0,s,h,i);return e!==void 0&&(n.add=e),c(this.scene,o,n),o})},72566:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2638),c=t(39429);c.register("dynamicBitmapText",function(a,r,n,e,s){return this.displayList.add(new d(this.scene,a,r,n,e,s))})},12310:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(73482),a=t(86741),p.exports={renderWebGL:c,renderCanvas:a}},73482:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(61340),a=t(70554),r=new c,n=function(e,s,h,i){var o=s.text,f=o.length;if(f!==0){h.addToRenderList(s);var l=e.pipelines.set(s.pipeline,s),u=d(s,h,i);e.pipelines.preBatch(s);var v=u.sprite,m=u.calc,x=r,g=s.cropWidth>0||s.cropHeight>0;g&&(l.flush(),e.pushScissor(m.tx,m.ty,s.cropWidth*m.scaleX,s.cropHeight*m.scaleY));var y=s.frame,T=y.glTexture,E=s.tintFill,P=a.getTintAppendFloatAlpha(s.tintTopLeft,h.alpha*s._alphaTL),R=a.getTintAppendFloatAlpha(s.tintTopRight,h.alpha*s._alphaTR),M=a.getTintAppendFloatAlpha(s.tintBottomLeft,h.alpha*s._alphaBL),L=a.getTintAppendFloatAlpha(s.tintBottomRight,h.alpha*s._alphaBR),O=l.setGameObject(s),D=0,I=0,V=0,X=0,H=s.letterSpacing,G,U=0,F=0,B,N=s.scrollX,z=s.scrollY,Y=s.fontData,K=Y.chars,Z=Y.lineHeight,Q=s.fontSize/Y.size,$=0,j=s._align,k=0,_=0,q=s.getTextBounds(!1);s.maxWidth>0&&(o=q.wrappedText,f=o.length);var et=s._bounds.lines;j===1?_=(et.longest-et.lengths[0])/2:j===2&&(_=et.longest-et.lengths[0]);for(var nt=h.roundPixels,at=s.displayCallback,rt=s.callbackData,tt=0;tt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(45319),a=t(31401),r=t(95643),n=t(53048),e=t(61327),s=t(21859),h=t(87841),i=t(18658),o=new d({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Texture,a.Tint,a.Transform,a.Visible,i],initialize:function(l,u,v,m,x,g,y){x===void 0&&(x=""),y===void 0&&(y=0),r.call(this,l,"BitmapText"),this.font=m;var T=this.scene.sys.cache.bitmapFont.get(m);T||console.warn("Invalid BitmapText key: "+m),this.fontData=T.data,this._text="",this._fontSize=g||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=y,this._bounds=n(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=T.fromAtlas,this.setTexture(T.texture,T.frame),this.setPosition(u,v),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(x)},setLeftAlign:function(){return this._align=o.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=o.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=o.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(f){return this._fontSize=f,this._dirty=!0,this},setLetterSpacing:function(f){return f===void 0&&(f=0),this._letterSpacing=f,this._dirty=!0,this},setLineSpacing:function(f){return f===void 0&&(f=0),this.lineSpacing=f,this},setText:function(f){return!f&&f!==0&&(f=""),Array.isArray(f)&&(f=f.join(` +`)),f!==this.text&&(this._text=f.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(f,l,u,v){return f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=.5),this.dropShadowX=f,this.dropShadowY=l,this.dropShadowColor=u,this.dropShadowAlpha=v,this},setCharacterTint:function(f,l,u,v,m,x,g){f===void 0&&(f=0),l===void 0&&(l=1),u===void 0&&(u=!1),v===void 0&&(v=-1),m===void 0&&(m=v,x=v,g=v);var y=this.text.length;l===-1&&(l=y),f<0&&(f=y+f),f=c(f,0,y-1);for(var T=c(f+l,f,y),E=this.charColors,P=f;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20926),c=function(a,r,n,e){var s=r._text,h=s.length,i=a.currentContext;if(!(h===0||!d(a,i,r,n,e))){n.addToRenderList(r);var o=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.fontData.chars,l=r.fontData.lineHeight,u=r._letterSpacing,v=r._lineSpacing,m=0,x=0,g=0,y=null,T=0,E=0,P=0,R=0,M=0,L=0,O=null,D=0,I=o.source.image,V=o.cutX,X=o.cutY,H=r._fontSize/r.fontData.size,G=r._align,U=0,F=0,B=r.getTextBounds(!1);r.maxWidth>0&&(s=B.wrappedText,h=s.length);var N=r._bounds.lines;G===1?F=(N.longest-N.lengths[0])/2:G===2&&(F=N.longest-N.lengths[0]),i.translate(-r.displayOriginX,-r.displayOriginY);for(var z=n.roundPixels,Y=0;Y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22186),c=t(25305),a=t(44603),r=t(23568),n=t(35154);a.register("bitmapText",function(e,s){e===void 0&&(e={});var h=n(e,"font",""),i=r(e,"text",""),o=r(e,"size",!1),f=n(e,"align",0),l=new d(this.scene,0,0,h,i,o,f);return s!==void 0&&(e.add=s),c(this.scene,l,e),l})},34914:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22186),c=t(39429);c.register("bitmapText",function(a,r,n,e,s,h){return this.displayList.add(new d(this.scene,a,r,n,e,s,h))})},18658:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(33590),a=t(37289),p.exports={renderWebGL:c,renderCanvas:a}},33590:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(3217),c=t(91296),a=t(70554),r=function(n,e,s,h){var i=e._text,o=i.length;if(o!==0){s.addToRenderList(e);var f=n.pipelines.set(e.pipeline,e),l=c(e,s,h).calc;n.pipelines.preBatch(e);var u=s.roundPixels,v=s.alpha,m=e.charColors,x=e.tintFill,g=a.getTintAppendFloatAlpha,y=g(e.tintTopLeft,v*e._alphaTL),T=g(e.tintTopRight,v*e._alphaTR),E=g(e.tintBottomLeft,v*e._alphaBL),P=g(e.tintBottomRight,v*e._alphaBR),R=e.frame.glTexture,M=f.setGameObject(e),L=e.getTextBounds(!1),O,D,I,V=L.characters,X=e.dropShadowX,H=e.dropShadowY,G=X!==0||H!==0;if(G){var U=e.dropShadowColor,F=e.dropShadowAlpha,B=g(U,v*F*e._alphaTL),N=g(U,v*F*e._alphaTR),z=g(U,v*F*e._alphaBL),Y=g(U,v*F*e._alphaBR);for(O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(48011),c=t(46590),a=t(83419),r=t(31401),n=t(4327),e=t(95643),s=t(73162),h=new a({Extends:e,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Size,r.Texture,r.Transform,r.Visible,d],initialize:function(o,f,l,u,v){e.call(this,o,"Blitter"),this.setTexture(u,v),this.setPosition(f,l),this.initPipeline(),this.initPostPipeline(),this.children=new s,this.renderList=[],this.dirty=!1},create:function(i,o,f,l,u){l===void 0&&(l=!0),u===void 0&&(u=this.children.length),f===void 0?f=this.frame:f instanceof n||(f=this.texture.get(f));var v=new c(this,i,o,f,l);return this.children.addAt(v,u,!1),this.dirty=!0,v},createFromCallback:function(i,o,f,l){for(var u=this.createMultiple(o,f,l),v=0;v0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});p.exports=h},72396:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=d.getRenderList();if(r.length!==0){var n=t.currentContext,e=c.alpha*d.alpha;if(e!==0){c.addToRenderList(d),n.globalCompositeOperation=t.blendModes[d.blendMode],n.imageSmoothingEnabled=!d.frame.source.scaleMode;var s=d.x-c.scrollX*d.scrollFactorX,h=d.y-c.scrollY*d.scrollFactorY;n.save(),a&&a.copyToContext(n);for(var i=c.roundPixels,o=0;o0&&v.height>0&&(n.save(),n.translate(f.x+s,f.y+h),n.scale(g,y),n.drawImage(u.source.image,v.x,v.y,v.width,v.height,m,x,v.width,v.height),n.restore())):(i&&(m=Math.round(m),x=Math.round(x)),v.width>0&&v.height>0&&n.drawImage(u.source.image,v.x,v.y,v.width,v.height,m+f.x+s,x+f.y+h,v.width,v.height)))}n.restore()}}};p.exports=C},9403:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6107),c=t(25305),a=t(44603),r=t(23568);a.register("blitter",function(n,e){n===void 0&&(n={});var s=r(n,"key",null),h=r(n,"frame",null),i=new d(this.scene,0,0,s,h);return e!==void 0&&(n.add=e),c(this.scene,i,n),i})},12709:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6107),c=t(39429);c.register("blitter",function(a,r,n,e){return this.displayList.add(new d(this.scene,a,r,n,e))})},48011:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(99485),a=t(72396),p.exports={renderWebGL:c,renderCanvas:a}},99485:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61340),c=t(70554),a=new d,r=function(n,e,s,h){var i=e.getRenderList(),o=s.alpha*e.alpha;if(!(i.length===0||o===0)){s.addToRenderList(e);var f=n.pipelines.set(this.pipeline,e),l=s.scrollX*e.scrollFactorX,u=s.scrollY*e.scrollFactorY,v=a.copyFrom(s.matrix);h&&(v.multiplyWithOffset(h,-l,-u),l=0,u=0);var m=e.x-l,x=e.y-u,g=-1,y=!1;n.pipelines.preBatch(e);for(var T=0;T{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(4327),a=new d({initialize:function(n,e,s,h,i){this.parent=n,this.x=e,this.y=s,this.frame=h,this.data={},this.tint=16777215,this._visible=i,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(r){return r===void 0?this.frame=this.parent.frame:r instanceof c&&r.texture===this.parent.texture?this.frame=r:this.frame=this.parent.texture.get(r),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(r,n,e){return this.x=r,this.y=n,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,e&&this.setFrame(e),this},setPosition:function(r,n){return this.x=r,this.y=n,this},setFlipX:function(r){return this.flipX=r,this},setFlipY:function(r){return this.flipY=r,this},setFlip:function(r,n){return this.flipX=r,this.flipY=n,this},setVisible:function(r){return this.visible=r,this},setAlpha:function(r){return this.alpha=r,this},setTint:function(r){return this.tint=r,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(r){this.parent.dirty|=this._visible!==r,this._visible=r}},alpha:{get:function(){return this._alpha},set:function(r){this.parent.dirty|=this._alpha>0!=r>0,this._alpha=r}}});p.exports=a},16005:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=2,a={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(r,n,e,s){return r===void 0&&(r=1),n===void 0?this.alpha=r:(this._alphaTL=d(r,0,1),this._alphaTR=d(n,0,1),this._alphaBL=d(e,0,1),this._alphaBR=d(s,0,1)),this},alpha:{get:function(){return this._alpha},set:function(r){var n=d(r,0,1);this._alpha=n,this._alphaTL=n,this._alphaTR=n,this._alphaBL=n,this._alphaBR=n,n===0?this.renderFlags&=~c:this.renderFlags|=c}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(r){var n=d(r,0,1);this._alphaTL=n,n!==0&&(this.renderFlags|=c)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(r){var n=d(r,0,1);this._alphaTR=n,n!==0&&(this.renderFlags|=c)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(r){var n=d(r,0,1);this._alphaBL=n,n!==0&&(this.renderFlags|=c)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(r){var n=d(r,0,1);this._alphaBR=n,n!==0&&(this.renderFlags|=c)}}};p.exports=a},88509:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=2,a={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(r){return r===void 0&&(r=1),this.alpha=r,this},alpha:{get:function(){return this._alpha},set:function(r){var n=d(r,0,1);this._alpha=n,n===0?this.renderFlags&=~c:this.renderFlags|=c}}};p.exports=a},90065:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c={_blendMode:d.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(a){typeof a=="string"&&(a=d[a]),a|=0,a>=-1&&(this._blendMode=a)}},setBlendMode:function(a){return this.blendMode=a,this}};p.exports=c},94215:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,d){return this.width=t,this.height=d,this},setDisplaySize:function(t,d){return this.displayWidth=t,this.displayHeight=d,this}};p.exports=C},61683:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={texture:null,frame:null,isCropped:!1,setCrop:function(t,d,c,a){if(t===void 0)this.isCropped=!1;else if(this.frame){if(typeof t=="number")this.frame.setCropUVs(this._crop,t,d,c,a,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};p.exports=C},89272:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return t===void 0&&(t=0),this.depth=t,this}};p.exports=C},47059:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(66064),a=t(19133),r=new d({initialize:function(e,s){this.gameObject=e,this.isPost=s,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(n){return n===void 0&&(n=0),this.padding=n,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(n){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,n!==void 0&&(this.padding=n),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var n=this.list,e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,d){return this.flipX=t,this.flipY=d,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}};p.exports=C},8004:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=t(11520),a=t(26099),r={prepareBoundsOutput:function(n,e){if(e===void 0&&(e=!1),this.rotation!==0&&c(n,this.x,this.y,this.rotation),e&&this.parentContainer){var s=this.parentContainer.getBoundsTransformMatrix();s.transformPoint(n.x,n.y,n)}return n},getCenter:function(n,e){return n===void 0&&(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,n.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(n,e)},getTopLeft:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX,n.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(n,e)},getTopCenter:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,n.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(n,e)},getTopRight:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth,n.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(n,e)},getLeftCenter:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX,n.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(n,e)},getRightCenter:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth,n.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(n,e)},getBottomLeft:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX,n.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(n,e)},getBottomCenter:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,n.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(n,e)},getBottomRight:function(n,e){return n||(n=new a),n.x=this.x-this.displayWidth*this.originX+this.displayWidth,n.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(n,e)},getBounds:function(n){n===void 0&&(n=new d);var e,s,h,i,o,f,l,u;if(this.parentContainer){var v=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(n),v.transformPoint(n.x,n.y,n),e=n.x,s=n.y,this.getTopRight(n),v.transformPoint(n.x,n.y,n),h=n.x,i=n.y,this.getBottomLeft(n),v.transformPoint(n.x,n.y,n),o=n.x,f=n.y,this.getBottomRight(n),v.transformPoint(n.x,n.y,n),l=n.x,u=n.y}else this.getTopLeft(n),e=n.x,s=n.y,this.getTopRight(n),h=n.x,i=n.y,this.getBottomLeft(n),o=n.x,f=n.y,this.getBottomRight(n),l=n.x,u=n.y;return n.x=Math.min(e,h,o,l),n.y=Math.min(s,i,f,u),n.width=Math.max(e,h,o,l)-n.x,n.height=Math.max(s,i,f,u)-n.y,n}};p.exports=r},8573:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6858),c=t(80661),a={mask:null,setMask:function(r){return this.mask=r,this},clearMask:function(r){return r===void 0&&(r=!1),r&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(r,n,e,s,h){return r===void 0&&(this.texture||this.shader||this.geom)&&(r=this),new d(this.scene,r,n,e,s,h)},createGeometryMask:function(r){return r===void 0&&(this.type==="Graphics"||this.geom)&&(r=this),new c(this.scene,r)}};p.exports=a},27387:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,d){return t===void 0&&(t=.5),d===void 0&&(d=t),this.originX=t,this.originY=d,this.updateDisplayOrigin()},setOriginFromFrame:function(){return!this.frame||!this.frame.customPivot?this.setOrigin():(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin())},setDisplayOrigin:function(t,d){return t===void 0&&(t=0),d===void 0&&(d=t),this.displayOriginX=t,this.displayOriginY=d,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};p.exports=C},37640:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39506),c=t(57355),a=t(35154),r=t(86353),n=t(26099),e={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:r.PLAYING_FORWARD,setPath:function(s,h){h===void 0&&(h=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=s,h&&this.startFollow(h),this},setRotateToPath:function(s,h){return h===void 0&&(h=0),this.rotateToPath=s,this.pathRotationOffset=h,this},isFollowing:function(){var s=this.pathTween;return s&&s.isPlaying()},startFollow:function(s,h){s===void 0&&(s={}),h===void 0&&(h=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),typeof s=="number"&&(s={duration:s}),s.from=a(s,"from",0),s.to=a(s,"to",1);var o=c(s,"positionOnPath",!1);this.rotateToPath=c(s,"rotateToPath",!1),this.pathRotationOffset=a(s,"rotationOffset",0);var f=a(s,"startAt",h);if(f&&(s.onStart=function(u){var v=u.data[0];v.progress=f,v.elapsed=v.duration*f;var m=v.ease(v.progress);v.current=v.start+(v.end-v.start)*m,v.setTargetValue()}),this.pathOffset||(this.pathOffset=new n(this.x,this.y)),this.pathVector||(this.pathVector=new n),this.pathDelta||(this.pathDelta=new n),this.pathDelta.reset(),s.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(s),this.path.getStartPoint(this.pathOffset),o&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=r.PLAYING_FORWARD,this.rotateToPath){var l=this.path.getPoint(.1);this.rotation=Math.atan2(l.y-this.y,l.x-this.x)+d(this.pathRotationOffset)}return this.pathConfig=s,this},pauseFollow:function(){var s=this.pathTween;return s&&s.isPlaying()&&s.pause(),this},resumeFollow:function(){var s=this.pathTween;return s&&s.isPaused()&&s.resume(),this},stopFollow:function(){var s=this.pathTween;return s&&s.isPlaying()&&s.stop(),this},pathUpdate:function(){var s=this.pathTween;if(s&&s.data){var h=s.data[0],i=this.pathDelta,o=this.pathVector;if(i.copy(o).negate(),h.state===r.COMPLETE){this.path.getPoint(h.end,o),i.add(o),o.add(this.pathOffset),this.setPosition(o.x,o.y);return}else if(h.state!==r.PLAYING_FORWARD&&h.state!==r.PLAYING_BACKWARD)return;this.path.getPoint(s.getValue(),o),i.add(o),o.add(this.pathOffset);var f=this.x,l=this.y;this.setPosition(o.x,o.y);var u=this.x-f,v=this.y-l;if(u===0&&v===0)return;if(h.state!==this._prevDirection){this._prevDirection=h.state;return}this.rotateToPath&&(this.rotation=Math.atan2(v,u)+d(this.pathRotationOffset))}}};p.exports=e},72699:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62644),c={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(a){this.pipelineData={};var r=this.scene.sys.renderer;if(!r)return!1;var n=r.pipelines;if(n){a===void 0&&(a=n.default);var e=n.get(a);if(e)return this.defaultPipeline=e,this.pipeline=e,!0}return!1},setPipeline:function(a,r,n){var e=this.scene.sys.renderer;if(!e)return this;var s=e.pipelines;if(s){var h=s.get(a);h&&(this.pipeline=h),r&&(this.pipelineData=n?d(r):r)}return this},setPipelineData:function(a,r){var n=this.pipelineData;return r===void 0?delete n[a]:n[a]=r,this},resetPipeline:function(a){return a===void 0&&(a=!1),this.pipeline=this.defaultPipeline,a&&(this.pipelineData={}),this.pipeline!==null},getPipelineName:function(){return this.pipeline.name}};p.exports=c},17581:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62644),c=t(47059),a=t(19133),r={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(n){this.postPipelines=[],this.postPipelineData={},this.postFX=new c(this,!0),n&&(this.preFX=new c(this,!1))},setPostPipeline:function(n,e,s){var h=this.scene.sys.renderer;if(!h)return this;var i=h.pipelines;if(i){Array.isArray(n)||(n=[n]);for(var o=0;o0,this},setPostPipelineData:function(n,e){var s=this.postPipelineData;return e===void 0?delete s[n]:s[n]=e,this},getPostPipeline:function(n){for(var e=typeof n=="string",s=this.postPipelines,h=[],i=0;i=0;h--){var i=s[h];(e&&i.name===n||!e&&i===n)&&(i.destroy(),a(s,h))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};p.exports=r},80227:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,d){return d===void 0&&(d=t),this.scrollFactorX=t,this.scrollFactorY=d,this}};p.exports=C},16736:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var d=this.input;return d&&!d.customHitArea&&(d.hitArea.width=this.width,d.hitArea.height=this.height),this},setSize:function(t,d){return this.width=t,this.height=d,this},setDisplaySize:function(t,d){return this.displayWidth=t,this.displayHeight=d,this}};p.exports=C},37726:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(4327),c=8,a={texture:null,frame:null,isCropped:!1,setTexture:function(r,n,e,s){return this.texture=this.scene.sys.textures.get(r),this.setFrame(n,e,s)},setFrame:function(r,n,e){return n===void 0&&(n=!0),e===void 0&&(e=!0),r instanceof d?(this.texture=this.scene.sys.textures.get(r.texture.key),this.frame=r):this.frame=this.texture.get(r),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~c:this.renderFlags|=c,this._sizeComponent&&n&&this.setSizeToFrame(),this._originComponent&&e&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};p.exports=a},79812:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(4327),c=8,a={texture:null,frame:null,isCropped:!1,setCrop:function(r,n,e,s){if(r===void 0)this.isCropped=!1;else if(this.frame){if(typeof r=="number")this.frame.setCropUVs(this._crop,r,n,e,s,this.flipX,this.flipY);else{var h=r;this.frame.setCropUVs(this._crop,h.x,h.y,h.width,h.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(r,n){return this.texture=this.scene.sys.textures.get(r),this.setFrame(n)},setFrame:function(r,n,e){return n===void 0&&(n=!0),e===void 0&&(e=!0),r instanceof d?(this.texture=this.scene.sys.textures.get(r.texture.key),this.frame=r):this.frame=this.texture.get(r),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~c:this.renderFlags|=c,this._sizeComponent&&n&&this.setSizeToFrame(),this._originComponent&&e&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};p.exports=a},27472:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,d,c,a){return t===void 0&&(t=16777215),d===void 0&&(d=t,c=t,a=t),this.tintTopLeft=t,this.tintTopRight=d,this.tintBottomLeft=c,this.tintBottomRight=a,this.tintFill=!1,this},setTintFill:function(t,d,c,a){return this.setTint(t,d,c,a),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};p.exports=C},53774:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(d.textureKey=t.texture.key,d.frameKey=t.frame.name),d};p.exports=C},16901:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(61340),a=t(85955),r=t(86554),n=t(30954),e=t(26099),s=4,h={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(i){this._scaleX=i,this._scaleY=i,i===0?this.renderFlags&=~s:this.renderFlags|=s}},scaleX:{get:function(){return this._scaleX},set:function(i){this._scaleX=i,i===0?this.renderFlags&=~s:this._scaleY!==0&&(this.renderFlags|=s)}},scaleY:{get:function(){return this._scaleY},set:function(i){this._scaleY=i,i===0?this.renderFlags&=~s:this._scaleX!==0&&(this.renderFlags|=s)}},angle:{get:function(){return n(this._rotation*d.RAD_TO_DEG)},set:function(i){this.rotation=n(i)*d.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(i){this._rotation=r(i)}},setPosition:function(i,o,f,l){return i===void 0&&(i=0),o===void 0&&(o=i),f===void 0&&(f=0),l===void 0&&(l=0),this.x=i,this.y=o,this.z=f,this.w=l,this},copyPosition:function(i){return i.x!==void 0&&(this.x=i.x),i.y!==void 0&&(this.y=i.y),i.z!==void 0&&(this.z=i.z),i.w!==void 0&&(this.w=i.w),this},setRandomPosition:function(i,o,f,l){return i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=this.scene.sys.scale.width),l===void 0&&(l=this.scene.sys.scale.height),this.x=i+Math.random()*f,this.y=o+Math.random()*l,this},setRotation:function(i){return i===void 0&&(i=0),this.rotation=i,this},setAngle:function(i){return i===void 0&&(i=0),this.angle=i,this},setScale:function(i,o){return i===void 0&&(i=1),o===void 0&&(o=i),this.scaleX=i,this.scaleY=o,this},setX:function(i){return i===void 0&&(i=0),this.x=i,this},setY:function(i){return i===void 0&&(i=0),this.y=i,this},setZ:function(i){return i===void 0&&(i=0),this.z=i,this},setW:function(i){return i===void 0&&(i=0),this.w=i,this},getLocalTransformMatrix:function(i){return i===void 0&&(i=new c),i.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(i,o){i===void 0&&(i=new c);var f=this.parentContainer;if(!f)return this.getLocalTransformMatrix(i);for(o||(o=new c),i.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);f;)o.applyITRS(f.x,f.y,f._rotation,f._scaleX,f._scaleY),o.multiply(i,i),f=f.parentContainer;return i},getLocalPoint:function(i,o,f,l){f||(f=new e),l||(l=this.scene.sys.cameras.main);var u=l.scrollX,v=l.scrollY,m=i+u*this.scrollFactorX-u,x=o+v*this.scrollFactorY-v;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(m,x,f):a(m,x,this.x,this.y,this.rotation,this.scaleX,this.scaleY,f),this._originComponent&&(f.x+=this._displayOriginX,f.y+=this._displayOriginY),f},getParentRotation:function(){for(var i=0,o=this.parentContainer;o;)i+=o.rotation,o=o.parentContainer;return i}};p.exports=h},61340:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(36383),a=t(26099),r=new d({initialize:function(e,s,h,i,o,f){e===void 0&&(e=1),s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=1),o===void 0&&(o=0),f===void 0&&(f=0),this.matrix=new Float32Array([e,s,h,i,o,f,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(n){this.matrix[0]=n}},b:{get:function(){return this.matrix[1]},set:function(n){this.matrix[1]=n}},c:{get:function(){return this.matrix[2]},set:function(n){this.matrix[2]=n}},d:{get:function(){return this.matrix[3]},set:function(n){this.matrix[3]=n}},e:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},f:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},tx:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},ty:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var n=this.matrix,e=n[0],s=n[1],h=n[2],i=n[3];return e||s?s>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):h||i?c.TAU-(i>0?Math.acos(-h/this.scaleY):-Math.acos(h/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var n=this.matrix;return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,this},translate:function(n,e){var s=this.matrix;return s[4]=s[0]*n+s[2]*e+s[4],s[5]=s[1]*n+s[3]*e+s[5],this},scale:function(n,e){var s=this.matrix;return s[0]*=n,s[1]*=n,s[2]*=e,s[3]*=e,this},rotate:function(n){var e=Math.sin(n),s=Math.cos(n),h=this.matrix,i=h[0],o=h[1],f=h[2],l=h[3];return h[0]=i*s+f*e,h[1]=o*s+l*e,h[2]=i*-e+f*s,h[3]=o*-e+l*s,this},multiply:function(n,e){var s=this.matrix,h=n.matrix,i=s[0],o=s[1],f=s[2],l=s[3],u=s[4],v=s[5],m=h[0],x=h[1],g=h[2],y=h[3],T=h[4],E=h[5],P=e===void 0?s:e.matrix;return P[0]=m*i+x*f,P[1]=m*o+x*l,P[2]=g*i+y*f,P[3]=g*o+y*l,P[4]=T*i+E*f+u,P[5]=T*o+E*l+v,P},multiplyWithOffset:function(n,e,s){var h=this.matrix,i=n.matrix,o=h[0],f=h[1],l=h[2],u=h[3],v=h[4],m=h[5],x=e*o+s*l+v,g=e*f+s*u+m,y=i[0],T=i[1],E=i[2],P=i[3],R=i[4],M=i[5];return h[0]=y*o+T*l,h[1]=y*f+T*u,h[2]=E*o+P*l,h[3]=E*f+P*u,h[4]=R*o+M*l+x,h[5]=R*f+M*u+g,this},transform:function(n,e,s,h,i,o){var f=this.matrix,l=f[0],u=f[1],v=f[2],m=f[3],x=f[4],g=f[5];return f[0]=n*l+e*v,f[1]=n*u+e*m,f[2]=s*l+h*v,f[3]=s*u+h*m,f[4]=i*l+o*v+x,f[5]=i*u+o*m+g,this},transformPoint:function(n,e,s){s===void 0&&(s={x:0,y:0});var h=this.matrix,i=h[0],o=h[1],f=h[2],l=h[3],u=h[4],v=h[5];return s.x=n*i+e*f+u,s.y=n*o+e*l+v,s},invert:function(){var n=this.matrix,e=n[0],s=n[1],h=n[2],i=n[3],o=n[4],f=n[5],l=e*i-s*h;return n[0]=i/l,n[1]=-s/l,n[2]=-h/l,n[3]=e/l,n[4]=(h*f-i*o)/l,n[5]=-(e*f-s*o)/l,this},copyFrom:function(n){var e=this.matrix;return e[0]=n.a,e[1]=n.b,e[2]=n.c,e[3]=n.d,e[4]=n.e,e[5]=n.f,this},copyFromArray:function(n){var e=this.matrix;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],this},copyToContext:function(n){var e=this.matrix;return n.transform(e[0],e[1],e[2],e[3],e[4],e[5]),n},setToContext:function(n){return n.setTransform(this),n},copyToArray:function(n){var e=this.matrix;return n===void 0?n=[e[0],e[1],e[2],e[3],e[4],e[5]]:(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5]),n},setTransform:function(n,e,s,h,i,o){var f=this.matrix;return f[0]=n,f[1]=e,f[2]=s,f[3]=h,f[4]=i,f[5]=o,this},decomposeMatrix:function(){var n=this.decomposedMatrix,e=this.matrix,s=e[0],h=e[1],i=e[2],o=e[3],f=s*o-h*i;if(n.translateX=e[4],n.translateY=e[5],s||h){var l=Math.sqrt(s*s+h*h);n.rotation=h>0?Math.acos(s/l):-Math.acos(s/l),n.scaleX=l,n.scaleY=f/l}else if(i||o){var u=Math.sqrt(i*i+o*o);n.rotation=Math.PI*.5-(o>0?Math.acos(-i/u):-Math.acos(i/u)),n.scaleX=f/u,n.scaleY=u}else n.rotation=0,n.scaleX=0,n.scaleY=0;return n},applyITRS:function(n,e,s,h,i){var o=this.matrix,f=Math.sin(s),l=Math.cos(s);return o[4]=n,o[5]=e,o[0]=l*h,o[1]=f*h,o[2]=-f*i,o[3]=l*i,this},applyInverse:function(n,e,s){s===void 0&&(s=new a);var h=this.matrix,i=h[0],o=h[1],f=h[2],l=h[3],u=h[4],v=h[5],m=1/(i*l+f*-o);return s.x=l*m*n+-f*m*e+(v*f-u*l)*m,s.y=i*m*e+-o*m*n+(-v*i+u*o)*m,s},setQuad:function(n,e,s,h,i,o){i===void 0&&(i=!1),o===void 0&&(o=this.quad);var f=this.matrix,l=f[0],u=f[1],v=f[2],m=f[3],x=f[4],g=f[5];return i?(o[0]=Math.round(n*l+e*v+x),o[1]=Math.round(n*u+e*m+g),o[2]=Math.round(n*l+h*v+x),o[3]=Math.round(n*u+h*m+g),o[4]=Math.round(s*l+h*v+x),o[5]=Math.round(s*u+h*m+g),o[6]=Math.round(s*l+e*v+x),o[7]=Math.round(s*u+e*m+g)):(o[0]=n*l+e*v+x,o[1]=n*u+e*m+g,o[2]=n*l+h*v+x,o[3]=n*u+h*m+g,o[4]=s*l+h*v+x,o[5]=s*u+h*m+g,o[6]=s*l+e*v+x,o[7]=s*u+e*m+g),o},getX:function(n,e){return n*this.a+e*this.c+this.e},getY:function(n,e){return n*this.b+e*this.d+this.f},getXRound:function(n,e,s){var h=this.getX(n,e);return s&&(h=Math.round(h)),h},getYRound:function(n,e,s){var h=this.getY(n,e);return s&&(h=Math.round(h)),h},getCSSMatrix:function(){var n=this.matrix;return"matrix("+n[0]+","+n[1]+","+n[2]+","+n[3]+","+n[4]+","+n[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});p.exports=r},59715:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=1,t={_visible:!0,visible:{get:function(){return this._visible},set:function(d){d?(this._visible=!0,this.renderFlags|=C):(this._visible=!1,this.renderFlags&=~C)}},setVisible:function(d){return this.visible=d,this}};p.exports=t},31401:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Alpha:t(16005),AlphaSingle:t(88509),BlendMode:t(90065),ComputedSize:t(94215),Crop:t(61683),Depth:t(89272),Flip:t(54434),FX:t(47059),GetBounds:t(8004),Mask:t(8573),Origin:t(27387),PathFollower:t(37640),Pipeline:t(72699),PostPipeline:t(17581),ScrollFactor:t(80227),Size:t(16736),Texture:t(37726),TextureCrop:t(79812),Tint:t(27472),ToJSON:t(53774),Transform:t(16901),TransformMatrix:t(61340),Visible:t(59715)}},31559:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37105),c=t(10312),a=t(83419),r=t(31401),n=t(51708),e=t(95643),s=t(87841),h=t(29959),i=t(36899),o=t(26099),f=new a({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.ComputedSize,r.Depth,r.Mask,r.PostPipeline,r.Transform,r.Visible,h],initialize:function(u,v,m,x){e.call(this,u,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new r.TransformMatrix,this.tempTransformMatrix=new r.TransformMatrix,this._sortKey="",this._sysEvents=u.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(v,m),this.setBlendMode(c.SKIP_CHECK),x&&this.add(x)},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this.width*.5}},displayOriginY:{get:function(){return this.height*.5}},setExclusive:function(l){return l===void 0&&(l=!0),this.exclusive=l,this},getBounds:function(l){if(l===void 0&&(l=new s),l.setTo(this.x,this.y,0,0),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix(),v=u.transformPoint(this.x,this.y);l.setTo(v.x,v.y,0,0)}if(this.list.length>0){var m=this.list,x=new s,g=!1;l.setEmpty();for(var y=0;y-1},setAll:function(l,u,v,m){return d.SetAll(this.list,l,u,v,m),this},each:function(l,u){var v=[null],m,x=this.list.slice(),g=x.length;for(m=2;m0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]},onChildDestroyed:function(l){d.Remove(this.list,l),this.exclusive&&(l.parentContainer=null,l.removedFromScene())}});p.exports=f},53584:p=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d);var r=d.list;if(r.length!==0){var n=d.localTransform;a?(n.loadIdentity(),n.multiply(a),n.translate(d.x,d.y),n.rotate(d.rotation),n.scale(d.scaleX,d.scaleY)):n.applyITRS(d.x,d.y,d.rotation,d.scaleX,d.scaleY);var e=d.blendMode!==-1;e||t.setBlendMode(0);var s=d._alpha,h=d.scrollFactorX,i=d.scrollFactorY;d.mask&&d.mask.preRenderCanvas(t,null,c);for(var o=0;o{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(31559),a=t(44603),r=t(23568),n=t(95540);a.register("container",function(e,s){e===void 0&&(e={});var h=r(e,"x",0),i=r(e,"y",0),o=n(e,"children",null),f=new c(this.scene,h,i,o);return s!==void 0&&(e.add=s),d(this.scene,f,e),f})},24961:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(31559),c=t(39429);c.register("container",function(a,r,n){return this.displayList.add(new d(this.scene,a,r,n))})},29959:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(72249),a=t(53584),p.exports={renderWebGL:c,renderCanvas:a}},72249:p=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d);var r=d.list,n=r.length;if(n!==0){var e=d.localTransform;a?(e.loadIdentity(),e.multiply(a),e.translate(d.x,d.y),e.rotate(d.rotation),e.scale(d.scaleX,d.scaleY)):e.applyITRS(d.x,d.y,d.rotation,d.scaleX,d.scaleY),t.pipelines.preBatch(d);var s=d.blendMode!==-1;s||t.setBlendMode(0);for(var h=d.alpha,i=d.scrollFactorX,o=d.scrollFactorY,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(441),r=t(95643),n=t(41212),e=t(35846),s=t(44594),h=t(61369),i=new d({Extends:r,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.Origin,c.ScrollFactor,c.Transform,c.Visible,a],initialize:function(f,l,u,v,m,x){r.call(this,f,"DOMElement"),this.parent=f.sys.game.domContainer,this.cache=f.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new h,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(l,u),typeof v=="string"?v[0]==="#"?this.setElement(v.substr(1),m,x):this.createElement(v,m,x):v&&this.setElement(v,m,x),f.sys.events.on(s.SLEEP,this.handleSceneEvent,this),f.sys.events.on(s.WAKE,this.handleSceneEvent,this),f.sys.events.on(s.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(o){var f=this.node,l=f.style;f&&(l.display=o.settings.visible?"block":"none")},setSkew:function(o,f){return o===void 0&&(o=0),f===void 0&&(f=o),this.skewX=o,this.skewY=f,this},setPerspective:function(o){return this.parent.style.perspective=o+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(o){this.parent.style.perspective=o+"px"}},addListener:function(o){if(this.node){o=o.split(" ");for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(47407),c=t(95643),a=t(61340),r=new a,n=new a,e=new a,s=function(h,i,o,f){if(i.node){var l=i.node.style,u=i.scene.sys.settings;if(!l||!u.visible||c.RENDER_MASK!==i.renderFlags||i.cameraFilter!==0&&i.cameraFilter&o.id||i.parentContainer&&!i.parentContainer.willRender()){l.display="none";return}var v=i.parentContainer,m=o.alpha*i.alpha;v&&(m*=v.alpha);var x=r,g=n,y=e,T=0,E=0,P="0%",R="0%";f?(T=i.width*i.scaleX*i.originX,E=i.height*i.scaleY*i.originY,g.applyITRS(i.x-T,i.y-E,i.rotation,i.scaleX,i.scaleY),x.copyFrom(o.matrix),x.multiplyWithOffset(f,-o.scrollX*i.scrollFactorX,-o.scrollY*i.scrollFactorY),g.e=i.x-T,g.f=i.y-E,x.multiply(g,y)):(T=i.width*i.originX,E=i.height*i.originY,g.applyITRS(i.x-T,i.y-E,i.rotation,i.scaleX,i.scaleY),x.copyFrom(o.matrix),P=100*i.originX+"%",R=100*i.originY+"%",g.e-=o.scrollX*i.scrollFactorX,g.f-=o.scrollY*i.scrollFactorY,x.multiply(g,y)),i.transformOnly||(l.display="block",l.opacity=m,l.zIndex=i._depth,l.pointerEvents=i.pointerEvents,l.mixBlendMode=d[i._blendMode]),l.transform=y.getCSSMatrix()+" skew("+i.skewX+"rad, "+i.skewY+"rad) rotate3d("+i.rotate3d.x+","+i.rotate3d.y+","+i.rotate3d.z+","+i.rotate3d.w+i.rotate3dAngle+")",l.transformOrigin=P+" "+R}};p.exports=s},2611:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(3069),c=t(39429);c.register("dom",function(a,r,n,e,s){var h=new d(this.scene,a,r,n,e,s);return this.displayList.add(h),h})},441:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(49381),a=t(49381),p.exports={renderWebGL:c,renderCanvas:a}},62980:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="addedtoscene"},41337:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},44947:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="removedfromscene"},49358:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},35163:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="created"},97249:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="error"},19483:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="locked"},56059:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="loop"},26772:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="metadata"},64437:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="playing"},83411:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="play"},75780:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="seeked"},67799:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="seeking"},63500:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stalled"},55541:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stop"},53208:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="textureready"},4992:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="unlocked"},12:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="unsupported"},51708:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADDED_TO_SCENE:t(62980),DESTROY:t(41337),REMOVED_FROM_SCENE:t(44947),VIDEO_COMPLETE:t(49358),VIDEO_CREATED:t(35163),VIDEO_ERROR:t(97249),VIDEO_LOCKED:t(19483),VIDEO_LOOP:t(56059),VIDEO_METADATA:t(26772),VIDEO_PLAY:t(83411),VIDEO_PLAYING:t(64437),VIDEO_SEEKED:t(75780),VIDEO_SEEKING:t(67799),VIDEO_STALLED:t(63500),VIDEO_STOP:t(55541),VIDEO_TEXTURE:t(53208),VIDEO_UNLOCKED:t(4992),VIDEO_UNSUPPORTED:t(12)}},42421:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(64993),n=new d({Extends:a,Mixins:[c.Alpha,c.BlendMode,c.Depth,c.Flip,c.Origin,c.ScrollFactor,c.Size,c.Texture,c.Tint,c.Transform,c.Visible,r],initialize:function(s){a.call(this,s,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});p.exports=n},70217:()=>{},56315:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(42421),c=t(39429);c.register("extern",function(){var a=new d(this.scene);return this.displayList.add(a),a})},64993:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(80287),a=t(70217),p.exports={renderWebGL:c,renderCanvas:a}},80287:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=function(a,r,n,e){a.pipelines.clear();var s=d(r,n,e).calc;r.render.call(r,a,n,s),a.pipelines.rebind()};p.exports=c},85592:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},43831:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(71911),c=t(83419),a=t(85592),r=t(31401),n=t(8497),e=t(95643),s=t(95540),h=t(35154),i=t(36383),o=t(84503),f=new c({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,o],initialize:function(u,v){var m=h(v,"x",0),x=h(v,"y",0);e.call(this,u,"Graphics"),this.setPosition(m,x),this.initPipeline(),this.initPostPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(v)},setDefaultStyles:function(l){return h(l,"lineStyle",null)&&(this.defaultStrokeWidth=h(l,"lineStyle.width",1),this.defaultStrokeColor=h(l,"lineStyle.color",16777215),this.defaultStrokeAlpha=h(l,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),h(l,"fillStyle",null)&&(this.defaultFillColor=h(l,"fillStyle.color",16777215),this.defaultFillAlpha=h(l,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(l,u,v){return v===void 0&&(v=1),this.commandBuffer.push(a.LINE_STYLE,l,u,v),this._lineWidth=l,this},fillStyle:function(l,u){return u===void 0&&(u=1),this.commandBuffer.push(a.FILL_STYLE,l,u),this},fillGradientStyle:function(l,u,v,m,x,g,y,T){return x===void 0&&(x=1),g===void 0&&(g=x),y===void 0&&(y=x),T===void 0&&(T=x),this.commandBuffer.push(a.GRADIENT_FILL_STYLE,x,g,y,T,l,u,v,m),this},lineGradientStyle:function(l,u,v,m,x,g){return g===void 0&&(g=1),this.commandBuffer.push(a.GRADIENT_LINE_STYLE,l,g,u,v,m,x),this},beginPath:function(){return this.commandBuffer.push(a.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(a.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(a.FILL_PATH),this},fill:function(){return this.commandBuffer.push(a.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(a.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(a.STROKE_PATH),this},fillCircleShape:function(l){return this.fillCircle(l.x,l.y,l.radius)},strokeCircleShape:function(l){return this.strokeCircle(l.x,l.y,l.radius)},fillCircle:function(l,u,v){return this.beginPath(),this.arc(l,u,v,0,i.PI2),this.fillPath(),this},strokeCircle:function(l,u,v){return this.beginPath(),this.arc(l,u,v,0,i.PI2),this.strokePath(),this},fillRectShape:function(l){return this.fillRect(l.x,l.y,l.width,l.height)},strokeRectShape:function(l){return this.strokeRect(l.x,l.y,l.width,l.height)},fillRect:function(l,u,v,m){return this.commandBuffer.push(a.FILL_RECT,l,u,v,m),this},strokeRect:function(l,u,v,m){var x=this._lineWidth/2,g=l-x,y=l+x;return this.beginPath(),this.moveTo(l,u),this.lineTo(l,u+m),this.strokePath(),this.beginPath(),this.moveTo(l+v,u),this.lineTo(l+v,u+m),this.strokePath(),this.beginPath(),this.moveTo(g,u),this.lineTo(y+v,u),this.strokePath(),this.beginPath(),this.moveTo(g,u+m),this.lineTo(y+v,u+m),this.strokePath(),this},fillRoundedRect:function(l,u,v,m,x){x===void 0&&(x=20);var g=x,y=x,T=x,E=x;typeof x!="number"&&(g=s(x,"tl",20),y=s(x,"tr",20),T=s(x,"bl",20),E=s(x,"br",20));var P=g>=0,R=y>=0,M=T>=0,L=E>=0;return g=Math.abs(g),y=Math.abs(y),T=Math.abs(T),E=Math.abs(E),this.beginPath(),this.moveTo(l+g,u),this.lineTo(l+v-y,u),R?this.arc(l+v-y,u+y,y,-i.TAU,0):this.arc(l+v,u,y,Math.PI,i.TAU,!0),this.lineTo(l+v,u+m-E),L?this.arc(l+v-E,u+m-E,E,0,i.TAU):this.arc(l+v,u+m,E,-i.TAU,Math.PI,!0),this.lineTo(l+T,u+m),M?this.arc(l+T,u+m-T,T,i.TAU,Math.PI):this.arc(l,u+m,T,0,-i.TAU,!0),this.lineTo(l,u+g),P?this.arc(l+g,u+g,g,-Math.PI,-i.TAU):this.arc(l,u,g,i.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(l,u,v,m,x){x===void 0&&(x=20);var g=x,y=x,T=x,E=x,P=Math.min(v,m)/2;typeof x!="number"&&(g=s(x,"tl",20),y=s(x,"tr",20),T=s(x,"bl",20),E=s(x,"br",20));var R=g>=0,M=y>=0,L=T>=0,O=E>=0;return g=Math.min(Math.abs(g),P),y=Math.min(Math.abs(y),P),T=Math.min(Math.abs(T),P),E=Math.min(Math.abs(E),P),this.beginPath(),this.moveTo(l+g,u),this.lineTo(l+v-y,u),this.moveTo(l+v-y,u),M?this.arc(l+v-y,u+y,y,-i.TAU,0):this.arc(l+v,u,y,Math.PI,i.TAU,!0),this.lineTo(l+v,u+m-E),this.moveTo(l+v,u+m-E),O?this.arc(l+v-E,u+m-E,E,0,i.TAU):this.arc(l+v,u+m,E,-i.TAU,Math.PI,!0),this.lineTo(l+T,u+m),this.moveTo(l+T,u+m),L?this.arc(l+T,u+m-T,T,i.TAU,Math.PI):this.arc(l,u+m,T,0,-i.TAU,!0),this.lineTo(l,u+g),this.moveTo(l,u+g),R?this.arc(l+g,u+g,g,-Math.PI,-i.TAU):this.arc(l,u,g,i.TAU,0,!0),this.strokePath(),this},fillPointShape:function(l,u){return this.fillPoint(l.x,l.y,u)},fillPoint:function(l,u,v){return!v||v<1?v=1:(l-=v/2,u-=v/2),this.commandBuffer.push(a.FILL_RECT,l,u,v,v),this},fillTriangleShape:function(l){return this.fillTriangle(l.x1,l.y1,l.x2,l.y2,l.x3,l.y3)},strokeTriangleShape:function(l){return this.strokeTriangle(l.x1,l.y1,l.x2,l.y2,l.x3,l.y3)},fillTriangle:function(l,u,v,m,x,g){return this.commandBuffer.push(a.FILL_TRIANGLE,l,u,v,m,x,g),this},strokeTriangle:function(l,u,v,m,x,g){return this.commandBuffer.push(a.STROKE_TRIANGLE,l,u,v,m,x,g),this},strokeLineShape:function(l){return this.lineBetween(l.x1,l.y1,l.x2,l.y2)},lineBetween:function(l,u,v,m){return this.beginPath(),this.moveTo(l,u),this.lineTo(v,m),this.strokePath(),this},lineTo:function(l,u){return this.commandBuffer.push(a.LINE_TO,l,u),this},moveTo:function(l,u){return this.commandBuffer.push(a.MOVE_TO,l,u),this},strokePoints:function(l,u,v,m){u===void 0&&(u=!1),v===void 0&&(v=!1),m===void 0&&(m=l.length),this.beginPath(),this.moveTo(l[0].x,l[0].y);for(var x=1;x-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(l,u,v){var m=this.scene.sys,x=m.game.renderer;u===void 0&&(u=m.scale.width),v===void 0&&(v=m.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,u,v),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var g,y,T={willReadFrequently:!0};if(typeof l=="string")if(m.textures.exists(l)){g=m.textures.get(l);var E=g.getSourceImage();E instanceof HTMLCanvasElement&&(y=E.getContext("2d",T))}else g=m.textures.createCanvas(l,u,v),y=g.getSourceImage().getContext("2d",T);else l instanceof HTMLCanvasElement&&(y=l.getContext("2d",T));return y&&(this.renderCanvas(x,this,f.TargetCamera,null,y,!1),g&&g.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new d,p.exports=f},32768:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85592),c=t(20926),a=function(r,n,e,s,h,i){var o=n.commandBuffer,f=o.length,l=h||r.currentContext;if(!(f===0||!c(r,l,n,e,s))){e.addToRenderList(n);var u=1,v=1,m=0,x=0,g=1,y=0,T=0,E=0;l.beginPath();for(var P=0;P>>16,T=(m&65280)>>>8,E=m&255,l.strokeStyle="rgba("+y+","+T+","+E+","+u+")",l.lineWidth=g,P+=3;break;case d.FILL_STYLE:x=o[P+1],v=o[P+2],y=(x&16711680)>>>16,T=(x&65280)>>>8,E=x&255,l.fillStyle="rgba("+y+","+T+","+E+","+v+")",P+=2;break;case d.BEGIN_PATH:l.beginPath();break;case d.CLOSE_PATH:l.closePath();break;case d.FILL_PATH:i||l.fill();break;case d.STROKE_PATH:i||l.stroke();break;case d.FILL_RECT:i?l.rect(o[P+1],o[P+2],o[P+3],o[P+4]):l.fillRect(o[P+1],o[P+2],o[P+3],o[P+4]),P+=4;break;case d.FILL_TRIANGLE:l.beginPath(),l.moveTo(o[P+1],o[P+2]),l.lineTo(o[P+3],o[P+4]),l.lineTo(o[P+5],o[P+6]),l.closePath(),i||l.fill(),P+=6;break;case d.STROKE_TRIANGLE:l.beginPath(),l.moveTo(o[P+1],o[P+2]),l.lineTo(o[P+3],o[P+4]),l.lineTo(o[P+5],o[P+6]),l.closePath(),i||l.stroke(),P+=6;break;case d.LINE_TO:l.lineTo(o[P+1],o[P+2]),P+=2;break;case d.MOVE_TO:l.moveTo(o[P+1],o[P+2]),P+=2;break;case d.LINE_FX_TO:l.lineTo(o[P+1],o[P+2]),P+=5;break;case d.MOVE_FX_TO:l.moveTo(o[P+1],o[P+2]),P+=5;break;case d.SAVE:l.save();break;case d.RESTORE:l.restore();break;case d.TRANSLATE:l.translate(o[P+1],o[P+2]),P+=2;break;case d.SCALE:l.scale(o[P+1],o[P+2]),P+=2;break;case d.ROTATE:l.rotate(o[P+1]),P+=1;break;case d.GRADIENT_FILL_STYLE:P+=5;break;case d.GRADIENT_LINE_STYLE:P+=6;break}}l.restore()}};p.exports=a},87079:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(44603),c=t(43831);d.register("graphics",function(a,r){a===void 0&&(a={}),r!==void 0&&(a.add=r);var n=new c(this.scene,a);return a.add&&this.scene.sys.displayList.add(n),n})},1201:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43831),c=t(39429);c.register("graphics",function(a){return this.displayList.add(new d(this.scene,a))})},84503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(77545),a=t(32768),a=t(32768),p.exports={renderWebGL:c,renderCanvas:a}},77545:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85592),c=t(91296),a=t(61340),r=t(70554),n=function(o,f,l){this.x=o,this.y=f,this.width=l},e=function(o,f,l){this.points=[],this.pointsLength=1,this.points[0]=new n(o,f,l)},s=[],h=new a,i=function(o,f,l,u){if(f.commandBuffer.length!==0){l.addToRenderList(f);var v=o.pipelines.set(f.pipeline,f);o.pipelines.preBatch(f);for(var m=c(f,l,u).calc,x=h.loadIdentity(),g=f.commandBuffer,y=l.alpha*f.alpha,T=1,E=v.fillTint,P=v.strokeTint,R=0,M=0,L=0,O=.01,D=Math.PI*2,I,V=[],X=0,H=!0,G=null,U=r.getTintAppendFloatAlpha,F=0;F0&&(tt=-D+tt%D):tt>D?tt=D:tt<0&&(tt=D+tt%D),G===null&&(G=new e(et+Math.cos(rt)*at,nt+Math.sin(rt)*at,T),V.push(G),q+=O);q<1+it;)L=tt*q+rt,R=et+Math.cos(L)*at,M=nt+Math.sin(L)*at,G.points.push(new n(R,M,T)),q+=O;L=tt+rt,R=et+Math.cos(L)*at,M=nt+Math.sin(L)*at,G.points.push(new n(R,M,T));break}case d.FILL_RECT:{v.batchFillRect(g[++F],g[++F],g[++F],g[++F],x,m);break}case d.FILL_TRIANGLE:{v.batchFillTriangle(g[++F],g[++F],g[++F],g[++F],g[++F],g[++F],x,m);break}case d.STROKE_TRIANGLE:{v.batchStrokeTriangle(g[++F],g[++F],g[++F],g[++F],g[++F],g[++F],T,x,m);break}case d.LINE_TO:{G!==null?G.points.push(new n(g[++F],g[++F],T)):(G=new e(g[++F],g[++F],T),V.push(G));break}case d.MOVE_TO:{G=new e(g[++F],g[++F],T),V.push(G);break}case d.SAVE:{s.push(x.copyToArray());break}case d.RESTORE:{x.copyFromArray(s.pop());break}case d.TRANSLATE:{et=g[++F],nt=g[++F],x.translate(et,nt);break}case d.SCALE:{et=g[++F],nt=g[++F],x.scale(et,nt);break}case d.ROTATE:{x.rotate(g[++F]);break}}o.pipelines.postBatch(f)}};p.exports=i},26479:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61061),c=t(83419),a=t(51708),r=t(50792),n=t(46710),e=t(95540),s=t(35154),h=t(97022),i=t(41212),o=t(88492),f=t(35072),l=t(68287),u=new c({Extends:r,initialize:function(m,x,g){r.call(this),g?x&&!Array.isArray(x)&&(x=[x]):Array.isArray(x)?i(x[0])&&(g=x,x=null):i(x)&&(g=x,x=null),this.scene=m,this.children=new f,this.isParent=!0,this.type="Group",this.classType=e(g,"classType",l),this.name=e(g,"name",""),this.active=e(g,"active",!0),this.maxSize=e(g,"maxSize",-1),this.defaultKey=e(g,"defaultKey",null),this.defaultFrame=e(g,"defaultFrame",null),this.runChildUpdate=e(g,"runChildUpdate",!1),this.createCallback=e(g,"createCallback",null),this.removeCallback=e(g,"removeCallback",null),this.createMultipleCallback=e(g,"createMultipleCallback",null),this.internalCreateCallback=e(g,"internalCreateCallback",null),this.internalRemoveCallback=e(g,"internalRemoveCallback",null),x&&this.addMultiple(x),g&&this.createMultiple(g),this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(v,m,x,g,y,T){if(v===void 0&&(v=0),m===void 0&&(m=0),x===void 0&&(x=this.defaultKey),g===void 0&&(g=this.defaultFrame),y===void 0&&(y=!0),T===void 0&&(T=!0),this.isFull())return null;var E=new this.classType(this.scene,v,m,x,g);return E.addToDisplayList(this.scene.sys.displayList),E.addToUpdateList(),E.visible=y,E.setActive(T),this.add(E),E},createMultiple:function(v){if(this.isFull())return[];Array.isArray(v)||(v=[v]);var m=[];if(v[0].key)for(var x=0;x=0;L--)if(M=D[L],M.active===x){if(O++,O===m)break}else M=null;return M?(typeof y=="number"&&(M.x=y),typeof T=="number"&&(M.y=T),M):g?this.create(y,T,E,P,R):null},get:function(v,m,x,g,y){return this.getFirst(!1,!0,v,m,x,g,y)},getFirstAlive:function(v,m,x,g,y,T){return this.getFirst(!0,v,m,x,g,y,T)},getFirstDead:function(v,m,x,g,y,T){return this.getFirst(!1,v,m,x,g,y,T)},playAnimation:function(v,m){return d.PlayAnimation(this.children.entries,v,m),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(v){v===void 0&&(v=!0);for(var m=0,x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(44603),c=t(26479);d.register("group",function(a){return new c(this.scene,null,a)})},3385:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26479),c=t(39429);c.register("group",function(a,r){return this.updateList.add(new d(this.scene,a,r))})},88571:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(59819),n=new d({Extends:a,Mixins:[c.Alpha,c.BlendMode,c.Depth,c.Flip,c.GetBounds,c.Mask,c.Origin,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Size,c.TextureCrop,c.Tint,c.Transform,c.Visible,r],initialize:function(s,h,i,o,f){a.call(this,s,"Image"),this._crop=this.resetCropObject(),this.setTexture(o,f),this.setPosition(h,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});p.exports=n},40652:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d),t.batchSprite(d,d.frame,c,a)};p.exports=C},82459:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(88571);c.register("image",function(n,e){n===void 0&&(n={});var s=a(n,"key",null),h=a(n,"frame",null),i=new r(this.scene,0,0,s,h);return e!==void 0&&(n.add=e),d(this.scene,i,n),i})},2117:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(88571),c=t(39429);c.register("image",function(a,r,n,e){return this.displayList.add(new d(this.scene,a,r,n,e))})},59819:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(99517),a=t(40652),p.exports={renderWebGL:c,renderCanvas:a}},99517:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d),this.pipeline.batchSprite(d,c,a)};p.exports=C},77856:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={Events:t(51708),DisplayList:t(8050),GameObjectCreator:t(44603),GameObjectFactory:t(39429),UpdateList:t(45027),Components:t(31401),GetCalcMatrix:t(91296),BuildGameObject:t(25305),BuildGameObjectAnimation:t(13059),GameObject:t(95643),BitmapText:t(22186),Blitter:t(6107),Bob:t(46590),Container:t(31559),DOMElement:t(3069),DynamicBitmapText:t(2638),Extern:t(42421),Graphics:t(43831),Group:t(26479),Image:t(88571),Layer:t(93595),Particles:t(18404),PathFollower:t(1159),RenderTexture:t(591),RetroFont:t(196),Rope:t(77757),Sprite:t(68287),Text:t(50171),GetTextSize:t(14220),MeasureText:t(79557),TextStyle:t(35762),TileSprite:t(20839),Zone:t(41481),Video:t(18471),Shape:t(17803),Arc:t(23629),Curve:t(89),Ellipse:t(19921),Grid:t(30479),IsoBox:t(61475),IsoTriangle:t(16933),Line:t(57847),Polygon:t(24949),Rectangle:t(74561),Star:t(55911),Triangle:t(36931),Factories:{Blitter:t(12709),Container:t(24961),DOMElement:t(2611),DynamicBitmapText:t(72566),Extern:t(56315),Graphics:t(1201),Group:t(3385),Image:t(2117),Layer:t(20005),Particles:t(676),PathFollower:t(90145),RenderTexture:t(60505),Rope:t(96819),Sprite:t(46409),StaticBitmapText:t(34914),Text:t(68005),TileSprite:t(91681),Zone:t(84175),Video:t(89025),Arc:t(42563),Curve:t(40511),Ellipse:t(1543),Grid:t(34137),IsoBox:t(3933),IsoTriangle:t(49803),Line:t(2481),Polygon:t(64827),Rectangle:t(87959),Star:t(93697),Triangle:t(45245)},Creators:{Blitter:t(9403),Container:t(77143),DynamicBitmapText:t(11164),Graphics:t(87079),Group:t(94975),Image:t(82459),Layer:t(25179),Particles:t(92730),RenderTexture:t(34495),Rope:t(26209),Sprite:t(15567),StaticBitmapText:t(57336),Text:t(71259),TileSprite:t(14167),Zone:t(95261),Video:t(11511)}};d.Shader=t(20071),d.Mesh=t(4703),d.NineSlice=t(28103),d.PointLight=t(80321),d.Plane=t(33663),d.Factories.Shader=t(74177),d.Factories.Mesh=t(9225),d.Factories.NineSlice=t(47521),d.Factories.PointLight=t(71255),d.Factories.Plane=t(30985),d.Creators.Shader=t(54935),d.Creators.Mesh=t(20527),d.Creators.NineSlice=t(28279),d.Creators.PointLight=t(39829),d.Creators.Plane=t(56015),d.Light=t(41432),d.LightsManager=t(61356),d.LightsPlugin=t(88992),p.exports=d},93595:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(83419),a=t(31401),r=t(53774),n=t(45893),e=t(50792),s=t(51708),h=t(73162),i=t(33963),o=t(44594),f=t(19186),l=new c({Extends:h,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Mask,a.PostPipeline,a.Visible,e,i],initialize:function(v,m){h.call(this,v),e.call(this),this.scene=v,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=v.sys,this.events=v.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(d.SKIP_CHECK),m&&this.add(m),v.sys.queueDepthSort()},setActive:function(u){return this.active=u,this},setName:function(u){return this.name=u,this},setState:function(u){return this.state=u,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(u,v){return this.data||(this.data=new n(this)),this.data.set(u,v),this},incData:function(u,v){return this.data||(this.data=new n(this)),this.data.inc(u,v),this},toggleData:function(u){return this.data||(this.data=new n(this)),this.data.toggle(u),this},getData:function(u){return this.data||(this.data=new n(this)),this.data.get(u)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(u){return!(this.renderFlags!==15||this.list.length===0||this.cameraFilter!==0&&this.cameraFilter&u.id)},getIndexList:function(){for(var u=this,v=this.parentContainer,m=[];v&&(m.unshift(v.getIndex(u)),u=v,v.parentContainer);)v=v.parentContainer;return m.unshift(this.displayList.getIndex(u)),m},addChildCallback:function(u){var v=u.displayList;v&&v!==this&&u.removeFromDisplayList(),u.displayList||(this.queueDepthSort(),u.displayList=this,u.emit(s.ADDED_TO_SCENE,u,this.scene),this.events.emit(o.ADDED_TO_SCENE,u,this.scene))},removeChildCallback:function(u){this.queueDepthSort(),u.displayList=null,u.emit(s.REMOVED_FROM_SCENE,u,this.scene),this.events.emit(o.REMOVED_FROM_SCENE,u,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(u,v){return u._depth-v._depth},getChildren:function(){return this.list},addToDisplayList:function(u){return u===void 0&&(u=this.scene.sys.displayList),this.displayList&&this.displayList!==u&&this.removeFromDisplayList(),u.exists(this)||(this.displayList=u,u.add(this,!0),u.queueDepthSort(),this.emit(s.ADDED_TO_SCENE,this,this.scene),u.events.emit(o.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var u=this.displayList||this.scene.sys.displayList;return u.exists(this)&&(u.remove(this,!0),u.queueDepthSort(),this.displayList=null,this.emit(s.REMOVED_FROM_SCENE,this,this.scene),u.events.emit(o.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(u){if(!(!this.scene||this.ignoreDestroy)){this.emit(s.DESTROY,this);for(var v=this.list;v.length;)v[0].destroy(u);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0,!1),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});p.exports=l},2956:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=d.list;if(a.length!==0){d.depthSort();var r=d.blendMode!==-1;r||t.setBlendMode(0);var n=d._alpha;d.mask&&d.mask.preRenderCanvas(t,null,c);for(var e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(93595),a=t(44603),r=t(23568);a.register("layer",function(n,e){n===void 0&&(n={});var s=r(n,"children",null),h=new c(this.scene,s);return e!==void 0&&(n.add=e),d(this.scene,h,n),h})},20005:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(93595),c=t(39429);c.register("layer",function(a){return this.displayList.add(new d(this.scene,a))})},33963:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(15869),a=t(2956),p.exports={renderWebGL:c,renderCanvas:a}},15869:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=d.list,r=a.length;if(r!==0){d.depthSort(),t.pipelines.preBatch(d);var n=d.blendMode!==-1;n||t.setBlendMode(0);for(var e=d.alpha,s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(96503),c=t(83419),a=t(31401),r=t(51767),n=t(70554),e=new c({Extends:d,Mixins:[a.Origin,a.ScrollFactor,a.Transform,a.Visible],initialize:function(h,i,o,f,l,u,v){d.call(this,h,i,o),this.color=new r(f,l,u),this.intensity=v,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(o)},displayWidth:{get:function(){return this.diameter},set:function(s){this.diameter=s}},displayHeight:{get:function(){return this.diameter},set:function(s){this.diameter=s}},width:{get:function(){return this.diameter},set:function(s){this.diameter=s}},height:{get:function(){return this.diameter},set:function(s){this.diameter=s}},willRender:function(s){return!(e.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&s.id)},setColor:function(s){var h=n.getFloatsFromUintRGB(s);return this.color.set(h[0],h[1],h[2]),this},setIntensity:function(s){return this.intensity=s,this},setRadius:function(s){return this.radius=s,this}});e.RENDER_MASK=15,p.exports=e},61356:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(81491),c=t(83419),a=t(20339),r=t(41432),n=t(80321),e=t(51767),s=t(19133),h=t(19186),i=t(70554),o=new c({initialize:function(){this.lights=[],this.ambientColor=new e(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(f,l,u,v,m,x){return this.systems.displayList.add(new n(this.scene,f,l,u,v,m,x))},enable:function(){return this.maxLights===-1&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(f){for(var l=this.lights,u=f.worldView,v=[],m=0;mthis.maxLights&&(h(v,this.sortByDistance),v=v.slice(0,this.maxLights)),this.visibleLights=v.length,v},sortByDistance:function(f,l){return f.distance>=l.distance},setAmbientColor:function(f){var l=i.getFloatsFromUintRGB(f);return this.ambientColor.set(l[0],l[1],l[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(f,l,u,v,m){f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=128),v===void 0&&(v=16777215),m===void 0&&(m=1);var x=i.getFloatsFromUintRGB(v),g=new r(f,l,u,x[0],x[1],x[2],m);return this.lights.push(g),g},removeLight:function(f){var l=this.lights.indexOf(f);return l>=0&&s(this.lights,l),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});p.exports=o},88992:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(61356),a=t(37277),r=t(44594),n=new d({Extends:c,initialize:function(s){this.scene=s,this.systems=s.sys,s.sys.settings.isBooted||s.sys.events.once(r.BOOT,this.boot,this),c.call(this)},boot:function(){var e=this.systems.events;e.on(r.SHUTDOWN,this.shutdown,this),e.on(r.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});a.register("LightsPlugin",n,"lights"),p.exports=n},4703:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(39506),r=t(83997),n=t(95643),e=t(34684),s=t(92515),h=t(91296),i=t(37867),o=t(29807),f=t(43396),l=t(19186),u=t(25836),v=t(39318),m=new d({Extends:n,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.Mask,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Size,c.Texture,c.Transform,c.Visible,o],initialize:function(g,y,T,E,P,R,M,L,O,D,I,V){y===void 0&&(y=0),T===void 0&&(T=0),E===void 0&&(E="__WHITE"),n.call(this,g,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new u,this.modelScale=new u(1,1,1),this.modelRotation=new u,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new i,this.viewPosition=new u,this.viewMatrix=new i,this.projectionMatrix=new i,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var X=g.sys.renderer;this.setPosition(y,T),this.setTexture(E,P),this.setSize(X.width,X.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(X.width,X.height),R&&this.addVertices(R,M,L,O,D,I,V)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(x){return this.viewPosition.addScale(u.LEFT,x),this.dirtyCache[10]=1,this},panY:function(x){return this.viewPosition.y+=u.DOWN.y*x,this.dirtyCache[10]=1,this},panZ:function(x){return this.viewPosition.z+=x,this.dirtyCache[10]=1,this},setPerspective:function(x,g,y,T,E){return y===void 0&&(y=45),T===void 0&&(T=.01),E===void 0&&(E=1e3),this.fov=y,this.projectionMatrix.perspective(a(y),x/g,T,E),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(x,g,y,T){return x===void 0&&(x=this.scene.sys.renderer.getAspectRatio()),g===void 0&&(g=1),y===void 0&&(y=-1e3),T===void 0&&(T=1e3),this.fov=0,this.projectionMatrix.ortho(-x,x,-g,g,y,T),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(x){x.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(x,g,y,T,E,P,R,M,L){var O=this.scene.sys.cache.obj.get(x),D;return O&&(D=e(O,this,g,y,T,E,P,R,M,L)),(!D||D.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",x),this},sortByDepth:function(x,g){return x.depth-g.depth},depthSort:function(){return l(this.faces,this.sortByDepth),this},addVertex:function(x,g,y,T,E,P,R){var M=new v(x,g,y,T,E,P,R);return this.vertices.push(M),M},addFace:function(x,g,y){var T=new r(x,g,y);return this.faces.push(T),this.dirtyCache[9]=-1,T},addVertices:function(x,g,y,T,E,P,R){var M=s(x,g,y,T,E,P,R);return M?(this.faces=this.faces.concat(M.faces),this.vertices=this.vertices.concat(M.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(x){return this.faces[x]},hasFaceAt:function(x,g,y){y===void 0&&(y=this.scene.sys.cameras.main);for(var T=h(this,y).calc,E=this.faces,P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){};p.exports=C},20527:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(35154),n=t(4703);c.register("mesh",function(e,s){e===void 0&&(e={});var h=a(e,"key",null),i=a(e,"frame",null),o=r(e,"vertices",[]),f=r(e,"uvs",[]),l=r(e,"indicies",[]),u=r(e,"containsZ",!1),v=r(e,"normals",[]),m=r(e,"colors",16777215),x=r(e,"alphas",1),g=new n(this.scene,0,0,h,i,o,f,l,u,v,m,x);return s!==void 0&&(e.add=s),d(this.scene,g,e),g})},9225:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(4703),c=t(39429);c.register("mesh",function(a,r,n,e,s,h,i,o,f,l,u){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i,o,f,l,u))})},29807:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(48833),a=t(36488),p.exports={renderWebGL:c,renderCanvas:a}},48833:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=function(a,r,n,e){var s=r.faces,h=s.length;if(h!==0){n.addToRenderList(r);var i=a.pipelines.set(r.pipeline,r),o=d(r,n,e).calc;a.pipelines.preBatch(r);for(var f=i.setGameObject(r),l=i.vertexViewF32,u=i.vertexViewU32,v=i.vertexCount*i.currentShader.vertexComponentCount-1,m=r.tintFill,x=[],g=r.debugCallback,y=o.a,T=o.b,E=o.c,P=o.d,R=o.e,M=o.f,L=r.viewPosition.z,O=r.hideCCW,D=n.roundPixels,I=n.alpha*r.alpha,V=0,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(78023),n=t(39318),e=new d({Extends:a,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.GetBounds,c.Mask,c.Origin,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Texture,c.Transform,c.Visible,r],initialize:function(h,i,o,f,l,u,v,m,x,g,y){a.call(this,h,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tint=16777215,this.tintFill=!1;var T=h.textures.getFrame(f,l);this.is3Slice=!g&&!y,T.scale9&&(this.is3Slice=T.is3Slice);for(var E=this.is3Slice?18:54,P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(35154),n=t(28103);c.register("nineslice",function(e,s){e===void 0&&(e={});var h=a(e,"key",null),i=a(e,"frame",null),o=r(e,"width",256),f=r(e,"height",256),l=r(e,"leftWidth",10),u=r(e,"rightWidth",10),v=r(e,"topHeight",0),m=r(e,"bottomHeight",0),x=new n(this.scene,0,0,h,i,o,f,l,u,v,m);return s!==void 0&&(e.add=s),d(this.scene,x,e),x})},47521:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(28103),c=t(39429);c.register("nineslice",function(a,r,n,e,s,h,i,o,f,l){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i,o,f,l))})},78023:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(52230),p.exports={renderWebGL:c,renderCanvas:a}},52230:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){var h=n.vertices,i=h.length;if(i!==0){e.addToRenderList(n);var o=r.pipelines.set(n.pipeline,n),f=d(n,e,s,!1).calc;r.pipelines.preBatch(n);var l=o.setGameObject(n),u=o.vertexViewF32,v=o.vertexViewU32,m=o.vertexCount*o.currentShader.vertexComponentCount-1,x=e.roundPixels,g=n.tintFill,y=e.alpha*n.alpha,T=c.getTintAppendFloatAlpha(n.tint,y),E=o.vertexAvailable(),P=-1;E{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(44777),a=t(37589),r=t(6113),n=t(91389),e=t(90664),s=new d({Extends:c,initialize:function(i){c.call(this,i,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return this.propertyValue===null?0:9},setMethods:function(){var h=this.propertyValue,i=h,o=this.defaultEmit,f=this.defaultUpdate;if(this.method===9){this.start=h[0],this.ease=r("Linear"),this.interpolation=n("linear"),o=this.easedValueEmit,f=this.easeValueUpdate,i=h[0],this.active=!0;for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30976),c=t(45319),a=t(83419),r=t(99472),n=t(6113),e=t(95540),s=t(91389),h=t(77720),i=t(15994),o=new a({initialize:function(l,u,v){v===void 0&&(v=!1),this.propertyKey=l,this.propertyValue=u,this.defaultValue=u,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=v,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(f,l){f===void 0&&(f={}),l&&(this.propertyKey=l),this.propertyValue=e(f,this.propertyKey,this.defaultValue),this.method=this.getMethod(),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return JSON.stringify(this.propertyValue)},onChange:function(f){var l;switch(this.method){case 1:case 3:case 8:l=f;break;case 2:this.propertyValue.indexOf(f)>=0&&(l=f);break;case 4:var u=(this.end-this.start)/this.steps;l=h(f,u),this.counter=l;break;case 5:case 6:case 7:l=c(f,this.start,this.end);break;case 9:l=this.start[0];break}return this.current=l,this},getMethod:function(){var f=this.propertyValue;if(f===null)return 0;var l=typeof f;if(l==="number")return 1;if(Array.isArray(f))return 2;if(l==="function")return 3;if(l==="object"){if(this.hasBoth(f,"start","end"))return this.has(f,"steps")?4:5;if(this.hasBoth(f,"min","max"))return 6;if(this.has(f,"random"))return 7;if(this.hasEither(f,"onEmit","onUpdate"))return 8;if(this.hasEither(f,"values","interpolation"))return 9}return 0},setMethods:function(){var f=this.propertyValue,l=f,u=this.defaultEmit,v=this.defaultUpdate;switch(this.method){case 1:u=this.staticValueEmit;break;case 2:u=this.randomStaticValueEmit,l=f[0];break;case 3:this._onEmit=f,u=this.proxyEmit;break;case 4:this.start=f.start,this.end=f.end,this.steps=f.steps,this.counter=this.start,this.yoyo=this.has(f,"yoyo")?f.yoyo:!1,this.direction=0,u=this.steppedEmit,l=this.start;break;case 5:this.start=f.start,this.end=f.end;var m=this.has(f,"ease")?f.ease:"Linear";this.ease=n(m,f.easeParams),u=this.has(f,"random")&&f.random?this.randomRangedValueEmit:this.easedValueEmit,v=this.easeValueUpdate,l=this.start;break;case 6:this.start=f.min,this.end=f.max,u=this.has(f,"int")&&f.int?this.randomRangedIntEmit:this.randomRangedValueEmit,l=this.start;break;case 7:var x=f.random;Array.isArray(x)&&(this.start=x[0],this.end=x[1]),u=this.randomRangedIntEmit,l=this.start;break;case 8:this._onEmit=this.has(f,"onEmit")?f.onEmit:this.defaultEmit,this._onUpdate=this.has(f,"onUpdate")?f.onUpdate:this.defaultUpdate,u=this.proxyEmit,v=this.proxyUpdate;break;case 9:this.start=f.values;var g=this.has(f,"ease")?f.ease:"Linear";this.ease=n(g,f.easeParams),this.interpolation=s(f.interpolation),u=this.easedValueEmit,v=this.easeValueUpdate,l=this.start[0];break}return this.onEmit=u,this.onUpdate=v,this.current=l,this},has:function(f,l){return f.hasOwnProperty(l)},hasBoth:function(f,l,u){return f.hasOwnProperty(l)&&f.hasOwnProperty(u)},hasEither:function(f,l,u){return f.hasOwnProperty(l)||f.hasOwnProperty(u)},defaultEmit:function(f,l,u){return u},defaultUpdate:function(f,l,u,v){return v},proxyEmit:function(f,l,u){var v=this._onEmit(f,l,u);return this.current=v,v},proxyUpdate:function(f,l,u,v){var m=this._onUpdate(f,l,u,v);return this.current=m,m},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var f=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[f],this.current},randomRangedValueEmit:function(f,l){var u=r(this.start,this.end);return f&&f.data[l]&&(f.data[l].min=u,f.data[l].max=this.end),this.current=u,u},randomRangedIntEmit:function(f,l){var u=d(this.start,this.end);return f&&f.data[l]&&(f.data[l].min=u,f.data[l].max=this.end),this.current=u,u},steppedEmit:function(){var f=this.counter,l=f,u=(this.end-this.start)/this.steps;if(this.yoyo){var v;this.direction===0?(l+=u,l>=this.end&&(v=l-this.end,l=this.end-v,this.direction=1)):(l-=u,l<=this.start&&(v=this.start-l,l=this.start+v,this.direction=0)),this.counter=l}else this.counter=i(l+u,this.start,this.end);return this.current=f,f},easedValueEmit:function(f,l){if(f&&f.data[l]){var u=f.data[l];u.min=this.start,u.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(f,l,u){var v=f.data[l],m,x=this.ease(u);return this.interpolation?m=this.interpolation(this.start,x):m=(v.max-v.min)*x+v.min,this.current=m,m},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});p.exports=o},24502:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(20286),r=new d({Extends:a,initialize:function(e,s,h,i,o){if(typeof e=="object"){var f=e;e=c(f,"x",0),s=c(f,"y",0),h=c(f,"power",0),i=c(f,"epsilon",100),o=c(f,"gravity",50)}else e===void 0&&(e=0),s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=100),o===void 0&&(o=50);a.call(this,e,s,!0),this._gravity=o,this._power=h*o,this._epsilon=i*i},update:function(n,e){var s=this.x-n.x,h=this.y-n.y,i=s*s+h*h;if(i!==0){var o=Math.sqrt(i);i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(9674),c=t(45319),a=t(83419),r=t(39506),n=t(87841),e=t(11520),s=t(26099),h=new a({initialize:function(o){this.emitter=o,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new s,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.holdCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1},x:{min:0,max:0},y:{min:0,max:0},accelerationX:{min:0,max:0},accelerationY:{min:0,max:0},maxVelocityX:{min:0,max:0},maxVelocityY:{min:0,max:0},moveToX:{min:0,max:0},moveToY:{min:0,max:0},bounce:{min:0,max:0}},this.isCropped=!1,this.scene=o.scene,this.anims=new d(this),this.bounds=new n},emit:function(i,o,f,l,u,v){return this.emitter.emit(i,o,f,l,u,v)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(i,o){i===void 0&&(i=0),o===void 0&&(o=0),this.x=i,this.y=o},fire:function(i,o){var f=this.emitter,l=f.ops,u=f.getAnim();if(u?this.anims.play(u):(this.frame=f.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(f.getEmitZone(this),i===void 0?this.x+=l.x.onEmit(this,"x"):l.x.steps>0?this.x+=i+l.x.onEmit(this,"x"):this.x+=i,o===void 0?this.y+=l.y.onEmit(this,"y"):l.y.steps>0?this.y+=o+l.y.onEmit(this,"y"):this.y+=o,this.life=l.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=l.delay.onEmit(this,"delay"),this.holdCurrent=l.hold.onEmit(this,"hold"),this.scaleX=l.scaleX.onEmit(this,"scaleX"),this.scaleY=l.scaleY.active?l.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=l.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),f.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&f.getDeathZone(this))return this.lifeCurrent=0,!1;var v=l.speedX.onEmit(this,"speedX"),m=l.speedY.active?l.speedY.onEmit(this,"speedY"):v;if(f.radial){var x=r(l.angle.onEmit(this,"angle"));this.velocityX=Math.cos(x)*Math.abs(v),this.velocityY=Math.sin(x)*Math.abs(m)}else if(f.moveTo){var g=l.moveToX.onEmit(this,"moveToX"),y=l.moveToY.onEmit(this,"moveToY"),T=this.life/1e3;this.velocityX=(g-this.x)/T,this.velocityY=(y-this.y)/T}else this.velocityX=v,this.velocityY=m;return f.acceleration&&(this.accelerationX=l.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=l.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=l.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=l.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=l.bounce.onEmit(this,"bounce"),this.alpha=l.alpha.onEmit(this,"alpha"),l.color.active?this.tint=l.color.onEmit(this,"tint"):this.tint=l.tint.onEmit(this,"tint"),!0},update:function(i,o,f){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=i,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=i,!1;this.anims.update(0,i);var l=this.emitter,u=l.ops,v=1-this.lifeCurrent/this.life;if(this.lifeT=v,this.x=u.x.onUpdate(this,"x",v,this.x),this.y=u.y.onUpdate(this,"y",v,this.y),l.moveTo){var m=u.moveToX.onUpdate(this,"moveToX",v,l.moveToX),x=u.moveToY.onUpdate(this,"moveToY",v,l.moveToY),g=this.lifeCurrent/1e3;this.velocityX=(m-this.x)/g,this.velocityY=(x-this.y)/g}return this.computeVelocity(l,i,o,f,v),this.scaleX=u.scaleX.onUpdate(this,"scaleX",v,this.scaleX),u.scaleY.active?this.scaleY=u.scaleY.onUpdate(this,"scaleY",v,this.scaleY):this.scaleY=this.scaleX,this.angle=u.rotate.onUpdate(this,"rotate",v,this.angle),this.rotation=r(this.angle),l.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=c(u.alpha.onUpdate(this,"alpha",v,this.alpha),0,1),u.color.active?this.tint=u.color.onUpdate(this,"color",v,this.tint):this.tint=u.tint.onUpdate(this,"tint",v,this.tint),this.lifeCurrent-=i,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(i,o,f,l,u){var v=i.ops,m=this.velocityX,x=this.velocityY,g=v.accelerationX.onUpdate(this,"accelerationX",u,this.accelerationX),y=v.accelerationY.onUpdate(this,"accelerationY",u,this.accelerationY),T=v.maxVelocityX.onUpdate(this,"maxVelocityX",u,this.maxVelocityX),E=v.maxVelocityY.onUpdate(this,"maxVelocityY",u,this.maxVelocityY);this.bounce=v.bounce.onUpdate(this,"bounce",u,this.bounce),m+=i.gravityX*f+g*f,x+=i.gravityY*f+y*f,m=c(m,-T,T),x=c(x,-E,E),this.velocityX=m,this.velocityY=x,this.x+=m*f,this.y+=x*f,i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(20286),a=t(87841),r=new d({Extends:c,initialize:function(e,s,h,i,o,f,l,u){o===void 0&&(o=!0),f===void 0&&(f=!0),l===void 0&&(l=!0),u===void 0&&(u=!0),c.call(this,e,s,!0),this.bounds=new a(e,s,h,i),this.collideLeft=o,this.collideRight=f,this.collideTop=l,this.collideBottom=u},update:function(n){var e=this.bounds,s=-n.bounce,h=n.worldPosition;h.xe.right&&this.collideRight&&(n.x-=h.x-e.right,n.velocityX*=s),h.ye.bottom&&this.collideBottom&&(n.y-=h.y-e.bottom,n.velocityY*=s)}});p.exports=r},31600:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(53774),r=t(43459),n=t(26388),e=t(19909),s=t(76472),h=t(44777),i=t(20696),o=t(95643),f=t(95540),l=t(26546),u=t(24502),v=t(1985),m=t(97022),x=t(86091),g=t(73162),y=t(20074),T=t(56480),E=t(68875),P=t(87841),R=t(59996),M=t(72905),L=t(90668),O=t(19186),D=t(61340),I=t(26099),V=t(15994),X=t(69601),H=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintFill","timeScale","trackVisible","visible"],G=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],U=new d({Extends:o,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.Mask,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Texture,c.Transform,c.Visible,L],initialize:function(B,N,z,Y,K){o.call(this,B,"ParticleEmitter"),this.particleClass=T,this.ops={accelerationX:new h("accelerationX",0),accelerationY:new h("accelerationY",0),alpha:new h("alpha",1),angle:new h("angle",{min:0,max:360},!0),bounce:new h("bounce",0),color:new s("color"),delay:new h("delay",0,!0),hold:new h("hold",0,!0),lifespan:new h("lifespan",1e3,!0),maxVelocityX:new h("maxVelocityX",1e4),maxVelocityY:new h("maxVelocityY",1e4),moveToX:new h("moveToX",0),moveToY:new h("moveToY",0),quantity:new h("quantity",1,!0),rotate:new h("rotate",0),scaleX:new h("scaleX",1),scaleY:new h("scaleY",1),speedX:new h("speedX",0,!0),speedY:new h("speedY",0,!0),tint:new h("tint",16777215),x:new h("x",0),y:new h("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new I,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new D,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new g(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(N,z),this.setTexture(Y),K&&this.setConfig(K)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(F){if(!F)return this;var B=0,N="",z=this.ops;for(B=0;B=this.animQuantity&&(this.animCounter=0,this.currentAnim=V(this.currentAnim+1,0,B)),N},setAnim:function(F,B,N){B===void 0&&(B=!0),N===void 0&&(N=1),this.randomAnim=B,this.animQuantity=N,this.currentAnim=0;var z=typeof F;if(this.anims.length=0,Array.isArray(F))this.anims=this.anims.concat(F);else if(z==="string")this.anims.push(F);else if(z==="object"){var Y=F;F=f(Y,"anims",null),F&&(this.anims=this.anims.concat(F));var K=f(Y,"cycle",!1);this.randomAnim=!K,this.animQuantity=f(Y,"quantity",N)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(F){return F===void 0&&(F=!0),this.radial=F,this},addParticleBounds:function(F,B,N,z,Y,K,Z,Q){if(typeof F=="object"){var $=F;F=$.x,B=$.y,N=m($,"w")?$.w:$.width,z=m($,"h")?$.h:$.height}return this.addParticleProcessor(new X(F,B,N,z,Y,K,Z,Q))},setParticleSpeed:function(F,B){return B===void 0&&(B=F),this.ops.speedX.onChange(F),F===B?this.ops.speedY.active=!1:this.ops.speedY.onChange(B),this.radial=!0,this},setParticleScale:function(F,B){return F===void 0&&(F=1),B===void 0&&(B=F),this.ops.scaleX.onChange(F),this.ops.scaleY.onChange(B),this},setParticleGravity:function(F,B){return this.gravityX=F,this.gravityY=B,this},setParticleAlpha:function(F){return this.ops.alpha.onChange(F),this},setParticleTint:function(F){return this.ops.tint.onChange(F),this},setEmitterAngle:function(F){return this.ops.angle.onChange(F),this},setParticleLifespan:function(F){return this.ops.lifespan.onChange(F),this},setQuantity:function(F){return this.quantity=F,this},setFrequency:function(F,B){return this.frequency=F,this.flowCounter=F>0?F:0,B&&(this.quantity=B),this},addDeathZone:function(F){Array.isArray(F)||(F=[F]);for(var B,N=[],z=0;z-1&&(this.zoneTotal++,this.zoneTotal===z.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===N&&(this.zoneIndex=0)))}},getDeathZone:function(F){for(var B=this.deathZones,N=0;N=0&&(this.zoneIndex=B),this},addParticleProcessor:function(F){return this.processors.exists(F)||(F.emitter&&F.emitter.removeParticleProcessor(F),this.processors.add(F),F.emitter=this),F},removeParticleProcessor:function(F){return this.processors.exists(F)&&(this.processors.remove(F,!0),F.emitter=null),F},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(F){return this.addParticleProcessor(new u(F))},reserve:function(F){var B=this.dead;if(this.maxParticles>0){var N=this.getParticleCount();N+F>this.maxParticles&&(F=this.maxParticles-(N+F))}for(var z=0;z0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(F,B){return F===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof F=="function"&&(this.emitCallback=F,B&&(this.emitCallbackScope=B)),this},onParticleDeath:function(F,B){return F===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof F=="function"&&(this.deathCallback=F,B&&(this.deathCallbackScope=B)),this},killAll:function(){for(var F=this.dead,B=this.alive;B.length>0;)F.push(B.pop());return this},forEachAlive:function(F,B){for(var N=this.alive,z=N.length,Y=0;Y0&&this.fastForward(F),this.emitting=!0,this.resetCounters(this.frequency,!0),B!==void 0&&(this.duration=Math.abs(B)),this.emit(i.START,this)),this},stop:function(F){return F===void 0&&(F=!1),this.emitting&&(this.emitting=!1,F&&this.killAll(),this.emit(i.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(F,B){return F===void 0&&(F=""),B===void 0&&(B=this.true),this.sortProperty=F,this.sortOrderAsc=B,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(F){return this.sortProperty!==""?F=this.depthSortCallback:F=null,this.sortCallback=F,this},depthSort:function(){return O(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(F,B){var N=this.sortProperty;return this.sortOrderAsc?F[N]-B[N]:B[N]-F[N]},flow:function(F,B,N){return B===void 0&&(B=1),this.emitting=!1,this.frequency=F,this.quantity=B,N!==void 0&&(this.stopAfter=N),this.start()},explode:function(F,B,N){this.frequency=-1,this.resetCounters(-1,!0);var z=this.emitParticle(F,B,N);return this.emit(i.EXPLODE,this,z),z},emitParticleAt:function(F,B,N){return this.emitParticle(N,F,B)},emitParticle:function(F,B,N){if(!this.atLimit()){F===void 0&&(F=this.ops.quantity.onEmit());for(var z=this.dead,Y=this.stopAfter,K=this.follow?this.follow.x+this.followOffset.x:B,Z=this.follow?this.follow.y+this.followOffset.y:N,Q=0;Q0&&(this.stopCounter++,this.stopCounter>=Y)||this.atLimit())break}return $}},fastForward:function(F,B){B===void 0&&(B=1e3/60);var N=0;for(this.skipping=!0;N0){var k=this.deathCallback,_=this.deathCallbackScope;for(Z=$-1;Z>=0;Z--){var q=Q[Z];Y.splice(q.index,1),K.push(q.particle),k&&k.call(_,q.particle),q.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&Y.length===0&&(this.completeFlag=0,this.emit(i.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=B;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=B,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(F){for(var B=this.getWorldTransformMatrix(),N=this.alive,z=N.length,Y=[],K=0;K0){var j=0;for(this.skipping=!0;j0&&x(z,F,F),z},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(F){this.ops.x.onChange(F)}},particleY:{get:function(){return this.ops.y.current},set:function(F){this.ops.y.onChange(F)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(F){this.ops.accelerationX.onChange(F)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(F){this.ops.accelerationY.onChange(F)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(F){this.ops.maxVelocityX.onChange(F)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(F){this.ops.maxVelocityY.onChange(F)}},speed:{get:function(){return this.ops.speedX.current},set:function(F){this.ops.speedX.onChange(F),this.ops.speedY.onChange(F)}},speedX:{get:function(){return this.ops.speedX.current},set:function(F){this.ops.speedX.onChange(F)}},speedY:{get:function(){return this.ops.speedY.current},set:function(F){this.ops.speedY.onChange(F)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(F){this.ops.moveToX.onChange(F)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(F){this.ops.moveToY.onChange(F)}},bounce:{get:function(){return this.ops.bounce.current},set:function(F){this.ops.bounce.onChange(F)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(F){this.ops.scaleX.onChange(F)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(F){this.ops.scaleY.onChange(F)}},particleColor:{get:function(){return this.ops.color.current},set:function(F){this.ops.color.onChange(F)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(F){this.ops.color.setEase(F)}},particleTint:{get:function(){return this.ops.tint.current},set:function(F){this.ops.tint.onChange(F)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(F){this.ops.alpha.onChange(F)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(F){this.ops.lifespan.onChange(F)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(F){this.ops.angle.onChange(F)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(F){this.ops.rotate.onChange(F)}},quantity:{get:function(){return this.ops.quantity.current},set:function(F){this.ops.quantity.onChange(F)}},delay:{get:function(){return this.ops.delay.current},set:function(F){this.ops.delay.onChange(F)}},hold:{get:function(){return this.ops.hold.current},set:function(F){this.ops.hold.onChange(F)}},flowCounter:{get:function(){return this.counters[0]},set:function(F){this.counters[0]=F}},frameCounter:{get:function(){return this.counters[1]},set:function(F){this.counters[1]=F}},animCounter:{get:function(){return this.counters[2]},set:function(F){this.counters[2]=F}},elapsed:{get:function(){return this.counters[3]},set:function(F){this.counters[3]=F}},stopCounter:{get:function(){return this.counters[4]},set:function(F){this.counters[4]=F}},completeFlag:{get:function(){return this.counters[5]},set:function(F){this.counters[5]=F}},zoneIndex:{get:function(){return this.counters[6]},set:function(F){this.counters[6]=F}},zoneTotal:{get:function(){return this.counters[7]},set:function(F){this.counters[7]=F}},currentFrame:{get:function(){return this.counters[8]},set:function(F){this.counters[8]=F}},currentAnim:{get:function(){return this.counters[9]},set:function(F){this.counters[9]=F}},preDestroy:function(){this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var F,B=this.ops;for(F=0;F{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(59996),c=t(61340),a=new c,r=new c,n=new c,e=new c,s=function(h,i,o,f){var l=a,u=r,v=n,m=e;f?(m.loadIdentity(),m.multiply(f),m.translate(i.x,i.y),m.rotate(i.rotation),m.scale(i.scaleX,i.scaleY)):m.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY);var x=h.currentContext,g=o.roundPixels,y=o.alpha,T=i.alpha,E=i.alive,P=E.length,R=i.viewBounds;if(!(!i.visible||P===0||R&&!d(R,o.worldView))){i.sortCallback&&i.depthSort(),o.addToRenderList(i);var M=i.scrollFactorX,L=i.scrollFactorY;x.save(),x.globalCompositeOperation=h.blendModes[i.blendMode];for(var O=0;O0&&X.height>0){var H=-V.halfWidth,G=-V.halfHeight;x.globalAlpha=I,x.save(),u.setToContext(x),g&&(H=Math.round(H),G=Math.round(G)),x.imageSmoothingEnabled=!V.source.scaleMode,x.drawImage(V.source.image,X.x,X.y,X.width,X.height,H,G,X.width,X.height),x.restore()}}}x.restore()}};p.exports=s},92730:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(95540),n=t(31600);c.register("particles",function(e,s){e===void 0&&(e={});var h=a(e,"key",null),i=r(e,"config",null),o=new n(this.scene,0,0,h);return s!==void 0&&(e.add=s),d(this.scene,o,e),i&&o.setConfig(i),o})},676:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(31600);d.register("particles",function(a,r,n,e){return a!==void 0&&typeof a=="string"&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new c(this.scene,a,r,n,e))})},90668:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(21188),a=t(9871),p.exports={renderWebGL:c,renderCanvas:a}},21188:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(59996),c=t(61340),a=t(70554),r=new c,n=new c,e=new c,s=new c,h=function(i,o,f,l){var u=i.pipelines.set(o.pipeline),v=r,m=n,x=e,g=s;l?(g.loadIdentity(),g.multiply(l),g.translate(o.x,o.y),g.rotate(o.rotation),g.scale(o.scaleX,o.scaleY)):g.applyITRS(o.x,o.y,o.rotation,o.scaleX,o.scaleY);var y=a.getTintAppendFloatAlpha,T=f.alpha,E=o.alpha;i.pipelines.preBatch(o);var P=o.alive,R=P.length,M=o.viewBounds;if(!(R===0||M&&!d(M,f.worldView))){o.sortCallback&&o.depthSort(),f.addToRenderList(o),v.copyFrom(f.matrix),v.multiplyWithOffset(g,-f.scrollX*o.scrollFactorX,-f.scrollY*o.scrollFactorY),i.setBlendMode(o.blendMode),o.mask&&(o.mask.preRenderWebGL(i,o,f),i.pipelines.set(o.pipeline));for(var L=o.tintFill,O,D,I=0;I{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e){r===void 0&&(r=0),n===void 0&&(n=0),e===void 0&&(e=!0),this.emitter,this.x=r,this.y=n,this.active=e},update:function(){},destroy:function(){this.emitter=null}});p.exports=c},9774:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},812:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="deathzone"},30522:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="explode"},96695:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="start"},18677:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stop"},20696:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={COMPLETE:t(9774),DEATH_ZONE:t(812),EXPLODE:t(30522),START:t(96695),STOP:t(18677)}},18404:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={EmitterColorOp:t(76472),EmitterOp:t(44777),Events:t(20696),GravityWell:t(24502),Particle:t(56480),ParticleBounds:t(69601),ParticleEmitter:t(31600),ParticleProcessor:t(20286),Zones:t(21024)}},26388:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n){this.source=r,this.killOnEnter=n},willKill:function(a){var r=a.worldPosition,n=this.source.contains(r.x,r.y);return n&&this.killOnEnter||!n&&!this.killOnEnter}});p.exports=c},19909:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s,h,i){s===void 0&&(s=!1),h===void 0&&(h=!0),i===void 0&&(i=-1),this.source=r,this.points=[],this.quantity=n,this.stepRate=e,this.yoyo=s,this.counter=-1,this.seamless=h,this._length=0,this._direction=0,this.total=i,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var a=this.points[0],r=this.points[this.points.length-1];a.x===r.x&&a.y===r.y&&this.points.pop()}var n=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(a){return this.source=a,this.updateSource()},getPoint:function(a){this._direction===0?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,this.counter===-1&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var r=this.points[this.counter];r&&(a.x=r.x,a.y=r.y)}});p.exports=c},68875:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(26099),a=new d({initialize:function(n){this.source=n,this._tempVec=new c,this.total=-1},getPoint:function(r){var n=this._tempVec;this.source.getRandomPoint(n),r.x=n.x,r.y=n.y}});p.exports=a},21024:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={DeathZone:t(26388),EdgeZone:t(19909),RandomZone:t(68875)}},1159:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(68287),r=new d({Extends:a,Mixins:[c.PathFollower],initialize:function(e,s,h,i,o,f){a.call(this,e,h,i,o,f),this.path=s},preUpdate:function(n,e){this.anims.update(n,e),this.pathUpdate(n)}});p.exports=r},90145:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(1159);d.register("follower",function(a,r,n,e,s){var h=new c(this.scene,a,r,n,e,s);return this.displayList.add(h),this.updateList.add(h),h})},33663:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(9674),c=t(83419),a=t(48803),r=t(90664),n=t(4703),e=t(45650),s=new c({Extends:n,initialize:function(i,o,f,l,u,v,m,x){l||(l="__DEFAULT"),n.call(this,i,o,f,l,u),this.type="Plane",this.anims=new d(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(v,m,x),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(h,i,o){h===void 0&&(h=8),i===void 0&&(i=8),o===void 0&&(o=!1);var f=!1;return o&&(f=!0),this.gridWidth=h,this.gridHeight=i,this.isTiled=o,this.clear(),a({mesh:this,widthSegments:h,heightSegments:i,isOrtho:!1,tile:o,flipY:f}),this},setSizeToFrame:function(h){h===void 0&&(h=!0);var i=this.frame;if(this.setPerspective(this.width/i.width,this.height/i.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!h)return this;var o=this.gridWidth,f=this.gridHeight,l=this.vertices,u=i.u0,v=i.u1,m=i.v0,x=i.v1,g,y,T=0;if(this.isTiled)for(m=i.v1,x=i.v0,y=0;y7&&g>7?m.push(u.r,u.g,u.b,o):m.push(v.r,v.g,v.b,f);var y=this.scene.sys.textures.addUint8Array(e(),new Uint8Array(m),16,16);return this.removeCheckerboard(),this.setTexture(y),this.setSizeToFrame(),this.setViewHeight(l),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(h,i){return this.anims.play(h,i)},playReverse:function(h,i){return this.anims.playReverse(h,i)},playAfterDelay:function(h,i){return this.anims.playAfterDelay(h,i)},playAfterRepeat:function(h,i){return this.anims.playAfterRepeat(h,i)},stop:function(){return this.anims.stop()},stopAfterDelay:function(h){return this.anims.stopAfterDelay(h)},stopAfterRepeat:function(h){return this.anims.stopAfterRepeat(h)},stopOnFrame:function(h){return this.anims.stopOnFrame(h)},preUpdate:function(h,i){n.prototype.preUpdate.call(this,h,i),this.anims.update(h,i)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});p.exports=s},56015:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(13059),a=t(44603),r=t(23568),n=t(35154),e=t(33663);a.register("plane",function(s,h){s===void 0&&(s={});var i=r(s,"key",null),o=r(s,"frame",null),f=n(s,"width",8),l=n(s,"height",8),u=n(s,"tile",!1),v=new e(this.scene,0,0,i,o,f,l,u);h!==void 0&&(s.add=h);var m=n(s,"checkerboard",null);if(m){var x=n(m,"color1",16777215),g=n(m,"color2",255),y=n(m,"alpha1",255),T=n(m,"alpha2",255),E=n(m,"height",128);v.createCheckerboard(x,g,y,T,E)}return d(this.scene,v,s),c(v,s),v})},30985:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33663),c=t(39429);c.register("plane",function(a,r,n,e,s,h,i){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i))})},80321:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(30100),n=t(36060),e=t(67277),s=new d({Extends:a,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.Mask,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Transform,c.Visible,e],initialize:function(i,o,f,l,u,v,m){l===void 0&&(l=16777215),u===void 0&&(u=128),v===void 0&&(v=1),m===void 0&&(m=.1),a.call(this,i,"PointLight"),this.initPipeline(n.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(o,f),this.color=r(l),this.intensity=v,this.attenuation=m,this.width=u*2,this.height=u*2,this._radius=u},radius:{get:function(){return this._radius},set:function(h){this._radius=h,this.width=h*2,this.height=h*2}},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});p.exports=s},39829:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(80321);c.register("pointlight",function(n,e){n===void 0&&(n={});var s=a(n,"color",16777215),h=a(n,"radius",128),i=a(n,"intensity",1),o=a(n,"attenuation",.1),f=new r(this.scene,0,0,s,h,i,o);return e!==void 0&&(n.add=e),d(this.scene,f,n),f})},71255:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(80321);d.register("pointlight",function(a,r,n,e,s,h){return this.displayList.add(new c(this.scene,a,r,n,e,s,h))})},67277:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(57787),p.exports={renderWebGL:c,renderCanvas:a}},57787:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=function(a,r,n,e){n.addToRenderList(r);var s=a.pipelines.set(r.pipeline),h=d(r,n,e).calc,i=r.width,o=r.height,f=-r._radius,l=-r._radius,u=f+i,v=l+o,m=h.getX(0,0),x=h.getY(0,0),g=h.getX(f,l),y=h.getY(f,l),T=h.getX(f,v),E=h.getY(f,v),P=h.getX(u,v),R=h.getY(u,v),M=h.getX(u,l),L=h.getY(u,l);a.pipelines.preBatch(r),s.batchPointLight(r,n,g,y,T,E,P,R,M,L,m,x),a.pipelines.postBatch(r)};p.exports=c},591:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(81320),a=t(88571),r=new d({Extends:a,initialize:function(e,s,h,i,o){s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=32),o===void 0&&(o=32);var f=new c(e.sys.textures,"",i,o);a.call(this,e,s,h,f),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(n,e){this.width=n,this.height=e,this.texture.setSize(n,e),this.updateDisplayOrigin();var s=this.input;return s&&!s.customHitArea&&(s.hitArea.width=n,s.hitArea.height=e),this},resize:function(n,e){return this.setSize(n,e),this},saveTexture:function(n){var e=this.texture;return e.key=n,e.manager.addDynamicTexture(e)&&(this._saved=!0),e},fill:function(n,e,s,h,i,o){return this.texture.fill(n,e,s,h,i,o),this},clear:function(){return this.texture.clear(),this},stamp:function(n,e,s,h,i){return this.texture.stamp(n,e,s,h,i),this},erase:function(n,e,s){return this.texture.erase(n,e,s),this},draw:function(n,e,s,h,i){return this.texture.draw(n,e,s,h,i),this},drawFrame:function(n,e,s,h,i,o){return this.texture.drawFrame(n,e,s,h,i,o),this},repeat:function(n,e,s,h,i,o,f,l,u){return this.texture.repeat(n,e,s,h,i,o,f,l,u),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(n,e,s,h,i){return this.texture.batchDraw(n,e,s,h,i),this},batchDrawFrame:function(n,e,s,h,i,o){return this.texture.batchDrawFrame(n,e,s,h,i,o),this},endDraw:function(n){return this.texture.endDraw(n),this},snapshotArea:function(n,e,s,h,i,o,f){return this.texture.snapshotArea(n,e,s,h,i,o,f),this},snapshot:function(n,e,s){return this.snapshotArea(0,0,this.width,this.height,n,e,s)},snapshotPixel:function(n,e,s){return this.snapshotArea(n,e,1,1,s,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});p.exports=r},34495:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(591);c.register("renderTexture",function(n,e){n===void 0&&(n={});var s=a(n,"x",0),h=a(n,"y",0),i=a(n,"width",32),o=a(n,"height",32),f=new r(this.scene,s,h,i,o);return e!==void 0&&(n.add=e),d(this.scene,f,n),f})},60505:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(591);d.register("renderTexture",function(a,r,n,e){return this.displayList.add(new c(this.scene,a,r,n,e))})},77757:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(9674),c=t(83419),a=t(31401),r=t(95643),n=t(36060),e=t(38745),s=t(26099),h=new c({Extends:r,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.Pipeline,a.PostPipeline,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,e],initialize:function(o,f,l,u,v,m,x,g,y){u===void 0&&(u="__DEFAULT"),m===void 0&&(m=2),x===void 0&&(x=!0),r.call(this,o,"Rope"),this.anims=new d(this),this.points=m,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=u==="__DEFAULT",this.dirty=!1,this.horizontal=x,this._flipX=!1,this._flipY=!1,this._perp=new s,this.debugCallback=null,this.debugGraphic=null,this.setTexture(u,v),this.setPosition(f,l),this.setSizeToFrame(),this.initPipeline(n.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(m)&&this.resizeArrays(m.length),this.setPoints(m,g,y),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(i,o){var f=this.anims.currentFrame;this.anims.update(i,o),this.anims.currentFrame!==f&&(this.updateUVs(),this.updateVertices())},play:function(i,o,f){return this.anims.play(i,o,f),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(i,o,f){return i===void 0&&(i=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(i,o,f))},setVertical:function(i,o,f){return i===void 0&&(i=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(i,o,f)):this},setTintFill:function(i){return i===void 0&&(i=!1),this.tintFill=i,this},setAlphas:function(i,o){var f=this.points.length;if(f<1)return this;var l=this.alphas;i===void 0?i=[1]:!Array.isArray(i)&&o===void 0&&(i=[i]);var u,v=0;if(o!==void 0)for(u=0;uv&&(m=i[v]),l[v]=m,i.length>v+1&&(m=i[v+1]),l[v+1]=m}return this},setColors:function(i){var o=this.points.length;if(o<1)return this;var f=this.colors;i===void 0?i=[16777215]:Array.isArray(i)||(i=[i]);var l,u=0;if(i.length===o)for(l=0;lu&&(v=i[u]),f[u]=v,i.length>u+1&&(v=i[u+1]),f[u+1]=v}return this},setPoints:function(i,o,f){if(i===void 0&&(i=2),typeof i=="number"){var l=i;l<2&&(l=2),i=[];var u,v,m;if(this.horizontal)for(m=-this.frame.halfWidth,v=this.frame.width/(l-1),u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){};p.exports=C},26209:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(35154),n=t(77757);c.register("rope",function(e,s){e===void 0&&(e={});var h=a(e,"key",null),i=a(e,"frame",null),o=a(e,"horizontal",!0),f=r(e,"points",void 0),l=r(e,"colors",void 0),u=r(e,"alphas",void 0),v=new n(this.scene,0,0,h,i,f,o,l,u);return s!==void 0&&(e.add=s),d(this.scene,v,e),v})},96819:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(77757),c=t(39429);c.register("rope",function(a,r,n,e,s,h,i,o){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i,o))})},38745:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(20439),a=t(95262),p.exports={renderWebGL:c,renderCanvas:a}},20439:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline,n),i=d(n,e,s).calc,o=n.vertices,f=n.uv,l=n.colors,u=n.alphas,v=n.alpha,m=c.getTintAppendFloatAlpha,x=e.roundPixels,g=o.length,y=Math.floor(g*.5);h.flush(),r.pipelines.preBatch(n);var T=h.setGameObject(n),E=h.vertexViewF32,P=h.vertexViewU32,R=h.vertexCount*h.currentShader.vertexComponentCount-1,M=0,L=n.tintFill;n.dirty&&n.updateVertices();for(var O=n.debugCallback,D=[],I=0;I{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(95540),n=t(79291),e=t(61622),s=t(25479),h=t(61340),i=t(95428),o=t(92503),f=new d({Extends:a,Mixins:[c.ComputedSize,c.Depth,c.GetBounds,c.Mask,c.Origin,c.ScrollFactor,c.Transform,c.Visible,s],initialize:function(u,v,m,x,g,y,T,E){m===void 0&&(m=0),x===void 0&&(x=0),g===void 0&&(g=128),y===void 0&&(y=128),a.call(this,u,"Shader"),this.blendMode=-1,this.shader;var P=u.sys.renderer;this.renderer=P,this.gl=P.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=P.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this._deferSetShader=null,this._deferProjOrtho=null,this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=P.width,this._rendererHeight=P.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(m,x),this.setSize(g,y),this.setOrigin(.5,.5),this.setShader(v,T,E),this.renderer.on(o.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(l){return this.renderToTexture?!0:!(a.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&l.id)},setRenderToTexture:function(l,u){if(u===void 0&&(u=!1),!this.renderToTexture){var v=this.width,m=this.height,x=this.renderer;this.glTexture=x.createTextureFromSource(null,v,m,0),this.glTexture.flipY=u,this.framebuffer=x.createFramebuffer(v,m,this.glTexture,!1),this._rendererWidth=v,this._rendererHeight=m,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),l&&(this.texture=this.scene.sys.textures.addGLTexture(l,this.glTexture))}return this.shader&&(x.pipelines.clear(),this.load(),this.flush(),x.pipelines.rebind()),this},setShader:function(l,u,v){if(this.renderer.contextLost)return this._deferSetShader={key:l,textures:u,textureData:v},this;if(u===void 0&&(u=[]),typeof l=="string"){var m=this.scene.sys.cache.shader;if(!m.has(l))return console.warn("Shader missing: "+l),this;this.shader=m.get(l)}else this.shader=l;var x=this.gl,g=this.renderer;this.program&&g.deleteProgram(this.program);var y=g.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);x.uniformMatrix4fv(x.getUniformLocation(y.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),x.uniformMatrix4fv(x.getUniformLocation(y.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),x.uniform2f(x.getUniformLocation(y.webGLProgram,"uResolution"),this.width,this.height),this.program=y;var T=new Date,E={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[T.getFullYear(),T.getMonth(),T.getDate(),T.getHours()*60*60+T.getMinutes()*60+T.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=n(!0,{},this.shader.uniforms,E):this.uniforms=E;for(var P=0;P<4;P++)u[P]&&this.setSampler2D("iChannel"+P,u[P],P,v);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(l){return this.pointer=l,this},projOrtho:function(l,u,v,m){if(this.renderer.contextLost){this._deferProjOrtho={left:l,right:u,bottom:v,top:m};return}var x=-1e3,g=1e3,y=1/(l-u),T=1/(v-m),E=1/(x-g),P=this.projectionMatrix;P[0]=-2*y,P[5]=-2*T,P[10]=2*E,P[12]=(l+u)*y,P[13]=(m+v)*T,P[14]=(g+x)*E;var R=this.program,M=this.gl,L=this.renderer;L.setProgram(R),M.uniformMatrix4fv(M.getUniformLocation(R.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=u,this._rendererHeight=v},initUniforms:function(){var l=this.renderer.glFuncMap,u=this.program;this._textureCount=0;for(var v in this.uniforms){var m=this.uniforms[v],x=m.type,g=l[x];m.uniformLocation=this.renderer.createUniformLocation(u,v),x!=="sampler2D"&&(m.glMatrix=g.matrix,m.glValueLength=g.length,m.glFunc=g.func)}},setSampler2DBuffer:function(l,u,v,m,x,g){x===void 0&&(x=0),g===void 0&&(g={});var y=this.uniforms[l];return y.value=u,g.width=v,g.height=m,y.textureData=g,this._textureCount=x,this.initSampler2D(y),this},setSampler2D:function(l,u,v,m){v===void 0&&(v=0);var x=this.scene.sys.textures;if(x.exists(u)){var g=x.getFrame(u);if(g.glTexture&&g.glTexture.isRenderTexture)return this.setSampler2DBuffer(l,g.glTexture,g.width,g.height,v,m);var y=this.uniforms[l],T=g.source;y.textureKey=u,y.source=T.image,y.value=g.glTexture,T.isGLTexture&&(m||(m={}),m.width=T.width,m.height=T.height),m&&(y.textureData=m),this._textureCount=v,this.initSampler2D(y)}return this},setUniform:function(l,u){return e(this.uniforms,l,u),this},getUniform:function(l){return r(this.uniforms,l,null)},setChannel0:function(l,u){return this.setSampler2D("iChannel0",l,0,u)},setChannel1:function(l,u){return this.setSampler2D("iChannel1",l,1,u)},setChannel2:function(l,u){return this.setSampler2D("iChannel2",l,2,u)},setChannel3:function(l,u){return this.setSampler2D("iChannel3",l,3,u)},initSampler2D:function(l){if(l.value){var u=this.gl;u.activeTexture(u.TEXTURE0+this._textureCount),u.bindTexture(u.TEXTURE_2D,l.value.webGLTexture);var v=l.textureData;if(v&&!l.value.isRenderTexture){var m=l.value,x=u[r(v,"magFilter","linear").toUpperCase()],g=u[r(v,"minFilter","linear").toUpperCase()],y=u[r(v,"wrapS","repeat").toUpperCase()],T=u[r(v,"wrapT","repeat").toUpperCase()],E=u[r(v,"format","rgba").toUpperCase()];if(v.repeat&&(y=u.REPEAT,T=u.REPEAT),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!!v.flipY),v.width){var P=r(v,"width",512),R=r(v,"height",2),M=r(v,"border",0);u.texImage2D(u.TEXTURE_2D,0,E,P,R,M,E,u.UNSIGNED_BYTE,null),m.width=P,m.height=R}else u.texImage2D(u.TEXTURE_2D,0,E,u.RGBA,u.UNSIGNED_BYTE,l.source);u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,x),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,g),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,y),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,T),m.magFilter=x,m.minFilter=g,m.wrapS=y,m.wrapT=T,m.format=E,m.flipY=!!v.flipY,m.pixels=l.source}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var l=this.gl,u=this.uniforms,v,m,x,g,y,T=0;for(var E in u)v=u[E],x=v.glFunc,m=v.glValueLength,g=v.uniformLocation,y=v.value,y!==null&&(m===1?v.glMatrix?x.call(l,g.webGLUniformLocation,v.transpose,y):x.call(l,g.webGLUniformLocation,y):m===2?x.call(l,g.webGLUniformLocation,y.x,y.y):m===3?x.call(l,g.webGLUniformLocation,y.x,y.y,y.z):m===4?x.call(l,g.webGLUniformLocation,y.x,y.y,y.z,y.w):v.type==="sampler2D"&&(l.activeTexture(l.TEXTURE0+T),l.bindTexture(l.TEXTURE_2D,y.webGLTexture),l.uniform1i(g.webGLUniformLocation,T),T++))},load:function(l){var u=this.gl,v=this.width,m=this.height,x=this.renderer,g=this.program,y=this.viewMatrix;if(!this.renderToTexture){var T=-this._displayOriginX,E=-this._displayOriginY;y[0]=l[0],y[1]=l[1],y[4]=l[2],y[5]=l[3],y[8]=l[4],y[9]=l[5],y[12]=y[0]*T+y[4]*E,y[13]=y[1]*T+y[5]*E}u.useProgram(g.webGLProgram),u.uniformMatrix4fv(u.getUniformLocation(g.webGLProgram,"uViewMatrix"),!1,y),u.uniformMatrix4fv(u.getUniformLocation(g.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),u.uniform2f(u.getUniformLocation(g.webGLProgram,"uResolution"),this.width,this.height);var P=this.uniforms,R=P.resolution;R.value.x=v,R.value.y=m,P.time.value=x.game.loop.getDuration();var M=this.pointer;if(M){var L=P.mouse,O=M.x/v,D=1-M.y/m;L.value.x=O.toFixed(2),L.value.y=D.toFixed(2)}this.syncUniforms()},flush:function(){var l=this.width,u=this.height,v=this.program,m=this.gl,x=this.vertexBuffer,g=this.renderer,y=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(g.setFramebuffer(this.framebuffer),m.clearColor(0,0,0,0),m.clear(m.COLOR_BUFFER_BIT)),m.bindBuffer(m.ARRAY_BUFFER,x.webGLBuffer);var T=m.getAttribLocation(v.webGLProgram,"inPosition");T!==-1&&(m.enableVertexAttribArray(T),m.vertexAttribPointer(T,2,m.FLOAT,!1,y,0));var E=this.vertexViewF32;E[3]=u,E[4]=l,E[5]=u,E[8]=l,E[9]=u,E[10]=l;var P=6;m.bufferSubData(m.ARRAY_BUFFER,0,this.bytes.subarray(0,P*y)),m.drawArrays(m.TRIANGLES,0,P),this.renderToTexture&&g.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var l=this._deferSetShader.key,u=this._deferSetShader.textures,v=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(l,u,v)}if(this._deferProjOrtho!==null){var m=this._deferProjOrtho.left,x=this._deferProjOrtho.right,g=this._deferProjOrtho.bottom,y=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(m,x,g,y)}},preDestroy:function(){var l=this.renderer;l.off(o.RESTORE_WEBGL,this.onContextRestored,this),l.deleteProgram(this.program),l.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(l.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),i(this.uniforms,function(u){l.deleteUniformLocation(u.uniformLocation),u.uniformLocation=null})}});p.exports=f},80464:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){};p.exports=C},54935:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(20071);c.register("shader",function(n,e){n===void 0&&(n={});var s=a(n,"key",null),h=a(n,"x",0),i=a(n,"y",0),o=a(n,"width",128),f=a(n,"height",128),l=new r(this.scene,s,h,i,o,f);return e!==void 0&&(n.add=e),d(this.scene,l,n),l})},74177:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20071),c=t(39429);c.register("shader",function(a,r,n,e,s,h,i){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i))})},25479:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(19257),a=t(80464),p.exports={renderWebGL:c,renderCanvas:a}},19257:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=function(a,r,n,e){if(r.shader){if(n.addToRenderList(r),a.pipelines.clear(),r.renderToTexture)r.load(),r.flush();else{var s=d(r,n,e).calc;(a.width!==r._rendererWidth||a.height!==r._rendererHeight)&&r.projOrtho(0,a.width,a.height,0),r.load(s.matrix),r.flush()}a.pipelines.rebind()}};p.exports=c},10441:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70554),c=function(a,r,n,e,s,h){for(var i=d.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*e),o=n.pathData,f=n.pathIndexes,l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=c||d.fillColor,n=a||d.fillAlpha,e=(r&16711680)>>>16,s=(r&65280)>>>8,h=r&255;t.fillStyle="rgba("+e+","+s+","+h+","+n+")"};p.exports=C},75177:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=c||d.strokeColor,n=a||d.strokeAlpha,e=(r&16711680)>>>16,s=(r&65280)>>>8,h=r&255;t.strokeStyle="rgba("+e+","+s+","+h+","+n+")",t.lineWidth=d.lineWidth};p.exports=C},17803:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(95643),r=t(23031),n=new d({Extends:a,Mixins:[c.AlphaSingle,c.BlendMode,c.Depth,c.GetBounds,c.Mask,c.Origin,c.Pipeline,c.PostPipeline,c.ScrollFactor,c.Transform,c.Visible],initialize:function(s,h,i){h===void 0&&(h="Shape"),a.call(this,s,h),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new r,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(e,s){return s===void 0&&(s=1),e===void 0?this.isFilled=!1:(this.fillColor=e,this.fillAlpha=s,this.isFilled=!0),this},setStrokeStyle:function(e,s,h){return h===void 0&&(h=1),e===void 0?this.isStroked=!1:(this.lineWidth=e,this.strokeColor=s,this.strokeAlpha=h,this.isStroked=!0),this},setClosePath:function(e){return this.closePath=e,this},setSize:function(e,s){return this.width=e,this.height=s,this},setDisplaySize:function(e,s){return this.displayWidth=e,this.displayHeight=s,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(e){this.scaleX=e/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(e){this.scaleY=e/this.height}}});p.exports=n},34682:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70554),c=function(a,r,n,e,s){var h=a.strokeTint,i=d.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n);h.TL=i,h.TR=i,h.BL=i,h.BR=i;var o=r.pathData,f=o.length-1,l=r.lineWidth,u=l/2,v=o[0]-e,m=o[1]-s;r.closePath||(f-=2);for(var x=2;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13609),c=t(83419),a=t(39506),r=t(94811),n=t(96503),e=t(36383),s=t(17803),h=new c({Extends:s,Mixins:[d],initialize:function(o,f,l,u,v,m,x,g,y){f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=128),v===void 0&&(v=0),m===void 0&&(m=360),x===void 0&&(x=!1),s.call(this,o,"Arc",new n(0,0,u)),this._startAngle=v,this._endAngle=m,this._anticlockwise=x,this._iterations=.01,this.setPosition(f,l);var T=this.geom.radius*2;this.setSize(T,T),g!==void 0&&this.setFillStyle(g,y),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(i){this._iterations=i,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(i){this.geom.radius=i;var o=i*2;this.setSize(o,o),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(i){this._startAngle=i,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(i){this._endAngle=i,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(i){this._anticlockwise=i,this.updateData()}},setRadius:function(i){return this.radius=i,this},setIterations:function(i){return i===void 0&&(i=.01),this.iterations=i,this},setStartAngle:function(i,o){return this._startAngle=i,o!==void 0&&(this._anticlockwise=o),this.updateData()},setEndAngle:function(i,o){return this._endAngle=i,o!==void 0&&(this._anticlockwise=o),this.updateData()},updateData:function(){var i=this._iterations,o=i,f=this.geom.radius,l=a(this._startAngle),u=a(this._endAngle),v=this._anticlockwise,m=f,x=f;u-=l,v?u<-e.PI2?u=-e.PI2:u>0&&(u=-e.PI2+u%e.PI2):u>e.PI2?u=e.PI2:u<0&&(u=e.PI2+u%e.PI2);for(var g=[m+Math.cos(l)*f,x+Math.sin(l)*f],y;o<1;)y=u*o+l,g.push(m+Math.cos(y)*f,x+Math.sin(y)*f),o+=i;return y=u+l,g.push(m+Math.cos(y)*f,x+Math.sin(y)*f),g.push(m+Math.cos(l)*f,x+Math.sin(l)*f),this.pathIndexes=r(g),this.pathData=g,this}});p.exports=h},42542:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39506),c=t(65960),a=t(75177),r=t(20926),n=function(e,s,h,i){h.addToRenderList(s);var o=e.currentContext;if(r(e,o,s,h,i)){var f=s.radius;o.beginPath(),o.arc(f-s.originX*(f*2),f-s.originY*(f*2),f,d(s._startAngle),d(s._endAngle),s.anticlockwise),s.closePath&&o.closePath(),s.isFilled&&(c(o,s),o.fill()),s.isStroked&&(a(o,s),o.stroke()),o.restore()}};p.exports=n},42563:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23629),c=t(39429);c.register("arc",function(a,r,n,e,s,h,i,o){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i,o))}),c.register("circle",function(a,r,n,e,s){return this.displayList.add(new d(this.scene,a,r,n,0,360,!1,e,s))})},13609:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(41447),a=t(42542),p.exports={renderWebGL:c,renderCanvas:a}},41447:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(10441),a=t(34682),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=d(e,s,h),f=i.calcMatrix.copyFrom(o.calc),l=e._displayOriginX,u=e._displayOriginY,v=s.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&c(i,f,e,v,l,u),e.isStroked&&a(i,e,v,l,u),n.pipelines.postBatch(e)};p.exports=r},89:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(33141),a=t(94811),r=t(87841),n=t(17803),e=new d({Extends:n,Mixins:[c],initialize:function(h,i,o,f,l,u){i===void 0&&(i=0),o===void 0&&(o=0),n.call(this,h,"Curve",f),this._smoothness=32,this._curveBounds=new r,this.closePath=!1,this.setPosition(i,o),l!==void 0&&this.setFillStyle(l,u),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(s){this._smoothness=s,this.updateData()}},setSmoothness:function(s){return this._smoothness=s,this.updateData()},updateData:function(){var s=this._curveBounds,h=this._smoothness;this.geom.getBounds(s,h),this.setSize(s.width,s.height),this.updateDisplayOrigin();for(var i=[],o=this.geom.getPoints(h),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX+e._curveBounds.x,f=e._displayOriginY+e._curveBounds.y,l=e.pathData,u=l.length-1,v=l[0]-o,m=l[1]-f;i.beginPath(),i.moveTo(v,m),e.closePath||(u-=2);for(var x=2;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(89);d.register("curve",function(a,r,n,e,s){return this.displayList.add(new c(this.scene,a,r,n,e,s))})},33141:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(53987),a=t(3170),p.exports={renderWebGL:c,renderCanvas:a}},53987:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10441),c=t(91296),a=t(34682),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=c(e,s,h),f=i.calcMatrix.copyFrom(o.calc),l=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,v=s.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&d(i,f,e,v,l,u),e.isStroked&&a(i,e,v,l,u),n.pipelines.postBatch(e)};p.exports=r},19921:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(94811),a=t(54205),r=t(8497),n=t(17803),e=new d({Extends:n,Mixins:[a],initialize:function(h,i,o,f,l,u,v){i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=128),l===void 0&&(l=128),n.call(this,h,"Ellipse",new r(f/2,l/2,f,l)),this._smoothness=64,this.setPosition(i,o),this.width=f,this.height=l,u!==void 0&&this.setFillStyle(u,v),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(s){this._smoothness=s,this.updateData()}},setSize:function(s,h){return this.width=s,this.height=h,this.geom.setPosition(s/2,h/2),this.geom.setSize(s,h),this.updateData()},setSmoothness:function(s){return this._smoothness=s,this.updateData()},updateData:function(){for(var s=[],h=this.geom.getPoints(this._smoothness),i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX,f=e._displayOriginY,l=e.pathData,u=l.length-1,v=l[0]-o,m=l[1]-f;i.beginPath(),i.moveTo(v,m),e.closePath||(u-=2);for(var x=2;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19921),c=t(39429);c.register("ellipse",function(a,r,n,e,s,h){return this.displayList.add(new d(this.scene,a,r,n,e,s,h))})},54205:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(19467),a=t(7930),p.exports={renderWebGL:c,renderCanvas:a}},19467:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10441),c=t(91296),a=t(34682),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=c(e,s,h),f=i.calcMatrix.copyFrom(o.calc),l=e._displayOriginX,u=e._displayOriginY,v=s.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&d(i,f,e,v,l,u),e.isStroked&&a(i,e,v,l,u),n.pipelines.postBatch(e)};p.exports=r},30479:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(17803),a=t(26015),r=new d({Extends:c,Mixins:[a],initialize:function(e,s,h,i,o,f,l,u,v,m,x){s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=128),o===void 0&&(o=128),f===void 0&&(f=32),l===void 0&&(l=32),c.call(this,e,"Grid",null),this.cellWidth=f,this.cellHeight=l,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(s,h),this.setSize(i,o),this.setFillStyle(u,v),m!==void 0&&this.setOutlineStyle(m,x),this.updateDisplayOrigin()},setFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showCells=!1:(this.fillColor=n,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showAltCells=!1:(this.altFillColor=n,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showOutline=!1:(this.outlineFillColor=n,this.outlineFillAlpha=e,this.showOutline=!0),this}});p.exports=r},49912:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=-e._displayOriginX,f=-e._displayOriginY,l=s.alpha*e.alpha,u=e.width,v=e.height,m=e.cellWidth,x=e.cellHeight,g=Math.ceil(u/m),y=Math.ceil(v/x),T=m,E=x,P=m-(g*m-u),R=x-(y*x-v),M=e.showCells,L=e.showAltCells,O=e.showOutline,D=0,I=0,V=0,X=0,H=0;if(O&&(T--,E--,P===m&&P--,R===x&&R--),M&&e.fillAlpha>0)for(d(i,e),I=0;I0)for(d(i,e,e.altFillColor,e.altFillAlpha*l),I=0;I0){for(c(i,e,e.outlineFillColor,e.outlineFillAlpha*l),D=1;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(30479);d.register("grid",function(a,r,n,e,s,h,i,o,f,l){return this.displayList.add(new c(this.scene,a,r,n,e,s,h,i,o,f,l))})},26015:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(46161),a=t(49912),p.exports={renderWebGL:c,renderCanvas:a}},46161:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),i=d(n,e,s),o=h.calcMatrix.copyFrom(i.calc);o.translate(-n._displayOriginX,-n._displayOriginY);var f=e.alpha*n.alpha,l=n.width,u=n.height,v=n.cellWidth,m=n.cellHeight,x=Math.ceil(l/v),g=Math.ceil(u/m),y=v,T=m,E=v-(x*v-l),P=m-(g*m-u),R,M,L=n.showCells,O=n.showAltCells,D=n.showOutline,I=0,V=0,X=0,H=0,G=0;if(D&&(y--,T--,E===v&&E--,P===m&&P--),r.pipelines.preBatch(n),L&&n.fillAlpha>0)for(R=h.fillTint,M=c.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*f),R.TL=M,R.TR=M,R.BL=M,R.BR=M,V=0;V0)for(R=h.fillTint,M=c.getTintAppendFloatAlpha(n.altFillColor,n.altFillAlpha*f),R.TL=M,R.TR=M,R.BL=M,R.BR=M,V=0;V0){var U=h.strokeTint,F=c.getTintAppendFloatAlpha(n.outlineFillColor,n.outlineFillAlpha*f);for(U.TL=F,U.TR=F,U.BL=F,U.BR=F,I=1;I{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(99651),c=t(83419),a=t(17803),r=new c({Extends:a,Mixins:[d],initialize:function(e,s,h,i,o,f,l,u){s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=48),o===void 0&&(o=32),f===void 0&&(f=15658734),l===void 0&&(l=10066329),u===void 0&&(u=13421772),a.call(this,e,"IsoBox",null),this.projection=4,this.fillTop=f,this.fillLeft=l,this.fillRight=u,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(s,h),this.setSize(i,o),this.updateDisplayOrigin()},setProjection:function(n){return this.projection=n,this},setFaces:function(n,e,s){return n===void 0&&(n=!0),e===void 0&&(e=!0),s===void 0&&(s=!0),this.showTop=n,this.showLeft=e,this.showRight=s,this},setFillStyle:function(n,e,s){return this.fillTop=n,this.fillLeft=e,this.fillRight=s,this.isFilled=!0,this}});p.exports=r},11508:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(20926),a=function(r,n,e,s){e.addToRenderList(n);var h=r.currentContext;if(c(r,h,n,e,s)&&n.isFilled){var i=n.width,o=n.height,f=i/2,l=i/n.projection;n.showTop&&(d(h,n,n.fillTop),h.beginPath(),h.moveTo(-f,-o),h.lineTo(0,-l-o),h.lineTo(f,-o),h.lineTo(f,-1),h.lineTo(0,l-1),h.lineTo(-f,-1),h.lineTo(-f,-o),h.fill()),n.showLeft&&(d(h,n,n.fillLeft),h.beginPath(),h.moveTo(-f,0),h.lineTo(0,l),h.lineTo(0,l-o),h.lineTo(-f,-o),h.lineTo(-f,0),h.fill()),n.showRight&&(d(h,n,n.fillRight),h.beginPath(),h.moveTo(f,0),h.lineTo(0,l),h.lineTo(0,l-o),h.lineTo(f,-o),h.lineTo(f,0),h.fill()),h.restore()}};p.exports=a},3933:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(61475);d.register("isobox",function(a,r,n,e,s,h,i){return this.displayList.add(new c(this.scene,a,r,n,e,s,h,i))})},99651:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(68149),a=t(11508),p.exports={renderWebGL:c,renderCanvas:a}},68149:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),i=d(n,e,s),o=h.calcMatrix.copyFrom(i.calc),f=n.width,l=n.height,u=f/2,v=f/n.projection,m=e.alpha*n.alpha;if(n.isFilled){var x,g,y,T,E,P,R,M,L;r.pipelines.preBatch(n),n.showTop&&(x=c.getTintAppendFloatAlpha(n.fillTop,m),g=o.getX(-u,-l),y=o.getY(-u,-l),T=o.getX(0,-v-l),E=o.getY(0,-v-l),P=o.getX(u,-l),R=o.getY(u,-l),M=o.getX(0,v-l),L=o.getY(0,v-l),h.batchQuad(n,g,y,T,E,P,R,M,L,0,0,1,1,x,x,x,x,2)),n.showLeft&&(x=c.getTintAppendFloatAlpha(n.fillLeft,m),g=o.getX(-u,0),y=o.getY(-u,0),T=o.getX(0,v),E=o.getY(0,v),P=o.getX(0,v-l),R=o.getY(0,v-l),M=o.getX(-u,-l),L=o.getY(-u,-l),h.batchQuad(n,g,y,T,E,P,R,M,L,0,0,1,1,x,x,x,x,2)),n.showRight&&(x=c.getTintAppendFloatAlpha(n.fillRight,m),g=o.getX(u,0),y=o.getY(u,0),T=o.getX(0,v),E=o.getY(0,v),P=o.getX(0,v-l),R=o.getY(0,v-l),M=o.getX(u,-l),L=o.getY(u,-l),h.batchQuad(n,g,y,T,E,P,R,M,L,0,0,1,1,x,x,x,x,2)),r.pipelines.postBatch(n)}};p.exports=a},16933:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(60561),a=t(17803),r=new d({Extends:a,Mixins:[c],initialize:function(e,s,h,i,o,f,l,u,v){s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i=48),o===void 0&&(o=32),f===void 0&&(f=!1),l===void 0&&(l=15658734),u===void 0&&(u=10066329),v===void 0&&(v=13421772),a.call(this,e,"IsoTriangle",null),this.projection=4,this.fillTop=l,this.fillLeft=u,this.fillRight=v,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=f,this.isFilled=!0,this.setPosition(s,h),this.setSize(i,o),this.updateDisplayOrigin()},setProjection:function(n){return this.projection=n,this},setReversed:function(n){return this.isReversed=n,this},setFaces:function(n,e,s){return n===void 0&&(n=!0),e===void 0&&(e=!0),s===void 0&&(s=!0),this.showTop=n,this.showLeft=e,this.showRight=s,this},setFillStyle:function(n,e,s){return this.fillTop=n,this.fillLeft=e,this.fillRight=s,this.isFilled=!0,this}});p.exports=r},79590:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(20926),a=function(r,n,e,s){e.addToRenderList(n);var h=r.currentContext;if(c(r,h,n,e,s)&&n.isFilled){var i=n.width,o=n.height,f=i/2,l=i/n.projection,u=n.isReversed;n.showTop&&u&&(d(h,n,n.fillTop),h.beginPath(),h.moveTo(-f,-o),h.lineTo(0,-l-o),h.lineTo(f,-o),h.lineTo(0,l-o),h.fill()),n.showLeft&&(d(h,n,n.fillLeft),h.beginPath(),u?(h.moveTo(-f,-o),h.lineTo(0,l),h.lineTo(0,l-o)):(h.moveTo(-f,0),h.lineTo(0,l),h.lineTo(0,l-o)),h.fill()),n.showRight&&(d(h,n,n.fillRight),h.beginPath(),u?(h.moveTo(f,-o),h.lineTo(0,l),h.lineTo(0,l-o)):(h.moveTo(f,0),h.lineTo(0,l),h.lineTo(0,l-o)),h.fill()),h.restore()}};p.exports=a},49803:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(16933);d.register("isotriangle",function(a,r,n,e,s,h,i,o){return this.displayList.add(new c(this.scene,a,r,n,e,s,h,i,o))})},60561:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(51503),a=t(79590),p.exports={renderWebGL:c,renderCanvas:a}},51503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),i=d(n,e,s),o=h.calcMatrix.copyFrom(i.calc),f=n.width,l=n.height,u=f/2,v=f/n.projection,m=n.isReversed,x=e.alpha*n.alpha;if(n.isFilled){r.pipelines.preBatch(n);var g,y,T,E,P,R,M;if(n.showTop&&m){g=c.getTintAppendFloatAlpha(n.fillTop,x),y=o.getX(-u,-l),T=o.getY(-u,-l),E=o.getX(0,-v-l),P=o.getY(0,-v-l),R=o.getX(u,-l),M=o.getY(u,-l);var L=o.getX(0,v-l),O=o.getY(0,v-l);h.batchQuad(n,y,T,E,P,R,M,L,O,0,0,1,1,g,g,g,g,2)}n.showLeft&&(g=c.getTintAppendFloatAlpha(n.fillLeft,x),m?(y=o.getX(-u,-l),T=o.getY(-u,-l),E=o.getX(0,v),P=o.getY(0,v),R=o.getX(0,v-l),M=o.getY(0,v-l)):(y=o.getX(-u,0),T=o.getY(-u,0),E=o.getX(0,v),P=o.getY(0,v),R=o.getX(0,v-l),M=o.getY(0,v-l)),h.batchTri(n,y,T,E,P,R,M,0,0,1,1,g,g,g,2)),n.showRight&&(g=c.getTintAppendFloatAlpha(n.fillRight,x),m?(y=o.getX(u,-l),T=o.getY(u,-l),E=o.getX(0,v),P=o.getY(0,v),R=o.getX(0,v-l),M=o.getY(0,v-l)):(y=o.getX(u,0),T=o.getY(u,0),E=o.getX(0,v),P=o.getY(0,v),R=o.getX(0,v-l),M=o.getY(0,v-l)),h.batchTri(n,y,T,E,P,R,M,0,0,1,1,g,g,g,2)),r.pipelines.postBatch(n)}};p.exports=a},57847:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(17803),a=t(23031),r=t(36823),n=new d({Extends:c,Mixins:[r],initialize:function(s,h,i,o,f,l,u,v,m){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=128),u===void 0&&(u=0),c.call(this,s,"Line",new a(o,f,l,u));var x=Math.max(1,this.geom.right-this.geom.left),g=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(h,i),this.setSize(x,g),v!==void 0&&this.setStrokeStyle(1,v,m),this.updateDisplayOrigin()},setLineWidth:function(e,s){return s===void 0&&(s=e),this._startWidth=e,this._endWidth=s,this.lineWidth=e,this},setTo:function(e,s,h,i){return this.geom.setTo(e,s,h,i),this}});p.exports=n},17440:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(75177),c=t(20926),a=function(r,n,e,s){e.addToRenderList(n);var h=r.currentContext;if(c(r,h,n,e,s)){var i=n._displayOriginX,o=n._displayOriginY;n.isStroked&&(d(h,n),h.beginPath(),h.moveTo(n.geom.x1-i,n.geom.y1-o),h.lineTo(n.geom.x2-i,n.geom.y2-o),h.stroke()),h.restore()}};p.exports=a},2481:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(57847);d.register("line",function(a,r,n,e,s,h,i,o){return this.displayList.add(new c(this.scene,a,r,n,e,s,h,i,o))})},36823:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(77385),a=t(17440),p.exports={renderWebGL:c,renderCanvas:a}},77385:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(70554),a=function(r,n,e,s){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),i=d(n,e,s);h.calcMatrix.copyFrom(i.calc);var o=n._displayOriginX,f=n._displayOriginY,l=e.alpha*n.alpha;if(r.pipelines.preBatch(n),n.isStroked){var u=h.strokeTint,v=c.getTintAppendFloatAlpha(n.strokeColor,n.strokeAlpha*l);u.TL=v,u.TR=v,u.BL=v,u.BR=v,h.batchLine(n.geom.x1-o,n.geom.y1-f,n.geom.x2-o,n.geom.y2-f,n._startWidth/2,n._endWidth/2,1,0,!1,i.sprite,i.camera)}r.pipelines.postBatch(n)};p.exports=a},24949:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(90273),c=t(83419),a=t(94811),r=t(13829),n=t(25717),e=t(17803),s=t(5469),h=new c({Extends:e,Mixins:[d],initialize:function(o,f,l,u,v,m){f===void 0&&(f=0),l===void 0&&(l=0),e.call(this,o,"Polygon",new n(u));var x=r(this.geom);this.setPosition(f,l),this.setSize(x.width,x.height),v!==void 0&&this.setFillStyle(v,m),this.updateDisplayOrigin(),this.updateData()},smooth:function(i){i===void 0&&(i=1);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX,f=e._displayOriginY,l=e.pathData,u=l.length-1,v=l[0]-o,m=l[1]-f;i.beginPath(),i.moveTo(v,m),e.closePath||(u-=2);for(var x=2;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(24949);d.register("polygon",function(a,r,n,e,s){return this.displayList.add(new c(this.scene,a,r,n,e,s))})},90273:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(73695),a=t(38710),p.exports={renderWebGL:c,renderCanvas:a}},73695:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10441),c=t(91296),a=t(34682),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=c(e,s,h),f=i.calcMatrix.copyFrom(o.calc),l=e._displayOriginX,u=e._displayOriginY,v=s.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&d(i,f,e,v,l,u),e.isStroked&&a(i,e,v,l,u),n.pipelines.postBatch(e)};p.exports=r},74561:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(87841),a=t(17803),r=t(95597),n=new d({Extends:a,Mixins:[r],initialize:function(s,h,i,o,f,l,u){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=128),f===void 0&&(f=128),a.call(this,s,"Rectangle",new c(0,0,o,f)),this.setPosition(h,i),this.setSize(o,f),l!==void 0&&this.setFillStyle(l,u),this.updateDisplayOrigin(),this.updateData()},setSize:function(e,s){this.width=e,this.height=s,this.geom.setSize(e,s),this.updateData(),this.updateDisplayOrigin();var h=this.input;return h&&!h.customHitArea&&(h.hitArea.width=e,h.hitArea.height=s),this},updateData:function(){var e=[],s=this.geom,h=this._tempLine;return s.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),s.getLineB(h),e.push(h.x2,h.y2),s.getLineC(h),e.push(h.x2,h.y2),s.getLineD(h),e.push(h.x2,h.y2),this.pathData=e,this}});p.exports=n},48682:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX,f=e._displayOriginY;e.isFilled&&(d(i,e),i.fillRect(-o,-f,e.width,e.height)),e.isStroked&&(c(i,e),i.beginPath(),i.rect(-o,-f,e.width,e.height),i.stroke()),i.restore()}};p.exports=r},87959:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(74561);d.register("rectangle",function(a,r,n,e,s,h){return this.displayList.add(new c(this.scene,a,r,n,e,s,h))})},95597:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(52059),a=t(48682),p.exports={renderWebGL:c,renderCanvas:a}},52059:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(34682),a=t(70554),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=d(e,s,h);i.calcMatrix.copyFrom(o.calc);var f=e._displayOriginX,l=e._displayOriginY,u=s.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var v=i.fillTint,m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);v.TL=m,v.TR=m,v.BL=m,v.BR=m,i.batchFillRect(-f,-l,e.width,e.height)}e.isStroked&&c(i,e,u,f,l),n.pipelines.postBatch(e)};p.exports=r},55911:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(81991),c=t(83419),a=t(94811),r=t(17803),n=new c({Extends:r,Mixins:[d],initialize:function(s,h,i,o,f,l,u,v){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=5),f===void 0&&(f=32),l===void 0&&(l=64),r.call(this,s,"Star",null),this._points=o,this._innerRadius=f,this._outerRadius=l,this.setPosition(h,i),this.setSize(l*2,l*2),u!==void 0&&this.setFillStyle(u,v),this.updateDisplayOrigin(),this.updateData()},setPoints:function(e){return this._points=e,this.updateData()},setInnerRadius:function(e){return this._innerRadius=e,this.updateData()},setOuterRadius:function(e){return this._outerRadius=e,this.updateData()},points:{get:function(){return this._points},set:function(e){this._points=e,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this.updateData()}},updateData:function(){var e=[],s=this._points,h=this._innerRadius,i=this._outerRadius,o=Math.PI/2*3,f=Math.PI/s,l=i,u=i;e.push(l,u+-i);for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX,f=e._displayOriginY,l=e.pathData,u=l.length-1,v=l[0]-o,m=l[1]-f;i.beginPath(),i.moveTo(v,m),e.closePath||(u-=2);for(var x=2;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(55911),c=t(39429);c.register("star",function(a,r,n,e,s,h,i){return this.displayList.add(new d(this.scene,a,r,n,e,s,h,i))})},81991:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(57017),a=t(64272),p.exports={renderWebGL:c,renderCanvas:a}},57017:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10441),c=t(91296),a=t(34682),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=c(e,s,h),f=i.calcMatrix.copyFrom(o.calc),l=e._displayOriginX,u=e._displayOriginY,v=s.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&d(i,f,e,v,l,u),e.isStroked&&a(i,e,v,l,u),n.pipelines.postBatch(e)};p.exports=r},36931:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(17803),a=t(16483),r=t(96195),n=new d({Extends:c,Mixins:[r],initialize:function(s,h,i,o,f,l,u,v,m,x,g){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=128),l===void 0&&(l=64),u===void 0&&(u=0),v===void 0&&(v=128),m===void 0&&(m=128),c.call(this,s,"Triangle",new a(o,f,l,u,v,m));var y=this.geom.right-this.geom.left,T=this.geom.bottom-this.geom.top;this.setPosition(h,i),this.setSize(y,T),x!==void 0&&this.setFillStyle(x,g),this.updateDisplayOrigin(),this.updateData()},setTo:function(e,s,h,i,o,f){return this.geom.setTo(e,s,h,i,o,f),this.updateData()},updateData:function(){var e=[],s=this.geom,h=this._tempLine;return s.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),s.getLineB(h),e.push(h.x2,h.y2),s.getLineC(h),e.push(h.x2,h.y2),this.pathData=e,this}});p.exports=n},85172:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(65960),c=t(75177),a=t(20926),r=function(n,e,s,h){s.addToRenderList(e);var i=n.currentContext;if(a(n,i,e,s,h)){var o=e._displayOriginX,f=e._displayOriginY,l=e.geom.x1-o,u=e.geom.y1-f,v=e.geom.x2-o,m=e.geom.y2-f,x=e.geom.x3-o,g=e.geom.y3-f;i.beginPath(),i.moveTo(l,u),i.lineTo(v,m),i.lineTo(x,g),i.closePath(),e.isFilled&&(d(i,e),i.fill()),e.isStroked&&(c(i,e),i.stroke()),i.restore()}};p.exports=r},45245:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(36931);d.register("triangle",function(a,r,n,e,s,h,i,o,f,l){return this.displayList.add(new c(this.scene,a,r,n,e,s,h,i,o,f,l))})},96195:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(83253),a=t(85172),p.exports={renderWebGL:c,renderCanvas:a}},83253:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=t(34682),a=t(70554),r=function(n,e,s,h){s.addToRenderList(e);var i=n.pipelines.set(e.pipeline),o=d(e,s,h);i.calcMatrix.copyFrom(o.calc);var f=e._displayOriginX,l=e._displayOriginY,u=s.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var v=i.fillTint,m=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);v.TL=m,v.TR=m,v.BL=m,v.BR=m;var x=e.geom.x1-f,g=e.geom.y1-l,y=e.geom.x2-f,T=e.geom.y2-l,E=e.geom.x3-f,P=e.geom.y3-l;i.batchFillTriangle(x,g,y,T,E,P,o.sprite,o.camera)}e.isStroked&&c(i,e,u,f,l),n.pipelines.postBatch(e)};p.exports=r},68287:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(9674),c=t(83419),a=t(31401),r=t(95643),n=t(92751),e=new c({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Size,a.TextureCrop,a.Tint,a.Transform,a.Visible,n],initialize:function(h,i,o,f,l){r.call(this,h,"Sprite"),this._crop=this.resetCropObject(),this.anims=new d(this),this.setTexture(f,l),this.setPosition(i,o),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(s,h){this.anims.update(s,h)},play:function(s,h){return this.anims.play(s,h)},playReverse:function(s,h){return this.anims.playReverse(s,h)},playAfterDelay:function(s,h){return this.anims.playAfterDelay(s,h)},playAfterRepeat:function(s,h){return this.anims.playAfterRepeat(s,h)},chain:function(s){return this.anims.chain(s)},stop:function(){return this.anims.stop()},stopAfterDelay:function(s){return this.anims.stopAfterDelay(s)},stopAfterRepeat:function(s){return this.anims.stopAfterRepeat(s)},stopOnFrame:function(s){return this.anims.stopOnFrame(s)},toJSON:function(){return a.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});p.exports=e},76552:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d),t.batchSprite(d,d.frame,c,a)};p.exports=C},15567:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(13059),a=t(44603),r=t(23568),n=t(68287);a.register("sprite",function(e,s){e===void 0&&(e={});var h=r(e,"key",null),i=r(e,"frame",null),o=new n(this.scene,0,0,h,i);return s!==void 0&&(e.add=s),d(this.scene,o,e),c(o,e),o})},46409:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(68287);d.register("sprite",function(a,r,n,e){return this.displayList.add(new c(this.scene,a,r,n,e))})},92751:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(9409),a=t(76552),p.exports={renderWebGL:c,renderCanvas:a}},9409:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c.addToRenderList(d),d.pipeline.batchSprite(d,c,a)};p.exports=C},14220:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=t.canvas,r=t.context,n=t.style,e=[],s=0,h=c.length;n.maxLines>0&&n.maxLines1&&(o+=t.letterSpacing*(c[i].length-1)),n.wordWrap&&(o-=r.measureText(" ").width),e[i]=Math.ceil(o),s=Math.max(s,e[i])}var f=d.fontSize+n.strokeThickness,l=f*h,u=t.lineSpacing;return h>1&&(l+=u*(h-1)),{width:s,height:l,lines:h,lineWidths:e,lineSpacing:u,lineHeight:f}};p.exports=C},79557:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=function(a){var r=d.create(this),n=r.getContext("2d",{willReadFrequently:!0});a.syncFont(r,n);var e=n.measureText(a.testString);if("actualBoundingBoxAscent"in e){var s=e.actualBoundingBoxAscent,h=e.actualBoundingBoxDescent;return d.remove(r),{ascent:s,descent:h,fontSize:s+h}}var i=Math.ceil(e.width*a.baselineX),o=i,f=2*o;o=o*a.baselineY|0,r.width=i,r.height=f,n.fillStyle="#f00",n.fillRect(0,0,i,f),n.font=a._font,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a.testString,0,o);var l={ascent:0,descent:0,fontSize:0},u=n.getImageData(0,0,i,f);if(!u)return l.ascent=o,l.descent=o+6,l.fontSize=l.ascent+l.descent,d.remove(r),l;var v=u.data,m=v.length,x=i*4,g,y,T=0,E=!1;for(g=0;go;g--){for(y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(40366),c=t(27919),a=t(83419),r=t(31401),n=t(95643),e=t(14220),s=t(35154),h=t(35846),i=t(61771),o=t(35762),f=t(45650),l=new a({Extends:n,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,i],initialize:function(v,m,x,g,y){m===void 0&&(m=0),x===void 0&&(x=0),n.call(this,v,"Text"),this.renderer=v.sys.renderer,this.setPosition(m,x),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=c.create(this),this.context,this.style=new o(this,y),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.letterSpacing=0,this.style.resolution===0&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=v.sys.textures.addCanvas(this._textureKey,this.canvas),this.context=this.texture.context,this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(g),y&&y.padding&&this.setPadding(y.padding),y&&y.lineSpacing&&this.setLineSpacing(y.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",d(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(u){var v=this.style;if(v.wordWrapCallback){var m=v.wordWrapCallback.call(v.wordWrapCallbackScope,u,this);return Array.isArray(m)&&(m=m.join(` +`)),m}else return v.wordWrapWidth?v.wordWrapUseAdvanced?this.advancedWordWrap(u,this.context,this.style.wordWrapWidth):this.basicWordWrap(u,this.context,this.style.wordWrapWidth):u},advancedWordWrap:function(u,v,m){for(var x="",g=u.replace(/ +/gi," ").split(this.splitRegExp),y=g.length,T=0;TM){if(O===0){for(var X=I;X.length&&(X=X.slice(0,-1),V=v.measureText(X).width,!(V<=M)););if(!X.length)throw new Error("wordWrapWidth < a single character");var H=D.substr(X.length);L[O]=H,P+=X}var G=L[O].length?O:O+1,U=L.slice(G).join(" ").replace(/[ \n]*$/gi,"");g.splice(T+1,0,U),y=g.length;break}else P+=I,M-=V}x+=P.replace(/[ \n]*$/gi,"")+` +`}return x=x.replace(/[\s|\n]*$/gi,""),x},basicWordWrap:function(u,v,m){for(var x="",g=u.split(this.splitRegExp),y=g.length-1,T=v.measureText(" ").width,E=0;E<=y;E++){for(var P=m,R=g[E].split(" "),M=R.length-1,L=0;L<=M;L++){var O=R[L],D=v.measureText(O).width,I=D;LP&&L>0&&(x+=` +`,P=m),x+=O,L0&&(D+=E.lineSpacing*I),m.rtl)O=M-O-P.left-P.right;else if(m.align==="right")O+=R-E.lineWidths[I];else if(m.align==="center")O+=(R-E.lineWidths[I])/2;else if(m.align==="justify"){var V=.85;if(E.lineWidths[I]/E.width>=V){var X=E.width-E.lineWidths[I],H=v.measureText(" ").width,G=T[I].trim(),U=G.split(" ");X+=(T[I].length-G.length)*H;for(var F=Math.floor(X/H),B=0;F>0;)U[B]+=" ",B=(B+1)%(U.length-1||1),--F;T[I]=U.join(" ")}}if(this.autoRound&&(O=Math.round(O),D=Math.round(D)),m.strokeThickness&&(m.syncShadow(v,m.shadowStroke),v.strokeText(T[I],O,D)),m.color){m.syncShadow(v,m.shadowFill);var N=this.letterSpacing;if(N!==0)for(var z=0,Y=T[I].split(""),K=0;K{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d.width===0||d.height===0||(c.addToRenderList(d),t.batchSprite(d,d.frame,c,a))};p.exports=C},71259:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(50171);c.register("text",function(n,e){n===void 0&&(n={});var s=a(n,"text",""),h=a(n,"style",null),i=a(n,"padding",null);i!==null&&(h.padding=i);var o=new r(this.scene,0,0,s,h);return e!==void 0&&(n.add=e),d(this.scene,o,n),o.autoRound=a(n,"autoRound",!0),o.resolution=a(n,"resolution",1),o})},68005:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(50171),c=t(39429);c.register("text",function(a,r,n,e){return this.displayList.add(new d(this.scene,a,r,n,e))})},61771:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(34397),a=t(79724),p.exports={renderWebGL:c,renderCanvas:a}},35762:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23568),a=t(35154),r=t(79557),n={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},e=new d({initialize:function(h,i){this.parent=h,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(i,!1,!0)},setStyle:function(s,h,i){h===void 0&&(h=!0),i===void 0&&(i=!1),s&&s.hasOwnProperty("fontSize")&&typeof s.fontSize=="number"&&(s.fontSize=s.fontSize.toString()+"px");for(var o in n){var f=i?n[o][1]:this[o];o==="wordWrapCallback"||o==="wordWrapCallbackScope"?this[o]=a(s,n[o][0],f):this[o]=c(s,n[o][0],f)}var l=a(s,"font",null);l!==null&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=a(s,"fill",null);u!==null&&(this.color=u);var v=a(s,"metrics",!1);return v?this.metrics={ascent:a(v,"ascent",0),descent:a(v,"descent",0),fontSize:a(v,"fontSize",0)}:(h||!this.metrics)&&(this.metrics=r(this)),h?this.parent.updateText():this.parent},syncFont:function(s,h){h.font=this._font},syncStyle:function(s,h){h.textBaseline="alphabetic",h.fillStyle=this.color,h.strokeStyle=this.stroke,h.lineWidth=this.strokeThickness,h.lineCap="round",h.lineJoin="round"},syncShadow:function(s,h){h?(s.shadowOffsetX=this.shadowOffsetX,s.shadowOffsetY=this.shadowOffsetY,s.shadowColor=this.shadowColor,s.shadowBlur=this.shadowBlur):(s.shadowOffsetX=0,s.shadowOffsetY=0,s.shadowColor=0,s.shadowBlur=0)},update:function(s){return s&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=r(this)),this.parent.updateText()},setFont:function(s,h){h===void 0&&(h=!0);var i=s,o="",f="";if(typeof s!="string")i=a(s,"fontFamily","Courier"),o=a(s,"fontSize","16px"),f=a(s,"fontStyle","");else{var l=s.split(" "),u=0;f=l.length>2?l[u++]:"",o=l[u++]||"16px",i=l[u++]||"Courier"}return(i!==this.fontFamily||o!==this.fontSize||f!==this.fontStyle)&&(this.fontFamily=i,this.fontSize=o,this.fontStyle=f,h&&this.update(!0)),this.parent},setFontFamily:function(s){return this.fontFamily!==s&&(this.fontFamily=s,this.update(!0)),this.parent},setFontStyle:function(s){return this.fontStyle!==s&&(this.fontStyle=s,this.update(!0)),this.parent},setFontSize:function(s){return typeof s=="number"&&(s=s.toString()+"px"),this.fontSize!==s&&(this.fontSize=s,this.update(!0)),this.parent},setTestString:function(s){return this.testString=s,this.update(!0)},setFixedSize:function(s,h){return this.fixedWidth=s,this.fixedHeight=h,s&&(this.parent.width=s),h&&(this.parent.height=h),this.update(!1)},setBackgroundColor:function(s){return this.backgroundColor=s,this.update(!1)},setFill:function(s){return this.color=s,this.update(!1)},setColor:function(s){return this.color=s,this.update(!1)},setResolution:function(s){return this.resolution=s,this.update(!1)},setStroke:function(s,h){return h===void 0&&(h=this.strokeThickness),s===void 0&&this.strokeThickness!==0?(this.strokeThickness=0,this.update(!0)):(this.stroke!==s||this.strokeThickness!==h)&&(this.stroke=s,this.strokeThickness=h,this.update(!0)),this.parent},setShadow:function(s,h,i,o,f,l){return s===void 0&&(s=0),h===void 0&&(h=0),i===void 0&&(i="#000"),o===void 0&&(o=0),f===void 0&&(f=!1),l===void 0&&(l=!0),this.shadowOffsetX=s,this.shadowOffsetY=h,this.shadowColor=i,this.shadowBlur=o,this.shadowStroke=f,this.shadowFill=l,this.update(!1)},setShadowOffset:function(s,h){return s===void 0&&(s=0),h===void 0&&(h=s),this.shadowOffsetX=s,this.shadowOffsetY=h,this.update(!1)},setShadowColor:function(s){return s===void 0&&(s="#000"),this.shadowColor=s,this.update(!1)},setShadowBlur:function(s){return s===void 0&&(s=0),this.shadowBlur=s,this.update(!1)},setShadowStroke:function(s){return this.shadowStroke=s,this.update(!1)},setShadowFill:function(s){return this.shadowFill=s,this.update(!1)},setWordWrapWidth:function(s,h){return h===void 0&&(h=!1),this.wordWrapWidth=s,this.wordWrapUseAdvanced=h,this.update(!1)},setWordWrapCallback:function(s,h){return h===void 0&&(h=null),this.wordWrapCallback=s,this.wordWrapCallbackScope=h,this.update(!1)},setAlign:function(s){return s===void 0&&(s="left"),this.align=s,this.update(!1)},setMaxLines:function(s){return s===void 0&&(s=0),this.maxLines=s,this.update(!1)},getTextMetrics:function(){var s=this.metrics;return{ascent:s.ascent,descent:s.descent,fontSize:s.fontSize}},toJSON:function(){var s={};for(var h in n)s[h]=this[h];return s.metrics=this.getTextMetrics(),s},destroy:function(){this.parent=void 0}});p.exports=e},34397:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70554),c=function(a,r,n,e){if(!(r.width===0||r.height===0)){n.addToRenderList(r);var s=r.frame,h=s.width,i=s.height,o=d.getTintAppendFloatAlpha,f=a.pipelines.set(r.pipeline,r),l=f.setTexture2D(s.glTexture,r);f.batchTexture(r,s.glTexture,h,i,r.x,r.y,h/r.style.resolution,i/r.style.resolution,r.scaleX,r.scaleY,r.rotation,r.flipX,r.flipY,r.scrollFactorX,r.scrollFactorY,r.displayOriginX,r.displayOriginY,0,0,h,i,o(r.tintTopLeft,n.alpha*r._alphaTL),o(r.tintTopRight,n.alpha*r._alphaTR),o(r.tintBottomLeft,n.alpha*r._alphaBL),o(r.tintBottomRight,n.alpha*r._alphaBR),r.tintFill,0,0,n,e,!1,l)}};p.exports=c},20839:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=t(83419),a=t(31401),r=t(95643),n=t(98439),e=t(68703),s=t(56295),h=t(45650),i=t(26099),o=8,f=new c({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,s],initialize:function(u,v,m,x,g,y,T){var E=u.sys.renderer;r.call(this,u,"TileSprite");var P=u.sys.textures.get(y),R=P.get(T);R.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),P=u.sys.textures.get("__MISSING"),R=P.get()),P.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),P=u.sys.textures.get("__MISSING"),R=P.get()),!x||!g?(x=R.width,g=R.height):(x=Math.floor(x),g=Math.floor(g)),this._tilePosition=new i,this._tileScale=new i(1,1),this.dirty=!1,this.renderer=E,this.canvas=d.create(this,x,g),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=P,this.displayFrame=R,this._crop=this.resetCropObject(),this._textureKey=h(),this.texture=u.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=n(R.width),this.potHeight=n(R.height),this.fillCanvas=d.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(v,m),this.setSize(x,g),this.setFrame(T),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(l,u){return this.displayTexture=this.scene.sys.textures.get(l),this.setFrame(u)},setFrame:function(l){var u=this.displayTexture.get(l);return this.potWidth=n(u.width),this.potHeight=n(u.height),this.canvas.width=0,!u.cutWidth||!u.cutHeight?this.renderFlags&=~o:this.renderFlags|=o,this.displayFrame=u,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(l,u){return l!==void 0&&(this.tilePositionX=l),u!==void 0&&(this.tilePositionY=u),this},setTileScale:function(l,u){return l===void 0&&(l=this.tileScaleX),u===void 0&&(u=l),this.tileScaleX=l,this.tileScaleY=u,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var l=this.displayFrame;if(l.source.isRenderTexture||l.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var u=this.fillContext,v=this.fillCanvas,m=this.potWidth,x=this.potHeight;(!this.renderer||!this.renderer.gl)&&(m=l.cutWidth,x=l.cutHeight),u.clearRect(0,0,m,x),v.width=m,v.height=x,u.drawImage(l.source.image,l.cutX,l.cutY,l.cutWidth,l.cutHeight,0,0,m,x),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(v,this.fillPattern):this.fillPattern=u.createPattern(v,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var l=this.canvas;if((l.width!==this.width||l.height!==this.height)&&(l.width=this.width,l.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl){this.dirty=!1;return}var u=this.context;this.scene.sys.game.config.antialias||e.disable(u);var v=this._tileScale.x,m=this._tileScale.y,x=this._tilePosition.x,g=this._tilePosition.y;u.clearRect(0,0,this.width,this.height),u.save(),u.scale(v,m),u.translate(-x,-g),u.fillStyle=this.fillPattern,u.fillRect(x,g,this.width/v,this.height/m),u.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),d.remove(this.canvas),d.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var l=this.texture;l&&l.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(l){this._tilePosition.x=l,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(l){this._tilePosition.y=l,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(l){this._tileScale.x=l,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(l){this._tileScale.y=l,this.dirty=!0}}});p.exports=f},46992:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d.updateCanvas(),c.addToRenderList(d),t.batchSprite(d,d.frame,c,a)};p.exports=C},14167:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(20839);c.register("tileSprite",function(n,e){n===void 0&&(n={});var s=a(n,"x",0),h=a(n,"y",0),i=a(n,"width",512),o=a(n,"height",512),f=a(n,"key",""),l=a(n,"frame",""),u=new r(this.scene,s,h,i,o,f,l);return e!==void 0&&(n.add=e),d(this.scene,u,n),u})},91681:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20839),c=t(39429);c.register("tileSprite",function(a,r,n,e,s,h){return this.displayList.add(new d(this.scene,a,r,n,e,s,h))})},56295:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(18553),a=t(46992),p.exports={renderWebGL:c,renderCanvas:a}},18553:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70554),c=function(a,r,n,e){r.updateCanvas();var s=r.width,h=r.height;if(!(s===0||h===0)){n.addToRenderList(r);var i=d.getTintAppendFloatAlpha,o=a.pipelines.set(r.pipeline,r),f=o.setTexture2D(r.fillPattern,r);o.batchTexture(r,r.fillPattern,r.displayFrame.width*r.tileScaleX,r.displayFrame.height*r.tileScaleY,r.x,r.y,s,h,r.scaleX,r.scaleY,r.rotation,r.flipX,r.flipY,r.scrollFactorX,r.scrollFactorY,r.originX*s,r.originY*h,0,0,s,h,i(r.tintTopLeft,n.alpha*r._alphaTL),i(r.tintTopRight,n.alpha*r._alphaTR),i(r.tintBottomLeft,n.alpha*r._alphaBL),i(r.tintBottomRight,n.alpha*r._alphaBR),r.tintFill,r.tilePositionX%r.displayFrame.width/r.displayFrame.width,r.tilePositionY%r.displayFrame.height/r.displayFrame.height,n,e,!1,f)}};p.exports=c},18471:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(31401),r=t(51708),n=t(8443),e=t(95643),s=t(36383),h=t(14463),i=t(45650),o=t(10247),f=new c({Extends:e,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,o],initialize:function(u,v,m,x){e.call(this,u,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=i(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._rfvCallbackId=0;var g=u.sys.game;this._device=g.device.video,this.setPosition(v,m),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),g.events.on(n.PAUSE,this.globalPause,this),g.events.on(n.RESUME,this.globalResume,this);var y=u.sys.sound;y&&y.on(h.GLOBAL_MUTE,this.globalMute,this),x&&this.load(x)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(l){var u=this.scene.sys.cache.video.get(l);return u?(this.cacheKey=l,this.loadHandler(u.url,u.noAudio,u.crossOrigin)):console.warn("No video in cache for key: "+l),this},changeSource:function(l,u,v,m,x){u===void 0&&(u=!0),v===void 0&&(v=!1),this.cacheKey!==l&&(this.load(l),u&&this.play(v,m,x))},getVideoKey:function(){return this.cacheKey},loadURL:function(l,u,v){u===void 0&&(u=!1);var m=this._device.getVideoURL(l);return m?(this.cacheKey="",this.loadHandler(m.url,u,v)):console.warn("No supported video format found for "+l),this},loadMediaStream:function(l,u,v){return this.loadHandler(null,u,v,l)},loadHandler:function(l,u,v,m){u||(u=!1);var x=this.video;if(x?(this.removeLoadEventHandlers(),this.stop()):(x=document.createElement("video"),x.controls=!1,x.setAttribute("playsinline","playsinline"),x.setAttribute("preload","auto"),x.setAttribute("disablePictureInPicture","true")),u?(x.muted=!0,x.defaultMuted=!0,x.setAttribute("autoplay","autoplay")):(x.muted=!1,x.defaultMuted=!1,x.removeAttribute("autoplay")),v?x.setAttribute("crossorigin",v):x.removeAttribute("crossorigin"),m)if("srcObject"in x)try{x.srcObject=m}catch(y){if(y.name!=="TypeError")throw y;x.src=URL.createObjectURL(m)}else x.src=URL.createObjectURL(m);else x.src=l;this.retry=0,this.video=x,this._playCalled=!1,x.load(),this.addLoadEventHandlers();var g=this.scene.sys.textures.get(this._key);return this.setTexture(g),this},requestVideoFrame:function(l,u){var v=this.video;if(v){var m=u.width,x=u.height,g=this.videoTexture,y=this.videoTextureSource,T=!g||y.source!==v;T?(this._codePaused=v.paused,this._codeMuted=v.muted,g?(y.source=v,y.width=m,y.height=x,g.get().setSize(m,x)):(g=this.scene.sys.textures.create(this._key,v,m,x),g.add("__BASE",0,0,0,m,x),this.setTexture(g),this.videoTexture=g,this.videoTextureSource=g.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(r.VIDEO_TEXTURE,this,g)),this.setSizeToFrame(),this.updateDisplayOrigin()):y.update(),this.isStalled=!1,this.metadata=u;var E=u.mediaTime;T&&(this._lastUpdate=E,this.emit(r.VIDEO_CREATED,this,m,x),this.frameReady||(this.frameReady=!0,this.emit(r.VIDEO_PLAY,this))),this._playingMarker?E>=this._markerOut&&(v.loop?(v.currentTime=this._markerIn,this.emit(r.VIDEO_LOOP,this)):(this.stop(!1),this.emit(r.VIDEO_COMPLETE,this))):E-1&&v>u&&v=0&&!isNaN(v)&&v>u&&(this.markers[l]=[u,v]),this},playMarker:function(l,u){var v=this.markers[l];return v&&this.play(u,v[0],v[1]),this},removeMarker:function(l){return delete this.markers[l],this},snapshot:function(l,u){return l===void 0&&(l=this.width),u===void 0&&(u=this.height),this.snapshotArea(0,0,this.width,this.height,l,u)},snapshotArea:function(l,u,v,m,x,g){l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=this.width),m===void 0&&(m=this.height),x===void 0&&(x=v),g===void 0&&(g=m);var y=this.video,T=this.snapshotTexture;return T?(T.setSize(x,g),y&&T.context.drawImage(y,l,u,v,m,0,0,x,g)):(T=this.scene.sys.textures.createCanvas(i(),x,g),this.snapshotTexture=T,y&&T.context.drawImage(y,l,u,v,m,0,0,x,g)),T.update()},saveSnapshotTexture:function(l){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,l):this.snapshotTexture=this.scene.sys.textures.createCanvas(l,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(r.VIDEO_UNLOCKED,this));var l=this.scene.sys.sound;l&&l.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(l){var u=l.name;u==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(r.VIDEO_LOCKED,this)):u==="NotSupportedError"?(this.stop(!1),this.emit(r.VIDEO_UNSUPPORTED,this,l)):(this.stop(!1),this.emit(r.VIDEO_ERROR,this,l))},legacyPlayHandler:function(){var l=this.video;l&&(this.playSuccess(),l.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(r.VIDEO_PLAYING,this)},loadErrorHandler:function(l){this.stop(!1),this.emit(r.VIDEO_ERROR,this,l)},metadataHandler:function(l){this.emit(r.VIDEO_METADATA,this,l)},setSizeToFrame:function(l){l||(l=this.frame),this.width=l.realWidth,this.height=l.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var u=this.input;return u&&!u.customHitArea&&(u.hitArea.width=this.width,u.hitArea.height=this.height),this},stalledHandler:function(l){this.isStalled=!0,this.emit(r.VIDEO_STALLED,this,l)},completeHandler:function(){this._playCalled=!1,this.emit(r.VIDEO_COMPLETE,this)},preUpdate:function(l,u){var v=this.video;!v||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=u,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(l){var u=this.video;if(u){var v=u.duration;if(v!==1/0&&!isNaN(v)){var m=v*l;this.setCurrentTime(m)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(l){var u=this.video;if(u){if(typeof l=="string"){var v=l[0],m=parseFloat(l.substr(1));v==="+"?l=u.currentTime+m:v==="-"&&(l=u.currentTime-m)}u.currentTime=l}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(r.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(r.VIDEO_SEEKED,this)},getProgress:function(){var l=this.video;if(l){var u=l.duration;if(u!==1/0&&!isNaN(u))return l.currentTime/u}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(l){l===void 0&&(l=!0),this._codeMuted=l;var u=this.video;return u&&(u.muted=this._systemMuted?!0:l),this},isMuted:function(){return this._codeMuted},globalMute:function(l,u){this._systemMuted=u;var v=this.video;v&&(v.muted=this._codeMuted?!0:u)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&!this.video.ended&&this.createPlayPromise()},setPaused:function(l){l===void 0&&(l=!0);var u=this.video;return this._codePaused=l,u&&!u.ended&&(l?u.paused||(this.removeEventHandlers(),u.pause()):l||(this._playCalled?u.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(l){return l===void 0&&(l=1),this.video&&(this.video.volume=d(l,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(l){return this.video&&(this.video.playbackRate=l),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(l){return l===void 0&&(l=!0),this.video&&(this.video.loop=l),this},isPlaying:function(){return this.video?!(this.video.paused||this.video.ended):!1},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(l,u){return u===void 0&&(u=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,l),this.videoTextureSource.setFlipY(u)),this._key=l,this.flipY=u,!!this.videoTexture},stop:function(l){l===void 0&&(l=!0);var u=this.video;return u&&(this.removeEventHandlers(),u.cancelVideoFrameCallback(this._rfvCallbackId),u.pause()),this.retry=0,this._playCalled=!1,l&&this.emit(r.VIDEO_STOP,this),this},removeVideoElement:function(){var l=this.video;if(l){for(l.parentNode&&l.parentNode.removeChild(l);l.hasChildNodes();)l.removeChild(l.firstChild);l.removeAttribute("autoplay"),l.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var l=this.scene.sys.game.events;l.off(n.PAUSE,this.globalPause,this),l.off(n.RESUME,this.globalResume,this);var u=this.scene.sys.sound;u&&u.off(h.GLOBAL_MUTE,this.globalMute,this)}});p.exports=f},58352:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d.videoTexture&&(c.addToRenderList(d),t.batchSprite(d,d.frame,c,a))};p.exports=C},11511:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25305),c=t(44603),a=t(23568),r=t(18471);c.register("video",function(n,e){n===void 0&&(n={});var s=a(n,"key",null),h=new r(this.scene,0,0,s);return e!==void 0&&(n.add=e),d(this.scene,h,n),h})},89025:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(18471),c=t(39429);c.register("video",function(a,r,n){return this.displayList.add(new d(this.scene,a,r,n))})},10247:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(29849),a=t(58352),p.exports={renderWebGL:c,renderCanvas:a}},29849:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d.videoTexture&&(c.addToRenderList(d),d.pipeline.batchSprite(d,c,a))};p.exports=C},41481:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(96503),a=t(87902),r=t(83419),n=t(31401),e=t(95643),s=t(87841),h=t(37303),i=new r({Extends:e,Mixins:[n.Depth,n.GetBounds,n.Origin,n.Transform,n.ScrollFactor,n.Visible],initialize:function(f,l,u,v,m){v===void 0&&(v=1),m===void 0&&(m=v),e.call(this,f,"Zone"),this.setPosition(l,u),this.width=v,this.height=m,this.blendMode=d.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(o){this.scaleX=o/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(o){this.scaleY=o/this.height}},setSize:function(o,f,l){l===void 0&&(l=!0),this.width=o,this.height=f,this.updateDisplayOrigin();var u=this.input;return l&&u&&!u.customHitArea&&(u.hitArea.width=o,u.hitArea.height=f),this},setDisplaySize:function(o,f){return this.displayWidth=o,this.displayHeight=f,this},setCircleDropZone:function(o){return this.setDropZone(new c(0,0,o),a)},setRectangleDropZone:function(o,f){return this.setDropZone(new s(0,0,o,f),h)},setDropZone:function(o,f){return this.input||this.setInteractive(o,f,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(o,f,l){l.addToRenderList(f)},renderWebGL:function(o,f,l){l.addToRenderList(f)}});p.exports=i},95261:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(44603),c=t(23568),a=t(41481);d.register("zone",function(r){var n=c(r,"x",0),e=c(r,"y",0),s=c(r,"width",1),h=c(r,"height",s);return new a(this.scene,n,e,s,h)})},84175:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41481),c=t(39429);c.register("zone",function(a,r,n,e){return this.displayList.add(new d(this.scene,a,r,n,e))})},95166:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0};p.exports=C},96503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(87902),a=t(26241),r=t(79124),n=t(23777),e=t(28176),s=new d({initialize:function(i,o,f){i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),this.type=n.CIRCLE,this.x=i,this.y=o,this._radius=f,this._diameter=f*2},contains:function(h,i){return c(this,h,i)},getPoint:function(h,i){return a(this,h,i)},getPoints:function(h,i,o){return r(this,h,i,o)},getRandomPoint:function(h){return e(this,h)},setTo:function(h,i,o){return this.x=h,this.y=i,this._radius=o,this._diameter=o*2,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(h,i){return i===void 0&&(i=h),this.x=h,this.y=i,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(h){this._radius=h,this._diameter=h*2}},diameter:{get:function(){return this._diameter},set:function(h){this._diameter=h,this._radius=h*.5}},left:{get:function(){return this.x-this._radius},set:function(h){this.x=h+this._radius}},right:{get:function(){return this.x+this._radius},set:function(h){this.x=h-this._radius}},top:{get:function(){return this.y-this._radius},set:function(h){this.y=h+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(h){this.y=h-this._radius}}});p.exports=s},71562:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return 2*(Math.PI*t.radius)};p.exports=C},92110:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n){return n===void 0&&(n=new d),n.x=a.x+a.radius*Math.cos(r),n.y=a.y+a.radius*Math.sin(r),n};p.exports=c},42250:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(96503),c=function(a){return new d(a.x,a.y,a.radius)};p.exports=c},87902:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(t.radius>0&&d>=t.left&&d<=t.right&&c>=t.top&&c<=t.bottom){var a=(t.x-d)*(t.x-d),r=(t.y-c)*(t.y-c);return a+r<=t.radius*t.radius}else return!1};p.exports=C},5698:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87902),c=function(a,r){return d(a,r.x,r.y)};p.exports=c},70588:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87902),c=function(a,r){return d(a,r.x,r.y)&&d(a,r.right,r.y)&&d(a,r.x,r.bottom)&&d(a,r.right,r.bottom)};p.exports=c},26394:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x,t.y,t.radius)};p.exports=C},76278:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x===d.x&&t.y===d.y&&t.radius===d.radius};p.exports=C},2074:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r){return r===void 0&&(r=new d),r.x=a.left,r.y=a.top,r.width=a.diameter,r.height=a.diameter,r};p.exports=c},26241:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(92110),c=t(62945),a=t(36383),r=t(2141),n=function(e,s,h){h===void 0&&(h=new r);var i=c(s,0,a.PI2);return d(e,i,h)};p.exports=n},79124:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(71562),c=t(92110),a=t(62945),r=t(36383),n=function(e,s,h,i){i===void 0&&(i=[]),!s&&h>0&&(s=d(e)/h);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x+=d,t.y+=c,t};p.exports=C},39212:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x+=d.x,t.y+=d.y,t};p.exports=C},28176:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){r===void 0&&(r=new d);var n=2*Math.PI*Math.random(),e=Math.random()+Math.random(),s=e>1?2-e:e,h=s*Math.cos(n),i=s*Math.sin(n);return r.x=a.x+h*a.radius,r.y=a.y+i*a.radius,r};p.exports=c},88911:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(96503);d.Area=t(95166),d.Circumference=t(71562),d.CircumferencePoint=t(92110),d.Clone=t(42250),d.Contains=t(87902),d.ContainsPoint=t(5698),d.ContainsRect=t(70588),d.CopyFrom=t(26394),d.Equals=t(76278),d.GetBounds=t(2074),d.GetPoint=t(26241),d.GetPoints=t(79124),d.Offset=t(50884),d.OffsetPoint=t(39212),d.Random=t(28176),p.exports=d},23777:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6};p.exports=C},78874:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI};p.exports=C},92990:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=t.width/2,c=t.height/2,a=Math.pow(d-c,2)/Math.pow(d+c,2);return Math.PI*(d+c)*(1+3*a/(10+Math.sqrt(4-3*a)))};p.exports=C},79522:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n){n===void 0&&(n=new d);var e=a.width/2,s=a.height/2;return n.x=a.x+e*Math.cos(r),n.y=a.y+s*Math.sin(r),n};p.exports=c},58102:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8497),c=function(a){return new d(a.x,a.y,a.width,a.height)};p.exports=c},81154:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(t.width<=0||t.height<=0)return!1;var a=(d-t.x)/t.width,r=(c-t.y)/t.height;return a*=a,r*=r,a+r<.25};p.exports=C},46662:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(81154),c=function(a,r){return d(a,r.x,r.y)};p.exports=c},1632:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(81154),c=function(a,r){return d(a,r.x,r.y)&&d(a,r.right,r.y)&&d(a,r.x,r.bottom)&&d(a,r.right,r.bottom)};p.exports=c},65534:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x,t.y,t.width,t.height)};p.exports=C},8497:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(81154),a=t(90549),r=t(48320),n=t(23777),e=t(24820),s=new d({initialize:function(i,o,f,l){i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),this.type=n.ELLIPSE,this.x=i,this.y=o,this.width=f,this.height=l},contains:function(h,i){return c(this,h,i)},getPoint:function(h,i){return a(this,h,i)},getPoints:function(h,i,o){return r(this,h,i,o)},getRandomPoint:function(h){return e(this,h)},setTo:function(h,i,o,f){return this.x=h,this.y=i,this.width=o,this.height=f,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(h,i){return i===void 0&&(i=h),this.x=h,this.y=i,this},setSize:function(h,i){return i===void 0&&(i=h),this.width=h,this.height=i,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(h){this.x=h+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(h){this.x=h-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(h){this.y=h+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(h){this.y=h-this.height/2}}});p.exports=s},36146:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x===d.x&&t.y===d.y&&t.width===d.width&&t.height===d.height};p.exports=C},23694:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r){return r===void 0&&(r=new d),r.x=a.left,r.y=a.top,r.width=a.width,r.height=a.height,r};p.exports=c},90549:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79522),c=t(62945),a=t(36383),r=t(2141),n=function(e,s,h){h===void 0&&(h=new r);var i=c(s,0,a.PI2);return d(e,i,h)};p.exports=n},48320:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(92990),c=t(79522),a=t(62945),r=t(36383),n=function(e,s,h,i){i===void 0&&(i=[]),!s&&h>0&&(s=d(e)/h);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x+=d,t.y+=c,t};p.exports=C},44808:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x+=d.x,t.y+=d.y,t};p.exports=C},24820:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){r===void 0&&(r=new d);var n=Math.random()*Math.PI*2,e=Math.sqrt(Math.random());return r.x=a.x+e*Math.cos(n)*a.width/2,r.y=a.y+e*Math.sin(n)*a.height/2,r};p.exports=c},49203:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8497);d.Area=t(78874),d.Circumference=t(92990),d.CircumferencePoint=t(79522),d.Clone=t(58102),d.Contains=t(81154),d.ContainsPoint=t(46662),d.ContainsRect=t(1632),d.CopyFrom=t(65534),d.Equals=t(36146),d.GetBounds=t(23694),d.GetPoint=t(90549),d.GetPoints=t(48320),d.Offset=t(73424),d.OffsetPoint=t(44808),d.Random=t(24820),p.exports=d},55738:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23777),c=t(79291),a={Circle:t(88911),Ellipse:t(49203),Intersects:t(91865),Line:t(2529),Mesh:t(73090),Point:t(43711),Polygon:t(58423),Rectangle:t(93232),Triangle:t(84435)};a=c(!1,a,d),p.exports=a},2044:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20339),c=function(a,r){return d(a.x,a.y,r.x,r.y)<=a.radius+r.radius};p.exports=c},81491:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=d.width/2,a=d.height/2,r=Math.abs(t.x-d.x-c),n=Math.abs(t.y-d.y-a),e=c+t.radius,s=a+t.radius;if(r>e||n>s)return!1;if(r<=c||n<=a)return!0;var h=r-c,i=n-a,o=h*h,f=i*i,l=t.radius*t.radius;return o+f<=l};p.exports=C},63376:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(2044),a=function(r,n,e){if(e===void 0&&(e=[]),c(r,n)){var s=r.x,h=r.y,i=r.radius,o=n.x,f=n.y,l=n.radius,u,v,m,x,g;if(h===f)g=(l*l-i*i-o*o+s*s)/(2*(s-o)),u=1,v=-2*f,m=o*o+g*g-2*o*g+f*f-l*l,x=v*v-4*u*m,x===0?e.push(new d(g,-v/(2*u))):x>0&&(e.push(new d(g,(-v+Math.sqrt(x))/(2*u))),e.push(new d(g,(-v-Math.sqrt(x))/(2*u))));else{var y=(s-o)/(h-f),T=(l*l-i*i-o*o+s*s-f*f+h*h)/(2*(h-f));u=y*y+1,v=2*h*y-2*T*y-2*s,m=s*s+h*h+T*T-i*i-2*h*T,x=v*v-4*u*m,x===0?(g=-v/(2*u),e.push(new d(g,T-g*y))):x>0&&(g=(-v+Math.sqrt(x))/(2*u),e.push(new d(g,T-g*y)),g=(-v-Math.sqrt(x))/(2*u),e.push(new d(g,T-g*y)))}}return e};p.exports=a},97439:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(4042),c=t(81491),a=function(r,n,e){if(e===void 0&&(e=[]),c(r,n)){var s=n.getLineA(),h=n.getLineB(),i=n.getLineC(),o=n.getLineD();d(s,r,e),d(h,r,e),d(i,r,e),d(o,r,e)}return e};p.exports=a},4042:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(80462),a=function(r,n,e){if(e===void 0&&(e=[]),c(r,n)){var s=r.x1,h=r.y1,i=r.x2,o=r.y2,f=n.x,l=n.y,u=n.radius,v=i-s,m=o-h,x=s-f,g=h-l,y=v*v+m*m,T=2*(v*x+m*g),E=x*x+g*g-u*u,P=T*T-4*y*E,R,M;if(P===0){var L=-T/(2*y);R=s+L*v,M=h+L*m,L>=0&&L<=1&&e.push(new d(R,M))}else if(P>0){var O=(-T-Math.sqrt(P))/(2*y);R=s+O*v,M=h+O*m,O>=0&&O<=1&&e.push(new d(R,M));var D=(-T+Math.sqrt(P))/(2*y);R=s+D*v,M=h+D*m,D>=0&&D<=1&&e.push(new d(R,M))}}return e};p.exports=a},36100:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25836),c=function(a,r,n,e){n===void 0&&(n=!1);var s=a.x1,h=a.y1,i=a.x2,o=a.y2,f=r.x1,l=r.y1,u=r.x2,v=r.y2,m=i-s,x=o-h,g=u-f,y=v-l,T=m*y-x*g;if(T===0)return null;var E,P,R;if(n){if(E=(m*(l-h)+x*(s-f))/(g*x-y*m),P=(f+g*E-s)/m,P<0||E<0||E>1)return null;R=P}else{if(E=((f-s)*y-(l-h)*g)/T,P=((h-l)*m-(s-f)*x)/T,E<0||E>1||P<0||P>1)return null;R=E}return e===void 0&&(e=new d),e.set(s+m*R,h+x*R,R)};p.exports=c},3073:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36100),c=t(23031),a=t(25836),r=new c,n=new a,e=function(s,h,i,o){i===void 0&&(i=!1),o===void 0&&(o=new a);var f=!1;o.set(),n.set();for(var l=h[h.length-1],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25836),c=t(61369),a=t(3073),r=new d,n=function(e,s,h,i){i===void 0&&(i=new c),Array.isArray(s)||(s=[s]);var o=!1;i.set(),r.set();for(var f=0;f{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(76112),a=t(92773),r=function(n,e,s){if(s===void 0&&(s=[]),a(n,e))for(var h=e.getLineA(),i=e.getLineB(),o=e.getLineC(),f=e.getLineD(),l=[new d,new d,new d,new d],u=[c(h,n,l[0]),c(i,n,l[1]),c(o,n,l[2]),c(f,n,l[3])],v=0;v<4;v++)u[v]&&s.push(l[v]);return s};p.exports=r},71147:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61369),c=t(56362),a=t(23031),r=new a;function n(h,i,o,f,l){var u=Math.cos(h),v=Math.sin(h);r.setTo(i,o,i+u,o+v);var m=c(r,f,!0);m&&l.push(new d(m.x,m.y,h,m.w))}function e(h,i){return h.z-i.z}var s=function(h,i,o){Array.isArray(o)||(o=[o]);for(var f=[],l=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=t(59996),a=function(r,n,e){return e===void 0&&(e=new d),c(r,n)&&(e.x=Math.max(r.x,n.x),e.y=Math.max(r.y,n.y),e.width=Math.min(r.right,n.right)-e.x,e.height=Math.min(r.bottom,n.bottom)-e.y),e};p.exports=a},52784:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(60646),c=t(59996),a=function(r,n,e){if(e===void 0&&(e=[]),c(r,n)){var s=r.getLineA(),h=r.getLineB(),i=r.getLineC(),o=r.getLineD();d(s,n,e),d(h,n,e),d(i,n,e),d(o,n,e)}return e};p.exports=a},26341:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(89265),c=t(60646),a=function(r,n,e){if(e===void 0&&(e=[]),d(r,n)){var s=n.getLineA(),h=n.getLineB(),i=n.getLineC();c(s,r,e),c(h,r,e),c(i,r,e)}return e};p.exports=a},38720:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(4042),c=t(67636),a=function(r,n,e){if(e===void 0&&(e=[]),c(r,n)){var s=r.getLineA(),h=r.getLineB(),i=r.getLineC();d(s,n,e),d(h,n,e),d(i,n,e)}return e};p.exports=a},13882:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(2822),a=t(76112),r=function(n,e,s){if(s===void 0&&(s=[]),c(n,e))for(var h=n.getLineA(),i=n.getLineB(),o=n.getLineC(),f=[new d,new d,new d],l=[a(h,e,f[0]),a(i,e,f[1]),a(o,e,f[2])],u=0;u<3;u++)l[u]&&s.push(f[u]);return s};p.exports=r},75636:(p,C,t)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82944),c=t(13882),a=function(r,n,e){if(e===void 0&&(e=[]),d(r,n)){var s=n.getLineA(),h=n.getLineB(),i=n.getLineC();c(r,s,e),c(r,h,e),c(r,i,e)}return e};p.exports=a},80462:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87902),c=t(2141),a=new c,r=function(n,e,s){if(s===void 0&&(s=a),d(e,n.x1,n.y1))return s.x=n.x1,s.y=n.y1,!0;if(d(e,n.x2,n.y2))return s.x=n.x2,s.y=n.y2,!0;var h=n.x2-n.x1,i=n.y2-n.y1,o=e.x-n.x1,f=e.y-n.y1,l=h*h+i*i,u=h,v=i;if(l>0){var m=(o*h+f*i)/l;u*=m,v*=m}s.x=n.x1+u,s.y=n.y1+v;var x=u*u+v*v;return x<=l&&u*h+v*i>=0&&d(e,s.x,s.y)};p.exports=r},76112:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=t.x1,r=t.y1,n=t.x2,e=t.y2,s=d.x1,h=d.y1,i=d.x2,o=d.y2;if(a===n&&r===e||s===i&&h===o)return!1;var f=(o-h)*(n-a)-(i-s)*(e-r);if(f===0)return!1;var l=((i-s)*(r-h)-(o-h)*(a-s))/f,u=((n-a)*(r-h)-(e-r)*(a-s))/f;return l<0||l>1||u<0||u>1?!1:(c&&(c.x=a+l*(n-a),c.y=r+l*(e-r)),!0)};p.exports=C},92773:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.x1,a=t.y1,r=t.x2,n=t.y2,e=d.x,s=d.y,h=d.right,i=d.bottom,o=0;if(c>=e&&c<=h&&a>=s&&a<=i||r>=e&&r<=h&&n>=s&&n<=i)return!0;if(c=e){if(o=a+(n-a)*(e-c)/(r-c),o>s&&o<=i)return!0}else if(c>h&&r<=h&&(o=a+(n-a)*(h-c)/(r-c),o>=s&&o<=i))return!0;if(a=s){if(o=c+(r-c)*(s-a)/(n-a),o>=e&&o<=h)return!0}else if(a>i&&n<=i&&(o=c+(r-c)*(i-a)/(n-a),o>=e&&o<=h))return!0;return!1};p.exports=C},16204:p=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){c===void 0&&(c=1);var a=d.x1,r=d.y1,n=d.x2,e=d.y2,s=t.x,h=t.y,i=(n-a)*(n-a)+(e-r)*(e-r);if(i===0)return!1;var o=((s-a)*(n-a)+(h-r)*(e-r))/i;if(o<0)return Math.sqrt((a-s)*(a-s)+(r-h)*(r-h))<=c;if(o>=0&&o<=1){var f=((r-h)*(n-a)-(a-s)*(e-r))/i;return Math.abs(f)*Math.sqrt(i)<=c}else return Math.sqrt((n-s)*(n-s)+(e-h)*(e-h))<=c};p.exports=C},14199:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(16204),c=function(a,r){if(!d(a,r))return!1;var n=Math.min(r.x1,r.x2),e=Math.max(r.x1,r.x2),s=Math.min(r.y1,r.y2),h=Math.max(r.y1,r.y2);return a.x>=n&&a.x<=e&&a.y>=s&&a.y<=h};p.exports=c},59996:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.width<=0||t.height<=0||d.width<=0||d.height<=0?!1:!(t.rightd.right||t.y>d.bottom)};p.exports=C},89265:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(76112),c=t(37303),a=t(48653),r=t(77493),n=function(e,s){if(s.left>e.right||s.righte.bottom||s.bottom0};p.exports=n},84411:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n){return n===void 0&&(n=0),!(d>t.right+n||ct.bottom+n||r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80462),c=t(10690),a=function(r,n){return r.left>n.right||r.rightn.bottom||r.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(76112),c=function(a,r){return!!(a.contains(r.x1,r.y1)||a.contains(r.x2,r.y2)||d(a.getLineA(),r)||d(a.getLineB(),r)||d(a.getLineC(),r))};p.exports=c},82944:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(48653),c=t(71694),a=t(76112),r=function(n,e){if(n.left>e.right||n.righte.bottom||n.bottom0||(u=c(e),v=d(n,u,!0),v.length>0)};p.exports=r},91865:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CircleToCircle:t(2044),CircleToRectangle:t(81491),GetCircleToCircle:t(63376),GetCircleToRectangle:t(97439),GetLineToCircle:t(4042),GetLineToLine:t(36100),GetLineToPoints:t(3073),GetLineToPolygon:t(56362),GetLineToRectangle:t(60646),GetRaysFromPointToPolygon:t(71147),GetRectangleIntersection:t(68389),GetRectangleToRectangle:t(52784),GetRectangleToTriangle:t(26341),GetTriangleToCircle:t(38720),GetTriangleToLine:t(13882),GetTriangleToTriangle:t(75636),LineToCircle:t(80462),LineToLine:t(76112),LineToRectangle:t(92773),PointToLine:t(16204),PointToLineSegment:t(14199),RectangleToRectangle:t(59996),RectangleToTriangle:t(89265),RectangleToValues:t(84411),TriangleToCircle:t(67636),TriangleToLine:t(2822),TriangleToTriangle:t(82944)}},91938:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)};p.exports=C},84993:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){d===void 0&&(d=1),c===void 0&&(c=[]);var a=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),e=Math.round(t.y2),s=Math.abs(n-a),h=Math.abs(e-r),i=a-h&&(f-=h,a+=i),u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=d-(t.x1+t.x2)/2,r=c-(t.y1+t.y2)/2;return t.x1+=a,t.y1+=r,t.x2+=a,t.y2+=r,t};p.exports=C},31116:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23031),c=function(a){return new d(a.x1,a.y1,a.x2,a.y2)};p.exports=c},59944:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x1,t.y1,t.x2,t.y2)};p.exports=C},59220:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x1===d.x1&&t.y1===d.y1&&t.x2===d.x2&&t.y2===d.y2};p.exports=C},78177:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=function(a,r,n){n===void 0&&(n=r);var e=d(a),s=a.x2-a.x1,h=a.y2-a.y1;return r&&(a.x1=a.x1-s/e*r,a.y1=a.y1-h/e*r),n&&(a.x2=a.x2+s/e*n,a.y2=a.y2+h/e*n),a};p.exports=c},26708:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(52816),c=t(6113),a=t(2141),r=function(n,e,s,h,i){h===void 0&&(h=0),i===void 0&&(i=[]);var o=[],f=n.x1,l=n.y1,u=n.x2-f,v=n.y2-l,m=c(e,i),x,g,y=s-1;for(x=0;x0){var T=o[0],E=[T];for(x=1;x=h&&(E.push(P),T=P)}var R=o[o.length-1];return d(T,R){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.x=(a.x1+a.x2)/2,r.y=(a.y1+a.y2)/2,r};p.exports=c},99569:(p,C,t)=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n){n===void 0&&(n=new d);var e=a.x1,s=a.y1,h=a.x2,i=a.y2,o=(h-e)*(h-e)+(i-s)*(i-s);if(o===0)return n;var f=((r.x-e)*(h-e)+(r.y-s)*(i-s))/o;return n.x=e+f*(h-e),n.y=s+f*(i-s),n};p.exports=c},34638:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(91938),a=t(2141),r=function(n,e){e===void 0&&(e=new a);var s=c(n)-d.TAU;return e.x=Math.cos(s),e.y=Math.sin(s),e};p.exports=r},13151:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n){return n===void 0&&(n=new d),n.x=a.x1+(a.x2-a.x1)*r,n.y=a.y1+(a.y2-a.y1)*r,n};p.exports=c},15258:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=t(2141),a=function(r,n,e,s){s===void 0&&(s=[]),!n&&e>0&&(n=d(r)/e);for(var h=r.x1,i=r.y1,o=r.x2,f=r.y2,l=0;l{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.x1,a=t.y1,r=t.x2,n=t.y2,e=(r-c)*(r-c)+(n-a)*(n-a);if(e===0)return!1;var s=((a-d.y)*(r-c)-(c-d.x)*(n-a))/e;return Math.abs(s)*Math.sqrt(e)};p.exports=C},98770:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.abs(t.y1-t.y2)};p.exports=C},35001:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))};p.exports=C},23031:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(13151),a=t(15258),r=t(23777),n=t(65822),e=t(26099),s=new d({initialize:function(i,o,f,l){i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),this.type=r.LINE,this.x1=i,this.y1=o,this.x2=f,this.y2=l},getPoint:function(h,i){return c(this,h,i)},getPoints:function(h,i,o){return a(this,h,i,o)},getRandomPoint:function(h){return n(this,h)},setTo:function(h,i,o,f){return h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),this.x1=h,this.y1=i,this.x2=o,this.y2=f,this},setFromObjects:function(h,i){return this.x1=h.x,this.y1=h.y,this.x2=i.x,this.y2=i.y,this},getPointA:function(h){return h===void 0&&(h=new e),h.set(this.x1,this.y1),h},getPointB:function(h){return h===void 0&&(h=new e),h.set(this.x2,this.y2),h},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(h){this.x1<=this.x2?this.x1=h:this.x2=h}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(h){this.x1>this.x2?this.x1=h:this.x2=h}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(h){this.y1<=this.y2?this.y1=h:this.y2=h}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(h){this.y1>this.y2?this.y1=h:this.y2=h}}});p.exports=s},64795:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(15994),a=t(91938),r=function(n){var e=a(n)-d.TAU;return c(e,-Math.PI,Math.PI)};p.exports=r},52616:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(91938),a=function(r){return Math.cos(c(r)-d.TAU)};p.exports=a},87231:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(91938),a=function(r){return Math.sin(c(r)-d.TAU)};p.exports=a},89662:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x1+=d,t.y1+=c,t.x2+=d,t.y2+=c,t};p.exports=C},71165:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return-((t.x2-t.x1)/(t.y2-t.y1))};p.exports=C},65822:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){r===void 0&&(r=new d);var n=Math.random();return r.x=a.x1+n*(a.x2-a.x1),r.y=a.y1+n*(a.y2-a.y1),r};p.exports=c},69777:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91938),c=t(64795),a=function(r,n){return 2*c(n)-Math.PI-d(r)};p.exports=a},39706:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(64400),c=function(a,r){var n=(a.x1+a.x2)/2,e=(a.y1+a.y2)/2;return d(a,n,e,r)};p.exports=c},82585:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(64400),c=function(a,r,n){return d(a,r.x,r.y,n)};p.exports=c},64400:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=Math.cos(a),n=Math.sin(a),e=t.x1-d,s=t.y1-c;return t.x1=e*r-s*n+d,t.y1=e*n+s*r+c,e=t.x2-d,s=t.y2-c,t.x2=e*r-s*n+d,t.y2=e*n+s*r+c,t};p.exports=C},62377:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){return t.x1=d,t.y1=c,t.x2=d+Math.cos(a)*r,t.y2=c+Math.sin(a)*r,t};p.exports=C},71366:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t.y2-t.y1)/(t.x2-t.x1)};p.exports=C},10809:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.abs(t.x1-t.x2)};p.exports=C},2529:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23031);d.Angle=t(91938),d.BresenhamPoints=t(84993),d.CenterOn=t(36469),d.Clone=t(31116),d.CopyFrom=t(59944),d.Equals=t(59220),d.Extend=t(78177),d.GetEasedPoints=t(26708),d.GetMidPoint=t(32125),d.GetNearestPoint=t(99569),d.GetNormal=t(34638),d.GetPoint=t(13151),d.GetPoints=t(15258),d.GetShortestDistance=t(26408),d.Height=t(98770),d.Length=t(35001),d.NormalAngle=t(64795),d.NormalX=t(52616),d.NormalY=t(87231),d.Offset=t(89662),d.PerpSlope=t(71165),d.Random=t(65822),d.ReflectAngle=t(69777),d.Rotate=t(39706),d.RotateAroundPoint=t(82585),d.RotateAroundXY=t(64400),d.SetToAngle=t(62377),d.Slope=t(71366),d.Width=t(10809),p.exports=d},83997:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(87841),a=t(26099);function r(e,s,h,i){var o=e-h,f=s-i,l=o*o+f*f;return Math.sqrt(l)}var n=new d({initialize:function(s,h,i){this.vertex1=s,this.vertex2=h,this.vertex3=i,this.bounds=new c,this._inCenter=new a},getInCenter:function(e){e===void 0&&(e=!0);var s=this.vertex1,h=this.vertex2,i=this.vertex3,o,f,l,u,v,m;e?(o=s.x,f=s.y,l=h.x,u=h.y,v=i.x,m=i.y):(o=s.vx,f=s.vy,l=h.vx,u=h.vy,v=i.vx,m=i.vy);var x=r(v,m,l,u),g=r(o,f,v,m),y=r(l,u,o,f),T=x+g+y;return this._inCenter.set((o*x+l*g+v*y)/T,(f*x+u*g+m*y)/T)},contains:function(e,s,h){var i=this.vertex1,o=this.vertex2,f=this.vertex3,l=i.vx,u=i.vy,v=o.vx,m=o.vy,x=f.vx,g=f.vy;if(h){var y=h.a,T=h.b,E=h.c,P=h.d,R=h.e,M=h.f;l=i.vx*y+i.vy*E+R,u=i.vx*T+i.vy*P+M,v=o.vx*y+o.vy*E+R,m=o.vx*T+o.vy*P+M,x=f.vx*y+f.vy*E+R,g=f.vx*T+f.vy*P+M}var L=x-l,O=g-u,D=v-l,I=m-u,V=e-l,X=s-u,H=L*L+O*O,G=L*D+O*I,U=L*V+O*X,F=D*D+I*I,B=D*V+I*X,N=H*F-G*G,z=N===0?0:1/N,Y=(F*U-G*B)*z,K=(H*B-G*U)*z;return Y>=0&&K>=0&&Y+K<1},isCounterClockwise:function(e){var s=this.vertex1,h=this.vertex2,i=this.vertex3,o=(h.vx-s.vx)*(i.vy-s.vy)-(h.vy-s.vy)*(i.vx-s.vx);return e<=0?o>=0:o<0},load:function(e,s,h,i,o){return h=this.vertex1.load(e,s,h,i,o),h=this.vertex2.load(e,s,h,i,o),h=this.vertex3.load(e,s,h,i,o),h},transformCoordinatesLocal:function(e,s,h,i){return this.vertex1.transformCoordinatesLocal(e,s,h,i),this.vertex2.transformCoordinatesLocal(e,s,h,i),this.vertex3.transformCoordinatesLocal(e,s,h,i),this},updateBounds:function(){var e=this.vertex1,s=this.vertex2,h=this.vertex3,i=this.bounds;return i.x=Math.min(e.vx,s.vx,h.vx),i.y=Math.min(e.vy,s.vy,h.vy),i.width=Math.max(e.vx,s.vx,h.vx)-i.x,i.height=Math.max(e.vy,s.vy,h.vy)-i.y,this},isInView:function(e,s,h,i,o,f,l,u,v,m,x){this.update(i,o,f,l,u,v,m,x);var g=this.vertex1,y=this.vertex2,T=this.vertex3;if(g.ta<=0&&y.ta<=0&&T.ta<=0||s&&!this.isCounterClockwise(h))return!1;var E=this.bounds;E.x=Math.min(g.tx,y.tx,T.tx),E.y=Math.min(g.ty,y.ty,T.ty),E.width=Math.max(g.tx,y.tx,T.tx)-E.x,E.height=Math.max(g.ty,y.ty,T.ty)-E.y;var P=e.x+e.width,R=e.y+e.height;return E.width<=0||E.height<=0||e.width<=0||e.height<=0?!1:!(E.rightP||E.y>R)},scrollUV:function(e,s){return this.vertex1.scrollUV(e,s),this.vertex2.scrollUV(e,s),this.vertex3.scrollUV(e,s),this},scaleUV:function(e,s){return this.vertex1.scaleUV(e,s),this.vertex2.scaleUV(e,s),this.vertex3.scaleUV(e,s),this},setColor:function(e){return this.vertex1.color=e,this.vertex2.color=e,this.vertex3.color=e,this},update:function(e,s,h,i,o,f,l,u){return this.vertex1.update(s,h,i,o,f,l,u,e),this.vertex2.update(s,h,i,o,f,l,u,e),this.vertex3.update(s,h,i,o,f,l,u,e),this},translate:function(e,s){s===void 0&&(s=0);var h=this.vertex1,i=this.vertex2,o=this.vertex3;return h.x+=e,h.y+=s,i.x+=e,i.y+=s,o.x+=e,o.y+=s,this},x:{get:function(){return this.getInCenter().x},set:function(e){var s=this.getInCenter();this.translate(e-s.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(e){var s=this.getInCenter();this.translate(0,e-s.y)}},alpha:{get:function(){var e=this.vertex1,s=this.vertex2,h=this.vertex3;return(e.alpha+s.alpha+h.alpha)/3},set:function(e){this.vertex1.alpha=e,this.vertex2.alpha=e,this.vertex3.alpha=e}},depth:{get:function(){var e=this.vertex1,s=this.vertex2,h=this.vertex3;return(e.vz+s.vz+h.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});p.exports=n},48803:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83997),c=t(95540),a=t(37867),r=t(25836),n=t(39318),e=new r,s=new r,h=new a,i=function(o){var f=c(o,"mesh"),l=c(o,"texture",null),u=c(o,"frame"),v=c(o,"width",1),m=c(o,"height",v),x=c(o,"widthSegments",1),g=c(o,"heightSegments",x),y=c(o,"x",0),T=c(o,"y",0),E=c(o,"z",0),P=c(o,"rotateX",0),R=c(o,"rotateY",0),M=c(o,"rotateZ",0),L=c(o,"zIsUp",!0),O=c(o,"isOrtho",f?f.dirtyCache[11]:!1),D=c(o,"colors",[16777215]),I=c(o,"alphas",[1]),V=c(o,"tile",!1),X=c(o,"flipY",!1),H=c(o,"width",null),G={faces:[],verts:[]};e.set(y,T,E),s.set(P,R,M),h.fromRotationXYTranslation(s,e,L);var U;if(!l&&f)l=f.texture,u||(U=f.frame);else if(f&&typeof l=="string")l=f.scene.sys.textures.get(l);else if(!l)return G;U||(U=l.get(u)),!H&&O&&l&&f&&(v=U.width/f.height,m=U.height/f.height);var F=v/2,B=m/2,N=Math.floor(x),z=Math.floor(g),Y=N+1,K=z+1,Z=v/N,Q=m/z,$=[],j=[],k,_,q=0,et=1,nt=0,at=1;U&&(q=U.u0,et=U.u1,X?(nt=U.v1,at=U.v0):(nt=U.v0,at=U.v1));var rt=et-q,tt=at-nt;for(_=0;_{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83997),c=t(37867),a=t(25836),r=t(39318),n=new a,e=new a,s=new c,h=function(i,o,f,l,u,v,m,x,g,y){f===void 0&&(f=1),l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=0),m===void 0&&(m=0),x===void 0&&(x=0),g===void 0&&(g=0),y===void 0&&(y=!0);var T={faces:[],verts:[]},E=i.materials;n.set(l,u,v),e.set(m,x,g),s.fromRotationXYTranslation(e,n,y);for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83997),c=t(39318),a=function(r,n,e,s,h,i,o,f){if(s===void 0&&(s=!1),i===void 0&&(i=16777215),o===void 0&&(o=1),f===void 0&&(f=!1),r.length!==n.length&&!s){console.warn("GenerateVerts: vertices and uvs count not equal");return}var l={faces:[],vertices:[]},u,v,m,x,g,y,T,E,P,R,M,L=s?3:2,O=Array.isArray(i),D=Array.isArray(o);if(Array.isArray(e)&&e.length>0)for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=!0,t="untitled",d="",c="";function a(v){var m=v.indexOf("#");return m>-1?v.substring(0,m):v}function r(v){return v.models.length===0&&v.models.push({faces:[],name:t,textureCoords:[],vertexNormals:[],vertices:[]}),d="",v.models[v.models.length-1]}function n(v,m){var x=v.length>=2?v[1]:t;m.models.push({faces:[],name:x,textureCoords:[],vertexNormals:[],vertices:[]}),d=""}function e(v){v.length===2&&(d=v[1])}function s(v,m){var x=v.length,g=x>=2?parseFloat(v[1]):0,y=x>=3?parseFloat(v[2]):0,T=x>=4?parseFloat(v[3]):0;r(m).vertices.push({x:g,y,z:T})}function h(v,m){var x=v.length,g=x>=2?parseFloat(v[1]):0,y=x>=3?parseFloat(v[2]):0,T=x>=4?parseFloat(v[3]):0;isNaN(g)&&(g=0),isNaN(y)&&(y=0),isNaN(T)&&(T=0),C&&(y=1-y),r(m).textureCoords.push({u:g,v:y,w:T})}function i(v,m){var x=v.length,g=x>=2?parseFloat(v[1]):0,y=x>=3?parseFloat(v[2]):0,T=x>=4?parseFloat(v[3]):0;r(m).vertexNormals.push({x:g,y,z:T})}function o(v,m){var x=v.length-1;if(!(x<3)){for(var g={group:d,material:c,vertices:[]},y=0;y3)){var R=0,M=0,L=0;R=parseInt(E[0],10),P>1&&E[1]!==""&&(M=parseInt(E[1],10)),P>2&&(L=parseInt(E[2],10)),R!==0&&(R<0&&(R=r(m).vertices.length+1+R),M-=1,R-=1,L-=1,g.vertices.push({textureCoordsIndex:M,vertexIndex:R,vertexNormalIndex:L}))}}r(m).faces.push(g)}}function f(v,m){v.length>=2&&m.materialLibraries.push(v[1])}function l(v){v.length>=2&&(c=v[1])}var u=function(v,m){m===void 0&&(m=!0),C=m;var x={materials:{},materialLibraries:[],models:[]};d="",c="";for(var g=v.split(` +`),y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37589),c=function(a){for(var r={},n=a.split(` +`),e="",s=0;s=2?Math.floor(i[2]*255):o,l=i.length>=3?Math.floor(i[3]*255):o;r[e]=d(o,f,l);break}}}}return r};p.exports=c},92570:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r,n;if(c===void 0&&a===void 0){var e=t.getInCenter();r=e.x,n=e.y}var s=Math.cos(d),h=Math.sin(d),i=t.vertex1,o=t.vertex2,f=t.vertex3,l=i.x-r,u=i.y-n;i.set(l*s-u*h+r,l*h+u*s+n),l=o.x-r,u=o.y-n,o.set(l*s-u*h+r,l*h+u*s+n),l=f.x-r,u=f.y-n,f.set(l*s-u*h+r,l*h+u*s+n)};p.exports=C},39318:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(70554),a=t(25836),r=new d({Extends:a,initialize:function(e,s,h,i,o,f,l,u,v,m){f===void 0&&(f=16777215),l===void 0&&(l=1),u===void 0&&(u=0),v===void 0&&(v=0),m===void 0&&(m=0),a.call(this,e,s,h),this.vx=0,this.vy=0,this.vz=0,this.nx=u,this.ny=v,this.nz=m,this.u=i,this.v=o,this.color=f,this.alpha=l,this.tx=0,this.ty=0,this.ta=0,this.tu=i,this.tv=o},setUVs:function(n,e){return this.u=n,this.v=e,this.tu=n,this.tv=e,this},scrollUV:function(n,e){return this.tu+=n,this.tv+=e,this},scaleUV:function(n,e){return this.tu=this.u*n,this.tv=this.v*e,this},transformCoordinatesLocal:function(n,e,s,h){var i=this.x,o=this.y,f=this.z,l=n.val,u=i*l[0]+o*l[4]+f*l[8]+l[12],v=i*l[1]+o*l[5]+f*l[9]+l[13],m=i*l[2]+o*l[6]+f*l[10]+l[14],x=i*l[3]+o*l[7]+f*l[11]+l[15];this.vx=u/x*e,this.vy=-(v/x)*s,h<=0?this.vz=m/x:this.vz=-(m/x)},resize:function(n,e,s,h,i,o){return this.x=n,this.y=e,this.vx=this.x*s,this.vy=-this.y*h,this.vz=0,i<.5?this.vx+=s*(.5-i):i>.5&&(this.vx-=s*(i-.5)),o<.5?this.vy+=h*(.5-o):o>.5&&(this.vy-=h*(o-.5)),this},update:function(n,e,s,h,i,o,f,l){var u=this.vx*n+this.vy*s+i,v=this.vx*e+this.vy*h+o;return f&&(u=Math.round(u),v=Math.round(v)),this.tx=u,this.ty=v,this.ta=this.alpha*l,this},load:function(n,e,s,h,i){return n[++s]=this.tx,n[++s]=this.ty,n[++s]=this.tu,n[++s]=this.tv,n[++s]=h,n[++s]=i,e[++s]=c.getTintAppendFloatAlpha(this.color,this.ta),s}});p.exports=r},73090:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={Face:t(83997),GenerateGridVerts:t(48803),GenerateObjVerts:t(34684),GenerateVerts:t(92515),ParseObj:t(85048),ParseObjMaterial:t(61485),RotateFace:t(92570),Vertex:t(39318)};p.exports=d},96550:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))};p.exports=C},99706:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a){return new d(a.x,a.y)};p.exports=c},68010:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x,t.y)};p.exports=C},27814:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x===d.x&&t.y===d.y};p.exports=C},73565:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))};p.exports=C},87555:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){if(r===void 0&&(r=new d),!Array.isArray(a))throw new Error("GetCentroid points argument must be an array");var n=a.length;if(n<1)throw new Error("GetCentroid points array must not be empty");if(n===1)r.x=a[0].x,r.y=a[0].y;else{for(var e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)};p.exports=C},44405:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x*t.x+t.y*t.y};p.exports=C},20873:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r){r===void 0&&(r=new d);for(var n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,i=0;in&&(n=o.x),o.xs&&(s=o.y),o.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n,e){return n===void 0&&(n=0),e===void 0&&(e=new d),e.x=a.x+(r.x-a.x)*n,e.y=a.y+(r.y-a.y)*n,e};p.exports=c},55767:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.setTo(t.y,t.x)};p.exports=C},79432:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.setTo(-a.x,-a.y)};p.exports=c},2141:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23777),a=new d({initialize:function(n,e){n===void 0&&(n=0),e===void 0&&(e=n),this.type=c.POINT,this.x=n,this.y=e},setTo:function(r,n){return r===void 0&&(r=0),n===void 0&&(n=r),this.x=r,this.y=n,this}});p.exports=a},72930:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(44405),a=function(r,n,e){e===void 0&&(e=new d);var s=r.x*n.x+r.y*n.y,h=s/c(n);return h!==0&&(e.x=h*n.x,e.y=h*n.y),e};p.exports=a},62880:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r,n){n===void 0&&(n=new d);var e=a.x*r.x+a.y*r.y;return e!==0&&(n.x=e*r.x,n.y=e*r.y),n};p.exports=c},15093:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(28793),c=function(a,r){if(a.x!==0||a.y!==0){var n=d(a);a.x/=n,a.y/=n}return a.x*=r,a.y*=r,a};p.exports=c},43711:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141);d.Ceil=t(96550),d.Clone=t(99706),d.CopyFrom=t(68010),d.Equals=t(27814),d.Floor=t(73565),d.GetCentroid=t(87555),d.GetMagnitude=t(28793),d.GetMagnitudeSq=t(44405),d.GetRectangleFromPoints=t(20873),d.Interpolate=t(26152),d.Invert=t(55767),d.Negative=t(79432),d.Project=t(72930),d.ProjectUnit=t(62880),d.SetMagnitude=t(15093),p.exports=d},12306:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25717),c=function(a){return new d(a.points)};p.exports=c},63814:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){for(var a=!1,r=-1,n=t.points.length-1;++r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(63814),c=function(a,r){return d(a,r.x,r.y)};p.exports=c},94811:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(G,U,F){F=F||2;var B=U&&U.length,N=B?U[0]*F:G.length,z=t(G,0,N,F,!0),Y=[];if(!z||z.next===z.prev)return Y;var K,Z,Q,$,j,k,_;if(B&&(z=s(G,U,z,F)),G.length>80*F){K=Q=G[0],Z=$=G[1];for(var q=F;qQ&&(Q=j),k>$&&($=k);_=Math.max(Q-K,$-Z),_=_!==0?32767/_:0}return c(z,Y,F,K,Z,_,0),Y}function t(G,U,F,B,N){var z,Y;if(N===H(G,U,F,B)>0)for(z=U;z=U;z-=B)Y=I(z,G[z],G[z+1],Y);return Y&&T(Y,Y.next)&&(V(Y),Y=Y.next),Y}function d(G,U){if(!G)return G;U||(U=G);var F=G,B;do if(B=!1,!F.steiner&&(T(F,F.next)||y(F.prev,F,F.next)===0)){if(V(F),F=U=F.prev,F===F.next)break;B=!0}else F=F.next;while(B||F!==U);return U}function c(G,U,F,B,N,z,Y){if(G){!Y&&z&&l(G,B,N,z);for(var K=G,Z,Q;G.prev!==G.next;){if(Z=G.prev,Q=G.next,z?r(G,B,N,z):a(G)){U.push(Z.i/F|0),U.push(G.i/F|0),U.push(Q.i/F|0),V(G),G=Q.next,K=Q.next;continue}if(G=Q,G===K){Y?Y===1?(G=n(d(G),U,F),c(G,U,F,B,N,z,2)):Y===2&&e(G,U,F,B,N,z):c(d(G),U,F,B,N,z,1);break}}}}function a(G){var U=G.prev,F=G,B=G.next;if(y(U,F,B)>=0)return!1;for(var N=U.x,z=F.x,Y=B.x,K=U.y,Z=F.y,Q=B.y,$=Nz?N>Y?N:Y:z>Y?z:Y,_=K>Z?K>Q?K:Q:Z>Q?Z:Q,q=B.next;q!==U;){if(q.x>=$&&q.x<=k&&q.y>=j&&q.y<=_&&x(N,K,z,Z,Y,Q,q.x,q.y)&&y(q.prev,q,q.next)>=0)return!1;q=q.next}return!0}function r(G,U,F,B){var N=G.prev,z=G,Y=G.next;if(y(N,z,Y)>=0)return!1;for(var K=N.x,Z=z.x,Q=Y.x,$=N.y,j=z.y,k=Y.y,_=KZ?K>Q?K:Q:Z>Q?Z:Q,nt=$>j?$>k?$:k:j>k?j:k,at=v(_,q,U,F,B),rt=v(et,nt,U,F,B),tt=G.prevZ,st=G.nextZ;tt&&tt.z>=at&&st&&st.z<=rt;){if(tt.x>=_&&tt.x<=et&&tt.y>=q&&tt.y<=nt&&tt!==N&&tt!==Y&&x(K,$,Z,j,Q,k,tt.x,tt.y)&&y(tt.prev,tt,tt.next)>=0||(tt=tt.prevZ,st.x>=_&&st.x<=et&&st.y>=q&&st.y<=nt&&st!==N&&st!==Y&&x(K,$,Z,j,Q,k,st.x,st.y)&&y(st.prev,st,st.next)>=0))return!1;st=st.nextZ}for(;tt&&tt.z>=at;){if(tt.x>=_&&tt.x<=et&&tt.y>=q&&tt.y<=nt&&tt!==N&&tt!==Y&&x(K,$,Z,j,Q,k,tt.x,tt.y)&&y(tt.prev,tt,tt.next)>=0)return!1;tt=tt.prevZ}for(;st&&st.z<=rt;){if(st.x>=_&&st.x<=et&&st.y>=q&&st.y<=nt&&st!==N&&st!==Y&&x(K,$,Z,j,Q,k,st.x,st.y)&&y(st.prev,st,st.next)>=0)return!1;st=st.nextZ}return!0}function n(G,U,F){var B=G;do{var N=B.prev,z=B.next.next;!T(N,z)&&E(N,B,B.next,z)&&L(N,z)&&L(z,N)&&(U.push(N.i/F|0),U.push(B.i/F|0),U.push(z.i/F|0),V(B),V(B.next),B=G=z),B=B.next}while(B!==G);return d(B)}function e(G,U,F,B,N,z){var Y=G;do{for(var K=Y.next.next;K!==Y.prev;){if(Y.i!==K.i&&g(Y,K)){var Z=D(Y,K);Y=d(Y,Y.next),Z=d(Z,Z.next),c(Y,U,F,B,N,z,0),c(Z,U,F,B,N,z,0);return}K=K.next}Y=Y.next}while(Y!==G)}function s(G,U,F,B){var N=[],z,Y,K,Z,Q;for(z=0,Y=U.length;z=F.next.y&&F.next.y!==F.y){var K=F.x+(N-F.y)*(F.next.x-F.x)/(F.next.y-F.y);if(K<=B&&K>z&&(z=K,Y=F.x=F.x&&F.x>=Q&&B!==F.x&&x(N<$?B:z,N,Q,$,N<$?z:B,N,F.x,F.y)&&(k=Math.abs(N-F.y)/(B-F.x),L(F,G)&&(kY.x||F.x===Y.x&&f(Y,F)))&&(Y=F,j=k)),F=F.next;while(F!==Z);return Y}function f(G,U){return y(G.prev,G,U.prev)<0&&y(U.next,G,G.next)<0}function l(G,U,F,B){var N=G;do N.z===0&&(N.z=v(N.x,N.y,U,F,B)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==G);N.prevZ.nextZ=null,N.prevZ=null,u(N)}function u(G){var U,F,B,N,z,Y,K,Z,Q=1;do{for(F=G,G=null,z=null,Y=0;F;){for(Y++,B=F,K=0,U=0;U0||Z>0&&B;)K!==0&&(Z===0||!B||F.z<=B.z)?(N=F,F=F.nextZ,K--):(N=B,B=B.nextZ,Z--),z?z.nextZ=N:G=N,N.prevZ=z,z=N;F=B}z.nextZ=null,Q*=2}while(Y>1);return G}function v(G,U,F,B,N){return G=(G-F)*N|0,U=(U-B)*N|0,G=(G|G<<8)&16711935,G=(G|G<<4)&252645135,G=(G|G<<2)&858993459,G=(G|G<<1)&1431655765,U=(U|U<<8)&16711935,U=(U|U<<4)&252645135,U=(U|U<<2)&858993459,U=(U|U<<1)&1431655765,G|U<<1}function m(G){var U=G,F=G;do(U.x=(G-Y)*(z-K)&&(G-Y)*(B-K)>=(F-Y)*(U-K)&&(F-Y)*(z-K)>=(N-Y)*(B-K)}function g(G,U){return G.next.i!==U.i&&G.prev.i!==U.i&&!M(G,U)&&(L(G,U)&&L(U,G)&&O(G,U)&&(y(G.prev,G,U.prev)||y(G,U.prev,U))||T(G,U)&&y(G.prev,G,G.next)>0&&y(U.prev,U,U.next)>0)}function y(G,U,F){return(U.y-G.y)*(F.x-U.x)-(U.x-G.x)*(F.y-U.y)}function T(G,U){return G.x===U.x&&G.y===U.y}function E(G,U,F,B){var N=R(y(G,U,F)),z=R(y(G,U,B)),Y=R(y(F,B,G)),K=R(y(F,B,U));return!!(N!==z&&Y!==K||N===0&&P(G,F,U)||z===0&&P(G,B,U)||Y===0&&P(F,G,B)||K===0&&P(F,U,B))}function P(G,U,F){return U.x<=Math.max(G.x,F.x)&&U.x>=Math.min(G.x,F.x)&&U.y<=Math.max(G.y,F.y)&&U.y>=Math.min(G.y,F.y)}function R(G){return G>0?1:G<0?-1:0}function M(G,U){var F=G;do{if(F.i!==G.i&&F.next.i!==G.i&&F.i!==U.i&&F.next.i!==U.i&&E(F,F.next,G,U))return!0;F=F.next}while(F!==G);return!1}function L(G,U){return y(G.prev,G,G.next)<0?y(G,U,G.next)>=0&&y(G,G.prev,U)>=0:y(G,U,G.prev)<0||y(G,G.next,U)<0}function O(G,U){var F=G,B=!1,N=(G.x+U.x)/2,z=(G.y+U.y)/2;do F.y>z!=F.next.y>z&&F.next.y!==F.y&&N<(F.next.x-F.x)*(z-F.y)/(F.next.y-F.y)+F.x&&(B=!B),F=F.next;while(F!==G);return B}function D(G,U){var F=new X(G.i,G.x,G.y),B=new X(U.i,U.x,U.y),N=G.next,z=U.prev;return G.next=U,U.prev=G,F.next=N,N.prev=F,B.next=F,F.prev=B,z.next=B,B.prev=z,B}function I(G,U,F,B){var N=new X(G,U,F);return B?(N.next=B.next,N.prev=B,B.next.prev=N,B.next=N):(N.prev=N,N.next=N),N}function V(G){G.next.prev=G.prev,G.prev.next=G.next,G.prevZ&&(G.prevZ.nextZ=G.nextZ),G.nextZ&&(G.nextZ.prevZ=G.prevZ)}function X(G,U,F){this.i=G,this.x=U,this.y=F,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}C.deviation=function(G,U,F,B){var N=U&&U.length,z=N?U[0]*F:G.length,Y=Math.abs(H(G,0,z,F));if(N)for(var K=0,Z=U.length;K0&&(B+=G[N-1].length,F.holes.push(B))}return F},p.exports=C},13829:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r){r===void 0&&(r=new d);for(var n=1/0,e=1/0,s=-n,h=-e,i,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=[]);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=t(23031),a=t(30052),r=function(n,e,s,h){h===void 0&&(h=[]);var i=n.points,o=a(n);!e&&s>0&&(e=o/s);for(var f=0;fu+y){u+=y;continue}var T=g.getPoint((l-u)/y);h.push(T);break}return h};p.exports=r},30052:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=t(23031),a=function(r){for(var n=r.points,e=0,s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(63814),a=t(9564),r=t(23777),n=new d({initialize:function(s){this.type=r.POLYGON,this.area=0,this.points=[],s&&this.setTo(s)},contains:function(e,s){return c(this,e,s)},setTo:function(e){if(this.area=0,this.points=[],typeof e=="string"&&(e=e.split(" ")),!Array.isArray(e))return this;for(var s,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.points.reverse(),t};p.exports=C},29524:p=>{function C(n,e){var s=n.x-e.x,h=n.y-e.y;return s*s+h*h}function t(n,e,s){var h=e.x,i=e.y,o=s.x-h,f=s.y-i;if(o!==0||f!==0){var l=((n.x-h)*o+(n.y-i)*f)/(o*o+f*f);l>1?(h=s.x,i=s.y):l>0&&(h+=o*l,i+=f*l)}return o=n.x-h,f=n.y-i,o*o+f*f}function d(n,e){for(var s=n[0],h=[s],i,o=1,f=n.length;oe&&(h.push(i),s=i);return s!==i&&h.push(i),h}function c(n,e,s,h,i){for(var o=h,f,l=e+1;lo&&(f=l,o=u)}o>h&&(f-e>1&&c(n,e,f,h,i),i.push(n[f]),s-f>1&&c(n,f,s,h,i))}function a(n,e){var s=n.length-1,h=[n[0]];return c(n,0,s,e,h),h.push(n[s]),h}var r=function(n,e,s){e===void 0&&(e=1),s===void 0&&(s=!1);var h=n.points;if(h.length>2){var i=e*e;s||(h=d(h,i)),n.setTo(a(h,i))}return n};p.exports=r},5469:p=>{/** + * @author Richard Davey + * @author Igor Ognichenko + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(d,c){return d[0]=c[0],d[1]=c[1],d},t=function(d){var c,a=[],r=d.points;for(c=0;c0&&n.push(C([0,0],a[0])),c=0;c1&&n.push(C([0,0],a[a.length-1])),d.setTo(n)};p.exports=t},24709:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){for(var a=t.points,r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25717);d.Clone=t(12306),d.Contains=t(63814),d.ContainsPoint=t(99338),d.Earcut=t(94811),d.GetAABB=t(13829),d.GetNumberArray=t(26173),d.GetPoints=t(9564),d.Perimeter=t(30052),d.Reverse=t(8133),d.Simplify=t(29524),d.Smooth=t(5469),d.Translate=t(24709),p.exports=d},62224:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.width*t.height};p.exports=C},98615:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t};p.exports=C},31688:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t};p.exports=C},67502:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x=d-t.width/2,t.y=c-t.height/2,t};p.exports=C},65085:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a){return new d(a.x,a.y,a.width,a.height)};p.exports=c},37303:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.width<=0||t.height<=0?!1:t.x<=d&&t.x+t.width>=d&&t.y<=c&&t.y+t.height>=c};p.exports=C},96553:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37303),c=function(a,r){return d(a,r.x,r.y)};p.exports=c},70273:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.width*d.height>t.width*t.height?!1:d.x>t.x&&d.xt.x&&d.rightt.y&&d.yt.y&&d.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x,t.y,t.width,t.height)};p.exports=C},77493:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=[]),d.push({x:t.x,y:t.y}),d.push({x:t.right,y:t.y}),d.push({x:t.right,y:t.bottom}),d.push({x:t.x,y:t.bottom}),d};p.exports=C},9219:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x===d.x&&t.y===d.y&&t.width===d.width&&t.height===d.height};p.exports=C},53751:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8249),c=function(a,r){var n=d(a);return n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(8249),c=function(a,r){var n=d(a);return n>d(r)?a.setSize(r.height*n,r.height):a.setSize(r.width,r.width/n),a.setPosition(r.centerX-a.width/2,r.centerY-a.height/2)};p.exports=c},80774:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t};p.exports=C},83859:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t};p.exports=C},19217:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=t(36383),a=function(r,n){if(n===void 0&&(n=new d),r.length===0)return n;for(var e=Number.MAX_VALUE,s=Number.MAX_VALUE,h=c.MIN_SAFE_INTEGER,i=c.MIN_SAFE_INTEGER,o,f,l,u=0;u{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r,n,e,s){return s===void 0&&(s=new d),s.setTo(Math.min(a,n),Math.min(r,e),Math.abs(a-n),Math.abs(r-e))};p.exports=c},8249:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.height===0?NaN:t.width/t.height};p.exports=C},27165:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.x=a.centerX,r.y=a.centerY,r};p.exports=c},20812:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13019),c=t(2141),a=function(r,n,e){if(e===void 0&&(e=new c),n<=0||n>=1)return e.x=r.x,e.y=r.y,e;var s=d(r)*n;return n>.5?(s-=r.width+r.height,s<=r.width?(e.x=r.right-s,e.y=r.bottom):(e.x=r.x,e.y=r.bottom-(s-r.width))):s<=r.width?(e.x=r.x+s,e.y=r.y):(e.x=r.right,e.y=r.y+(s-r.width)),e};p.exports=a},34819:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20812),c=t(13019),a=function(r,n,e,s){s===void 0&&(s=[]),!n&&e>0&&(n=c(r)/e);for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.x=a.width,r.y=a.height,r};p.exports=c},86091:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(67502),c=function(a,r,n){var e=a.centerX,s=a.centerY;return a.setSize(a.width+r*2,a.height+n*2),d(a,e,s)};p.exports=c},53951:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=t(59996),a=function(r,n,e){return e===void 0&&(e=new d),c(r,n)?(e.x=Math.max(r.x,n.x),e.y=Math.max(r.y,n.y),e.width=Math.min(r.right,n.right)-e.x,e.height=Math.min(r.bottom,n.bottom)-e.y):e.setEmpty(),e};p.exports=a},14649:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13019),c=t(2141),a=function(r,n,e,s){if(s===void 0&&(s=[]),!n&&!e)return s;n?e=Math.round(d(r)/n):n=d(r)/e;for(var h=r.x,i=r.y,o=0,f=0;f=r.right&&(o=1,i+=h-r.right,h=r.right);break;case 1:i+=n,i>=r.bottom&&(o=2,h-=i-r.bottom,i=r.bottom);break;case 2:h-=n,h<=r.left&&(o=3,i-=r.left-h,h=r.left);break;case 3:i-=n,i<=r.top&&(o=0,i=r.top);break}return s};p.exports=a},33595:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){for(var c=t.x,a=t.right,r=t.y,n=t.bottom,e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=Math.min(t.x,d.x),a=Math.max(t.right,d.right);t.x=c,t.width=a-c;var r=Math.min(t.y,d.y),n=Math.max(t.bottom,d.bottom);return t.y=r,t.height=n-r,t};p.exports=C},92171:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=Math.min(t.x,d),r=Math.max(t.right,d);t.x=a,t.width=r-a;var n=Math.min(t.y,c),e=Math.max(t.bottom,c);return t.y=n,t.height=e-n,t};p.exports=C},42981:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x+=d,t.y+=c,t};p.exports=C},46907:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x+=d.x,t.y+=d.y,t};p.exports=C},60170:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.xd.x&&t.yd.y};p.exports=C},13019:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return 2*(t.width+t.height)};p.exports=C},85133:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(39506),a=function(r,n,e){e===void 0&&(e=new d),n=c(n);var s=Math.sin(n),h=Math.cos(n),i=h>0?r.width/2:r.width/-2,o=s>0?r.height/2:r.height/-2;return Math.abs(i*s){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.x=a.x+Math.random()*a.width,r.y=a.y+Math.random()*a.height,r};p.exports=c},86470:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30976),c=t(70273),a=t(2141),r=function(n,e,s){if(s===void 0&&(s=new a),c(n,e))switch(d(0,3)){case 0:s.x=n.x+Math.random()*(e.right-n.x),s.y=n.y+Math.random()*(e.top-n.y);break;case 1:s.x=e.x+Math.random()*(n.right-e.x),s.y=e.bottom+Math.random()*(n.bottom-e.bottom);break;case 2:s.x=n.x+Math.random()*(e.x-n.x),s.y=e.y+Math.random()*(n.bottom-e.y);break;case 3:s.x=e.right+Math.random()*(n.right-e.right),s.y=n.y+Math.random()*(e.bottom-n.y);break}return s};p.exports=r},87841:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(37303),a=t(20812),r=t(34819),n=t(23777),e=t(23031),s=t(26597),h=new d({initialize:function(o,f,l,u){o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=0),this.type=n.RECTANGLE,this.x=o,this.y=f,this.width=l,this.height=u},contains:function(i,o){return c(this,i,o)},getPoint:function(i,o){return a(this,i,o)},getPoints:function(i,o,f){return r(this,i,o,f)},getRandomPoint:function(i){return s(this,i)},setTo:function(i,o,f,l){return this.x=i,this.y=o,this.width=f,this.height=l,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(i,o){return o===void 0&&(o=i),this.x=i,this.y=o,this},setSize:function(i,o){return o===void 0&&(o=i),this.width=i,this.height=o,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(i){return i===void 0&&(i=new e),i.setTo(this.x,this.y,this.right,this.y),i},getLineB:function(i){return i===void 0&&(i=new e),i.setTo(this.right,this.y,this.right,this.bottom),i},getLineC:function(i){return i===void 0&&(i=new e),i.setTo(this.right,this.bottom,this.x,this.bottom),i},getLineD:function(i){return i===void 0&&(i=new e),i.setTo(this.x,this.bottom,this.x,this.y),i},left:{get:function(){return this.x},set:function(i){i>=this.right?this.width=0:this.width=this.right-i,this.x=i}},right:{get:function(){return this.x+this.width},set:function(i){i<=this.x?this.width=0:this.width=i-this.x}},top:{get:function(){return this.y},set:function(i){i>=this.bottom?this.height=0:this.height=this.bottom-i,this.y=i}},bottom:{get:function(){return this.y+this.height},set:function(i){i<=this.y?this.height=0:this.height=i-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(i){this.x=i-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(i){this.y=i-this.height/2}}});p.exports=h},94845:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.width===d.width&&t.height===d.height};p.exports=C},31730:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c===void 0&&(c=d),t.width*=d,t.height*=c,t};p.exports=C},36899:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=function(a,r,n){n===void 0&&(n=new d);var e=Math.min(a.x,r.x),s=Math.min(a.y,r.y),h=Math.max(a.right,r.right)-e,i=Math.max(a.bottom,r.bottom)-s;return n.setTo(e,s,h,i)};p.exports=c},93232:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841);d.Area=t(62224),d.Ceil=t(98615),d.CeilAll=t(31688),d.CenterOn=t(67502),d.Clone=t(65085),d.Contains=t(37303),d.ContainsPoint=t(96553),d.ContainsRect=t(70273),d.CopyFrom=t(43459),d.Decompose=t(77493),d.Equals=t(9219),d.FitInside=t(53751),d.FitOutside=t(16088),d.Floor=t(80774),d.FloorAll=t(83859),d.FromPoints=t(19217),d.FromXY=t(9477),d.GetAspectRatio=t(8249),d.GetCenter=t(27165),d.GetPoint=t(20812),d.GetPoints=t(34819),d.GetSize=t(51313),d.Inflate=t(86091),d.Intersection=t(53951),d.MarchingAnts=t(14649),d.MergePoints=t(33595),d.MergeRect=t(20074),d.MergeXY=t(92171),d.Offset=t(42981),d.OffsetPoint=t(46907),d.Overlaps=t(60170),d.Perimeter=t(13019),d.PerimeterPoint=t(85133),d.Random=t(26597),d.RandomOutside=t(86470),d.SameDimensions=t(94845),d.Scale=t(31730),d.Union=t(36899),p.exports=d},41658:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=t.x1,c=t.y1,a=t.x2,r=t.y2,n=t.x3,e=t.y3;return Math.abs(((n-d)*(r-c)-(a-d)*(e-c))/2)};p.exports=C},39208:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(16483),c=function(a,r,n){var e=n*(Math.sqrt(3)/2),s=a,h=r,i=a+n/2,o=r+e,f=a-n/2,l=r+e;return new d(s,h,i,o,f,l)};p.exports=c},39545:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(94811),c=t(16483),a=function(r,n,e,s,h){n===void 0&&(n=null),e===void 0&&(e=1),s===void 0&&(s=1),h===void 0&&(h=[]);for(var i=d(r,n),o,f,l,u,v,m,x,g,y,T=0;T{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(16483),c=function(a,r,n,e){e===void 0&&(e=n);var s=a,h=r,i=a,o=r-e,f=a+n,l=r;return new d(s,h,i,o,f,l)};p.exports=c},23707:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(97523),c=t(13584),a=function(r,n,e,s){s===void 0&&(s=d);var h=s(r),i=n-h.x,o=e-h.y;return c(r,i,o)};p.exports=a},97523:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){return r===void 0&&(r=new d),r.x=(a.x1+a.x2+a.x3)/3,r.y=(a.y1+a.y2+a.y3)/3,r};p.exports=c},24951:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099);function c(r,n,e,s){return r*s-n*e}var a=function(r,n){n===void 0&&(n=new d);var e=r.x3,s=r.y3,h=r.x1-e,i=r.y1-s,o=r.x2-e,f=r.y2-s,l=2*c(h,i,o,f),u=c(i,h*h+i*i,f,o*o+f*f),v=c(h,h*h+i*i,o,o*o+f*f);return n.x=e-u/l,n.y=s+v/l,n};p.exports=a},85614:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(96503),c=function(a,r){r===void 0&&(r=new d);var n=a.x1,e=a.y1,s=a.x2,h=a.y2,i=a.x3,o=a.y3,f=s-n,l=h-e,u=i-n,v=o-e,m=f*(n+s)+l*(e+h),x=u*(n+i)+v*(e+o),g=2*(f*(o-h)-l*(i-s)),y,T;if(Math.abs(g)<1e-6){var E=Math.min(n,s,i),P=Math.min(e,h,o);y=(Math.max(n,s,i)-E)*.5,T=(Math.max(e,h,o)-P)*.5,r.x=E+y,r.y=P+T,r.radius=Math.sqrt(y*y+T*T)}else r.x=(v*m-l*x)/g,r.y=(f*x-u*m)/g,y=r.x-n,T=r.y-e,r.radius=Math.sqrt(y*y+T*T);return r};p.exports=c},74422:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(16483),c=function(a){return new d(a.x1,a.y1,a.x2,a.y2,a.x3,a.y3)};p.exports=c},10690:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=t.x3-t.x1,r=t.y3-t.y1,n=t.x2-t.x1,e=t.y2-t.y1,s=d-t.x1,h=c-t.y1,i=a*a+r*r,o=a*n+r*e,f=a*s+r*h,l=n*n+e*e,u=n*s+e*h,v=i*l-o*o,m=v===0?0:1/v,x=(l*f-o*u)*m,g=(i*u-o*f)*m;return x>=0&&g>=0&&x+g<1};p.exports=C},48653:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c===void 0&&(c=!1),a===void 0&&(a=[]);for(var r=t.x3-t.x1,n=t.y3-t.y1,e=t.x2-t.x1,s=t.y2-t.y1,h=r*r+n*n,i=r*e+n*s,o=e*e+s*s,f=h*o-i*i,l=f===0?0:1/f,u,v,m,x,g,y,T=t.x1,E=t.y1,P=0;P=0&&v>=0&&u+v<1&&(a.push({x:d[P].x,y:d[P].y}),c)));P++);return a};p.exports=C},96006:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10690),c=function(a,r){return d(a,r.x,r.y)};p.exports=c},71326:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)};p.exports=C},71694:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=[]),d.push({x:t.x1,y:t.y1}),d.push({x:t.x2,y:t.y2}),d.push({x:t.x3,y:t.y3}),d};p.exports=C},33522:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.x1===d.x1&&t.y1===d.y1&&t.x2===d.x2&&t.y2===d.y2&&t.x3===d.x3&&t.y3===d.y3};p.exports=C},20437:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=t(35001),a=function(r,n,e){e===void 0&&(e=new d);var s=r.getLineA(),h=r.getLineB(),i=r.getLineC();if(n<=0||n>=1)return e.x=s.x1,e.y=s.y1,e;var o=c(s),f=c(h),l=c(i),u=o+f+l,v=u*n,m=0;return vo+f?(v-=o+f,m=v/l,e.x=i.x1+(i.x2-i.x1)*m,e.y=i.y1+(i.y2-i.y1)*m):(v-=o,m=v/f,e.x=h.x1+(h.x2-h.x1)*m,e.y=h.y1+(h.y2-h.y1)*m),e};p.exports=a},80672:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=t(2141),a=function(r,n,e,s){s===void 0&&(s=[]);var h=r.getLineA(),i=r.getLineB(),o=r.getLineC(),f=d(h),l=d(i),u=d(o),v=f+l+u;!n&&e>0&&(n=v/e);for(var m=0;mf+l?(x-=f+l,g=x/u,y.x=o.x1+(o.x2-o.x1)*g,y.y=o.y1+(o.y2-o.y1)*g):(x-=f,g=x/l,y.x=i.x1+(i.x2-i.x1)*g,y.y=i.y1+(i.y2-i.y1)*g),s.push(y)}return s};p.exports=a},39757:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141);function c(r,n,e,s){var h=r-e,i=n-s,o=h*h+i*i;return Math.sqrt(o)}var a=function(r,n){n===void 0&&(n=new d);var e=r.x1,s=r.y1,h=r.x2,i=r.y2,o=r.x3,f=r.y3,l=c(o,f,h,i),u=c(e,s,o,f),v=c(h,i,e,s),m=l+u+v;return n.x=(e*l+h*u+o*v)/m,n.y=(s*l+i*u+f*v)/m,n};p.exports=a},13584:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t.x1+=d,t.y1+=c,t.x2+=d,t.y2+=c,t.x3+=d,t.y3+=c,t};p.exports=C},1376:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35001),c=function(a){var r=a.getLineA(),n=a.getLineB(),e=a.getLineC();return d(r)+d(n)+d(e)};p.exports=c},90260:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2141),c=function(a,r){r===void 0&&(r=new d);var n=a.x2-a.x1,e=a.y2-a.y1,s=a.x3-a.x1,h=a.y3-a.y1,i=Math.random(),o=Math.random();return i+o>=1&&(i=1-i,o=1-o),r.x=a.x1+(n*i+s*o),r.y=a.y1+(e*i+h*o),r};p.exports=c},52172:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(99614),c=t(39757),a=function(r,n){var e=c(r);return d(r,e.x,e.y,n)};p.exports=a},49907:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(99614),c=function(a,r,n){return d(a,r.x,r.y,n)};p.exports=c},99614:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=Math.cos(a),n=Math.sin(a),e=t.x1-d,s=t.y1-c;return t.x1=e*r-s*n+d,t.y1=e*n+s*r+c,e=t.x2-d,s=t.y2-c,t.x2=e*r-s*n+d,t.y2=e*n+s*r+c,e=t.x3-d,s=t.y3-c,t.x3=e*r-s*n+d,t.y3=e*n+s*r+c,t};p.exports=C},16483:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(10690),a=t(20437),r=t(80672),n=t(23777),e=t(23031),s=t(90260),h=new d({initialize:function(o,f,l,u,v,m){o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=0),m===void 0&&(m=0),this.type=n.TRIANGLE,this.x1=o,this.y1=f,this.x2=l,this.y2=u,this.x3=v,this.y3=m},contains:function(i,o){return c(this,i,o)},getPoint:function(i,o){return a(this,i,o)},getPoints:function(i,o,f){return r(this,i,o,f)},getRandomPoint:function(i){return s(this,i)},setTo:function(i,o,f,l,u,v){return i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=0),v===void 0&&(v=0),this.x1=i,this.y1=o,this.x2=f,this.y2=l,this.x3=u,this.y3=v,this},getLineA:function(i){return i===void 0&&(i=new e),i.setTo(this.x1,this.y1,this.x2,this.y2),i},getLineB:function(i){return i===void 0&&(i=new e),i.setTo(this.x2,this.y2,this.x3,this.y3),i},getLineC:function(i){return i===void 0&&(i=new e),i.setTo(this.x3,this.y3,this.x1,this.y1),i},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(i){var o=0;this.x1<=this.x2&&this.x1<=this.x3?o=this.x1-i:this.x2<=this.x1&&this.x2<=this.x3?o=this.x2-i:o=this.x3-i,this.x1-=o,this.x2-=o,this.x3-=o}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(i){var o=0;this.x1>=this.x2&&this.x1>=this.x3?o=this.x1-i:this.x2>=this.x1&&this.x2>=this.x3?o=this.x2-i:o=this.x3-i,this.x1-=o,this.x2-=o,this.x3-=o}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(i){var o=0;this.y1<=this.y2&&this.y1<=this.y3?o=this.y1-i:this.y2<=this.y1&&this.y2<=this.y3?o=this.y2-i:o=this.y3-i,this.y1-=o,this.y2-=o,this.y3-=o}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(i){var o=0;this.y1>=this.y2&&this.y1>=this.y3?o=this.y1-i:this.y2>=this.y1&&this.y2>=this.y3?o=this.y2-i:o=this.y3-i,this.y1-=o,this.y2-=o,this.y3-=o}}});p.exports=h},84435:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(16483);d.Area=t(41658),d.BuildEquilateral=t(39208),d.BuildFromPolygon=t(39545),d.BuildRight=t(90301),d.CenterOn=t(23707),d.Centroid=t(97523),d.CircumCenter=t(24951),d.CircumCircle=t(85614),d.Clone=t(74422),d.Contains=t(10690),d.ContainsArray=t(48653),d.ContainsPoint=t(96006),d.CopyFrom=t(71326),d.Decompose=t(71694),d.Equals=t(33522),d.GetPoint=t(20437),d.GetPoints=t(80672),d.InCenter=t(39757),d.Perimeter=t(1376),d.Offset=t(13584),d.Random=t(90260),d.Rotate=t(52172),d.RotateAroundPoint=t(49907),d.RotateAroundXY=t(99614),p.exports=d},74457:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:d,hitAreaCallback:c,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}};p.exports=C},84409:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return function(c,a,r,n){var e=t.getPixelAlpha(a,r,n.texture.key,n.frame.name);return e&&e>=d}};p.exports=C},7003:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(93301),a=t(50792),r=t(8214),n=t(8443),e=t(78970),s=t(85098),h=t(42515),i=t(36210),o=t(61340),f=t(85955),l=new d({initialize:function(v,m){this.game=v,this.scaleManager,this.canvas,this.config=m,this.enabled=!0,this.events=new a,this.isOver=!0,this.defaultCursor="",this.keyboard=m.inputKeyboard?new e(this):null,this.mouse=m.inputMouse?new s(this):null,this.touch=m.inputTouch?new i(this):null,this.pointers=[],this.pointersTotal=m.inputActivePointers,m.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var x=0;x<=this.pointersTotal;x++){var g=new h(this,x);g.smoothFactor=m.inputSmoothFactor,this.pointers.push(g)}this.mousePointer=m.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new o,this._tempMatrix2=new o,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],v.events.once(n.BOOT,this.boot,this)},boot:function(){var u=this.game,v=u.events;this.canvas=u.canvas,this.scaleManager=u.scale,this.events.emit(r.MANAGER_BOOT),v.on(n.PRE_RENDER,this.preRender,this),v.once(n.DESTROY,this.destroy,this)},setCanvasOver:function(u){this.isOver=!0,this.events.emit(r.GAME_OVER,u)},setCanvasOut:function(u){this.isOver=!1,this.events.emit(r.GAME_OUT,u)},preRender:function(){var u=this.game.loop.now,v=this.game.loop.delta,m=this.game.scene.getScenes(!0,!0);this.time=u,this.events.emit(r.MANAGER_UPDATE);for(var x=0;x10&&(u=10-this.pointersTotal);for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(96503),c=t(87902),a=t(83419),r=t(93301),n=t(74457),e=t(84409),s=t(20339),h=t(8497),i=t(81154),o=t(8214),f=t(50792),l=t(95540),u=t(23777),v=t(89639),m=t(41212),x=t(37277),g=t(87841),y=t(37303),T=t(44594),E=t(16483),P=t(10690),R=new a({Extends:f,initialize:function(L){f.call(this),this.scene=L,this.systems=L.sys,this.settings=L.sys.settings,this.manager=L.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,v.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var O={cancelled:!1};this._eventContainer={stopPropagation:function(){O.cancelled=!0}},this._eventData=O,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,L.sys.events.once(T.BOOT,this.boot,this),L.sys.events.on(T.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(T.DESTROY,this.destroy,this),this.pluginEvents.emit(o.BOOT)},start:function(){var M=this.systems.events;M.on(T.TRANSITION_START,this.transitionIn,this),M.on(T.TRANSITION_OUT,this.transitionOut,this),M.on(T.TRANSITION_COMPLETE,this.transitionComplete,this),M.on(T.PRE_UPDATE,this.preUpdate,this),M.once(T.SHUTDOWN,this.shutdown,this),this.manager.events.on(o.GAME_OUT,this.onGameOut,this),this.manager.events.on(o.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(o.START)},onGameOver:function(M){this.isActive()&&this.emit(o.GAME_OVER,M.timeStamp,M)},onGameOut:function(M){this.isActive()&&this.emit(o.GAME_OUT,M.timeStamp,M)},preUpdate:function(){this.pluginEvents.emit(o.PRE_UPDATE);var M=this._pendingRemoval,L=this._pendingInsertion,O=M.length,D=L.length;if(!(O===0&&D===0)){for(var I=this._list,V=0;V-1&&(I.splice(H,1),this.clear(X,!0))}this._pendingRemoval.length=0,this._list=I.concat(L.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(M,L){if(!this.isActive())return!1;if(this.pluginEvents.emit(o.UPDATE,M,L),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var O,D=this.manager,I=D.pointers,V=D.pointersTotal;for(O=0;O0)if(this._pollTimer-=L,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var H=!1;for(O=0;O0&&(H=!0)}return H},update:function(M,L){if(!this.isActive())return!1;for(var O=L.length,D=!1,I=0;I0&&(D=!0)}return this._updatedThisFrame=!0,D},clear:function(M,L){L===void 0&&(L=!1),this.disable(M);var O=M.input;O&&(this.removeDebug(M),this.manager.resetCursor(O),O.gameObject=void 0,O.target=void 0,O.hitArea=void 0,O.hitAreaCallback=void 0,O.callbackContext=void 0,M.input=null),L||this.queueForRemoval(M);var D=this._draggable.indexOf(M);return D>-1&&this._draggable.splice(D,1),M},disable:function(M){var L=M.input;L&&(L.enabled=!1,L.dragState=0);for(var O=this._drag,D=this._over,I=this.manager,V=0,X;V-1&&O[V].splice(X,1),X=D[V].indexOf(M),X>-1&&D[V].splice(X,1);return this},enable:function(M,L,O,D){return D===void 0&&(D=!1),M.input?M.input.enabled=!0:this.setHitArea(M,L,O),M.input&&D&&!M.input.dropZone&&(M.input.dropZone=D),this},hitTestPointer:function(M){for(var L=this.cameras.getCamerasBelowPointer(M),O=0;O0)return M.camera=D,I}return M.camera=L[0],[]},processDownEvents:function(M){var L=0,O=this._temp,D=this._eventData,I=this._eventContainer;D.cancelled=!1;for(var V=!1,X=0;X0&&s(M.x,M.y,M.downX,M.downY)>=I||D>0&&L>=M.downTime+D)&&(O=!0),O)return this.setDragState(M,3),this.processDragStartList(M)},processDragStartList:function(M){if(this.getDragState(M)!==3)return 0;for(var L=this._drag[M.id],O=0;O1&&(this.sortGameObjects(O,M),this.topOnly&&O.splice(1)),this._drag[M.id]=O,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(M,3),this.processDragStartList(M)):(this.setDragState(M,2),0))},processDragMoveEvent:function(M){if(this.getDragState(M)===2&&this.processDragThresholdEvent(M,this.manager.game.loop.now),this.getDragState(M)!==4)return 0;for(var L=this._tempZones,O=this._drag[M.id],D=0;D0?(I.emit(o.GAMEOBJECT_DRAG_LEAVE,M,X),this.emit(o.DRAG_LEAVE,M,I,X),V.target=L[0],X=V.target,I.emit(o.GAMEOBJECT_DRAG_ENTER,M,X),this.emit(o.DRAG_ENTER,M,I,X)):(I.emit(o.GAMEOBJECT_DRAG_LEAVE,M,X),this.emit(o.DRAG_LEAVE,M,I,X),L[0]?(V.target=L[0],X=V.target,I.emit(o.GAMEOBJECT_DRAG_ENTER,M,X),this.emit(o.DRAG_ENTER,M,I,X)):V.target=null)}else!X&&L[0]&&(V.target=L[0],X=V.target,I.emit(o.GAMEOBJECT_DRAG_ENTER,M,X),this.emit(o.DRAG_ENTER,M,I,X));var G,U;if(!I.parentContainer)G=M.worldX-V.dragX,U=M.worldY-V.dragY;else{var F=M.worldX-V.dragStartXGlobal,B=M.worldY-V.dragStartYGlobal,N=I.getParentRotation(),z=F*Math.cos(N)+B*Math.sin(N),Y=B*Math.cos(N)-F*Math.sin(N);z*=1/I.parentContainer.scaleX,Y*=1/I.parentContainer.scaleY,G=z+V.dragStartX,U=Y+V.dragStartY}I.emit(o.GAMEOBJECT_DRAG,M,G,U),this.emit(o.DRAG,M,I,G,U)}return O.length},processDragUpEvent:function(M){for(var L=this._drag[M.id],O=0;O0){var V=this.manager,X=this._eventData,H=this._eventContainer;X.cancelled=!1;for(var G=!1,U=0;U0){var I=this.manager,V=this._eventData,X=this._eventContainer;V.cancelled=!1;var H=!1;this.sortGameObjects(L,M);for(var G=0;G0){for(this.sortGameObjects(I,M),O=0;O0){for(this.sortGameObjects(V,M),O=0;O-1&&this._draggable.splice(I,1)}return this},makePixelPerfect:function(M){M===void 0&&(M=1);var L=this.systems.textures;return e(L,M)},setHitArea:function(M,L,O){if(L===void 0)return this.setHitAreaFromTexture(M);Array.isArray(M)||(M=[M]);var D=!1,I=!1,V=!1,X=!1,H=!1,G=!0;if(m(L)&&Object.keys(L).length){var U=L,F=M.some(function(K){return K.hasOwnProperty("faces")});if(!F){L=l(U,"hitArea",null),O=l(U,"hitAreaCallback",null),H=l(U,"pixelPerfect",!1);var B=l(U,"alphaTolerance",1);H&&(L={},O=this.makePixelPerfect(B))}D=l(U,"draggable",!1),I=l(U,"dropZone",!1),V=l(U,"cursor",!1),X=l(U,"useHandCursor",!1),(!L||!O)&&(this.setHitAreaFromTexture(M),G=!1)}else typeof L=="function"&&!O&&(O=L,L={});for(var N=0;N{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35154),c={},a={};a.register=function(r,n,e,s,h){c[r]={plugin:n,mapping:e,settingsKey:s,configKey:h}},a.getPlugin=function(r){return c[r]},a.install=function(r){var n=r.scene.sys,e=n.settings.input,s=n.game.config;for(var h in c){var i=c[h].plugin,o=c[h].mapping,f=c[h].settingsKey,l=c[h].configKey;d(e,f,s[l])&&(r[o]=new i(r))}},a.remove=function(r){c.hasOwnProperty(r)&&delete c[r]},p.exports=a},42515:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(31040),c=t(83419),a=t(20339),r=t(43855),n=t(47235),e=t(26099),s=t(25892),h=new c({initialize:function(o,f){this.manager=o,this.id=f,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new e,this.prevPosition=new e,this.midPoint=new e(-1,-1),this.velocity=new e,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=f===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(i){var o=i.getWorldPoint(this.x,this.y);return this.worldX=o.x,this.worldY=o.y,this},positionToCamera:function(i,o){return i.getWorldPoint(this.x,this.y,o)},updateMotion:function(){var i=this.position.x,o=this.position.y,f=this.midPoint.x,l=this.midPoint.y;if(!(i===f&&o===l)){var u=n(this.motionFactor,f,i),v=n(this.motionFactor,l,o);r(u,i,.1)&&(u=i),r(v,o,.1)&&(v=o),this.midPoint.set(u,v);var m=i-u,x=o-v;this.velocity.set(m,x),this.angle=d(u,v,i,o),this.distance=Math.sqrt(m*m+x*x)}},up:function(i){"buttons"in i&&(this.buttons=i.buttons),this.event=i,this.button=i.button,this.upElement=i.target,this.manager.transformPointer(this,i.pageX,i.pageY,!1),i.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=i.timeStamp,this.wasTouch=!1)},down:function(i){"buttons"in i&&(this.buttons=i.buttons),this.event=i,this.button=i.button,this.downElement=i.target,this.manager.transformPointer(this,i.pageX,i.pageY,!1),i.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),s.macOS&&i.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=i.timeStamp),this.wasTouch=!1},move:function(i){"buttons"in i&&(this.buttons=i.buttons),this.event=i,this.manager.transformPointer(this,i.pageX,i.pageY,!0),this.locked&&(this.movementX=i.movementX||i.mozMovementX||i.webkitMovementX||0,this.movementY=i.movementY||i.mozMovementY||i.webkitMovementY||0),this.moveTime=i.timeStamp,this.wasTouch=!1},wheel:function(i){"buttons"in i&&(this.buttons=i.buttons),this.event=i,this.manager.transformPointer(this,i.pageX,i.pageY,!1),this.deltaX=i.deltaX,this.deltaY=i.deltaY,this.deltaZ=i.deltaZ,this.wasTouch=!1},touchstart:function(i,o){i.pointerId&&(this.pointerId=i.pointerId),this.identifier=i.identifier,this.target=i.target,this.active=!0,this.buttons=1,this.event=o,this.downElement=i.target,this.manager.transformPointer(this,i.pageX,i.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=o.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(i,o){this.event=o,this.manager.transformPointer(this,i.pageX,i.pageY,!0),this.moveTime=o.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(i,o){this.buttons=0,this.event=o,this.upElement=i.target,this.manager.transformPointer(this,i.pageX,i.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=o.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(i,o){this.buttons=0,this.event=o,this.upElement=i.target,this.manager.transformPointer(this,i.pageX,i.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=o.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return this.buttons===0},leftButtonDown:function(){return!!(this.buttons&1)},rightButtonDown:function(){return!!(this.buttons&2)},middleButtonDown:function(){return!!(this.buttons&4)},backButtonDown:function(){return!!(this.buttons&8)},forwardButtonDown:function(){return!!(this.buttons&16)},leftButtonReleased:function(){return this.button===0&&!this.isDown},rightButtonReleased:function(){return this.button===2&&!this.isDown},middleButtonReleased:function(){return this.button===1&&!this.isDown},backButtonReleased:function(){return this.button===3&&!this.isDown},forwardButtonReleased:function(){return this.button===4&&!this.isDown},getDistance:function(){return this.isDown?a(this.downX,this.downY,this.x,this.y):a(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?d(this.downX,this.downY,this.x,this.y):d(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(i,o){i===void 0&&(i=10),o===void 0&&(o=[]);for(var f=this.prevPosition.x,l=this.prevPosition.y,u=this.position.x,v=this.position.y,m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8};p.exports=C},7179:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="boot"},85375:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},39843:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragend"},23388:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragenter"},16133:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="drag"},27829:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragleave"},53904:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragover"},56058:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragstart"},2642:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="drop"},88171:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectdown"},36147:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragend"},71692:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragenter"},96149:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="drag"},81285:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragleave"},74048:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragover"},21322:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragstart"},49378:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="drop"},86754:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectmove"},86433:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectout"},60709:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectover"},24081:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerdown"},11172:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointermove"},18907:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerout"},95579:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerover"},35368:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerup"},26972:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="wheel"},47078:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectup"},73802:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameobjectwheel"},56718:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameout"},25936:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="gameover"},27503:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="boot"},50852:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="process"},96438:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="update"},59152:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerlockchange"},47777:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerdown"},27957:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerdownoutside"},19444:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointermove"},54251:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerout"},18667:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerover"},27192:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerup"},24652:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pointerupoutside"},45132:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="wheel"},44512:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="preupdate"},15757:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="shutdown"},41637:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="start"},93802:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="update"},8214:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BOOT:t(7179),DESTROY:t(85375),DRAG_END:t(39843),DRAG_ENTER:t(23388),DRAG:t(16133),DRAG_LEAVE:t(27829),DRAG_OVER:t(53904),DRAG_START:t(56058),DROP:t(2642),GAME_OUT:t(56718),GAME_OVER:t(25936),GAMEOBJECT_DOWN:t(88171),GAMEOBJECT_DRAG_END:t(36147),GAMEOBJECT_DRAG_ENTER:t(71692),GAMEOBJECT_DRAG:t(96149),GAMEOBJECT_DRAG_LEAVE:t(81285),GAMEOBJECT_DRAG_OVER:t(74048),GAMEOBJECT_DRAG_START:t(21322),GAMEOBJECT_DROP:t(49378),GAMEOBJECT_MOVE:t(86754),GAMEOBJECT_OUT:t(86433),GAMEOBJECT_OVER:t(60709),GAMEOBJECT_POINTER_DOWN:t(24081),GAMEOBJECT_POINTER_MOVE:t(11172),GAMEOBJECT_POINTER_OUT:t(18907),GAMEOBJECT_POINTER_OVER:t(95579),GAMEOBJECT_POINTER_UP:t(35368),GAMEOBJECT_POINTER_WHEEL:t(26972),GAMEOBJECT_UP:t(47078),GAMEOBJECT_WHEEL:t(73802),MANAGER_BOOT:t(27503),MANAGER_PROCESS:t(50852),MANAGER_UPDATE:t(96438),POINTER_DOWN:t(47777),POINTER_DOWN_OUTSIDE:t(27957),POINTER_MOVE:t(19444),POINTER_OUT:t(54251),POINTER_OVER:t(18667),POINTER_UP:t(27192),POINTER_UP_OUTSIDE:t(24652),POINTER_WHEEL:t(45132),POINTERLOCK_CHANGE:t(59152),PRE_UPDATE:t(44512),SHUTDOWN:t(15757),START:t(41637),UPDATE:t(93802)}},97421:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n){this.pad=r,this.events=r.events,this.index=n,this.value=0,this.threshold=.1},update:function(a){this.value=a},getValue:function(){return Math.abs(this.value){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(92734),a=new d({initialize:function(n,e){this.pad=n,this.events=n.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(r){this.value=r;var n=this.pad,e=this.index;r>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(c.BUTTON_DOWN,n,this,r),this.pad.emit(c.GAMEPAD_BUTTON_DOWN,e,r,this)):this.pressed&&(this.pressed=!1,this.events.emit(c.BUTTON_UP,n,this,r),this.pad.emit(c.GAMEPAD_BUTTON_UP,e,r,this))},destroy:function(){this.pad=null,this.events=null}});p.exports=a},99125:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(97421),c=t(28884),a=t(83419),r=t(50792),n=t(26099),e=new a({Extends:r,initialize:function(h,i){r.call(this),this.manager=h,this.pad=i,this.id=i.id,this.index=i.index;for(var o=[],f=0;f=2&&(this.leftStick.set(l[0].getValue(),l[1].getValue()),f>=4&&this.rightStick.set(l[2].getValue(),l[3].getValue()))}},destroy:function(){this.removeAllListeners(),this.manager=null,this.pad=null;var s;for(s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(92734),r=t(99125),n=t(35154),e=t(89639),s=t(8214),h=new d({Extends:c,initialize:function(o){c.call(this),this.scene=o.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=o,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,o.pluginEvents.once(s.BOOT,this.boot,this),o.pluginEvents.on(s.START,this.start,this)},boot:function(){var i=this.scene.sys.game,o=this.settings.input,f=i.config;this.enabled=n(o,"gamepad",f.inputGamepad)&&i.device.input.gamepads,this.target=n(o,"gamepad.target",f.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(s.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(s.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var i=this,o=this.target,f=function(l){l.defaultPrevented||!i.isActive()||(i.refreshPads(),i.queue.push(l))};this.onGamepadHandler=f,o.addEventListener("gamepadconnected",f,!1),o.addEventListener("gamepaddisconnected",f,!1),this.sceneInputPlugin.pluginEvents.on(s.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(s.UPDATE,this.update);for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},65294:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},90089:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},64894:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={DUALSHOCK_4:t(65294),SNES_USB:t(89651),XBOX_360:t(90089)}},46008:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="down"},7629:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="up"},42206:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="connected"},86544:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="disconnected"},94784:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="down"},14325:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="up"},92734:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BUTTON_DOWN:t(46008),BUTTON_UP:t(7629),CONNECTED:t(42206),DISCONNECTED:t(86544),GAMEPAD_BUTTON_DOWN:t(94784),GAMEPAD_BUTTON_UP:t(14325)}},48646:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Axis:t(97421),Button:t(28884),Events:t(92734),Gamepad:t(99125),GamepadPlugin:t(56654),Configs:t(64894)}},14350:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(93301),c=t(79291),a={CreatePixelPerfectHandler:t(84409),CreateInteractiveObject:t(74457),Events:t(8214),Gamepad:t(48646),InputManager:t(7003),InputPlugin:t(48205),InputPluginCache:t(89639),Keyboard:t(51442),Mouse:t(87078),Pointer:t(42515),Touch:t(95618)};a=c(!1,a,d),p.exports=a},78970:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(72905),c=t(83419),a=t(8443),r=t(8214),n=t(46032),e=t(29747),s=new c({initialize:function(i){this.manager=i,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=e,this.onKeyUp=e,i.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var h=this.manager.config;this.enabled=h.inputKeyboard,this.target=h.inputKeyboardEventTarget,this.addCapture(h.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(a.POST_STEP,this.postUpdate,this)},startListeners:function(){var h=this;this.onKeyDown=function(o){if(!(o.defaultPrevented||!h.enabled||!h.manager)){h.queue.push(o),h.manager.events.emit(r.MANAGER_PROCESS);var f=o.altKey||o.ctrlKey||o.shiftKey||o.metaKey;h.preventDefault&&!f&&h.captures.indexOf(o.keyCode)>-1&&o.preventDefault()}},this.onKeyUp=function(o){if(!(o.defaultPrevented||!h.enabled||!h.manager)){h.queue.push(o),h.manager.events.emit(r.MANAGER_PROCESS);var f=o.altKey||o.ctrlKey||o.shiftKey||o.metaKey;h.preventDefault&&!f&&h.captures.indexOf(o.keyCode)>-1&&o.preventDefault()}};var i=this.target;i&&(i.addEventListener("keydown",this.onKeyDown,!1),i.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var h=this.target;h.removeEventListener("keydown",this.onKeyDown,!1),h.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(h){typeof h=="string"&&(h=h.split(",")),Array.isArray(h)||(h=[h]);for(var i=this.captures,o=0;o0},removeCapture:function(h){typeof h=="string"&&(h=h.split(",")),Array.isArray(h)||(h=[h]);for(var i=this.captures,o=0;o0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(a.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});p.exports=s},28846:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(95922),r=t(8443),n=t(35154),e=t(8214),s=t(89639),h=t(30472),i=t(46032),o=t(87960),f=t(74600),l=t(44594),u=t(56583),v=new d({Extends:c,initialize:function(x){c.call(this),this.game=x.systems.game,this.scene=x.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=x,this.manager=x.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,x.pluginEvents.once(e.BOOT,this.boot,this),x.pluginEvents.on(e.START,this.start,this)},boot:function(){var m=this.settings.input;this.enabled=n(m,"keyboard",!0);var x=n(m,"keyboard.capture",null);x&&this.addCaptures(x),this.sceneInputPlugin.pluginEvents.once(e.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(e.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(e.SHUTDOWN,this.shutdown,this),this.game.events.on(r.BLUR,this.resetKeys,this),this.scene.sys.events.on(l.PAUSE,this.resetKeys,this),this.scene.sys.events.on(l.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(m){return this.manager.addCapture(m),this},removeCapture:function(m){return this.manager.removeCapture(m),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:i.UP,down:i.DOWN,left:i.LEFT,right:i.RIGHT,space:i.SPACE,shift:i.SHIFT})},addKeys:function(m,x,g){x===void 0&&(x=!0),g===void 0&&(g=!1);var y={};if(typeof m=="string"){m=m.split(",");for(var T=0;T-1?y[T]=m:y[m.keyCode]=m,x&&this.addCapture(m.keyCode),m.setEmitOnRepeat(g),m}return typeof m=="string"&&(m=i[m.toUpperCase()]),y[m]||(y[m]=new h(this,m),x&&this.addCapture(m),y[m].setEmitOnRepeat(g)),y[m]},removeKey:function(m,x,g){x===void 0&&(x=!1),g===void 0&&(g=!1);var y=this.keys,T;if(m instanceof h){var E=y.indexOf(m);E>-1&&(T=this.keys[E],this.keys[E]=void 0)}else typeof m=="string"&&(m=i[m.toUpperCase()]);return y[m]&&(T=y[m],y[m]=void 0),T&&(T.plugin=null,g&&this.removeCapture(T.keyCode),x&&T.destroy()),this},removeAllKeys:function(m,x){m===void 0&&(m=!1),x===void 0&&(x=!1);for(var g=this.keys,y=0;ym._tick)return m._tick=g,!0}return!1},update:function(){var m=this.manager.queue,x=m.length;if(!(!this.isActive()||x===0))for(var g=this.keys,y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d.timeLastMatched=t.timeStamp,d.index++,d.index===d.size?!0:(d.current=d.keyCodes[d.index],!1)};p.exports=C},87960:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95922),a=t(95540),r=t(68769),n=t(92803),e=new d({initialize:function(h,i,o){if(o===void 0&&(o={}),i.length<2)return!1;this.manager=h,this.enabled=!0,this.keyCodes=[];for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66970),c=function(a,r){if(r.matched)return!0;var n=!1,e=!1;if(a.keyCode===r.current)if(r.index>0&&r.maxKeyDelay>0){var s=r.timeLastMatched+r.maxKeyDelay;a.timeStamp<=s&&(e=!0,n=d(a,r))}else e=!0,n=d(a,r);return!e&&r.resetOnWrongKey&&(r.index=0,r.current=r.keyCodes[0]),n&&(r.timeLastMatched=a.timeStamp,r.matched=!0,r.timeMatched=a.timeStamp),n};p.exports=c},92803:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t};p.exports=C},92612:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="keydown"},23345:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="keyup"},21957:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="keycombomatch"},44743:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="down"},3771:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="keydown-"},46358:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="keyup-"},75674:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="up"},95922:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ANY_KEY_DOWN:t(92612),ANY_KEY_UP:t(23345),COMBO_MATCH:t(21957),DOWN:t(44743),KEY_DOWN:t(3771),KEY_UP:t(46358),UP:t(75674)}},51442:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Events:t(95922),KeyboardManager:t(78970),KeyboardPlugin:t(28846),Key:t(30472),KeyCodes:t(46032),KeyCombo:t(87960),AdvanceKeyCombo:t(66970),ProcessKeyCombo:t(68769),ResetKeyCombo:t(92803),JustDown:t(90229),JustUp:t(38796),DownDuration:t(37015),UpDuration:t(41170)}},37015:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=50);var c=t.plugin.game.loop.time-t.timeDown;return t.isDown&&c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t._justDown?(t._justDown=!1,!0):!1};p.exports=C},38796:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t._justUp?(t._justUp=!1,!0):!1};p.exports=C},30472:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(95922),r=new d({Extends:c,initialize:function(e,s){c.call(this),this.plugin=e,this.keyCode=s,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(n){return this.emitOnRepeat=n,this},onDown:function(n){this.originalEvent=n,this.enabled&&(this.altKey=n.altKey,this.ctrlKey=n.ctrlKey,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.location=n.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(a.DOWN,this,n):(this.isDown=!0,this.isUp=!1,this.timeDown=n.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(a.DOWN,this,n)))},onUp:function(n){this.originalEvent=n,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=n.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(a.UP,this,n))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});p.exports=r},46032:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175};p.exports=C},74600:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(46032),c={};for(var a in d)c[d[a]]=a;p.exports=c},41170:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=50);var c=t.plugin.game.loop.time-t.timeUp;return t.isUp&&c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(89357),a=t(8214),r=t(29747),n=new d({initialize:function(s){this.manager=s,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=r,this.onMouseDown=r,this.onMouseUp=r,this.onMouseDownWindow=r,this.onMouseUpWindow=r,this.onMouseOver=r,this.onMouseOut=r,this.onMouseWheel=r,this.pointerLockChange=r,this.isTop=!0,s.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var e=this.manager.config;this.enabled=e.inputMouse,this.target=e.inputMouseEventTarget,this.passive=e.inputMousePassive,this.preventDefaultDown=e.inputMousePreventDefaultDown,this.preventDefaultUp=e.inputMousePreventDefaultUp,this.preventDefaultMove=e.inputMousePreventDefaultMove,this.preventDefaultWheel=e.inputMousePreventDefaultWheel,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,e.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(e){return e.preventDefault(),!1}),this},requestPointerLock:function(){if(c.pointerLock){var e=this.target;e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock()}},releasePointerLock:function(){c.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var e=this.target;if(e){var s=this,h=this.manager,i=h.canvas,o=window&&window.focus&&h.game.config.autoFocus;this.onMouseMove=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&(h.onMouseMove(l),s.preventDefaultMove&&l.preventDefault())},this.onMouseDown=function(l){o&&window.focus(),!l.defaultPrevented&&s.enabled&&h&&h.enabled&&(h.onMouseDown(l),s.preventDefaultDown&&l.target===i&&l.preventDefault())},this.onMouseDownWindow=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&l.target!==i&&h.onMouseDown(l)},this.onMouseUp=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&(h.onMouseUp(l),s.preventDefaultUp&&l.target===i&&l.preventDefault())},this.onMouseUpWindow=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&l.target!==i&&h.onMouseUp(l)},this.onMouseOver=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&h.setCanvasOver(l)},this.onMouseOut=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&h.setCanvasOut(l)},this.onMouseWheel=function(l){!l.defaultPrevented&&s.enabled&&h&&h.enabled&&h.onMouseWheel(l),s.preventDefaultWheel&&l.target===i&&l.preventDefault()};var f={passive:!0};if(e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mouseover",this.onMouseOver,f),e.addEventListener("mouseout",this.onMouseOut,f),this.preventDefaultWheel?e.addEventListener("wheel",this.onMouseWheel,{passive:!1}):e.addEventListener("wheel",this.onMouseWheel,f),window&&h.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,f),window.top.addEventListener("mouseup",this.onMouseUpWindow,f)}catch{window.addEventListener("mousedown",this.onMouseDownWindow,f),window.addEventListener("mouseup",this.onMouseUpWindow,f),this.isTop=!1}c.pointerLock&&(this.pointerLockChange=function(l){var u=s.target;s.locked=document.pointerLockElement===u||document.mozPointerLockElement===u||document.webkitPointerLockElement===u,h.onPointerLockChange(l)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var e=this.target;e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mouseover",this.onMouseOver),e.removeEventListener("mouseout",this.onMouseOut),window&&(e=this.isTop?window.top:window,e.removeEventListener("mousedown",this.onMouseDownWindow),e.removeEventListener("mouseup",this.onMouseUpWindow)),c.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});p.exports=n},87078:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={MouseManager:t(85098)}},36210:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(8214),a=t(29747),r=new d({initialize:function(e){this.manager=e,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=a,this.onTouchStartWindow=a,this.onTouchMove=a,this.onTouchEnd=a,this.onTouchEndWindow=a,this.onTouchCancel=a,this.onTouchCancelWindow=a,this.isTop=!0,e.events.once(c.MANAGER_BOOT,this.boot,this)},boot:function(){var n=this.manager.config;this.enabled=n.inputTouch,this.target=n.inputTouchEventTarget,this.capture=n.inputTouchCapture,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,n.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(n){return n.preventDefault(),!1}),this},startListeners:function(){var n=this.target;if(n){var e=this,s=this.manager,h=s.canvas,i=window&&window.focus&&s.game.config.autoFocus;this.onTouchMove=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&(s.onTouchMove(u),e.capture&&u.cancelable&&u.preventDefault())},this.onTouchStart=function(u){i&&window.focus(),!u.defaultPrevented&&e.enabled&&s&&s.enabled&&(s.onTouchStart(u),e.capture&&u.cancelable&&u.target===h&&u.preventDefault())},this.onTouchStartWindow=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&u.target!==h&&s.onTouchStart(u)},this.onTouchEnd=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&(s.onTouchEnd(u),e.capture&&u.cancelable&&u.target===h&&u.preventDefault())},this.onTouchEndWindow=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&u.target!==h&&(s.onTouchEnd(u),e.capture&&u.cancelable&&u.preventDefault())},this.onTouchCancel=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&(s.onTouchCancel(u),e.capture&&u.preventDefault())},this.onTouchCancelWindow=function(u){!u.defaultPrevented&&e.enabled&&s&&s.enabled&&s.onTouchCancel(u)};var o=this.capture,f={passive:!0},l={passive:!1};if(n.addEventListener("touchstart",this.onTouchStart,o?l:f),n.addEventListener("touchmove",this.onTouchMove,o?l:f),n.addEventListener("touchend",this.onTouchEnd,o?l:f),n.addEventListener("touchcancel",this.onTouchCancel,o?l:f),window&&s.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,l),window.top.addEventListener("touchend",this.onTouchEndWindow,l),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,l)}catch{window.addEventListener("touchstart",this.onTouchStartWindow,l),window.addEventListener("touchend",this.onTouchEndWindow,l),window.addEventListener("touchcancel",this.onTouchCancelWindow,l),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var n=this.target;n.removeEventListener("touchstart",this.onTouchStart),n.removeEventListener("touchmove",this.onTouchMove),n.removeEventListener("touchend",this.onTouchEnd),n.removeEventListener("touchcancel",this.onTouchCancel),window&&(n=this.isTop?window.top:window,n.removeEventListener("touchstart",this.onTouchStartWindow),n.removeEventListener("touchend",this.onTouchEndWindow),n.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});p.exports=r},95618:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={TouchManager:t(36210)}},41299:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(54899),r=t(95540),n=t(98356),e=t(3374),s=t(84376),h=t(92638),i=new d({initialize:function(f,l){if(this.loader=f,this.cache=r(l,"cache",!1),this.type=r(l,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=r(l,"key",!1);var u=this.key;if(f.prefix&&f.prefix!==""&&(this.key=f.prefix+u),!this.key)throw new Error("Invalid File key: "+this.key);var v=r(l,"url");v===void 0?v=f.path+u+"."+r(l,"extension",""):typeof v=="string"&&!v.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)&&(v=f.path+v),this.url=v,this.src="",this.xhrSettings=h(r(l,"responseType",void 0)),r(l,"xhrSettings",!1)&&(this.xhrSettings=e(this.xhrSettings,r(l,"xhrSettings",{}))),this.xhrLoader=null,this.state=typeof this.url=="function"?c.FILE_POPULATED:c.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=r(l,"config",{}),this.multiFile,this.linkFile,this.base64=typeof v=="string"&&v.indexOf("data:")===0},setLink:function(o){this.linkFile=o,o.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===c.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=c.FILE_LOADING,this.src=n(this,this.loader.baseURL),this.src.indexOf("data:")===0&&(this.base64=!0),this.xhrLoader=s(this,this.loader.xhr))},onLoad:function(o,f){var l=o.responseURL&&this.loader.localSchemes.some(function(m){return o.responseURL.indexOf(m)===0}),u=l&&f.target.status===0,v=!(f.target&&f.target.status!==200)||u;o.readyState===4&&o.status>=400&&o.status<=599&&(v=!1),this.state=c.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,v)},onBase64Load:function(o){this.xhrLoader=o,this.state=c.FILE_LOADED,this.percentComplete=1,this.loader.emit(a.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(o){o.lengthComputable&&(this.bytesLoaded=o.loaded,this.bytesTotal=o.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(a.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=c.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=c.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=c.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(o){if(this.state!==c.FILE_PENDING_DESTROY){o===void 0&&(o=this.data);var f=this.key,l=this.type;this.loader.emit(a.FILE_COMPLETE,f,l,o),this.loader.emit(a.FILE_KEY_COMPLETE+l+"-"+f,f,l,o),this.loader.flagForRemoval(this),this.state=c.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});i.createObjectURL=function(o,f,l){if(typeof URL=="function")o.src=URL.createObjectURL(f);else{var u=new FileReader;u.onload=function(){o.removeAttribute("crossOrigin"),o.src="data:"+(f.type||l)+";base64,"+u.result.split(",")[1]},u.onerror=o.onerror,u.readAsDataURL(f)}},i.revokeObjectURL=function(o){typeof URL=="function"&&URL.revokeObjectURL(o.src)},p.exports=i},74099:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={},t={install:function(d){for(var c in C)d[c]=C[c]},register:function(d,c){C[d]=c},destroy:function(){C={}}};p.exports=t},98356:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.url?t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:d+t.url:!1};p.exports=C},74261:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(35072),r=t(50792),n=t(54899),e=t(74099),s=t(95540),h=t(35154),i=t(37277),o=t(44594),f=t(92638),l=new d({Extends:r,initialize:function(v){r.call(this);var m=v.sys.game.config,x=v.sys.settings.loader;this.scene=v,this.systems=v.sys,this.cacheManager=v.sys.cache,this.textureManager=v.sys.textures,this.sceneManager=v.sys.game.scene,e.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(s(x,"baseURL",m.loaderBaseURL)),this.setPath(s(x,"path",m.loaderPath)),this.setPrefix(s(x,"prefix",m.loaderPrefix)),this.maxParallelDownloads=s(x,"maxParallelDownloads",m.loaderMaxParallelDownloads),this.xhr=f(s(x,"responseType",m.loaderResponseType),s(x,"async",m.loaderAsync),s(x,"user",m.loaderUser),s(x,"password",m.loaderPassword),s(x,"timeout",m.loaderTimeout),s(x,"withCredentials",m.loaderWithCredentials)),this.crossOrigin=s(x,"crossOrigin",m.loaderCrossOrigin),this.imageLoadType=s(x,"imageLoadType",m.loaderImageLoadType),this.localSchemes=s(x,"localScheme",m.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new a,this.inflight=new a,this.queue=new a,this._deleteQueue=new a,this.totalFailed=0,this.totalComplete=0,this.state=c.LOADER_IDLE,this.multiKeyIndex=0,v.sys.events.once(o.BOOT,this.boot,this),v.sys.events.on(o.START,this.pluginStart,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(o.SHUTDOWN,this.shutdown,this)},setBaseURL:function(u){return u===void 0&&(u=""),u!==""&&u.substr(-1)!=="/"&&(u=u.concat("/")),this.baseURL=u,this},setPath:function(u){return u===void 0&&(u=""),u!==""&&u.substr(-1)!=="/"&&(u=u.concat("/")),this.path=u,this},setPrefix:function(u){return u===void 0&&(u=""),this.prefix=u,this},setCORS:function(u){return this.crossOrigin=u,this},addFile:function(u){Array.isArray(u)||(u=[u]);for(var v=0;v0},isLoading:function(){return this.state===c.LOADER_LOADING||this.state===c.LOADER_PROCESSING},isReady:function(){return this.state===c.LOADER_IDLE||this.state===c.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(n.START,this),this.list.size===0?this.loadComplete():(this.state=c.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(o.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(n.PROGRESS,this.progress)},update:function(){this.state===c.LOADER_LOADING&&this.list.size>0&&this.inflight.size{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=t(92638),a=function(r,n){var e=r===void 0?c():d({},r);if(n)for(var s in n)n[s]!==void 0&&(e[s]=n[s]);return e};p.exports=a},26430:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(54899),r=new d({initialize:function(e,s,h,i){var o=[];i.forEach(function(u){u&&o.push(u)}),this.loader=e,this.type=s,this.key=h;var f=this.key;e.prefix&&e.prefix!==""&&(this.key=e.prefix+f),this.multiKeyIndex=e.multiKeyIndex++,this.files=o,this.state=c.FILE_PENDING,this.complete=!1,this.pending=o.length,this.failed=0,this.config={},this.baseURL=e.baseURL,this.path=e.path,this.prefix=e.prefix;for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(3374),c=function(a,r){var n=d(r,a.xhrSettings);if(a.base64){var e=a.url.split(";base64,").pop()||a.url.split(",").pop(),s={responseText:atob(e)};a.onBase64Load(s);return}var h=new XMLHttpRequest;if(h.open("GET",a.src,n.async,n.user,n.password),h.responseType=a.xhrSettings.responseType,h.timeout=n.timeout,n.headers)for(var i in n.headers)h.setRequestHeader(i,n.headers[i]);return n.header&&n.headerValue&&h.setRequestHeader(n.header,n.headerValue),n.requestedWith&&h.setRequestHeader("X-Requested-With",n.requestedWith),n.overrideMimeType&&h.overrideMimeType(n.overrideMimeType),n.withCredentials&&(h.withCredentials=!0),h.onload=a.onLoad.bind(a,h),h.onerror=a.onError.bind(a,h),h.onprogress=a.onProgress.bind(a),h.ontimeout=a.onError.bind(a,h),h.send(),h};p.exports=c},92638:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n){return t===void 0&&(t=""),d===void 0&&(d=!0),c===void 0&&(c=""),a===void 0&&(a=""),r===void 0&&(r=0),n===void 0&&(n=!1),{responseType:t,async:d,user:c,password:a,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}};p.exports=C},23906:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20};p.exports=C},42155:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="addfile"},38991:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},27540:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="filecomplete"},87464:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="filecomplete-"},94486:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="loaderror"},13035:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="load"},38144:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="fileprogress"},97520:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="postprocess"},85595:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="progress"},55680:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="start"},54899:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADD:t(42155),COMPLETE:t(38991),FILE_COMPLETE:t(27540),FILE_KEY_COMPLETE:t(87464),FILE_LOAD_ERROR:t(94486),FILE_LOAD:t(13035),FILE_PROGRESS:t(38144),POST_PROCESS:t(97520),PROGRESS:t(85595),START:t(55680)}},14135:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(518),r=t(54899),n=new d({Extends:a,initialize:function(s,h,i,o,f){a.call(this,s,h,i,o,f),this.type="animationJSON"},onProcess:function(){this.loader.once(r.POST_PROCESS,this.onLoadComplete,this),a.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});c.register("animation",function(e,s,h,i){if(Array.isArray(e))for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),s=t(26430),h=new d({Extends:s,initialize:function(o,f,l,u,v,m){var x,g;if(n(f)){var y=f;f=a(y,"key"),x=new r(o,{key:f,url:a(y,"textureURL"),extension:a(y,"textureExtension","png"),normalMap:a(y,"normalMap"),xhrSettings:a(y,"textureXhrSettings")}),g=new e(o,{key:f,url:a(y,"atlasURL"),extension:a(y,"atlasExtension","json"),xhrSettings:a(y,"atlasXhrSettings")})}else x=new r(o,f,l,v),g=new e(o,f,u,m);x.linkFile?s.call(this,o,"atlasjson",f,[x,g,x.linkFile]):s.call(this,o,"atlasjson",f,[x,g])},addToCache:function(){if(this.isReadyToProcess()){var i=this.files[0],o=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(i.key,i.data,o.data,f),o.addToCache(),this.complete=!0}}});c.register("aseprite",function(i,o,f,l,u){var v;if(Array.isArray(i))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),s=t(26430),h=new d({Extends:s,initialize:function(o,f,l,u,v,m){var x,g;if(n(f)){var y=f;f=a(y,"key"),x=new r(o,{key:f,url:a(y,"textureURL"),extension:a(y,"textureExtension","png"),normalMap:a(y,"normalMap"),xhrSettings:a(y,"textureXhrSettings")}),g=new e(o,{key:f,url:a(y,"atlasURL"),extension:a(y,"atlasExtension","json"),xhrSettings:a(y,"atlasXhrSettings")})}else x=new r(o,f,l,v),g=new e(o,f,u,m);x.linkFile?s.call(this,o,"atlasjson",f,[x,g,x.linkFile]):s.call(this,o,"atlasjson",f,[x,g])},addToCache:function(){if(this.isReadyToProcess()){var i=this.files[0],o=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(i.key,i.data,o.data,f),this.complete=!0}}});c.register("atlas",function(i,o,f,l,u){var v;if(Array.isArray(i))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),s=t(57318),h=new d({Extends:e,initialize:function(o,f,l,u,v,m){var x,g;if(n(f)){var y=f;f=a(y,"key"),x=new r(o,{key:f,url:a(y,"textureURL"),extension:a(y,"textureExtension","png"),normalMap:a(y,"normalMap"),xhrSettings:a(y,"textureXhrSettings")}),g=new s(o,{key:f,url:a(y,"atlasURL"),extension:a(y,"atlasExtension","xml"),xhrSettings:a(y,"atlasXhrSettings")})}else x=new r(o,f,l,v),g=new s(o,f,u,m);x.linkFile?e.call(this,o,"atlasxml",f,[x,g,x.linkFile]):e.call(this,o,"atlasxml",f,[x,g])},addToCache:function(){if(this.isReadyToProcess()){var i=this.files[0],o=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(i.key,i.data,o.data,f),this.complete=!0}}});c.register("atlasXML",function(i,o,f,l,u){var v;if(Array.isArray(i))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(89749),s=t(41212),h=new d({Extends:a,initialize:function(o,f,l,u,v){if(s(f)){var m=f;f=n(m,"key"),u=n(m,"xhrSettings"),v=n(m,"context",v)}var x={type:"audio",cache:o.cacheManager.audio,extension:l.type,responseType:"arraybuffer",key:f,url:l.url,xhrSettings:u,config:{context:v}};a.call(this,o,x)},onProcess:function(){this.state=c.FILE_PROCESSING;var i=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(o){i.data=o,i.onProcessComplete()},function(o){console.error("Error decoding audio: "+i.key+" - ",o?o.message:null),i.onProcessError()}),this.config.context=null}});h.create=function(i,o,f,l,u){var v=i.systems.game,m=v.config.audio,x=v.device.audio;s(o)&&(f=n(o,"url",[]),l=n(o,"config",{}));var g=h.getAudioURL(v,f);return g?x.webAudio&&!m.disableWebAudio?new h(i,o,g,u,v.sound.context):new e(i,o,g,l):(console.warn('No audio URLs for "%s" matched this device',o),null)},h.getAudioURL=function(i,o){Array.isArray(o)||(o=[o]);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(21097),c=t(83419),a=t(74099),r=t(95540),n=t(41212),e=t(518),s=t(26430),h=new c({Extends:s,initialize:function(o,f,l,u,v,m,x){if(n(f)){var g=f;f=r(g,"key"),l=r(g,"jsonURL"),u=r(g,"audioURL"),v=r(g,"audioConfig"),m=r(g,"audioXhrSettings"),x=r(g,"jsonXhrSettings")}var y;if(!u)y=new e(o,f,l,x),s.call(this,o,"audiosprite",f,[y]),this.config.resourceLoad=!0,this.config.audioConfig=v,this.config.audioXhrSettings=m;else{var T=d.create(o,f,u,v,m);T&&(y=new e(o,f,l,x),s.call(this,o,"audiosprite",f,[T,y]),this.config.resourceLoad=!1)}},onFileComplete:function(i){var o=this.files.indexOf(i);if(o!==-1&&(this.pending--,this.config.resourceLoad&&i.type==="json"&&i.data.hasOwnProperty("resources"))){var f=i.data.resources,l=r(this.config,"audioConfig"),u=r(this.config,"audioXhrSettings"),v=d.create(this.loader,i.key,f,l,u);v&&(this.addToMultiFile(v),this.loader.addFile(v))}},addToCache:function(){if(this.isReadyToProcess()){var i=this.files[0],o=this.files[1];i.addToCache(),o.addToCache(),this.complete=!0}}});a.register("audioSprite",function(i,o,f,l,u,v){var m=this.systems.game,x=m.config.audio,g=m.device.audio;if(x&&x.noAudio||!g.webAudio&&!g.audioData)return this;var y;if(Array.isArray(i))for(var T=0;T{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u){var v="bin";if(e(o)){var m=o;o=n(m,"key"),f=n(m,"url"),l=n(m,"xhrSettings"),v=n(m,"extension",v),u=n(m,"dataType",u)}var x={type:"binary",cache:i.cacheManager.binary,extension:v,responseType:"arraybuffer",key:o,url:f,xhrSettings:l,config:{dataType:u}};a.call(this,i,x)},onProcess:function(){this.state=c.FILE_PROCESSING;var h=this.config.dataType;this.data=h?new h(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});r.register("binary",function(h,i,o,f){if(Array.isArray(h))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),s=t(21859),h=t(57318),i=new d({Extends:e,initialize:function(f,l,u,v,m,x){var g,y;if(n(l)){var T=l;l=a(T,"key"),g=new r(f,{key:l,url:a(T,"textureURL"),extension:a(T,"textureExtension","png"),normalMap:a(T,"normalMap"),xhrSettings:a(T,"textureXhrSettings")}),y=new h(f,{key:l,url:a(T,"fontDataURL"),extension:a(T,"fontDataExtension","xml"),xhrSettings:a(T,"fontDataXhrSettings")})}else g=new r(f,l,u,m),y=new h(f,l,v,x);g.linkFile?e.call(this,f,"bitmapfont",l,[g,y,g.linkFile]):e.call(this,f,"bitmapfont",l,[g,y])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],f=this.files[1];o.addToCache();var l=o.cache.get(o.key),u=s(f.data,o.cache.getFrame(o.key),0,0,l);this.loader.cacheManager.bitmapFont.add(o.key,{data:u,texture:o.key,frame:null}),this.complete=!0}}});c.register("bitmapFont",function(o,f,l,u,v){var m;if(Array.isArray(o))for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l){var u="css";if(e(o)){var v=o;o=n(v,"key"),f=n(v,"url"),l=n(v,"xhrSettings"),u=n(v,"extension",u)}var m={type:"script",cache:!1,extension:u,responseType:"text",key:o,url:f,xhrSettings:l};a.call(this,i,m)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});r.register("css",function(h,i,o){if(Array.isArray(h))for(var f=0;f{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(38734),c=t(85722),a=t(83419),r=t(74099),n=t(95540),e=t(19550),s=t(41212),h=t(518),i=t(31403),o=t(46975),f=t(59327),l=t(26430),u=t(82038),v=t(55222),m=new a({Extends:l,initialize:function(g,y,T,E){if(T.multiAtlasURL){var P=new h(g,{key:y,url:T.multiAtlasURL,xhrSettings:E,config:T});l.call(this,g,"texture",y,[P])}else{var R=T.textureURL.substr(T.textureURL.length-3);T.type||(T.type=R.toLowerCase()==="ktx"?"KTX":"PVR");var M=new c(g,{key:y,url:T.textureURL,extension:R,xhrSettings:E,config:T});if(T.atlasURL){var L=new h(g,{key:y,url:T.atlasURL,xhrSettings:E,config:T});l.call(this,g,"texture",y,[M,L])}else l.call(this,g,"texture",y,[M])}this.config=T},onFileComplete:function(x){var g=this.files.indexOf(x);if(g!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(x.type==="json"&&x.data.hasOwnProperty("textures")){var y=x.data.textures,T=this.config,E=this.loader,P=E.baseURL,R=E.path,M=E.prefix,L=n(T,"multiBaseURL",this.baseURL),O=n(T,"multiPath",this.path),D=n(T,"prefix",this.prefix),I=n(T,"textureXhrSettings");L&&E.setBaseURL(L),O&&E.setPath(O),D&&E.setPrefix(D);for(var V=0;V{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=t(73894),h=new d({Extends:a,initialize:function(o,f,l,u,v){var m="glsl";if(e(f)){var x=f;f=n(x,"key"),l=n(x,"url"),u=n(x,"shaderType","fragment"),v=n(x,"xhrSettings"),m=n(x,"extension",m)}else u===void 0&&(u="fragment");var g={type:"glsl",cache:o.cacheManager.shader,extension:m,responseType:"text",key:f,url:l,config:{shaderType:u},xhrSettings:v};a.call(this,o,g)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var i=this.data.split(` +`),o=this.extractBlock(i,0);if(o)for(;o;){var f=this.getShaderName(o.header),l=this.getShaderType(o.header),u=this.getShaderUniforms(o.header),v=o.shader;if(this.cache.has(f)){var m=this.cache.get(f);l==="fragment"?m.fragmentSrc=v:m.vertexSrc=v,m.uniforms||(m.uniforms=u)}else l==="fragment"?this.cache.add(f,new s(f,v,"",u)):this.cache.add(f,new s(f,"",v,u));o=this.extractBlock(i,o.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new s(this.key,this.data)):this.cache.add(this.key,new s(this.key,"",this.data))},getShaderName:function(i){for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(54899),a=t(41299),r=t(95540),n=t(98356),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l){if(e(o)){var u=o;o=r(u,"key"),l=r(u,"config",l)}var v={type:"audio",cache:i.cacheManager.audio,extension:f.type,key:o,url:f.url,config:l};a.call(this,i,v),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l){var u="html";if(e(o)){var v=o;o=n(v,"key"),f=n(v,"url"),l=n(v,"xhrSettings"),u=n(v,"extension",u)}var m={type:"text",cache:i.cacheManager.html,extension:u,responseType:"text",key:o,url:f,xhrSettings:l};a.call(this,i,m)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("html",function(h,i,o){if(Array.isArray(h))for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u,v){l===void 0&&(l=512),u===void 0&&(u=512);var m="html";if(e(o)){var x=o;o=n(x,"key"),f=n(x,"url"),v=n(x,"xhrSettings"),m=n(x,"extension",m),l=n(x,"width",l),u=n(x,"height",u)}var g={type:"html",cache:i.textureManager,extension:m,responseType:"text",key:o,url:f,xhrSettings:v,config:{width:l,height:u}};a.call(this,i,g)},onProcess:function(){this.state=c.FILE_PROCESSING;var h=this.config.width,i=this.config.height,o=[];o.push(''),o.push(''),o.push(''),o.push(this.xhrLoader.responseText),o.push(""),o.push(""),o.push("");var f=[o.join(` +`)],l=this;try{var u=new window.Blob(f,{type:"image/svg+xml;charset=utf-8"})}catch{l.state=c.FILE_ERRORED,l.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){a.revokeObjectURL(l.data),l.onProcessComplete()},this.data.onerror=function(){a.revokeObjectURL(l.data),l.onProcessError()},a.createObjectURL(this.data,u,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("htmlTexture",function(h,i,o,f,l){if(Array.isArray(h))for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=t(98356),h=new d({Extends:a,initialize:function i(o,f,l,u,v){var m="png",x;if(e(f)){var g=f;f=n(g,"key"),l=n(g,"url"),x=n(g,"normalMap"),u=n(g,"xhrSettings"),m=n(g,"extension",m),v=n(g,"frameConfig")}Array.isArray(l)&&(x=l[1],l=l[0]);var y={type:"image",cache:o.textureManager,extension:m,responseType:"blob",key:f,url:l,xhrSettings:u,config:v};if(a.call(this,o,y),x){var T=new i(o,this.key,x,u,v);T.type="normalMap",this.setLink(T),o.addFile(T)}this.useImageElementLoad=o.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var i=this;this.data.onload=function(){a.revokeObjectURL(i.data),i.onProcessComplete()},this.data.onerror=function(){a.revokeObjectURL(i.data),i.onProcessError()},a.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var i=this.state;this.state=c.FILE_PROCESSING,i===c.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=c.FILE_LOADING,this.src=s(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var i=this;this.data.onload=function(){i.state=c.FILE_LOADED,i.loader.nextFile(i,!0)},this.data.onerror=function(){i.loader.nextFile(i,!1)},this.data.src=this.src},addToCache:function(){var i=this.linkFile;i?i.state>=c.FILE_COMPLETE&&(i.type==="spritesheet"?i.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,i.data,this.data):this.cache.addImage(this.key,this.data,i.data)):this.cache.addImage(this.key,this.data)}});r.register("image",function(i,o,f){if(Array.isArray(i))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(35154),s=t(41212),h=new d({Extends:a,initialize:function(o,f,l,u,v){var m="json";if(s(f)){var x=f;f=n(x,"key"),l=n(x,"url"),u=n(x,"xhrSettings"),m=n(x,"extension",m),v=n(x,"dataKey",v)}var g={type:"json",cache:o.cacheManager.json,extension:m,responseType:"text",key:f,url:l,xhrSettings:u,config:v};a.call(this,o,g),s(l)&&(v?this.data=e(l,v):this.data=l,this.state=c.FILE_POPULATED)},onProcess:function(){if(this.state!==c.FILE_POPULATED){this.state=c.FILE_PROCESSING;try{var i=JSON.parse(this.xhrLoader.responseText)}catch(f){throw this.onProcessError(),f}var o=this.config;typeof o=="string"?this.data=e(i,o,i):this.data=i}this.onProcessComplete()}});r.register("json",function(i,o,f,l){if(Array.isArray(i))for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),s=t(26430),h=new d({Extends:s,initialize:function(o,f,l,u,v,m,x){if(n(f)){var g=f;f=a(g,"key"),a(g,"url",!1)?l=a(g,"url"):l=a(g,"atlasURL"),m=a(g,"xhrSettings"),u=a(g,"path"),v=a(g,"baseURL"),x=a(g,"textureXhrSettings")}var y=new e(o,f,l,m);s.call(this,o,"multiatlas",f,[y]),this.config.path=u,this.config.baseURL=v,this.config.textureXhrSettings=x},onFileComplete:function(i){var o=this.files.indexOf(i);if(o!==-1&&(this.pending--,i.type==="json"&&i.data.hasOwnProperty("textures"))){var f=i.data.textures,l=this.config,u=this.loader,v=u.baseURL,m=u.path,x=u.prefix,g=a(l,"baseURL",this.baseURL),y=a(l,"path",this.path),T=a(l,"prefix",this.prefix),E=a(l,"textureXhrSettings");u.setBaseURL(g),u.setPath(y),u.setPrefix(T);for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(34328),s=new d({Extends:n,initialize:function(i,o,f,l){var u="js",v=[];if(r(o)){var m=o;o=a(m,"key"),f=a(m,"url"),l=a(m,"xhrSettings"),u=a(m,"extension",u)}Array.isArray(f)||(f=[f]);for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(85048),s=t(61485),h=t(78776),i=new d({Extends:n,initialize:function(f,l,u,v,m,x){var g,y,T=f.cacheManager.obj;if(r(l)){var E=l;l=a(E,"key"),g=new h(f,{key:l,type:"obj",cache:T,url:a(E,"url"),extension:a(E,"extension","obj"),xhrSettings:a(E,"xhrSettings"),config:{flipUV:a(E,"flipUV",m)}}),v=a(E,"matURL"),v&&(y=new h(f,{key:l,type:"mat",cache:T,url:v,extension:a(E,"matExtension","mat"),xhrSettings:a(E,"xhrSettings")}))}else g=new h(f,{key:l,url:u,type:"obj",cache:T,extension:"obj",xhrSettings:x,config:{flipUV:m}}),v&&(y=new h(f,{key:l,url:v,type:"mat",cache:T,extension:"mat",xhrSettings:x}));n.call(this,f,"obj",l,[g,y])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],f=this.files[1],l=e(o.data,o.config.flipUV);f&&(l.materials=s(f.data)),o.cache.add(o.key,l),this.complete=!0}}});c.register("obj",function(o,f,l,u,v){var m;if(Array.isArray(o))for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(74099),r=t(518),n=new d({Extends:r,initialize:function(s,h,i,o,f){r.call(this,s,h,i,o,f),this.type="packfile"},onProcess:function(){if(this.state!==c.FILE_POPULATED&&(this.state=c.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var e={};e[this.config]=this.data,this.data=e}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});a.register("pack",function(e,s,h,i){if(Array.isArray(e))for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u,v){var m="js";if(e(o)){var x=o;o=n(x,"key"),f=n(x,"url"),v=n(x,"xhrSettings"),m=n(x,"extension",m),l=n(x,"start"),u=n(x,"mapping")}var g={type:"plugin",cache:!1,extension:m,responseType:"text",key:o,url:f,xhrSettings:v,config:{start:l,mapping:u}};a.call(this,i,g),typeof f=="function"&&(this.data=f,this.state=c.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,i=this.config,o=n(i,"start",!1),f=n(i,"mapping",null);if(this.state===c.FILE_POPULATED)h.install(this.key,this.data,o,f);else{this.state=c.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var l=h.install(this.key,window[this.key],o,f);(o||f)&&(this.loader.systems[f]=l,this.loader.scene[f]=l)}this.onProcessComplete()}});r.register("plugin",function(h,i,o,f,l){if(Array.isArray(h))for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u){var v="svg";if(e(o)){var m=o;o=n(m,"key"),f=n(m,"url"),l=n(m,"svgConfig",{}),u=n(m,"xhrSettings"),v=n(m,"extension",v)}var x={type:"svg",cache:i.textureManager,extension:v,responseType:"text",key:o,url:f,xhrSettings:u,config:{width:n(l,"width"),height:n(l,"height"),scale:n(l,"scale")}};a.call(this,i,x)},onProcess:function(){this.state=c.FILE_PROCESSING;var h=this.xhrLoader.responseText,i=[h],o=this.config.width,f=this.config.height,l=this.config.scale;t:if(o&&f||l){var u=null,v=new DOMParser;u=v.parseFromString(h,"text/xml");var m=u.getElementsByTagName("svg")[0],x=m.hasAttribute("viewBox"),g=parseFloat(m.getAttribute("width")),y=parseFloat(m.getAttribute("height"));if(!x&&g&&y)m.setAttribute("viewBox","0 0 "+g+" "+y);else if(x&&!g&&!y){var T=m.getAttribute("viewBox").split(/\s+|,/);g=T[2],y=T[3]}if(l)if(g&&y)o=g*l,f=y*l;else break t;m.setAttribute("width",o.toString()+"px"),m.setAttribute("height",f.toString()+"px"),i=[new XMLSerializer().serializeToString(m)]}try{var E=new window.Blob(i,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var P=this,R=!1;this.data.onload=function(){R||a.revokeObjectURL(P.data),P.onProcessComplete()},this.data.onerror=function(){R?P.onProcessError():(R=!0,a.revokeObjectURL(P.data),P.data.src="data:image/svg+xml,"+encodeURIComponent(i.join("")))},a.createObjectURL(this.data,E,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("svg",function(h,i,o,f){if(Array.isArray(h))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l){var u="js";if(e(o)){var v=o;o=n(v,"key"),f=n(v,"url"),l=n(v,"xhrSettings"),u=n(v,"extension",u)}var m={type:"text",extension:u,responseType:"text",key:o,url:f,xhrSettings:l};a.call(this,i,m)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var h=this.data.concat(`(function(){ +return new `+this.key+`(); +}).call(this);`),i=eval;this.loader.sceneManager.add(this.key,i(h)),this.complete=!0}});r.register("sceneFile",function(h,i,o){if(Array.isArray(h))for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u,v){var m="js";if(e(o)){var x=o;o=n(x,"key"),f=n(x,"url"),v=n(x,"xhrSettings"),m=n(x,"extension",m),l=n(x,"systemKey"),u=n(x,"sceneKey")}var g={type:"scenePlugin",cache:!1,extension:m,responseType:"text",key:o,url:f,xhrSettings:v,config:{systemKey:l,sceneKey:u}};a.call(this,i,g),typeof f=="function"&&(this.data=f,this.state=c.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,i=this.config,o=this.key,f=n(i,"systemKey",o),l=n(i,"sceneKey",o);this.state===c.FILE_POPULATED?h.installScenePlugin(f,this.data,l,this.loader.scene,!0):(this.state=c.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),h.installScenePlugin(f,window[this.key],l,this.loader.scene,!0)),this.onProcessComplete()}});r.register("scenePlugin",function(h,i,o,f,l){if(Array.isArray(h))for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l,u){var v="js";if(e(o)){var m=o;o=n(m,"key"),f=n(m,"url"),l=n(m,"type","script"),u=n(m,"xhrSettings"),v=n(m,"extension",v)}else l===void 0&&(l="script");var x={type:l,cache:!1,extension:v,responseType:"text",key:o,url:f,xhrSettings:u};a.call(this,i,x)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});r.register("script",function(h,i,o,f){if(Array.isArray(h))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(74099),r=t(19550),n=new d({Extends:r,initialize:function(s,h,i,o,f){r.call(this,s,h,i,f,o),this.type="spritesheet"},addToCache:function(){var e=this.linkFile;e?e.state>=c.FILE_COMPLETE&&(this.type==="normalMap"?this.cache.addSpriteSheet(this.key,e.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,e.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});a.register("spritesheet",function(e,s,h,i){if(Array.isArray(e))for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=new d({Extends:a,initialize:function(i,o,f,l){var u="text",v="txt",m=i.cacheManager.text;if(e(o)){var x=o;o=n(x,"key"),f=n(x,"url"),l=n(x,"xhrSettings"),v=n(x,"extension",v),u=n(x,"type",u),m=n(x,"cache",m)}var g={type:u,cache:m,extension:v,responseType:"text",key:o,url:f,xhrSettings:l};a.call(this,i,g)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(h,i,o){if(Array.isArray(h))for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=t(80341),h=new d({Extends:a,initialize:function(o,f,l,u){var v="csv";if(e(f)){var m=f;f=n(m,"key"),l=n(m,"url"),u=n(m,"xhrSettings"),v=n(m,"extension",v)}var x={type:"tilemapCSV",cache:o.cacheManager.tilemap,extension:v,responseType:"text",key:f,url:l,xhrSettings:u};a.call(this,o,x),this.tilemapFormat=s.CSV},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var i={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,i)}});r.register("tilemapCSV",function(i,o,f){if(Array.isArray(i))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(518),r=t(80341),n=new d({Extends:a,initialize:function(s,h,i,o){a.call(this,s,h,i,o),this.type="tilemapJSON",this.cache=s.cacheManager.tilemap},addToCache:function(){var e={format:r.WELTMEISTER,data:this.data};this.cache.add(this.key,e)}});c.register("tilemapImpact",function(e,s,h){if(Array.isArray(e))for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(518),r=t(80341),n=new d({Extends:a,initialize:function(s,h,i,o){a.call(this,s,h,i,o),this.type="tilemapJSON",this.cache=s.cacheManager.tilemap},addToCache:function(){var e={format:r.TILED_JSON,data:this.data};this.cache.add(this.key,e)}});c.register("tilemapTiledJSON",function(e,s,h){if(Array.isArray(e))for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),s=t(78776),h=new d({Extends:e,initialize:function(o,f,l,u,v,m){var x,g;if(n(f)){var y=f;f=a(y,"key"),x=new r(o,{key:f,url:a(y,"textureURL"),extension:a(y,"textureExtension","png"),normalMap:a(y,"normalMap"),xhrSettings:a(y,"textureXhrSettings")}),g=new s(o,{key:f,url:a(y,"atlasURL"),extension:a(y,"atlasExtension","txt"),xhrSettings:a(y,"atlasXhrSettings")})}else x=new r(o,f,l,v),g=new s(o,f,u,m);x.linkFile?e.call(this,o,"unityatlas",f,[x,g,x.linkFile]):e.call(this,o,"unityatlas",f,[x,g])},addToCache:function(){if(this.isReadyToProcess()){var i=this.files[0],o=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(i.key,i.data,o.data,f),this.complete=!0}}});c.register("unityAtlas",function(i,o,f,l,u){var v;if(Array.isArray(i))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(98356),e=t(95540),s=t(41212),h=new d({Extends:a,initialize:function(o,f,l,u){if(u===void 0&&(u=!1),s(f)){var v=f;f=e(v,"key"),l=e(v,"url",[]),u=e(v,"noAudio",!1)}var m=o.systems.game.device.video.getVideoURL(l);m||console.warn("VideoFile: No supported format for "+f);var x={type:"video",cache:o.cacheManager.video,extension:m.type,key:f,url:m.url,config:{noAudio:u}};a.call(this,o,x)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=n(this,this.loader.baseURL),this.state=c.FILE_LOADED,this.loader.nextFile(this,!0)}});r.register("video",function(i,o,f){if(Array.isArray(i))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),s=t(56836),h=new d({Extends:a,initialize:function(o,f,l,u){var v="xml";if(e(f)){var m=f;f=n(m,"key"),l=n(m,"url"),u=n(m,"xhrSettings"),v=n(m,"extension",v)}var x={type:"xml",cache:o.cacheManager.xml,extension:v,responseType:"text",key:f,url:l,xhrSettings:u};a.call(this,o,x)},onProcess:function(){this.state=c.FILE_PROCESSING,this.data=s(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});r.register("xml",function(i,o,f){if(Array.isArray(i))for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AnimationJSONFile:t(14135),AsepriteFile:t(76272),AtlasJSONFile:t(38734),AtlasXMLFile:t(74599),AudioFile:t(21097),AudioSpriteFile:t(89524),BinaryFile:t(85722),BitmapFontFile:t(97025),CompressedTextureFile:t(69559),CSSFile:t(16024),GLSLFile:t(47931),HTML5AudioFile:t(89749),HTMLFile:t(88470),HTMLTextureFile:t(14643),ImageFile:t(19550),JSONFile:t(518),MultiAtlasFile:t(59327),MultiScriptFile:t(99297),OBJFile:t(41846),PackFile:t(58610),PluginFile:t(48988),SceneFile:t(88423),ScenePluginFile:t(56812),ScriptFile:t(34328),SpriteSheetFile:t(85035),SVGFile:t(67397),TextFile:t(78776),TilemapCSVFile:t(49477),TilemapImpactFile:t(40807),TilemapJSONFile:t(56775),UnityAtlasFile:t(25771),VideoFile:t(33720),XMLFile:t(57318)}},57777:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23906),c=t(79291),a={Events:t(54899),FileTypes:t(64589),File:t(41299),FileTypesManager:t(74099),GetURL:t(98356),LoaderPlugin:t(74261),MergeXHRSettings:t(3374),MultiFile:t(26430),XHRLoader:t(84376),XHRSettings:t(92638)};a=c(!1,a,d),p.exports=a},53307:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=0,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6411),c=function(a,r){return d(a)/d(r)/d(a-r)};p.exports=c},30976:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return Math.floor(Math.random()*(d-t+1)+t)};p.exports=C},87842:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){var n=(a-d)*.5,e=(r-c)*.5,s=t*t,h=t*s;return(2*c-2*a+n+e)*h+(-3*c+3*a-2*n-e)*s+n*t+c};p.exports=C},26302:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){d===void 0&&(d=0),c===void 0&&(c=10);var a=Math.pow(c,-d);return Math.ceil(t*a)/a};p.exports=C},45319:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return Math.max(d,Math.min(c,t))};p.exports=C},39506:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=function(a){return a*d.DEG_TO_RAD};p.exports=c},61241:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return Math.abs(t-d)};p.exports=C},38857:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(37867),r=t(29747),n=new a,e=new c({initialize:function s(h,i,o,f){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f=s.DefaultOrder),this._x=h,this._y=i,this._z=o,this._order=f,this.onChangeCallback=r},x:{get:function(){return this._x},set:function(s){this._x=s,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(s){this._y=s,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(s){this._z=s,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(s){this._order=s,this.onChangeCallback(this)}},set:function(s,h,i,o){return o===void 0&&(o=this._order),this._x=s,this._y=h,this._z=i,this._order=o,this.onChangeCallback(this),this},copy:function(s){return this.set(s.x,s.y,s.z,s.order)},setFromQuaternion:function(s,h,i){return h===void 0&&(h=this._order),i===void 0&&(i=!1),n.fromQuat(s),this.setFromRotationMatrix(n,h,i)},setFromRotationMatrix:function(s,h,i){h===void 0&&(h=this._order),i===void 0&&(i=!1);var o=s.val,f=o[0],l=o[4],u=o[8],v=o[1],m=o[5],x=o[9],g=o[2],y=o[6],T=o[10],E=0,P=0,R=0,M=.99999;switch(h){case"XYZ":{P=Math.asin(d(u,-1,1)),Math.abs(u){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){if(t===0)return 1;for(var d=t;--t;)d*=t;return d};p.exports=C},99472:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return Math.random()*(d-t)+t};p.exports=C},77623:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){d===void 0&&(d=0),c===void 0&&(c=10);var a=Math.pow(c,-d);return Math.floor(t*a)/a};p.exports=C},62945:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=function(a,r,n){return a=d(a,0,1),(n-r)*a+r};p.exports=c},38265:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t/d/1e3};p.exports=C},78702:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t==parseFloat(t)?!(t%2):void 0};p.exports=C},94883:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t===parseFloat(t)?!(t%2):void 0};p.exports=C},28915:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return(d-t)*c+t};p.exports=C},94908:p=>{/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c===void 0&&(c=0),t.clone().lerp(d,c)};p.exports=C},94434:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r){this.val=new Float32Array(9),r?this.copy(r):this.identity()},clone:function(){return new c(this)},set:function(a){return this.copy(a)},copy:function(a){var r=this.val,n=a.val;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],this},fromMat4:function(a){var r=a.val,n=this.val;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10],this},fromArray:function(a){var r=this.val;return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],this},identity:function(){var a=this.val;return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,this},transpose:function(){var a=this.val,r=a[1],n=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=r,a[5]=a[7],a[6]=n,a[7]=e,this},invert:function(){var a=this.val,r=a[0],n=a[1],e=a[2],s=a[3],h=a[4],i=a[5],o=a[6],f=a[7],l=a[8],u=l*h-i*f,v=-l*s+i*o,m=f*s-h*o,x=r*u+n*v+e*m;return x?(x=1/x,a[0]=u*x,a[1]=(-l*n+e*f)*x,a[2]=(i*n-e*h)*x,a[3]=v*x,a[4]=(l*r-e*o)*x,a[5]=(-i*r+e*s)*x,a[6]=m*x,a[7]=(-f*r+n*o)*x,a[8]=(h*r-n*s)*x,this):null},adjoint:function(){var a=this.val,r=a[0],n=a[1],e=a[2],s=a[3],h=a[4],i=a[5],o=a[6],f=a[7],l=a[8];return a[0]=h*l-i*f,a[1]=e*f-n*l,a[2]=n*i-e*h,a[3]=i*o-s*l,a[4]=r*l-e*o,a[5]=e*s-r*i,a[6]=s*f-h*o,a[7]=n*o-r*f,a[8]=r*h-n*s,this},determinant:function(){var a=this.val,r=a[0],n=a[1],e=a[2],s=a[3],h=a[4],i=a[5],o=a[6],f=a[7],l=a[8];return r*(l*h-i*f)+n*(-l*s+i*o)+e*(f*s-h*o)},multiply:function(a){var r=this.val,n=r[0],e=r[1],s=r[2],h=r[3],i=r[4],o=r[5],f=r[6],l=r[7],u=r[8],v=a.val,m=v[0],x=v[1],g=v[2],y=v[3],T=v[4],E=v[5],P=v[6],R=v[7],M=v[8];return r[0]=m*n+x*h+g*f,r[1]=m*e+x*i+g*l,r[2]=m*s+x*o+g*u,r[3]=y*n+T*h+E*f,r[4]=y*e+T*i+E*l,r[5]=y*s+T*o+E*u,r[6]=P*n+R*h+M*f,r[7]=P*e+R*i+M*l,r[8]=P*s+R*o+M*u,this},translate:function(a){var r=this.val,n=a.x,e=a.y;return r[6]=n*r[0]+e*r[3]+r[6],r[7]=n*r[1]+e*r[4]+r[7],r[8]=n*r[2]+e*r[5]+r[8],this},rotate:function(a){var r=this.val,n=r[0],e=r[1],s=r[2],h=r[3],i=r[4],o=r[5],f=Math.sin(a),l=Math.cos(a);return r[0]=l*n+f*h,r[1]=l*e+f*i,r[2]=l*s+f*o,r[3]=l*h-f*n,r[4]=l*i-f*e,r[5]=l*o-f*s,this},scale:function(a){var r=this.val,n=a.x,e=a.y;return r[0]=n*r[0],r[1]=n*r[1],r[2]=n*r[2],r[3]=e*r[3],r[4]=e*r[4],r[5]=e*r[5],this},fromQuat:function(a){var r=a.x,n=a.y,e=a.z,s=a.w,h=r+r,i=n+n,o=e+e,f=r*h,l=r*i,u=r*o,v=n*i,m=n*o,x=e*o,g=s*h,y=s*i,T=s*o,E=this.val;return E[0]=1-(v+x),E[3]=l+T,E[6]=u-y,E[1]=l-T,E[4]=1-(f+x),E[7]=m+g,E[2]=u+y,E[5]=m-g,E[8]=1-(f+v),this},normalFromMat4:function(a){var r=a.val,n=this.val,e=r[0],s=r[1],h=r[2],i=r[3],o=r[4],f=r[5],l=r[6],u=r[7],v=r[8],m=r[9],x=r[10],g=r[11],y=r[12],T=r[13],E=r[14],P=r[15],R=e*f-s*o,M=e*l-h*o,L=e*u-i*o,O=s*l-h*f,D=s*u-i*f,I=h*u-i*l,V=v*T-m*y,X=v*E-x*y,H=v*P-g*y,G=m*E-x*T,U=m*P-g*T,F=x*P-g*E,B=R*F-M*U+L*G+O*H-D*X+I*V;return B?(B=1/B,n[0]=(f*F-l*U+u*G)*B,n[1]=(l*H-o*F-u*X)*B,n[2]=(o*U-f*H+u*V)*B,n[3]=(h*U-s*F-i*G)*B,n[4]=(e*F-h*H+i*X)*B,n[5]=(s*H-e*U-i*V)*B,n[6]=(T*I-E*D+P*O)*B,n[7]=(E*L-y*I-P*M)*B,n[8]=(y*D-T*L+P*R)*B,this):null}});p.exports=c},37867:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(25836),a=1e-6,r=new d({initialize:function(f){this.val=new Float32Array(16),f?this.copy(f):this.identity()},clone:function(){return new r(this)},set:function(o){return this.copy(o)},setValues:function(o,f,l,u,v,m,x,g,y,T,E,P,R,M,L,O){var D=this.val;return D[0]=o,D[1]=f,D[2]=l,D[3]=u,D[4]=v,D[5]=m,D[6]=x,D[7]=g,D[8]=y,D[9]=T,D[10]=E,D[11]=P,D[12]=R,D[13]=M,D[14]=L,D[15]=O,this},copy:function(o){var f=o.val;return this.setValues(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])},fromArray:function(o){return this.setValues(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9],o[10],o[11],o[12],o[13],o[14],o[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(o,f,l){var u=n.fromQuat(l),v=u.val,m=f.x,x=f.y,g=f.z;return this.setValues(v[0]*m,v[1]*m,v[2]*m,0,v[4]*x,v[5]*x,v[6]*x,0,v[8]*g,v[9]*g,v[10]*g,0,o.x,o.y,o.z,1)},xyz:function(o,f,l){this.identity();var u=this.val;return u[12]=o,u[13]=f,u[14]=l,this},scaling:function(o,f,l){this.zero();var u=this.val;return u[0]=o,u[5]=f,u[10]=l,u[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var o=this.val,f=o[1],l=o[2],u=o[3],v=o[6],m=o[7],x=o[11];return o[1]=o[4],o[2]=o[8],o[3]=o[12],o[4]=f,o[6]=o[9],o[7]=o[13],o[8]=l,o[9]=v,o[11]=o[14],o[12]=u,o[13]=m,o[14]=x,this},getInverse:function(o){return this.copy(o),this.invert()},invert:function(){var o=this.val,f=o[0],l=o[1],u=o[2],v=o[3],m=o[4],x=o[5],g=o[6],y=o[7],T=o[8],E=o[9],P=o[10],R=o[11],M=o[12],L=o[13],O=o[14],D=o[15],I=f*x-l*m,V=f*g-u*m,X=f*y-v*m,H=l*g-u*x,G=l*y-v*x,U=u*y-v*g,F=T*L-E*M,B=T*O-P*M,N=T*D-R*M,z=E*O-P*L,Y=E*D-R*L,K=P*D-R*O,Z=I*K-V*Y+X*z+H*N-G*B+U*F;return Z?(Z=1/Z,this.setValues((x*K-g*Y+y*z)*Z,(u*Y-l*K-v*z)*Z,(L*U-O*G+D*H)*Z,(P*G-E*U-R*H)*Z,(g*N-m*K-y*B)*Z,(f*K-u*N+v*B)*Z,(O*X-M*U-D*V)*Z,(T*U-P*X+R*V)*Z,(m*Y-x*N+y*F)*Z,(l*N-f*Y-v*F)*Z,(M*G-L*X+D*I)*Z,(E*X-T*G-R*I)*Z,(x*B-m*z-g*F)*Z,(f*z-l*B+u*F)*Z,(L*V-M*H-O*I)*Z,(T*H-E*V+P*I)*Z)):this},adjoint:function(){var o=this.val,f=o[0],l=o[1],u=o[2],v=o[3],m=o[4],x=o[5],g=o[6],y=o[7],T=o[8],E=o[9],P=o[10],R=o[11],M=o[12],L=o[13],O=o[14],D=o[15];return this.setValues(x*(P*D-R*O)-E*(g*D-y*O)+L*(g*R-y*P),-(l*(P*D-R*O)-E*(u*D-v*O)+L*(u*R-v*P)),l*(g*D-y*O)-x*(u*D-v*O)+L*(u*y-v*g),-(l*(g*R-y*P)-x*(u*R-v*P)+E*(u*y-v*g)),-(m*(P*D-R*O)-T*(g*D-y*O)+M*(g*R-y*P)),f*(P*D-R*O)-T*(u*D-v*O)+M*(u*R-v*P),-(f*(g*D-y*O)-m*(u*D-v*O)+M*(u*y-v*g)),f*(g*R-y*P)-m*(u*R-v*P)+T*(u*y-v*g),m*(E*D-R*L)-T*(x*D-y*L)+M*(x*R-y*E),-(f*(E*D-R*L)-T*(l*D-v*L)+M*(l*R-v*E)),f*(x*D-y*L)-m*(l*D-v*L)+M*(l*y-v*x),-(f*(x*R-y*E)-m*(l*R-v*E)+T*(l*y-v*x)),-(m*(E*O-P*L)-T*(x*O-g*L)+M*(x*P-g*E)),f*(E*O-P*L)-T*(l*O-u*L)+M*(l*P-u*E),-(f*(x*O-g*L)-m*(l*O-u*L)+M*(l*g-u*x)),f*(x*P-g*E)-m*(l*P-u*E)+T*(l*g-u*x))},determinant:function(){var o=this.val,f=o[0],l=o[1],u=o[2],v=o[3],m=o[4],x=o[5],g=o[6],y=o[7],T=o[8],E=o[9],P=o[10],R=o[11],M=o[12],L=o[13],O=o[14],D=o[15],I=f*x-l*m,V=f*g-u*m,X=f*y-v*m,H=l*g-u*x,G=l*y-v*x,U=u*y-v*g,F=T*L-E*M,B=T*O-P*M,N=T*D-R*M,z=E*O-P*L,Y=E*D-R*L,K=P*D-R*O;return I*K-V*Y+X*z+H*N-G*B+U*F},multiply:function(o){var f=this.val,l=f[0],u=f[1],v=f[2],m=f[3],x=f[4],g=f[5],y=f[6],T=f[7],E=f[8],P=f[9],R=f[10],M=f[11],L=f[12],O=f[13],D=f[14],I=f[15],V=o.val,X=V[0],H=V[1],G=V[2],U=V[3];return f[0]=X*l+H*x+G*E+U*L,f[1]=X*u+H*g+G*P+U*O,f[2]=X*v+H*y+G*R+U*D,f[3]=X*m+H*T+G*M+U*I,X=V[4],H=V[5],G=V[6],U=V[7],f[4]=X*l+H*x+G*E+U*L,f[5]=X*u+H*g+G*P+U*O,f[6]=X*v+H*y+G*R+U*D,f[7]=X*m+H*T+G*M+U*I,X=V[8],H=V[9],G=V[10],U=V[11],f[8]=X*l+H*x+G*E+U*L,f[9]=X*u+H*g+G*P+U*O,f[10]=X*v+H*y+G*R+U*D,f[11]=X*m+H*T+G*M+U*I,X=V[12],H=V[13],G=V[14],U=V[15],f[12]=X*l+H*x+G*E+U*L,f[13]=X*u+H*g+G*P+U*O,f[14]=X*v+H*y+G*R+U*D,f[15]=X*m+H*T+G*M+U*I,this},multiplyLocal:function(o){var f=this.val,l=o.val;return this.setValues(f[0]*l[0]+f[1]*l[4]+f[2]*l[8]+f[3]*l[12],f[0]*l[1]+f[1]*l[5]+f[2]*l[9]+f[3]*l[13],f[0]*l[2]+f[1]*l[6]+f[2]*l[10]+f[3]*l[14],f[0]*l[3]+f[1]*l[7]+f[2]*l[11]+f[3]*l[15],f[4]*l[0]+f[5]*l[4]+f[6]*l[8]+f[7]*l[12],f[4]*l[1]+f[5]*l[5]+f[6]*l[9]+f[7]*l[13],f[4]*l[2]+f[5]*l[6]+f[6]*l[10]+f[7]*l[14],f[4]*l[3]+f[5]*l[7]+f[6]*l[11]+f[7]*l[15],f[8]*l[0]+f[9]*l[4]+f[10]*l[8]+f[11]*l[12],f[8]*l[1]+f[9]*l[5]+f[10]*l[9]+f[11]*l[13],f[8]*l[2]+f[9]*l[6]+f[10]*l[10]+f[11]*l[14],f[8]*l[3]+f[9]*l[7]+f[10]*l[11]+f[11]*l[15],f[12]*l[0]+f[13]*l[4]+f[14]*l[8]+f[15]*l[12],f[12]*l[1]+f[13]*l[5]+f[14]*l[9]+f[15]*l[13],f[12]*l[2]+f[13]*l[6]+f[14]*l[10]+f[15]*l[14],f[12]*l[3]+f[13]*l[7]+f[14]*l[11]+f[15]*l[15])},premultiply:function(o){return this.multiplyMatrices(o,this)},multiplyMatrices:function(o,f){var l=o.val,u=f.val,v=l[0],m=l[4],x=l[8],g=l[12],y=l[1],T=l[5],E=l[9],P=l[13],R=l[2],M=l[6],L=l[10],O=l[14],D=l[3],I=l[7],V=l[11],X=l[15],H=u[0],G=u[4],U=u[8],F=u[12],B=u[1],N=u[5],z=u[9],Y=u[13],K=u[2],Z=u[6],Q=u[10],$=u[14],j=u[3],k=u[7],_=u[11],q=u[15];return this.setValues(v*H+m*B+x*K+g*j,y*H+T*B+E*K+P*j,R*H+M*B+L*K+O*j,D*H+I*B+V*K+X*j,v*G+m*N+x*Z+g*k,y*G+T*N+E*Z+P*k,R*G+M*N+L*Z+O*k,D*G+I*N+V*Z+X*k,v*U+m*z+x*Q+g*_,y*U+T*z+E*Q+P*_,R*U+M*z+L*Q+O*_,D*U+I*z+V*Q+X*_,v*F+m*Y+x*$+g*q,y*F+T*Y+E*$+P*q,R*F+M*Y+L*$+O*q,D*F+I*Y+V*$+X*q)},translate:function(o){return this.translateXYZ(o.x,o.y,o.z)},translateXYZ:function(o,f,l){var u=this.val;return u[12]=u[0]*o+u[4]*f+u[8]*l+u[12],u[13]=u[1]*o+u[5]*f+u[9]*l+u[13],u[14]=u[2]*o+u[6]*f+u[10]*l+u[14],u[15]=u[3]*o+u[7]*f+u[11]*l+u[15],this},scale:function(o){return this.scaleXYZ(o.x,o.y,o.z)},scaleXYZ:function(o,f,l){var u=this.val;return u[0]=u[0]*o,u[1]=u[1]*o,u[2]=u[2]*o,u[3]=u[3]*o,u[4]=u[4]*f,u[5]=u[5]*f,u[6]=u[6]*f,u[7]=u[7]*f,u[8]=u[8]*l,u[9]=u[9]*l,u[10]=u[10]*l,u[11]=u[11]*l,this},makeRotationAxis:function(o,f){var l=Math.cos(f),u=Math.sin(f),v=1-l,m=o.x,x=o.y,g=o.z,y=v*m,T=v*x;return this.setValues(y*m+l,y*x-u*g,y*g+u*x,0,y*x+u*g,T*x+l,T*g-u*m,0,y*g-u*x,T*g+u*m,v*g*g+l,0,0,0,0,1)},rotate:function(o,f){var l=this.val,u=f.x,v=f.y,m=f.z,x=Math.sqrt(u*u+v*v+m*m);if(Math.abs(x){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return Math.min(t+d,c)};p.exports=C},50040:p=>{/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=t.length;if(d===0)return 0;t.sort(function(a,r){return a-r});var c=Math.floor(d/2);return d%2===0?(t[c]+t[c-1])/2:t[c]};p.exports=C},37204:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return Math.max(t-d,c)};p.exports=C},65201:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){c===void 0&&(c=d+1);var r=(t-d)/(c-d);return r>1?a!==void 0?(r=(a-t)/(a-c),r<0&&(r=0)):r=1:r<0&&(r=0),r};p.exports=C},15746:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(94434),a=t(29747),r=t(25836),n=1e-6,e=new Int8Array([1,2,0]),s=new Float32Array([0,0,0]),h=new r(1,0,0),i=new r(0,1,0),o=new r,f=new c,l=new d({initialize:function(v,m,x,g){this.onChangeCallback=a,this.set(v,m,x,g)},x:{get:function(){return this._x},set:function(u){this._x=u,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(u){this._y=u,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(u){this._z=u,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(u){this._w=u,this.onChangeCallback(this)}},copy:function(u){return this.set(u)},set:function(u,v,m,x,g){return g===void 0&&(g=!0),typeof u=="object"?(this._x=u.x||0,this._y=u.y||0,this._z=u.z||0,this._w=u.w||0):(this._x=u||0,this._y=v||0,this._z=m||0,this._w=x||0),g&&this.onChangeCallback(this),this},add:function(u){return this._x+=u.x,this._y+=u.y,this._z+=u.z,this._w+=u.w,this.onChangeCallback(this),this},subtract:function(u){return this._x-=u.x,this._y-=u.y,this._z-=u.z,this._w-=u.w,this.onChangeCallback(this),this},scale:function(u){return this._x*=u,this._y*=u,this._z*=u,this._w*=u,this.onChangeCallback(this),this},length:function(){var u=this.x,v=this.y,m=this.z,x=this.w;return Math.sqrt(u*u+v*v+m*m+x*x)},lengthSq:function(){var u=this.x,v=this.y,m=this.z,x=this.w;return u*u+v*v+m*m+x*x},normalize:function(){var u=this.x,v=this.y,m=this.z,x=this.w,g=u*u+v*v+m*m+x*x;return g>0&&(g=1/Math.sqrt(g),this._x=u*g,this._y=v*g,this._z=m*g,this._w=x*g),this.onChangeCallback(this),this},dot:function(u){return this.x*u.x+this.y*u.y+this.z*u.z+this.w*u.w},lerp:function(u,v){v===void 0&&(v=0);var m=this.x,x=this.y,g=this.z,y=this.w;return this.set(m+v*(u.x-m),x+v*(u.y-x),g+v*(u.z-g),y+v*(u.w-y))},rotationTo:function(u,v){var m=u.x*v.x+u.y*v.y+u.z*v.z;return m<-.999999?(o.copy(h).cross(u).length().999999?this.set(0,0,0,1):(o.copy(u).cross(v),this._x=o.x,this._y=o.y,this._z=o.z,this._w=1+m,this.normalize())},setAxes:function(u,v,m){var x=f.val;return x[0]=v.x,x[3]=v.y,x[6]=v.z,x[1]=m.x,x[4]=m.y,x[7]=m.z,x[2]=-u.x,x[5]=-u.y,x[8]=-u.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(u,v){v=v*.5;var m=Math.sin(v);return this.set(m*u.x,m*u.y,m*u.z,Math.cos(v))},multiply:function(u){var v=this.x,m=this.y,x=this.z,g=this.w,y=u.x,T=u.y,E=u.z,P=u.w;return this.set(v*P+g*y+m*E-x*T,m*P+g*T+x*y-v*E,x*P+g*E+v*T-m*y,g*P-v*y-m*T-x*E)},slerp:function(u,v){var m=this.x,x=this.y,g=this.z,y=this.w,T=u.x,E=u.y,P=u.z,R=u.w,M=m*T+x*E+g*P+y*R;M<0&&(M=-M,T=-T,E=-E,P=-P,R=-R);var L=1-v,O=v;if(1-M>n){var D=Math.acos(M),I=Math.sin(D);L=Math.sin((1-v)*D)/I,O=Math.sin(v*D)/I}return this.set(L*m+O*T,L*x+O*E,L*g+O*P,L*y+O*R)},invert:function(){var u=this.x,v=this.y,m=this.z,x=this.w,g=u*u+v*v+m*m+x*x,y=g?1/g:0;return this.set(-u*y,-v*y,-m*y,x*y)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(u){u*=.5;var v=this.x,m=this.y,x=this.z,g=this.w,y=Math.sin(u),T=Math.cos(u);return this.set(v*T+g*y,m*T+x*y,x*T-m*y,g*T-v*y)},rotateY:function(u){u*=.5;var v=this.x,m=this.y,x=this.z,g=this.w,y=Math.sin(u),T=Math.cos(u);return this.set(v*T-x*y,m*T+g*y,x*T+v*y,g*T-m*y)},rotateZ:function(u){u*=.5;var v=this.x,m=this.y,x=this.z,g=this.w,y=Math.sin(u),T=Math.cos(u);return this.set(v*T+m*y,m*T-v*y,x*T+g*y,g*T-x*y)},calculateW:function(){var u=this.x,v=this.y,m=this.z;return this.w=-Math.sqrt(1-u*u-v*v-m*m),this},setFromEuler:function(u,v){var m=u.x/2,x=u.y/2,g=u.z/2,y=Math.cos(m),T=Math.cos(x),E=Math.cos(g),P=Math.sin(m),R=Math.sin(x),M=Math.sin(g);switch(u.order){case"XYZ":{this.set(P*T*E+y*R*M,y*R*E-P*T*M,y*T*M+P*R*E,y*T*E-P*R*M,v);break}case"YXZ":{this.set(P*T*E+y*R*M,y*R*E-P*T*M,y*T*M-P*R*E,y*T*E+P*R*M,v);break}case"ZXY":{this.set(P*T*E-y*R*M,y*R*E+P*T*M,y*T*M+P*R*E,y*T*E-P*R*M,v);break}case"ZYX":{this.set(P*T*E-y*R*M,y*R*E+P*T*M,y*T*M-P*R*E,y*T*E+P*R*M,v);break}case"YZX":{this.set(P*T*E+y*R*M,y*R*E+P*T*M,y*T*M-P*R*E,y*T*E-P*R*M,v);break}case"XZY":{this.set(P*T*E-y*R*M,y*R*E-P*T*M,y*T*M+P*R*E,y*T*E+P*R*M,v);break}}return this},setFromRotationMatrix:function(u){var v=u.val,m=v[0],x=v[4],g=v[8],y=v[1],T=v[5],E=v[9],P=v[2],R=v[6],M=v[10],L=m+T+M,O;return L>0?(O=.5/Math.sqrt(L+1),this.set((R-E)*O,(g-P)*O,(y-x)*O,.25/O)):m>T&&m>M?(O=2*Math.sqrt(1+m-T-M),this.set(.25*O,(x+y)/O,(g+P)/O,(R-E)/O)):T>M?(O=2*Math.sqrt(1+T-m-M),this.set((x+y)/O,.25*O,(E+R)/O,(g-P)/O)):(O=2*Math.sqrt(1+M-m-T),this.set((g+P)/O,(E+R)/O,.25*O,(y-x)/O)),this},fromMat3:function(u){var v=u.val,m=v[0]+v[4]+v[8],x;if(m>0)x=Math.sqrt(m+1),this.w=.5*x,x=.5/x,this._x=(v[7]-v[5])*x,this._y=(v[2]-v[6])*x,this._z=(v[3]-v[1])*x;else{var g=0;v[4]>v[0]&&(g=1),v[8]>v[g*3+g]&&(g=2);var y=e[g],T=e[y];x=Math.sqrt(v[g*3+g]-v[y*3+y]-v[T*3+T]+1),s[g]=.5*x,x=.5/x,s[y]=(v[y*3+g]+v[g*3+y])*x,s[T]=(v[T*3+g]+v[g*3+T])*x,this._x=s[0],this._y=s[1],this._z=s[2],this._w=(v[T*3+y]-v[y*3+T])*x}return this.onChangeCallback(this),this}});p.exports=l},43396:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=function(a){return a*d.RAD_TO_DEG};p.exports=c},74362:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=1);var c=Math.random()*2*Math.PI;return t.x=Math.cos(c)*d,t.y=Math.sin(c)*d,t};p.exports=C},60706:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=1);var c=Math.random()*2*Math.PI,a=Math.random()*2-1,r=Math.sqrt(1-a*a)*d;return t.x=Math.cos(c)*r,t.y=Math.sin(c)*r,t.z=a*d,t};p.exports=C},67421:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1),t.x=(Math.random()*2-1)*d,t.y=(Math.random()*2-1)*d,t.z=(Math.random()*2-1)*d,t.w=(Math.random()*2-1)*d,t};p.exports=C},36305:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.x,a=t.y;return t.x=c*Math.cos(d)-a*Math.sin(d),t.y=c*Math.sin(d)+a*Math.cos(d),t};p.exports=C},11520:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=Math.cos(a),n=Math.sin(a),e=t.x-d,s=t.y-c;return t.x=e*r-s*n+d,t.y=e*n+s*r+c,t};p.exports=C},1163:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){var n=a+Math.atan2(t.y-c,t.x-d);return t.x=d+r*Math.cos(n),t.y=c+r*Math.sin(n),t};p.exports=C},70336:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){return t.x=d+r*Math.cos(a),t.y=c+r*Math.sin(a),t};p.exports=C},72678:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(25836),c=t(37867),a=t(15746),r=new c,n=new a,e=new d,s=function(h,i,o){return n.setAxisAngle(i,o),r.fromRotationTranslation(n,e.set(0,0,0)),h.transformMat4(r)};p.exports=s},2284:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t>0?Math.ceil(t):Math.floor(t)};p.exports=C},41013:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){d===void 0&&(d=0),c===void 0&&(c=10);var a=Math.pow(c,-d);return Math.round(t*a)/a};p.exports=C},16922:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d===void 0&&(d=1),c===void 0&&(c=1),a===void 0&&(a=1),a*=Math.PI/t;for(var r=[],n=[],e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t<=d?0:t>=c?1:(t=(t-d)/(c-d),t*t*(3-2*t))};p.exports=C},54261:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t=Math.max(0,Math.min(1,(t-d)/(c-d))),t*t*t*(t*(t*6-15)+10)};p.exports=C},44408:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e){e===void 0&&(e=new d);var s=0,h=0,i=r*n;return a>0&&a<=i&&(a>r-1?(h=Math.floor(a/r),s=a-h*r):s=a),e.set(s,h)};p.exports=c},85955:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s,h,i,o){o===void 0&&(o=new d);var f=Math.sin(s),l=Math.cos(s),u=l*h,v=f*h,m=-f*i,x=l*i,g=1/(u*x+m*-v);return o.x=x*g*a+-m*g*r+(e*m-n*x)*g,o.y=u*g*r+-v*g*a+(-e*u+n*v)*g,o};p.exports=c},26099:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(43855),a=new d({initialize:function(n,e){this.x=0,this.y=0,typeof n=="object"?(this.x=n.x||0,this.y=n.y||0):(e===void 0&&(e=n),this.x=n||0,this.y=e||0)},clone:function(){return new a(this.x,this.y)},copy:function(r){return this.x=r.x||0,this.y=r.y||0,this},setFromObject:function(r){return this.x=r.x||0,this.y=r.y||0,this},set:function(r,n){return n===void 0&&(n=r),this.x=r,this.y=n,this},setTo:function(r,n){return this.set(r,n)},setToPolar:function(r,n){return n==null&&(n=1),this.x=Math.cos(r)*n,this.y=Math.sin(r)*n,this},equals:function(r){return this.x===r.x&&this.y===r.y},fuzzyEquals:function(r,n){return c(this.x,r.x,n)&&c(this.y,r.y,n)},angle:function(){var r=Math.atan2(this.y,this.x);return r<0&&(r+=2*Math.PI),r},setAngle:function(r){return this.setToPolar(r,this.length())},add:function(r){return this.x+=r.x,this.y+=r.y,this},subtract:function(r){return this.x-=r.x,this.y-=r.y,this},multiply:function(r){return this.x*=r.x,this.y*=r.y,this},scale:function(r){return isFinite(r)?(this.x*=r,this.y*=r):(this.x=0,this.y=0),this},divide:function(r){return this.x/=r.x,this.y/=r.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(r){var n=r.x-this.x,e=r.y-this.y;return Math.sqrt(n*n+e*e)},distanceSq:function(r){var n=r.x-this.x,e=r.y-this.y;return n*n+e*e},length:function(){var r=this.x,n=this.y;return Math.sqrt(r*r+n*n)},setLength:function(r){return this.normalize().scale(r)},lengthSq:function(){var r=this.x,n=this.y;return r*r+n*n},normalize:function(){var r=this.x,n=this.y,e=r*r+n*n;return e>0&&(e=1/Math.sqrt(e),this.x=r*e,this.y=n*e),this},normalizeRightHand:function(){var r=this.x;return this.x=this.y*-1,this.y=r,this},normalizeLeftHand:function(){var r=this.x;return this.x=this.y,this.y=r*-1,this},dot:function(r){return this.x*r.x+this.y*r.y},cross:function(r){return this.x*r.y-this.y*r.x},lerp:function(r,n){n===void 0&&(n=0);var e=this.x,s=this.y;return this.x=e+n*(r.x-e),this.y=s+n*(r.y-s),this},transformMat3:function(r){var n=this.x,e=this.y,s=r.val;return this.x=s[0]*n+s[3]*e+s[6],this.y=s[1]*n+s[4]*e+s[7],this},transformMat4:function(r){var n=this.x,e=this.y,s=r.val;return this.x=s[0]*n+s[4]*e+s[12],this.y=s[1]*n+s[5]*e+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(r){var n=this.length();return n&&n>r&&this.scale(r/n),this},reflect:function(r){return r=r.clone().normalize(),this.subtract(r.scale(2*this.dot(r)))},mirror:function(r){return this.reflect(r).negate()},rotate:function(r){var n=Math.cos(r),e=Math.sin(r);return this.set(n*this.x-e*this.y,e*this.x+n*this.y)},project:function(r){var n=this.dot(r)/r.dot(r);return this.copy(r).scale(n)}});a.ZERO=new a,a.RIGHT=new a(1,0),a.LEFT=new a(-1,0),a.UP=new a(0,-1),a.DOWN=new a(0,1),a.ONE=new a(1,1),p.exports=a},25836:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e){this.x=0,this.y=0,this.z=0,typeof r=="object"?(this.x=r.x||0,this.y=r.y||0,this.z=r.z||0):(this.x=r||0,this.y=n||0,this.z=e||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this.z=Math.min(this.z,a.z),this},max:function(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this.z=Math.max(this.z,a.z),this},clone:function(){return new c(this.x,this.y,this.z)},addVectors:function(a,r){return this.x=a.x+r.x,this.y=a.y+r.y,this.z=a.z+r.z,this},crossVectors:function(a,r){var n=a.x,e=a.y,s=a.z,h=r.x,i=r.y,o=r.z;return this.x=e*o-s*i,this.y=s*h-n*o,this.z=n*i-e*h,this},equals:function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z||0,this},set:function(a,r,n){return typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0):(this.x=a||0,this.y=r||0,this.z=n||0),this},setFromMatrixPosition:function(a){return this.fromArray(a.val,12)},setFromMatrixColumn:function(a,r){return this.fromArray(a.val,r*4)},fromArray:function(a,r){return r===void 0&&(r=0),this.x=a[r],this.y=a[r+1],this.z=a[r+2],this},add:function(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z||0,this},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addScale:function(a,r){return this.x+=a.x*r,this.y+=a.y*r,this.z+=a.z*r||0,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z||0,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z||1,this},scale:function(a){return isFinite(a)?(this.x*=a,this.y*=a,this.z*=a):(this.x=0,this.y=0,this.z=0),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return Math.sqrt(r*r+n*n+e*e)},distanceSq:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return r*r+n*n+e*e},length:function(){var a=this.x,r=this.y,n=this.z;return Math.sqrt(a*a+r*r+n*n)},lengthSq:function(){var a=this.x,r=this.y,n=this.z;return a*a+r*r+n*n},normalize:function(){var a=this.x,r=this.y,n=this.z,e=a*a+r*r+n*n;return e>0&&(e=1/Math.sqrt(e),this.x=a*e,this.y=r*e,this.z=n*e),this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},cross:function(a){var r=this.x,n=this.y,e=this.z,s=a.x,h=a.y,i=a.z;return this.x=n*i-e*h,this.y=e*s-r*i,this.z=r*h-n*s,this},lerp:function(a,r){r===void 0&&(r=0);var n=this.x,e=this.y,s=this.z;return this.x=n+r*(a.x-n),this.y=e+r*(a.y-e),this.z=s+r*(a.z-s),this},applyMatrix3:function(a){var r=this.x,n=this.y,e=this.z,s=a.val;return this.x=s[0]*r+s[3]*n+s[6]*e,this.y=s[1]*r+s[4]*n+s[7]*e,this.z=s[2]*r+s[5]*n+s[8]*e,this},applyMatrix4:function(a){var r=this.x,n=this.y,e=this.z,s=a.val,h=1/(s[3]*r+s[7]*n+s[11]*e+s[15]);return this.x=(s[0]*r+s[4]*n+s[8]*e+s[12])*h,this.y=(s[1]*r+s[5]*n+s[9]*e+s[13])*h,this.z=(s[2]*r+s[6]*n+s[10]*e+s[14])*h,this},transformMat3:function(a){var r=this.x,n=this.y,e=this.z,s=a.val;return this.x=r*s[0]+n*s[3]+e*s[6],this.y=r*s[1]+n*s[4]+e*s[7],this.z=r*s[2]+n*s[5]+e*s[8],this},transformMat4:function(a){var r=this.x,n=this.y,e=this.z,s=a.val;return this.x=s[0]*r+s[4]*n+s[8]*e+s[12],this.y=s[1]*r+s[5]*n+s[9]*e+s[13],this.z=s[2]*r+s[6]*n+s[10]*e+s[14],this},transformCoordinates:function(a){var r=this.x,n=this.y,e=this.z,s=a.val,h=r*s[0]+n*s[4]+e*s[8]+s[12],i=r*s[1]+n*s[5]+e*s[9]+s[13],o=r*s[2]+n*s[6]+e*s[10]+s[14],f=r*s[3]+n*s[7]+e*s[11]+s[15];return this.x=h/f,this.y=i/f,this.z=o/f,this},transformQuat:function(a){var r=this.x,n=this.y,e=this.z,s=a.x,h=a.y,i=a.z,o=a.w,f=o*r+h*e-i*n,l=o*n+i*r-s*e,u=o*e+s*n-h*r,v=-s*r-h*n-i*e;return this.x=f*o+v*-s+l*-i-u*-h,this.y=l*o+v*-h+u*-s-f*-i,this.z=u*o+v*-i+f*-h-l*-s,this},project:function(a){var r=this.x,n=this.y,e=this.z,s=a.val,h=s[0],i=s[1],o=s[2],f=s[3],l=s[4],u=s[5],v=s[6],m=s[7],x=s[8],g=s[9],y=s[10],T=s[11],E=s[12],P=s[13],R=s[14],M=s[15],L=1/(r*f+n*m+e*T+M);return this.x=(r*h+n*l+e*x+E)*L,this.y=(r*i+n*u+e*g+P)*L,this.z=(r*o+n*v+e*y+R)*L,this},projectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unprojectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unproject:function(a,r){var n=a.x,e=a.y,s=a.z,h=a.w,i=this.x-n,o=h-this.y-1-e,f=this.z;return this.x=2*i/s-1,this.y=2*o/h-1,this.z=2*f-1,this.project(r)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});c.ZERO=new c,c.RIGHT=new c(1,0,0),c.LEFT=new c(-1,0,0),c.UP=new c(0,-1,0),c.DOWN=new c(0,1,0),c.FORWARD=new c(0,0,1),c.BACK=new c(0,0,-1),c.ONE=new c(1,1,1),p.exports=c},61369:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s){this.x=0,this.y=0,this.z=0,this.w=0,typeof r=="object"?(this.x=r.x||0,this.y=r.y||0,this.z=r.z||0,this.w=r.w||0):(this.x=r||0,this.y=n||0,this.z=e||0,this.w=s||0)},clone:function(){return new c(this.x,this.y,this.z,this.w)},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z||0,this.w=a.w||0,this},equals:function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z&&this.w===a.w},set:function(a,r,n,e){return typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this.w=a.w||0):(this.x=a||0,this.y=r||0,this.z=n||0,this.w=e||0),this},add:function(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z||0,this.w+=a.w||0,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z||0,this.w-=a.w||0,this},scale:function(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this},length:function(){var a=this.x,r=this.y,n=this.z,e=this.w;return Math.sqrt(a*a+r*r+n*n+e*e)},lengthSq:function(){var a=this.x,r=this.y,n=this.z,e=this.w;return a*a+r*r+n*n+e*e},normalize:function(){var a=this.x,r=this.y,n=this.z,e=this.w,s=a*a+r*r+n*n+e*e;return s>0&&(s=1/Math.sqrt(s),this.x=a*s,this.y=r*s,this.z=n*s,this.w=e*s),this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lerp:function(a,r){r===void 0&&(r=0);var n=this.x,e=this.y,s=this.z,h=this.w;return this.x=n+r*(a.x-n),this.y=e+r*(a.y-e),this.z=s+r*(a.z-s),this.w=h+r*(a.w-h),this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z||1,this.w*=a.w||1,this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z||1,this.w/=a.w||1,this},distance:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0,s=a.w-this.w||0;return Math.sqrt(r*r+n*n+e*e+s*s)},distanceSq:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0,s=a.w-this.w||0;return r*r+n*n+e*e+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(a){var r=this.x,n=this.y,e=this.z,s=this.w,h=a.val;return this.x=h[0]*r+h[4]*n+h[8]*e+h[12]*s,this.y=h[1]*r+h[5]*n+h[9]*e+h[13]*s,this.z=h[2]*r+h[6]*n+h[10]*e+h[14]*s,this.w=h[3]*r+h[7]*n+h[11]*e+h[15]*s,this},transformQuat:function(a){var r=this.x,n=this.y,e=this.z,s=a.x,h=a.y,i=a.z,o=a.w,f=o*r+h*e-i*n,l=o*n+i*r-s*e,u=o*e+s*n-h*r,v=-s*r-h*n-i*e;return this.x=f*o+v*-s+l*-i-u*-h,this.y=l*o+v*-h+u*-s-f*-i,this.z=u*o+v*-i+f*-h-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});c.prototype.sub=c.prototype.subtract,c.prototype.mul=c.prototype.multiply,c.prototype.div=c.prototype.divide,c.prototype.dist=c.prototype.distance,c.prototype.distSq=c.prototype.distanceSq,c.prototype.len=c.prototype.length,c.prototype.lenSq=c.prototype.lengthSq,p.exports=c},60417:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return Math.abs(t-d)<=c};p.exports=C},15994:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=c-d;return d+((t-d)%a+a)%a};p.exports=C},31040:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return Math.atan2(a-d,c-t)};p.exports=C},55495:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return Math.atan2(d.y-t.y,d.x-t.x)};p.exports=C},128:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return Math.atan2(d.x-t.x,d.y-t.y)};p.exports=C},41273:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return Math.atan2(c-t,a-d)};p.exports=C},1432:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=function(a){return a>Math.PI&&(a-=d.PI2),Math.abs(((a+d.TAU)%d.PI2-d.PI2)%d.PI2)};p.exports=c},12407:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t=t%(2*Math.PI),t>=0?t:t+2*Math.PI};p.exports=C},53993:(p,C,t)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(99472),c=function(){return d(-Math.PI,Math.PI)};p.exports=c},86564:(p,C,t)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(99472),c=function(){return d(-180,180)};p.exports=c},90154:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(12407),c=function(a){return d(a+Math.PI)};p.exports=c},48736:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=function(a,r,n){return n===void 0&&(n=.05),a===r||(Math.abs(r-a)<=n||Math.abs(r-a)>=d.PI2-n?a=r:(Math.abs(r-a)>Math.PI&&(ra?a+=n:r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=d-t;if(c===0)return 0;var a=Math.floor((c- -180)/360);return c-a*360};p.exports=C},86554:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(15994),c=function(a){return d(a,-Math.PI,Math.PI)};p.exports=c},30954:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(15994),c=function(a){return d(a,-180,180)};p.exports=c},25588:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Between:t(31040),BetweenPoints:t(55495),BetweenPointsY:t(128),BetweenY:t(41273),CounterClockwise:t(1432),Normalize:t(12407),Random:t(53993),RandomDegrees:t(86564),Reverse:t(90154),RotateTo:t(48736),ShortestBetween:t(61430),Wrap:t(86554),WrapDegrees:t(30954)}},36383:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={PI2:Math.PI*2,TAU:Math.PI*.5,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};p.exports=C},20339:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=t-c,n=d-a;return Math.sqrt(r*r+n*n)};p.exports=C},52816:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.x-d.x,a=t.y-d.y;return Math.sqrt(c*c+a*a)};p.exports=C},64559:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.x-d.x,a=t.y-d.y;return c*c+a*a};p.exports=C},82340:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return Math.max(Math.abs(t-c),Math.abs(d-a))};p.exports=C},14390:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){return r===void 0&&(r=2),Math.sqrt(Math.pow(c-t,r)+Math.pow(a-d,r))};p.exports=C},2243:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return Math.abs(t-c)+Math.abs(d-a)};p.exports=C},89774:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=t-c,n=d-a;return r*r+n*n};p.exports=C},50994:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Between:t(20339),BetweenPoints:t(52816),BetweenPointsSquared:t(64559),Chebyshev:t(82340),Power:t(14390),Snake:t(2243),Squared:t(89774)}},62640:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54178),c=t(41521),a=t(79980),r=t(85433),n=t(99140),e=t(48857),s=t(81596),h=t(59133),i=t(98516),o=t(35248),f=t(82500),l=t(49752);p.exports={Power0:s,Power1:h.Out,Power2:r.Out,Power3:i.Out,Power4:o.Out,Linear:s,Quad:h.Out,Cubic:r.Out,Quart:i.Out,Quint:o.Out,Sine:f.Out,Expo:e.Out,Circ:a.Out,Elastic:n.Out,Back:d.Out,Bounce:c.Out,Stepped:l,"Quad.easeIn":h.In,"Cubic.easeIn":r.In,"Quart.easeIn":i.In,"Quint.easeIn":o.In,"Sine.easeIn":f.In,"Expo.easeIn":e.In,"Circ.easeIn":a.In,"Elastic.easeIn":n.In,"Back.easeIn":d.In,"Bounce.easeIn":c.In,"Quad.easeOut":h.Out,"Cubic.easeOut":r.Out,"Quart.easeOut":i.Out,"Quint.easeOut":o.Out,"Sine.easeOut":f.Out,"Expo.easeOut":e.Out,"Circ.easeOut":a.Out,"Elastic.easeOut":n.Out,"Back.easeOut":d.Out,"Bounce.easeOut":c.Out,"Quad.easeInOut":h.InOut,"Cubic.easeInOut":r.InOut,"Quart.easeInOut":i.InOut,"Quint.easeInOut":o.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":e.InOut,"Circ.easeInOut":a.InOut,"Elastic.easeInOut":n.InOut,"Back.easeInOut":d.InOut,"Bounce.easeInOut":c.InOut}},1639:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1.70158),t*t*((d+1)*t-d)};p.exports=C},50099:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=1.70158);var c=d*1.525;return(t*=2)<1?.5*(t*t*((c+1)*t-c)):.5*((t-=2)*t*((c+1)*t+c)+2)};p.exports=C},41286:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1.70158),--t*t*((d+1)*t+d)+1};p.exports=C},54178:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(1639),Out:t(41286),InOut:t(50099)}},59590:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t=1-t,t<.36363636363636365?1-7.5625*t*t:t<.7272727272727273?1-(7.5625*(t-=.5454545454545454)*t+.75):t<.9090909090909091?1-(7.5625*(t-=.8181818181818182)*t+.9375):1-(7.5625*(t-=.9545454545454546)*t+.984375)};p.exports=C},41788:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=!1;return t<.5?(t=1-t*2,d=!0):t=t*2-1,t<.36363636363636365?t=7.5625*t*t:t<.7272727272727273?t=7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?t=7.5625*(t-=.8181818181818182)*t+.9375:t=7.5625*(t-=.9545454545454546)*t+.984375,d?(1-t)*.5:t*.5+.5};p.exports=C},69905:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375};p.exports=C},41521:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(59590),Out:t(69905),InOut:t(41788)}},91861:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return 1-Math.sqrt(1-t*t)};p.exports=C},4177:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};p.exports=C},57512:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.sqrt(1- --t*t)};p.exports=C},79980:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(91861),Out:t(57512),InOut:t(4177)}},51150:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t*t*t};p.exports=C},82820:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};p.exports=C},35033:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return--t*t*t+1};p.exports=C},85433:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(51150),Out:t(35033),InOut:t(82820)}},69965:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===void 0&&(d=.1),c===void 0&&(c=.1),t===0)return 0;if(t===1)return 1;var a=c/4;return d<1?d=1:a=c*Math.asin(1/d)/(2*Math.PI),-(d*Math.pow(2,10*(t-=1))*Math.sin((t-a)*(2*Math.PI)/c))};p.exports=C},50665:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===void 0&&(d=.1),c===void 0&&(c=.1),t===0)return 0;if(t===1)return 1;var a=c/4;return d<1?d=1:a=c*Math.asin(1/d)/(2*Math.PI),(t*=2)<1?-.5*(d*Math.pow(2,10*(t-=1))*Math.sin((t-a)*(2*Math.PI)/c)):d*Math.pow(2,-10*(t-=1))*Math.sin((t-a)*(2*Math.PI)/c)*.5+1};p.exports=C},7744:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===void 0&&(d=.1),c===void 0&&(c=.1),t===0)return 0;if(t===1)return 1;var a=c/4;return d<1?d=1:a=c*Math.asin(1/d)/(2*Math.PI),d*Math.pow(2,-10*t)*Math.sin((t-a)*(2*Math.PI)/c)+1};p.exports=C},99140:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(69965),Out:t(7744),InOut:t(50665)}},24590:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return Math.pow(2,10*(t-1))-.001};p.exports=C},87844:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))};p.exports=C},89433:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return 1-Math.pow(2,-10*t)};p.exports=C},48857:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(24590),Out:t(89433),InOut:t(87844)}},48820:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Back:t(54178),Bounce:t(41521),Circular:t(79980),Cubic:t(85433),Elastic:t(99140),Expo:t(48857),Linear:t(81596),Quadratic:t(59133),Quartic:t(98516),Quintic:t(35248),Sine:t(82500),Stepped:t(49752)}},7147:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t};p.exports=C},81596:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports=t(7147)},34826:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t*t};p.exports=C},20544:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)};p.exports=C},92029:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t*(2-t)};p.exports=C},59133:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(34826),Out:t(92029),InOut:t(20544)}},64413:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t*t*t*t};p.exports=C},78137:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)};p.exports=C},45840:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return 1- --t*t*t*t};p.exports=C},98516:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(64413),Out:t(45840),InOut:t(78137)}},87745:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t*t*t*t*t};p.exports=C},16509:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)};p.exports=C},17868:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return--t*t*t*t*t+1};p.exports=C},35248:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(87745),Out:t(17868),InOut:t(16509)}},80461:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t===0?0:t===1?1:1-Math.cos(t*Math.PI/2)};p.exports=C},34025:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t===0?0:t===1?1:.5*(1-Math.cos(Math.PI*t))};p.exports=C},52768:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t===0?0:t===1?1:Math.sin(t*Math.PI/2)};p.exports=C},82500:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={In:t(80461),Out:t(52768),InOut:t(34025)}},72251:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1),t<=0?0:t>=1?1:((d*t|0)+1)*(1/d)};p.exports=C},49752:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports=t(72251)},75698:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1e-4),Math.ceil(t-d)};p.exports=C},43855:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c===void 0&&(c=1e-4),Math.abs(t-d){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d=1e-4),Math.floor(t+d)};p.exports=C},5470:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c===void 0&&(c=1e-4),t>d-c};p.exports=C},94977:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return c===void 0&&(c=1e-4),t{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Ceil:t(75698),Equal:t(43855),Floor:t(25777),GreaterThan:t(5470),LessThan:t(94977)}},75508:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36383),c=t(79291),a={Angle:t(25588),Distance:t(50994),Easing:t(48820),Fuzzy:t(48379),Interpolation:t(38289),Pow2:t(49001),Snap:t(73697),RandomDataGenerator:t(28453),Average:t(53307),Bernstein:t(85710),Between:t(30976),CatmullRom:t(87842),CeilTo:t(26302),Clamp:t(45319),DegToRad:t(39506),Difference:t(61241),Euler:t(38857),Factorial:t(6411),FloatBetween:t(99472),FloorTo:t(77623),FromPercent:t(62945),GetSpeed:t(38265),IsEven:t(78702),IsEvenStrict:t(94883),Linear:t(28915),LinearXY:t(94908),MaxAdd:t(86883),Median:t(50040),MinSub:t(37204),Percent:t(65201),RadToDeg:t(43396),RandomXY:t(74362),RandomXYZ:t(60706),RandomXYZW:t(67421),Rotate:t(36305),RotateAround:t(11520),RotateAroundDistance:t(1163),RotateTo:t(70336),RoundAwayFromZero:t(2284),RoundTo:t(41013),SinCosTableGenerator:t(16922),SmootherStep:t(54261),SmoothStep:t(7602),ToXY:t(44408),TransformXY:t(85955),Within:t(60417),Wrap:t(15994),Vector2:t(26099),Vector3:t(25836),Vector4:t(61369),Matrix3:t(94434),Matrix4:t(37867),Quaternion:t(15746),RotateVec3:t(72678)};a=c(!1,a,d),p.exports=a},89318:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85710),c=function(a,r){for(var n=0,e=a.length-1,s=0;s<=e;s++)n+=Math.pow(1-r,e-s)*Math.pow(r,s)*a[s]*d(e,s);return n};p.exports=c},77259:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87842),c=function(a,r){var n=a.length-1,e=n*r,s=Math.floor(e);return a[0]===a[n]?(r<0&&(s=Math.floor(e=n*(1+r))),d(e-s,a[(s-1+n)%n],a[s],a[(s+1)%n],a[(s+2)%n])):r<0?a[0]-(d(-e,a[0],a[0],a[1],a[1])-a[0]):r>1?a[n]-(d(e-n,a[n],a[n],a[n-1],a[n-1])-a[n]):d(e-s,a[s?s-1:0],a[s],a[n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(r,n){var e=1-r;return e*e*e*n}function t(r,n){var e=1-r;return 3*e*e*r*n}function d(r,n){return 3*(1-r)*r*r*n}function c(r,n){return r*r*r*n}var a=function(r,n,e,s,h){return C(r,n)+t(r,e)+d(r,s)+c(r,h)};p.exports=a},28392:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(28915),c=function(a,r){var n=a.length-1,e=n*r,s=Math.floor(e);return r<0?d(a[0],a[1],e):r>1?d(a[n],a[n-1],n-e):d(a[s],a[s+1>n?n:s+1],e-s)};p.exports=c},32112:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(a,r){var n=1-a;return n*n*r}function t(a,r){return 2*(1-a)*a*r}function d(a,r){return a*a*r}var c=function(a,r,n,e){return C(a,r)+t(a,n)+d(a,e)};p.exports=c},47235:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7602),c=function(a,r,n){return r+(n-r)*d(a,0,1)};p.exports=c},50178:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(54261),c=function(a,r,n){return r+(n-r)*d(a,0,1)};p.exports=c},38289:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Bezier:t(89318),CatmullRom:t(77259),CubicBezier:t(36316),Linear:t(28392),QuadraticBezier:t(32112),SmoothStep:t(47235),SmootherStep:t(50178)}},98439:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=Math.log(t)/.6931471805599453;return 1<{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t>0&&(t&t-1)===0&&d>0&&(d&d-1)===0};p.exports=C},81230:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t>0&&(t&t-1)===0};p.exports=C},49001:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={GetNext:t(98439),IsSize:t(50030),IsValue:t(81230)}},28453:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r){r===void 0&&(r=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],r&&this.init(r)},rnd:function(){var a=2091639*this.s0+this.c*23283064365386963e-26;return this.c=a|0,this.s0=this.s1,this.s1=this.s2,this.s2=a-this.c,this.s2},hash:function(a){var r,n=this.n;a=a.toString();for(var e=0;e>>0,r-=n,r*=n,n=r>>>0,r-=n,n+=r*4294967296;return this.n=n,(n>>>0)*23283064365386963e-26},init:function(a){typeof a=="string"?this.state(a):this.sow(a)},sow:function(a){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,!!a)for(var r=0;r0;n--){var e=Math.floor(this.frac()*(n+1)),s=a[e];a[e]=a[n],a[n]=s}return a}});p.exports=c},63448:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return c===void 0&&(c=0),d===0?t:(t-=c,t=d*Math.ceil(t/d),a?(c+t)/d:c+t)};p.exports=C},56583:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return c===void 0&&(c=0),d===0?t:(t-=c,t=d*Math.floor(t/d),a?(c+t)/d:c+t)};p.exports=C},77720:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){return c===void 0&&(c=0),d===0?t:(t-=c,t=d*Math.round(t/d),a?(c+t)/d:c+t)};p.exports=C},73697:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Ceil:t(63448),Floor:t(56583),To:t(77720)}},85454:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */t(63595);var d=t(8054),c=t(79291),a={Actions:t(61061),Animations:t(60421),BlendModes:t(10312),Cache:t(83388),Cameras:t(26638),Core:t(42857),Class:t(83419),Create:t(15822),Curves:t(25410),Data:t(44965),Display:t(27460),DOM:t(84902),Events:t(93055),FX:t(66064),Game:t(50127),GameObjects:t(77856),Geom:t(55738),Input:t(14350),Loader:t(57777),Math:t(75508),Physics:t(44563),Plugins:t(18922),Renderer:t(36909),Scale:t(93364),ScaleModes:t(29795),Scene:t(97482),Scenes:t(62194),Structs:t(41392),Textures:t(27458),Tilemaps:t(62501),Time:t(90291),Tweens:t(43066),Utils:t(91799)};a.Sound=t(23717),a=c(!1,a,d),p.exports=a,t.g.Phaser=a},71289:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(92209),a=t(88571),r=new d({Extends:a,Mixins:[c.Acceleration,c.Angular,c.Bounce,c.Collision,c.Debug,c.Drag,c.Enable,c.Friction,c.Gravity,c.Immovable,c.Mass,c.Pushable,c.Size,c.Velocity],initialize:function(e,s,h,i,o){a.call(this,e,s,h,i,o),this.body=null}});p.exports=r},86689:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(39506),a=t(20339),r=t(89774),n=t(66022),e=t(95540),s=t(46975),h=t(72441),i=t(47956),o=t(37277),f=t(44594),l=t(26099),u=t(82248),v=new d({initialize:function(x){this.scene=x,this.systems=x.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,x.sys.events.once(f.BOOT,this.boot,this),x.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new u(this.scene,this.config),this.add=new n(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new u(this.scene,this.config),this.add=new n(this.world));var m=this.systems.events;e(this.config,"customUpdate",!1)||m.on(f.UPDATE,this.world.update,this.world),m.on(f.POST_UPDATE,this.world.postUpdate,this.world),m.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var m=this.systems.game.config.physics,x=this.systems.settings.physics,g=s(e(x,"arcade",{}),e(m,"arcade",{}));return g},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(m,x,g,y,T){return g===void 0&&(g=null),y===void 0&&(y=null),T===void 0&&(T=g),this.world.collideObjects(m,x,g,y,T,!0)},collide:function(m,x,g,y,T){return g===void 0&&(g=null),y===void 0&&(y=null),T===void 0&&(T=g),this.world.collideObjects(m,x,g,y,T,!1)},collideTiles:function(m,x,g,y,T){return this.world.collideTiles(m,x,g,y,T)},overlapTiles:function(m,x,g,y,T){return this.world.overlapTiles(m,x,g,y,T)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(m,x,g,y,T,E){y===void 0&&(y=60);var P=Math.atan2(g-m.y,x-m.x);return m.body.acceleration.setToPolar(P,y),T!==void 0&&E!==void 0&&m.body.maxVelocity.set(T,E),P},accelerateToObject:function(m,x,g,y,T){return this.accelerateTo(m,x.x,x.y,g,y,T)},closest:function(m,x){x||(x=this.world.bodies.entries);for(var g=Number.MAX_VALUE,y=null,T=m.x,E=m.y,P=x.length,R=0;Rg&&(y=M,g=O)}}return y},moveTo:function(m,x,g,y,T){y===void 0&&(y=60),T===void 0&&(T=0);var E=Math.atan2(g-m.y,x-m.x);return T>0&&(y=a(m.x,m.y,x,g)/(T/1e3)),m.body.velocity.setToPolar(E,y),E},moveToObject:function(m,x,g,y){return this.moveTo(m,x.x,x.y,g,y)},velocityFromAngle:function(m,x,g){return x===void 0&&(x=60),g===void 0&&(g=new l),g.setToPolar(c(m),x)},velocityFromRotation:function(m,x,g){return x===void 0&&(x=60),g===void 0&&(g=new l),g.setToPolar(m,x)},overlapRect:function(m,x,g,y,T,E){return i(this.world,m,x,g,y,T,E)},overlapCirc:function(m,x,g,y,T){return h(this.world,m,x,g,y,T)},shutdown:function(){if(this.world){var m=this.systems.events;m.off(f.UPDATE,this.world.update,this.world),m.off(f.POST_UPDATE,this.world.postUpdate,this.world),m.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});o.register("ArcadePhysics",v,"arcadePhysics"),p.exports=v},13759:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(92209),a=t(68287),r=new d({Extends:a,Mixins:[c.Acceleration,c.Angular,c.Bounce,c.Collision,c.Debug,c.Drag,c.Enable,c.Friction,c.Gravity,c.Immovable,c.Mass,c.Pushable,c.Size,c.Velocity],initialize:function(e,s,h,i,o){a.call(this,e,s,h,i,o),this.body=null}});p.exports=r},37742:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(78389),a=t(37747),r=t(63012),n=t(43396),e=t(87841),s=t(37303),h=t(95829),i=t(26099),o=new d({Mixins:[c],initialize:function(l,u){var v=64,m=64,x={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},g=u!==void 0;g&&u.displayWidth&&(v=u.displayWidth,m=u.displayHeight),g||(u=x),this.world=l,this.gameObject=g?u:void 0,this.isBody=!0,this.transform={x:u.x,y:u.y,rotation:u.angle,scaleX:u.scaleX,scaleY:u.scaleY,displayOriginX:u.displayOriginX,displayOriginY:u.displayOriginY},this.debugShowBody=l.defaults.debugShowBody,this.debugShowVelocity=l.defaults.debugShowVelocity,this.debugBodyColor=l.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new i,this.position=new i(u.x-u.scaleX*u.displayOriginX,u.y-u.scaleY*u.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=u.angle,this.preRotation=u.angle,this.width=v,this.height=m,this.sourceWidth=v,this.sourceHeight=m,u.frame&&(this.sourceWidth=u.frame.realWidth,this.sourceHeight=u.frame.realHeight),this.halfWidth=Math.abs(v/2),this.halfHeight=Math.abs(m/2),this.center=new i(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new i,this.newVelocity=new i,this.deltaMax=new i,this.acceleration=new i,this.allowDrag=!0,this.drag=new i,this.allowGravity=!0,this.gravity=new i,this.bounce=new i,this.worldBounce=null,this.customBoundsRectangle=l.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new i(1e4,1e4),this.maxSpeed=-1,this.friction=new i(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=a.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new i(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.syncBounds=!1,this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=u.scaleX,this._sy=u.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new e,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var f=this.gameObject,l=this.transform;if(f.parentContainer){var u=f.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);l.x=u.tx,l.y=u.ty,l.rotation=n(u.rotation),l.scaleX=u.scaleX,l.scaleY=u.scaleY,l.displayOriginX=f.displayOriginX,l.displayOriginY=f.displayOriginY}else l.x=f.x,l.y=f.y,l.rotation=f.angle,l.scaleX=f.scaleX,l.scaleY=f.scaleY,l.displayOriginX=f.displayOriginX,l.displayOriginY=f.displayOriginY;var v=!1;if(this.syncBounds){var m=f.getBounds(this._bounds);this.width=m.width,this.height=m.height,v=!0}else{var x=Math.abs(l.scaleX),g=Math.abs(l.scaleY);(this._sx!==x||this._sy!==g)&&(this.width=this.sourceWidth*x,this.height=this.sourceHeight*g,this._sx=x,this._sy=g,v=!0)}v&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var f=this.transform;this.position.x=f.x+f.scaleX*(this.offset.x-f.displayOriginX),this.position.y=f.y+f.scaleY*(this.offset.y-f.displayOriginY),this.updateCenter()},resetFlags:function(f){f===void 0&&(f=!1);var l=this.wasTouching,u=this.touching,v=this.blocked;f?h(!0,l):(l.none=u.none,l.up=u.up,l.down=u.down,l.left=u.left,l.right=u.right),h(!0,u),h(!0,v),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(f,l){if(f&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var u=this.position;this.prev.x=u.x,this.prev.y=u.y,this.prevFrame.x=u.x,this.prevFrame.y=u.y}f&&this.update(l)},update:function(f){var l=this.prev,u=this.position,v=this.velocity;if(l.set(u.x,u.y),!this.moves){this._dx=u.x-l.x,this._dy=u.y-l.y;return}if(this.directControl){var m=this.autoFrame;v.set((u.x-m.x)/f,(u.y-m.y)/f),this.world.updateMotion(this,f),this._dx=u.x-m.x,this._dy=u.y-m.y}else this.world.updateMotion(this,f),this.newVelocity.set(v.x*f,v.y*f),u.add(this.newVelocity),this._dx=u.x-l.x,this._dy=u.y-l.y;var x=v.x,g=v.y;if(this.updateCenter(),this.angle=Math.atan2(g,x),this.speed=Math.sqrt(x*x+g*g),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var y=this.blocked;this.world.emit(r.WORLD_BOUNDS,this,y.up,y.down,y.left,y.right)}},postUpdate:function(){var f=this.position,l=f.x-this.prevFrame.x,u=f.y-this.prevFrame.y,v=this.gameObject;if(this.moves){var m=this.deltaMax.x,x=this.deltaMax.y;m!==0&&l!==0&&(l<0&&l<-m?l=-m:l>0&&l>m&&(l=m)),x!==0&&u!==0&&(u<0&&u<-x?u=-x:u>0&&u>x&&(u=x)),v&&(v.x+=l,v.y+=u)}l<0?this.facing=a.FACING_LEFT:l>0&&(this.facing=a.FACING_RIGHT),u<0?this.facing=a.FACING_UP:u>0&&(this.facing=a.FACING_DOWN),this.allowRotation&&v&&(v.angle+=this.deltaZ()),this._tx=l,this._ty=u,this.autoFrame.set(f.x,f.y)},setBoundsRectangle:function(f){return this.customBoundsRectangle=f||this.world.bounds,this},checkWorldBounds:function(){var f=this.position,l=this.velocity,u=this.blocked,v=this.customBoundsRectangle,m=this.world.checkCollision,x=this.worldBounce?-this.worldBounce.x:-this.bounce.x,g=this.worldBounce?-this.worldBounce.y:-this.bounce.y,y=!1;return f.xv.right&&m.right&&(f.x=v.right-this.width,l.x*=x,u.right=!0,y=!0),f.yv.bottom&&m.down&&(f.y=v.bottom-this.height,l.y*=g,u.down=!0,y=!0),y&&(this.blocked.none=!1,this.updateCenter()),y},setOffset:function(f,l){return l===void 0&&(l=f),this.offset.set(f,l),this},setGameObject:function(f,l){return l===void 0&&(l=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=f,f.body&&(f.body=this),this.setSize(),this.world.add(this),this.enable=l,this},setSize:function(f,l,u){u===void 0&&(u=!0);var v=this.gameObject;if(v&&(!f&&v.frame&&(f=v.frame.realWidth),!l&&v.frame&&(l=v.frame.realHeight)),this.sourceWidth=f,this.sourceHeight=l,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),u&&v&&v.getCenter){var m=(v.width-f)/2,x=(v.height-l)/2;this.offset.set(m,x)}return this.isCircle=!1,this.radius=0,this},setCircle:function(f,l,u){return l===void 0&&(l=this.offset.x),u===void 0&&(u=this.offset.y),f>0?(this.isCircle=!0,this.radius=f,this.sourceWidth=f*2,this.sourceHeight=f*2,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(l,u),this.updateCenter()):this.isCircle=!1,this},reset:function(f,l){this.stop();var u=this.gameObject;u&&(u.setPosition(f,l),this.rotation=u.angle,this.preRotation=u.angle);var v=this.position;u&&u.getTopLeft?u.getTopLeft(v):v.set(f,l),this.prev.copy(v),this.prevFrame.copy(v),this.autoFrame.copy(v),u&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(f){return f.x=this.x,f.y=this.y,f.right=this.right,f.bottom=this.bottom,f},hitTest:function(f,l){if(!this.isCircle)return s(this,f,l);if(this.radius>0&&f>=this.left&&f<=this.right&&l>=this.top&&l<=this.bottom){var u=(this.center.x-f)*(this.center.x-f),v=(this.center.y-l)*(this.center.y-l);return u+v<=this.radius*this.radius}return!1},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(f){var l=this.position,u=l.x+this.halfWidth,v=l.y+this.halfHeight;this.debugShowBody&&(f.lineStyle(f.defaultStrokeWidth,this.debugBodyColor),this.isCircle?f.strokeCircle(u,v,this.width/2):(this.checkCollision.up&&f.lineBetween(l.x,l.y,l.x+this.width,l.y),this.checkCollision.right&&f.lineBetween(l.x+this.width,l.y,l.x+this.width,l.y+this.height),this.checkCollision.down&&f.lineBetween(l.x,l.y+this.height,l.x+this.width,l.y+this.height),this.checkCollision.left&&f.lineBetween(l.x,l.y,l.x,l.y+this.height))),this.debugShowVelocity&&(f.lineStyle(f.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),f.lineBetween(u,v,u+this.velocity.x/2,v+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(f){return f===void 0&&(f=!0),this.directControl=f,this},setCollideWorldBounds:function(f,l,u,v){f===void 0&&(f=!0),this.collideWorldBounds=f;var m=l!==void 0,x=u!==void 0;return(m||x)&&(this.worldBounce||(this.worldBounce=new i),m&&(this.worldBounce.x=l),x&&(this.worldBounce.y=u)),v!==void 0&&(this.onWorldBounds=v),this},setVelocity:function(f,l){return this.velocity.set(f,l),f=this.velocity.x,l=this.velocity.y,this.speed=Math.sqrt(f*f+l*l),this},setVelocityX:function(f){return this.setVelocity(f,this.velocity.y)},setVelocityY:function(f){return this.setVelocity(this.velocity.x,f)},setMaxVelocity:function(f,l){return this.maxVelocity.set(f,l),this},setMaxVelocityX:function(f){return this.maxVelocity.x=f,this},setMaxVelocityY:function(f){return this.maxVelocity.y=f,this},setMaxSpeed:function(f){return this.maxSpeed=f,this},setSlideFactor:function(f,l){return this.slideFactor.set(f,l),this},setBounce:function(f,l){return this.bounce.set(f,l),this},setBounceX:function(f){return this.bounce.x=f,this},setBounceY:function(f){return this.bounce.y=f,this},setAcceleration:function(f,l){return this.acceleration.set(f,l),this},setAccelerationX:function(f){return this.acceleration.x=f,this},setAccelerationY:function(f){return this.acceleration.y=f,this},setAllowDrag:function(f){return f===void 0&&(f=!0),this.allowDrag=f,this},setAllowGravity:function(f){return f===void 0&&(f=!0),this.allowGravity=f,this},setAllowRotation:function(f){return f===void 0&&(f=!0),this.allowRotation=f,this},setDrag:function(f,l){return this.drag.set(f,l),this},setDamping:function(f){return this.useDamping=f,this},setDragX:function(f){return this.drag.x=f,this},setDragY:function(f){return this.drag.y=f,this},setGravity:function(f,l){return this.gravity.set(f,l),this},setGravityX:function(f){return this.gravity.x=f,this},setGravityY:function(f){return this.gravity.y=f,this},setFriction:function(f,l){return this.friction.set(f,l),this},setFrictionX:function(f){return this.friction.x=f,this},setFrictionY:function(f){return this.friction.y=f,this},setAngularVelocity:function(f){return this.angularVelocity=f,this},setAngularAcceleration:function(f){return this.angularAcceleration=f,this},setAngularDrag:function(f){return this.angularDrag=f,this},setMass:function(f){return this.mass=f,this},setImmovable:function(f){return f===void 0&&(f=!0),this.immovable=f,this},setEnable:function(f){return f===void 0&&(f=!0),this.enable=f,this},processX:function(f,l,u,v){this.x+=f,this.updateCenter(),l!==null&&(this.velocity.x=l*this.slideFactor.x);var m=this.blocked;u&&(m.left=!0,m.none=!1),v&&(m.right=!0,m.none=!1)},processY:function(f,l,u,v){this.y+=f,this.updateCenter(),l!==null&&(this.velocity.y=l*this.slideFactor.y);var m=this.blocked;u&&(m.up=!0,m.none=!1),v&&(m.down=!0,m.none=!1)},x:{get:function(){return this.position.x},set:function(f){this.position.x=f}},y:{get:function(){return this.position.y},set:function(f){this.position.y=f}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});p.exports=o},79342:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s,h,i,o){this.world=r,this.name="",this.active=!0,this.overlapOnly=n,this.object1=e,this.object2=s,this.collideCallback=h,this.processCallback=i,this.callbackContext=o},setName:function(a){return this.name=a,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});p.exports=c},66022:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(71289),c=t(13759),a=t(37742),r=t(83419),n=t(37747),e=t(60758),s=t(72624),h=t(71464),i=new r({initialize:function(f){this.world=f,this.scene=f.scene,this.sys=f.scene.sys},collider:function(o,f,l,u,v){return this.world.addCollider(o,f,l,u,v)},overlap:function(o,f,l,u,v){return this.world.addOverlap(o,f,l,u,v)},existing:function(o,f){var l=f?n.STATIC_BODY:n.DYNAMIC_BODY;return this.world.enableBody(o,l),o},staticImage:function(o,f,l,u){var v=new d(this.scene,o,f,l,u);return this.sys.displayList.add(v),this.world.enableBody(v,n.STATIC_BODY),v},image:function(o,f,l,u){var v=new d(this.scene,o,f,l,u);return this.sys.displayList.add(v),this.world.enableBody(v,n.DYNAMIC_BODY),v},staticSprite:function(o,f,l,u){var v=new c(this.scene,o,f,l,u);return this.sys.displayList.add(v),this.sys.updateList.add(v),this.world.enableBody(v,n.STATIC_BODY),v},sprite:function(o,f,l,u){var v=new c(this.scene,o,f,l,u);return this.sys.displayList.add(v),this.sys.updateList.add(v),this.world.enableBody(v,n.DYNAMIC_BODY),v},staticGroup:function(o,f){return this.sys.updateList.add(new h(this.world,this.world.scene,o,f))},group:function(o,f){return this.sys.updateList.add(new e(this.world,this.world.scene,o,f))},body:function(o,f,l,u){var v=new a(this.world);return v.position.set(o,f),l&&u&&v.setSize(l,u),this.world.add(v,n.DYNAMIC_BODY),v},staticBody:function(o,f,l,u){var v=new s(this.world);return v.position.set(o,f),l&&u&&v.setSize(l,u),this.world.add(v,n.STATIC_BODY),v},destroy:function(){this.world=null,this.scene=null,this.sys=null}});p.exports=i},79599:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=0;if(!Array.isArray(t))d=t;else for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37747),c=function(a,r,n,e){var s=0,h=a.deltaAbsX()+r.deltaAbsX()+e;return a._dx===0&&r._dx===0?(a.embedded=!0,r.embedded=!0):a._dx>r._dx?(s=a.right-r.x,s>h&&!n||a.checkCollision.right===!1||r.checkCollision.left===!1?s=0:(a.touching.none=!1,a.touching.right=!0,r.touching.none=!1,r.touching.left=!0,r.physicsType===d.STATIC_BODY&&!n&&(a.blocked.none=!1,a.blocked.right=!0),a.physicsType===d.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.left=!0))):a._dxh&&!n||a.checkCollision.left===!1||r.checkCollision.right===!1?s=0:(a.touching.none=!1,a.touching.left=!0,r.touching.none=!1,r.touching.right=!0,r.physicsType===d.STATIC_BODY&&!n&&(a.blocked.none=!1,a.blocked.left=!0),a.physicsType===d.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.right=!0))),a.overlapX=s,r.overlapX=s,s};p.exports=c},45170:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37747),c=function(a,r,n,e){var s=0,h=a.deltaAbsY()+r.deltaAbsY()+e;return a._dy===0&&r._dy===0?(a.embedded=!0,r.embedded=!0):a._dy>r._dy?(s=a.bottom-r.y,s>h&&!n||a.checkCollision.down===!1||r.checkCollision.up===!1?s=0:(a.touching.none=!1,a.touching.down=!0,r.touching.none=!1,r.touching.up=!0,r.physicsType===d.STATIC_BODY&&!n&&(a.blocked.none=!1,a.blocked.down=!0),a.physicsType===d.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.up=!0))):a._dyh&&!n||a.checkCollision.up===!1||r.checkCollision.down===!1?s=0:(a.touching.none=!1,a.touching.up=!0,r.touching.none=!1,r.touching.down=!0,r.physicsType===d.STATIC_BODY&&!n&&(a.blocked.none=!1,a.blocked.up=!0),a.physicsType===d.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.down=!0))),a.overlapY=s,r.overlapY=s,s};p.exports=c},60758:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13759),c=t(83419),a=t(78389),r=t(37747),n=t(95540),e=t(26479),s=t(41212),h=new c({Extends:e,Mixins:[a],initialize:function(o,f,l,u){if(!l&&!u)u={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else if(s(l))u=l,l=null,u.internalCreateCallback=this.createCallbackHandler,u.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(l)&&s(l[0])){var v=this;l.forEach(function(m){m.internalCreateCallback=v.createCallbackHandler,m.internalRemoveCallback=v.removeCallbackHandler,m.classType=n(m,"classType",d)}),u=null}else u={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=o,u&&(u.classType=n(u,"classType",d)),this.physicsType=r.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:n(u,"collideWorldBounds",!1),setBoundsRectangle:n(u,"customBoundsRectangle",null),setAccelerationX:n(u,"accelerationX",0),setAccelerationY:n(u,"accelerationY",0),setAllowDrag:n(u,"allowDrag",!0),setAllowGravity:n(u,"allowGravity",!0),setAllowRotation:n(u,"allowRotation",!0),setDamping:n(u,"useDamping",!1),setBounceX:n(u,"bounceX",0),setBounceY:n(u,"bounceY",0),setDragX:n(u,"dragX",0),setDragY:n(u,"dragY",0),setEnable:n(u,"enable",!0),setGravityX:n(u,"gravityX",0),setGravityY:n(u,"gravityY",0),setFrictionX:n(u,"frictionX",0),setFrictionY:n(u,"frictionY",0),setMaxSpeed:n(u,"maxSpeed",-1),setMaxVelocityX:n(u,"maxVelocityX",1e4),setMaxVelocityY:n(u,"maxVelocityY",1e4),setVelocityX:n(u,"velocityX",0),setVelocityY:n(u,"velocityY",0),setAngularVelocity:n(u,"angularVelocity",0),setAngularAcceleration:n(u,"angularAcceleration",0),setAngularDrag:n(u,"angularDrag",0),setMass:n(u,"mass",1),setImmovable:n(u,"immovable",!1)},e.call(this,f,l,u),this.type="PhysicsGroup"},createCallbackHandler:function(i){i.body||this.world.enableBody(i,r.DYNAMIC_BODY);var o=i.body;for(var f in this.defaults)o[f](this.defaults[f])},removeCallbackHandler:function(i){i.body&&this.world.disableBody(i)},setVelocity:function(i,o,f){f===void 0&&(f=0);for(var l=this.getChildren(),u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C,t,d,c,a,r,n,e,s,h,i,o,f,l,u,v,m,x=function(R,M,L){C=R,t=M;var O=C.velocity.x,D=t.velocity.x;return d=C.pushable,s=C._dx<0,h=C._dx>0,i=C._dx===0,u=Math.abs(C.right-t.x)<=Math.abs(t.right-C.x),n=D-O*C.bounce.x,c=t.pushable,o=t._dx<0,f=t._dx>0,l=t._dx===0,v=!u,e=O-D*t.bounce.x,m=Math.abs(L),g()},g=function(){return h&&u&&t.blocked.right?(C.processX(-m,n,!1,!0),1):s&&v&&t.blocked.left?(C.processX(m,n,!0),1):f&&v&&C.blocked.right?(t.processX(-m,e,!1,!0),2):o&&u&&C.blocked.left?(t.processX(m,e,!0),2):0},y=function(){var R=C.velocity.x,M=t.velocity.x,L=Math.sqrt(M*M*t.mass/C.mass)*(M>0?1:-1),O=Math.sqrt(R*R*C.mass/t.mass)*(R>0?1:-1),D=(L+O)*.5;return L-=D,O-=D,a=D+L*C.bounce.x,r=D+O*t.bounce.x,s&&v?T(0):o&&u?T(1):h&&u?T(2):f&&v?T(3):!1},T=function(R){if(d&&c)m*=.5,R===0||R===3?(C.processX(m,a),t.processX(-m,r)):(C.processX(-m,a),t.processX(m,r));else if(d&&!c)R===0||R===3?C.processX(m,n,!0):C.processX(-m,n,!1,!0);else if(!d&&c)R===0||R===3?t.processX(-m,e,!1,!0):t.processX(m,e,!0);else{var M=m*.5;R===0?l?(C.processX(m,0,!0),t.processX(0,null,!1,!0)):f?(C.processX(M,0,!0),t.processX(-M,0,!1,!0)):(C.processX(M,t.velocity.x,!0),t.processX(-M,null,!1,!0)):R===1?i?(C.processX(0,null,!1,!0),t.processX(m,0,!0)):h?(C.processX(-M,0,!1,!0),t.processX(M,0,!0)):(C.processX(-M,null,!1,!0),t.processX(M,C.velocity.x,!0)):R===2?l?(C.processX(-m,0,!1,!0),t.processX(0,null,!0)):o?(C.processX(-M,0,!1,!0),t.processX(M,0,!0)):(C.processX(-M,t.velocity.x,!1,!0),t.processX(M,null,!0)):R===3&&(i?(C.processX(0,null,!0),t.processX(-m,0,!1,!0)):s?(C.processX(M,0,!0),t.processX(-M,0,!1,!0)):(C.processX(M,t.velocity.y,!0),t.processX(-M,null,!1,!0)))}return!0},E=function(R){R===1?t.velocity.x=0:u?t.processX(m,e,!0):t.processX(-m,e,!1,!0),C.moves&&(t.y+=(C.y-C.prev.y)*C.friction.y,t._dy=t.y-t.prev.y)},P=function(R){R===2?C.velocity.x=0:v?C.processX(m,n,!0):C.processX(-m,n,!1,!0),t.moves&&(C.y+=(t.y-t.prev.y)*t.friction.y,C._dy=C.y-C.prev.y)};p.exports={BlockCheck:g,Check:y,Set:x,Run:T,RunImmovableBody1:E,RunImmovableBody2:P}},47962:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C,t,d,c,a,r,n,e,s,h,i,o,f,l,u,v,m,x=function(R,M,L){C=R,t=M;var O=C.velocity.y,D=t.velocity.y;return d=C.pushable,s=C._dy<0,h=C._dy>0,i=C._dy===0,u=Math.abs(C.bottom-t.y)<=Math.abs(t.bottom-C.y),n=D-O*C.bounce.y,c=t.pushable,o=t._dy<0,f=t._dy>0,l=t._dy===0,v=!u,e=O-D*t.bounce.y,m=Math.abs(L),g()},g=function(){return h&&u&&t.blocked.down?(C.processY(-m,n,!1,!0),1):s&&v&&t.blocked.up?(C.processY(m,n,!0),1):f&&v&&C.blocked.down?(t.processY(-m,e,!1,!0),2):o&&u&&C.blocked.up?(t.processY(m,e,!0),2):0},y=function(){var R=C.velocity.y,M=t.velocity.y,L=Math.sqrt(M*M*t.mass/C.mass)*(M>0?1:-1),O=Math.sqrt(R*R*C.mass/t.mass)*(R>0?1:-1),D=(L+O)*.5;return L-=D,O-=D,a=D+L*C.bounce.y,r=D+O*t.bounce.y,s&&v?T(0):o&&u?T(1):h&&u?T(2):f&&v?T(3):!1},T=function(R){if(d&&c)m*=.5,R===0||R===3?(C.processY(m,a),t.processY(-m,r)):(C.processY(-m,a),t.processY(m,r));else if(d&&!c)R===0||R===3?C.processY(m,n,!0):C.processY(-m,n,!1,!0);else if(!d&&c)R===0||R===3?t.processY(-m,e,!1,!0):t.processY(m,e,!0);else{var M=m*.5;R===0?l?(C.processY(m,0,!0),t.processY(0,null,!1,!0)):f?(C.processY(M,0,!0),t.processY(-M,0,!1,!0)):(C.processY(M,t.velocity.y,!0),t.processY(-M,null,!1,!0)):R===1?i?(C.processY(0,null,!1,!0),t.processY(m,0,!0)):h?(C.processY(-M,0,!1,!0),t.processY(M,0,!0)):(C.processY(-M,null,!1,!0),t.processY(M,C.velocity.y,!0)):R===2?l?(C.processY(-m,0,!1,!0),t.processY(0,null,!0)):o?(C.processY(-M,0,!1,!0),t.processY(M,0,!0)):(C.processY(-M,t.velocity.y,!1,!0),t.processY(M,null,!0)):R===3&&(i?(C.processY(0,null,!0),t.processY(-m,0,!1,!0)):s?(C.processY(M,0,!0),t.processY(-M,0,!1,!0)):(C.processY(M,t.velocity.y,!0),t.processY(-M,null,!1,!0)))}return!0},E=function(R){R===1?t.velocity.y=0:u?t.processY(m,e,!0):t.processY(-m,e,!1,!0),C.moves&&(t.x+=(C.x-C.prev.x)*C.friction.x,t._dx=t.x-t.prev.x)},P=function(R){R===2?C.velocity.y=0:v?C.processY(m,n,!0):C.processY(-m,n,!1,!0),t.moves&&(C.x+=(t.x-t.prev.x)*t.friction.x,C._dx=C.x-C.prev.x)};p.exports={BlockCheck:g,Check:y,Set:x,Run:T,RunImmovableBody1:E,RunImmovableBody2:P}},14087:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(64897),c=t(3017),a=function(r,n,e,s,h){h===void 0&&(h=d(r,n,e,s));var i=r.immovable,o=n.immovable;if(e||h===0||i&&o||r.customSeparateX||n.customSeparateX)return h!==0||r.embedded&&n.embedded;var f=c.Set(r,n,h);return!i&&!o?f>0?!0:c.Check():(i?c.RunImmovableBody1(f):o&&c.RunImmovableBody2(f),!0)};p.exports=a},89936:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45170),c=t(47962),a=function(r,n,e,s,h){h===void 0&&(h=d(r,n,e,s));var i=r.immovable,o=n.immovable;if(e||h===0||i&&o||r.customSeparateY||n.customSeparateY)return h!==0||r.embedded&&n.embedded;var f=c.Set(r,n,h);return!i&&!o?f>0?!0:c.Check():(i?c.RunImmovableBody1(f):o&&c.RunImmovableBody2(f),!0)};p.exports=a},95829:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===void 0&&(d={}),d.none=t,d.up=!1,d.down=!1,d.left=!1,d.right=!1,t||(d.up=!0,d.down=!0,d.left=!0,d.right=!0),d};p.exports=C},72624:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87902),c=t(83419),a=t(78389),r=t(37747),n=t(37303),e=t(95829),s=t(26099),h=new c({Mixins:[a],initialize:function(o,f){var l=64,u=64,v={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},m=f!==void 0;m&&f.displayWidth&&(l=f.displayWidth,u=f.displayHeight),m||(f=v),this.world=o,this.gameObject=m?f:void 0,this.isBody=!0,this.debugShowBody=o.defaults.debugShowStaticBody,this.debugBodyColor=o.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new s,this.position=new s(f.x-l*f.originX,f.y-u*f.originY),this.width=l,this.height=u,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new s(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=s.ZERO,this.allowGravity=!1,this.gravity=s.ZERO,this.bounce=s.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=e(!1),this.touching=e(!0),this.wasTouching=e(!0),this.blocked=e(!0),this.physicsType=r.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(i,o){return i&&i!==this.gameObject&&(this.gameObject.body=null,i.body=this,this.gameObject=i),o&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var i=this.gameObject;return i.getTopLeft(this.position),this.width=i.displayWidth,this.height=i.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(i,o){return o===void 0&&(o=i),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(i,o),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(i,o,f){f===void 0&&(f=!0);var l=this.gameObject;if(l&&l.frame&&(i||(i=l.frame.realWidth),o||(o=l.frame.realHeight)),this.world.staticTree.remove(this),this.width=i,this.height=o,this.halfWidth=Math.floor(i/2),this.halfHeight=Math.floor(o/2),f&&l&&l.getCenter){var u=l.displayWidth/2,v=l.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(u-this.halfWidth,v-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(i,o,f){return o===void 0&&(o=this.offset.x),f===void 0&&(f=this.offset.y),i>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=i,this.width=i*2,this.height=i*2,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(o,f),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(i,o){var f=this.gameObject;i===void 0&&(i=f.x),o===void 0&&(o=f.y),this.world.staticTree.remove(this),f.setPosition(i,o),f.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(i){return i.x=this.x,i.y=this.y,i.right=this.right,i.bottom=this.bottom,i},hitTest:function(i,o){return this.isCircle?d(this,i,o):n(this,i,o)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(i){var o=this.position,f=o.x+this.halfWidth,l=o.y+this.halfHeight;this.debugShowBody&&(i.lineStyle(i.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?i.strokeCircle(f,l,this.width/2):i.strokeRect(o.x,o.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(i){return i<=0&&(i=.1),this.mass=i,this},x:{get:function(){return this.position.x},set:function(i){this.world.staticTree.remove(this),this.position.x=i,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(i){this.world.staticTree.remove(this),this.position.y=i,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});p.exports=h},71464:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13759),c=t(83419),a=t(78389),r=t(37747),n=t(95540),e=t(26479),s=t(41212),h=new c({Extends:e,Mixins:[a],initialize:function(o,f,l,u){!l&&!u?u={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:d}:s(l)?(u=l,l=null,u.internalCreateCallback=this.createCallbackHandler,u.internalRemoveCallback=this.removeCallbackHandler,u.createMultipleCallback=this.createMultipleCallbackHandler,u.classType=n(u,"classType",d)):Array.isArray(l)&&s(l[0])?(u=l,l=null,u.forEach(function(v){v.internalCreateCallback=this.createCallbackHandler,v.internalRemoveCallback=this.removeCallbackHandler,v.createMultipleCallback=this.createMultipleCallbackHandler,v.classType=n(v,"classType",d)})):u={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler},this.world=o,this.physicsType=r.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,e.call(this,f,l,u),this.type="StaticPhysicsGroup"},createCallbackHandler:function(i){i.body||this.world.enableBody(i,r.STATIC_BODY)},removeCallbackHandler:function(i){i.body&&this.world.disableBody(i)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var i=this.children.entries,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(55495),c=t(37742),a=t(45319),r=t(83419),n=t(79342),e=t(37747),s=t(20339),h=t(52816),i=t(50792),o=t(63012),f=t(43855),l=t(5470),u=t(94977),v=t(64897),m=t(45170),x=t(96523),g=t(35154),y=t(36383),T=t(25774),E=t(96602),P=t(87841),R=t(59542),M=t(40012),L=t(14087),O=t(89936),D=t(35072),I=t(72624),V=t(2483),X=t(61340),H=t(26099),G=t(15994),U=new r({Extends:i,initialize:function(B,N){i.call(this),this.scene=B,this.bodies=new D,this.staticBodies=new D,this.pendingDestroy=new D,this.colliders=new T,this.gravity=new H(g(N,"gravity.x",0),g(N,"gravity.y",0)),this.bounds=new P(g(N,"x",0),g(N,"y",0),g(N,"width",B.sys.scale.width),g(N,"height",B.sys.scale.height)),this.checkCollision={up:g(N,"checkCollision.up",!0),down:g(N,"checkCollision.down",!0),left:g(N,"checkCollision.left",!0),right:g(N,"checkCollision.right",!0)},this.fps=g(N,"fps",60),this.fixedStep=g(N,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=g(N,"timeScale",1),this.OVERLAP_BIAS=g(N,"overlapBias",4),this.TILE_BIAS=g(N,"tileBias",16),this.forceX=g(N,"forceX",!1),this.isPaused=g(N,"isPaused",!1),this._total=0,this.drawDebug=g(N,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:g(N,"debugShowBody",!0),debugShowStaticBody:g(N,"debugShowStaticBody",!0),debugShowVelocity:g(N,"debugShowVelocity",!0),bodyDebugColor:g(N,"debugBodyColor",16711935),staticBodyDebugColor:g(N,"debugStaticBodyColor",255),velocityDebugColor:g(N,"debugVelocityColor",65280)},this.maxEntries=g(N,"maxEntries",16),this.useTree=g(N,"useTree",!0),this.tree=new R(this.maxEntries),this.staticTree=new R(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new X,this._tempMatrix2=new X,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(F,B){B===void 0&&(B=e.DYNAMIC_BODY),Array.isArray(F)||(F=[F]);for(var N=0;N=Y;for(this.fixedStep||(z=B*.001,Q=!0,this._elapsed=0),N=0;N=Y;)this._elapsed-=Y,this.step(z)}},step:function(F){var B,N,z=this.bodies.entries,Y=z.length;for(B=0;B0){var $=this.tree,j=this.staticTree;for(N=Q.entries,z=N.length,F=0;F-1&&F.velocity.length()>_&&(F.velocity.normalize().scale(_),k=_),F.speed=k},separate:function(F,B,N,z,Y){var K,Z,Q=!1,$=!0;if(!F.enable||!B.enable||F.checkCollision.none||B.checkCollision.none||!this.intersects(F,B)||N&&N.call(z,F.gameObject,B.gameObject)===!1)return Q;if(F.isCircle||B.isCircle){var j=this.separateCircle(F,B,Y);j.result?(Q=!0,$=!1):(K=j.x,Z=j.y,$=!0)}if($){var k=!1,_=!1,q=this.OVERLAP_BIAS;Y?(k=L(F,B,Y,q,K),_=O(F,B,Y,q,Z)):this.forceX||Math.abs(this.gravity.y+F.gravity.y)st&&(_=s(et,nt,st,tt)-at):nt>it&&(etst&&(_=s(et,nt,st,it)-at)),_*=-1}else _=F.halfWidth+B.halfWidth-h(K,Z);F.overlapR=_,B.overlapR=_;var ot=d(K,Z),ht=(_+y.EPSILON)*Math.cos(ot),xt=(_+y.EPSILON)*Math.sin(ot),mt={overlap:_,result:!1,x:ht,y:xt};if(N&&(!q||q&&_!==0))return mt.result=!0,mt;if(!q&&_===0||Q&&$||F.customSeparateX||B.customSeparateX)return mt.x=void 0,mt.y=void 0,mt;var ft=!F.pushable&&!B.pushable;if(q){var lt=K.x-Z.x,St=K.y-Z.y,pt=Math.sqrt(Math.pow(lt,2)+Math.pow(St,2)),At=(Z.x-K.x)/pt||0,Mt=(Z.y-K.y)/pt||0,Ot=2*(j.x*At+j.y*Mt-k.x*At-k.y*Mt)/(F.mass+B.mass);(Q||$)&&(Ot*=2),Q||(j.x=j.x-Ot/F.mass*At,j.y=j.y-Ot/F.mass*Mt,j.multiply(F.bounce)),$||(k.x=k.x+Ot/B.mass*At,k.y=k.y+Ot/B.mass*Mt,k.multiply(B.bounce)),!Q&&!$&&(ht*=.5,xt*=.5),Q||(F.x-=ht,F.y-=xt,F.updateCenter()),$||(B.x+=ht,B.y+=xt,B.updateCenter()),mt.result=!0}else!Q||F.pushable||ft?(F.x-=ht,F.y-=xt,F.updateCenter()):(!$||B.pushable||ft)&&(B.x+=ht,B.y+=xt,B.updateCenter()),mt.x=void 0,mt.y=void 0;return mt},intersects:function(F,B){return F===B?!1:!F.isCircle&&!B.isCircle?!(F.right<=B.left||F.bottom<=B.top||F.left>=B.right||F.top>=B.bottom):F.isCircle?B.isCircle?h(F.center,B.center)<=F.halfWidth+B.halfWidth:this.circleBodyIntersects(F,B):this.circleBodyIntersects(B,F)},circleBodyIntersects:function(F,B){var N=a(F.center.x,B.left,B.right),z=a(F.center.y,B.top,B.bottom),Y=(F.center.x-N)*(F.center.x-N),K=(F.center.y-z)*(F.center.y-z);return Y+K<=F.halfWidth*F.halfWidth},overlap:function(F,B,N,z,Y){return N===void 0&&(N=null),z===void 0&&(z=null),Y===void 0&&(Y=N),this.collideObjects(F,B,N,z,Y,!0)},collide:function(F,B,N,z,Y){return N===void 0&&(N=null),z===void 0&&(z=null),Y===void 0&&(Y=N),this.collideObjects(F,B,N,z,Y,!1)},collideObjects:function(F,B,N,z,Y,K){var Z,Q;F.isParent&&(F.physicsType===void 0||B===void 0||F===B)&&(F=F.children.entries),B&&B.isParent&&B.physicsType===void 0&&(B=B.children.entries);var $=Array.isArray(F),j=Array.isArray(B);if(this._total=0,!$&&!j)this.collideHandler(F,B,N,z,Y,K);else if(!$&&j)for(Z=0;Z0},collideHandler:function(F,B,N,z,Y,K){if(B===void 0&&F.isParent)return this.collideGroupVsGroup(F,F,N,z,Y,K);if(!F||!B)return!1;if(F.body||F.isBody){if(B.body||B.isBody)return this.collideSpriteVsSprite(F,B,N,z,Y,K);if(B.isParent)return this.collideSpriteVsGroup(F,B,N,z,Y,K);if(B.isTilemap)return this.collideSpriteVsTilemapLayer(F,B,N,z,Y,K)}else if(F.isParent){if(B.body||B.isBody)return this.collideSpriteVsGroup(B,F,N,z,Y,K);if(B.isParent)return this.collideGroupVsGroup(F,B,N,z,Y,K);if(B.isTilemap)return this.collideGroupVsTilemapLayer(F,B,N,z,Y,K)}else if(F.isTilemap){if(B.body||B.isBody)return this.collideSpriteVsTilemapLayer(B,F,N,z,Y,K);if(B.isParent)return this.collideGroupVsTilemapLayer(B,F,N,z,Y,K)}},canCollide:function(F,B){return F&&B&&(F.collisionMask&B.collisionCategory)!==0&&(B.collisionMask&F.collisionCategory)!==0},collideSpriteVsSprite:function(F,B,N,z,Y,K){var Z=F.isBody?F:F.body,Q=B.isBody?B:B.body;return this.canCollide(Z,Q)?(this.separate(Z,Q,z,Y,K)&&(N&&N.call(Y,F,B),this._total++),!0):!1},collideSpriteVsGroup:function(F,B,N,z,Y,K){var Z=F.isBody?F:F.body;if(!(B.length===0||!Z||!Z.enable||Z.checkCollision.none||!this.canCollide(Z,B))){var Q,$,j;if(this.useTree||B.physicsType===e.STATIC_BODY){var k=this.treeMinMax;k.minX=Z.left,k.minY=Z.top,k.maxX=Z.right,k.maxY=Z.bottom;var _=B.physicsType===e.DYNAMIC_BODY?this.tree.search(k):this.staticTree.search(k);for($=_.length,Q=0;Q<$;Q++)j=_[Q],!(Z===j||!j.enable||j.checkCollision.none||!B.contains(j.gameObject))&&this.separate(Z,j,z,Y,K)&&(N&&N.call(Y,Z.gameObject,j.gameObject),this._total++)}else{var q=B.getChildren(),et=B.children.entries.indexOf(F);for($=q.length,Q=0;Q<$;Q++)j=q[Q].body,!(!j||Q===et||!j.enable)&&this.separate(Z,j,z,Y,K)&&(N&&N.call(Y,Z.gameObject,j.gameObject),this._total++)}}},collideGroupVsTilemapLayer:function(F,B,N,z,Y,K){if(!this.canCollide(F,B))return!1;var Z=F.getChildren();if(Z.length===0)return!1;for(var Q=!1,$=0;${/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setAcceleration:function(t,d){return this.body.acceleration.set(t,d),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}};p.exports=C},59023:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}};p.exports=C},62069:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setBounce:function(t,d){return this.body.bounce.set(t,d),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,d,c,a){return this.body.setCollideWorldBounds(t,d,c,a),this}};p.exports=C},78389:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79599),c={setCollisionCategory:function(a){var r=this.body?this.body:this;return r.collisionCategory=a,this},willCollideWith:function(a){var r=this.body?this.body:this;return(r.collisionMask&a)!==0},addCollidesWith:function(a){var r=this.body?this.body:this;return r.collisionMask=r.collisionMask|a,this},removeCollidesWith:function(a){var r=this.body?this.body:this;return r.collisionMask=r.collisionMask&~a,this},setCollidesWith:function(a){var r=this.body?this.body:this;return r.collisionMask=d(a),this},resetCollisionCategory:function(){var a=this.body?this.body:this;return a.collisionCategory=1,a.collisionMask=1,this}};p.exports=c},87118:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setDebug:function(t,d,c){return this.debugShowBody=t,this.debugShowVelocity=d,this.debugBodyColor=c,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}};p.exports=C},52819:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setDrag:function(t,d){return this.body.drag.set(t,d),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}};p.exports=C},4074:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,d,c,a,r){return t&&this.body.reset(d,c),a&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,d){return t===void 0&&(t=!1),d===void 0&&(d=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),d&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};p.exports=C},40831:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setFriction:function(t,d){return this.body.friction.set(t,d),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}};p.exports=C},26775:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setGravity:function(t,d){return this.body.gravity.set(t,d),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}};p.exports=C},9437:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setImmovable:function(t){return t===void 0&&(t=!0),this.body.immovable=t,this}};p.exports=C},30621:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setMass:function(t){return this.body.mass=t,this}};p.exports=C},72441:(p,C,t)=>{var d=t(47956),c=t(96503),a=t(2044),r=t(81491),n=function(e,s,h,i,o,f){var l=d(e,s-i,h-i,2*i,2*i,o,f);if(l.length===0)return l;for(var u=new c(s,h,i),v=new c,m=[],x=0;x{var C=function(t,d,c,a,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var s=[],h=[],i=t.treeMinMax;if(i.minX=d,i.minY=c,i.maxX=d+a,i.maxY=c+r,e&&(h=t.staticTree.search(i)),n&&t.useTree)s=t.tree.search(i);else if(n){var o=t.bodies,f={position:{x:d,y:c},left:d,top:c,right:d+a,bottom:c+r,isCircle:!1},l=t.intersects;o.iterate(function(u){l(u,f)&&s.push(u)})}return h.concat(s)};p.exports=C},62121:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setPushable:function(t){return t===void 0&&(t=!0),this.body.pushable=t,this}};p.exports=C},29384:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setOffset:function(t,d){return this.body.setOffset(t,d),this},setSize:function(t,d,c){return this.body.setSize(t,d,c),this},setBodySize:function(t,d,c){return this.body.setSize(t,d,c),this},setCircle:function(t,d,c){return this.body.setCircle(t,d,c),this}};p.exports=C},15098:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setVelocity:function(t,d){return this.body.setVelocity(t,d),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,d){return this.body.maxVelocity.set(t,d),this}};p.exports=C},92209:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Acceleration:t(1093),Angular:t(59023),Bounce:t(62069),Collision:t(78389),Debug:t(87118),Drag:t(52819),Enable:t(4074),Friction:t(40831),Gravity:t(26775),Immovable:t(9437),Mass:t(30621),OverlapCirc:t(72441),OverlapRect:t(47956),Pushable:t(62121),Size:t(29384),Velocity:t(15098)}},37747:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14};p.exports=C},20009:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="collide"},36768:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="overlap"},60473:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},89954:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},61804:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="tilecollide"},7161:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="tileoverlap"},34689:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="worldbounds"},16006:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="worldstep"},63012:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={COLLIDE:t(20009),OVERLAP:t(36768),PAUSE:t(60473),RESUME:t(89954),TILE_COLLIDE:t(61804),TILE_OVERLAP:t(7161),WORLD_BOUNDS:t(34689),WORLD_STEP:t(16006)}},27064:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37747),c=t(79291),a={ArcadePhysics:t(86689),Body:t(37742),Collider:t(79342),Components:t(92209),Events:t(63012),Factory:t(66022),GetCollidesWith:t(79599),GetOverlapX:t(64897),GetOverlapY:t(45170),SeparateX:t(14087),SeparateY:t(89936),Group:t(60758),Image:t(71289),Sprite:t(13759),StaticBody:t(72624),StaticGroup:t(71464),Tilemap:t(55173),World:t(82248)};a=c(!1,a,d),p.exports=a},96602:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,d,t):t.layer.callbacks[t.index]?!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,d,t):!0};p.exports=C},36294:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d<0?(t.blocked.none=!1,t.blocked.left=!0):d>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=d,t.updateCenter(),t.bounce.x===0?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x};p.exports=C},67013:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d<0?(t.blocked.none=!1,t.blocked.up=!0):d>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=d,t.updateCenter(),t.bounce.y===0?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y};p.exports=C},40012:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(21329),c=t(53442),a=t(2483),r=function(n,e,s,h,i,o,f){var l=h.left,u=h.top,v=h.right,m=h.bottom,x=s.faceLeft||s.faceRight,g=s.faceTop||s.faceBottom;if(f||(x=!0,g=!0),!x&&!g)return!1;var y=0,T=0,E=0,P=1;if(e.deltaAbsX()>e.deltaAbsY()?E=-1:e.deltaAbsX(){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36294),c=function(a,r,n,e,s,h){var i=0,o=r.faceLeft,f=r.faceRight,l=r.collideLeft,u=r.collideRight;return h||(o=!0,f=!0,l=!0,u=!0),a.deltaX()<0&&u&&a.checkCollision.left?f&&a.x0&&l&&a.checkCollision.right&&o&&a.right>n&&(i=a.right-n,i>s&&(i=0)),i!==0&&(a.customSeparateX?a.overlapX=i:d(a,i)),i};p.exports=c},53442:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(67013),c=function(a,r,n,e,s,h){var i=0,o=r.faceTop,f=r.faceBottom,l=r.collideUp,u=r.collideDown;return h||(o=!0,f=!0,l=!0,u=!0),a.deltaY()<0&&u&&a.checkCollision.up?f&&a.y0&&l&&a.checkCollision.down&&o&&a.bottom>n&&(i=a.bottom-n,i>s&&(i=0)),i!==0&&(a.customSeparateY?a.overlapY=i:d(a,i)),i};p.exports=c},2483:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return!(d.right<=t.left||d.bottom<=t.top||d.position.x>=t.right||d.position.y>=t.bottom)};p.exports=C},55173:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={ProcessTileCallbacks:t(96602),ProcessTileSeparationX:t(36294),ProcessTileSeparationY:t(67013),SeparateTile:t(40012),TileCheckX:t(21329),TileCheckY:t(53442),TileIntersectsBody:t(2483)};p.exports=d},44563:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Arcade:t(27064),Matter:t(3875)}},68174:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(26099),a=new d({initialize:function(){this.boundsCenter=new c,this.centerDiff=new c},parseBody:function(r){if(r=r.hasOwnProperty("body")?r.body:r,!r.hasOwnProperty("bounds")||!r.hasOwnProperty("centerOfMass"))return!1;var n=this.boundsCenter,e=this.centerDiff,s=r.bounds.max.x-r.bounds.min.x,h=r.bounds.max.y-r.bounds.min.y,i=s*r.centerOfMass.x,o=h*r.centerOfMass.y;return n.set(s/2,h/2),e.set(i-n.x,o-n.y),!0},getTopLeft:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n+s.x+h.x,e+s.y+h.y)}return!1},getTopCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n+h.x,e+s.y+h.y)}return!1},getTopRight:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n-(s.x-h.x),e+s.y+h.y)}return!1},getLeftCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n+s.x+h.x,e+h.y)}return!1},getCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.centerDiff;return new c(n+s.x,e+s.y)}return!1},getRightCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n-(s.x-h.x),e+h.y)}return!1},getBottomLeft:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n+s.x+h.x,e-(s.y-h.y))}return!1},getBottomCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n+h.x,e-(s.y-h.y))}return!1},getBottomRight:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var s=this.boundsCenter,h=this.centerDiff;return new c(n-(s.x-h.x),e-(s.y-h.y))}return!1}});p.exports=a},19933:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6790);d.Body=t(22562),d.Composite=t(69351),d.World=t(4372),d.Collision=t(52284),d.Detector=t(81388),d.Pairs=t(99561),d.Pair=t(4506),d.Query=t(73296),d.Resolver=t(66272),d.Constraint=t(48140),d.Common=t(53402),d.Engine=t(48413),d.Events=t(35810),d.Sleeping=t(53614),d.Plugin=t(73832),d.Bodies=t(66280),d.Composites=t(74116),d.Axes=t(66615),d.Bounds=t(15647),d.Svg=t(74058),d.Vector=t(31725),d.Vertices=t(41598),d.World.add=d.Composite.add,d.World.remove=d.Composite.remove,d.World.addComposite=d.Composite.addComposite,d.World.addBody=d.Composite.addBody,d.World.addConstraint=d.Composite.addConstraint,d.World.clear=d.Composite.clear,p.exports=d},28137:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(83419),a=t(74116),r=t(48140),n=t(74058),e=t(75803),s=t(23181),h=t(34803),i=t(73834),o=t(19496),f=t(85791),l=t(98713),u=t(41598),v=new c({initialize:function(x){this.world=x,this.scene=x.scene,this.sys=x.scene.sys},rectangle:function(m,x,g,y,T){var E=d.rectangle(m,x,g,y,T);return this.world.add(E),E},trapezoid:function(m,x,g,y,T,E){var P=d.trapezoid(m,x,g,y,T,E);return this.world.add(P),P},circle:function(m,x,g,y,T){var E=d.circle(m,x,g,y,T);return this.world.add(E),E},polygon:function(m,x,g,y,T){var E=d.polygon(m,x,g,y,T);return this.world.add(E),E},fromVertices:function(m,x,g,y,T,E,P){typeof g=="string"&&(g=u.fromPath(g));var R=d.fromVertices(m,x,g,y,T,E,P);return this.world.add(R),R},fromPhysicsEditor:function(m,x,g,y,T){T===void 0&&(T=!0);var E=o.parseBody(m,x,g,y);return T&&!this.world.has(E)&&this.world.add(E),E},fromSVG:function(m,x,g,y,T,E){y===void 0&&(y=1),T===void 0&&(T={}),E===void 0&&(E=!0);for(var P=g.getElementsByTagName("path"),R=[],M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(31884),c=t(95540),a=t(26099);function r(e){return!!e.get&&typeof e.get=="function"||!!e.set&&typeof e.set=="function"}var n=function(e,s,h,i){h===void 0&&(h={}),i===void 0&&(i=!0);var o=s.x,f=s.y;s.body={temp:!0,position:{x:o,y:f}};var l=[d.Bounce,d.Collision,d.Force,d.Friction,d.Gravity,d.Mass,d.Sensor,d.SetBody,d.Sleep,d.Static,d.Transform,d.Velocity];if(l.forEach(function(v){for(var m in v)r(v[m])?Object.defineProperty(s,m,{get:v[m].get,set:v[m].set}):Object.defineProperty(s,m,{value:v[m]})}),s.world=e,s._tempVec2=new a(o,f),h.hasOwnProperty("type")&&h.type==="body")s.setExistingBody(h,i);else{var u=c(h,"shape",null);u||(u="rectangle"),h.addToWorld=i,s.setBody(u,h)}return s};p.exports=n},23181:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31884),a=t(95643),r=t(95540),n=t(88571),e=t(72699),s=t(26099),h=new d({Extends:n,Mixins:[c.Bounce,c.Collision,c.Force,c.Friction,c.Gravity,c.Mass,c.Sensor,c.SetBody,c.Sleep,c.Static,c.Transform,c.Velocity,e],initialize:function(o,f,l,u,v,m){a.call(this,o.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(u,v),this.setSizeToFrame(),this.setOrigin(),this.world=o,this._tempVec2=new s(f,l);var x=r(m,"shape",null);x?this.setBody(x,m):this.setRectangle(this.width,this.height,m),this.setPosition(f,l),this.initPipeline(),this.initPostPipeline(!0)}});p.exports=h},42045:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(60461),c=t(66615),a=t(66280),r=t(22562),n=t(68174),e=t(15647),s=t(83419),h=t(52284),i=t(53402),o=t(69351),f=t(74116),l=t(48140),u=t(81388),v=t(20339),m=t(28137),x=t(95540),g=t(35154),y=t(18210),T=t(40178),E=t(6790),P=t(74507),R=t(46975),M=t(4506),L=t(99561),O=t(73832),D=t(37277),I=t(73296),V=t(66272),X=t(44594),H=t(74058),G=t(31725),U=t(41598),F=t(68243);i.setDecomp(t(55973));var B=new s({initialize:function(z){this.scene=z,this.systems=z.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=r,this.composite=o,this.collision=h,this.detector=u,this.pair=M,this.pairs=L,this.query=I,this.resolver=V,this.constraint=l,this.bodies=a,this.composites=f,this.axes=c,this.bounds=e,this.svg=H,this.vector=G,this.vertices=U,this.verts=U,this._tempVec2=G.create(),g(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),g(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),g(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),V._restingThresh=g(this.config,"restingThresh",4),V._restingThreshTangent=g(this.config,"restingThreshTangent",6),V._positionDampen=g(this.config,"positionDampen",.9),V._positionWarming=g(this.config,"positionWarming",.8),V._frictionNormalMultiplier=g(this.config,"frictionNormalMultiplier",5),z.sys.events.once(X.BOOT,this.boot,this),z.sys.events.on(X.START,this.start,this)},boot:function(){this.world=new F(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new n,this.systems.events.once(X.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new F(this.scene,this.config),this.add=new m(this.world));var N=this.systems.events;N.on(X.UPDATE,this.world.update,this.world),N.on(X.POST_UPDATE,this.world.postUpdate,this.world),N.once(X.SHUTDOWN,this.shutdown,this)},getConfig:function(){var N=this.systems.game.config.physics,z=this.systems.settings.physics,Y=R(x(z,"matter",{}),x(N,"matter",{}));return Y},enableAttractorPlugin:function(){return O.register(y),O.use(E,y),this},enableWrapPlugin:function(){return O.register(P),O.use(E,P),this},enableCollisionEventsPlugin:function(){return O.register(T),O.use(E,T),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(N,z){this.world.step(N,z)},containsPoint:function(N,z,Y){N=this.getMatterBodies(N);var K=G.create(z,Y),Z=I.point(N,K);return Z.length>0},intersectPoint:function(N,z,Y){Y=this.getMatterBodies(Y);var K=G.create(N,z),Z=[],Q=I.point(Y,K);return Q.forEach(function($){Z.indexOf($)===-1&&Z.push($)}),Z},intersectRect:function(N,z,Y,K,Z,Q){Z===void 0&&(Z=!1),Q=this.getMatterBodies(Q);var $={min:{x:N,y:z},max:{x:N+Y,y:z+K}},j=[],k=I.region(Q,$,Z);return k.forEach(function(_){j.indexOf(_)===-1&&j.push(_)}),j},intersectRay:function(N,z,Y,K,Z,Q){Z===void 0&&(Z=1),Q=this.getMatterBodies(Q);for(var $=[],j=I.ray(Q,G.create(N,z),G.create(Y,K),Z),k=0;k{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(9674),c=t(83419),a=t(31884),r=t(95643),n=t(95540),e=t(72699),s=t(68287),h=t(26099),i=new c({Extends:s,Mixins:[a.Bounce,a.Collision,a.Force,a.Friction,a.Gravity,a.Mass,a.Sensor,a.SetBody,a.Sleep,a.Static,a.Transform,a.Velocity,e],initialize:function(f,l,u,v,m,x){r.call(this,f.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new d(this),this.setTexture(v,m),this.setSizeToFrame(),this.setOrigin(),this.world=f,this._tempVec2=new h(l,u);var g=n(x,"shape",null);g?this.setBody(g,x):this.setRectangle(this.width,this.height,x),this.setPosition(l,u),this.initPipeline(),this.initPostPipeline(!0)}});p.exports=i},73834:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(22562),a=t(83419),r=t(31884),n=t(62644),e=t(50792),s=t(95540),h=t(97022),i=t(41598),o=new a({Extends:e,Mixins:[r.Bounce,r.Collision,r.Friction,r.Gravity,r.Mass,r.Sensor,r.Sleep,r.Static],initialize:function(l,u,v){e.call(this),this.tile=u,this.world=l,u.physics.matterBody&&u.physics.matterBody.destroy(),u.physics.matterBody=this;var m=s(v,"body",null),x=s(v,"addToWorld",!0);if(m)this.setBody(m,x);else{var g=u.getCollisionGroup(),y=s(g,"objects",[]);y.length>0?this.setFromTileCollision(v):this.setFromTileRectangle(v)}if(u.flipX||u.flipY){var T={x:u.getCenterX(),y:u.getCenterY()},E=u.flipX?-1:1,P=u.flipY?-1:1;c.scale(m,E,P,T)}},setFromTileRectangle:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);var l=this.tile.getBounds(),u=l.x+l.width/2,v=l.y+l.height/2,m=d.rectangle(u,v,l.width,l.height,f);return this.setBody(m,f.addToWorld),this},setFromTileCollision:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);for(var l=this.tile.tilemapLayer.scaleX,u=this.tile.tilemapLayer.scaleY,v=this.tile.getLeft(),m=this.tile.getTop(),x=this.tile.getCollisionGroup(),g=s(x,"objects",[]),y=[],T=0;T1){var H=n(f);H.parts=y,this.setBody(c.create(H),H.addToWorld)}return this},setBody:function(f,l){return l===void 0&&(l=!0),this.body&&this.removeBody(),this.body=f,this.body.gameObject=this,l&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});p.exports=o},19496:(p,C,t)=>{/** + * @author Joachim Grill + * @author Richard Davey + * @copyright 2018 CodeAndWeb GmbH + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(22562),a=t(53402),r=t(95540),n=t(41598),e={parseBody:function(s,h,i,o){o===void 0&&(o={});for(var f=r(i,"fixtures",[]),l=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(22562),a={parseBody:function(r,n,e,s){s===void 0&&(s={});var h,i=e.vertices;if(i.length===1)s.vertices=i[0],h=c.create(s),d.flagCoincidentParts(h.parts);else{for(var o=[],f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(15647),c=t(83419),a=t(69351),r=t(48140),n=t(81388),e=t(1121),s=t(8214),h=t(46975),i=t(53614),o=t(26099),f=t(41598),l=new c({initialize:function(v,m,x){x===void 0&&(x={});var g={label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}};this.scene=v,this.world=m,this.camera=null,this.pointer=null,this.active=!0,this.position=new o,this.body=null,this.part=null,this.constraint=r.create(h(x,g)),this.world.on(e.BEFORE_UPDATE,this.update,this),v.sys.input.on(s.POINTER_DOWN,this.onDown,this),v.sys.input.on(s.POINTER_UP,this.onUp,this)},onDown:function(u){this.pointer||(this.pointer=u,this.camera=u.camera)},onUp:function(u){u===this.pointer&&(this.pointer=null)},getBody:function(u){var v=this.position,m=this.constraint;this.camera.getWorldPoint(u.x,u.y,v);for(var x=a.allBodies(this.world.localWorld),g=0;g1?1:0,y=g;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(22562),a=t(83419),r=t(53402),n=t(69351),e=t(48413),s=t(50792),h=t(1121),i=t(95540),o=t(35154),f=t(22562),l=t(35810),u=t(73834),v=t(4372),m=t(31725),x=new a({Extends:s,initialize:function(y,T){s.call(this),this.scene=y,this.engine=e.create(T),this.localWorld=this.engine.world;var E=o(T,"gravity",null);E?this.setGravity(E.x,E.y,E.scale):E===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=o(T,"enabled",!0),this.getDelta=o(T,"getDelta",this.update60Hz);var P=i(T,"runner",{}),R=i(P,"fps",!1),M=i(P,"fps",60),L=i(P,"delta",1e3/M),O=i(P,"deltaMin",1e3/M),D=i(P,"deltaMax",1e3/(M*.5));R||(M=1e3/L),this.runner={fps:M,deltaSampleSize:i(P,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:i(P,"isFixed",!1),delta:L,deltaMin:O,deltaMax:D},this.autoUpdate=o(T,"autoUpdate",!0);var I=o(T,"debug",!1);if(this.drawDebug=typeof I=="object"?!0:I,this.debugGraphic,this.debugConfig={showAxes:i(I,"showAxes",!1),showAngleIndicator:i(I,"showAngleIndicator",!1),angleColor:i(I,"angleColor",15208787),showBroadphase:i(I,"showBroadphase",!1),broadphaseColor:i(I,"broadphaseColor",16757760),showBounds:i(I,"showBounds",!1),boundsColor:i(I,"boundsColor",16777215),showVelocity:i(I,"showVelocity",!1),velocityColor:i(I,"velocityColor",44783),showCollisions:i(I,"showCollisions",!1),collisionColor:i(I,"collisionColor",16094476),showSeparations:i(I,"showSeparations",!1),separationColor:i(I,"separationColor",16753920),showBody:i(I,"showBody",!0),showStaticBody:i(I,"showStaticBody",!0),showInternalEdges:i(I,"showInternalEdges",!1),renderFill:i(I,"renderFill",!1),renderLine:i(I,"renderLine",!0),fillColor:i(I,"fillColor",1075465),fillOpacity:i(I,"fillOpacity",1),lineColor:i(I,"lineColor",2678297),lineOpacity:i(I,"lineOpacity",1),lineThickness:i(I,"lineThickness",1),staticFillColor:i(I,"staticFillColor",857979),staticLineColor:i(I,"staticLineColor",1255396),showSleeping:i(I,"showSleeping",!1),staticBodySleepOpacity:i(I,"staticBodySleepOpacity",.7),sleepFillColor:i(I,"sleepFillColor",4605510),sleepLineColor:i(I,"sleepLineColor",10066585),showSensors:i(I,"showSensors",!0),sensorFillColor:i(I,"sensorFillColor",857979),sensorLineColor:i(I,"sensorLineColor",1255396),showPositions:i(I,"showPositions",!0),positionSize:i(I,"positionSize",4),positionColor:i(I,"positionColor",14697178),showJoint:i(I,"showJoint",!0),jointColor:i(I,"jointColor",14737474),jointLineOpacity:i(I,"jointLineOpacity",1),jointLineThickness:i(I,"jointLineThickness",2),pinSize:i(I,"pinSize",4),pinColor:i(I,"pinColor",4382944),springColor:i(I,"springColor",14697184),anchorColor:i(I,"anchorColor",15724527),anchorSize:i(I,"anchorSize",4),showConvexHulls:i(I,"showConvexHulls",!1),hullColor:i(I,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),i(T,"setBounds",!1)){var V=T.setBounds;if(typeof V=="boolean")this.setBounds();else{var X=i(V,"x",0),H=i(V,"y",0),G=i(V,"width",y.sys.scale.width),U=i(V,"height",y.sys.scale.height),F=i(V,"thickness",64),B=i(V,"left",!0),N=i(V,"right",!0),z=i(V,"top",!0),Y=i(V,"bottom",!0);this.setBounds(X,H,G,U,F,B,N,z,Y)}}},setCompositeRenderStyle:function(g){var y=g.bodies,T=g.constraints,E=g.composites,P,R,M;for(P=0;P0&&(R=P[0].bodyA,M=P[0].bodyB),g.emit(h.COLLISION_START,E,R,M)}),l.on(y,"collisionActive",function(E){var P=E.pairs,R,M;P.length>0&&(R=P[0].bodyA,M=P[0].bodyB),g.emit(h.COLLISION_ACTIVE,E,R,M)}),l.on(y,"collisionEnd",function(E){var P=E.pairs,R,M;P.length>0&&(R=P[0].bodyA,M=P[0].bodyB),g.emit(h.COLLISION_END,E,R,M)})},setBounds:function(g,y,T,E,P,R,M,L,O){return g===void 0&&(g=0),y===void 0&&(y=0),T===void 0&&(T=this.scene.sys.scale.width),E===void 0&&(E=this.scene.sys.scale.height),P===void 0&&(P=64),R===void 0&&(R=!0),M===void 0&&(M=!0),L===void 0&&(L=!0),O===void 0&&(O=!0),this.updateWall(R,"left",g-P,y-P,P,E+P*2),this.updateWall(M,"right",g+T,y-P,P,E+P*2),this.updateWall(L,"top",g,y-P,T,P),this.updateWall(O,"bottom",g,y+E,T,P),this},updateWall:function(g,y,T,E,P,R){var M=this.walls[y];g?(M&&v.remove(this.localWorld,M),T+=P/2,E+=R/2,this.walls[y]=this.create(T,E,P,R,{isStatic:!0,friction:0,frictionStatic:0})):(M&&v.remove(this.localWorld,M),this.walls[y]=null)},createDebugGraphic:function(){var g=this.scene.sys.add.graphics({x:0,y:0});return g.setDepth(Number.MAX_VALUE),this.debugGraphic=g,this.drawDebug=!0,g},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(g,y,T){return g===void 0&&(g=0),y===void 0&&(y=1),T===void 0&&(T=.001),this.localWorld.gravity.x=g,this.localWorld.gravity.y=y,this.localWorld.gravity.scale=T,this},create:function(g,y,T,E,P){var R=d.rectangle(g,y,T,E,P);return v.add(this.localWorld,R),R},add:function(g){return v.add(this.localWorld,g),this},remove:function(g,y){Array.isArray(g)||(g=[g]);for(var T=0;TE.deltaMax?E.deltaMax:y,E.delta=y),E.timeScalePrev=P.timeScale,E.frameCounter+=1,g-E.counterTimestamp>=1e3&&(E.fps=E.frameCounter*((g-E.counterTimestamp)/1e3),E.counterTimestamp=g,E.frameCounter=0),e.update(T,y)}},step:function(g){e.update(this.engine,g)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(g){var y=g.hasOwnProperty("body")?g.body:g;return n.get(this.localWorld,y.id,y.type)!==null},getAllBodies:function(){return n.allBodies(this.localWorld)},getAllConstraints:function(){return n.allConstraints(this.localWorld)},getAllComposites:function(){return n.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var g=this.debugConfig,y=this.engine,T=this.debugGraphic,E=n.allBodies(this.localWorld);this.debugGraphic.clear(),g.showBroadphase&&y.broadphase.controller&&this.renderGrid(y.broadphase,T,g.broadphaseColor,.5),g.showBounds&&this.renderBodyBounds(E,T,g.boundsColor,.5),(g.showBody||g.showStaticBody)&&this.renderBodies(E),g.showJoint&&this.renderJoints(),(g.showAxes||g.showAngleIndicator)&&this.renderBodyAxes(E,T,g.showAxes,g.angleColor,.5),g.showVelocity&&this.renderBodyVelocity(E,T,g.velocityColor,1,2),g.showSeparations&&this.renderSeparations(y.pairs.list,T,g.separationColor),g.showCollisions&&this.renderCollisions(y.pairs.list,T,g.collisionColor)}},renderGrid:function(g,y,T,E){y.lineStyle(1,T,E);for(var P=r.keys(g.buckets),R=0;R0){var I=D[0].vertex.x,V=D[0].vertex.y;D.length===2&&(I=(D[0].vertex.x+D[1].vertex.x)/2,V=(D[0].vertex.y+D[1].vertex.y)/2),O.bodyB===O.supports[0].body||O.bodyA.isStatic?y.lineBetween(I-O.normal.x*8,V-O.normal.y*8,I,V):y.lineBetween(I+O.normal.x*8,V+O.normal.y*8,I,V)}}return this},renderBodyBounds:function(g,y,T,E){y.lineStyle(1,T,E);for(var P=0;P1?1:0;O1?1:0;D1?1:0;D1&&this.renderConvexHull(U,y,H,N)}}},renderBody:function(g,y,T,E,P,R,M,L){E===void 0&&(E=null),P===void 0&&(P=null),R===void 0&&(R=1),M===void 0&&(M=null),L===void 0&&(L=null);for(var O=this.debugConfig,D=O.sensorFillColor,I=O.sensorLineColor,V=g.parts,X=V.length,H=X>1?1:0;H1){var M=g.vertices;y.lineStyle(E,T),y.beginPath(),y.moveTo(M[0].x,M[0].y);for(var L=1;L0&&(y.fillStyle(M),y.fillCircle(V.x,V.y,L),y.fillCircle(X.x,X.y,L)),this},resetCollisionIDs:function(){return c._nextCollidingGroupId=1,c._nextNonCollidingGroupId=-1,c._nextCategory=1,this},shutdown:function(){l.off(this.engine),this.removeAllListeners(),v.clear(this.localWorld,!1),e.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});p.exports=x},70410:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setBounce:function(t){return this.body.restitution=t,this}};p.exports=C},66968:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var d=0;if(!Array.isArray(t))d=t;else for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22562),c={applyForce:function(a){return this._tempVec2.set(this.body.position.x,this.body.position.y),d.applyForce(this.body,this._tempVec2,a),this},applyForceFrom:function(a,r){return d.applyForce(this.body,a,r),this},thrust:function(a){var r=this.body.angle;return this._tempVec2.set(a*Math.cos(r),a*Math.sin(r)),d.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(a){var r=this.body.angle-Math.PI/2;return this._tempVec2.set(a*Math.cos(r),a*Math.sin(r)),d.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(a){var r=this.body.angle+Math.PI/2;return this._tempVec2.set(a*Math.cos(r),a*Math.sin(r)),d.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(a){var r=this.body.angle-Math.PI;return this._tempVec2.set(a*Math.cos(r),a*Math.sin(r)),d.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};p.exports=c},5436:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setFriction:function(t,d,c){return this.body.friction=t,d!==void 0&&(this.body.frictionAir=d),c!==void 0&&(this.body.frictionStatic=c),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};p.exports=C},39858:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}};p.exports=C},37302:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22562),c=t(26099),a={setMass:function(r){return d.setMass(this.body,r),this},setDensity:function(r){return d.setDensity(this.body,r),this},centerOfMass:{get:function(){return new c(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};p.exports=a},39132:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}};p.exports=C},57772:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(66280),c=t(22562),a=t(43855),r=t(95540),n=t(19496),e=t(85791),s=t(41598),h={setRectangle:function(i,o,f){return this.setBody({type:"rectangle",width:i,height:o},f)},setCircle:function(i,o){return this.setBody({type:"circle",radius:i},o)},setPolygon:function(i,o,f){return this.setBody({type:"polygon",sides:o,radius:i},f)},setTrapezoid:function(i,o,f,l){return this.setBody({type:"trapezoid",width:i,height:o,slope:f},l)},setExistingBody:function(i,o){o===void 0&&(o=!0),this.body&&this.world.remove(this.body,!0),this.body=i;for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(1121),c=t(53614),a=t(35810),r={setToSleep:function(){return c.set(this.body,!0),this},setAwake:function(){return c.set(this.body,!1),this},setSleepThreshold:function(n){return n===void 0&&(n=60),this.body.sleepThreshold=n,this},setSleepEvents:function(n,e){return this.setSleepStartEvent(n),this.setSleepEndEvent(e),this},setSleepStartEvent:function(n){if(n){var e=this.world;a.on(this.body,"sleepStart",function(s){e.emit(d.SLEEP_START,s,this)})}else a.off(this.body,"sleepStart");return this},setSleepEndEvent:function(n){if(n){var e=this.world;a.on(this.body,"sleepEnd",function(s){e.emit(d.SLEEP_END,s,this)})}else a.off(this.body,"sleepEnd");return this}};p.exports=r},90556:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22562),c={setStatic:function(a){return d.setStatic(this.body,a),this},isStatic:function(){return this.body.isStatic}};p.exports=c},85436:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22562),c=t(36383),a=t(86554),r=t(30954),n=4,e={x:{get:function(){return this.body.position.x},set:function(s){this._tempVec2.set(s,this.y),d.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(s){this._tempVec2.set(this.x,s),d.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(s){var h=1/this._scaleX,i=1/this._scaleY;this._scaleX=s,this._scaleX===0?this.renderFlags&=~n:this.renderFlags|=n,d.scale(this.body,h,i),d.scale(this.body,s,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(s){var h=1/this._scaleX,i=1/this._scaleY;this._scaleY=s,this._scaleY===0?this.renderFlags&=~n:this.renderFlags|=n,d.scale(this.body,h,i),d.scale(this.body,this._scaleX,s)}},angle:{get:function(){return r(this.body.angle*c.RAD_TO_DEG)},set:function(s){this.rotation=r(s)*c.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(s){this._rotation=a(s),d.setAngle(this.body,this._rotation)}},setPosition:function(s,h){return s===void 0&&(s=0),h===void 0&&(h=s),this._tempVec2.set(s,h),d.setPosition(this.body,this._tempVec2),this},setRotation:function(s){return s===void 0&&(s=0),this._rotation=a(s),d.setAngle(this.body,s),this},setFixedRotation:function(){return d.setInertia(this.body,1/0),this},setAngle:function(s){return s===void 0&&(s=0),this.angle=s,d.setAngle(this.body,this.rotation),this},setScale:function(s,h,i){s===void 0&&(s=1),h===void 0&&(h=s);var o=1/this._scaleX,f=1/this._scaleY;return this._scaleX=s,this._scaleY=h,d.scale(this.body,o,f,i),d.scale(this.body,s,h,i),this}};p.exports=e},42081:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(22562),c={setVelocityX:function(a){return this._tempVec2.set(a,this.body.velocity.y),d.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(a){return this._tempVec2.set(this.body.velocity.x,a),d.setVelocity(this.body,this._tempVec2),this},setVelocity:function(a,r){return this._tempVec2.set(a,r),d.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return d.getVelocity(this.body)},setAngularVelocity:function(a){return d.setAngularVelocity(this.body,a),this},getAngularVelocity:function(){return d.getAngularVelocity(this.body)},setAngularSpeed:function(a){return d.setAngularSpeed(this.body,a),this},getAngularSpeed:function(){return d.getAngularSpeed(this.body)}};p.exports=c},31884:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Bounce:t(70410),Collision:t(66968),Force:t(51607),Friction:t(5436),Gravity:t(39858),Mass:t(37302),Sensor:t(39132),SetBody:t(57772),Sleep:t(38083),Static:t(90556),Transform:t(85436),Velocity:t(42081)}},85608:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="afteradd"},1213:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="afterremove"},25968:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="afterupdate"},67205:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="beforeadd"},39438:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="beforeremove"},44823:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="beforeupdate"},92593:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="collisionactive"},60128:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="collisionend"},76861:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="collisionstart"},92362:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragend"},76408:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="drag"},93971:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="dragstart"},5656:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},47861:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},79099:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="sleepend"},35906:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="sleepstart"},1121:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AFTER_ADD:t(85608),AFTER_REMOVE:t(1213),AFTER_UPDATE:t(25968),BEFORE_ADD:t(67205),BEFORE_REMOVE:t(39438),BEFORE_UPDATE:t(44823),COLLISION_ACTIVE:t(92593),COLLISION_END:t(60128),COLLISION_START:t(76861),DRAG_END:t(92362),DRAG:t(76408),DRAG_START:t(93971),PAUSE:t(5656),RESUME:t(47861),SLEEP_END:t(79099),SLEEP_START:t(35906)}},3875:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BodyBounds:t(68174),Components:t(31884),Events:t(1121),Factory:t(28137),MatterGameObject:t(75803),Image:t(23181),Matter:t(19933),MatterPhysics:t(42045),PolyDecomp:t(55973),Sprite:t(34803),TileBody:t(73834),PhysicsEditorParser:t(19496),PhysicsJSONParser:t(85791),PointerConstraint:t(98713),World:t(68243)}},22562:(p,C,t)=>{var d={};p.exports=d;var c=t(41598),a=t(31725),r=t(53614),n=t(53402),e=t(15647),s=t(66615);(function(){d._timeCorrection=!0,d._inertiaScale=4,d._nextCollidingGroupId=1,d._nextNonCollidingGroupId=-1,d._nextCategory=1,d._baseDelta=16.666666666666668,d.create=function(i){var o={id:n.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,deltaTime:16.666666666666668,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!i.hasOwnProperty("position")&&i.hasOwnProperty("vertices")?i.position=c.centre(i.vertices):i.hasOwnProperty("vertices")||(o.vertices=c.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var f=n.extend(o,i);return h(f,i),f.setOnCollideWith=function(l,u){return u?this.onCollideWith[l.id]=u:delete this.onCollideWith[l.id],this},f},d.nextGroup=function(i){return i?d._nextNonCollidingGroupId--:d._nextCollidingGroupId++},d.nextCategory=function(){return d._nextCategory=d._nextCategory<<1,d._nextCategory};var h=function(i,o){if(o=o||{},d.set(i,{bounds:i.bounds||e.create(i.vertices),positionPrev:i.positionPrev||a.clone(i.position),anglePrev:i.anglePrev||i.angle,vertices:i.vertices,parts:i.parts||[i],isStatic:i.isStatic,isSleeping:i.isSleeping,parent:i.parent||i}),c.rotate(i.vertices,i.angle,i.position),s.rotate(i.axes,i.angle),e.update(i.bounds,i.vertices,i.velocity),d.set(i,{axes:o.axes||i.axes,area:o.area||i.area,mass:o.mass||i.mass,inertia:o.inertia||i.inertia}),i.parts.length===1){var f=i.bounds,l=i.centerOfMass,u=i.centerOffset,v=f.max.x-f.min.x,m=f.max.y-f.min.y;l.x=-(f.min.x-i.position.x)/v,l.y=-(f.min.y-i.position.y)/m,u.x=v*l.x,u.y=m*l.y}};d.set=function(i,o,f){var l;typeof o=="string"&&(l=o,o={},o[l]=f);for(l in o)if(Object.prototype.hasOwnProperty.call(o,l))switch(f=o[l],l){case"isStatic":d.setStatic(i,f);break;case"isSleeping":r.set(i,f);break;case"mass":d.setMass(i,f);break;case"density":d.setDensity(i,f);break;case"inertia":d.setInertia(i,f);break;case"vertices":d.setVertices(i,f);break;case"position":d.setPosition(i,f);break;case"angle":d.setAngle(i,f);break;case"velocity":d.setVelocity(i,f);break;case"angularVelocity":d.setAngularVelocity(i,f);break;case"speed":d.setSpeed(i,f);break;case"angularSpeed":d.setAngularSpeed(i,f);break;case"parts":d.setParts(i,f);break;case"centre":d.setCentre(i,f);break;default:i[l]=f}},d.setStatic=function(i,o){for(var f=0;f0&&a.rotateAbout(v.position,l,i.position,v.position)}},d.setVelocity=function(i,o){var f=i.deltaTime/d._baseDelta;i.positionPrev.x=i.position.x-o.x*f,i.positionPrev.y=i.position.y-o.y*f,i.velocity.x=(i.position.x-i.positionPrev.x)/f,i.velocity.y=(i.position.y-i.positionPrev.y)/f,i.speed=a.magnitude(i.velocity)},d.getVelocity=function(i){var o=d._baseDelta/i.deltaTime;return{x:(i.position.x-i.positionPrev.x)*o,y:(i.position.y-i.positionPrev.y)*o}},d.getSpeed=function(i){return a.magnitude(d.getVelocity(i))},d.setSpeed=function(i,o){d.setVelocity(i,a.mult(a.normalise(d.getVelocity(i)),o))},d.setAngularVelocity=function(i,o){var f=i.deltaTime/d._baseDelta;i.anglePrev=i.angle-o*f,i.angularVelocity=(i.angle-i.anglePrev)/f,i.angularSpeed=Math.abs(i.angularVelocity)},d.getAngularVelocity=function(i){return(i.angle-i.anglePrev)*d._baseDelta/i.deltaTime},d.getAngularSpeed=function(i){return Math.abs(d.getAngularVelocity(i))},d.setAngularSpeed=function(i,o){d.setAngularVelocity(i,n.sign(d.getAngularVelocity(i))*o)},d.translate=function(i,o,f){d.setPosition(i,a.add(i.position,o),f)},d.rotate=function(i,o,f,l){if(!f)d.setAngle(i,i.angle+o,l);else{var u=Math.cos(o),v=Math.sin(o),m=i.position.x-f.x,x=i.position.y-f.y;d.setPosition(i,{x:f.x+(m*u-x*v),y:f.y+(m*v+x*u)},l),d.setAngle(i,i.angle+o,l)}},d.scale=function(i,o,f,l){var u=0,v=0;l=l||i.position;for(var m=i.inertia===1/0,x=0;x0&&(u+=g.area,v+=g.inertia),g.position.x=l.x+(g.position.x-l.x)*o,g.position.y=l.y+(g.position.y-l.y)*f,e.update(g.bounds,g.vertices,i.velocity)}i.parts.length>1&&(i.area=u,i.isStatic||(d.setMass(i,i.density*u),d.setInertia(i,v))),i.circleRadius&&(o===f?i.circleRadius*=o:i.circleRadius=null),m&&d.setInertia(i,1/0)},d.update=function(i,o){o=(typeof o<"u"?o:16.666666666666668)*i.timeScale;var f=o*o,l=d._timeCorrection?o/(i.deltaTime||o):1,u=1-i.frictionAir*(o/n._baseDelta),v=(i.position.x-i.positionPrev.x)*l,m=(i.position.y-i.positionPrev.y)*l;i.velocity.x=v*u+i.force.x/i.mass*f,i.velocity.y=m*u+i.force.y/i.mass*f,i.positionPrev.x=i.position.x,i.positionPrev.y=i.position.y,i.position.x+=i.velocity.x,i.position.y+=i.velocity.y,i.deltaTime=o,i.angularVelocity=(i.angle-i.anglePrev)*u*l+i.torque/i.inertia*f,i.anglePrev=i.angle,i.angle+=i.angularVelocity,i.speed=a.magnitude(i.velocity),i.angularSpeed=Math.abs(i.angularVelocity);for(var x=0;x0&&(g.position.x+=i.velocity.x,g.position.y+=i.velocity.y),i.angularVelocity!==0&&(c.rotate(g.vertices,i.angularVelocity,i.position),s.rotate(g.axes,i.angularVelocity),x>0&&a.rotateAbout(g.position,i.angularVelocity,i.position,g.position)),e.update(g.bounds,g.vertices,i.velocity)}},d.updateVelocities=function(i){var o=d._baseDelta/i.deltaTime,f=i.velocity;f.x=(i.position.x-i.positionPrev.x)*o,f.y=(i.position.y-i.positionPrev.y)*o,i.speed=Math.sqrt(f.x*f.x+f.y*f.y),i.angularVelocity=(i.angle-i.anglePrev)*o,i.angularSpeed=Math.abs(i.angularVelocity)},d.applyForce=function(i,o,f){var l={x:o.x-i.position.x,y:o.y-i.position.y};i.force.x+=f.x,i.force.y+=f.y,i.torque+=l.x*f.y-l.y*f.x},d._totalProperties=function(i){for(var o={mass:0,area:0,inertia:0,centre:{x:0,y:0}},f=i.parts.length===1?0:1;f{var d={};p.exports=d;var c=t(35810),a=t(53402),r=t(15647),n=t(22562);(function(){d.create=function(e){return a.extend({id:a.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},e)},d.setModified=function(e,s,h,i){if(c.trigger(e,"compositeModified",e),e.isModified=s,s&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),h&&e.parent&&d.setModified(e.parent,s,h,i),i)for(var o=0;o{var d={};p.exports=d;var c=t(69351);(function(){d.create=c.create,d.add=c.add,d.remove=c.remove,d.clear=c.clear,d.addComposite=c.addComposite,d.addBody=c.addBody,d.addConstraint=c.addConstraint})()},52284:(p,C,t)=>{var d={};p.exports=d;var c=t(41598),a=t(4506);(function(){var r=[],n={overlap:0,axis:null},e={overlap:0,axis:null};d.create=function(s,h){return{pair:null,collided:!1,bodyA:s,bodyB:h,parentA:s.parent,parentB:h.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},d.collides=function(s,h,i){if(d._overlapAxes(n,s.vertices,h.vertices,s.axes),n.overlap<=0||(d._overlapAxes(e,h.vertices,s.vertices,h.axes),e.overlap<=0))return null;var o=i&&i.table[a.id(s,h)],f;o?f=o.collision:(f=d.create(s,h),f.collided=!0,f.bodyA=s.idG?G=M:MU?U=M:Mf?f=u:u{var C={};p.exports=C,function(){C.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}}()},81388:(p,C,t)=>{var d={};p.exports=d;var c=t(53402),a=t(52284);(function(){d.create=function(r){var n={bodies:[],pairs:null};return c.extend(n,r)},d.setBodies=function(r,n){r.bodies=n.slice(0)},d.clear=function(r){r.bodies=[]},d.collisions=function(r){var n=[],e=r.pairs,s=r.bodies,h=s.length,i=d.canCollide,o=a.collides,f,l;for(s.sort(d._compareBoundsX),f=0;fm)break;if(!(xR.max.y)&&!(y&&(P.isStatic||P.isSleeping))&&i(u.collisionFilter,P.collisionFilter)){var M=P.parts.length;if(E&&M===1){var L=o(u,P,e);L&&n.push(L)}else for(var O=T>1?1:0,D=M>1?1:0,I=O;IR.max.x||v.max.xR.max.y)){var L=o(V,H,e);L&&n.push(L)}}}}}return n},d.canCollide=function(r,n){return r.group===n.group&&r.group!==0?r.group>0:(r.mask&n.category)!==0&&(n.mask&r.category)!==0},d._compareBoundsX=function(r,n){return r.bounds.min.x-n.bounds.min.x}})()},4506:(p,C,t)=>{var d={};p.exports=d;var c=t(43424);(function(){d.create=function(a,r){var n=a.bodyA,e=a.bodyB,s={id:d.id(n,e),bodyA:n,bodyB:e,collision:a,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||e.isSensor,timeCreated:r,timeUpdated:r,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return d.update(s,a,r),s},d.update=function(a,r,n){var e=a.contacts,s=r.supports,h=a.activeContacts,i=r.parentA,o=r.parentB,f=i.vertices.length;a.isActive=!0,a.timeUpdated=n,a.collision=r,a.separation=r.depth,a.inverseMass=i.inverseMass+o.inverseMass,a.friction=i.frictiono.frictionStatic?i.frictionStatic:o.frictionStatic,a.restitution=i.restitution>o.restitution?i.restitution:o.restitution,a.slop=i.slop>o.slop?i.slop:o.slop,r.pair=a,h.length=0;for(var l=0;l{var d={};p.exports=d;var c=t(4506),a=t(53402);(function(){d.create=function(r){return a.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},r)},d.update=function(r,n,e){var s=r.list,h=s.length,i=r.table,o=n.length,f=r.collisionStart,l=r.collisionEnd,u=r.collisionActive,v,m,x,g;for(f.length=0,l.length=0,u.length=0,g=0;g{var d={};p.exports=d;var c=t(31725),a=t(52284),r=t(15647),n=t(66280),e=t(41598);(function(){d.collides=function(s,h){for(var i=[],o=h.length,f=s.bounds,l=a.collides,u=r.overlaps,v=0;v{var d={};p.exports=d;var c=t(41598),a=t(53402),r=t(15647);(function(){d._restingThresh=2,d._restingThreshTangent=Math.sqrt(6),d._positionDampen=.9,d._positionWarming=.8,d._frictionNormalMultiplier=5,d._frictionMaxStatic=Number.MAX_VALUE,d.preSolvePosition=function(n){var e,s,h,i=n.length;for(e=0;ett?(x=nt>0?nt:-nt,m=T.friction*(nt>0?1:-1)*i,m<-x?m=-x:m>x&&(m=x)):(m=nt,x=u);var st=z*D-Y*O,it=K*D-Z*O,ot=G/(U+P.inverseInertia*st*st+R.inverseInertia*it*it),ht=(1+T.restitution)*et*ot;if(m*=ot,et0&&(B.normalImpulse=0),ht=B.normalImpulse-xt}if(nt<-f||nt>f)B.tangentImpulse=0;else{var mt=B.tangentImpulse;B.tangentImpulse+=m,B.tangentImpulse<-x&&(B.tangentImpulse=-x),B.tangentImpulse>x&&(B.tangentImpulse=x),m=B.tangentImpulse-mt}var ft=O*ht+I*m,lt=D*ht+V*m;P.isStatic||P.isSleeping||(P.positionPrev.x+=ft*P.inverseMass,P.positionPrev.y+=lt*P.inverseMass,P.anglePrev+=(z*lt-Y*ft)*P.inverseInertia),R.isStatic||R.isSleeping||(R.positionPrev.x-=ft*R.inverseMass,R.positionPrev.y-=lt*R.inverseMass,R.anglePrev-=(K*lt-Z*ft)*R.inverseInertia)}}}}})()},48140:(p,C,t)=>{var d={};p.exports=d;var c=t(41598),a=t(31725),r=t(53614),n=t(15647),e=t(66615),s=t(53402);(function(){d._warming=.4,d._torqueDampen=1,d._minLength=1e-6,d.create=function(h){var i=h;i.bodyA&&!i.pointA&&(i.pointA={x:0,y:0}),i.bodyB&&!i.pointB&&(i.pointB={x:0,y:0});var o=i.bodyA?a.add(i.bodyA.position,i.pointA):i.pointA,f=i.bodyB?a.add(i.bodyB.position,i.pointB):i.pointB,l=a.magnitude(a.sub(o,f));i.length=typeof i.length<"u"?i.length:l,i.id=i.id||s.nextId(),i.label=i.label||"Constraint",i.type="constraint",i.stiffness=i.stiffness||(i.length>0?1:.7),i.damping=i.damping||0,i.angularStiffness=i.angularStiffness||0,i.angleA=i.bodyA?i.bodyA.angle:i.angleA,i.angleB=i.bodyB?i.bodyB.angle:i.angleB,i.plugin={};var u={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return i.length===0&&i.stiffness>.1?(u.type="pin",u.anchors=!1):i.stiffness<.9&&(u.type="spring"),i.render=s.extend(u,i.render),i},d.preSolveAll=function(h){for(var i=0;i=1||h.length===0,E=T?h.stiffness*i:h.stiffness*i*i,P=h.damping*i,R=a.mult(x,y*E),M=(o?o.inverseMass:0)+(f?f.inverseMass:0),L=(o?o.inverseInertia:0)+(f?f.inverseInertia:0),O=M+L,D,I,V,X,H;if(P>0){var G=a.create();V=a.div(x,g),H=a.sub(f&&a.sub(f.position,f.positionPrev)||G,o&&a.sub(o.position,o.positionPrev)||G),X=a.dot(V,H)}o&&!o.isStatic&&(I=o.inverseMass/M,o.constraintImpulse.x-=R.x*I,o.constraintImpulse.y-=R.y*I,o.position.x-=R.x*I,o.position.y-=R.y*I,P>0&&(o.positionPrev.x-=P*V.x*X*I,o.positionPrev.y-=P*V.y*X*I),D=a.cross(l,R)/O*d._torqueDampen*o.inverseInertia*(1-h.angularStiffness),o.constraintImpulse.angle-=D,o.angle-=D),f&&!f.isStatic&&(I=f.inverseMass/M,f.constraintImpulse.x+=R.x*I,f.constraintImpulse.y+=R.y*I,f.position.x+=R.x*I,f.position.y+=R.y*I,P>0&&(f.positionPrev.x+=P*V.x*X*I,f.positionPrev.y+=P*V.y*X*I),D=a.cross(u,R)/O*d._torqueDampen*f.inverseInertia*(1-h.angularStiffness),f.constraintImpulse.angle+=D,f.angle+=D)}}},d.postSolveAll=function(h){for(var i=0;i0&&(u.position.x+=f.x,u.position.y+=f.y),f.angle!==0&&(c.rotate(u.vertices,f.angle,o.position),e.rotate(u.axes,f.angle),l>0&&a.rotateAbout(u.position,f.angle,o.position,u.position)),n.update(u.bounds,u.vertices,o.velocity)}f.angle*=d._warming,f.x*=d._warming,f.y*=d._warming}}},d.pointAWorld=function(h){return{x:(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),y:(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0)}},d.pointBWorld=function(h){return{x:(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),y:(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0)}},d.currentLength=function(h){var i=(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),o=(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0),f=(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),l=(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0),u=i-f,v=o-l;return Math.sqrt(u*u+v*v)}})()},53402:(p,C,t)=>{var d={};p.exports=d,function(){d._baseDelta=16.666666666666668,d._nextId=0,d._seed=0,d._nowStartTime=+new Date,d._warnedOnce={},d._decomp=null,d.extend=function(a,r){var n,e;typeof r=="boolean"?(n=2,e=r):(n=1,e=!0);for(var s=n;s0;r--){var n=Math.floor(d.random()*(r+1)),e=a[r];a[r]=a[n],a[n]=e}return a},d.choose=function(a){return a[Math.floor(d.random()*a.length)]},d.isElement=function(a){return typeof HTMLElement<"u"?a instanceof HTMLElement:!!(a&&a.nodeType&&a.nodeName)},d.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"},d.isFunction=function(a){return typeof a=="function"},d.isPlainObject=function(a){return typeof a=="object"&&a.constructor===Object},d.isString=function(a){return toString.call(a)==="[object String]"},d.clamp=function(a,r,n){return an?n:a},d.sign=function(a){return a<0?-1:1},d.now=function(){if(typeof window<"u"&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-d._nowStartTime},d.random=function(a,r){return a=typeof a<"u"?a:0,r=typeof r<"u"?r:1,a+c()*(r-a)};var c=function(){return d._seed=(d._seed*9301+49297)%233280,d._seed/233280};d.colorToNumber=function(a){return a=a.replace("#",""),a.length==3&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)),parseInt(a,16)},d.logLevel=1,d.log=function(){console&&d.logLevel>0&&d.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},d.info=function(){console&&d.logLevel>0&&d.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},d.warn=function(){console&&d.logLevel>0&&d.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},d.warnOnce=function(){var a=Array.prototype.slice.call(arguments).join(" ");d._warnedOnce[a]||(d.warn(a),d._warnedOnce[a]=!0)},d.deprecated=function(a,r,n){a[r]=d.chain(function(){d.warnOnce("🔅 deprecated 🔅",n)},a[r])},d.nextId=function(){return d._nextId++},d.indexOf=function(a,r){if(a.indexOf)return a.indexOf(r);for(var n=0;n{var d={};p.exports=d;var c=t(53614),a=t(66272),r=t(81388),n=t(99561),e=t(35810),s=t(69351),h=t(48140),i=t(53402),o=t(22562);(function(){d.create=function(f){f=f||{};var l={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},u=i.extend(l,f);return u.world=f.world||s.create({label:"World"}),u.pairs=f.pairs||n.create(),u.detector=f.detector||r.create(),u.grid={buckets:[]},u.world.gravity=u.gravity,u.broadphase=u.grid,u.metrics={},u},d.update=function(f,l){var u=i.now(),v=f.world,m=f.detector,x=f.pairs,g=f.timing,y=g.timestamp,T;l=typeof l<"u"?l:i._baseDelta,l*=g.timeScale,g.timestamp+=l,g.lastDelta=l;var E={timestamp:g.timestamp,delta:l};e.trigger(f,"beforeUpdate",E);var P=s.allBodies(v),R=s.allConstraints(v);for(v.isModified&&(r.setBodies(m,P),s.setModified(v,!1,!1,!0)),f.enableSleeping&&c.update(P,l),d._bodiesApplyGravity(P,f.gravity),l>0&&d._bodiesUpdate(P,l),e.trigger(f,"beforeSolve",E),h.preSolveAll(P),T=0;T0&&e.trigger(f,"collisionStart",{pairs:x.collisionStart,timestamp:g.timestamp,delta:l});var L=i.clamp(20/f.positionIterations,0,1);for(a.preSolvePosition(x.list),T=0;T0&&e.trigger(f,"collisionActive",{pairs:x.collisionActive,timestamp:g.timestamp,delta:l}),x.collisionEnd.length>0&&e.trigger(f,"collisionEnd",{pairs:x.collisionEnd,timestamp:g.timestamp,delta:l}),d._bodiesClearForces(P),e.trigger(f,"afterUpdate",E),f.timing.lastElapsed=i.now()-u,f},d.merge=function(f,l){if(i.extend(f,l),l.world){f.world=l.world,d.clear(f);for(var u=s.allBodies(f.world),v=0;v{var d={};p.exports=d;var c=t(53402);(function(){d.on=function(a,r,n){for(var e=r.split(" "),s,h=0;h0){n||(n={}),e=r.split(" ");for(var f=0;f{var d={};p.exports=d;var c=t(73832),a=t(53402);(function(){d.name="matter-js",d.version="0.19.0",d.uses=[],d.used=[],d.use=function(){c.use(d,Array.prototype.slice.call(arguments))},d.before=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathBefore(d,r,n)},d.after=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathAfter(d,r,n)}})()},73832:(p,C,t)=>{var d={};p.exports=d;var c=t(53402);(function(){d._registry={},d.register=function(a){if(d.isPlugin(a)||c.warn("Plugin.register:",d.toString(a),"does not implement all required fields."),a.name in d._registry){var r=d._registry[a.name],n=d.versionParse(a.version).number,e=d.versionParse(r.version).number;n>e?(c.warn("Plugin.register:",d.toString(r),"was upgraded to",d.toString(a)),d._registry[a.name]=a):n-1},d.isFor=function(a,r){var n=a.for&&d.dependencyParse(a.for);return!a.for||r.name===n.name&&d.versionSatisfies(r.version,n.range)},d.use=function(a,r){if(a.uses=(a.uses||[]).concat(r||[]),a.uses.length===0){c.warn("Plugin.use:",d.toString(a),"does not specify any dependencies to install.");return}for(var n=d.dependencies(a),e=c.topologicalSort(n),s=[],h=0;h0&&!i.silent&&c.info(s.join(" "))},d.dependencies=function(a,r){var n=d.dependencyParse(a),e=n.name;if(r=r||{},!(e in r)){a=d.resolve(a)||a,r[e]=c.map(a.uses||[],function(h){d.isPlugin(h)&&d.register(h);var i=d.dependencyParse(h),o=d.resolve(h);return o&&!d.versionSatisfies(o.version,i.range)?(c.warn("Plugin.dependencies:",d.toString(o),"does not satisfy",d.toString(i),"used by",d.toString(n)+"."),o._warned=!0,a._warned=!0):o||(c.warn("Plugin.dependencies:",d.toString(h),"used by",d.toString(n),"could not be resolved."),a._warned=!0),i.name});for(var s=0;s=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;r.test(a)||c.warn("Plugin.versionParse:",a,"is not a valid version or range.");var n=r.exec(a),e=Number(n[4]),s=Number(n[5]),h=Number(n[6]);return{isRange:!!(n[1]||n[2]),version:n[3],range:a,operator:n[1]||n[2]||"",major:e,minor:s,patch:h,parts:[e,s,h],prerelease:n[7],number:e*1e8+s*1e4+h}},d.versionSatisfies=function(a,r){r=r||"*";var n=d.versionParse(r),e=d.versionParse(a);if(n.isRange){if(n.operator==="*"||a==="*")return!0;if(n.operator===">")return e.number>n.number;if(n.operator===">=")return e.number>=n.number;if(n.operator==="~")return e.major===n.major&&e.minor===n.minor&&e.patch>=n.patch;if(n.operator==="^")return n.major>0?e.major===n.major&&e.number>=n.number:n.minor>0?e.minor===n.minor&&e.patch>=n.patch:e.patch===n.patch}return a===r||a==="*"}})()},53614:(p,C,t)=>{var d={};p.exports=d;var c=t(22562),a=t(35810),r=t(53402);(function(){d._motionWakeThreshold=.18,d._motionSleepThreshold=.08,d._minBias=.9,d.update=function(n,e){for(var s=e/r._baseDelta,h=d._motionSleepThreshold,i=0;i0&&o.motion=o.sleepThreshold/s&&d.set(o,!0)):o.sleepCounter>0&&(o.sleepCounter-=1)}},d.afterCollisions=function(n){for(var e=d._motionSleepThreshold,s=0;se&&d.set(l,!1)}}}},d.set=function(n,e){var s=n.isSleeping;e?(n.isSleeping=!0,n.sleepCounter=n.sleepThreshold,n.positionImpulse.x=0,n.positionImpulse.y=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.speed=0,n.angularSpeed=0,n.motion=0,s||a.trigger(n,"sleepStart")):(n.isSleeping=!1,n.sleepCounter=0,s&&a.trigger(n,"sleepEnd"))}})()},66280:(p,C,t)=>{var d={};p.exports=d;var c=t(41598),a=t(53402),r=t(22562),n=t(15647),e=t(31725);(function(){d.rectangle=function(s,h,i,o,f){f=f||{};var l={label:"Rectangle Body",position:{x:s,y:h},vertices:c.fromPath("L 0 0 L "+i+" 0 L "+i+" "+o+" L 0 "+o)};if(f.chamfer){var u=f.chamfer;l.vertices=c.chamfer(l.vertices,u.radius,u.quality,u.qualityMin,u.qualityMax),delete f.chamfer}return r.create(a.extend({},l,f))},d.trapezoid=function(s,h,i,o,f,l){l=l||{},f*=.5;var u=(1-f*2)*i,v=i*f,m=v+u,x=m+v,g;f<.5?g="L 0 0 L "+v+" "+-o+" L "+m+" "+-o+" L "+x+" 0":g="L 0 0 L "+m+" "+-o+" L "+x+" 0";var y={label:"Trapezoid Body",position:{x:s,y:h},vertices:c.fromPath(g)};if(l.chamfer){var T=l.chamfer;y.vertices=c.chamfer(y.vertices,T.radius,T.quality,T.qualityMin,T.qualityMax),delete l.chamfer}return r.create(a.extend({},y,l))},d.circle=function(s,h,i,o,f){o=o||{};var l={label:"Circle Body",circleRadius:i};f=f||25;var u=Math.ceil(Math.max(10,Math.min(f,i)));return u%2===1&&(u+=1),d.polygon(s,h,u,i,a.extend({},l,o))},d.polygon=function(s,h,i,o,f){if(f=f||{},i<3)return d.circle(s,h,o,f);for(var l=2*Math.PI/i,u="",v=l*.5,m=0;m0&&c.area(H)1?(g=r.create(a.extend({parts:y.slice(0)},o)),r.setPosition(g,{x:s,y:h}),g):y[0]},d.flagCoincidentParts=function(s,h){h===void 0&&(h=5);for(var i=0;i{var d={};p.exports=d;var c=t(69351),a=t(48140),r=t(53402),n=t(22562),e=t(66280);(function(){d.stack=function(s,h,i,o,f,l,u){for(var v=c.create({label:"Stack"}),m=s,x=h,g,y=0,T=0;TE&&(E=M),n.translate(R,{x:L*.5,y:M*.5}),m=R.bounds.max.x+f,c.addBody(v,R),g=R,y+=1}else m+=f}x+=E+l,m=s}return v},d.chain=function(s,h,i,o,f,l){for(var u=s.bodies,v=1;v0)for(v=0;v0&&(g=l[v-1+(u-1)*h],c.addConstraint(s,a.create(r.extend({bodyA:g,bodyB:x},f)))),o&&vE)){g=E-g;var R=g,M=i-1-g;if(!(xM)){T===1&&n.translate(y,{x:(x+(i%2===1?1:-1))*P,y:0});var L=y?x*P:0;return u(s+L+x*f,m,x,g,y,T)}}})},d.newtonsCradle=function(s,h,i,o,f){for(var l=c.create({label:"Newtons Cradle"}),u=0;u{var d={};p.exports=d;var c=t(31725),a=t(53402);(function(){d.fromVertices=function(r){for(var n={},e=0;e{var C={};p.exports=C,function(){C.create=function(t){var d={min:{x:0,y:0},max:{x:0,y:0}};return t&&C.update(d,t),d},C.update=function(t,d,c){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var a=0;at.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=c.x:t.min.x+=c.x,c.y>0?t.max.y+=c.y:t.min.y+=c.y)},C.contains=function(t,d){return d.x>=t.min.x&&d.x<=t.max.x&&d.y>=t.min.y&&d.y<=t.max.y},C.overlaps=function(t,d){return t.min.x<=d.max.x&&t.max.x>=d.min.x&&t.max.y>=d.min.y&&t.min.y<=d.max.y},C.translate=function(t,d){t.min.x+=d.x,t.max.x+=d.x,t.min.y+=d.y,t.max.y+=d.y},C.shift=function(t,d){var c=t.max.x-t.min.x,a=t.max.y-t.min.y;t.min.x=d.x,t.max.x=d.x+c,t.min.y=d.y,t.max.y=d.y+a}}()},74058:(p,C,t)=>{var d={};p.exports=d,t(15647);var c=t(53402);(function(){d.pathToVertices=function(a,r){typeof window<"u"&&!("SVGPathSeg"in window)&&c.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var n,e,s,h,i,o,f,l,u,v,m=[],x,g,y=0,T=0,E=0;r=r||15;var P=function(M,L,O){var D=O%2===1&&O>1;if(!u||M!=u.x||L!=u.y){u&&D?(x=u.x,g=u.y):(x=0,g=0);var I={x:x+M,y:g+L};(D||!u)&&(u=I),m.push(I),T=x+M,E=g+L}},R=function(M){var L=M.pathSegTypeAsLetter.toUpperCase();if(L!=="Z"){switch(L){case"M":case"L":case"T":case"C":case"S":case"Q":T=M.x,E=M.y;break;case"H":T=M.x;break;case"V":E=M.y;break}P(T,E,M.pathSegType)}};for(d._svgPathToAbsolute(a),s=a.getTotalLength(),o=[],n=0;n{var C={};p.exports=C,function(){C.create=function(t,d){return{x:t||0,y:d||0}},C.clone=function(t){return{x:t.x,y:t.y}},C.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},C.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},C.rotate=function(t,d,c){var a=Math.cos(d),r=Math.sin(d);c||(c={});var n=t.x*a-t.y*r;return c.y=t.x*r+t.y*a,c.x=n,c},C.rotateAbout=function(t,d,c,a){var r=Math.cos(d),n=Math.sin(d);a||(a={});var e=c.x+((t.x-c.x)*r-(t.y-c.y)*n);return a.y=c.y+((t.x-c.x)*n+(t.y-c.y)*r),a.x=e,a},C.normalise=function(t){var d=C.magnitude(t);return d===0?{x:0,y:0}:{x:t.x/d,y:t.y/d}},C.dot=function(t,d){return t.x*d.x+t.y*d.y},C.cross=function(t,d){return t.x*d.y-t.y*d.x},C.cross3=function(t,d,c){return(d.x-t.x)*(c.y-t.y)-(d.y-t.y)*(c.x-t.x)},C.add=function(t,d,c){return c||(c={}),c.x=t.x+d.x,c.y=t.y+d.y,c},C.sub=function(t,d,c){return c||(c={}),c.x=t.x-d.x,c.y=t.y-d.y,c},C.mult=function(t,d){return{x:t.x*d,y:t.y*d}},C.div=function(t,d){return{x:t.x/d,y:t.y/d}},C.perp=function(t,d){return d=d===!0?-1:1,{x:d*-t.y,y:d*t.x}},C.neg=function(t){return{x:-t.x,y:-t.y}},C.angle=function(t,d){return Math.atan2(d.y-t.y,d.x-t.x)},C._temp=[C.create(),C.create(),C.create(),C.create(),C.create(),C.create()]}()},41598:(p,C,t)=>{var d={};p.exports=d;var c=t(31725),a=t(53402);(function(){d.create=function(r,n){for(var e=[],s=0;s0)return!1;i=o}return!0},d.scale=function(r,n,e,s){if(n===1&&e===1)return r;s=s||d.centre(r);for(var h,i,o=0;o=0?o-1:r.length-1],l=r[o],u=r[(o+1)%r.length],v=n[o0&&(n|=2),n===3)return!1;return n!==0?!0:null},d.hull=function(r){var n=[],e=[],s,h;for(r=r.slice(0),r.sort(function(i,o){var f=i.x-o.x;return f!==0?f:i.y-o.y}),h=0;h=2&&c.cross3(e[e.length-2],e[e.length-1],s)<=0;)e.pop();e.push(s)}for(h=r.length-1;h>=0;h-=1){for(s=r[h];n.length>=2&&c.cross3(n[n.length-2],n[n.length-1],s)<=0;)n.pop();n.push(s)}return n.pop(),e.pop(),n.concat(e)}})()},18210:(p,C,t)=>{var d=t(19933),c={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(a){a.after("Body.create",function(){c.Body.init(this)}),a.before("Engine.update",function(r){c.Engine.update(r)})},Body:{init:function(a){a.plugin.attractors=a.plugin.attractors||[]}},Engine:{update:function(a){for(var r=d.Composite.allBodies(a.world),n=0;n0)for(var h=0;h{/** + * @author @dxu https://github.com/dxu/matter-collision-events + * @author Richard Davey + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Engine.create",function(){t.Events.on(this,"collisionStart",function(d){d.pairs.map(function(c){var a=c.bodyA,r=c.bodyB;a.gameObject&&a.gameObject.emit("collide",a,r,c),r.gameObject&&r.gameObject.emit("collide",r,a,c),t.Events.trigger(a,"onCollide",{pair:c}),t.Events.trigger(r,"onCollide",{pair:c}),a.onCollideCallback&&a.onCollideCallback(c),r.onCollideCallback&&r.onCollideCallback(c),a.onCollideWith[r.id]&&a.onCollideWith[r.id](r,c),r.onCollideWith[a.id]&&r.onCollideWith[a.id](a,c)})}),t.Events.on(this,"collisionActive",function(d){d.pairs.map(function(c){var a=c.bodyA,r=c.bodyB;a.gameObject&&a.gameObject.emit("collideActive",a,r,c),r.gameObject&&r.gameObject.emit("collideActive",r,a,c),t.Events.trigger(a,"onCollideActive",{pair:c}),t.Events.trigger(r,"onCollideActive",{pair:c}),a.onCollideActiveCallback&&a.onCollideActiveCallback(c),r.onCollideActiveCallback&&r.onCollideActiveCallback(c)})}),t.Events.on(this,"collisionEnd",function(d){d.pairs.map(function(c){var a=c.bodyA,r=c.bodyB;a.gameObject&&a.gameObject.emit("collideEnd",a,r,c),r.gameObject&&r.gameObject.emit("collideEnd",r,a,c),t.Events.trigger(a,"onCollideEnd",{pair:c}),t.Events.trigger(r,"onCollideEnd",{pair:c}),a.onCollideEndCallback&&a.onCollideEndCallback(c),r.onCollideEndCallback&&r.onCollideEndCallback(c)})})})}};p.exports=C},74507:(p,C,t)=>{var d=t(19933),c={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(a){a.after("Engine.update",function(){c.Engine.update(this)})},Engine:{update:function(a){for(var r=a.world,n=d.Composite.allBodies(r),e=d.Composite.allComposites(r),s=0;sr.max.x?n=r.min.x-a.max.x:a.max.xr.max.y?e=r.min.y-a.max.y:a.max.y{/** + * @author Stefan Hedman (http://steffe.se) + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={decomp:R,quickDecomp:D,isSimple:L,removeCollinearPoints:I,removeDuplicatePoints:V,makeCCW:u};function C(G,U,F){F=F||0;var B=[0,0],N,z,Y,K,Z,Q,$;return N=G[1][1]-G[0][1],z=G[0][0]-G[1][0],Y=N*G[0][0]+z*G[0][1],K=U[1][1]-U[0][1],Z=U[0][0]-U[1][0],Q=K*U[0][0]+Z*U[0][1],$=N*Z-K*z,X($,0,F)||(B[0]=(Z*Y-z*Q)/$,B[1]=(N*Q-K*Y)/$),B}function t(G,U,F,B){var N=U[0]-G[0],z=U[1]-G[1],Y=B[0]-F[0],K=B[1]-F[1];if(Y*z-K*N===0)return!1;var Z=(N*(F[1]-G[1])+z*(G[0]-F[0]))/(Y*z-K*N),Q=(Y*(G[1]-F[1])+K*(F[0]-G[0]))/(K*N-Y*z);return Z>=0&&Z<=1&&Q>=0&&Q<=1}function d(G,U,F){return(U[0]-G[0])*(F[1]-G[1])-(F[0]-G[0])*(U[1]-G[1])}function c(G,U,F){return d(G,U,F)>0}function a(G,U,F){return d(G,U,F)>=0}function r(G,U,F){return d(G,U,F)<0}function n(G,U,F){return d(G,U,F)<=0}var e=[],s=[];function h(G,U,F,B){if(B){var N=e,z=s;N[0]=U[0]-G[0],N[1]=U[1]-G[1],z[0]=F[0]-U[0],z[1]=F[1]-U[1];var Y=N[0]*z[0]+N[1]*z[1],K=Math.sqrt(N[0]*N[0]+N[1]*N[1]),Z=Math.sqrt(z[0]*z[0]+z[1]*z[1]),Q=Math.acos(Y/(K*Z));return QF[U][0])&&(U=B);return c(o(G,U-1),o(G,U),o(G,U+1))?!1:(v(G),!0)}function v(G){for(var U=[],F=G.length,B=0;B!==F;B++)U.push(G.pop());for(var B=0;B!==F;B++)G[B]=U[B]}function m(G,U){return r(o(G,U-1),o(G,U),o(G,U+1))}var x=[],g=[];function y(G,U,F){var B,N,z=x,Y=g;if(a(o(G,U+1),o(G,U),o(G,F))&&n(o(G,U-1),o(G,U),o(G,F)))return!1;N=i(o(G,U),o(G,F));for(var K=0;K!==G.length;++K)if(!((K+1)%G.length===U||K===U)&&a(o(G,U),o(G,F),o(G,K+1))&&n(o(G,U),o(G,F),o(G,K))&&(z[0]=o(G,U),z[1]=o(G,F),Y[0]=o(G,K),Y[1]=o(G,K+1),B=C(z,Y),i(o(G,U),B)0?M(G,U):[G]}function M(G,U){if(U.length===0)return[G];if(U instanceof Array&&U.length&&U[0]instanceof Array&&U[0].length===2&&U[0][0]instanceof Array){for(var F=[G],B=0;Bz)return console.warn("quickDecomp: max level ("+z+") reached."),U;for(var it=0;itq&&(q+=G.length),_=Number.MAX_VALUE,q3&&B>=0;--B)h(o(G,B-1),o(G,B),o(G,B+1),U)&&(G.splice(B%G.length,1),F++);return F}function V(G,U){for(var F=G.length-1;F>=1;--F)for(var B=G[F],N=F-1;N>=0;--N)if(H(B,G[N],U)){G.splice(F,1);continue}}function X(G,U,F){return F=F||0,Math.abs(G-U)<=F}function H(G,U,F){return X(G[0],U[0],F)&&X(G[1],U[1],F)}},52018:(p,C,t)=>{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var d=t(83419),c=new d({initialize:function(r){this.pluginManager=r,this.game=r.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});p.exports=c},42363:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};p.exports=C},37277:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={},t={},d={};d.register=function(c,a,r,n){n===void 0&&(n=!1),C[c]={plugin:a,mapping:r,custom:n}},d.registerCustom=function(c,a,r,n){t[c]={plugin:a,mapping:r,data:n}},d.hasCore=function(c){return C.hasOwnProperty(c)},d.hasCustom=function(c){return t.hasOwnProperty(c)},d.getCore=function(c){return C[c]},d.getCustom=function(c){return t[c]},d.getCustomClass=function(c){return t.hasOwnProperty(c)?t[c].plugin:null},d.remove=function(c){C.hasOwnProperty(c)&&delete C[c]},d.removeCustom=function(c){t.hasOwnProperty(c)&&delete t[c]},d.destroyCorePlugins=function(){for(var c in C)C.hasOwnProperty(c)&&delete C[c]},d.destroyCustomPlugins=function(){for(var c in t)t.hasOwnProperty(c)&&delete t[c]},p.exports=d},77332:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(8443),a=t(50792),r=t(74099),n=t(44603),e=t(39429),s=t(95540),h=t(37277),i=t(72905),o=new d({Extends:a,initialize:function(l){a.call(this),this.game=l,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],l.isBooted?this.boot():l.events.once(c.BOOT,this.boot,this)},boot:function(){var f,l,u,v,m,x,g,y=this.game.config,T=y.installGlobalPlugins;for(T=T.concat(this._pendingGlobal),f=0;f{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var d=t(52018),c=t(83419),a=t(44594),r=new c({Extends:d,initialize:function(e,s,h){d.call(this,s),this.scene=e,this.systems=e.sys,this.pluginKey=h,e.sys.events.once(a.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});p.exports=r},18922:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={BasePlugin:t(52018),DefaultPlugins:t(42363),PluginCache:t(37277),PluginManager:t(77332),ScenePlugin:t(45145)}},63595:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(p){const C=performance.now(),t=this.getVideoPlaybackQuality(),d=this.mozPresentedFrames||this.mozPaintedFrames||t.totalVideoFrames-t.droppedVideoFrames,c=(a,r)=>{const n=this.getVideoPlaybackQuality(),e=this.mozPresentedFrames||this.mozPaintedFrames||n.totalVideoFrames-n.droppedVideoFrames;if(e>d){const s=this.mozFrameDelay||n.totalFrameDelay-t.totalFrameDelay||0,h=r-a;p(r,{presentationTime:r+s*1e3,expectedDisplayTime:r+h,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+h/1e3,presentedFrames:e,processingDuration:s}),delete this._rvfcpolyfillmap[C]}else this._rvfcpolyfillmap[C]=requestAnimationFrame(s=>c(r,s))};return this._rvfcpolyfillmap[C]=requestAnimationFrame(a=>c(C,a)),C},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(p){cancelAnimationFrame(this._rvfcpolyfillmap[p]),delete this._rvfcpolyfillmap[p]})},10312:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={DEFAULT:0,LINEAR:0,NEAREST:1};p.exports=C},68627:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19715),c=t(32880),a=t(83419),r=t(8054),n=t(50792),e=t(92503),s=t(56373),h=t(97480),i=t(69442),o=t(61340),f=new a({Extends:n,initialize:function(u){n.call(this);var v=u.config;this.config={clearBeforeRender:v.clearBeforeRender,backgroundColor:v.backgroundColor,antialias:v.antialias,roundPixels:v.roundPixels},this.game=u,this.type=r.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=u.canvas;var m={alpha:u.config.transparent,desynchronized:u.config.desynchronized,willReadFrequently:!1};this.gameContext=v.context?v.context:this.gameCanvas.getContext("2d",m),this.currentContext=this.gameContext,this.antialias=u.config.antialias,this.blendModes=s(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new o,this._tempMatrix2=new o,this._tempMatrix3=new o,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(i.READY,this.boot,this)},boot:function(){var l=this.game,u=l.scale.baseSize;this.width=u.width,this.height=u.height,this.isBooted=!0,l.scale.on(h.RESIZE,this.onResize,this),this.resize(u.width,u.height)},onResize:function(l,u){(u.width!==this.width||u.height!==this.height)&&this.resize(u.width,u.height)},resize:function(l,u){this.width=l,this.height=u,this.emit(e.RESIZE,l,u)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(l){return this.currentContext.globalCompositeOperation=l,this},setContext:function(l){return this.currentContext=l||this.gameContext,this},setAlpha:function(l){return this.currentContext.globalAlpha=l,this},preRender:function(){var l=this.gameContext,u=this.config,v=this.width,m=this.height;l.globalAlpha=1,l.globalCompositeOperation="source-over",l.setTransform(1,0,0,1,0,0),u.clearBeforeRender&&(l.clearRect(0,0,v,m),u.transparent||(l.fillStyle=u.backgroundColor.rgba,l.fillRect(0,0,v,m))),l.save(),this.drawCount=0,this.emit(e.PRE_RENDER)},render:function(l,u,v){var m=u.length;this.emit(e.RENDER,l,v);var x=v.x,g=v.y,y=v.width,T=v.height,E=v.renderToTexture?v.context:l.sys.context;E.save(),this.game.scene.customViewports&&(E.beginPath(),E.rect(x,g,y,T),E.clip()),v.emit(d.PRE_RENDER,v),this.currentContext=E;var P=v.mask;P&&P.preRenderCanvas(this,null,v._maskCamera),v.transparent||(E.fillStyle=v.backgroundColor.rgba,E.fillRect(x,g,y,T)),E.globalAlpha=v.alpha,E.globalCompositeOperation="source-over",this.drawCount+=m,v.renderToTexture&&v.emit(d.PRE_RENDER,v),v.matrix.copyToContext(E);for(var R=0;R=0?X=-(X+M):X<0&&(X=Math.abs(X)-M)),l.flipY&&(H>=0?H=-(H+L):H<0&&(H=Math.abs(H)-L))}var U=1,F=1;l.flipX&&(O||(X+=-u.realWidth+I*2),U=-1),l.flipY&&(O||(H+=-u.realHeight+V*2),F=-1);var B=l.x,N=l.y;T.applyITRS(B,N,l.rotation,l.scaleX*U,l.scaleY*F),y.copyFrom(v.matrix),m?(y.multiplyWithOffset(m,-v.scrollX*l.scrollFactorX,-v.scrollY*l.scrollFactorY),T.e=B,T.f=N):(T.e-=v.scrollX*l.scrollFactorX,T.f-=v.scrollY*l.scrollFactorY),y.multiply(T),v.roundPixels&&(y.e=Math.round(y.e),y.f=Math.round(y.f)),g.save(),y.setToContext(g),g.globalCompositeOperation=this.blendModes[l.blendMode],g.globalAlpha=x,g.imageSmoothingEnabled=!u.source.scaleMode,l.mask&&l.mask.preRenderCanvas(this,l,v),M>0&&L>0&&(v.roundPixels?g.drawImage(u.source.image,P,R,M,L,Math.round(X),Math.round(H),Math.round(M/D),Math.round(L/D)):g.drawImage(u.source.image,P,R,M,L,X,H,M/D,L/D)),l.mask&&l.mask.postRenderCanvas(this,l,v),g.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});p.exports=f},55830:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CanvasRenderer:t(68627),GetBlendModes:t(56373),SetTransform:t(20926)}},56373:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(89289),a=function(){var r=[],n=c.supportNewBlendModes,e="source-over";return r[d.NORMAL]=e,r[d.ADD]="lighter",r[d.MULTIPLY]=n?"multiply":e,r[d.SCREEN]=n?"screen":e,r[d.OVERLAY]=n?"overlay":e,r[d.DARKEN]=n?"darken":e,r[d.LIGHTEN]=n?"lighten":e,r[d.COLOR_DODGE]=n?"color-dodge":e,r[d.COLOR_BURN]=n?"color-burn":e,r[d.HARD_LIGHT]=n?"hard-light":e,r[d.SOFT_LIGHT]=n?"soft-light":e,r[d.DIFFERENCE]=n?"difference":e,r[d.EXCLUSION]=n?"exclusion":e,r[d.HUE]=n?"hue":e,r[d.SATURATION]=n?"saturation":e,r[d.COLOR]=n?"color":e,r[d.LUMINOSITY]=n?"luminosity":e,r[d.ERASE]="destination-out",r[d.SOURCE_IN]="source-in",r[d.SOURCE_OUT]="source-out",r[d.SOURCE_ATOP]="source-atop",r[d.DESTINATION_OVER]="destination-over",r[d.DESTINATION_IN]="destination-in",r[d.DESTINATION_OUT]="destination-out",r[d.DESTINATION_ATOP]="destination-atop",r[d.LIGHTER]="lighter",r[d.COPY]="copy",r[d.XOR]="xor",r};p.exports=a},20926:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91296),c=function(a,r,n,e,s){var h=e.alpha*n.alpha;if(h<=0)return!1;var i=d(n,e,s).calc;return r.globalCompositeOperation=a.blendModes[n.blendMode],r.globalAlpha=h,r.save(),i.setToContext(r),r.imageSmoothingEnabled=n.frame?!n.frame.source.scaleMode:a.antialias,!0};p.exports=c},63899:p=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="losewebgl"},6119:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="postrender"},48070:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="prerender"},15640:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="render"},8912:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resize"},87124:p=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="restorewebgl"},92503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={LOSE_WEBGL:t(63899),POST_RENDER:t(6119),PRE_RENDER:t(48070),RENDER:t(15640),RESIZE:t(8912),RESTORE_WEBGL:t(87124)}},36909:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Events:t(92503),Snapshot:t(89966)},p.exports.Canvas=t(55830),p.exports.WebGL=t(4159)},32880:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=t(40987),a=t(95540),r=function(n,e){var s=a(e,"callback"),h=a(e,"type","image/png"),i=a(e,"encoder",.92),o=Math.abs(Math.round(a(e,"x",0))),f=Math.abs(Math.round(a(e,"y",0))),l=Math.floor(a(e,"width",n.width)),u=Math.floor(a(e,"height",n.height)),v=a(e,"getPixel",!1);if(v){var m=n.getContext("2d",{willReadFrequently:!1}),x=m.getImageData(o,f,1,1),g=x.data;s.call(null,new c(g[0],g[1],g[2],g[3]))}else if(o!==0||f!==0||l!==n.width||u!==n.height){var y=d.createWebGL(this,l,u),T=y.getContext("2d",{willReadFrequently:!0});l>0&&u>0&&T.drawImage(n,o,f,l,u,0,0,l,u);var E=new Image;E.onerror=function(){s.call(null),d.remove(y)},E.onload=function(){s.call(null,E),d.remove(y)},E.src=y.toDataURL(h,i)}else{var P=new Image;P.onerror=function(){s.call(null)},P.onload=function(){s.call(null,P)},P.src=n.toDataURL(h,i)}};p.exports=r},88815:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=t(40987),a=t(95540),r=function(n,e){var s=n,h=a(e,"callback"),i=a(e,"type","image/png"),o=a(e,"encoder",.92),f=Math.abs(Math.round(a(e,"x",0))),l=Math.abs(Math.round(a(e,"y",0))),u=a(e,"getPixel",!1),v=a(e,"isFramebuffer",!1),m=v?a(e,"bufferWidth",1):s.drawingBufferWidth,x=v?a(e,"bufferHeight",1):s.drawingBufferHeight;if(u){var g=new Uint8Array(4),y=v?l:x-l;s.readPixels(f,y,1,1,s.RGBA,s.UNSIGNED_BYTE,g),h.call(null,new c(g[0],g[1],g[2],g[3]))}else{var T=Math.floor(a(e,"width",m)),E=Math.floor(a(e,"height",x)),P=T*E*4,R=new Uint8Array(P);s.readPixels(f,x-l-E,T,E,s.RGBA,s.UNSIGNED_BYTE,R);for(var M=d.createWebGL(this,T,E),L=M.getContext("2d",{willReadFrequently:!0}),O=L.getImageData(0,0,T,E),D=O.data,I=0;I{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Canvas:t(32880),WebGL:t(88815)}},7530:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(36060),a=t(90330),r=t(82264),n=t(95540),e=t(32302),s=t(63448),h=t(31302),i=t(58918),o=t(14811),f=t(92651),l=t(96569),u=t(56527),v=t(57516),m=t(43439),x=t(81041),g=t(12385),y=t(7589),T=t(95428),E=t(72905),P=new d({initialize:function(M){this.game=M.game,this.renderer=M,this.classes=new a([[c.UTILITY_PIPELINE,y],[c.MULTI_PIPELINE,v],[c.BITMAPMASK_PIPELINE,h],[c.SINGLE_PIPELINE,g],[c.ROPE_PIPELINE,x],[c.LIGHT_PIPELINE,l],[c.POINTLIGHT_PIPELINE,m],[c.MOBILE_PIPELINE,u]]),this.postPipelineClasses=new a,this.pipelines=new a,this.postPipelineInstances=[],this.default=null,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.MOBILE_PIPELINE=null,this.FX_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(R,M,L){var O=this.renderer,D=this.renderTargets;this.frameInc=Math.floor(n(R,"frameInc",32));var I=O.width,V=O.height,X=this.game.config.disablePreFX,H=this.game.config.disablePostFX;if(H||this.postPipelineClasses.setAll([[String(o.BARREL),i.Barrel],[String(o.BLOOM),i.Bloom],[String(o.BLUR),i.Blur],[String(o.BOKEH),i.Bokeh],[String(o.CIRCLE),i.Circle],[String(o.COLOR_MATRIX),i.ColorMatrix],[String(o.DISPLACEMENT),i.Displacement],[String(o.GLOW),i.Glow],[String(o.GRADIENT),i.Gradient],[String(o.PIXELATE),i.Pixelate],[String(o.SHADOW),i.Shadow],[String(o.SHINE),i.Shine],[String(o.VIGNETTE),i.Vignette],[String(o.WIPE),i.Wipe]]),!X){this.classes.set(c.FX_PIPELINE,f);for(var G=Math.min(I,V),U=Math.ceil(G/this.frameInc),F=1;F=0;L--){var O=M[L];O.active&&O.preBatch(R)}}},postBatch:function(R){if(R.hasPostPipeline){this.flush();for(var M=R.postPipelines,L=0;L=0;L--){var O=M[L];O.active&&O.preBatch(R)}}},postBatchCamera:function(R){if(R.hasPostPipeline){this.flush();for(var M=R.postPipelines,L=0;Lthis.maxDimension)return this.targetIndex=M.length-L,M[this.targetIndex];var O=(s(R,this.frameInc,0,!0)-1)*L;return this.targetIndex=O,M[O]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.default=null,this.current=null,this.previous=null}});p.exports=P},32302:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(92503),a=new d({initialize:function(n,e,s,h,i,o,f,l,u){h===void 0&&(h=1),i===void 0&&(i=0),o===void 0&&(o=!0),f===void 0&&(f=!1),l===void 0&&(l=!0),u===void 0&&(u=!0),this.renderer=n,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=h,this.minFilter=i,this.autoClear=o,this.autoResize=!0,this.hasDepthBuffer=l,this.forceClamp=u,this.resize(e,s),f?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(r){return r&&!this.autoResize?(this.renderer.on(c.RESIZE,this.resize,this),this.autoResize=!0):!r&&this.autoResize&&(this.renderer.off(c.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(r,n){if(r=Math.round(r*this.scale),n=Math.round(n*this.scale),r<=0&&(r=1),n<=0&&(n=1),this.autoResize&&(r!==this.width||n!==this.height)){var e=this.renderer;e.deleteFramebuffer(this.framebuffer),e.deleteTexture(this.texture),this.texture=e.createTextureFromSource(null,r,n,this.minFilter,this.forceClamp),this.framebuffer=e.createFramebuffer(r,n,this.texture,this.hasDepthBuffer),this.width=r,this.height=n}return this},willResize:function(r,n){return r=Math.round(r*this.scale),n=Math.round(n*this.scale),r<=0&&(r=1),n<=0&&(n=1),r!==this.width||n!==this.height},bind:function(r,n,e){r===void 0&&(r=!1);var s=this.renderer;if(r&&s.flush(),n&&e&&this.resize(n,e),s.pushFramebuffer(this.framebuffer,!1,!1),r&&this.adjustViewport(),this.autoClear){var h=this.renderer.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT)}s.clearStencilMask()},adjustViewport:function(){var r=this.renderer.gl;r.viewport(0,0,this.width,this.height),r.disable(r.SCISSOR_TEST)},clear:function(){var r=this.renderer,n=r.gl;r.pushFramebuffer(this.framebuffer),n.disable(n.SCISSOR_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),r.popFramebuffer(),r.resetScissor()},unbind:function(r){r===void 0&&(r=!1);var n=this.renderer;return r&&n.flush(),n.popFramebuffer()},destroy:function(){var r=this.renderer;r.off(c.RESIZE,this.resize,this),r.deleteFramebuffer(this.framebuffer),r.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});p.exports=a},70554:p=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @author Matthew Groves <@doormat> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={getTintFromFloats:function(C,t,d,c){var a=(C*255|0)&255,r=(t*255|0)&255,n=(d*255|0)&255,e=(c*255|0)&255;return(e<<24|a<<16|r<<8|n)>>>0},getTintAppendFloatAlpha:function(C,t){var d=(t*255|0)&255;return(d<<24|C)>>>0},getTintAppendFloatAlphaAndSwap:function(C,t){var d=(C>>16|0)&255,c=(C>>8|0)&255,a=(C|0)&255,r=(t*255|0)&255;return(r<<24|a<<16|c<<8|d)>>>0},getFloatsFromUintRGB:function(C){var t=(C>>16|0)&255,d=(C>>8|0)&255,c=(C|0)&255;return[t/255,d/255,c/255]},checkShaderMax:function(C,t){var d=Math.min(16,C.getParameter(C.MAX_TEXTURE_IMAGE_UNITS));return!t||t===-1?d:Math.min(d,t)},parseFragmentShaderMaxTextures:function(C,t){if(!C)return"";for(var d="",c=0;c0&&(d+=` + else `),c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(62644),a=t(50792),r=t(77085),n=t(95540),e=t(37867),s=t(92503),h=t(32302),i=t(70554),o=t(38683),f=new d({Extends:a,initialize:function(u){a.call(this);var v=u.game,m=v.renderer,x=m.gl;this.name=n(u,"name","WebGLPipeline"),this.game=v,this.renderer=m,this.manager,this.gl=x,this.view=v.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=n(u,"topology",x.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=n(u,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isPreFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=u,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=n(u,"resizeUniform","")},boot:function(){var l,u=this.gl,v=this.config,m=this.renderer;this.isPostFX||(this.projectionMatrix=new e().identity());var x=this.renderTargets,g=n(v,"renderTarget",!1);typeof g=="boolean"&&g&&(g=1);var y=m.width,T=m.height;if(typeof g=="number")for(l=0;lI&&(I=D[l].vertexSize);var V=n(v,"batchSize",m.config.batchSize);this.vertexCapacity=V*6;var X=new ArrayBuffer(this.vertexCapacity*I);this.vertexData=X,this.bytes=new Uint8Array(X),this.vertexViewF32=new Float32Array(X),this.vertexViewU32=new Uint32Array(X);var H=n(v,"vertices",null);for(H?(this.vertexViewF32.set(H),this.vertexBuffer=m.createVertexBuffer(X,u.STATIC_DRAW)):this.vertexBuffer=m.createVertexBuffer(X.byteLength,u.DYNAMIC_DRAW),this.setVertexBuffer(),l=D.length-1;l>=0;l--)D[l].rebind();this.hasBooted=!0,m.on(s.RESIZE,this.resize,this),m.on(s.PRE_RENDER,this.onPreRender,this),m.on(s.RENDER,this.onRender,this),m.on(s.POST_RENDER,this.onPostRender,this),this.emit(r.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(l,u,v){var m=this.renderer;if(l!==this.currentShader||m.currentProgram!==this.currentShader.program){this.flush();var x=this.setVertexBuffer(v);x&&!u&&(u=!0),l.bind(u,!1),this.currentShader=l}return this},getShaderByName:function(l){for(var u=this.shaders,v=0;v-1&&(D=G.substring(20))}I&&V&&L.push(new o(this,D,I,V,c(X)))}this.shaders=L}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(l){return this.currentBatch={start:this.vertexCount,count:0,texture:[l],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=l,this.batch.push(this.currentBatch),0},addTextureToBatch:function(l){var u=this.currentBatch;u&&(u.texture.push(l),u.unit++,u.maxUnit++)},pushBatch:function(l){if(!this.currentBatch||this.forceZero&&l!==this.currentTexture)return this.createBatch(l);if(l===this.currentTexture)return this.currentUnit;var u=this.currentBatch,v=u.texture.indexOf(l);return v===-1?u.texture.length===this.renderer.maxTextures?this.createBatch(l):(u.unit++,u.maxUnit++,u.texture.push(l),this.currentUnit=u.unit,this.currentTexture=l,u.unit):(this.currentUnit=v,this.currentTexture=l,v)},setGameObject:function(l,u){return u===void 0&&(u=l.frame),this.pushBatch(u.source.glTexture)},shouldFlush:function(l){return l===void 0&&(l=0),this.vertexCount+l>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(l,u){(l!==this.width||u!==this.height)&&this.flush(),this.width=l,this.height=u;for(var v=this.renderTargets,m=0;m=0;v--){var m=u[v].rebind();(!l||m===l)&&(this.currentShader=m)}return this.activeTextures.length=0,this.emit(r.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var l=this.shaders,u=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,u&&this.setVertexBuffer();for(var v=0;v0){this.emit(r.BEFORE_FLUSH,this,l),this.onBeforeFlush(l);var u=this.gl,v=this.vertexCount,m=this.currentShader.vertexSize,x=this.topology;if(this.active){this.setVertexBuffer(),v===this.vertexCapacity?u.bufferData(u.ARRAY_BUFFER,this.vertexData,u.DYNAMIC_DRAW):u.bufferSubData(u.ARRAY_BUFFER,0,this.bytes.subarray(0,v*m));var g,y,T,E=this.batch,P=this.activeTextures;if(this.forceZero)for(P[0]||u.activeTexture(u.TEXTURE0),g=0;g{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95428),c=t(72905),a=t(19715),r=t(83419),n=t(8054),e=t(50792),s=t(92503),h=t(50030),i=t(37867),o=t(29747),f=t(7530),l=t(32302),u=t(97480),v=t(69442),m=t(70554),x=t(88815),g=t(26128),y=t(1482),T=t(82751),E=t(84387),P=t(93567),R=t(57183),M=new r({Extends:e,initialize:function(O){e.call(this);var D=O.config,I={alpha:D.transparent,desynchronized:D.desynchronized,depth:!0,antialias:D.antialiasGL,premultipliedAlpha:D.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:D.failIfMajorPerformanceCaveat,powerPreference:D.powerPreference,preserveDrawingBuffer:D.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:D.clearBeforeRender,antialias:D.antialias,backgroundColor:D.backgroundColor,contextCreation:I,roundPixels:D.roundPixels,maxTextures:D.maxTextures,maxTextureSize:D.maxTextureSize,batchSize:D.batchSize,maxLights:D.maxLights,mipmapFilter:D.mipmapFilter},this.game=O,this.type=n.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=O.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.maxTextures=0,this.textureIndexes,this.glBufferWrappers=[],this.glProgramWrappers=[],this.glTextureWrappers=[],this.glFramebufferWrappers=[],this.glAttribLocationWrappers=[],this.glUniformLocationWrappers=[],this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=o,this.contextRestoredHandler=o,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.normalTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.maskSource=null,this.maskTarget=null,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(L){var O,D=this.game,I=this.canvas,V=L.backgroundColor;if(D.config.context?O=D.config.context:O=I.getContext("webgl",L.contextCreation)||I.getContext("experimental-webgl",L.contextCreation),!O||O.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=O;var X=this,H=function(){var F=O.getSupportedExtensions();X.supportedExtensions=F;var B="ANGLE_instanced_arrays";X.instancedArraysExtension=F.indexOf(B)>-1?O.getExtension(B):null;var N="OES_vertex_array_object";X.vaoExtension=F.indexOf(N)>-1?O.getExtension(N):null};H(),this.contextLostHandler=function(F){X.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),X.emit(s.LOSE_WEBGL,X),F.preventDefault()},I.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(F){if(O.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}X.currentProgram=null,X.currentFramebuffer=null,X.setBlendMode(n.BlendModes.NORMAL),O.disable(O.BLEND),O.disable(O.DEPTH_TEST),O.enable(O.CULL_FACE);var B=function(N){N.createResource()};d(X.glTextureWrappers,B),d(X.glBufferWrappers,B),d(X.glFramebufferWrappers,B),d(X.glProgramWrappers,B),d(X.glAttribLocationWrappers,B),d(X.glUniformLocationWrappers,B),X.createTemporaryTextures(),X.pipelines.restoreContext(),X.resize(X.game.scale.baseSize.width,X.game.scale.baseSize.height),H(),X.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),X.emit(s.RESTORE_WEBGL,X),F.preventDefault()},I.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),D.context=O;for(var G=0;G<=27;G++)this.blendModes.push({func:[O.ONE,O.ONE_MINUS_SRC_ALPHA],equation:O.FUNC_ADD});this.blendModes[1].func=[O.ONE,O.DST_ALPHA],this.blendModes[2].func=[O.DST_COLOR,O.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[O.ONE,O.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[O.ZERO,O.ONE_MINUS_SRC_ALPHA],equation:O.FUNC_REVERSE_SUBTRACT},this.glFormats=[O.BYTE,O.SHORT,O.UNSIGNED_BYTE,O.UNSIGNED_SHORT,O.FLOAT],this.glFuncMap={mat2:{func:O.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:O.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:O.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:O.uniform1f,length:1},"1fv":{func:O.uniform1fv,length:1},"1i":{func:O.uniform1i,length:1},"1iv":{func:O.uniform1iv,length:1},"2f":{func:O.uniform2f,length:2},"2fv":{func:O.uniform2fv,length:1},"2i":{func:O.uniform2i,length:2},"2iv":{func:O.uniform2iv,length:1},"3f":{func:O.uniform3f,length:3},"3fv":{func:O.uniform3fv,length:1},"3i":{func:O.uniform3i,length:3},"3iv":{func:O.uniform3iv,length:1},"4f":{func:O.uniform4f,length:4},"4fv":{func:O.uniform4fv,length:1},"4i":{func:O.uniform4i,length:4},"4iv":{func:O.uniform4iv,length:1}},(!L.maxTextures||L.maxTextures===-1)&&(L.maxTextures=O.getParameter(O.MAX_TEXTURE_IMAGE_UNITS)),L.maxTextureSize||(L.maxTextureSize=O.getParameter(O.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),O.disable(O.DEPTH_TEST),O.disable(O.CULL_FACE),O.enable(O.BLEND),O.clearColor(V.redGL,V.greenGL,V.blueGL,V.alphaGL);var U=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return U.indexOf(L.mipmapFilter)!==-1&&(this.mipmapFilter=O[L.mipmapFilter]),this.maxTextures=m.checkShaderMax(O,L.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(n.BlendModes.NORMAL),this.projectionMatrix=new i().identity(),D.textures.once(v.READY,this.boot,this),this},boot:function(){var L=this.game,O=this.pipelines,D=L.scale.baseSize,I=D.width,V=D.height;this.width=I,this.height=V,this.isBooted=!0,this.renderTarget=new l(this,I,V,1,0,!0,!0),this.maskTarget=new l(this,I,V,1,0,!0,!0),this.maskSource=new l(this,I,V,1,0,!0,!0);var X=L.config;O.boot(X.pipeline,X.defaultPipeline,X.autoMobilePipeline),this.blankTexture=L.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=L.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=L.textures.getFrame("__WHITE").glTexture;var H=this.gl;H.bindFramebuffer(H.FRAMEBUFFER,null),H.enable(H.SCISSOR_TEST),L.scale.on(u.RESIZE,this.onResize,this),this.resize(I,V)},createTemporaryTextures:function(){for(var L=this.gl,O=0;O0&&I>0;if(H&&G){var U=H[0],F=H[1],B=H[2],N=H[3];G=U!==L||F!==O||B!==D||N!==I}G&&(this.flush(),X.scissor(L,V-O-I,D,I))},resetScissor:function(){var L=this.gl;L.enable(L.SCISSOR_TEST);var O=this.currentScissor;if(O){var D=O[0],I=O[1],V=O[2],X=O[3];V>0&&X>0&&L.scissor(D,this.drawingBufferHeight-I-X,V,X)}},popScissor:function(){var L=this.scissorStack;L.pop();var O=L[L.length-1];O&&this.setScissor(O[0],O[1],O[2],O[3]),this.currentScissor=O},hasActiveStencilMask:function(){var L=this.currentMask.mask,O=this.currentCameraMask.mask;return L&&L.isStencil||O&&O.isStencil},resetViewport:function(){var L=this.gl;L.viewport(0,0,this.width,this.height),this.drawingBufferHeight=L.drawingBufferHeight},setBlendMode:function(L,O){O===void 0&&(O=!1);var D=this.gl,I=this.blendModes[L];return O||L!==n.BlendModes.SKIP_CHECK&&this.currentBlendMode!==L?(this.flush(),D.enable(D.BLEND),D.blendEquation(I.equation),I.func.length>2?D.blendFuncSeparate(I.func[0],I.func[1],I.func[2],I.func[3]):D.blendFunc(I.func[0],I.func[1]),this.currentBlendMode=L,!0):!1},addBlendMode:function(L,O){var D=this.blendModes.push({func:L,equation:O});return D-1},updateBlendMode:function(L,O,D){return this.blendModes[L]&&(this.blendModes[L].func=O,D&&(this.blendModes[L].equation=D)),this},removeBlendMode:function(L){return L>17&&this.blendModes[L]&&this.blendModes.splice(L,1),this},pushFramebuffer:function(L,O,D,I,V){return L===this.currentFramebuffer?this:(this.fboStack.push(L),this.setFramebuffer(L,O,D,I,V))},setFramebuffer:function(L,O,D,I,V){if(O===void 0&&(O=!1),D===void 0&&(D=!0),I===void 0&&(I=null),V===void 0&&(V=!1),L===this.currentFramebuffer)return this;var X=this.gl,H=this.width,G=this.height;return L&&L.renderTexture&&D?(H=L.renderTexture.width,G=L.renderTexture.height):this.flush(),L?X.bindFramebuffer(X.FRAMEBUFFER,L.webGLFramebuffer):X.bindFramebuffer(X.FRAMEBUFFER,null),D&&X.viewport(0,0,H,G),I&&X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,I.webGLTexture,0),V&&(X.clearColor(0,0,0,0),X.clear(X.COLOR_BUFFER_BIT)),O&&(L?(this.drawingBufferHeight=G,this.pushScissor(0,0,H,G)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=L,this},popFramebuffer:function(L,O){L===void 0&&(L=!1),O===void 0&&(O=!0);var D=this.fboStack;D.pop();var I=D[D.length-1];return I||(I=null),this.setFramebuffer(I,L,O),I},restoreFramebuffer:function(L,O){L===void 0&&(L=!1),O===void 0&&(O=!0);var D=this.fboStack,I=D[D.length-1];I||(I=null),this.currentFramebuffer=null,this.setFramebuffer(I,L,O)},setProgram:function(L){return L!==this.currentProgram?(this.flush(),this.gl.useProgram(L.webGLProgram),this.currentProgram=L,!0):!1},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(L,O,D,I,V){V===void 0&&(V=!1);var X=this.gl,H=X.NEAREST,G=X.NEAREST,U=X.CLAMP_TO_EDGE,F=null;O=L?L.width:O,D=L?L.height:D;var B=h(O,D);if(B&&!V&&(U=X.REPEAT),I===n.ScaleModes.LINEAR&&this.config.antialias){var N=L&&L.compressed,z=!N&&B||N&&L.mipmaps.length>1;H=this.mipmapFilter&&z?this.mipmapFilter:X.LINEAR,G=X.LINEAR}return!L&&typeof O=="number"&&typeof D=="number"?F=this.createTexture2D(0,H,G,U,U,X.RGBA,null,O,D):F=this.createTexture2D(0,H,G,U,U,X.RGBA,L),F},createTexture2D:function(L,O,D,I,V,X,H,G,U,F,B,N){typeof G!="number"&&(G=H?H.width:1),typeof U!="number"&&(U=H?H.height:1);var z=new T(this.gl,L,O,D,I,V,X,H,G,U,F,B,N);return this.glTextureWrappers.push(z),z},createFramebuffer:function(L,O,D,I){this.currentFramebuffer=null;var V=new E(this.gl,L,O,D,I);return this.glFramebufferWrappers.push(V),V},beginBitmapMask:function(L,O){var D=this.gl;D&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==L&&(this.currentMask.mask=L,this.currentMask.camera=O))},drawBitmapMask:function(L,O,D){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),L.renderWebGL(this,L,O),this.maskSource.unbind(!0),this.maskTarget.unbind();var I=this.gl,V=this.getCurrentStencilMask();V?(I.enable(I.STENCIL_TEST),V.mask.applyStencil(this,V.camera,!0)):this.currentMask.mask=null,this.pipelines.set(D),I.activeTexture(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,this.maskTarget.texture.webGLTexture),I.activeTexture(I.TEXTURE1),I.bindTexture(I.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(L,O){var D=new y(this.gl,L,O);return this.glProgramWrappers.push(D),D},createVertexBuffer:function(L,O){var D=this.gl,I=new g(D,L,D.ARRAY_BUFFER,O);return this.glBufferWrappers.push(I),I},createAttribLocation:function(L,O){var D=new P(this.gl,L,O);return this.glAttribLocationWrappers.push(D),D},createUniformLocation:function(L,O){var D=new R(this.gl,L,O);return this.glUniformLocationWrappers.push(D),D},createIndexBuffer:function(L,O){var D=this.gl,I=new g(D,L,D.ELEMENT_ARRAY_BUFFER,O);return this.glBufferWrappers.push(I),I},deleteTexture:function(L){if(L)return c(this.glTextureWrappers,L),L.destroy(),this},deleteFramebuffer:function(L){return L?(c(this.fboStack,L),c(this.glFramebufferWrappers,L),L.destroy(),this):this},deleteProgram:function(L){return L&&(c(this.glProgramWrappers,L),L.destroy()),this},deleteAttribLocation:function(L){return L&&(c(this.glAttribLocationWrappers,L),L.destroy()),this},deleteUniformLocation:function(L){return L&&(c(this.glUniformLocationWrappers,L),L.destroy()),this},deleteBuffer:function(L){return L?(c(this.glBufferWrappers,L),L.destroy(),this):this},preRenderCamera:function(L){var O=L.x,D=L.y,I=L.width,V=L.height,X=L.backgroundColor;if(L.emit(a.PRE_RENDER,L),this.pipelines.preBatchCamera(L),this.pushScissor(O,D,I,V),L.mask&&(this.currentCameraMask.mask=L.mask,this.currentCameraMask.camera=L._maskCamera,L.mask.preRenderWebGL(this,L,L._maskCamera)),X.alphaGL>0){var H=this.pipelines.setMulti();H.drawFillRect(O,D,I,V,m.getTintFromFloats(X.blueGL,X.greenGL,X.redGL,1),X.alphaGL)}},getCurrentStencilMask:function(){var L=null,O=this.maskStack,D=this.currentCameraMask;return O.length>0?L=O[O.length-1]:D.mask&&D.mask.isStencil&&(L=D),L},postRenderCamera:function(L){var O=L.flashEffect,D=L.fadeEffect;if(O.isRunning||D.isRunning||D.isComplete){var I=this.pipelines.setMulti();O.postRenderWebGL(I,m.getTintFromFloats),D.postRenderWebGL(I,m.getTintFromFloats)}L.dirty=!1,this.popScissor(),L.mask&&(this.currentCameraMask.mask=null,L.mask.postRenderWebGL(this,L._maskCamera)),this.pipelines.postBatchCamera(L),L.emit(a.POST_RENDER,L)},preRender:function(){if(!this.contextLost){var L=this.gl;if(L.bindFramebuffer(L.FRAMEBUFFER,null),this.config.clearBeforeRender){var O=this.config.backgroundColor;L.clearColor(O.redGL,O.greenGL,O.blueGL,O.alphaGL),L.clear(L.COLOR_BUFFER_BIT|L.DEPTH_BUFFER_BIT|L.STENCIL_BUFFER_BIT)}L.enable(L.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&L.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(s.PRE_RENDER)}},render:function(L,O,D){if(!this.contextLost){var I=O.length;if(this.emit(s.RENDER,L,D),this.preRenderCamera(D),I===0){this.setBlendMode(n.BlendModes.NORMAL),this.postRenderCamera(D);return}this.currentType="";for(var V=this.currentMask,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95428),a=t(95540),r=t(14500),n=new d({initialize:function(s,h,i,o,f){this.pipeline=s,this.name=h,this.renderer=s.renderer,this.gl=this.renderer.gl,this.fragSrc=o,this.vertSrc=i,this.program=this.renderer.createProgram(i,o),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(f),this.createUniforms()},createAttributes:function(e){var s=0,h=0,i=[];this.vertexComponentCount=0;for(var o=0;o=0?(s.enableVertexAttribArray(E.webGLAttribLocation),s.vertexAttribPointer(E.webGLAttribLocation,v,m,T,i,x),u.enabled=!0,u.location=E):E.webGLAttribLocation!==-1&&s.disableVertexAttribArray(E.webGLAttribLocation)}else g?s.vertexAttribPointer(y.webGLAttribLocation,v,m,T,i,x):!g&&y!==-1&&y.webGLAttribLocation>-1&&(s.disableVertexAttribArray(y.webGLAttribLocation),u.location=-1)}return this},createUniforms:function(){var e=this.gl,s=this.program,h=this.uniforms,i,o,f,l=e.getProgramParameter(s.webGLProgram,e.ACTIVE_UNIFORMS);for(i=0;i0&&(o=o.substr(0,v),h.hasOwnProperty(o)||(f=this.renderer.createUniformLocation(s,o),f!==null&&(h[o]={name:o,location:f,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var e=this.gl;this.renderer.setProgram(this.program);for(var s in this.uniforms){var h=this.uniforms[s];h.setter&&h.setter.call(e,h.location.webGLUniformLocation,h.value1,h.value2,h.value3,h.value4)}},hasUniform:function(e){return this.uniforms.hasOwnProperty(e)},resetUniform:function(e){var s=this.uniforms[e];return s&&(s.value1=null,s.value2=null,s.value3=null,s.value4=null),this},setUniform1:function(e,s,h,i){var o=this.uniforms[s];return o?((i||o.value1!==h)&&(o.setter||(o.setter=e),o.value1=h,this.renderer.setProgram(this.program),e.call(this.gl,o.location.webGLUniformLocation,h),this.pipeline.currentShader=this),this):this},setUniform2:function(e,s,h,i,o){var f=this.uniforms[s];return f?((o||f.value1!==h||f.value2!==i)&&(f.setter||(f.setter=e),f.value1=h,f.value2=i,this.renderer.setProgram(this.program),e.call(this.gl,f.location.webGLUniformLocation,h,i),this.pipeline.currentShader=this),this):this},setUniform3:function(e,s,h,i,o,f){var l=this.uniforms[s];return l?((f||l.value1!==h||l.value2!==i||l.value3!==o)&&(l.setter||(l.setter=e),l.value1=h,l.value2=i,l.value3=o,this.renderer.setProgram(this.program),e.call(this.gl,l.location.webGLUniformLocation,h,i,o),this.pipeline.currentShader=this),this):this},setUniform4:function(e,s,h,i,o,f,l){var u=this.uniforms[s];return u?((l||u.value1!==h||u.value2!==i||u.value3!==o||u.value4!==f)&&(u.setter||(u.setter=e),u.value1=h,u.value2=i,u.value3=o,u.value4=f,this.renderer.setProgram(this.program),e.call(this.gl,u.location.webGLUniformLocation,h,i,o,f),this.pipeline.currentShader=this),this):this},setBoolean:function(e,s){return this.setUniform1(this.gl.uniform1i,e,Number(s))},set1f:function(e,s){return this.setUniform1(this.gl.uniform1f,e,s)},set2f:function(e,s,h){return this.setUniform2(this.gl.uniform2f,e,s,h)},set3f:function(e,s,h,i){return this.setUniform3(this.gl.uniform3f,e,s,h,i)},set4f:function(e,s,h,i,o){return this.setUniform4(this.gl.uniform4f,e,s,h,i,o)},set1fv:function(e,s){return this.setUniform1(this.gl.uniform1fv,e,s,!0)},set2fv:function(e,s){return this.setUniform1(this.gl.uniform2fv,e,s,!0)},set3fv:function(e,s){return this.setUniform1(this.gl.uniform3fv,e,s,!0)},set4fv:function(e,s){return this.setUniform1(this.gl.uniform4fv,e,s,!0)},set1iv:function(e,s){return this.setUniform1(this.gl.uniform1iv,e,s,!0)},set2iv:function(e,s){return this.setUniform1(this.gl.uniform2iv,e,s,!0)},set3iv:function(e,s){return this.setUniform1(this.gl.uniform3iv,e,s,!0)},set4iv:function(e,s){return this.setUniform1(this.gl.uniform4iv,e,s,!0)},set1i:function(e,s){return this.setUniform1(this.gl.uniform1i,e,s)},set2i:function(e,s,h){return this.setUniform2(this.gl.uniform2i,e,s,h)},set3i:function(e,s,h,i){return this.setUniform3(this.gl.uniform3i,e,s,h,i)},set4i:function(e,s,h,i,o){return this.setUniform4(this.gl.uniform4i,e,s,h,i,o)},setMatrix2fv:function(e,s,h){return this.setUniform2(this.gl.uniformMatrix2fv,e,s,h,!0)},setMatrix3fv:function(e,s,h){return this.setUniform2(this.gl.uniformMatrix3fv,e,s,h,!0)},setMatrix4fv:function(e,s,h){return this.setUniform2(this.gl.uniformMatrix4fv,e,s,h,!0)},createProgram:function(e,s){return e===void 0&&(e=this.vertSrc),s===void 0&&(s=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=e,this.fragSrc=s,this.program=this.renderer.createProgram(e,s),this.createUniforms(),this.rebind()},destroy:function(){var e=this.renderer;c(this.uniforms,function(s){e.deleteUniformLocation(s.location)}),this.uniforms=null,c(this.attributes,function(s){e.deleteAttribLocation(s.location)}),this.attributes=null,e.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});p.exports=n},14500:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}};p.exports=C},4159:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(14500),c=t(79291),a={PipelineManager:t(7530),Pipelines:t(96615),RenderTarget:t(32302),Utils:t(70554),WebGLPipeline:t(29100),WebGLRenderer:t(74797),WebGLShader:t(38683),Wrappers:t(9503)};a=c(!1,a,d),p.exports=a},31302:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(78908),r=t(85191),n=t(14500),e=t(29100),s=new d({Extends:e,initialize:function(i){i.fragShader=c(i,"fragShader",a),i.vertShader=c(i,"vertShader",r),i.batchSize=c(i,"batchSize",1),i.vertices=c(i,"vertices",[-1,1,-1,-7,7,1]),i.attributes=c(i,"attributes",[{name:"inPosition",size:2,type:n.FLOAT}]),e.call(this,i)},boot:function(){e.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(h,i){e.prototype.resize.call(this,h,i),this.set2f("uResolution",h,i)},beginMask:function(h,i,o){this.renderer.beginBitmapMask(h,o)},endMask:function(h,i,o){var f=this.gl,l=this.renderer,u=h.bitmapMask;u&&f&&(l.drawBitmapMask(u,i,this),o&&this.set2f("uResolution",o.width,o.height),this.set1i("uInvertMaskAlpha",h.invertAlpha),f.drawArrays(this.topology,0,3),o&&this.set2f("uResolution",this.width,this.height),f.bindTexture(f.TEXTURE_2D,null))}});p.exports=s},92651:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(58918),a=t(14811),r=t(95540),n=t(43558),e=t(89350),s=t(70554),h=new d({Extends:n,initialize:function(o){o.shaders=[s.setGlowQuality(e.FXGlowFrag,o.game),e.FXShadowFrag,e.FXPixelateFrag,e.FXVignetteFrag,e.FXShineFrag,e.FXBlurLowFrag,e.FXBlurMedFrag,e.FXBlurHighFrag,e.FXGradientFrag,e.FXBloomFrag,e.ColorMatrixFrag,e.FXCircleFrag,e.FXBarrelFrag,e.FXDisplacementFrag,e.FXWipeFrag,e.FXBokehFrag],n.call(this,o);var f=this.game;this.glow=new c.Glow(f),this.shadow=new c.Shadow(f),this.pixelate=new c.Pixelate(f),this.vignette=new c.Vignette(f),this.shine=new c.Shine(f),this.gradient=new c.Gradient(f),this.circle=new c.Circle(f),this.barrel=new c.Barrel(f),this.wipe=new c.Wipe(f),this.bokeh=new c.Bokeh(f);var l=[];l[a.GLOW]=this.onGlow,l[a.SHADOW]=this.onShadow,l[a.PIXELATE]=this.onPixelate,l[a.VIGNETTE]=this.onVignette,l[a.SHINE]=this.onShine,l[a.BLUR]=this.onBlur,l[a.GRADIENT]=this.onGradient,l[a.BLOOM]=this.onBloom,l[a.COLOR_MATRIX]=this.onColorMatrix,l[a.CIRCLE]=this.onCircle,l[a.BARREL]=this.onBarrel,l[a.DISPLACEMENT]=this.onDisplacement,l[a.WIPE]=this.onWipe,l[a.BOKEH]=this.onBokeh,this.fxHandlers=l,this.source,this.target,this.swap},onDraw:function(i,o,f){this.source=i,this.target=o,this.swap=f;var l=i.width,u=i.height,v=this.tempSprite,m=this.fxHandlers;if(v&&v.preFX)for(var x=v.preFX.list,g=0;g{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(31063),r=t(57516),n=t(61340),e=t(26099),s=t(29100),h=new d({Extends:r,initialize:function(o){var f=c(o,"fragShader",a);o.fragShader=f.replace("%LIGHT_COUNT%",o.game.renderer.config.maxLights),r.call(this,o),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new e,this._tempMatrix=new n,this._tempMatrix2=new n},boot:function(){s.prototype.boot.call(this)},onRender:function(i,o){var f=i.sys.lights;if(this.lightsActive=!1,!(!f||!f.active)){var l=f.getLights(o),u=l.length;this.lightsActive=!0;var v,m=this.renderer,x=m.height,g=o.matrix,y=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",o.x,o.y,o.rotation,o.zoom),this.set3f("uAmbientLightColor",f.ambientColor.r,f.ambientColor.g,f.ambientColor.b),this.set1i("uLightCount",u),v=0;v0&&this.flush();var o=this.inverseRotationMatrix;if(i){var f=-i,l=Math.cos(f),u=Math.sin(f);o[1]=u,o[3]=-u,o[0]=o[4]=l}else o[0]=o[4]=1,o[1]=o[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,o),this.currentNormalMapRotation=i}},setTexture2D:function(i,o){var f=this.renderer;i===void 0&&(i=f.whiteTexture);var l=this.getNormalMap(o);this.isNewNormalMap(i,l)&&(this.flush(),this.createBatch(i),this.addTextureToBatch(l),this.currentNormalMap=l);var u=0;if(o&&o.parentContainer){var v=o.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);u=v.rotationNormalized}else o&&(u=o.rotation);return this.setNormalMapRotation(u),0},setGameObject:function(i,o){o===void 0&&(o=i.frame);var f=o.glTexture,l=this.getNormalMap(i);if(this.isNewNormalMap(f,l)&&(this.flush(),this.createBatch(f),this.addTextureToBatch(l),this.currentNormalMap=l),i.parentContainer){var u=i.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(u.rotationNormalized)}else this.setNormalMapRotation(i.rotation);return 0},isNewNormalMap:function(i,o){return this.currentTexture!==i||this.currentNormalMap!==o},getNormalMap:function(i){var o;if(i)i.displayTexture?o=i.displayTexture.dataSource[i.displayFrame.sourceIndex]:i.texture?o=i.texture.dataSource[i.frame.sourceIndex]:i.tileset&&(Array.isArray(i.tileset)?o=i.tileset[0].image.dataSource[0]:o=i.tileset.image.dataSource[0]);else return this.renderer.normalMap;return o?o.glTexture:this.renderer.normalMap},batchSprite:function(i,o,f){this.lightsActive&&r.prototype.batchSprite.call(this,i,o,f)},batchTexture:function(i,o,f,l,u,v,m,x,g,y,T,E,P,R,M,L,O,D,I,V,X,H,G,U,F,B,N,z,Y,K,Z,Q){this.lightsActive&&r.prototype.batchTexture.call(this,i,o,f,l,u,v,m,x,g,y,T,E,P,R,M,L,O,D,I,V,X,H,G,U,F,B,N,z,Y,K,Z,Q)},batchTextureFrame:function(i,o,f,l,u,v,m){this.lightsActive&&r.prototype.batchTextureFrame.call(this,i,o,f,l,u,v,m)}});p.exports=h},56527:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(57516),r=t(45561),n=t(60722),e=t(14500),s=t(29100),h=new d({Extends:a,initialize:function(o){o.fragShader=c(o,"fragShader",r),o.vertShader=c(o,"vertShader",n),o.attributes=c(o,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o.forceZero=!0,o.resizeUniform="uResolution",a.call(this,o)},boot:function(){s.prototype.boot.call(this);var i=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",i.width,i.height),this.set1i("uRoundPixels",i.config.roundPixels)}});p.exports=h},57516:(p,C,t)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(94811),a=t(95540),r=t(98840),n=t(44667),e=t(61340),s=t(70554),h=t(14500),i=t(29100),o=new d({Extends:i,initialize:function(l){var u=l.game.renderer,v=a(l,"fragShader",r);l.fragShader=s.parseFragmentShaderMaxTextures(v,u.maxTextures),l.vertShader=a(l,"vertShader",n),l.attributes=a(l,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),l.resizeUniform="uResolution",i.call(this,l),this._tempMatrix1=new e,this._tempMatrix2=new e,this._tempMatrix3=new e,this.calcMatrix=new e,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){i.prototype.boot.call(this);var f=this.renderer;this.set1iv("uMainSampler",f.textureIndexes),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)},batchSprite:function(f,l,u){this.manager.set(this,f);var v=this._tempMatrix1,m=this._tempMatrix2,x=this._tempMatrix3,g=f.frame,y=g.glTexture,T=g.u0,E=g.v0,P=g.u1,R=g.v1,M=g.x,L=g.y,O=g.cutWidth,D=g.cutHeight,I=g.customPivot,V=f.displayOriginX,X=f.displayOriginY,H=-V+M,G=-X+L;if(f.isCropped){var U=f._crop;(U.flipX!==f.flipX||U.flipY!==f.flipY)&&g.updateCropUVs(U,f.flipX,f.flipY),T=U.u0,E=U.v0,P=U.u1,R=U.v1,O=U.width,D=U.height,M=U.x,L=U.y,H=-V+M,G=-X+L}var F=1,B=1;f.flipX&&(I||(H+=-g.realWidth+V*2),F=-1),(f.flipY||g.source.isGLTexture&&g.source.isRenderTexture&&!y.flipY)&&(I||(G+=-g.realHeight+X*2),B=-1);var N=f.x,z=f.y;m.applyITRS(N,z,f.rotation,f.scaleX*F,f.scaleY*B),v.copyFrom(l.matrix),u?(v.multiplyWithOffset(u,-l.scrollX*f.scrollFactorX,-l.scrollY*f.scrollFactorY),m.e=N,m.f=z):(m.e-=l.scrollX*f.scrollFactorX,m.f-=l.scrollY*f.scrollFactorY),v.multiply(m,x);var Y=x.setQuad(H,G,H+O,G+D),K=s.getTintAppendFloatAlpha,Z=l.alpha,Q=K(f.tintTopLeft,Z*f._alphaTL),$=K(f.tintTopRight,Z*f._alphaTR),j=K(f.tintBottomLeft,Z*f._alphaBL),k=K(f.tintBottomRight,Z*f._alphaBR);this.shouldFlush(6)&&this.flush();var _=this.setGameObject(f,g);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",l.roundPixels),this.batchQuad(f,Y[0],Y[1],Y[2],Y[3],Y[4],Y[5],Y[6],Y[7],T,E,P,R,Q,$,j,k,f.tintFill,y,_),this.manager.postBatch(f)},batchTexture:function(f,l,u,v,m,x,g,y,T,E,P,R,M,L,O,D,I,V,X,H,G,U,F,B,N,z,Y,K,Z,Q,$,j,k){k===void 0&&(k=!1),this.manager.set(this,f);var _=this._tempMatrix1,q=this._tempMatrix2,et=this._tempMatrix3,nt=V/u+Y,at=X/v+K,rt=(V+H)/u+Y,tt=(X+G)/v+K,st=g,it=y,ot=-D,ht=-I;if(f.isCropped){var xt=f._crop,mt=xt.width,ft=xt.height;st=mt,it=ft,g=mt,y=ft,V=xt.x,X=xt.y;var lt=V,St=X;R&&(lt=H-xt.x-mt),M&&(St=G-xt.y-ft),nt=lt/u+Y,at=St/v+K,rt=(lt+mt)/u+Y,tt=(St+ft)/v+K,ot=-D+V,ht=-I+X}M=M^(!$&&l.isRenderTexture?1:0),R&&(st*=-1,ot+=g),M&&(it*=-1,ht+=y),q.applyITRS(m,x,P,T,E),_.copyFrom(Z.matrix),Q?(_.multiplyWithOffset(Q,-Z.scrollX*L,-Z.scrollY*O),q.e=m,q.f=x):(q.e-=Z.scrollX*L,q.f-=Z.scrollY*O),_.multiply(q,et);var pt=et.setQuad(ot,ht,ot+st,ht+it);j==null&&(j=this.setTexture2D(l)),f&&!k&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",Z.roundPixels),this.batchQuad(f,pt[0],pt[1],pt[2],pt[3],pt[4],pt[5],pt[6],pt[7],nt,at,rt,tt,U,F,B,N,z,l,j),f&&!k&&this.manager.postBatch(f)},batchTextureFrame:function(f,l,u,v,m,x,g){this.manager.set(this);var y=this._tempMatrix1.copyFrom(x),T=this._tempMatrix2;g?y.multiply(g,T):T=y;var E=T.setQuad(l,u,l+f.width,u+f.height),P=this.setTexture2D(f.source.glTexture);v=s.getTintAppendFloatAlpha(v,m),this.batchQuad(null,E[0],E[1],E[2],E[3],E[4],E[5],E[6],E[7],f.u0,f.v0,f.u1,f.v1,v,v,v,v,0,f.glTexture,P)},batchFillRect:function(f,l,u,v,m,x){this.renderer.pipelines.set(this);var g=this.calcMatrix;x&&x.multiply(m,g);var y=g.setQuad(f,l,f+u,l+v),T=this.fillTint;this.batchQuad(null,y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],0,0,1,1,T.TL,T.TR,T.BL,T.BR,2)},batchFillTriangle:function(f,l,u,v,m,x,g,y){this.renderer.pipelines.set(this);var T=this.calcMatrix;y&&y.multiply(g,T);var E=T.getX(f,l),P=T.getY(f,l),R=T.getX(u,v),M=T.getY(u,v),L=T.getX(m,x),O=T.getY(m,x),D=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,E,P,R,M,L,O,0,0,1,1,D.TL,D.TR,D.BL,2)},batchStrokeTriangle:function(f,l,u,v,m,x,g,y,T){var E=this.tempTriangle;E[0].x=f,E[0].y=l,E[0].width=g,E[1].x=u,E[1].y=v,E[1].width=g,E[2].x=m,E[2].y=x,E[2].width=g,E[3].x=f,E[3].y=l,E[3].width=g,this.batchStrokePath(E,g,!1,y,T)},batchFillPath:function(f,l,u){this.renderer.pipelines.set(this);var v=this.calcMatrix;u&&u.multiply(l,v);for(var m=f.length,x=this.polygonCache,g,y,T=this.fillTint.TL,E=this.fillTint.TR,P=this.fillTint.BL,R=0;R0&&st[4]?this.batchQuad(null,_,q,Q,$,st[0],st[1],st[2],st[3],0,0,1,1,nt,at,rt,tt,2):(it[0]=_,it[1]=q,it[2]=Q,it[3]=$,it[4]=1),T&&it[4]?this.batchQuad(null,K,Z,j,k,it[0],it[1],it[2],it[3],0,0,1,1,nt,at,rt,tt,2):(st[0]=K,st[1]=Z,st[2]=j,st[3]=k,st[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,i.prototype.destroy.call(this),this}});p.exports=o},43439:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(4127),r=t(89924),n=t(29100),e=new d({Extends:n,initialize:function(h){h.vertShader=c(h,"vertShader",r),h.fragShader=c(h,"fragShader",a),h.attributes=c(h,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),n.call(this,h)},onRender:function(s,h){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",h.zoom)},batchPointLight:function(s,h,i,o,f,l,u,v,m,x,g,y){var T=s.color,E=s.intensity,P=s.radius,R=s.attenuation,M=T.r*E,L=T.g*E,O=T.b*E,D=h.alpha*s.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(i,o,g,y,P,R,M,L,O,D),this.batchLightVert(f,l,g,y,P,R,M,L,O,D),this.batchLightVert(u,v,g,y,P,R,M,L,O,D),this.batchLightVert(i,o,g,y,P,R,M,L,O,D),this.batchLightVert(u,v,g,y,P,R,M,L,O,D),this.batchLightVert(m,x,g,y,P,R,M,L,O,D),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(s,h,i,o,f,l,u,v,m,x){var g=this.vertexViewF32,y=this.vertexCount*this.currentShader.vertexComponentCount-1;g[++y]=s,g[++y]=h,g[++y]=i,g[++y]=o,g[++y]=f,g[++y]=l,g[++y]=u,g[++y]=v,g[++y]=m,g[++y]=x,this.vertexCount++}});p.exports=e},84057:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(89422),a=t(95540),r=t(27681),n=t(49627),e=t(29100),s=new d({Extends:e,initialize:function(i){i.renderTarget=a(i,"renderTarget",1),i.fragShader=a(i,"fragShader",r),i.vertShader=a(i,"vertShader",n),i.attributes=a(i,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),i.batchSize=1,i.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],e.call(this,i),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new c,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){e.prototype.boot.call(this);var h=this.manager.UTILITY_PIPELINE;this.fullFrame1=h.fullFrame1,this.fullFrame2=h.fullFrame2,this.halfFrame1=h.halfFrame1,this.halfFrame2=h.halfFrame2;var i=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",i.width,i.height),this.set1i("uRoundPixels",i.config.roundPixels);for(var o=this.renderTargets,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(67502),a=t(83419),r=t(96293),n=t(95540),e=t(57516),s=t(27681),h=t(87841),i=t(32302),o=t(45561),f=t(60722),l=t(29100),u=new a({Extends:e,initialize:function(m){var x=n(m,"fragShader",s),g=n(m,"vertShader",f),y=n(m,"drawShader",s),T=[{name:"DrawSprite",fragShader:o,vertShader:f},{name:"CopySprite",fragShader:x,vertShader:g},{name:"DrawGame",fragShader:y,vertShader:f},{name:"ColorMatrix",fragShader:r}],E=n(m,"shaders",[]);m.shaders=T.concat(E),m.vertShader||(m.vertShader=g),m.batchSize=1,e.call(this,m),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new h,this.targetBounds=new h,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){l.prototype.boot.call(this);var v=this.shaders,m=this.renderer;this.drawSpriteShader=v[0],this.copyShader=v[1],this.gameShader=v[2],this.colorMatrixShader=v[3],this.fsTarget=new i(m,m.width,m.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var x=new ArrayBuffer(168);this.quadVertexData=x,this.quadVertexViewF32=new Float32Array(x),this.quadVertexBuffer=m.createVertexBuffer(x,this.gl.STATIC_DRAW),this.onResize(m.width,m.height),this.currentShader=this.copyShader,this.set2f("uResolution",m.width,m.height),this.set1i("uRoundPixels",m.config.roundPixels)},onResize:function(v,m){var x=this.quadVertexViewF32;x[1]=m,x[22]=m,x[14]=v,x[28]=v,x[35]=v,x[36]=m},batchQuad:function(v,m,x,g,y,T,E,P,R,M,L,O,D,I,V,X,H,G,U){var F=Math.min(m,g,T,P),B=Math.min(x,y,E,R),N=Math.max(m,g,T,P),z=Math.max(x,y,E,R),Y=N-F,K=z-B,Z=this.spriteBounds.setTo(F,B,Y,K),Q=v?v.preFX.padding:0,$=Y+Q*2,j=K+Q*2,k=Math.abs(Math.max($,j)),_=this.manager.getRenderTarget(k),q=this.targetBounds.setTo(0,0,_.width,_.height);c(q,Z.centerX,Z.centerY),this.tempSprite=v;var et=this.gl,nt=this.renderer;nt.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",nt.width,nt.height),this.set1i("uRoundPixels",nt.config.roundPixels),this.flipProjectionMatrix(!0),v&&(this.onDrawSprite(v,_),v.preFX.onFX(this));var at=this.fsTarget;return this.flush(),et.viewport(0,0,nt.width,nt.height),et.bindFramebuffer(et.FRAMEBUFFER,at.framebuffer.webGLFramebuffer),et.framebufferTexture2D(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,et.TEXTURE_2D,at.texture.webGLTexture,0),et.clearColor(0,0,0,0),et.clear(et.COLOR_BUFFER_BIT),this.setTexture2D(U),this.batchVert(m,x,M,L,0,G,I),this.batchVert(g,y,M,D,0,G,X),this.batchVert(T,E,O,D,0,G,H),this.batchVert(m,x,M,L,0,G,I),this.batchVert(T,E,O,D,0,G,H),this.batchVert(P,R,O,L,0,G,V),this.flush(),this.flipProjectionMatrix(!1),et.activeTexture(et.TEXTURE0),et.bindTexture(et.TEXTURE_2D,_.texture.webGLTexture),et.copyTexSubImage2D(et.TEXTURE_2D,0,0,0,q.x,q.y,q.width,q.height),et.bindFramebuffer(et.FRAMEBUFFER,null),et.bindTexture(et.TEXTURE_2D,null),this.onBatch(v),this.currentShader=this.copyShader,this.onDraw(_,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(v,m,x,g,y,T,E){x===void 0&&(x=!0),g===void 0&&(g=!0),y===void 0&&(y=!1),E===void 0&&(E=this.copyShader);var P=this.gl,R=this.tempSprite;T&&(E=this.colorMatrixShader),this.currentShader=E;var M=this.setVertexBuffer(this.quadVertexBuffer);E.bind(M,!1);var L=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",L.width,L.height),this.set1i("uRoundPixels",L.config.roundPixels),R.preFX.onFXCopy(this),this.onCopySprite(v,m,R),T&&(this.set1fv("uColorMatrix",T.getData()),this.set1f("uAlpha",T.alpha)),P.activeTexture(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,v.texture.webGLTexture),v.height>m.height)P.viewport(0,0,v.width,v.height),this.setTargetUVs(v,m);else{var O=m.height-v.height;P.viewport(0,O,v.width,v.height),this.resetUVs()}if(P.bindFramebuffer(P.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,m.texture.webGLTexture,0),x&&(P.clearColor(0,0,0,+!g),P.clear(P.COLOR_BUFFER_BIT)),y){var D=this.renderer.currentBlendMode;this.renderer.setBlendMode(d.ERASE)}P.bufferData(P.ARRAY_BUFFER,this.quadVertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),y&&this.renderer.setBlendMode(D),P.bindFramebuffer(P.FRAMEBUFFER,null)},copy:function(v,m){var x=this.gl;this.set1i("uMainSampler",0),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,v.texture.webGLTexture),x.viewport(0,0,v.width,v.height),this.setUVs(0,0,0,1,1,1,1,0),x.bindFramebuffer(x.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,m.texture.webGLTexture,0),x.clearColor(0,0,0,0),x.clear(x.COLOR_BUFFER_BIT),x.bufferData(x.ARRAY_BUFFER,this.quadVertexData,x.STATIC_DRAW),x.drawArrays(x.TRIANGLES,0,6),x.bindFramebuffer(x.FRAMEBUFFER,null)},blendFrames:function(v,m,x,g,y){this.manager.blendFrames(v,m,x,g,y)},blendFramesAdditive:function(v,m,x,g,y){this.manager.blendFramesAdditive(v,m,x,g,y)},drawToGame:function(v){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(v)},copyToGame:function(v){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(v)},bindAndDraw:function(v){var m=this.gl,x=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(v.texture);var g=this._tempMatrix1.loadIdentity(),y=this.targetBounds.x,T=this.targetBounds.y,E=y+v.width,P=T+v.height,R=g.getX(y,T),M=g.getX(y,P),L=g.getX(E,P),O=g.getX(E,T),D=g.getY(y,T),I=g.getY(y,P),V=g.getY(E,P),X=g.getY(E,T),H=16777215;this.batchVert(R,D,0,0,0,0,H),this.batchVert(M,I,0,1,0,0,H),this.batchVert(L,V,1,1,0,0,H),this.batchVert(R,D,0,0,0,0,H),this.batchVert(L,V,1,1,0,0,H),this.batchVert(O,X,1,0,0,0,H),x.restoreFramebuffer(!1,!0),x.currentFramebuffer||m.viewport(0,0,x.width,x.height),x.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(v){this.drawToGame(v)},setUVs:function(v,m,x,g,y,T,E,P){var R=this.quadVertexViewF32;R[2]=v,R[3]=m,R[9]=x,R[10]=g,R[16]=y,R[17]=T,R[23]=v,R[24]=m,R[30]=y,R[31]=T,R[37]=E,R[38]=P},setTargetUVs:function(v,m){var x=m.height/v.height;x>.5?x=.5-(x-.5):x=.5+(.5-x),this.setUVs(0,x,0,1+x,1,1+x,1,x)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){return this.renderer.deleteBuffer(this.quadVertexBuffer),this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.colorMatrixShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,e.prototype.destroy.call(this),this}});p.exports=u},81041:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(57516),r=new d({Extends:a,initialize:function(e){e.topology=5,e.batchSize=c(e,"batchSize",256),a.call(this,e)}});p.exports=r},12385:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(57516),r=t(45561),n=t(60722),e=t(29100),s=new d({Extends:a,initialize:function(i){i.fragShader=c(i,"fragShader",r),i.vertShader=c(i,"vertShader",n),i.forceZero=!0,a.call(this,i)},boot:function(){e.prototype.boot.call(this);var h=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",h.width,h.height),this.set1i("uRoundPixels",h.config.roundPixels)}});p.exports=s},7589:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35407),c=t(10312),a=t(83419),r=t(89422),n=t(96293),e=t(36682),s=t(95540),h=t(48247),i=t(49627),o=t(29100),f=new a({Extends:o,initialize:function(u){u.renderTarget=s(u,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),u.vertShader=s(u,"vertShader",i),u.shaders=s(u,"shaders",[{name:"Copy",fragShader:e},{name:"AddBlend",fragShader:d},{name:"LinearBlend",fragShader:h},{name:"ColorMatrix",fragShader:n}]),u.attributes=s(u,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),u.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],u.batchSize=1,o.call(this,u),this.colorMatrix=new r,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){o.prototype.boot.call(this);var l=this.shaders,u=this.renderTargets;this.copyShader=l[0],this.addShader=l[1],this.linearShader=l[2],this.colorMatrixShader=l[3],this.fullFrame1=u[0],this.fullFrame2=u[1],this.halfFrame1=u[2],this.halfFrame2=u[3]},copyFrame:function(l,u,v,m,x){v===void 0&&(v=1),m===void 0&&(m=!0),x===void 0&&(x=!0);var g=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",v),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,l.texture.webGLTexture),u?(g.viewport(0,0,u.width,u.height),g.bindFramebuffer(g.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,u.texture.webGLTexture,0)):g.viewport(0,0,l.width,l.height),m&&(x?g.clearColor(0,0,0,0):g.clearColor(0,0,0,1),g.clear(g.COLOR_BUFFER_BIT)),g.bufferData(g.ARRAY_BUFFER,this.vertexData,g.STATIC_DRAW),g.drawArrays(g.TRIANGLES,0,6),g.bindFramebuffer(g.FRAMEBUFFER,null),g.bindTexture(g.TEXTURE_2D,null)},blitFrame:function(l,u,v,m,x,g,y){v===void 0&&(v=1),m===void 0&&(m=!0),x===void 0&&(x=!0),g===void 0&&(g=!1),y===void 0&&(y=!1);var T=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",v),T.activeTexture(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,l.texture.webGLTexture),l.height>u.height)T.viewport(0,0,l.width,l.height),this.setTargetUVs(l,u);else{var E=u.height-l.height;T.viewport(0,E,l.width,l.height)}if(T.bindFramebuffer(T.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,u.texture.webGLTexture,0),m&&(x?T.clearColor(0,0,0,0):T.clearColor(0,0,0,1),T.clear(T.COLOR_BUFFER_BIT)),g){var P=this.renderer.currentBlendMode;this.renderer.setBlendMode(c.ERASE)}y&&this.flipY(),T.bufferData(T.ARRAY_BUFFER,this.vertexData,T.STATIC_DRAW),T.drawArrays(T.TRIANGLES,0,6),g&&this.renderer.setBlendMode(P),T.bindFramebuffer(T.FRAMEBUFFER,null),T.bindTexture(T.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(l,u,v,m,x,g,y,T){y===void 0&&(y=!0),T===void 0&&(T=!0);var E=this.gl;E.bindFramebuffer(E.FRAMEBUFFER,l.framebuffer.webGLFramebuffer),E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,l.texture.webGLTexture,0),y&&(T?E.clearColor(0,0,0,0):E.clearColor(0,0,0,1),E.clear(E.COLOR_BUFFER_BIT)),E.activeTexture(E.TEXTURE0),E.bindTexture(E.TEXTURE_2D,u.texture.webGLTexture),E.copyTexSubImage2D(E.TEXTURE_2D,0,0,0,v,m,x,g),E.bindFramebuffer(E.FRAMEBUFFER,null),E.bindTexture(E.TEXTURE_2D,null)},copyToGame:function(l){var u=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l.texture.webGLTexture),u.bufferData(u.ARRAY_BUFFER,this.vertexData,u.STATIC_DRAW),u.drawArrays(u.TRIANGLES,0,6)},drawFrame:function(l,u,v,m){v===void 0&&(v=!0),m===void 0&&(m=this.colorMatrix);var x=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",m.getData()),this.set1f("uAlpha",m.alpha),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,l.texture.webGLTexture),u?(x.viewport(0,0,u.width,u.height),x.bindFramebuffer(x.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,u.texture.webGLTexture,0)):x.viewport(0,0,l.width,l.height),v?x.clearColor(0,0,0,0):x.clearColor(0,0,0,1),x.clear(x.COLOR_BUFFER_BIT),x.bufferData(x.ARRAY_BUFFER,this.vertexData,x.STATIC_DRAW),x.drawArrays(x.TRIANGLES,0,6),x.bindFramebuffer(x.FRAMEBUFFER,null),x.bindTexture(x.TEXTURE_2D,null)},blendFrames:function(l,u,v,m,x,g){m===void 0&&(m=1),x===void 0&&(x=!0),g===void 0&&(g=this.linearShader);var y=this.gl;this.setShader(g),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",m),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,l.texture.webGLTexture),y.activeTexture(y.TEXTURE1),y.bindTexture(y.TEXTURE_2D,u.texture.webGLTexture),v?(y.bindFramebuffer(y.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,v.texture.webGLTexture,0),y.viewport(0,0,v.width,v.height)):y.viewport(0,0,l.width,l.height),x?y.clearColor(0,0,0,0):y.clearColor(0,0,0,1),y.clear(y.COLOR_BUFFER_BIT),y.bufferData(y.ARRAY_BUFFER,this.vertexData,y.STATIC_DRAW),y.drawArrays(y.TRIANGLES,0,6),y.bindFramebuffer(y.FRAMEBUFFER,null),y.bindTexture(y.TEXTURE_2D,null)},blendFramesAdditive:function(l,u,v,m,x){this.blendFrames(l,u,v,m,x,this.addShader)},clearFrame:function(l,u){u===void 0&&(u=!0);var v=this.gl;v.viewport(0,0,l.width,l.height),v.bindFramebuffer(v.FRAMEBUFFER,l.framebuffer.webGLFramebuffer),u?v.clearColor(0,0,0,0):v.clearColor(0,0,0,1),v.clear(v.COLOR_BUFFER_BIT);var m=this.renderer.currentFramebuffer;v.bindFramebuffer(v.FRAMEBUFFER,m.webGLFramebuffer)},setUVs:function(l,u,v,m,x,g,y,T){var E=this.vertexViewF32;E[2]=l,E[3]=u,E[6]=v,E[7]=m,E[10]=x,E[11]=g,E[14]=l,E[15]=u,E[18]=x,E[19]=g,E[22]=y,E[23]=T},setTargetUVs:function(l,u){var v=u.height/l.height;v>.5?v=.5-(v-.5):v=.5+(.5-v),this.setUVs(0,v,0,1+v,1,1+v,1,v)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});p.exports=f},36060:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"};p.exports=C},84817:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelineafterflush"},36712:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelinebeforeflush"},40285:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelinebind"},65918:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelineboot"},92852:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelinedestroy"},56072:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelinerebind"},57566:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pipelineresize"},77085:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AFTER_FLUSH:t(84817),BEFORE_FLUSH:t(36712),BIND:t(40285),BOOT:t(65918),DESTROY:t(92852),REBIND:t(56072),RESIZE:t(57566)}},54812:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(99155),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.amount=1},onPreRender:function(n,e){n=this.getController(n),this.set1f("amount",n.amount,e)}});p.exports=r},67329:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(24400),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(n){n=this.getController(n),this.set1f("strength",n.blurStrength),this.set3fv("color",n.glcolor)},onDraw:function(n){var e=this.getController(),s=this.fullFrame1,h=this.fullFrame2;this.copyFrame(n,h);for(var i=2/n.width*e.offsetX,o=2/n.height*e.offsetY,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(41514),a=t(51078),r=t(94328),n=t(84057),e=new d({Extends:n,initialize:function(h){n.call(this,{game:h,shaders:[{name:"Gaussian5",fragShader:c},{name:"Gaussian9",fragShader:a},{name:"Gaussian13",fragShader:r}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(s){var h=this.getController(),i=this.gl,o=this.fullFrame1,f=i.getParameter(i.FRAMEBUFFER_BINDING);this.bind(this.shaders[h.quality]),i.activeTexture(i.TEXTURE0),i.viewport(0,0,s.width,s.height),this.set1i("uMainSampler",0),this.set2f("resolution",s.width,s.height),this.set1f("strength",h.strength),this.set3fv("color",h.glcolor);for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(90610),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(n,e,s,h){n=this.getController(n),this.set1f("radius",n.radius,e),this.set1f("amount",n.amount,e),this.set1f("contrast",n.contrast,e),this.set1f("strength",n.strength,e),this.set2f("blur",n.blurX,n.blurY,e),this.setBoolean("isTiltShift",n.isTiltShift,e),s&&h&&this.set2f("resolution",s,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});p.exports=r},89428:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(91899),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(n,e,s,h){n=this.getController(n),this.set1f("scale",n.scale,e),this.set1f("feather",n.feather,e),this.set1f("thickness",n.thickness,e),this.set3fv("color",n.glcolor,e),this.set4fv("backgroundColor",n.glcolor2,e),s&&h&&this.set2f("resolution",s,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});p.exports=r},88904:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(84057),a=new d({Extends:c,initialize:function(n){c.call(this,{game:n})},onDraw:function(r){var n=this.fullFrame1;this.controller?this.manager.drawFrame(r,n,!0,this.controller):this.drawFrame(r,n),this.copyToGame(n)}});p.exports=a},63563:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(47838),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(n){var e=this.game.textures.getFrame(n);e&&(this.glTexture=e.glTexture)},onDraw:function(n){var e=this.getController(),s=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",e.x,e.y),this.bindTexture(e.glTexture,1),this.copySprite(n,s),this.copyToGame(s)}});p.exports=r},94045:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=t(98656),r=t(84057),n=t(70554),e=new d({Extends:r,initialize:function(h,i){var o=c(i,"quality",.1),f=c(i,"distance",10);r.call(this,{game:h,fragShader:n.setGlowQuality(a,h,o,f)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(s,h,i,o){s=this.getController(s),this.set1f("outerStrength",s.outerStrength,h),this.set1f("innerStrength",s.innerStrength,h),this.set4fv("glowColor",s.glcolor,h),this.setBoolean("knockout",s.knockout,h),i&&o&&this.set2f("resolution",i,o,h)},onDraw:function(s){this.set2f("resolution",s.width,s.height),this.bindAndDraw(s)}});p.exports=e},74088:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(70463),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(n,e){n=this.getController(n),this.set1f("alpha",n.alpha,e),this.set1i("size",n.size,e),this.set3fv("color1",n.glcolor1,e),this.set3fv("color2",n.glcolor2,e),this.set2f("positionFrom",n.fromX,n.fromY,e),this.set2f("positionTo",n.toX,n.toY,e)}});p.exports=r},99636:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50831),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.amount=1},onPreRender:function(n,e,s,h){n=this.getController(n),this.set1f("amount",n.amount,e),s&&h&&this.set2f("resolution",s,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});p.exports=r},34700:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(92595),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(n,e){n=this.getController(n);var s=n.samples;this.set1i("samples",s,e),this.set1f("intensity",n.intensity,e),this.set1f("decay",n.decay,e),this.set1f("power",n.power/s,e),this.set2f("lightPosition",n.x,n.y,e),this.set4fv("color",n.glcolor,e)}});p.exports=r},91157:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(72464),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(n,e,s,h){n=this.getController(n),this.setTime("time",e),this.set1f("speed",n.speed,e),this.set1f("lineWidth",n.lineWidth,e),this.set1f("gradient",n.gradient,e),this.setBoolean("reveal",n.reveal,e),s&&h&&this.set2f("resolution",s,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});p.exports=r},27797:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(39249),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(n,e){n=this.getController(n),this.set1f("radius",n.radius,e),this.set1f("strength",n.strength,e),this.set2f("position",n.x,n.y,e)}});p.exports=r},67603:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(2878),a=t(84057),r=new d({Extends:a,initialize:function(e){a.call(this,{game:e,fragShader:c}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(n,e){n=this.getController(n);var s=n.progress,h=n.wipeWidth,i=n.direction,o=n.axis;this.set4f("config",s,h,i,o,e),this.setBoolean("reveal",n.reveal,e)}});p.exports=r},58918:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={Barrel:t(54812),Bloom:t(67329),Blur:t(8861),Bokeh:t(51051),Circle:t(89428),ColorMatrix:t(88904),Displacement:t(63563),Glow:t(94045),Gradient:t(74088),Pixelate:t(99636),Shadow:t(34700),Shine:t(91157),Vignette:t(27797),Wipe:t(67603)};p.exports=d},96615:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(36060),c=t(79291),a={FX:t(58918),BitmapMaskPipeline:t(31302),Events:t(77085),FXPipeline:t(92651),LightPipeline:t(96569),MobilePipeline:t(56527),MultiPipeline:t(57516),PointLightPipeline:t(43439),PostFXPipeline:t(84057),PreFXPipeline:t(43558),RopePipeline:t(81041),SinglePipeline:t(12385),UtilityPipeline:t(7589)};a=c(!1,a,d),p.exports=a},35407:p=>{p.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = frame1 + frame2 * uStrength;","}"].join(` +`)},78908:p=>{p.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","precision mediump float;","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join(` +`)},85191:p=>{p.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","precision mediump float;","attribute vec2 inPosition;","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}"].join(` +`)},96293:p=>{p.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join(` +`)},36682:p=>{p.exports=["#define SHADER_NAME PHASER_COPY_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uBrightness;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}"].join(` +`)},99155:p=>{p.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join(` +`)},24400:p=>{p.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join(` +`)},94328:p=>{p.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},41514:p=>{p.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},51078:p=>{p.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},90610:p=>{p.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join(` +`)},91899:p=>{p.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join(` +`)},47838:p=>{p.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join(` +`)},98656:p=>{p.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join(` +`)},70463:p=>{p.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join(` +`)},50831:p=>{p.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join(` +`)},92595:p=>{p.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join(` +`)},72464:p=>{p.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join(` +`)},39249:p=>{p.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," col = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join(` +`)},2878:p=>{p.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join(` +`)},31063:p=>{p.exports=["#define SHADER_NAME PHASER_LIGHT_FS","precision mediump float;","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = %LIGHT_COUNT%;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}"].join(` +`)},48247:p=>{p.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}"].join(` +`)},41214:p=>{p.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join(` +`)},39653:p=>{p.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join(` +`)},62143:p=>{p.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},47940:p=>{p.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},98840:p=>{p.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler[%count%];","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture;"," %forloop%"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},44667:p=>{p.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},4127:p=>{p.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","precision mediump float;","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join(` +`)},89924:p=>{p.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}"].join(` +`)},27681:p=>{p.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join(` +`)},49627:p=>{p.exports=["#define SHADER_NAME PHASER_QUAD_VS","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join(` +`)},45561:p=>{p.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},60722:p=>{p.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},89350:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AddBlendFrag:t(35407),BitmapMaskFrag:t(78908),BitmapMaskVert:t(85191),ColorMatrixFrag:t(96293),CopyFrag:t(36682),FXBarrelFrag:t(99155),FXBloomFrag:t(24400),FXBlurHighFrag:t(94328),FXBlurLowFrag:t(41514),FXBlurMedFrag:t(51078),FXBokehFrag:t(90610),FXCircleFrag:t(91899),FXDisplacementFrag:t(47838),FXGlowFrag:t(98656),FXGradientFrag:t(70463),FXPixelateFrag:t(50831),FXShadowFrag:t(92595),FXShineFrag:t(72464),FXVignetteFrag:t(39249),FXWipeFrag:t(2878),LightFrag:t(31063),LinearBlendFrag:t(48247),MeshFrag:t(41214),MeshVert:t(39653),MobileFrag:t(62143),MobileVert:t(47940),MultiFrag:t(98840),MultiVert:t(44667),PointLightFrag:t(4127),PointLightVert:t(89924),PostFXFrag:t(27681),QuadVert:t(49627),SingleFrag:t(45561),SingleVert:t(60722)}},93567:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e){this.webGLAttribLocation=-1,this.gl=r,this.program=n,this.name=e,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLAttribLocation=-1;return}var a=this.gl;a.isContextLost()||(this.webGLAttribLocation=a.getAttribLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});p.exports=c},26128:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s){this.webGLBuffer=null,this.gl=r,this.initialDataOrSize=n,this.bufferType=e,this.bufferUsage=s,this.createResource()},createResource:function(){if(this.initialDataOrSize!==null){var a=this.gl;if(!a.isContextLost()){var r=this.bufferType,n=a.createBuffer();this.webGLBuffer=n,a.bindBuffer(r,this.webGLBuffer),a.bufferData(r,this.initialDataOrSize,this.bufferUsage),a.bindBuffer(r,null)}}},destroy:function(){var a=this.gl;a.isContextLost()||a.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});p.exports=c},84387:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},a=new d({initialize:function(n,e,s,h,i){this.webGLFramebuffer=null,this.gl=n,this.width=e,this.height=s,this.renderTexture=h,this.addDepthStencilBuffer=!!i,this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){var n=this.renderTexture,e=0,s=r.createFramebuffer();if(this.webGLFramebuffer=s,r.bindFramebuffer(r.FRAMEBUFFER,s),n.isRenderTexture=!0,n.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,n.webGLTexture,0),e=r.checkFramebufferStatus(r.FRAMEBUFFER),e!==r.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(c[e]||e));if(this.addDepthStencilBuffer){var h=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,h),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,this.width,this.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,h)}r.bindFramebuffer(r.FRAMEBUFFER,null)}},destroy:function(){if(this.webGLFramebuffer!==null){var r=this.gl;if(!r.isContextLost()){r.bindFramebuffer(r.FRAMEBUFFER,this.webGLFramebuffer);var n=r.getFramebufferAttachmentParameter(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);n!==null&&(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,null,0),r.deleteTexture(n));var e=r.getFramebufferAttachmentParameter(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);e!==null&&r.deleteRenderbuffer(e),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});p.exports=a},1482:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e){this.webGLProgram=null,this.gl=r,this.vertexSource=n,this.fragmentSource=e,this.createResource()},createResource:function(){var a=this.gl;if(!a.isContextLost()){var r=a.createProgram(),n=a.createShader(a.VERTEX_SHADER),e=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(n,this.vertexSource),a.shaderSource(e,this.fragmentSource),a.compileShader(n),a.compileShader(e);var s=`Shader failed: +`;if(!a.getShaderParameter(n,a.COMPILE_STATUS))throw new Error("Vertex "+s+a.getShaderInfoLog(n));if(!a.getShaderParameter(e,a.COMPILE_STATUS))throw new Error("Fragment "+s+a.getShaderInfoLog(e));if(a.attachShader(r,n),a.attachShader(r,e),a.linkProgram(r),!a.getProgramParameter(r,a.LINK_STATUS))throw new Error("Link "+s+a.getProgramInfoLog(r));a.useProgram(r),this.webGLProgram=r}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});p.exports=c},82751:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50030),a=new d({initialize:function(n,e,s,h,i,o,f,l,u,v,m,x,g){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=n,this.mipLevel=e,this.minFilter=s,this.magFilter=h,this.wrapT=i,this.wrapS=o,this.format=f,this.pixels=l,this.width=u,this.height=v,this.pma=m??!0,this.forceSize=!!x,this.flipY=!!g,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){if(this.pixels instanceof a){this.webGLTexture=this.pixels.webGLTexture;return}var n=r.createTexture();r.activeTexture(r.TEXTURE0);var e=r.getParameter(r.TEXTURE_BINDING_2D);r.bindTexture(r.TEXTURE_2D,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.minFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.magFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this.wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this.wrapT),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),this.flipY&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0);var s=this.pixels,h=this.mipLevel,i=this.width,o=this.height,f=this.format,l=!1;if(s==null)r.texImage2D(r.TEXTURE_2D,h,f,i,o,0,f,r.UNSIGNED_BYTE,null),l=c(i,o);else if(s.compressed){i=s.width,o=s.height,l=s.generateMipmap;for(var u=0;u{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e){this.webGLUniformLocation=null,this.gl=r,this.program=n,this.name=e,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLUniformLocation=null;return}var a=this.gl;a.isContextLost()||(this.webGLUniformLocation=a.getUniformLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});p.exports=c},9503:(p,C,t)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={WebGLAttribLocationWrapper:t(93567),WebGLBufferWrapper:t(26128),WebGLProgramWrapper:t(1482),WebGLTextureWrapper:t(82751),WebGLFramebufferWrapper:t(84387),WebGLUniformLocationWrapper:t(57183)};p.exports=d},76531:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(13560),c=t(83419),a=t(50792),r=t(97480),n=t(8443),e=t(57811),s=t(74403),h=t(45818),i=t(29747),o=t(87841),f=t(86555),l=t(56583),u=t(26099),v=t(38058),m=new c({Extends:a,initialize:function(g){a.call(this),this.game=g,this.canvas,this.canvasBounds=new o,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=d.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new u(1,1),this.autoRound=!1,this.autoCenter=d.CENTER.NO_CENTER,this.orientation=d.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.domlisteners={orientationChange:i,windowResize:i,fullScreenChange:i,fullScreenError:i}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(n.BOOT,this.boot,this)},boot:function(){var x=this.game;this.canvas=x.canvas,this.fullscreen=x.device.fullscreen,this.scaleMode!==d.SCALE_MODE.RESIZE&&this.scaleMode!==d.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===d.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),x.events.on(n.PRE_STEP,this.step,this),x.events.once(n.READY,this.refresh,this),x.events.once(n.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(x){this.getParent(x),this.getParentBounds();var g=x.width,y=x.height,T=x.scaleMode,E=x.zoom,P=x.autoRound;if(typeof g=="string")if(g.substr(-1)!=="%")g=parseInt(g,10);else{var R=this.parentSize.width;R===0&&(R=window.innerWidth);var M=parseInt(g,10)/100;g=Math.floor(R*M)}if(typeof y=="string")if(y.substr(-1)!=="%")y=parseInt(y,10);else{var L=this.parentSize.height;L===0&&(L=window.innerHeight);var O=parseInt(y,10)/100;y=Math.floor(L*O)}this.scaleMode=T,this.autoRound=P,this.autoCenter=x.autoCenter,this.resizeInterval=x.resizeInterval,P&&(g=Math.floor(g),y=Math.floor(y)),this.gameSize.setSize(g,y),E===d.ZOOM.MAX_ZOOM&&(E=this.getMaxZoom()),this.zoom=E,E!==1&&(this._resetZoom=!0),this.baseSize.setSize(g,y),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),x.minWidth>0&&this.displaySize.setMin(x.minWidth*E,x.minHeight*E),x.maxWidth>0&&this.displaySize.setMax(x.maxWidth*E,x.maxHeight*E),this.displaySize.setSize(g,y),(x.snapWidth>0||x.snapHeight>0)&&this.displaySize.setSnap(x.snapWidth,x.snapHeight),this.orientation=h(g,y)},getParent:function(x){var g=x.parent;if(g!==null){if(this.parent=s(g),this.parentIsWindow=this.parent===document.body,x.expandParent&&x.scaleMode!==d.SCALE_MODE.NONE){var y=this.parent.getBoundingClientRect();(this.parentIsWindow||y.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",y=this.parent.getBoundingClientRect(),!this.parentIsWindow&&y.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}x.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=s(x.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var x=this.parentSize,g=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(g.height=e(!0));var y=g.width,T=g.height;if(x.width!==y||x.height!==T)return x.setSize(y,T),!0;if(this.canvas){var E=this.canvasBounds,P=this.canvas.getBoundingClientRect();if(P.x!==E.x||P.y!==E.y)return!0}return!1},lockOrientation:function(x){var g=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return g?g.call(screen,x):!1},setParentSize:function(x,g){return this.parentSize.setSize(x,g),this.refresh()},setGameSize:function(x,g){var y=this.autoRound;y&&(x=Math.floor(x),g=Math.floor(g));var T=this.width,E=this.height;return this.gameSize.resize(x,g),this.baseSize.resize(x,g),y&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(x/g),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(T,E)},resize:function(x,g){var y=this.zoom,T=this.autoRound;T&&(x=Math.floor(x),g=Math.floor(g));var E=this.width,P=this.height;this.gameSize.resize(x,g),this.baseSize.resize(x,g),T&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(x*y,g*y),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var R=this.canvas.style,M=x*y,L=g*y;return T&&(M=Math.floor(M),L=Math.floor(L)),(M!==x||L!==g)&&(R.width=M+"px",R.height=L+"px"),this.refresh(E,P)},setZoom:function(x){return this.zoom=x,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(x,g){return x===void 0&&(x=0),g===void 0&&(g=x),this.displaySize.setSnap(x,g),this.refresh()},refresh:function(x,g){x===void 0&&(x=this.width),g===void 0&&(g=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var y=this.game.domContainer;if(y){this.baseSize.setCSS(y);var T=this.canvas.style,E=y.style;E.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",E.marginLeft=T.marginLeft,E.marginTop=T.marginTop}return this.emit(r.RESIZE,this.gameSize,this.baseSize,this.displaySize,x,g),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var x=h(this.width,this.height);x!==this.orientation&&(this.orientation=x,this.emit(r.ORIENTATION_CHANGE,x))}},updateScale:function(){var x=this.canvas.style,g=this.gameSize.width,y=this.gameSize.height,T,E,P=this.zoom,R=this.autoRound;if(this.scaleMode===d.SCALE_MODE.NONE)this.displaySize.setSize(g*P,y*P),T=this.displaySize.width,E=this.displaySize.height,R&&(T=Math.floor(T),E=Math.floor(E)),this._resetZoom&&(x.width=T+"px",x.height=E+"px",this._resetZoom=!1);else if(this.scaleMode===d.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),T=this.displaySize.width,E=this.displaySize.height,R&&(T=Math.floor(T),E=Math.floor(E)),this.canvas.width=T,this.canvas.height=E;else if(this.scaleMode===d.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),T=this.displaySize.width,E=this.displaySize.height,R&&(T=Math.floor(T),E=Math.floor(E)),x.width=T+"px",x.height=E+"px";var M=this.parentSize.width/this.gameSize.width,L=this.parentSize.height/this.gameSize.height;M=0?0:-(E.x*P.x),M=E.y>=0?0:-(E.y*P.y),L;T.width>=E.width?L=y.width:L=y.width-(E.width-T.width)*P.x;var O;return T.height>=E.height?O=y.height:O=y.height-(E.height-T.height)*P.y,g.setTo(R,M,L,O),x&&(g.width/=x.zoomX,g.height/=x.zoomY,g.centerX=x.centerX+x.scrollX,g.centerY=x.centerY+x.scrollY),g},step:function(x,g){this.parent&&(this._lastCheck+=g,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var x=this.domlisteners;window.removeEventListener("orientationchange",x.orientationChange,!1),window.removeEventListener("resize",x.windowResize,!1);var g=["webkit","moz",""];g.forEach(function(y){document.removeEventListener(y+"fullscreenchange",x.fullScreenChange,!1),document.removeEventListener(y+"fullscreenerror",x.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",x.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",x.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===d.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===d.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});p.exports=m},64743:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={CENTER:t(64743),ORIENTATION:t(39218),SCALE_MODE:t(81050),ZOOM:t(80805)};p.exports=d},56139:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="enterfullscreen"},2336:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="fullscreenfailed"},47412:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="fullscreenunsupported"},51452:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="leavefullscreen"},20666:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="orientationchange"},47945:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resize"},97480:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ENTER_FULLSCREEN:t(56139),FULLSCREEN_FAILED:t(2336),FULLSCREEN_UNSUPPORTED:t(47412),LEAVE_FULLSCREEN:t(51452),ORIENTATION_CHANGE:t(20666),RESIZE:t(47945)}},93364:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=t(13560),a={Center:t(64743),Events:t(97480),Orientation:t(39218),ScaleManager:t(76531),ScaleModes:t(81050),Zoom:t(80805)};a=d(!1,a,c.CENTER),a=d(!1,a,c.ORIENTATION),a=d(!1,a,c.SCALE_MODE),a=d(!1,a,c.ZOOM),p.exports=a},27397:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=t(35355),a=function(r){var n=r.game.config.defaultPhysicsSystem,e=d(r.settings,"physics",!1);if(!(!n&&!e)){var s=[];if(n&&s.push(c(n+"Physics")),e)for(var h in e)h=c(h.concat("Physics")),s.indexOf(h)===-1&&s.push(h);return s}};p.exports=a},52106:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=function(a){var r=a.plugins.getDefaultScenePlugins(),n=d(a.settings,"plugins",!1);return Array.isArray(n)?n:r||[]};p.exports=c},87033:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"};p.exports=C},97482:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(2368),a=new d({initialize:function(n){this.sys=new c(this,n),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});p.exports=a},60903:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(89993),a=t(44594),r=t(8443),n=t(35154),e=t(54899),s=t(29747),h=t(97482),i=t(2368),o=new d({initialize:function(l,u){if(this.game=l,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,u){Array.isArray(u)||(u=[u]);for(var v=0;v-1&&(delete this.keys[v],this.scenes.splice(u,1),this._start.indexOf(v)>-1&&(u=this._start.indexOf(v),this._start.splice(u,1)),l.sys.destroy())}return this},bootScene:function(f){var l=f.sys,u=l.settings;l.sceneUpdate=s,f.init&&(f.init.call(f,u.data),u.status=c.INIT,u.isTransition&&l.events.emit(a.TRANSITION_INIT,u.transitionFrom,u.transitionDuration));var v;l.load&&(v=l.load,v.reset()),v&&f.preload?(f.preload.call(f),u.status=c.LOADING,v.once(e.COMPLETE,this.loadComplete,this),v.start()):this.create(f)},loadComplete:function(f){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(f.scene)},payloadComplete:function(f){this.bootScene(f.scene)},update:function(f,l){this.processQueue(),this.isProcessing=!0;for(var u=this.scenes.length-1;u>=0;u--){var v=this.scenes[u].sys;v.settings.status>c.START&&v.settings.status<=c.RUNNING&&v.step(f,l),v.scenePlugin&&v.scenePlugin._target&&v.scenePlugin.step(f,l)}},render:function(f){for(var l=0;l=c.LOADING&&u.settings.status=c.START&&m<=c.CREATING)return this;if(m>=c.RUNNING&&m<=c.SLEEPING)v.shutdown(),v.sceneUpdate=s,v.start(l);else{v.sceneUpdate=s,v.start(l);var x;if(v.load&&(x=v.load),x&&v.settings.hasOwnProperty("pack")&&(x.reset(),x.addPack({payload:v.settings.pack})))return v.settings.status=c.LOADING,x.once(e.COMPLETE,this.payloadComplete,this),x.start(),this}return this.bootScene(u),this},stop:function(f,l){var u=this.getScene(f);if(u&&!u.sys.isTransitioning()&&u.sys.settings.status!==c.SHUTDOWN){var v=u.sys.load;v&&(v.off(e.COMPLETE,this.loadComplete,this),v.off(e.COMPLETE,this.payloadComplete,this)),u.sys.shutdown(l)}return this},switch:function(f,l){var u=this.getScene(f),v=this.getScene(l);return u&&v&&u!==v&&(this.sleep(f),this.isSleeping(l)?this.wake(l):this.start(l)),this},getAt:function(f){return this.scenes[f]},getIndex:function(f){var l=this.getScene(f);return this.scenes.indexOf(l)},bringToTop:function(f){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:f,keyB:null});else{var l=this.getIndex(f);if(l!==-1&&l0){var u=this.getScene(f);this.scenes.splice(l,1),this.scenes.unshift(u)}}return this},moveDown:function(f){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:f,keyB:null});else{var l=this.getIndex(f);if(l>0){var u=l-1,v=this.getScene(f),m=this.getAt(u);this.scenes[l]=m,this.scenes[u]=v}}return this},moveUp:function(f){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:f,keyB:null});else{var l=this.getIndex(f);if(lu),0,m)}}return this},moveBelow:function(f,l){if(f===l)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:f,keyB:l});else{var u=this.getIndex(f),v=this.getIndex(l);if(u!==-1&&v!==-1&&v>u){var m=this.getAt(v);this.scenes.splice(v,1),u===0?this.scenes.unshift(m):this.scenes.splice(u-(v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(44594),r=t(95540),n=t(37277),e=new c({initialize:function(h){this.scene=h,this.systems=h.sys,this.settings=h.sys.settings,this.key=h.sys.settings.key,this.manager=h.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,h.sys.events.once(a.BOOT,this.boot,this),h.sys.events.on(a.START,this.pluginStart,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(a.SHUTDOWN,this.shutdown,this)},start:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",s,h),this},restart:function(s){var h=this.key;return this.manager.queueOp("stop",h),this.manager.queueOp("start",h,s),this},transition:function(s){s===void 0&&(s={});var h=r(s,"target",!1),i=this.manager.getScene(h);if(!h||!this.checkValidTransition(i))return!1;var o=r(s,"duration",1e3);this._elapsed=0,this._target=i,this._duration=o,this._willSleep=r(s,"sleep",!1),this._willRemove=r(s,"remove",!1);var f=r(s,"onUpdate",null);f&&(this._onUpdate=f,this._onUpdateScope=r(s,"onUpdateScope",this.scene));var l=r(s,"allowInput",!1);this.settings.transitionAllowInput=l;var u=i.sys.settings;u.isTransition=!0,u.transitionFrom=this.scene,u.transitionDuration=o,u.transitionAllowInput=l,r(s,"moveAbove",!1)?this.manager.moveAbove(this.key,h):r(s,"moveBelow",!1)&&this.manager.moveBelow(this.key,h),i.sys.isSleeping()?i.sys.wake(r(s,"data")):this.manager.start(h,r(s,"data"));var v=r(s,"onStart",null),m=r(s,"onStartScope",this.scene);return v&&v.call(m,this.scene,i,o),this.systems.events.emit(a.TRANSITION_OUT,i,o),!0},checkValidTransition:function(s){return!(!s||s.sys.isActive()||s.sys.isTransitioning()||s===this.scene||this.systems.isTransitioning())},step:function(s,h){this._elapsed+=h,this.transitionProgress=d(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var s=this._target.sys,h=this._target.sys.settings;s.events.emit(a.TRANSITION_COMPLETE,this.scene),h.isTransition=!1,h.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(s,h,i,o){return this.manager.add(s,h,i,o)},launch:function(s,h){return s&&s!==this.key&&this.manager.queueOp("start",s,h),this},run:function(s,h){return s&&s!==this.key&&this.manager.queueOp("run",s,h),this},pause:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("pause",s,h),this},resume:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("resume",s,h),this},sleep:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("sleep",s,h),this},wake:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("wake",s,h),this},switch:function(s){return s!==this.key&&this.manager.queueOp("switch",this.key,s),this},stop:function(s,h){return s===void 0&&(s=this.key),this.manager.queueOp("stop",s,h),this},setActive:function(s,h,i){h===void 0&&(h=this.key);var o=this.manager.getScene(h);return o&&o.sys.setActive(s,i),this},setVisible:function(s,h){h===void 0&&(h=this.key);var i=this.manager.getScene(h);return i&&i.sys.setVisible(s),this},isSleeping:function(s){return s===void 0&&(s=this.key),this.manager.isSleeping(s)},isActive:function(s){return s===void 0&&(s=this.key),this.manager.isActive(s)},isPaused:function(s){return s===void 0&&(s=this.key),this.manager.isPaused(s)},isVisible:function(s){return s===void 0&&(s=this.key),this.manager.isVisible(s)},swapPosition:function(s,h){return h===void 0&&(h=this.key),s!==h&&this.manager.swapPosition(s,h),this},moveAbove:function(s,h){return h===void 0&&(h=this.key),s!==h&&this.manager.moveAbove(s,h),this},moveBelow:function(s,h){return h===void 0&&(h=this.key),s!==h&&this.manager.moveBelow(s,h),this},remove:function(s){return s===void 0&&(s=this.key),this.manager.remove(s),this},moveUp:function(s){return s===void 0&&(s=this.key),this.manager.moveUp(s),this},moveDown:function(s){return s===void 0&&(s=this.key),this.manager.moveDown(s),this},bringToTop:function(s){return s===void 0&&(s=this.key),this.manager.bringToTop(s),this},sendToBack:function(s){return s===void 0&&(s=this.key),this.manager.sendToBack(s),this},get:function(s){return this.manager.getScene(s)},getStatus:function(s){var h=this.manager.getScene(s);if(h)return h.sys.getStatus()},getIndex:function(s){return s===void 0&&(s=this.key),this.manager.getIndex(s)},shutdown:function(){var s=this.systems.events;s.off(a.SHUTDOWN,this.shutdown,this),s.off(a.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});n.register("ScenePlugin",e,"scenePlugin"),p.exports=e},55681:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(89993),c=t(35154),a=t(46975),r=t(87033),n={create:function(e){return typeof e=="string"?e={key:e}:e===void 0&&(e={}),{status:d.PENDING,key:c(e,"key",""),active:c(e,"active",!1),visible:c(e,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:c(e,"pack",!1),cameras:c(e,"cameras",null),map:c(e,"map",a(r,c(e,"mapAdd",{}))),physics:c(e,"physics",{}),loader:c(e,"loader",{}),plugins:c(e,"plugins",!1),input:c(e,"input",{})}}};p.exports=n},2368:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(89993),a=t(42363),r=t(44594),n=t(27397),e=t(52106),s=t(29747),h=t(55681),i=new d({initialize:function(f,l){this.scene=f,this.game,this.renderer,this.config=l,this.settings=h.create(l),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=s},init:function(o){this.settings.status=c.INIT,this.sceneUpdate=s,this.game=o,this.renderer=o.renderer,this.canvas=o.canvas,this.context=o.context;var f=o.plugins;this.plugins=f,f.addToScene(this,a.Global,[a.CoreScene,e(this),n(this)]),this.events.emit(r.BOOT,this),this.settings.isBooted=!0},step:function(o,f){var l=this.events;l.emit(r.PRE_UPDATE,o,f),l.emit(r.UPDATE,o,f),this.sceneUpdate.call(this.scene,o,f),l.emit(r.POST_UPDATE,o,f)},render:function(o){var f=this.displayList;f.depthSort(),this.events.emit(r.PRE_RENDER,o),this.cameras.render(o,f),this.events.emit(r.RENDER,o)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(o){var f=this.settings,l=this.getStatus();return l!==c.CREATING&&l!==c.RUNNING?console.warn("Cannot pause non-running Scene",f.key):this.settings.active&&(f.status=c.PAUSED,f.active=!1,this.events.emit(r.PAUSE,this,o)),this},resume:function(o){var f=this.events,l=this.settings;return this.settings.active||(l.status=c.RUNNING,l.active=!0,f.emit(r.RESUME,this,o)),this},sleep:function(o){var f=this.settings,l=this.getStatus();return l!==c.CREATING&&l!==c.RUNNING?console.warn("Cannot sleep non-running Scene",f.key):(f.status=c.SLEEPING,f.active=!1,f.visible=!1,this.events.emit(r.SLEEP,this,o)),this},wake:function(o){var f=this.events,l=this.settings;return l.status=c.RUNNING,l.active=!0,l.visible=!0,f.emit(r.WAKE,this,o),l.isTransition&&f.emit(r.TRANSITION_WAKE,l.transitionFrom,l.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var o=this.settings.status;return o>c.PENDING&&o<=c.RUNNING},isSleeping:function(){return this.settings.status===c.SLEEPING},isActive:function(){return this.settings.status===c.RUNNING},isPaused:function(){return this.settings.status===c.PAUSED},isTransitioning:function(){return this.settings.isTransition||this.scenePlugin._target!==null},isTransitionOut:function(){return this.scenePlugin._target!==null&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(o){return this.settings.visible=o,this},setActive:function(o,f){return o?this.resume(f):this.pause(f)},start:function(o){var f=this.events,l=this.settings;o&&(l.data=o),l.status=c.START,l.active=!0,l.visible=!0,f.emit(r.START,this),f.emit(r.READY,this,o)},shutdown:function(o){var f=this.events,l=this.settings;f.off(r.TRANSITION_INIT),f.off(r.TRANSITION_START),f.off(r.TRANSITION_COMPLETE),f.off(r.TRANSITION_OUT),l.status=c.SHUTDOWN,l.active=!1,l.visible=!1,f.emit(r.SHUTDOWN,this,o)},destroy:function(){var o=this.events,f=this.settings;f.status=c.DESTROYED,f.active=!1,f.visible=!1,o.emit(r.DESTROY,this),o.removeAllListeners();for(var l=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9};p.exports=C},69830:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="addedtoscene"},7919:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="boot"},46763:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="create"},11763:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},71555:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},36735:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="postupdate"},3809:p=>{/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="prerender"},90716:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="preupdate"},58262:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="ready"},91633:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="removedfromscene"},10319:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="render"},87132:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},81961:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="shutdown"},90194:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="sleep"},6265:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="start"},33178:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="transitioncomplete"},43063:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="transitioninit"},11259:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="transitionout"},61611:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="transitionstart"},45209:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="transitionwake"},22966:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="update"},21747:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="wake"},44594:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADDED_TO_SCENE:t(69830),BOOT:t(7919),CREATE:t(46763),DESTROY:t(11763),PAUSE:t(71555),POST_UPDATE:t(36735),PRE_RENDER:t(3809),PRE_UPDATE:t(90716),READY:t(58262),REMOVED_FROM_SCENE:t(91633),RENDER:t(10319),RESUME:t(87132),SHUTDOWN:t(81961),SLEEP:t(90194),START:t(6265),TRANSITION_COMPLETE:t(33178),TRANSITION_INIT:t(43063),TRANSITION_OUT:t(11259),TRANSITION_START:t(61611),TRANSITION_WAKE:t(45209),UPDATE:t(22966),WAKE:t(21747)}},62194:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(89993),c=t(79291),a={Events:t(44594),GetPhysicsPlugins:t(27397),GetScenePlugins:t(52106),SceneManager:t(60903),ScenePlugin:t(52209),Settings:t(55681),Systems:t(2368)};a=c(!1,a,d),p.exports=a},30341:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(14463),r=t(79291),n=t(29747),e=new d({Extends:c,initialize:function(h,i,o){c.call(this),this.manager=h,this.key=i,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=r(this.config,o),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(s){return!s||!s.name||typeof s.name!="string"?!1:this.markers[s.name]?(console.error("addMarker "+s.name+" already exists in Sound"),!1):(s=r(!0,{name:"",start:0,duration:this.totalDuration-(s.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},s),this.markers[s.name]=s,!0)},updateMarker:function(s){return!s||!s.name||typeof s.name!="string"?!1:this.markers[s.name]?(this.markers[s.name]=r(!0,this.markers[s.name],s),!0):(console.warn("Audio Marker: "+s.name+" missing in Sound: "+this.key),!1)},removeMarker:function(s){var h=this.markers[s];return h?(this.markers[s]=null,h):null},play:function(s,h){if(s===void 0&&(s=""),typeof s=="object"&&(h=s,s=""),typeof s!="string")return!1;if(!s)this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;else{if(!this.markers[s])return console.warn("Marker: "+s+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[s],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}return this.resetConfig(),this.currentConfig=r(this.currentConfig,h),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return this.isPaused||!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!this.isPaused||this.isPlaying?!1:(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!this.isPaused&&!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:n,calculateRate:function(){var s=1.0005777895065548,h=this.currentConfig.detune+this.manager.detune,i=Math.pow(s,h);this.totalRate=this.currentConfig.rate*this.manager.rate*i},destroy:function(){this.pendingRemove||(this.stop(),this.emit(a.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});p.exports=e},85034:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(41786),a=t(50792),r=t(14463),n=t(8443),e=t(46710),s=t(58731),h=t(29747),i=t(26099),o=new d({Extends:a,initialize:function(l){a.call(this),this.game=l,this.jsonCache=l.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,this.gameLostFocus=!1,this.listenerPosition=new i,l.events.on(n.BLUR,this.onGameBlur,this),l.events.on(n.FOCUS,this.onGameFocus,this),l.events.on(n.PRE_STEP,this.update,this),l.events.once(n.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(f,l){l===void 0&&(l={});var u=this.add(f,l);u.spritemap=this.jsonCache.get(f).spritemap;for(var v in u.spritemap)if(u.spritemap.hasOwnProperty(v)){var m=c(l),x=u.spritemap[v];m.loop=x.hasOwnProperty("loop")?x.loop:!1,u.addMarker({name:v,start:x.start,duration:x.end-x.start,config:m})}return u},get:function(f){return s(this.sounds,"key",f)},getAll:function(f){return f?e(this.sounds,"key",f):e(this.sounds)},getAllPlaying:function(){return e(this.sounds,"isPlaying",!0)},play:function(f,l){var u=this.add(f);return u.once(r.COMPLETE,u.destroy,u),l?l.name?(u.addMarker(l),u.play(l.name)):u.play(l):u.play()},playAudioSprite:function(f,l,u){var v=this.addAudioSprite(f);return v.once(r.COMPLETE,v.destroy,v),v.play(l,u)},remove:function(f){var l=this.sounds.indexOf(f);return l!==-1?(f.destroy(),this.sounds.splice(l,1),!0):!1},removeAll:function(){this.sounds.forEach(function(f){f.destroy()}),this.sounds.length=0},removeByKey:function(f){for(var l=0,u=this.sounds.length-1;u>=0;u--){var v=this.sounds[u];v.key===f&&(v.destroy(),this.sounds.splice(u,1),l++)}return l},pauseAll:function(){this.forEachActiveSound(function(f){f.pause()}),this.emit(r.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(f){f.resume()}),this.emit(r.RESUME_ALL,this)},setListenerPosition:h,stopAll:function(){this.forEachActiveSound(function(f){f.stop()}),this.emit(r.STOP_ALL,this)},stopByKey:function(f){var l=0;return this.getAll(f).forEach(function(u){u.stop()&&l++}),l},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(f,l){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(r.UNLOCKED,this));for(var u=this.sounds.length-1;u>=0;u--)this.sounds[u].pendingRemove&&this.sounds.splice(u,1);this.sounds.forEach(function(v){v.update(f,l)})},destroy:function(){this.game.events.off(n.BLUR,this.onGameBlur,this),this.game.events.off(n.FOCUS,this.onGameFocus,this),this.game.events.off(n.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(f,l){var u=this;this.sounds.forEach(function(v,m){v&&!v.pendingRemove&&f.call(l||u,v,m,u.sounds)})},setRate:function(f){return this.rate=f,this},rate:{get:function(){return this._rate},set:function(f){this._rate=f,this.forEachActiveSound(function(l){l.calculateRate()}),this.emit(r.GLOBAL_RATE,this,f)}},setDetune:function(f){return this.detune=f,this},detune:{get:function(){return this._detune},set:function(f){this._detune=f,this.forEachActiveSound(function(l){l.calculateRate()}),this.emit(r.GLOBAL_DETUNE,this,f)}}});p.exports=o},14747:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33684),c=t(25960),a=t(57490),r={create:function(n){var e=n.config.audio,s=n.device.audio;return e.noAudio||!s.webAudio&&!s.audioData?new c(n):s.webAudio&&!e.disableWebAudio?new a(n):new d(n)}};p.exports=r},19723:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},98882:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="decodedall"},57506:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="decoded"},73146:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="destroy"},11305:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="detune"},40577:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="detune"},30333:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="mute"},20394:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="rate"},21802:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="volume"},1299:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="looped"},99190:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="loop"},97125:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="mute"},89259:p=>{/** + * @author pi-kei + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pan"},79986:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pauseall"},17586:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},19618:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="play"},42306:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="rate"},10387:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resumeall"},48959:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},9960:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="seek"},19180:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stopall"},98328:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stop"},50401:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="unlocked"},52498:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="volume"},14463:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={COMPLETE:t(19723),DECODED:t(57506),DECODED_ALL:t(98882),DESTROY:t(73146),DETUNE:t(11305),GLOBAL_DETUNE:t(40577),GLOBAL_MUTE:t(30333),GLOBAL_RATE:t(20394),GLOBAL_VOLUME:t(21802),LOOP:t(99190),LOOPED:t(1299),MUTE:t(97125),PAN:t(89259),PAUSE_ALL:t(79986),PAUSE:t(17586),PLAY:t(19618),RATE:t(42306),RESUME_ALL:t(10387),RESUME:t(48959),SEEK:t(9960),STOP_ALL:t(19180),STOP:t(98328),UNLOCKED:t(50401),VOLUME:t(52498)}},64895:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30341),c=t(83419),a=t(14463),r=t(45319),n=new c({Extends:d,initialize:function(s,h,i){if(i===void 0&&(i={}),this.tags=s.game.cache.audio.get(h),!this.tags)throw new Error('No cached audio asset with key "'+h);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,d.call(this,s,h,i)},play:function(e,s){return this.manager.isLocked(this,"play",[e,s])||!d.prototype.play.call(this,e,s)||!this.pickAndPlayAudioTag()?!1:(this.emit(a.PLAY,this),!0)},pause:function(){return this.manager.isLocked(this,"pause")||this.startTime>0||!d.prototype.pause.call(this)?!1:(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(a.PAUSE,this),!0)},resume:function(){return this.manager.isLocked(this,"resume")||this.startTime>0||!d.prototype.resume.call(this)||!this.pickAndPlayAudioTag()?!1:(this.emit(a.RESUME,this),!0)},stop:function(){return this.manager.isLocked(this,"stop")||!d.prototype.stop.call(this)?!1:(this.stopAndReleaseAudioTag(),this.emit(a.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var e=this.currentConfig.seek,s=this.currentConfig.delay,h=(this.currentMarker?this.currentMarker.start:0)+e;return this.previousTime=h,this.audio.currentTime=h,this.applyConfig(),s===0?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+s*1e3,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var e=0;e0){this.startTime=h-this.manager.loopEndOffset?(this.audio.currentTime=s+Math.max(0,i-h),i=this.audio.currentTime):i=h){this.reset(),this.stopAndReleaseAudioTag(),this.emit(a.COMPLETE,this);return}this.previousTime=i}},destroy:function(){d.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=r(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){d.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(e){this.currentConfig.mute=e,!this.manager.isLocked(this,"mute",e)&&(this.updateMute(),this.emit(a.MUTE,this,e))}},setMute:function(e){return this.mute=e,this},volume:{get:function(){return this.currentConfig.volume},set:function(e){this.currentConfig.volume=e,!this.manager.isLocked(this,"volume",e)&&(this.updateVolume(),this.emit(a.VOLUME,this,e))}},setVolume:function(e){return this.volume=e,this},rate:{get:function(){return this.currentConfig.rate},set:function(e){this.currentConfig.rate=e,!this.manager.isLocked(this,a.RATE,e)&&(this.calculateRate(),this.emit(a.RATE,this,e))}},setRate:function(e){return this.rate=e,this},detune:{get:function(){return this.currentConfig.detune},set:function(e){this.currentConfig.detune=e,!this.manager.isLocked(this,a.DETUNE,e)&&(this.calculateRate(),this.emit(a.DETUNE,this,e))}},setDetune:function(e){return this.detune=e,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(e){this.manager.isLocked(this,"seek",e)||this.startTime>0||(this.isPlaying||this.isPaused)&&(e=Math.min(Math.max(0,e),this.duration),this.isPlaying?(this.previousTime=e,this.audio.currentTime=e):this.isPaused&&(this.currentConfig.seek=e),this.emit(a.SEEK,this,e))}},setSeek:function(e){return this.seek=e,this},loop:{get:function(){return this.currentConfig.loop},set:function(e){this.currentConfig.loop=e,!this.manager.isLocked(this,"loop",e)&&(this.audio&&(this.audio.loop=e),this.emit(a.LOOP,this,e))}},setLoop:function(e){return this.loop=e,this},pan:{get:function(){return this.currentConfig.pan},set:function(e){this.currentConfig.pan=e,this.emit(a.PAN,this,e)}},setPan:function(e){return this.pan=e,this}});p.exports=n},33684:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85034),c=t(83419),a=t(14463),r=t(64895),n=new c({Extends:d,initialize:function(s){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,d.call(this,s)},add:function(e,s){var h=new r(this,e,s);return this.sounds.push(h),h},unlock:function(){this.locked=!1;var e=this;if(this.game.cache.audio.entries.each(function(o,f){for(var l=0;l{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={SoundManagerCreator:t(14747),Events:t(14463),BaseSound:t(30341),BaseSoundManager:t(85034),WebAudioSound:t(71741),WebAudioSoundManager:t(57490),HTML5AudioSound:t(64895),HTML5AudioSoundManager:t(33684),NoAudioSound:t(4603),NoAudioSoundManager:t(25960)}},4603:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30341),c=t(83419),a=t(50792),r=t(79291),n=t(29747),e=function(){return!1},s=function(){return null},h=function(){return this},i=new c({Extends:a,initialize:function(f,l,u){u===void 0&&(u={}),a.call(this),this.manager=f,this.key=l,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=r({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},u),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:e,updateMarker:e,removeMarker:s,play:e,pause:e,resume:e,stop:e,setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h,applyConfig:s,resetConfig:s,update:n,calculateRate:s,destroy:function(){d.prototype.destroy.call(this)}});p.exports=i},25960:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85034),c=t(83419),a=t(50792),r=t(4603),n=t(29747),e=new c({Extends:a,initialize:function(h){a.call(this),this.game=h,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(s,h){var i=new r(this,s,h);return this.sounds.push(i),i},addAudioSprite:function(s,h){var i=this.add(s,h);return i.spritemap={},i},get:function(s){return d.prototype.get.call(this,s)},getAll:function(s){return d.prototype.getAll.call(this,s)},play:function(s,h){return!1},playAudioSprite:function(s,h,i){return!1},remove:function(s){return d.prototype.remove.call(this,s)},removeAll:function(){return d.prototype.removeAll.call(this)},removeByKey:function(s){return d.prototype.removeByKey.call(this,s)},stopByKey:function(s){return d.prototype.stopByKey.call(this,s)},onBlur:n,onFocus:n,onGameBlur:n,onGameFocus:n,pauseAll:n,resumeAll:n,stopAll:n,update:n,setRate:n,setDetune:n,setMute:n,setVolume:n,unlock:n,forEachActiveSound:function(s,h){d.prototype.forEachActiveSound.call(this,s,h)},destroy:function(){d.prototype.destroy.call(this)}});p.exports=e},71741:(p,C,t)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30341),c=t(83419),a=t(14463),r=t(95540),n=new c({Extends:d,initialize:function(s,h,i){if(i===void 0&&(i={}),this.audioBuffer=s.game.cache.audio.get(h),!this.audioBuffer)throw new Error('Audio key "'+h+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=s.context.createGain(),this.volumeNode=s.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),s.context.createPanner&&(this.spatialNode=s.context.createPanner(),this.volumeNode.connect(this.spatialNode)),s.context.createStereoPanner?(this.pannerNode=s.context.createStereoPanner(),s.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(s.destination)):s.context.createPanner?this.spatialNode.connect(s.destination):this.volumeNode.connect(s.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,d.call(this,s,h,i)},play:function(e,s){return d.prototype.play.call(this,e,s)?(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(a.PLAY,this),!0):!1},pause:function(){return this.manager.context.currentTime{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(53134),c=t(85034),a=t(83419),r=t(14463),n=t(8443),e=t(71741),s=t(95540),h=new a({Extends:c,initialize:function(o){this.context=this.createAudioContext(o),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked=this.context.state==="suspended"&&("ontouchstart"in window||"onclick"in window),c.call(this,o),this.locked&&o.isBooted?this.unlock():o.events.once(n.BOOT,this.unlock,this)},createAudioContext:function(i){var o=i.config.audio;if(o.context)return o.context.resume(),o.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(i){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=i,this.masterMuteNode=i.createGain(),this.masterVolumeNode=i.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(i.destination),this.destination=this.masterMuteNode,this},add:function(i,o){var f=new e(this,i,o);return this.sounds.push(f),f},decodeAudio:function(i,o){var f;Array.isArray(i)?f=i:f=[{key:i,data:o}];for(var l=this.game.cache.audio,u=f.length,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37105),c=t(83419),a=t(29747),r=t(19186),n=new c({initialize:function(s){this.parent=s,this.list=[],this.position=0,this.addCallback=a,this.removeCallback=a,this._sortKey=""},add:function(e,s){return s?d.Add(this.list,e):d.Add(this.list,e,0,this.addCallback,this)},addAt:function(e,s,h){return h?d.AddAt(this.list,e,s):d.AddAt(this.list,e,s,0,this.addCallback,this)},getAt:function(e){return this.list[e]},getIndex:function(e){return this.list.indexOf(e)},sort:function(e,s){return e?(s===void 0&&(s=function(h,i){return h[e]-i[e]}),r(this.list,s),this):this},getByName:function(e){return d.GetFirst(this.list,"name",e)},getRandom:function(e,s){return d.GetRandom(this.list,e,s)},getFirst:function(e,s,h,i){return d.GetFirst(this.list,e,s,h,i)},getAll:function(e,s,h,i){return d.GetAll(this.list,e,s,h,i)},count:function(e,s){return d.CountAllMatching(this.list,e,s)},swap:function(e,s){d.Swap(this.list,e,s)},moveTo:function(e,s){return d.MoveTo(this.list,e,s)},moveAbove:function(e,s){return d.MoveAbove(this.list,e,s)},moveBelow:function(e,s){return d.MoveBelow(this.list,e,s)},remove:function(e,s){return s?d.Remove(this.list,e):d.Remove(this.list,e,this.removeCallback,this)},removeAt:function(e,s){return s?d.RemoveAt(this.list,e):d.RemoveAt(this.list,e,this.removeCallback,this)},removeBetween:function(e,s,h){return h?d.RemoveBetween(this.list,e,s):d.RemoveBetween(this.list,e,s,this.removeCallback,this)},removeAll:function(e){for(var s=this.list.length;s--;)this.remove(this.list[s],e);return this},bringToTop:function(e){return d.BringToTop(this.list,e)},sendToBack:function(e){return d.SendToBack(this.list,e)},moveUp:function(e){return d.MoveUp(this.list,e),e},moveDown:function(e){return d.MoveDown(this.list,e),e},reverse:function(){return this.list.reverse(),this},shuffle:function(){return d.Shuffle(this.list),this},replace:function(e,s){return d.Replace(this.list,e,s)},exists:function(e){return this.list.indexOf(e)>-1},setAll:function(e,s,h,i){return d.SetAll(this.list,e,s,h,i),this},each:function(e,s){for(var h=[null],i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});p.exports=n},90330:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r){this.entries={},this.size=0,this.setAll(r)},setAll:function(a){if(Array.isArray(a))for(var r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(82348),r=new d({Extends:c,initialize:function(){c.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(n){return this._active.indexOf(n)>-1},isPending:function(n){return this._toProcess>0&&this._pending.indexOf(n)>-1},isDestroying:function(n){return this._destroy.indexOf(n)>-1},add:function(n){return this.checkQueue&&this.isActive(n)&&!this.isDestroying(n)||this.isPending(n)||(this._pending.push(n),this._toProcess++),n},remove:function(n){if(this.isPending(n)){var e=this._pending,s=e.indexOf(n);s!==-1&&e.splice(s,1)}else this.isActive(n)&&(this._destroy.push(n),this._toProcess++);return n},removeAll:function(){for(var n=this._active,e=this._destroy,s=n.length;s--;)e.push(n[s]),this._toProcess++;return this},update:function(){if(this._toProcess===0)return this._active;var n=this._destroy,e=this._active,s,h;for(s=0;s{/** + * @author Vladimir Agafonkin + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(43886);function c(g){if(!(this instanceof c))return new c(g);this._maxEntries=Math.max(4,g||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}c.prototype={all:function(){return this._all(this.data,[])},search:function(g){var y=this.data,T=[],E=this.toBBox;if(!v(g,y))return T;for(var P=[],R,M,L,O;y;){for(R=0,M=y.children.length;R=0&&R[y].children.length>this._maxEntries;)this._split(R,y),y--;this._adjustParentBBoxes(P,R,y)},_split:function(g,y){var T=g[y],E=T.children.length,P=this._minEntries;this._chooseSplitAxis(T,P,E);var R=this._chooseSplitIndex(T,P,E),M=m(T.children.splice(R,T.children.length-R));M.height=T.height,M.leaf=T.leaf,r(T,this.toBBox),r(M,this.toBBox),y?g[y-1].children.push(M):this._splitRoot(T,M)},_splitRoot:function(g,y){this.data=m([g,y]),this.data.height=g.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(g,y,T){var E,P,R,M,L,O,D,I;for(O=D=1/0,E=y;E<=T-y;E++)P=n(g,0,E,this.toBBox),R=n(g,E,T,this.toBBox),M=l(P,R),L=i(P)+i(R),M=y;O--)D=g.children[O],e(M,g.leaf?P(D):D),L+=o(M);return L},_adjustParentBBoxes:function(g,y,T){for(var E=T;E>=0;E--)e(y[E],g)},_condense:function(g){for(var y=g.length-1,T;y>=0;y--)g[y].children.length===0?y>0?(T=g[y-1].children,T.splice(T.indexOf(g[y]),1)):this.clear():r(g[y],this.toBBox)},compareMinX:function(g,y){return g.left-y.left},compareMinY:function(g,y){return g.top-y.top},toBBox:function(g){return{minX:g.left,minY:g.top,maxX:g.right,maxY:g.bottom}}};function a(g,y,T){if(!T)return y.indexOf(g);for(var E=0;E=g.minX&&y.maxY>=g.minY}function m(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(g,y,T,E,P){for(var R=[y,T],M;R.length;)T=R.pop(),y=R.pop(),!(T-y<=E)&&(M=y+Math.ceil((T-y)/E/2)*E,d(g,M,y,T,P),R.push(y,M,M,T))}p.exports=c},35072:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r){if(this.entries=[],Array.isArray(r))for(var n=0;n-1&&this.entries.splice(r,1),this},dump:function(){console.group("Set");for(var a=0;a-1},union:function(a){var r=new c;return a.entries.forEach(function(n){r.set(n)}),this.entries.forEach(function(n){r.set(n)}),r},intersect:function(a){var r=new c;return this.entries.forEach(function(n){a.contains(n)&&r.set(n)}),r},difference:function(a){var r=new c;return this.entries.forEach(function(n){a.contains(n)||r.set(n)}),r},size:{get:function(){return this.entries.length},set:function(a){return a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45319),c=t(83419),a=t(56583),r=t(26099),n=new c({initialize:function(s,h,i,o){s===void 0&&(s=0),h===void 0&&(h=s),i===void 0&&(i=0),o===void 0&&(o=null),this._width=s,this._height=h,this._parent=o,this.aspectMode=i,this.aspectRatio=h===0?1:s/h,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new r},setAspectMode:function(e){return e===void 0&&(e=0),this.aspectMode=e,this.setSize(this._width,this._height)},setSnap:function(e,s){return e===void 0&&(e=0),s===void 0&&(s=e),this.snapTo.set(e,s),this.setSize(this._width,this._height)},setParent:function(e){return this._parent=e,this.setSize(this._width,this._height)},setMin:function(e,s){return e===void 0&&(e=0),s===void 0&&(s=e),this.minWidth=d(e,0,this.maxWidth),this.minHeight=d(s,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(e,s){return e===void 0&&(e=Number.MAX_VALUE),s===void 0&&(s=e),this.maxWidth=d(e,this.minWidth,Number.MAX_VALUE),this.maxHeight=d(s,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(e,s){switch(e===void 0&&(e=0),s===void 0&&(s=e),this.aspectMode){case n.NONE:this._width=this.getNewWidth(a(e,this.snapTo.x)),this._height=this.getNewHeight(a(s,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height;break;case n.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(a(e,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case n.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(a(s,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case n.FIT:this.constrain(e,s,!0);break;case n.ENVELOP:this.constrain(e,s,!1);break}return this},setAspectRatio:function(e){return this.aspectRatio=e,this.setSize(this._width,this._height)},resize:function(e,s){return this._width=this.getNewWidth(a(e,this.snapTo.x)),this._height=this.getNewHeight(a(s,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height,this},getNewWidth:function(e,s){return s===void 0&&(s=!0),e=d(e,this.minWidth,this.maxWidth),s&&this._parent&&e>this._parent.width&&(e=Math.max(this.minWidth,this._parent.width)),e},getNewHeight:function(e,s){return s===void 0&&(s=!0),e=d(e,this.minHeight,this.maxHeight),s&&this._parent&&e>this._parent.height&&(e=Math.max(this.minHeight,this._parent.height)),e},constrain:function(e,s,h){e===void 0&&(e=0),s===void 0&&(s=e),h===void 0&&(h=!0),e=this.getNewWidth(e),s=this.getNewHeight(s);var i=this.snapTo,o=s===0?1:e/s;return h&&this.aspectRatio>o||!h&&this.aspectRatio0&&(s=a(s,i.y),e=s*this.aspectRatio)):(h&&this.aspectRatioo)&&(s=a(s,i.y),e=s*this.aspectRatio,i.x>0&&(e=a(e,i.x),s=e*(1/this.aspectRatio))),this._width=e,this._height=s,this},fitTo:function(e,s){return this.constrain(e,s,!0)},envelop:function(e,s){return this.constrain(e,s,!1)},setWidth:function(e){return this.setSize(e,this._height)},setHeight:function(e){return this.setSize(this._width,e)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(e){e&&e.style&&(e.style.width=this._width+"px",e.style.height=this._height+"px")},copy:function(e){return e.setAspectMode(this.aspectMode),e.aspectRatio=this.aspectRatio,e.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(e){this.setSize(e,this._height)}},height:{get:function(){return this._height},set:function(e){this.setSize(this._width,e)}}});n.NONE=0,n.WIDTH_CONTROLS_HEIGHT=1,n.HEIGHT_CONTROLS_WIDTH=2,n.FIT=3,n.ENVELOP=4,p.exports=n},15238:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="add"},56187:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="remove"},82348:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={PROCESS_QUEUE_ADD:t(15238),PROCESS_QUEUE_REMOVE:t(56187)}},41392:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Events:t(82348),List:t(73162),Map:t(90330),ProcessQueue:t(25774),RTree:t(59542),Set:t(35072),Size:t(86555)}},57382:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(45319),a=t(40987),r=t(8054),n=t(50030),e=t(79237),s=new d({Extends:e,initialize:function(i,o,f,l,u){e.call(this,i,o,f,l,u),this.add("__BASE",0,0,0,l,u),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=l,this.height=u,this.imageData=this.context.getImageData(0,0,l,u),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===r.WEBGL&&this.refresh(),this},draw:function(h,i,o,f){return f===void 0&&(f=!0),this.context.drawImage(o,h,i),f&&this.update(),this},drawFrame:function(h,i,o,f,l){o===void 0&&(o=0),f===void 0&&(f=0),l===void 0&&(l=!0);var u=this.manager.getFrame(h,i);if(u){var v=u.canvasData,m=u.cutWidth,x=u.cutHeight,g=u.source.resolution;this.context.drawImage(u.source.image,v.x,v.y,m,x,o,f,m/g,x/g),l&&this.update()}return this},setPixel:function(h,i,o,f,l,u){u===void 0&&(u=255),h=Math.abs(Math.floor(h)),i=Math.abs(Math.floor(i));var v=this.getIndex(h,i);if(v>-1){var m=this.context.getImageData(h,i,1,1);m.data[0]=o,m.data[1]=f,m.data[2]=l,m.data[3]=u,this.context.putImageData(m,h,i)}return this},putData:function(h,i,o,f,l,u,v){return f===void 0&&(f=0),l===void 0&&(l=0),u===void 0&&(u=h.width),v===void 0&&(v=h.height),this.context.putImageData(h,i,o,f,l,u,v),this},getData:function(h,i,o,f){h=c(Math.floor(h),0,this.width-1),i=c(Math.floor(i),0,this.height-1),o=c(o,1,this.width-h),f=c(f,1,this.height-i);var l=this.context.getImageData(h,i,o,f);return l},getPixel:function(h,i,o){o||(o=new a);var f=this.getIndex(h,i);if(f>-1){var l=this.data,u=l[f+0],v=l[f+1],m=l[f+2],x=l[f+3];o.setTo(u,v,m,x)}return o},getPixels:function(h,i,o,f){h===void 0&&(h=0),i===void 0&&(i=0),o===void 0&&(o=this.width),f===void 0&&(f=o),h=Math.abs(Math.round(h)),i=Math.abs(Math.round(i));for(var l=c(h,0,this.width),u=c(h+o,0,this.width),v=c(i,0,this.height),m=c(i+f,0,this.height),x=new a,g=[],y=v;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(10312),c=t(71911),a=t(27919),r=t(83419),n=t(8054),e=t(4327),s=t(95540),h=t(36060),i=t(32302),o=t(79237),f=t(70554),l=new r({Extends:o,initialize:function(v,m,x,g){x===void 0&&(x=256),g===void 0&&(g=256),this.type="DynamicTexture";var y=v.game.renderer,T=y&&y.type===n.CANVAS,E=T?a.create2D(this,x,g):[this];o.call(this,v,m,E,x,g),this.add("__BASE",0,0,0,x,g),this.renderer=y,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=T?E:null,this.context=T?E.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new c(0,0,x,g).setScene(v.game.scene.systemScene,!1),this.renderTarget=T?null:new i(y,x,g,1,0,!1,!0,!0,!1),this.pipeline=T?null:y.pipelines.get(h.SINGLE_PIPELINE),this.setSize(x,g)},setSize:function(u,v){v===void 0&&(v=u);var m=this.get(),x=m.source;if(u!==this.width||v!==this.height){this.canvas&&(this.canvas.width=u,this.canvas.height=v);var g=this.renderTarget;g&&(g.willResize(u,v)&&g.resize(u,v),g.texture!==x.glTexture&&this.renderer.deleteTexture(x.glTexture),this.setFromRenderTarget()),this.camera.setSize(u,v),x.width=u,x.height=v,m.setSize(u,v),this.width=u,this.height=v}else{var y=this.getSourceImage();m.cutX+u>y.width&&(u=y.width-m.cutX),m.cutY+v>y.height&&(v=y.height-m.cutY),m.setSize(u,v,m.cutX,m.cutY)}return this},setFromRenderTarget:function(){var u=this.get(),v=u.source,m=this.renderTarget;return v.isRenderTexture=!0,v.isGLTexture=!0,v.glTexture=m.texture,v.glTexture.flipY=!0,this},setIsSpriteTexture:function(u){return this.isSpriteTexture=u,this},fill:function(u,v,m,x,g,y){var T=this.camera,E=this.renderer;v===void 0&&(v=1),m===void 0&&(m=0),x===void 0&&(x=0),g===void 0&&(g=this.width),y===void 0&&(y=this.height);var P=u>>16&255,R=u>>8&255,M=u&255,L=this.renderTarget;if(T.preRender(),L){L.bind(!0);var O=this.pipeline.manager.set(this.pipeline),D=E.width/L.width,I=E.height/L.height,V=L.height-(x+y);O.drawFillRect(m*D,V*I,g*D,y*I,f.getTintFromFloats(M/255,R/255,P/255,1),v),L.unbind(!0)}else{var X=this.context;E.setContext(X),X.globalCompositeOperation="source-over",X.fillStyle="rgba("+P+","+R+","+M+","+v+")",X.fillRect(m,x,g,y),E.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var u=this.context,v=this.renderTarget;v?v.clear():u&&(u.save(),u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,this.width,this.height),u.restore()),this.dirty=!1}return this},stamp:function(u,v,m,x,g){m===void 0&&(m=0),x===void 0&&(x=0);var y=s(g,"alpha",1),T=s(g,"tint",16777215),E=s(g,"angle",0),P=s(g,"rotation",0),R=s(g,"scale",1),M=s(g,"scaleX",R),L=s(g,"scaleY",R),O=s(g,"originX",.5),D=s(g,"originY",.5),I=s(g,"blendMode",0),V=s(g,"erase",!1),X=s(g,"skipBatch",!1),H=this.manager.resetStamp(y,T);return H.setAngle(0),E!==0?H.setAngle(E):P!==0&&H.setRotation(P),H.setScale(M,L),H.setTexture(u,v),H.setOrigin(O,D),H.setBlendMode(I),V&&(this._eraseMode=!0),X?this.batchGameObject(H,m,x):this.draw(H,m,x),V&&(this._eraseMode=!1),this},erase:function(u,v,m){return this._eraseMode=!0,this.draw(u,v,m),this._eraseMode=!1,this},draw:function(u,v,m,x,g){return this.beginDraw(),this.batchDraw(u,v,m,x,g),this.endDraw(),this},drawFrame:function(u,v,m,x,g,y){return this.beginDraw(),this.batchDrawFrame(u,v,m,x,g,y),this.endDraw(),this},repeat:function(u,v,m,x,g,y,T,E,P){if(m===void 0&&(m=0),x===void 0&&(x=0),g===void 0&&(g=this.width),y===void 0&&(y=this.height),T===void 0&&(T=1),E===void 0&&(E=16777215),P===void 0&&(P=!1),u instanceof e?v=u:v=this.manager.getFrame(u,v),!v)return this;var R=this.manager.resetStamp(T,E);R.setFrame(v),R.setOrigin(0);var M=v.width,L=v.height;g=Math.floor(g),y=Math.floor(y);var O=Math.ceil(g/M),D=Math.ceil(y/L),I=O*M-g,V=D*L-y;I>0&&(I=M-I),V>0&&(V=L-V),m<0&&(O+=Math.ceil(Math.abs(m)/M)),x<0&&(D+=Math.ceil(Math.abs(x)/L));var X=m,H=x,G=!1,U=this.manager.stampCrop.setTo(0,0,M,L);P||this.beginDraw();for(var F=0;F0&&B===O-1&&(G=!0,U.width=I),V>0&&F===D-1&&(G=!0,U.height=V),G&&R.setCrop(U),this.batchGameObject(R,X,H),R.isCropped=!1,U.setTo(0,0,M,L),X+=M}X=m,H+=L}return P||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var u=this.camera,v=this.renderer,m=this.renderTarget;u.preRender(),m?v.beginCapture(m.width,m.height):v.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(u,v,m,x,g){return Array.isArray(u)||(u=[u]),this.batchList(u,v,m,x,g),this},batchDrawFrame:function(u,v,m,x,g,y){m===void 0&&(m=0),x===void 0&&(x=0),g===void 0&&(g=1),y===void 0&&(y=16777215);var T=this.manager.getFrame(u,v);return T&&(this.renderTarget?this.pipeline.batchTextureFrame(T,m,x,y,g,this.camera.matrix,null):this.batchTextureFrame(T,m,x,g,y)),this},endDraw:function(u){if(u===void 0&&(u=this._eraseMode),this.isDrawing){var v=this.renderer,m=this.renderTarget;if(m){var x=v.endCapture(),g=v.pipelines.setUtility();g.blitFrame(x,m,1,!1,!1,u,this.isSpriteTexture),v.resetScissor(),v.resetViewport()}else v.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(u,v,m,x,g){var y=u.length;if(y!==0)for(var T=0;T0&&P.height>0&&E.drawImage(R,P.x,P.y,P.width,P.height,v,m,P.width,P.height),E.restore()}},snapshotArea:function(u,v,m,x,g,y,T){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,g,!1,u,v,m,x,y,T):this.renderer.snapshotCanvas(this.canvas,g,!1,u,v,m,x,y,T),this},snapshot:function(u,v,m){return this.snapshotArea(0,0,this.width,this.height,u,v,m)},snapshotPixel:function(u,v,m){return this.snapshotArea(u,v,1,1,m,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(u,v,m,x){var g=this.manager.resetStamp();g.setTexture(this),g.setOrigin(0),g.renderWebGL(u,g,m,x)},renderCanvas:function(){},destroy:function(){var u=this.manager.stamp;u&&u.texture===this&&this.manager.resetStamp(),o.prototype.destroy.call(this),a.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});p.exports=l},4327:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(45319),a=t(79291),r=new d({initialize:function(e,s,h,i,o,f,l){this.texture=e,this.name=s,this.source=e.source[h],this.sourceIndex=h,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(f,l,i,o)},setSize:function(n,e,s,h){s===void 0&&(s=0),h===void 0&&(h=0),this.cutX=s,this.cutY=h,this.cutWidth=n,this.cutHeight=e,this.width=n,this.height=e,this.halfWidth=Math.floor(n*.5),this.halfHeight=Math.floor(e*.5),this.centerX=Math.floor(n/2),this.centerY=Math.floor(e/2);var i=this.data,o=i.cut;o.x=s,o.y=h,o.w=n,o.h=e,o.r=s+n,o.b=h+e,i.sourceSize.w=n,i.sourceSize.h=e,i.spriteSourceSize.w=n,i.spriteSourceSize.h=e,i.radius=.5*Math.sqrt(n*n+e*e);var f=i.drawImage;return f.x=s,f.y=h,f.width=n,f.height=e,this.updateUVs()},setTrim:function(n,e,s,h,i,o){var f=this.data,l=f.spriteSourceSize;return f.trim=!0,f.sourceSize.w=n,f.sourceSize.h=e,l.x=s,l.y=h,l.w=i,l.h=o,l.r=s+i,l.b=h+o,this.x=s,this.y=h,this.width=i,this.height=o,this.halfWidth=i*.5,this.halfHeight=o*.5,this.centerX=Math.floor(i/2),this.centerY=Math.floor(o/2),this.updateUVs()},setScale9:function(n,e,s,h){var i=this.data;return i.scale9=!0,i.is3Slice=e===0&&h===this.height,i.scale9Borders.x=n,i.scale9Borders.y=e,i.scale9Borders.w=s,i.scale9Borders.h=h,this},setCropUVs:function(n,e,s,h,i,o,f){var l=this.cutX,u=this.cutY,v=this.cutWidth,m=this.cutHeight,x=this.realWidth,g=this.realHeight;e=c(e,0,x),s=c(s,0,g),h=c(h,0,x-e),i=c(i,0,g-s);var y=l+e,T=u+s,E=h,P=i,R=this.data;if(R.trim){var M=R.spriteSourceSize;h=c(h,0,v-e),i=c(i,0,m-s);var L=e+h,O=s+i,D=!(M.rL||M.y>O);if(D){var I=Math.max(M.x,e),V=Math.max(M.y,s),X=Math.min(M.r,L)-I,H=Math.min(M.b,O)-V;E=X,P=H,o?y=l+(v-(I-M.x)-X):y=l+(I-M.x),f?T=u+(m-(V-M.y)-H):T=u+(V-M.y),e=I,s=V,h=X,i=H}else y=0,T=0,E=0,P=0}else o&&(y=l+(v-e-h)),f&&(T=u+(m-s-i));var G=this.source.width,U=this.source.height;return n.u0=Math.max(0,y/G),n.v0=Math.max(0,T/U),n.u1=Math.min(1,(y+E)/G),n.v1=Math.min(1,(T+P)/U),n.x=e,n.y=s,n.cx=y,n.cy=T,n.cw=E,n.ch=P,n.width=h,n.height=i,n.flipX=o,n.flipY=f,n},updateCropUVs:function(n,e,s){return this.setCropUVs(n,n.x,n.y,n.width,n.height,e,s)},setUVs:function(n,e,s,h,i,o){var f=this.data.drawImage;return f.width=n,f.height=e,this.u0=s,this.v0=h,this.u1=i,this.v1=o,this},updateUVs:function(){var n=this.cutX,e=this.cutY,s=this.cutWidth,h=this.cutHeight,i=this.data.drawImage;i.width=s,i.height=h;var o=this.source.width,f=this.source.height;return this.u0=n/o,this.v0=e/f,this.u1=(n+s)/o,this.v1=(e+h)/f,this},updateUVsInverted:function(){var n=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/n,this.v0=this.cutY/e,this.u1=this.cutX/n,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var n=new r(this.texture,this.name,this.sourceIndex);return n.cutX=this.cutX,n.cutY=this.cutY,n.cutWidth=this.cutWidth,n.cutHeight=this.cutHeight,n.x=this.x,n.y=this.y,n.width=this.width,n.height=this.height,n.halfWidth=this.halfWidth,n.halfHeight=this.halfHeight,n.centerX=this.centerX,n.centerY=this.centerY,n.rotated=this.rotated,n.data=a(!0,n.data,this.data),n.updateUVs(),n},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});p.exports=r},79237:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(4327),a=t(11876),r='Texture "%s" has no frame "%s"',n=new d({initialize:function(s,h,i,o,f){Array.isArray(i)||(i=[i]),this.manager=s,this.key=h,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var l=0;lo&&(o=u.cutX+u.cutWidth),u.cutY+u.cutHeight>f&&(f=u.cutY+u.cutHeight)}return{x:h,y:i,width:o-h,height:f-i}},getFrameNames:function(e){e===void 0&&(e=!1);var s=Object.keys(this.frames);if(!e){var h=s.indexOf("__BASE");h!==-1&&s.splice(h,1)}return s},getSourceImage:function(e){(e==null||this.frameTotal===1)&&(e="__BASE");var s=this.frames[e];return s?s.source.image:(console.warn(r,this.key,e),this.frames.__BASE.source.image)},getDataSourceImage:function(e){(e==null||this.frameTotal===1)&&(e="__BASE");var s=this.frames[e],h;return s?h=s.sourceIndex:(console.warn(r,this.key,e),h=this.frames.__BASE.sourceIndex),this.dataSource[h].image},setDataSource:function(e){Array.isArray(e)||(e=[e]);for(var s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=t(57382),a=t(83419),r=t(40987),n=t(8054),e=t(81320),s=t(50792),h=t(69442),i=t(4327),o=t(8443),f=t(99584),l=t(35154),u=t(88571),v=t(41212),m=t(61309),x=t(87841),g=t(79237),y=new a({Extends:s,initialize:function(E){s.call(this),this.game=E,this.name="TextureManager",this.list={},this._tempCanvas=d.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new x,this.silentWarnings=!1,E.events.once(o.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(h.LOAD,this.updatePending,this),this.on(h.ERROR,this.updatePending,this);var T=this.game.config;this.addBase64("__DEFAULT",T.defaultImage),this.addBase64("__MISSING",T.missingImage),this.addBase64("__WHITE",T.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(o.DESTROY,this.destroy,this),this.game.events.once(o.SYSTEM_READY,function(E){this.stamp=new u(E).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(h.LOAD),this.off(h.ERROR),this.emit(h.READY))},checkKey:function(T){return this.exists(T)?(this.silentWarnings||console.error("Texture key already in use: "+T),!1):!0},remove:function(T){if(typeof T=="string")if(this.exists(T))T=this.get(T);else return this.silentWarnings||console.warn("No texture found matching key: "+T),this;var E=T.key;return this.list.hasOwnProperty(E)&&(T.destroy(),this.emit(h.REMOVE,E),this.emit(h.REMOVE_KEY+E)),this},removeKey:function(T){return this.list.hasOwnProperty(T)&&delete this.list[T],this},addBase64:function(T,E){if(this.checkKey(T)){var P=this,R=new Image;R.onerror=function(){P.emit(h.ERROR,T)},R.onload=function(){var M=P.create(T,R);m.Image(M,0),P.emit(h.ADD,T,M),P.emit(h.ADD_KEY+T,M),P.emit(h.LOAD,T,M)},R.src=E}return this},getBase64:function(T,E,P,R){P===void 0&&(P="image/png"),R===void 0&&(R=.92);var M="",L=this.getFrame(T,E);if(L&&(L.source.isRenderTexture||L.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(L){var O=L.canvasData,D=d.create2D(this,O.width,O.height),I=D.getContext("2d",{willReadFrequently:!0});O.width>0&&O.height>0&&I.drawImage(L.source.image,O.x,O.y,O.width,O.height,0,0,O.width,O.height),M=D.toDataURL(P,R),d.remove(D)}return M},addImage:function(T,E,P){var R=null;return this.checkKey(T)&&(R=this.create(T,E),m.Image(R,0),P&&R.setDataSource(P),this.emit(h.ADD,T,R),this.emit(h.ADD_KEY+T,R)),R},addGLTexture:function(T,E){var P=null;if(this.checkKey(T)){var R=E.width,M=E.height;P=this.create(T,E,R,M),P.add("__BASE",0,0,0,R,M),this.emit(h.ADD,T,P),this.emit(h.ADD_KEY+T,P)}return P},addCompressedTexture:function(T,E,P){var R=null;if(this.checkKey(T)){if(R=this.create(T,E),R.add("__BASE",0,0,0,E.width,E.height),P){var M=function(O,D,I){Array.isArray(I.textures)||Array.isArray(I.frames)?m.JSONArray(O,D,I):m.JSONHash(O,D,I)};if(Array.isArray(P))for(var L=0;L=L.x&&T=L.y&&E=L.x&&T=L.y&&E{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(27919),c=t(83419),a=t(50030),r=t(29795),n=t(82751),e=new c({initialize:function(h,i,o,f,l){l===void 0&&(l=!1);var u=h.manager.game;this.renderer=u.renderer,this.texture=h,this.source=i,this.image=i.compressed?null:i,this.compressionAlgorithm=i.compressed?i.format:null,this.resolution=1,this.width=o||i.naturalWidth||i.videoWidth||i.width||0,this.height=f||i.naturalHeight||i.videoHeight||i.height||0,this.scaleMode=r.DEFAULT,this.isCanvas=i instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&i instanceof HTMLVideoElement,this.isRenderTexture=i.type==="RenderTexture"||i.type==="DynamicTexture",this.isGLTexture=i instanceof n,this.isPowerOf2=a(this.width,this.height),this.glTexture=null,this.flipY=l,this.init(u)},init:function(s){var h=this.renderer;if(h){var i=this.source;if(h.gl){var o=this.image,f=this.flipY,l=this.width,u=this.height,v=this.scaleMode;this.isCanvas?this.glTexture=h.createCanvasTexture(o,!1,f):this.isVideo?this.glTexture=h.createVideoTexture(o,!1,f):this.isRenderTexture?this.glTexture=h.createTextureFromSource(null,l,u,v):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=h.createTextureFromSource(i,void 0,void 0,v):i instanceof Uint8Array?this.glTexture=h.createUint8ArrayTexture(i,l,u,v):this.glTexture=h.createTextureFromSource(o,l,u,v)}else this.isRenderTexture&&(this.image=i.canvas)}s.config.antialias||this.setFilter(1)},setFilter:function(s){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,s),this.scaleMode=s},setFlipY:function(s){return s===void 0&&(s=!0),this.flipY=s,this},update:function(){var s=this.renderer,h=this.image,i=this.flipY,o=s.gl;o&&this.isCanvas?s.updateCanvasTexture(h,this.glTexture,i):o&&this.isVideo&&s.updateVideoTexture(h,this.glTexture,i)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&d.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});p.exports=e},19673:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={LINEAR:0,NEAREST:1};p.exports=C},44538:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="addtexture"},63486:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="addtexture-"},94851:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="onerror"},29099:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="onload"},8678:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="ready"},86415:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="removetexture"},30879:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="removetexture-"},69442:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ADD:t(44538),ADD_KEY:t(63486),ERROR:t(94851),LOAD:t(29099),READY:t(8678),REMOVE:t(86415),REMOVE_KEY:t(30879)}},27458:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=t(19673),a={CanvasTexture:t(57382),DynamicTexture:t(81320),Events:t(69442),FilterMode:c,Frame:t(4327),Parsers:t(61309),Texture:t(79237),TextureManager:t(17130),TextureSource:t(11876)};a=d(!1,a,c),p.exports=a},89905:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(!c.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var a=t.source[d];t.add("__BASE",d,0,0,a.width,a.height);for(var r=c.getElementsByTagName("SubTexture"),n,e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.source[d];return t.add("__BASE",d,0,0,c.width,c.height),t};p.exports=C},4832:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.source[d];return t.add("__BASE",d,0,0,c.width,c.height),t};p.exports=C},78566:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41786),c=function(a,r,n){if(!n.frames&&!n.textures){console.warn("Invalid Texture Atlas JSON Array");return}var e=a.source[r];a.add("__BASE",r,0,0,e.width,e.height);for(var s=Array.isArray(n.textures)?n.textures[r].frames:n.frames,h,i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41786),c=function(a,r,n){if(!n.frames){console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object");return}var e=a.source[r];a.add("__BASE",r,0,0,e.width,e.height);var s=n.frames,h;for(var i in s)if(s.hasOwnProperty(i)){var o=s[i];if(h=a.add(i,r,o.frame.x,o.frame.y,o.frame.w,o.frame.h),!h){console.warn("Invalid atlas json, frame already exists: "+i);continue}o.trimmed&&h.setTrim(o.sourceSize.w,o.sourceSize.h,o.spriteSourceSize.x,o.spriteSourceSize.y,o.spriteSourceSize.w,o.spriteSourceSize.h),o.rotated&&(h.rotated=!0,h.updateUVsInverted());var f=o.anchor||o.pivot;f&&(h.customPivot=!0,h.pivotX=f.x,h.pivotY=f.y),o.scale9Borders&&h.setScale9(o.scale9Borders.x,o.scale9Borders.y,o.scale9Borders.w,o.scale9Borders.h),h.customData=d(o)}for(var l in n)l!=="frames"&&(Array.isArray(n[l])?a.customData[l]=n[l].slice(0):a.customData[l]=n[l]);return a};p.exports=c},31403:p=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=[171,75,84,88,32,49,49,187,13,10,26,10],c,a=new Uint8Array(t,0,12);for(c=0;c>1),x=Math.max(1,x>>1),v+=g}return{mipmaps:u,width:i,height:o,internalFormat:h,compressed:!0,generateMipmap:!1}};p.exports=C},82038:p=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(E,P,R,M,L,O,D){return D===void 0&&(D=16),Math.floor((E+R)/L)*Math.floor((P+M)/O)*D}function t(E,P){return E=Math.max(E,16),P=Math.max(P,8),E*P/4}function d(E,P){return E=Math.max(E,8),P=Math.max(P,8),E*P/2}function c(E,P){return Math.ceil(E/4)*Math.ceil(P/4)*16}function a(E,P){return C(E,P,3,3,4,4,8)}function r(E,P){return C(E,P,3,3,4,4)}function n(E,P){return C(E,P,4,3,5,4)}function e(E,P){return C(E,P,4,4,5,5)}function s(E,P){return C(E,P,5,4,6,5)}function h(E,P){return C(E,P,5,5,6,6)}function i(E,P){return C(E,P,7,4,8,5)}function o(E,P){return C(E,P,7,5,8,6)}function f(E,P){return C(E,P,7,7,8,8)}function l(E,P){return C(E,P,9,4,10,5)}function u(E,P){return C(E,P,9,5,10,6)}function v(E,P){return C(E,P,9,7,10,8)}function m(E,P){return C(E,P,9,9,10,10)}function x(E,P){return C(E,P,11,9,12,10)}function g(E,P){return C(E,P,11,11,12,12)}var y={0:{sizeFunc:t,glFormat:[35841]},1:{sizeFunc:t,glFormat:[35843]},2:{sizeFunc:d,glFormat:[35840]},3:{sizeFunc:d,glFormat:[35842]},6:{sizeFunc:a,glFormat:[36196]},7:{sizeFunc:a,glFormat:[33776,35916]},8:{sizeFunc:r,glFormat:[33777,35917]},9:{sizeFunc:r,glFormat:[33778,35918]},11:{sizeFunc:r,glFormat:[33779,35919]},14:{sizeFunc:c,glFormat:[36494,36495]},15:{sizeFunc:c,glFormat:[36492,36493]},22:{sizeFunc:a,glFormat:[37492,37493]},23:{sizeFunc:r,glFormat:[37496,37497]},24:{sizeFunc:a,glFormat:[37494,37495]},25:{sizeFunc:a,glFormat:[37488]},26:{sizeFunc:r,glFormat:[37490]},27:{sizeFunc:r,glFormat:[37808,37840]},28:{sizeFunc:n,glFormat:[37809,37841]},29:{sizeFunc:e,glFormat:[37810,37842]},30:{sizeFunc:s,glFormat:[37811,37843]},31:{sizeFunc:h,glFormat:[37812,37844]},32:{sizeFunc:i,glFormat:[37813,37845]},33:{sizeFunc:o,glFormat:[37814,37846]},34:{sizeFunc:f,glFormat:[37815,37847]},35:{sizeFunc:l,glFormat:[37816,37848]},36:{sizeFunc:u,glFormat:[37817,37849]},37:{sizeFunc:v,glFormat:[37818,37850]},38:{sizeFunc:m,glFormat:[37819,37851]},39:{sizeFunc:x,glFormat:[37820,37852]},40:{sizeFunc:g,glFormat:[37821,37853]}},T=function(E){for(var P=new Uint32Array(E,0,13),R=P[0],M=R===55727696,L=M?P[2]:P[3],O=P[4],D=y[L].glFormat[O],I=y[L].sizeFunc,V=P[11],X=P[7],H=P[6],G=52+P[12],U=new Uint8Array(E,G),F=new Array(V),B=0,N=X,z=H,Y=0;Y>1),z=Math.max(1,z>>1),B+=K}return{mipmaps:F,width:X,height:H,internalFormat:D,compressed:!0,generateMipmap:!1}};p.exports=T},75549:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=function(a,r,n,e,s,h,i){var o=d(i,"frameWidth",null),f=d(i,"frameHeight",o);if(o===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var l=a.source[r];a.add("__BASE",r,0,0,l.width,l.height);var u=d(i,"startFrame",0),v=d(i,"endFrame",-1),m=d(i,"margin",0),x=d(i,"spacing",0),g=Math.floor((s-m+x)/(o+x)),y=Math.floor((h-m+x)/(f+x)),T=g*y;T===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",a.key),(u>T||u<-T)&&(u=0),u<0&&(u=T+u),(v===-1||v>T||vs&&(R=D-s),I>h&&(M=I-h),O>=u&&O<=v&&(a.add(L,r,n+E,e+P,o-R,f-M),L++),E+=o+x,E+o>s&&(E=m,P+=f+x)}return a};p.exports=c},47534:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=function(a,r,n){var e=d(n,"frameWidth",null),s=d(n,"frameHeight",e);if(!e)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var h=a.source[0];a.add("__BASE",0,0,0,h.width,h.height),d(n,"startFrame",0),d(n,"endFrame",-1);for(var i=d(n,"margin",0),o=d(n,"spacing",0),f=r.cutX,l=r.cutY,u=r.cutWidth,v=r.cutHeight,m=r.realWidth,x=r.realHeight,g=Math.floor((m-i+o)/(e+o)),y=Math.floor((x-i+o)/(s+o)),T=r.x,E=e-T,P=e-(m-u-T),R=r.y,M=s-R,L=s-(x-v-R),O,D=i,I=i,V=0,X=0,H=0;H{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=0,t=function(c,a,r,n){var e=C-n.y-n.height;c.add(r,a,n.x,e,n.width,n.height)},d=function(c,a,r){var n=c.source[a];c.add("__BASE",a,0,0,n.width,n.height),C=n.height;for(var e=r.split(` +`),s=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",i="",o={x:0,y:0,width:0,height:0},f=0;f{/** + * @author Ben Richards + * @copyright 2024 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(50030),c=function(h){for(var i=h.mipmaps,o=1;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AtlasXML:t(89905),Canvas:t(72893),Image:t(4832),JSONArray:t(78566),JSONHash:t(39711),KTXParser:t(31403),PVRParser:t(82038),SpriteSheet:t(75549),SpriteSheetFromAtlas:t(47534),UnityYAML:t(86147)}},80341:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r,n,e,s,h,i,o){(e===void 0||e<=0)&&(e=32),(s===void 0||s<=0)&&(s=32),h===void 0&&(h=0),i===void 0&&(i=0),this.name=r,this.firstgid=n|0,this.imageWidth=e|0,this.imageHeight=s|0,this.imageMargin=h|0,this.imageSpacing=i|0,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(a){return a>=this.firstgid&&a{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=new d({initialize:function(r){if(this.gids=[],r!==void 0)for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80341),c=t(87010),a=t(46177),r=t(49075),n=function(e,s,h,i,o,f,l,u){h===void 0&&(h=32),i===void 0&&(i=32),o===void 0&&(o=10),f===void 0&&(f=10),u===void 0&&(u=!1);var v=null;if(Array.isArray(l)){var m=s!==void 0?s:"map";v=a(m,d.ARRAY_2D,l,h,i,u)}else if(s!==void 0){var x=e.cache.tilemap.get(s);x?v=a(s,x.format,x.data,h,i,u):console.warn("No map data found for key "+s)}return v===null&&(v=new c({tileWidth:h,tileHeight:i,width:o,height:f})),new r(e,v)};p.exports=n},23029:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(31401),a=t(91907),r=t(62644),n=t(93232),e=new d({Mixins:[c.AlphaSingle,c.Flip,c.Visible],initialize:function(h,i,o,f,l,u,v,m){this.layer=h,this.index=i,this.x=o,this.y=f,this.width=l,this.height=u,this.right,this.bottom,this.baseWidth=v!==void 0?v:l,this.baseHeight=m!==void 0?m:u,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.tintFill=!1,this.physics={}},containsPoint:function(s,h){return!(sthis.right||h>this.bottom)},copy:function(s){return this.index=s.index,this.alpha=s.alpha,this.properties=r(s.properties),this.visible=s.visible,this.setFlip(s.flipX,s.flipY),this.tint=s.tint,this.rotation=s.rotation,this.collideUp=s.collideUp,this.collideDown=s.collideDown,this.collideLeft=s.collideLeft,this.collideRight=s.collideRight,this.collisionCallback=s.collisionCallback,this.collisionCallbackContext=s.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(s){var h=this.tilemapLayer;if(h){var i=h.tileToWorldXY(this.x,this.y,void 0,s);return i.x}return this.x*this.baseWidth},getRight:function(s){var h=this.tilemapLayer;return h?this.getLeft(s)+this.width*h.scaleX:this.getLeft(s)+this.width},getTop:function(s){var h=this.tilemapLayer;if(h){var i=h.tileToWorldXY(this.x,this.y,void 0,s);return i.y}return this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(s){var h=this.tilemapLayer;return h?this.getTop(s)+this.height*h.scaleY:this.getTop(s)+this.height},getBounds:function(s,h){return h===void 0&&(h=new n),h.x=this.getLeft(s),h.y=this.getTop(s),h.width=this.getRight(s)-h.x,h.height=this.getBottom(s)-h.y,h},getCenterX:function(s){return(this.getLeft(s)+this.getRight(s))/2},getCenterY:function(s){return(this.getTop(s)+this.getBottom(s))/2},intersects:function(s,h,i,o){return!(i<=this.pixelX||o<=this.pixelY||s>=this.right||h>=this.bottom)},isInteresting:function(s,h){return s&&h?this.canCollide||this.hasInterestingFace:s?this.collides:h?this.hasInterestingFace:!1},resetCollision:function(s){if(s===void 0&&(s=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,s){var h=this.tilemapLayer;h&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(s,h,i,o,f){if(h===void 0&&(h=s),i===void 0&&(i=s),o===void 0&&(o=s),f===void 0&&(f=!0),this.collideLeft=s,this.collideRight=h,this.collideUp=i,this.collideDown=o,this.faceLeft=s,this.faceRight=h,this.faceTop=i,this.faceBottom=o,f){var l=this.tilemapLayer;l&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},setCollisionCallback:function(s,h){return s===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=s,this.collisionCallbackContext=h),this},setSize:function(s,h,i,o){return s!==void 0&&(this.width=s),h!==void 0&&(this.height=h),i!==void 0&&(this.baseWidth=i),o!==void 0&&(this.baseHeight=o),this.updatePixelXY(),this},updatePixelXY:function(){var s=this.layer.orientation;if(s===a.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(s===a.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(s===a.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(s===a.HEXAGONAL){var h=this.layer.staggerAxis,i=this.layer.staggerIndex,o=this.layer.hexSideLength,f,l;h==="y"?(l=(this.baseHeight-o)/2+o,i==="odd"?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*l):h==="x"&&(f=(this.baseWidth-o)/2+o,this.pixelX=this.x*f,i==="odd"?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback!==void 0}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var s=this.layer.tilemapLayer;if(s){var h=s.gidMap[this.index];if(h)return h}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var s=this.tilemapLayer;return s?s.tilemap:null}}});p.exports=e},49075:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(84101),c=t(83419),a=t(39506),r=t(80341),n=t(95540),e=t(14977),s=t(27462),h=t(91907),i=t(36305),o=t(19133),f=t(68287),l=t(23029),u=t(81086),v=t(20442),m=t(33629),x=new c({initialize:function(y,T){this.scene=y,this.tileWidth=T.tileWidth,this.tileHeight=T.tileHeight,this.width=T.width,this.height=T.height,this.orientation=T.orientation,this.renderOrder=T.renderOrder,this.format=T.format,this.version=T.version,this.properties=T.properties,this.widthInPixels=T.widthInPixels,this.heightInPixels=T.heightInPixels,this.imageCollections=T.imageCollections,this.images=T.images,this.layers=T.layers,this.tiles=T.tiles,this.tilesets=T.tilesets,this.objects=T.objects,this.currentLayerIndex=0,this.hexSideLength=T.hexSideLength;var E=this.orientation;this._convert={WorldToTileXY:u.GetWorldToTileXYFunction(E),WorldToTileX:u.GetWorldToTileXFunction(E),WorldToTileY:u.GetWorldToTileYFunction(E),TileToWorldXY:u.GetTileToWorldXYFunction(E),TileToWorldX:u.GetTileToWorldXFunction(E),TileToWorldY:u.GetTileToWorldYFunction(E),GetTileCorners:u.GetTileCornersFunction(E)}},setRenderOrder:function(g){var y=["right-down","left-down","right-up","left-up"];return typeof g=="number"&&(g=y[g]),y.indexOf(g)>-1&&(this.renderOrder=g),this},addTilesetImage:function(g,y,T,E,P,R,M,L){if(g===void 0)return null;y==null&&(y=g);var O=this.scene.sys.textures;if(!O.exists(y))return console.warn('Texture key "%s" not found',y),null;var D=O.get(y),I=this.getTilesetIndex(g);if(I===null&&this.format===r.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',g,this.tilesets),null;var V=this.tilesets[I];return V?(V.setTileSize(T,E),V.setSpacing(P,R),V.setImage(D),V):(T===void 0&&(T=this.tileWidth),E===void 0&&(E=this.tileHeight),P===void 0&&(P=0),R===void 0&&(R=0),M===void 0&&(M=0),L===void 0&&(L={x:0,y:0}),V=new m(g,M,T,E,P,R,void 0,void 0,L),V.setImage(D),this.tilesets.push(V),this.tiles=d(this),V)},copy:function(g,y,T,E,P,R,M,L){return L=this.getLayer(L),L!==null?(u.Copy(g,y,T,E,P,R,M,L),this):null},createBlankLayer:function(g,y,T,E,P,R,M,L){T===void 0&&(T=0),E===void 0&&(E=0),P===void 0&&(P=this.width),R===void 0&&(R=this.height),M===void 0&&(M=this.tileWidth),L===void 0&&(L=this.tileHeight);var O=this.getLayerIndex(g);if(O!==null)return console.warn("Invalid Tilemap Layer ID: "+g),null;for(var D=new e({name:g,tileWidth:M,tileHeight:L,width:P,height:R,orientation:this.orientation}),I,V=0;V-1&&this.putTileAt(y,R.x,R.y,T,R.tilemapLayer)}return E},removeTileAt:function(g,y,T,E,P){return T===void 0&&(T=!0),E===void 0&&(E=!0),P=this.getLayer(P),P===null?null:u.RemoveTileAt(g,y,T,E,P)},removeTileAtWorldXY:function(g,y,T,E,P,R){return T===void 0&&(T=!0),E===void 0&&(E=!0),R=this.getLayer(R),R===null?null:u.RemoveTileAtWorldXY(g,y,T,E,P,R)},renderDebug:function(g,y,T){return T=this.getLayer(T),T===null?null:(this.orientation===h.ORTHOGONAL&&u.RenderDebug(g,y,T),this)},renderDebugFull:function(g,y){for(var T=this.layers,E=0;E{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(44603),c=t(31989);d.register("tilemap",function(a){var r=a!==void 0?a:{};return c(this.scene,r.key,r.tileWidth,r.tileHeight,r.width,r.height,r.data,r.insertNull)})},46029:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(39429),c=t(31989);d.register("tilemap",function(a,r,n,e,s,h,i){return a===null&&(a=void 0),r===null&&(r=void 0),n===null&&(n=void 0),e===null&&(e=void 0),s===null&&(s=void 0),c(this.scene,a,r,n,e,s,h,i)})},20442:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(78389),a=t(31401),r=t(95643),n=t(81086),e=t(19218),s=t(26099),h=new d({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,c,e],initialize:function(o,f,l,u,v,m){r.call(this,o,"TilemapLayer"),this.isTilemap=!0,this.tilemap=f,this.layerIndex=l,this.layer=f.layers[l],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=n.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new s,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(u),this.setAlpha(this.layer.alpha),this.setPosition(v,m),this.setOrigin(0,0),this.setSize(f.tileWidth*this.layer.width,f.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(i){var o=[],f=[],l=this.tilemap;Array.isArray(i)||(i=[i]);for(var u=0;u=0&&i<4&&(this._renderOrder=i),this},calculateFacesAt:function(i,o){return n.CalculateFacesAt(i,o,this.layer),this},calculateFacesWithin:function(i,o,f,l){return n.CalculateFacesWithin(i,o,f,l,this.layer),this},createFromTiles:function(i,o,f,l,u){return n.CreateFromTiles(i,o,f,l,u,this.layer)},cull:function(i){return this.cullCallback(this.layer,i,this.culledTiles,this._renderOrder)},copy:function(i,o,f,l,u,v,m){return n.Copy(i,o,f,l,u,v,m,this.layer),this},fill:function(i,o,f,l,u,v){return n.Fill(i,o,f,l,u,v,this.layer),this},filterTiles:function(i,o,f,l,u,v,m){return n.FilterTiles(i,o,f,l,u,v,m,this.layer)},findByIndex:function(i,o,f){return n.FindByIndex(i,o,f,this.layer)},findTile:function(i,o,f,l,u,v,m){return n.FindTile(i,o,f,l,u,v,m,this.layer)},forEachTile:function(i,o,f,l,u,v,m){return n.ForEachTile(i,o,f,l,u,v,m,this.layer),this},setTint:function(i,o,f,l,u,v){i===void 0&&(i=16777215);var m=function(x){x.tint=i,x.tintFill=!1};return this.forEachTile(m,this,o,f,l,u,v)},setTintFill:function(i,o,f,l,u,v){i===void 0&&(i=16777215);var m=function(x){x.tint=i,x.tintFill=!0};return this.forEachTile(m,this,o,f,l,u,v)},getTileAt:function(i,o,f){return n.GetTileAt(i,o,f,this.layer)},getTileAtWorldXY:function(i,o,f,l){return n.GetTileAtWorldXY(i,o,f,l,this.layer)},getIsoTileAtWorldXY:function(i,o,f,l,u){f===void 0&&(f=!0);var v=this.tempVec;return n.IsometricWorldToTileXY(i,o,!0,v,u,this.layer,f),this.getTileAt(v.x,v.y,l)},getTilesWithin:function(i,o,f,l,u){return n.GetTilesWithin(i,o,f,l,u,this.layer)},getTilesWithinShape:function(i,o,f){return n.GetTilesWithinShape(i,o,f,this.layer)},getTilesWithinWorldXY:function(i,o,f,l,u,v){return n.GetTilesWithinWorldXY(i,o,f,l,u,v,this.layer)},hasTileAt:function(i,o){return n.HasTileAt(i,o,this.layer)},hasTileAtWorldXY:function(i,o,f){return n.HasTileAtWorldXY(i,o,f,this.layer)},putTileAt:function(i,o,f,l){return n.PutTileAt(i,o,f,l,this.layer)},putTileAtWorldXY:function(i,o,f,l,u){return n.PutTileAtWorldXY(i,o,f,l,u,this.layer)},putTilesAt:function(i,o,f,l){return n.PutTilesAt(i,o,f,l,this.layer),this},randomize:function(i,o,f,l,u){return n.Randomize(i,o,f,l,u,this.layer),this},removeTileAt:function(i,o,f,l){return n.RemoveTileAt(i,o,f,l,this.layer)},removeTileAtWorldXY:function(i,o,f,l,u){return n.RemoveTileAtWorldXY(i,o,f,l,u,this.layer)},renderDebug:function(i,o){return n.RenderDebug(i,o,this.layer),this},replaceByIndex:function(i,o,f,l,u,v){return n.ReplaceByIndex(i,o,f,l,u,v,this.layer),this},setSkipCull:function(i){return i===void 0&&(i=!0),this.skipCull=i,this},setCullPadding:function(i,o){return i===void 0&&(i=1),o===void 0&&(o=1),this.cullPaddingX=i,this.cullPaddingY=o,this},setCollision:function(i,o,f,l){return n.SetCollision(i,o,f,this.layer,l),this},setCollisionBetween:function(i,o,f,l){return n.SetCollisionBetween(i,o,f,l,this.layer),this},setCollisionByProperty:function(i,o,f){return n.SetCollisionByProperty(i,o,f,this.layer),this},setCollisionByExclusion:function(i,o,f){return n.SetCollisionByExclusion(i,o,f,this.layer),this},setCollisionFromCollisionGroup:function(i,o){return n.SetCollisionFromCollisionGroup(i,o,this.layer),this},setTileIndexCallback:function(i,o,f){return n.SetTileIndexCallback(i,o,f,this.layer),this},setTileLocationCallback:function(i,o,f,l,u,v){return n.SetTileLocationCallback(i,o,f,l,u,v,this.layer),this},shuffle:function(i,o,f,l){return n.Shuffle(i,o,f,l,this.layer),this},swapByIndex:function(i,o,f,l,u,v){return n.SwapByIndex(i,o,f,l,u,v,this.layer),this},tileToWorldX:function(i,o){return this.tilemap.tileToWorldX(i,o,this)},tileToWorldY:function(i,o){return this.tilemap.tileToWorldY(i,o,this)},tileToWorldXY:function(i,o,f,l){return this.tilemap.tileToWorldXY(i,o,f,l,this)},getTileCorners:function(i,o,f){return this.tilemap.getTileCorners(i,o,f,this)},weightedRandomize:function(i,o,f,l,u){return n.WeightedRandomize(o,f,l,u,i,this.layer),this},worldToTileX:function(i,o,f){return this.tilemap.worldToTileX(i,o,f,this)},worldToTileY:function(i,o,f){return this.tilemap.worldToTileY(i,o,f,this)},worldToTileXY:function(i,o,f,l,u){return this.tilemap.worldToTileXY(i,o,f,l,u,this)},destroy:function(i){i===void 0&&(i=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),i&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});p.exports=h},16153:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61340),c=new d,a=new d,r=new d,n=function(e,s,h,i){var o=s.cull(h),f=o.length,l=h.alpha*s.alpha;if(!(f===0||l<=0)){var u=c,v=a,m=r;v.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY),u.copyFrom(h.matrix);var x=e.currentContext,g=s.gidMap;x.save(),i?(u.multiplyWithOffset(i,-h.scrollX*s.scrollFactorX,-h.scrollY*s.scrollFactorY),v.e=s.x,v.f=s.y,u.multiply(v,m),m.copyToContext(x)):(v.e-=h.scrollX*s.scrollFactorX,v.f-=h.scrollY*s.scrollFactorY,v.copyToContext(x)),(!e.antialias||s.scaleX>1||s.scaleY>1)&&(x.imageSmoothingEnabled=!1);for(var y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(29747),c=d,a=d;c=t(99558),a=t(16153),p.exports={renderWebGL:c,renderCanvas:a}},99558:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70554),c=function(a,r,n){var e=r.cull(n),s=e.length,h=n.alpha*r.alpha;if(!(s===0||h<=0)){var i=r.gidMap,o=a.pipelines.set(r.pipeline,r),f=d.getTintAppendFloatAlpha,l=r.scrollFactorX,u=r.scrollFactorY,v=r.x,m=r.y,x=r.scaleX,g=r.scaleY;a.pipelines.preBatch(r);for(var y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(26099),a=new d({initialize:function(n,e,s,h,i,o,f,l,u){(s===void 0||s<=0)&&(s=32),(h===void 0||h<=0)&&(h=32),i===void 0&&(i=0),o===void 0&&(o=0),f===void 0&&(f={}),l===void 0&&(l={}),this.name=n,this.firstgid=e,this.tileWidth=s,this.tileHeight=h,this.tileMargin=i,this.tileSpacing=o,this.tileProperties=f,this.tileData=l,this.tileOffset=new c,u!==void 0&&this.tileOffset.set(u.x,u.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(r){return this.containsTileIndex(r)?this.tileProperties[r-this.firstgid]:null},getTileData:function(r){return this.containsTileIndex(r)?this.tileData[r-this.firstgid]:null},getTileCollisionGroup:function(r){var n=this.getTileData(r);return n&&n.objectgroup?n.objectgroup:null},containsTileIndex:function(r){return r>=this.firstgid&&re.width||n.height>e.height?this.updateTileData(n.width,n.height):this.updateTileData(e.width,e.height,e.x,e.y),this},setTileSize:function(r,n){return r!==void 0&&(this.tileWidth=r),n!==void 0&&(this.tileHeight=n),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(r,n){return r!==void 0&&(this.tileMargin=r),n!==void 0&&(this.tileSpacing=n),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(r,n,e,s){e===void 0&&(e=0),s===void 0&&(s=0);var h=(n-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),i=(r-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(h%1!==0||i%1!==0)&&console.warn("Image tile area not tile size multiple in: "+this.name),h=Math.floor(h),i=Math.floor(i),this.rows=h,this.columns=i,this.total=h*i,this.texCoordinates.length=0;for(var o=this.tileMargin+e,f=this.tileMargin+s,l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7423),c=function(a,r,n){var e=d(a,r,!0,n),s=d(a,r-1,!0,n),h=d(a,r+1,!0,n),i=d(a-1,r,!0,n),o=d(a+1,r,!0,n),f=e&&e.collides;return f&&(e.faceTop=!0,e.faceBottom=!0,e.faceLeft=!0,e.faceRight=!0),s&&s.collides&&(f&&(e.faceTop=!1),s.faceBottom=!f),h&&h.collides&&(f&&(e.faceBottom=!1),h.faceTop=!f),i&&i.collides&&(f&&(e.faceLeft=!1),i.faceRight=!f),o&&o.collides&&(f&&(e.faceRight=!1),o.faceLeft=!f),e&&!e.collides&&e.resetFaces(),e};p.exports=c},42573:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7423),c=t(7386),a=function(r,n,e,s,h){for(var i=null,o=null,f=null,l=null,u=c(r,n,e,s,null,h),v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=new d,a=function(r,n,e,s){var h=e.tilemapLayer,i=h.cullPaddingX,o=h.cullPaddingY,f=h.tilemap.tileToWorldXY(r,n,c,s,h);return f.x>s.worldView.x+h.scaleX*e.tileWidth*(-i-.5)&&f.xs.worldView.y+h.scaleY*e.tileHeight*(-o-1)&&f.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(42573),c=t(7386),a=t(62991),r=t(23029),n=function(e,s,h,i,o,f,l,u){l===void 0&&(l=!0);var v=c(e,s,h,i,null,u),m=[];v.forEach(function(R){var M=new r(R.layer,R.index,R.x,R.y,R.width,R.height,R.baseWidth,R.baseHeight);M.copy(R),m.push(M)});for(var x=o-e,g=f-s,y=0;y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62644),c=t(7386),a=t(27987),r=function(n,e,s,h,i,o){s||(s={}),Array.isArray(n)||(n=[n]);var f=o.tilemapLayer;h||(h=f.scene),i||(i=h.cameras.main);var l=o.width,u=o.height,v=c(0,0,l,u,null,o),m=[],x,g=function(P,R,M){for(var L=0;L{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(87841),c=t(63448),a=t(56583),r=new d,n=function(e,s){var h=e.tilemapLayer.tilemap,i=e.tilemapLayer,o=Math.floor(h.tileWidth*i.scaleX),f=Math.floor(h.tileHeight*i.scaleY),l=a(s.worldView.x-i.x,o,0,!0)-i.cullPaddingX,u=c(s.worldView.right-i.x,o,0,!0)+i.cullPaddingX,v=a(s.worldView.y-i.y,f,0,!0)-i.cullPaddingY,m=c(s.worldView.bottom-i.y,f,0,!0)+i.cullPaddingY;return r.setTo(l,v,u-l,m-v)};p.exports=n},30003:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19545),c=t(32483),a=function(r,n,e,s){e===void 0&&(e=[]),s===void 0&&(s=0),e.length=0;var h=r.tilemapLayer,i=d(r,n);return(h.skipCull||h.scrollFactorX!==1||h.scrollFactorY!==1)&&(i.left=0,i.right=r.width,i.top=0,i.bottom=r.height),c(r,i,s,e),e};p.exports=a},35137:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(42573),a=t(20576),r=function(n,e,s,h,i,o,f){for(var l=f.collideIndexes.indexOf(n)!==-1,u=d(e,s,h,i,null,f),v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i,o){var f=d(n,e,s,h,i,o);return f.filter(a,r)};p.exports=c},52692:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d===void 0&&(d=0),c===void 0&&(c=!1);var r=0,n,e,s;if(c){for(e=a.height-1;e>=0;e--)for(n=a.width-1;n>=0;n--)if(s=a.data[e][n],s&&s.index===t){if(r===d)return s;r+=1}}else for(e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i,o){var f=d(n,e,s,h,i,o);return f.find(a,r)||null};p.exports=c},97560:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i,o){var f=d(n,e,s,h,i,o);f.forEach(a,r)};p.exports=c},43305:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(30003),a=t(9474),r=t(14018),n=t(29747),e=t(54503),s=function(h){return h===d.ORTHOGONAL?c:h===d.HEXAGONAL?a:h===d.STAGGERED?e:h===d.ISOMETRIC?r:n};p.exports=s},7423:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62991),c=function(a,r,n,e){if(n===void 0&&(n=!1),d(a,r,e)){var s=e.data[r][a]||null;return s?s.index===-1?n?s:null:s:null}else return null};p.exports=c},60540:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7423),c=t(26099),a=new c,r=function(n,e,s,h,i){return i.tilemapLayer.worldToTileXY(n,e,!0,a,h),d(a.x,a.y,s,i)};p.exports=r},55826:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e){var s=e.baseTileWidth,h=e.baseTileHeight,i=e.tilemapLayer,o=0,f=0;i&&(n||(n=i.scene.cameras.main),o=i.x+n.scrollX*(1-i.scrollFactorX),f=i.y+n.scrollY*(1-i.scrollFactorY),s*=i.scaleX,h*=i.scaleY);var l=o+a*s,u=f+r*h;return[new d(l,u),new d(l+s,u),new d(l+s,u+h),new d(l,u+h)]};p.exports=c},11758:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(27229),a=t(29747),r=t(55826),n=function(e){return e===d.ORTHOGONAL?r:e===d.ISOMETRIC?a:e===d.HEXAGONAL?c:(e===d.STAGGERED,a)};p.exports=n},39167:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(29747),a=t(97281),r=function(n){return n===d.ORTHOGONAL?a:c};p.exports=r},62e3:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(19951),a=t(14127),r=t(29747),n=t(97202),e=t(70326),s=function(h){return h===d.ORTHOGONAL?e:h===d.ISOMETRIC?a:h===d.HEXAGONAL?c:h===d.STAGGERED?n:r};p.exports=s},5984:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(29747),a=t(28054),r=t(29650),n=function(e){return e===d.ORTHOGONAL?r:e===d.STAGGERED?a:c};p.exports=n},7386:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=function(a,r,n,e,s,h){a===void 0&&(a=0),r===void 0&&(r=0),n===void 0&&(n=h.width),e===void 0&&(e=h.height),s||(s={});var i=d(s,"isNotEmpty",!1),o=d(s,"isColliding",!1),f=d(s,"hasInterestingFace",!1);a<0&&(n+=a,a=0),r<0&&(e+=r,r=0),a+n>h.width&&(n=Math.max(h.width-a,0)),r+e>h.height&&(e=Math.max(h.height-r,0));for(var l=[],u=r;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(55738),c=t(7386),a=t(91865),r=t(29747),n=t(26099),e=function(f,l){return a.RectangleToTriangle(l,f)},s=new n,h=new n,i=new n,o=function(f,l,u,v){if(f===void 0)return[];var m=r;f instanceof d.Circle?m=a.CircleToRectangle:f instanceof d.Rectangle?m=a.RectangleToRectangle:f instanceof d.Triangle?m=e:f instanceof d.Line&&(m=a.LineToRectangle),v.tilemapLayer.worldToTileXY(f.left,f.top,!0,h,u);var x=h.x,g=h.y;v.tilemapLayer.worldToTileXY(f.right,f.bottom,!1,i,u);var y=Math.ceil(i.x),T=Math.ceil(i.y),E=Math.max(y-x,1),P=Math.max(T-g,1),R=c(x,g,E,P,l,v),M=v.tileWidth,L=v.tileHeight;v.tilemapLayer&&(M*=v.tilemapLayer.scaleX,L*=v.tilemapLayer.scaleY);for(var O=[],D=new d.Rectangle(0,0,M,L),I=0;I{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(26099),a=new c,r=new c,n=function(e,s,h,i,o,f,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(e,s,!0,a,f,l);var v=a.x,m=a.y;u(e+h,s+i,!1,r,f,l);var x=Math.ceil(r.x),g=Math.ceil(r.y);return d(v,m,x-v,g-m,o,l)};p.exports=n},96113:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(20242),a=t(10095),r=function(n){return n===d.ORTHOGONAL?a:c};p.exports=r},16926:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(86625),a=t(96897),r=t(29747),n=t(15108),e=t(85896),s=function(h){return h===d.ORTHOGONAL?e:h===d.ISOMETRIC?a:h===d.HEXAGONAL?c:h===d.STAGGERED?n:r};p.exports=s},55762:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=t(20242),a=t(51900),r=t(63288),n=function(e){return e===d.ORTHOGONAL?r:e===d.STAGGERED?a:c};p.exports=n},45091:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62991),c=function(a,r,n){if(d(a,r,n)){var e=n.data[r][a];return e!==null&&e.index>-1}else return!1};p.exports=c},24152:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(45091),c=t(26099),a=new c,r=function(n,e,s,h){h.tilemapLayer.worldToTileXY(n,e,!0,a,s);var i=a.x,o=a.y;return d(i,o,h)};p.exports=r},90454:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(63448),c=t(56583),a=function(r,n){var e=r.tilemapLayer.tilemap,s=r.tilemapLayer,h=Math.floor(e.tileWidth*s.scaleX),i=Math.floor(e.tileHeight*s.scaleY),o=r.hexSideLength,f,l,u,v;if(r.staggerAxis==="y"){var m=(i-o)/2+o;f=c(n.worldView.x-s.x,h,0,!0)-s.cullPaddingX,l=d(n.worldView.right-s.x,h,0,!0)+s.cullPaddingX,u=c(n.worldView.y-s.y,m,0,!0)-s.cullPaddingY,v=d(n.worldView.bottom-s.y,m,0,!0)+s.cullPaddingY}else{var x=(h-o)/2+o;f=c(n.worldView.x-s.x,x,0,!0)-s.cullPaddingX,l=d(n.worldView.right-s.x,x,0,!0)+s.cullPaddingX,u=c(n.worldView.y-s.y,i,0,!0)-s.cullPaddingY,v=d(n.worldView.bottom-s.y,i,0,!0)+s.cullPaddingY}return{left:f,right:l,top:u,bottom:v}};p.exports=a},9474:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(90454),c=t(32483),a=function(r,n,e,s){e===void 0&&(e=[]),s===void 0&&(s=0),e.length=0;var h=r.tilemapLayer,i=d(r,n);return h.skipCull&&h.scrollFactorX===1&&h.scrollFactorY===1&&(i.left=0,i.right=r.width,i.top=0,i.bottom=r.height),c(r,i,s,e),e};p.exports=a},27229:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19951),c=t(26099),a=new c,r=function(n,e,s,h){var i=h.baseTileWidth,o=h.baseTileHeight,f=h.tilemapLayer;f&&(i*=f.scaleX,o*=f.scaleY);var l=d(n,e,a,s,h),u=[],v=.5773502691896257,m,x;h.staggerAxis==="y"?(m=v*i,x=o/2):(m=i/2,x=v*o);for(var g=0;g<6;g++){var y=2*Math.PI*(.5-g)/6;u.push(new c(l.x+m*Math.cos(y),l.y+x*Math.sin(y)))}return u};p.exports=r},19951:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s){n||(n=new d);var h=s.baseTileWidth,i=s.baseTileHeight,o=s.tilemapLayer,f=0,l=0;o&&(e||(e=o.scene.cameras.main),f=o.x+e.scrollX*(1-o.scrollFactorX),l=o.y+e.scrollY*(1-o.scrollFactorY),h*=o.scaleX,i*=o.scaleY);var u=h/2,v=i/2,m,x;return s.staggerAxis==="y"?(m=f+h*a+h,x=l+1.5*r*v+v,r%2===0&&(this.staggerIndex==="odd"?m-=u:m+=u)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(m=f+1.5*a*u+u,x=l+i*a+i,a%2===0&&(this.staggerIndex==="odd"?x-=v:x+=v)),n.set(m,x)};p.exports=c},86625:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s,h){e||(e=new d);var i=h.baseTileWidth,o=h.baseTileHeight,f=h.tilemapLayer;f&&(s||(s=f.scene.cameras.main),a=a-(f.x+s.scrollX*(1-f.scrollFactorX)),r=r-(f.y+s.scrollY*(1-f.scrollFactorY)),i*=f.scaleX,o*=f.scaleY);var l=.5773502691896257,u=-.3333333333333333,v=0,m=.6666666666666666,x=i/2,g=o/2,y,T,E,P,R;h.staggerAxis==="y"?(y=(a-x)/(l*i),T=(r-g)/g,E=l*y+u*T,P=v*y+m*T):(y=(a-x)/x,T=(r-g)/(l*o),E=u*y+l*T,P=m*y+v*T),R=-E-P;var M=Math.round(E),L=Math.round(P),O=Math.round(R),D=Math.abs(M-E),I=Math.abs(L-P),V=Math.abs(O-R);D>I&&D>V?M=-L-O:I>V&&(L=-M-O);var X,H=L;return h.staggerIndex==="odd"?X=H%2===0?L/2+M:L/2+M-.5:X=H%2===0?L/2+M:L/2+M+.5,e.set(X,H)};p.exports=c},62991:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t>=0&&t=0&&d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33528),c=function(a,r,n,e){n===void 0&&(n=[]),e===void 0&&(e=0),n.length=0;var s=a.tilemapLayer,h=a.data,i=a.width,o=a.height,f=s.skipCull,l=0,u=i,v=0,m=o,x,g,y;if(e===0)for(g=v;g=l;x--)y=h[g][x],!(!y||y.index===-1||!y.visible||y.alpha===0)&&(!f&&!d(x,g,a,r)||n.push(y));else if(e===2)for(g=m;g>=v;g--)for(x=l;x=v;g--)for(x=u;x>=l;x--)y=h[g][x],!(!y||y.index===-1||!y.visible||y.alpha===0)&&(!f&&!d(x,g,a,r)||n.push(y));return s.tilesDrawn=n.length,s.tilesTotal=i*o,n};p.exports=c},14127:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s){n||(n=new d);var h=s.baseTileWidth,i=s.baseTileHeight,o=s.tilemapLayer,f=0,l=0;o&&(e||(e=o.scene.cameras.main),f=o.x+e.scrollX*(1-o.scrollFactorX),h*=o.scaleX,l=o.y+e.scrollY*(1-o.scrollFactorY),i*=o.scaleY);var u=f+(a-r)*(h/2),v=l+(a+r)*(i/2);return n.set(u,v)};p.exports=c},96897:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s,h,i){e||(e=new d);var o=h.baseTileWidth,f=h.baseTileHeight,l=h.tilemapLayer;l&&(s||(s=l.scene.cameras.main),r=r-(l.y+s.scrollY*(1-l.scrollFactorY)),f*=l.scaleY,a=a-(l.x+s.scrollX*(1-l.scrollFactorX)),o*=l.scaleX);var u=o/2,v=f/2;a=a-u,i||(r=r-f);var m=.5*(a/u+r/v),x=.5*(-a/u+r/v);return n&&(m=Math.floor(m),x=Math.floor(x)),e.set(m,x)};p.exports=c},71558:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23029),c=t(62991),a=t(72023),r=t(20576),n=function(e,s,h,i,o){if(i===void 0&&(i=!0),!c(s,h,o))return null;var f,l=o.data[h][s],u=l&&l.collides;e instanceof d?(o.data[h][s]===null&&(o.data[h][s]=new d(o,e.index,s,h,o.tileWidth,o.tileHeight)),o.data[h][s].copy(e)):(f=e,o.data[h][s]===null?o.data[h][s]=new d(o,f,s,h,o.tileWidth,o.tileHeight):o.data[h][s].index=f);var v=o.data[h][s],m=o.collideIndexes.indexOf(v.index)!==-1;if(f=e instanceof d?e.index:e,f===-1)v.width=o.tileWidth,v.height=o.tileHeight;else{var x=o.tilemapLayer.tilemap,g=x.tiles,y=g[f][2],T=x.tilesets[y];v.width=T.tileWidth,v.height=T.tileHeight}return r(v,m),i&&u!==v.collides&&a(s,h,o),v};p.exports=n},26303:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(71558),c=t(26099),a=new c,r=function(n,e,s,h,i,o){return o.tilemapLayer.worldToTileXY(e,s,!0,a,i,o),d(n,a.x,a.y,h,o)};p.exports=r},14051:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(42573),c=t(71558),a=function(r,n,e,s,h){if(s===void 0&&(s=!0),!Array.isArray(r))return null;Array.isArray(r[0])||(r=[r]);for(var i=r.length,o=r[0].length,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(26546),a=function(r,n,e,s,h,i){var o,f=d(r,n,e,s,{},i);if(!h)for(h=[],o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(23029),c=t(62991),a=t(72023),r=function(n,e,s,h,i){if(s===void 0&&(s=!0),h===void 0&&(h=!0),!c(n,e,i))return null;var o=i.data[e][n];if(o)i.data[e][n]=s?null:new d(i,-1,n,e,i.tileWidth,i.tileHeight);else return null;return h&&o&&o.collides&&a(n,e,i),o};p.exports=r},94178:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(63557),c=t(26099),a=new c,r=function(n,e,s,h,i,o){return o.tilemapLayer.worldToTileXY(n,e,!0,a,i,o),d(a.x,a.y,s,h,o)};p.exports=r},15533:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(3956),a=new c(105,210,231,150),r=new c(243,134,48,200),n=new c(40,39,37,150),e=function(s,h,i){h===void 0&&(h={});var o=h.tileColor!==void 0?h.tileColor:a,f=h.collidingTileColor!==void 0?h.collidingTileColor:r,l=h.faceColor!==void 0?h.faceColor:n,u=d(0,0,i.width,i.height,null,i);s.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),s.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i){for(var o=d(n,e,s,h,null,i),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=t.data,n=t.width,e=t.height,s=t.tilemapLayer,h=Math.max(0,d.left),i=Math.min(n,d.right),o=Math.max(0,d.top),f=Math.min(e,d.bottom),l,u,v;if(c===0)for(u=o;u=h;l--)v=r[u][l],!(!v||v.index===-1||!v.visible||v.alpha===0)&&a.push(v);else if(c===2)for(u=f;u>=o;u--)for(l=h;r[u]&&l=o;u--)for(l=i;r[u]&&l>=h;l--)v=r[u][l],!(!v||v.index===-1||!v.visible||v.alpha===0)&&a.push(v);return s.tilesDrawn=a.length,s.tilesTotal=n*e,a};p.exports=C},57068:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20576),c=t(42573),a=t(9589),r=function(n,e,s,h,i){e===void 0&&(e=!0),s===void 0&&(s=!0),i===void 0&&(i=!0),Array.isArray(n)||(n=[n]);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20576),c=t(42573),a=t(9589),r=function(n,e,s,h,i,o){if(s===void 0&&(s=!0),h===void 0&&(h=!0),o===void 0&&(o=!0),!(n>e)){for(var f=n;f<=e;f++)a(f,s,i);if(o)for(var l=0;l=n&&v.index<=e&&d(v,s)}h&&c(0,0,i.width,i.height,i)}};p.exports=r},75661:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20576),c=t(42573),a=t(9589),r=function(n,e,s,h){e===void 0&&(e=!0),s===void 0&&(s=!0),Array.isArray(n)||(n=[n]);for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20576),c=t(42573),a=t(97022),r=function(n,e,s,h){e===void 0&&(e=!0),s===void 0&&(s=!0);for(var i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(20576),c=t(42573),a=function(r,n,e){r===void 0&&(r=!0),n===void 0&&(n=!0);for(var s=0;s0&&d(i,r)}}n&&c(0,0,e.width,e.height,e)};p.exports=a},9589:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=c.collideIndexes.indexOf(t);d&&a===-1?c.collideIndexes.push(t):!d&&a!==-1&&c.collideIndexes.splice(a,1)};p.exports=C},20576:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)};p.exports=C},79583:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){if(typeof t=="number")a.callbacks[t]=d!==null?{callback:d,callbackContext:c}:void 0;else for(var r=0,n=t.length;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i){for(var o=d(a,r,n,e,null,i),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(33680),a=function(r,n,e,s,h){var i=d(r,n,e,s,null,h),o=i.map(function(l){return l.index});c(o);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(63448),c=t(56583),a=function(r,n){var e=r.tilemapLayer.tilemap,s=r.tilemapLayer,h=Math.floor(e.tileWidth*s.scaleX),i=Math.floor(e.tileHeight*s.scaleY),o=c(n.worldView.x-s.x,h,0,!0)-s.cullPaddingX,f=d(n.worldView.right-s.x,h,0,!0)+s.cullPaddingX,l=c(n.worldView.y-s.y,i/2,0,!0)-s.cullPaddingY,u=d(n.worldView.bottom-s.y,i/2,0,!0)+s.cullPaddingY;return{left:o,right:f,top:l,bottom:u}};p.exports=a},54503:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(61325),c=t(32483),a=function(r,n,e,s){e===void 0&&(e=[]),s===void 0&&(s=0),e.length=0;var h=r.tilemapLayer,i=d(r,n);return h.skipCull&&h.scrollFactorX===1&&h.scrollFactorY===1&&(i.left=0,i.right=r.width,i.top=0,i.bottom=r.height),c(r,i,s,e),e};p.exports=a},97202:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s){n||(n=new d);var h=s.baseTileWidth,i=s.baseTileHeight,o=s.tilemapLayer,f=0,l=0;o&&(e||(e=o.scene.cameras.main),f=o.x+e.scrollX*(1-o.scrollFactorX),h*=o.scaleX,l=o.y+e.scrollY*(1-o.scrollFactorY),i*=o.scaleY);var u=f+a*h+r%2*(h/2),v=l+r*(i/2);return n.set(u,v)};p.exports=c},28054:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=c.baseTileHeight,r=c.tilemapLayer,n=0;return r&&(d===void 0&&(d=r.scene.cameras.main),n=r.y+d.scrollY*(1-r.scrollFactorY),a*=r.scaleY),n+t*(a/2)+a};p.exports=C},15108:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s,h){e||(e=new d);var i=h.baseTileWidth,o=h.baseTileHeight,f=h.tilemapLayer;f&&(s||(s=f.scene.cameras.main),r=r-(f.y+s.scrollY*(1-f.scrollFactorY)),o*=f.scaleY,a=a-(f.x+s.scrollX*(1-f.scrollFactorX)),i*=f.scaleX);var l=n?Math.floor(r/(o/2)):r/(o/2),u=n?Math.floor((a+l%2*.5*i)/i):(a+l%2*.5*i)/i;return e.set(u,l)};p.exports=c},51900:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=a.baseTileHeight,n=a.tilemapLayer;return n&&(c||(c=n.scene.cameras.main),t=t-(n.y+c.scrollY*(1-n.scrollFactorY)),r*=n.scaleY),d?Math.floor(t/(r/2)):t/(r/2)};p.exports=C},86560:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=function(a,r,n,e,s,h,i){for(var o=d(n,e,s,h,null,i),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=c.baseTileWidth,r=c.tilemapLayer,n=0;return r&&(d||(d=r.scene.cameras.main),n=r.x+d.scrollX*(1-r.scrollFactorX),a*=r.scaleX),n+t*a};p.exports=C},70326:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(97281),c=t(29650),a=t(26099),r=function(n,e,s,h,i){return s||(s=new a(0,0)),s.x=d(n,h,i),s.y=c(e,h,i),s};p.exports=r},29650:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=c.baseTileHeight,r=c.tilemapLayer,n=0;return r&&(d||(d=r.scene.cameras.main),n=r.y+d.scrollY*(1-r.scrollFactorY),a*=r.scaleY),n+t*a};p.exports=C},77366:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(7386),c=t(75508),a=function(r,n,e,s,h,i){if(h){var o,f=d(r,n,e,s,null,i),l=0;for(o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85896),c=t(26099),a=new c,r=function(n,e,s,h){return d(n,0,e,a,s,h),a.x};p.exports=r},85896:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(26099),c=function(a,r,n,e,s,h){n===void 0&&(n=!0),e||(e=new d);var i=h.baseTileWidth,o=h.baseTileHeight,f=h.tilemapLayer;f&&(s||(s=f.scene.cameras.main),a=a-(f.x+s.scrollX*(1-f.scrollFactorX)),r=r-(f.y+s.scrollY*(1-f.scrollFactorY)),i*=f.scaleX,o*=f.scaleY);var l=a/i,u=r/o;return n&&(l=Math.floor(l),u=Math.floor(u)),e.set(l,u)};p.exports=c},63288:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(85896),c=t(26099),a=new c,r=function(n,e,s,h){return d(0,n,e,a,s,h),a.y};p.exports=r},81086:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CalculateFacesAt:t(72023),CalculateFacesWithin:t(42573),CheckIsoBounds:t(33528),Copy:t(1785),CreateFromTiles:t(78419),CullBounds:t(19545),CullTiles:t(30003),Fill:t(35137),FilterTiles:t(40253),FindByIndex:t(52692),FindTile:t(66151),ForEachTile:t(97560),GetCullTilesFunction:t(43305),GetTileAt:t(7423),GetTileAtWorldXY:t(60540),GetTileCorners:t(55826),GetTileCornersFunction:t(11758),GetTilesWithin:t(7386),GetTilesWithinShape:t(91141),GetTilesWithinWorldXY:t(96523),GetTileToWorldXFunction:t(39167),GetTileToWorldXYFunction:t(62e3),GetTileToWorldYFunction:t(5984),GetWorldToTileXFunction:t(96113),GetWorldToTileXYFunction:t(16926),GetWorldToTileYFunction:t(55762),HasTileAt:t(45091),HasTileAtWorldXY:t(24152),HexagonalCullBounds:t(90454),HexagonalCullTiles:t(9474),HexagonalGetTileCorners:t(27229),HexagonalTileToWorldXY:t(19951),HexagonalWorldToTileXY:t(86625),IsInLayerBounds:t(62991),IsometricCullTiles:t(14018),IsometricTileToWorldXY:t(14127),IsometricWorldToTileXY:t(96897),PutTileAt:t(71558),PutTileAtWorldXY:t(26303),PutTilesAt:t(14051),Randomize:t(77389),RemoveTileAt:t(63557),RemoveTileAtWorldXY:t(94178),RenderDebug:t(15533),ReplaceByIndex:t(27987),RunCull:t(32483),SetCollision:t(57068),SetCollisionBetween:t(37266),SetCollisionByExclusion:t(75661),SetCollisionByProperty:t(64740),SetCollisionFromCollisionGroup:t(63307),SetLayerCollisionIndex:t(9589),SetTileCollision:t(20576),SetTileIndexCallback:t(79583),SetTileLocationCallback:t(93254),Shuffle:t(32903),StaggeredCullBounds:t(61325),StaggeredCullTiles:t(54503),StaggeredTileToWorldXY:t(97202),StaggeredTileToWorldY:t(28054),StaggeredWorldToTileXY:t(15108),StaggeredWorldToTileY:t(51900),SwapByIndex:t(86560),TileToWorldX:t(97281),TileToWorldXY:t(70326),TileToWorldY:t(29650),WeightedRandomize:t(77366),WorldToTileX:t(10095),WorldToTileXY:t(85896),WorldToTileY:t(63288)}},91907:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={ORIENTATION:t(91907)};p.exports=d},62501:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=t(21829),a={Components:t(81086),Parsers:t(57442),Formats:t(80341),ImageCollection:t(16536),ParseToTilemap:t(31989),Tile:t(23029),Tilemap:t(49075),TilemapCreator:t(45939),TilemapFactory:t(46029),Tileset:t(33629),TilemapLayer:t(20442),Orientation:t(91907),LayerData:t(14977),MapData:t(87010),ObjectLayer:t(48700)};a=d(!1,a,c.ORIENTATION),p.exports=a},14977:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(91907),a=t(95540),r=new d({initialize:function(e){e===void 0&&(e={}),this.name=a(e,"name","layer"),this.id=a(e,"id",0),this.x=a(e,"x",0),this.y=a(e,"y",0),this.width=a(e,"width",0),this.height=a(e,"height",0),this.tileWidth=a(e,"tileWidth",0),this.tileHeight=a(e,"tileHeight",0),this.baseTileWidth=a(e,"baseTileWidth",this.tileWidth),this.baseTileHeight=a(e,"baseTileHeight",this.tileHeight),this.orientation=a(e,"orientation",c.ORTHOGONAL),this.widthInPixels=a(e,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=a(e,"heightInPixels",this.height*this.baseTileHeight),this.alpha=a(e,"alpha",1),this.visible=a(e,"visible",!0),this.properties=a(e,"properties",[]),this.indexes=a(e,"indexes",[]),this.collideIndexes=a(e,"collideIndexes",[]),this.callbacks=a(e,"callbacks",[]),this.bodies=a(e,"bodies",[]),this.data=a(e,"data",[]),this.tilemapLayer=a(e,"tilemapLayer",null),this.hexSideLength=a(e,"hexSideLength",0),this.staggerAxis=a(e,"staggerAxis","y"),this.staggerIndex=a(e,"staggerIndex","odd")}});p.exports=r},87010:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(91907),a=t(95540),r=new d({initialize:function(e){e===void 0&&(e={}),this.name=a(e,"name","map"),this.width=a(e,"width",0),this.height=a(e,"height",0),this.infinite=a(e,"infinite",!1),this.tileWidth=a(e,"tileWidth",0),this.tileHeight=a(e,"tileHeight",0),this.widthInPixels=a(e,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=a(e,"heightInPixels",this.height*this.tileHeight),this.format=a(e,"format",null),this.orientation=a(e,"orientation",c.ORTHOGONAL),this.renderOrder=a(e,"renderOrder","right-down"),this.version=a(e,"version","1"),this.properties=a(e,"properties",{}),this.layers=a(e,"layers",[]),this.images=a(e,"images",[]),this.objects=a(e,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=a(e,"collision",{}),this.tilesets=a(e,"tilesets",[]),this.imageCollections=a(e,"imageCollections",[]),this.tiles=a(e,"tiles",[]),this.hexSideLength=a(e,"hexSideLength",0),this.staggerAxis=a(e,"staggerAxis","y"),this.staggerIndex=a(e,"staggerIndex","odd")}});p.exports=r},48700:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=new d({initialize:function(n){n===void 0&&(n={}),this.name=c(n,"name","object layer"),this.id=c(n,"id",0),this.opacity=c(n,"opacity",1),this.properties=c(n,"properties",{}),this.propertyTypes=c(n,"propertytypes",{}),this.type=c(n,"type","objectgroup"),this.visible=c(n,"visible",!0),this.objects=c(n,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});p.exports=a},6641:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(91907),c=function(a){return a=a.toLowerCase(),a==="isometric"?d.ISOMETRIC:a==="staggered"?d.STAGGERED:a==="hexagonal"?d.HEXAGONAL:d.ORTHOGONAL};p.exports=c},46177:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80341),c=t(2342),a=t(82593),r=t(46594),n=t(87021),e=function(s,h,i,o,f,l){var u;switch(h){case d.ARRAY_2D:u=c(s,i,o,f,l);break;case d.CSV:u=a(s,i,o,f,l);break;case d.TILED_JSON:u=r(s,i,l);break;case d.WELTMEISTER:u=n(s,i,l);break;default:console.warn("Unrecognized tilemap data format: "+h),u=null}return u};p.exports=e},2342:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80341),c=t(14977),a=t(87010),r=t(23029),n=function(e,s,h,i,o){for(var f=new c({tileWidth:h,tileHeight:i}),l=new a({name:e,tileWidth:h,tileHeight:i,format:d.ARRAY_2D,layers:[f]}),u=[],v=s.length,m=0,x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80341),c=t(2342),a=function(r,n,e,s,h){var i=n.trim().split(` +`).map(function(f){return f.split(",")}),o=c(r,i,e,s,h);return o.format=d.CSV,o};p.exports=a},6656:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(14977),c=t(23029),a=function(r,n){for(var e=[],s=0;s-1?m=new c(i,v,u,l,h.tilesize,h.tilesize):m=n?null:new c(i,-1,u,l,h.tilesize,h.tilesize),o.push(m)}f.push(o),o=[]}i.data=f,e.push(i)}return e};p.exports=a},96483:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33629),c=function(a){for(var r=[],n=[],e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(80341),c=t(87010),a=t(6656),r=t(96483),n=function(e,s,h){if(s.layer.length===0)return console.warn("No layers found in the Weltmeister map: "+e),null;for(var i=0,o=0,f=0;fi&&(i=s.layer[f].width),s.layer[f].height>o&&(o=s.layer[f].height);var l=new c({width:i,height:o,name:e,tileWidth:s.layer[0].tilesize,tileHeight:s.layer[0].tilesize,format:d.WELTMEISTER});return l.layers=a(s,h),l.tilesets=r(s),l};p.exports=n},52833:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ParseTileLayers:t(6656),ParseTilesets:t(96483),ParseWeltmeister:t(87021)}},57442:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={FromOrientationString:t(6641),Parse:t(46177),Parse2DArray:t(2342),ParseCSV:t(82593),Impact:t(52833),Tiled:t(96761)}},51233:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(79291),c=function(a){for(var r,n,e,s,h,i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=window.atob(t),c=d.length,a=new Array(c/4),r=0;r>>0;return a};p.exports=C},84101:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33629),c=function(a){var r,n,e=[];for(r=0;r{/** + * @author Seth Berrier + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=function(a,r,n){if(!r)return{i:0,layers:a.layers,name:"",opacity:1,visible:!0,x:0,y:0};var e=r.x+d(r,"startx",0)*a.tilewidth+d(r,"offsetx",0),s=r.y+d(r,"starty",0)*a.tileheight+d(r,"offsety",0);return{i:0,layers:r.layers,name:n.name+r.name+"/",opacity:n.opacity*r.opacity,visible:n.visible&&r.visible,x:n.x+e,y:n.y+s}};p.exports=c},29920:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=2147483648,t=1073741824,d=536870912,c=function(a){var r=!!(a&C),n=!!(a&t),e=!!(a&d);a=a&~(C|t|d);var s=0,h=!1;return r&&n&&e?(s=Math.PI/2,h=!0):r&&n&&!e?(s=Math.PI,h=!1):r&&!n&&e?(s=Math.PI/2,h=!1):r&&!n&&!e?(s=0,h=!0):!r&&n&&e?(s=3*Math.PI/2,h=!1):!r&&n&&!e?(s=Math.PI,h=!0):!r&&!n&&e?(s=3*Math.PI/2,h=!0):!r&&!n&&!e&&(s=0,h=!1),{gid:a,flippedHorizontal:r,flippedVertical:n,flippedAntiDiagonal:e,rotation:s,flipped:h}};p.exports=c},12635:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=t(79677),a=function(r){for(var n=[],e=[],s=c(r);s.i0;){if(s.i>=s.layers.length){if(e.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=e.pop();continue}var h=s.layers[s.i];if(s.i++,h.type!=="imagelayer"){if(h.type==="group"){var i=c(r,h,s);e.push(s),s=i}continue}var o=d(h,"offsetx",0)+d(h,"startx",0),f=d(h,"offsety",0)+d(h,"starty",0);n.push({name:s.name+h.name,image:h.image,x:s.x+o+h.x,y:s.y+f+h.y,alpha:s.opacity*h.opacity,visible:s.visible&&h.visible,properties:d(h,"properties",{})})}return n};p.exports=a},46594:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(51233),c=t(84101),a=t(91907),r=t(62644),n=t(80341),e=t(6641),s=t(87010),h=t(12635),i=t(22611),o=t(28200),f=t(24619),l=function(u,v,m){var x=r(v),g=new s({width:x.width,height:x.height,name:u,tileWidth:x.tilewidth,tileHeight:x.tileheight,orientation:e(x.orientation),format:n.TILED_JSON,version:x.version,properties:x.properties,renderOrder:x.renderorder,infinite:x.infinite});g.orientation===a.HEXAGONAL&&(g.hexSideLength=x.hexsidelength,g.staggerAxis=x.staggeraxis,g.staggerIndex=x.staggerindex),g.layers=o(x,m),g.images=h(x);var y=f(x);return g.tilesets=y.tilesets,g.imageCollections=y.imageCollections,g.objects=i(x),g.tiles=c(g),d(g),g};p.exports=l},52205:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(18254),c=t(29920),a=function(e){return{x:e.x,y:e.y}},r=["id","name","type","rotation","properties","visible","x","y","width","height"],n=function(e,s,h){s===void 0&&(s=0),h===void 0&&(h=0);var i=d(e,r);if(i.x+=s,i.y+=h,e.gid){var o=c(e.gid);i.gid=o.gid,i.flippedHorizontal=o.flippedHorizontal,i.flippedVertical=o.flippedVertical,i.flippedAntiDiagonal=o.flippedAntiDiagonal}else e.polyline?i.polyline=e.polyline.map(a):e.polygon?i.polygon=e.polygon.map(a):e.ellipse?i.ellipse=e.ellipse:e.text?i.text=e.text:e.point?i.point=!0:i.rectangle=!0;return i};p.exports=n},22611:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95540),c=t(52205),a=t(48700),r=t(79677),n=function(e){for(var s=[],h=[],i=r(e);i.i0;){if(i.i>=i.layers.length){if(h.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}i=h.pop();continue}var o=i.layers[i.i];if(i.i++,o.opacity*=i.opacity,o.visible=i.visible&&o.visible,o.type!=="objectgroup"){if(o.type==="group"){var f=r(e,o,i);h.push(i),i=f}continue}o.name=i.name+o.name;for(var l=i.x+d(o,"startx",0)+d(o,"offsetx",0),u=i.y+d(o,"starty",0)+d(o,"offsety",0),v=[],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41868),c=t(91907),a=t(79677),r=t(6641),n=t(95540),e=t(14977),s=t(29920),h=t(23029),i=function(o,f){for(var l=n(o,"infinite",!1),u=[],v=[],m=a(o);m.i0;){if(m.i>=m.layers.length){if(v.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}m=v.pop();continue}var x=m.layers[m.i];if(m.i++,x.type!=="tilelayer"){if(x.type==="group"){var g=a(o,x,m);v.push(m),m=g}continue}if(x.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+x.name+"'");continue}else if(x.encoding&&x.encoding==="base64"){if(x.chunks)for(var y=0;y0?(P=new h(T,E.gid,N,z,o.tilewidth,o.tileheight),P.rotation=E.rotation,P.flipX=E.flipped,M[z][N]=P):(R=f?null:new h(T,-1,N,z,o.tilewidth,o.tileheight),M[z][N]=R),L++,L===X.width&&(U++,L=0)}}else{T=new e({name:m.name+x.name,id:x.id,x:m.x+n(x,"offsetx",0)+x.x,y:m.y+n(x,"offsety",0)+x.y,width:x.width,height:x.height,tileWidth:o.tilewidth,tileHeight:o.tileheight,alpha:m.opacity*x.opacity,visible:m.visible&&x.visible,properties:n(x,"properties",[]),orientation:r(o.orientation)}),T.orientation===c.HEXAGONAL&&(T.hexSideLength=o.hexsidelength,T.staggerAxis=o.staggeraxis,T.staggerIndex=o.staggerindex);for(var Y=[],K=0,Z=x.data.length;K0?(P=new h(T,E.gid,L,M.length,o.tilewidth,o.tileheight),P.rotation=E.rotation,P.flipX=E.flipped,Y.push(P)):(R=f?null:new h(T,-1,L,M.length,o.tilewidth,o.tileheight),Y.push(R)),L++,L===x.width&&(M.push(Y),L=0,Y=[])}T.data=M,u.push(T)}return u};p.exports=i},24619:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(33629),c=t(16536),a=t(52205),r=t(57880),n=function(e){for(var s=[],h=[],i=null,o,f=0;f1){var v=void 0,m=void 0;if(Array.isArray(l.tiles)){v=v||{},m=m||{};for(var x=0;x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){for(var c=0;c0){var n={},e={},s,h,i;if(Array.isArray(a.edgecolors))for(s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={AssignTileProperties:t(51233),Base64Decode:t(41868),BuildTilesetIndex:t(84101),CreateGroupLayer:t(79677),ParseGID:t(29920),ParseImageLayers:t(12635),ParseJSONTiled:t(46594),ParseObject:t(52205),ParseObjectLayers:t(22611),ParseTileLayers:t(28200),ParseTilesets:t(24619)}},33385:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(37277),a=t(44594),r=t(94880),n=t(72905),e=new d({initialize:function(h){this.scene=h,this.systems=h.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],h.sys.events.once(a.BOOT,this.boot,this),h.sys.events.on(a.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var s=this.systems.events;s.on(a.PRE_UPDATE,this.preUpdate,this),s.on(a.UPDATE,this.update,this),s.once(a.SHUTDOWN,this.shutdown,this)},addEvent:function(s){var h;return s instanceof r?(h=s,this.removeEvent(h),h.elapsed=h.startAt,h.hasDispatched=!1,h.repeatCount=h.repeat===-1||h.loop?999999999999:h.repeat):h=new r(s),this._pendingInsertion.push(h),h},delayedCall:function(s,h,i,o){return this.addEvent({delay:s,callback:h,args:i,callbackScope:o})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(s){Array.isArray(s)||(s=[s]);for(var h=0;h-1&&this._active.splice(f,1),o.destroy()}for(i=0;i=o.delay)){var f=o.elapsed-o.delay;if(o.elapsed=o.delay,!o.hasDispatched&&o.callback&&(o.hasDispatched=!0,o.callback.apply(o.callbackScope,o.args)),o.repeatCount>0){if(o.repeatCount--,f>=o.delay)for(;f>=o.delay&&o.repeatCount>0;)o.callback&&o.callback.apply(o.callbackScope,o.args),f-=o.delay,o.repeatCount--;o.elapsed=f,o.hasDispatched=!1}else o.hasDispatched&&this._pendingRemoval.push(o)}}}},shutdown:function(){var s;for(s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(39429),r=t(95540),n=t(44594),e=t(89809),s=new d({Extends:c,initialize:function(i,o){c.call(this),this.scene=i,this.systems=i.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var f=this.systems.events;f.on(n.PRE_UPDATE,this.preUpdate,this),f.on(n.UPDATE,this.update,this),f.once(n.SHUTDOWN,this.destroy,this),o&&this.add(o)},preUpdate:function(h,i){this.paused||(this.elapsed+=i)},update:function(){if(!(this.paused||this.complete)){var h,i=this.events,o=!1,f=this.systems,l;for(h=0;h=i.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(e.COMPLETE,this)}},play:function(h){return h===void 0&&(h=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,h&&this.reset(),this},pause:function(){return this.paused=!0,this},repeat:function(h){return(h===void 0||h===!0)&&(h=-1),h===!1&&(h=0),this.loop=h,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(h){h===void 0&&(h=!1),this.elapsed=0,h||(this.iteration=0);for(var i=0;i0&&(o=i[i.length-1].time);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(95540),a=new d({initialize:function(n){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(n)},reset:function(r){if(this.delay=c(r,"delay",0),this.repeat=c(r,"repeat",0),this.loop=c(r,"loop",!1),this.callback=c(r,"callback",void 0),this.callbackScope=c(r,"callbackScope",this),this.args=c(r,"args",[]),this.timeScale=c(r,"timeScale",1),this.startAt=c(r,"startAt",0),this.paused=c(r,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay===0&&(this.repeat>0||this.loop))throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var r=this.delay+this.delay*this.repeat,n=this.elapsed+this.delay*(this.repeat-this.repeatCount);return n/r}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(r){r===void 0&&(r=!1),this.elapsed=this.delay,this.hasDispatched=!r,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});p.exports=a},35945:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},89809:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={COMPLETE:t(35945)}},90291:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Clock:t(33385),Events:t(89809),Timeline:t(96120),TimerEvent:t(94880)}},40382:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(72905),c=t(83419),a=t(43491),r=t(88032),n=t(37277),e=t(44594),s=t(93109),h=t(86081),i=t(8357),o=t(43960),f=t(26012),l=new c({initialize:function(v){this.scene=v,this.events=v.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(e.BOOT,this.boot,this),this.events.on(e.START,this.start,this)},boot:function(){this.events.once(e.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(e.UPDATE,this.update,this),this.events.once(e.SHUTDOWN,this.shutdown,this)},create:function(u){Array.isArray(u)||(u=[u]);for(var v=[],m=0;m-1},existing:function(u){return this.has(u)||this.tweens.push(u.reset()),this},addCounter:function(u){var v=r(this,u);return this.tweens.push(v.reset()),v},stagger:function(u,v){return s(u,v)},setLagSmooth:function(u,v){return u===void 0&&(u=1/1e-8),v===void 0&&(v=0),this.maxLag=u,this.lagSkip=Math.min(v,this.maxLag),this},setFps:function(u){return u===void 0&&(u=240),this.gap=1e3/u,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(u){var v=Date.now()-this.prevTime;v>this.maxLag&&(this.startTime+=v-this.lagSkip),this.prevTime+=v;var m=this.prevTime-this.startTime,x=m-this.nextTime,g=m-this.time*1e3;return x>0||u?(m/=1e3,this.time=m,this.nextTime+=x+(x>=this.gap?4:this.gap-x)):g=0,g},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(u){u===void 0&&(u=!1);var v=this.getDelta(u);if(!(v<=0)){this.processing=!0;var m,x,g=[],y=this.tweens;for(m=0;m0){for(m=0;m-1&&(x.isPendingRemove()||x.isDestroyed())&&(y.splice(E,1),x.destroy())}g.length=0}this.processing=!1}},remove:function(u){return this.processing?u.setPendingRemoveState():(d(this.tweens,u),u.setRemovedState()),this},reset:function(u){return this.existing(u),u.seek(),u.setActiveState(),this},makeActive:function(u){return this.existing(u),u.setActiveState(),this},each:function(u,v){var m,x=[null];for(m=1;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){return t&&t.hasOwnProperty(d)?t[d]:c};p.exports=C},6113:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(62640),c=t(35355),a=function(r,n){var e=d.Power0;if(typeof r=="string")if(d.hasOwnProperty(r))e=d[r];else{var s="";if(r.indexOf(".")){s=r.substring(r.indexOf(".")+1);var h=s.toLowerCase();h==="in"?s="easeIn":h==="out"?s="easeOut":h==="inout"&&(s="easeInOut")}r=c(r.substring(0,r.indexOf(".")+1)+s),d.hasOwnProperty(r)&&(e=d[r])}else typeof r=="function"&&(e=r);if(!n)return e;var i=n.slice(0);return i.unshift(0),function(o){return i[0]=o,e.apply(this,i)}};p.exports=a},91389:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(89318),c=t(77259),a=t(28392),r={bezier:d,catmull:c,catmullrom:c,linear:a},n=function(e){if(e===null)return null;var s=r.linear;return typeof e=="string"?r.hasOwnProperty(e)&&(s=r[e]):typeof e=="function"&&(s=e),s};p.exports=n},55292:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a;if(t.hasOwnProperty(d)){var r=typeof t[d];r==="function"?a=function(n,e,s,h,i,o){return t[d](n,e,s,h,i,o)}:a=function(){return t[d]}}else typeof c=="function"?a=c:a=function(){return c};return a};p.exports=C},82985:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(81076),c=function(a){var r,n=[];if(a.hasOwnProperty("props"))for(r in a.props)r.substring(0,1)!=="_"&&n.push({key:r,value:a.props[r]});else for(r in a)d.indexOf(r)===-1&&r.substring(0,1)!=="_"&&n.push({key:r,value:a[r]});return n};p.exports=c},62329:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35154),c=function(a){var r=d(a,"targets",null);return r===null||(typeof r=="function"&&(r=r.call()),Array.isArray(r)||(r=[r])),r};p.exports=c},17777:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(30976),c=t(99472);function a(h){return!!h.getActive&&typeof h.getActive=="function"}function r(h){return!!h.getStart&&typeof h.getStart=="function"}function n(h){return!!h.getEnd&&typeof h.getEnd=="function"}function e(h){return r(h)||n(h)||a(h)}var s=function(h,i){var o,f=function(X,H,G){return G},l=function(X,H,G){return G},u=null,v=typeof i;if(v==="number")f=function(){return i};else if(Array.isArray(i))l=function(){return i[0]},f=function(){return i[i.length-1]};else if(v==="string"){var m=i.toLowerCase(),x=m.substring(0,6)==="random",g=m.substring(0,3)==="int";if(x||g){var y=m.indexOf("("),T=m.indexOf(")"),E=m.indexOf(",");if(y&&T&&E){var P=parseFloat(m.substring(y+1,E)),R=parseFloat(m.substring(E+1,T));x?f=function(){return c(P,R)}:f=function(){return d(P,R)}}else throw new Error("invalid random() format")}else{m=m[0];var M=parseFloat(i.substr(2));switch(m){case"+":f=function(X,H,G){return G+M};break;case"-":f=function(X,H,G){return G-M};break;case"*":f=function(X,H,G){return G*M};break;case"/":f=function(X,H,G){return G/M};break;default:f=function(){return parseFloat(i)}}}}else if(v==="function")f=i;else if(v==="object")if(e(i))a(i)&&(u=i.getActive),n(i)&&(f=i.getEnd),r(i)&&(l=i.getStart);else if(i.hasOwnProperty("value"))o=s(h,i.value);else{var L=i.hasOwnProperty("to"),O=i.hasOwnProperty("from"),D=i.hasOwnProperty("start");if(L&&(O||D)){if(o=s(h,i.to),D){var I=s(h,i.start);o.getActive=I.getEnd}if(O){var V=s(h,i.from);o.getStart=V.getEnd}}}return o||(o={getActive:u,getEnd:f,getStart:l}),o};p.exports=s},88032:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70402),c=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(55292),s=t(35154),h=t(17777),i=t(269),o=t(86081),f=function(l,u,v){if(u instanceof o)return u.parent=l,u;v===void 0?v=c:v=i(c,v);var m=s(u,"from",0),x=s(u,"to",1),g=[{value:m}],y=s(u,"delay",v.delay),T=s(u,"easeParams",v.easeParams),E=s(u,"ease",v.ease),P=h("value",x),R=new o(l,g),M=R.add(0,"value",P.getEnd,P.getStart,P.getActive,n(s(u,"ease",E),s(u,"easeParams",T)),e(u,"delay",y),s(u,"duration",v.duration),r(u,"yoyo",v.yoyo),s(u,"hold",v.hold),s(u,"repeat",v.repeat),s(u,"repeatDelay",v.repeatDelay),!1,!1);M.start=m,M.current=m,R.completeDelay=a(u,"completeDelay",0),R.loop=Math.round(a(u,"loop",0)),R.loopDelay=Math.round(a(u,"loopDelay",0)),R.paused=r(u,"paused",!1),R.persist=r(u,"persist",!1),R.callbackScope=s(u,"callbackScope",R);for(var L=d.TYPES,O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(6113),c=t(35154),a=t(36383),r=function(n,e){e===void 0&&(e={});var s,h=c(e,"start",0),i=c(e,"ease",null),o=c(e,"grid",null),f=c(e,"from",0),l=f==="first",u=f==="center",v=f==="last",m=typeof f=="number",x=Array.isArray(n),g=parseFloat(x?n[0]:n),y=x?parseFloat(n[1]):0,T=Math.max(g,y);if(x&&(h+=g),o){var E=o[0],P=o[1],R=0,M=0,L=0,O=0,D=[];v?(R=E-1,M=P-1):m?(R=f%E,M=Math.floor(f/E)):u&&(R=(E-1)/2,M=(P-1)/2);for(var I=a.MIN_SAFE_INTEGER,V=0;VI&&(I=H),D[V][X]=H}}}var G=i?d(i):null;return o?s=function(U,F,B,N){var z=0,Y=N%E,K=Math.floor(N/E);Y>=0&&Y=0&&K{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70402),c=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(91389),s=t(55292),h=t(82985),i=t(62329),o=t(35154),f=t(17777),l=t(269),u=t(86081),v=function(m,x,g){if(x instanceof u)return x.parent=m,x;g===void 0?g=c:g=l(c,g);var y=i(x);!y&&g.targets&&(y=g.targets);for(var T=h(x),E=o(x,"delay",g.delay),P=o(x,"duration",g.duration),R=o(x,"easeParams",g.easeParams),M=o(x,"ease",g.ease),L=o(x,"hold",g.hold),O=o(x,"repeat",g.repeat),D=o(x,"repeatDelay",g.repeatDelay),I=r(x,"yoyo",g.yoyo),V=r(x,"flipX",g.flipX),X=r(x,"flipY",g.flipY),H=o(x,"interpolation",g.interpolation),G=function(j,k,_,q){if(_==="texture"){var et=q,nt=void 0;Array.isArray(q)?(et=q[0],nt=q[1]):q.hasOwnProperty("value")?(et=q.value,Array.isArray(q.value)?(et=q.value[0],nt=q.value[1]):typeof q.value=="string"&&(et=q.value)):typeof q=="string"&&(et=q),j.addFrame(k,et,nt,s(q,"delay",E),o(q,"duration",P),o(q,"hold",L),o(q,"repeat",O),o(q,"repeatDelay",D),r(q,"flipX",V),r(q,"flipY",X))}else{var at=f(_,q),rt=e(o(q,"interpolation",H));j.add(k,_,at.getEnd,at.getStart,at.getActive,n(o(q,"ease",M),o(q,"easeParams",R)),s(q,"delay",E),o(q,"duration",P),r(q,"yoyo",I),o(q,"hold",L),o(q,"repeat",O),o(q,"repeatDelay",D),r(q,"flipX",V),r(q,"flipY",X),rt,rt?q:null)}},U=new u(m,y),F=0;F{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70402),c=t(23568),a=t(57355),r=t(62329),n=t(35154),e=t(8357),s=t(43960),h=function(i,o){if(o instanceof s)return o.parent=i,o;var f=new s(i);f.startDelay=n(o,"delay",0),f.completeDelay=c(o,"completeDelay",0),f.loop=Math.round(c(o,"loop",n(o,"repeat",0))),f.loopDelay=Math.round(c(o,"loopDelay",n(o,"repeatDelay",0))),f.paused=a(o,"paused",!1),f.persist=a(o,"persist",!1),f.callbackScope=n(o,"callbackScope",f);var l,u=d.TYPES;for(l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={GetBoolean:t(57355),GetEaseFunction:t(6113),GetInterpolationFunction:t(91389),GetNewValue:t(55292),GetProps:t(82985),GetTargets:t(62329),GetValueOp:t(17777),NumberTweenBuilder:t(88032),StaggerBuilder:t(93109),TweenBuilder:t(8357)}},73685:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="active"},98540:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="complete"},67233:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="loop"},2859:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="pause"},98336:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="repeat"},25764:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="resume"},32193:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="start"},84371:p=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="stop"},70766:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="update"},55659:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports="yoyo"},842:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={TWEEN_ACTIVE:t(73685),TWEEN_COMPLETE:t(98540),TWEEN_LOOP:t(67233),TWEEN_PAUSE:t(2859),TWEEN_RESUME:t(25764),TWEEN_REPEAT:t(98336),TWEEN_START:t(32193),TWEEN_STOP:t(84371),TWEEN_UPDATE:t(70766),TWEEN_YOYO:t(55659)}},43066:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d={States:t(86353),Builders:t(30231),Events:t(842),TweenManager:t(40382),Tween:t(86081),TweenData:t(48177),TweenFrameData:t(42220),BaseTween:t(70402),TweenChain:t(43960)};p.exports=d},70402:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(50792),a=t(842),r=t(86353),n=new d({Extends:c,initialize:function(s){c.call(this),this.parent=s,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=r.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(e){return this.timeScale=e,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(a.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(a.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(a.TWEEN_COMPLETE,"onComplete")},complete:function(e){return e===void 0&&(e=0),e?(this.setCompleteDelayState(),this.countdown=e):this.onCompleteHandler(),this},completeAfterLoop:function(e){return e===void 0&&(e=0),this.loopCounter>e&&(this.loopCounter=e),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(a.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(a.TWEEN_START,"onStart"),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,s,h){return h===void 0&&(h=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:s,params:h}),this},setPendingState:function(){this.state=r.PENDING},setActiveState:function(){this.state=r.ACTIVE},setLoopDelayState:function(){this.state=r.LOOP_DELAY},setCompleteDelayState:function(){this.state=r.COMPLETE_DELAY},setStartDelayState:function(){this.state=r.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=r.PENDING_REMOVE},setRemovedState:function(){this.state=r.REMOVED},setFinishedState:function(){this.state=r.FINISHED},setDestroyedState:function(){this.state=r.DESTROYED},isPending:function(){return this.state===r.PENDING},isActive:function(){return this.state===r.ACTIVE},isLoopDelayed:function(){return this.state===r.LOOP_DELAY},isCompleteDelayed:function(){return this.state===r.COMPLETE_DELAY},isStartDelayed:function(){return this.state===r.START_DELAY},isPendingRemove:function(){return this.state===r.PENDING_REMOVE},isRemoved:function(){return this.state===r.REMOVED},isFinished:function(){return this.state===r.FINISHED},isDestroyed:function(){return this.state===r.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(e){e.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});n.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],p.exports=n},95042:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(83419),c=t(842),a=t(86353),r=new d({initialize:function(e,s,h,i,o,f,l,u,v,m){this.tween=e,this.targetIndex=s,this.duration=i,this.totalDuration=0,this.delay=0,this.getDelay=h,this.yoyo=o,this.hold=f,this.repeat=l,this.repeatDelay=u,this.repeatCounter=0,this.flipX=v,this.flipY=m,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(n){n===void 0&&(n=this.current),this.tween.targets[this.targetIndex][this.key]=n},setCreatedState:function(){this.state=a.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=a.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=a.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=a.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=a.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=a.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=a.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=a.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===a.CREATED},isDelayed:function(){return this.state===a.DELAY},isPendingRender:function(){return this.state===a.PENDING_RENDER},isPlayingForward:function(){return this.state===a.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===a.PLAYING_BACKWARD},isHolding:function(){return this.state===a.HOLD_DELAY},isRepeating:function(){return this.state===a.REPEAT_DELAY},isComplete:function(){return this.state===a.COMPLETE},setStateFromEnd:function(n){this.yoyo?this.onRepeat(n,!0,!0):this.repeatCounter>0?this.onRepeat(n,!0,!1):this.setCompleteState()},setStateFromStart:function(n){this.repeatCounter>0?this.onRepeat(n,!1):this.setCompleteState()},reset:function(){var n=this.tween,e=n.totalTargets,s=this.targetIndex,h=n.targets[s],i=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(h,i,0,s,e,n),this.repeatCounter=this.repeat===-1?a.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var f=o+this.repeatDelay;this.totalDuration=this.delay+o,this.repeat===-1?(this.totalDuration+=f*a.MAX,n.isInfinite=!0):this.repeat>0&&(this.totalDuration+=f*this.repeat),this.totalDuration>n.duration&&(n.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(n,e,s){var h=this.tween,i=h.totalTargets,o=this.targetIndex,f=h.targets[o],l=this.key,u=l!=="texture";if(this.elapsed=n,this.progress=n/this.duration,this.flipX&&f.toggleFlipX(),this.flipY&&f.toggleFlipY(),u&&(e||s)&&(this.start=this.getStartValue(f,l,this.start,o,i,h)),s){this.setPlayingBackwardState(),this.dispatchEvent(c.TWEEN_YOYO,"onYoyo");return}this.repeatCounter--,u&&(this.end=this.getEndValue(f,l,this.start,o,i,h)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-n,u&&(this.current=this.start,f[l]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(c.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});p.exports=r},69902:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null};p.exports=C},81076:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},86081:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(70402),c=t(83419),a=t(842),r=t(44603),n=t(39429),e=t(36383),s=t(86353),h=t(48177),i=t(42220),o=new c({Extends:d,initialize:function(l,u){d.call(this,l),this.targets=u,this.totalTargets=u.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0},add:function(f,l,u,v,m,x,g,y,T,E,P,R,M,L,O,D){var I=new h(this,f,l,u,v,m,x,g,y,T,E,P,R,M,L,O,D);return this.totalData=this.data.push(I),I},addFrame:function(f,l,u,v,m,x,g,y,T,E){var P=new i(this,f,l,u,v,m,x,g,y,T,E);return this.totalData=this.data.push(P),P},getValue:function(f){f===void 0&&(f=0);var l=null;return this.data&&(l=this.data[f].current),l},hasTarget:function(f){return this.targets&&this.targets.indexOf(f)!==-1},updateTo:function(f,l,u){if(u===void 0&&(u=!1),f!=="texture")for(var v=0;v0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,d.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(f,l,u){if(f===void 0&&(f=0),l===void 0&&(l=16.6),u===void 0&&(u=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;u||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive");var v=this.paused;if(this.paused=!1,f>0){for(var m=Math.floor(f/l),x=f-m*l,g=0;g0&&this.update(x)}return this.paused=v,this.isSeeking=!1,this},initTweenData:function(f){f===void 0&&(f=!1),this.duration=0,this.startDelay=e.MAX_SAFE_INTEGER;for(var l=this.data,u=0;u0?this.totalDuration=v+m+(v+g)*x:this.totalDuration=v+m},reset:function(f){return f===void 0&&(f=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=s.MAX),f||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive")),this},update:function(f){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(f*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(f),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(f),!1;this.hasStarted||(this.startDelay-=f,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,"onStart"),f=0));var l=!1;if(this.isActive())for(var u=this.data,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(72905),c=t(70402),a=t(83419),r=t(842),n=t(44603),e=t(39429),s=t(86353),h=new a({Extends:c,initialize:function(o){c.call(this,o),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?s.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"),this},add:function(i){var o=this.parent.create(i);Array.isArray(o)||(o=[o]);for(var f=this.data,l=0;l0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var i=this.data,o=this.totalData,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95042),c=t(45319),a=t(83419),r=t(842),n=new a({Extends:d,initialize:function(s,h,i,o,f,l,u,v,m,x,g,y,T,E,P,R,M){d.call(this,s,h,v,m,x,g,y,T,E,P),this.key=i,this.getActiveValue=l,this.getEndValue=o,this.getStartValue=f,this.ease=u,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=R,this.interpolationData=M},reset:function(e){d.prototype.reset.call(this);var s=this.tween.targets[this.targetIndex],h=this.key;e&&(s[h]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(s[h]=this.getActiveValue(s,h,0))},update:function(e){var s=this.tween,h=s.totalTargets,i=this.targetIndex,o=s.targets[i],f=this.key;if(!o)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(o,f,o[f],i,h,s),this.end=this.getEndValue(o,f,this.start,i,h,s),this.current=this.start,o[f]=this.start,this.setPlayingForwardState(),!0;var l=this.isPlayingForward(),u=this.isPlayingBackward();if(l||u){var v=this.elapsed,m=this.duration,x=0,g=!1;v+=e,v>=m?(x=v-m,v=m,g=!0):v<0&&(v=0);var y=c(v/m,0,1);if(this.elapsed=v,this.progress=y,this.previous=this.current,g)l?(this.current=this.end,o[f]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(x)):(this.current=this.start,o[f]=this.start,this.setStateFromStart(x));else{l||(y=1-y);var T=this.ease(y);this.interpolation?this.current=this.interpolation(this.interpolationData,T):this.current=this.start+(this.end-this.start)*T,o[f]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,s){var h=this.tween;if(!h.isSeeking){var i=h.targets[this.targetIndex],o=this.key,f=this.current,l=this.previous;h.emit(e,h,o,i,f,l);var u=h.callbacks[s];u&&u.func.apply(h.callbackScope,[h,i,o,f,l].concat(u.params))}},destroy:function(){d.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});p.exports=n},42220:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(95042),c=t(45319),a=t(83419),r=t(842),n=new a({Extends:d,initialize:function(s,h,i,o,f,l,u,v,m,x,g){d.call(this,s,h,f,l,!1,u,v,m,x,g),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=o,this.yoyo=v!==0},reset:function(e){d.prototype.reset.call(this);var s=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=s.texture.key,this.startFrame=s.frame.name),e&&s.setTexture(this.startTexture,this.startFrame)},update:function(e){var s=this.tween,h=this.targetIndex,i=s.targets[h];if(!i)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&i.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var o=this.isPlayingForward(),f=this.isPlayingBackward();if(o||f){var l=this.elapsed,u=this.duration,v=0,m=!1;l+=e,l>=u?(v=l-u,l=u,m=!0):l<0&&(l=0);var x=c(l/u,0,1);this.elapsed=l,this.progress=x,m&&(o?(i.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(v)):(i.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(v))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,s){var h=this.tween;if(!h.isSeeking){var i=h.targets[this.targetIndex],o=this.key;h.emit(e,h,o,i);var f=h.callbacks[s];f&&f.func.apply(h.callbackScope,[h,i,o].concat(f.params))}},destroy:function(){d.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});p.exports=n},86353:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999};p.exports=C},83419:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(n){return!!n.get&&typeof n.get=="function"||!!n.set&&typeof n.set=="function"}function t(n,e,s){var h=s?n[e]:Object.getOwnPropertyDescriptor(n,e);return!s&&h.value&&typeof h.value=="object"&&(h=h.value),h&&C(h)?(typeof h.enumerable>"u"&&(h.enumerable=!0),typeof h.configurable>"u"&&(h.configurable=!0),h):!1}function d(n,e){var s=Object.getOwnPropertyDescriptor(n,e);return s?(s.value&&typeof s.value=="object"&&(s=s.value),s.configurable===!1):!1}function c(n,e,s,h){for(var i in e)if(e.hasOwnProperty(i)){var o=t(e,i,s);if(o!==!1){var f=h||n;if(d(f.prototype,i)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+i+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(n.prototype,i,o)}else n.prototype[i]=e[i]}}function a(n,e){if(e){Array.isArray(e)||(e=[e]);for(var s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){};p.exports=C},20242:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){return null};p.exports=C},71146:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r){if(r===void 0&&(r=t),c>0){var n=c-t.length;if(n<=0)return null}if(!Array.isArray(d))return t.indexOf(d)===-1?(t.push(d),a&&a.call(r,d),d):null;for(var e=d.length-1;e>=0;)t.indexOf(d[e])!==-1&&d.splice(e,1),e--;if(e=d.length,e===0)return null;c>0&&e>n&&(d.splice(n),e=n);for(var s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a,r,n){if(c===void 0&&(c=0),n===void 0&&(n=t),a>0){var e=a-t.length;if(e<=0)return null}if(!Array.isArray(d))return t.indexOf(d)===-1?(t.splice(c,0,d),r&&r.call(n,d),d):null;for(var s=d.length-1;s>=0;)t.indexOf(d[s])!==-1&&d.pop(),s--;if(s=d.length,s===0)return null;a>0&&s>e&&(d.splice(e),s=e);for(var h=s-1;h>=0;h--){var i=d[h];t.splice(c,0,i),r&&r.call(n,i)}return d};p.exports=C},66905:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.indexOf(d);return c!==-1&&c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){e===void 0&&(e=0),s===void 0&&(s=a.length);var h=0;if(d(a,e,s))for(var i=e;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a,r=[null];for(a=3;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){if(e===void 0&&(e=0),s===void 0&&(s=a.length),d(a,e,s)){var h,i=[null];for(h=5;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d.length){if(d.length===1)return d[0]}else return NaN;var a=1,r,n;if(c){if(td.length&&(a=d.length),c?(r=d[a-1][c],n=d[a][c],n-t<=t-r?d[a]:d[a-1]):(r=d[a-1],n=d[a],n-t<=t-r?n:r)};p.exports=C},43491:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=[]);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){e===void 0&&(e=0),s===void 0&&(s=a.length);var h=[];if(d(a,e,s))for(var i=e;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){if(e===void 0&&(e=0),s===void 0&&(s=a.length),d(a,e,s))for(var h=e;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){d===void 0&&(d=0),c===void 0&&(c=t.length);var a=d+Math.floor(Math.random()*c);return t[a]===void 0?null:t[a]};p.exports=C},85835:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===c)return t;var a=t.indexOf(d),r=t.indexOf(c);if(a<0||r<0)throw new Error("Supplied items must be elements of the same array");return a>r||(t.splice(a,1),r===t.length-1?t.push(d):t.splice(r,0,d)),t};p.exports=C},83371:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===c)return t;var a=t.indexOf(d),r=t.indexOf(c);if(a<0||r<0)throw new Error("Supplied items must be elements of the same array");return a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.indexOf(d);if(c>0){var a=t[c-1],r=t.indexOf(a);t[c]=a,t[r]=d}return t};p.exports=C},69693:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=t.indexOf(d);if(a===-1||c<0||c>=t.length)throw new Error("Supplied index out of bounds");return a!==c&&(t.splice(a,1),t.splice(c,0,d)),d};p.exports=C},40853:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.indexOf(d);if(c!==-1&&c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=[],n,e=!1;if((c||a)&&(e=!0,c||(c=""),a||(a="")),d=d;n--)e?r.push(c+n.toString()+a):r.push(n);else for(n=t;n<=d;n++)e?r.push(c+n.toString()+a):r.push(n);return r};p.exports=C},593:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(2284),c=function(a,r,n){a===void 0&&(a=0),r===void 0&&(r=null),n===void 0&&(n=1),r===null&&(r=a,a=0);for(var e=[],s=Math.max(d((r-a)/(n||1)),0),h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function C(c,a,r){var n=c[a];c[a]=c[r],c[r]=n}function t(c,a){return ca?1:0}var d=function(c,a,r,n,e){for(r===void 0&&(r=0),n===void 0&&(n=c.length-1),e===void 0&&(e=t);n>r;){if(n-r>600){var s=n-r+1,h=a-r+1,i=Math.log(s),o=.5*Math.exp(2*i/3),f=.5*Math.sqrt(i*o*(s-o)/s)*(h-s/2<0?-1:1),l=Math.max(r,Math.floor(a-h*o/s+f)),u=Math.min(n,Math.floor(a+(s-h)*o/s+f));d(c,a,l,u,e)}var v=c[a],m=r,x=n;for(C(c,r,a),e(c[n],v)>0&&C(c,r,n);m0;)x--}e(c[r],v)===0?C(c,r,x):(x++,C(c,x,n)),x<=a&&(r=x+1),a<=x&&(n=x-1)}};p.exports=d},88492:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35154),c=t(33680),a=function(n,e,s){for(var h=[],i=0;i{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19133),c=function(a,r,n,e){e===void 0&&(e=a);var s;if(!Array.isArray(r))return s=a.indexOf(r),s!==-1?(d(a,s),n&&n.call(e,r),r):null;for(var h=r.length-1,i=[];h>=0;){var o=r[h];s=a.indexOf(o),s!==-1&&(d(a,s),i.push(o),n&&n.call(e,o)),h--}return i};p.exports=c},60248:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19133),c=function(a,r,n,e){if(e===void 0&&(e=a),r<0||r>a.length-1)throw new Error("Index out of bounds");var s=d(a,r);return n&&n.call(e,s),s};p.exports=c},81409:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){if(r===void 0&&(r=0),n===void 0&&(n=a.length),s===void 0&&(s=a),d(a,r,n)){var h=n-r,i=a.splice(r,h);if(e)for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(19133),c=function(a,r,n){r===void 0&&(r=0),n===void 0&&(n=a.length);var e=r+Math.floor(Math.random()*n);return d(a,e)};p.exports=c},42169:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=t.indexOf(d),r=t.indexOf(c);return a!==-1&&r===-1?(t[a]=c,!0):!1};p.exports=C},86003:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=1);for(var c=null,a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){d===void 0&&(d=1);for(var c=null,a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){var r=t.length;if(d<0||d>r||d>=c||c>r){if(a)throw new Error("Range Error: Values outside acceptable range");return!1}else return!0};p.exports=C},89545:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){var c=t.indexOf(d);return c!==-1&&c>0&&(t.splice(c,1),t.unshift(d)),d};p.exports=C},17810:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82011),c=function(a,r,n,e,s){if(e===void 0&&(e=0),s===void 0&&(s=a.length),d(a,e,s))for(var h=e;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=t.length-1;d>0;d--){var c=Math.floor(Math.random()*(d+1)),a=t[d];t[d]=t[c],t[c]=a}return t};p.exports=C},90126:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d=/\D/g;return t.sort(function(c,a){return parseInt(c.replace(d,""),10)-parseInt(a.replace(d,""),10)}),t};p.exports=C},19133:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){if(!(d>=t.length)){for(var c=t.length-1,a=t[d],r=d;r{/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(82264);function c(e,s){return String(e).localeCompare(s)}function a(e,s){var h=e.length;if(h<=1)return e;for(var i=new Array(h),o=1;oo&&(v=o),m>o&&(m=o),x=u,g=v;;)if(x{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(d===c)return t;var a=t.indexOf(d),r=t.indexOf(c);if(a<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[a]=c,t[r]=d,t};p.exports=C},37105:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Matrix:t(54915),Add:t(71146),AddAt:t(51067),BringToTop:t(66905),CountAllMatching:t(21612),Each:t(95428),EachInRange:t(36914),FindClosestInSorted:t(81957),Flatten:t(43491),GetAll:t(46710),GetFirst:t(58731),GetRandom:t(26546),MoveDown:t(70864),MoveTo:t(69693),MoveUp:t(40853),MoveAbove:t(85835),MoveBelow:t(83371),NumberArray:t(20283),NumberArrayStep:t(593),QuickSelect:t(43886),Range:t(88492),Remove:t(72905),RemoveAt:t(60248),RemoveBetween:t(81409),RemoveRandomElement:t(31856),Replace:t(42169),RotateLeft:t(86003),RotateRight:t(49498),SafeRange:t(82011),SendToBack:t(89545),SetAll:t(17810),Shuffle:t(33680),SortByDigits:t(90126),SpliceOne:t(19133),StableSort:t(19186),Swap:t(25630)}},86922:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var d=t[0].length,c=1;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41836),c=t(86922),a=function(r){var n="";if(!c(r))return n;for(var e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.reverse()};p.exports=C},21224:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37829),c=function(a){return d(a,180)};p.exports=c},44657:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37829),c=function(a,r){r===void 0&&(r=1);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(86922),c=t(2429),a=function(r,n){if(n===void 0&&(n=90),!d(r))return null;if(typeof n!="string"&&(n=(n%360+360)%360),n===90||n===-270||n==="rotateLeft")r=c(r),r.reverse();else if(n===-90||n===270||n==="rotateRight")r.reverse(),r=c(r);else if(Math.abs(n)===180||n==="rotate180"){for(var e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(37829),c=function(a,r){r===void 0&&(r=1);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(86003),c=t(49498),a=function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),e!==0&&(e<0?d(r,Math.abs(e)):c(r,e)),n!==0)for(var s=0;s{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){for(var d=t.length,c=t[0].length,a=new Array(c),r=0;r-1;n--)a[r][n]=t[n][r]}return a};p.exports=C},54915:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={CheckMatrix:t(86922),MatrixToString:t(63362),ReverseColumns:t(92598),ReverseRows:t(21224),Rotate180:t(98717),RotateLeft:t(44657),RotateMatrix:t(37829),RotateRight:t(92632),Translate:t(69512),TransposeMatrix:t(2429)}},71334:p=>{/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=function(d,c){for(var a=new Uint8Array(d),r=a.length,n=c?"data:"+c+";base64,":"",e=0;e>2],n+=C[(a[e]&3)<<4|a[e+1]>>4],n+=C[(a[e+1]&15)<<2|a[e+2]>>6],n+=C[a[e+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n};p.exports=t},53134:p=>{/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */for(var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),d=0;d>4,l[e++]=(h&15)<<4|i>>2,l[e++]=(i&3)<<6|o&63;return f};p.exports=c},65839:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={ArrayBufferToBase64:t(71334),Base64ToArrayBuffer:t(53134)}},91799:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Array:t(37105),Base64:t(65839),Objects:t(1183),String:t(31749),NOOP:t(29747),NULL:t(20242)}},41786:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d={};for(var c in t)Array.isArray(t[c])?d[c]=t[c].slice(0):d[c]=t[c];return d};p.exports=C},62644:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){var d,c,a;if(typeof t!="object"||t===null)return t;d=Array.isArray(t)?[]:{};for(a in t)c=t[a],d[a]=C(c);return d};p.exports=C},79291:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41212),c=function(){var a,r,n,e,s,h,i=arguments[0]||{},o=1,f=arguments.length,l=!1;for(typeof i=="boolean"&&(l=i,i=arguments[1]||{},o=2),f===o&&(i=this,--o);o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(75508),c=t(35154),a=function(r,n,e){var s=c(r,n,null);if(s===null)return e;if(Array.isArray(s))return d.RND.pick(s);if(typeof s=="object"){if(s.hasOwnProperty("randInt"))return d.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return d.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if(typeof s=="function")return s(n);return s};p.exports=a},95540:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){var a=typeof t;return!t||a==="number"||a==="string"?c:t.hasOwnProperty(d)&&t[d]!==void 0?t[d]:c};p.exports=C},82840:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(35154),c=t(45319),a=function(r,n,e,s,h){h===void 0&&(h=e);var i=d(r,n,h);return c(i,e,s)};p.exports=a},35154:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){if(!t&&!a||typeof t=="number")return c;if(t&&t.hasOwnProperty(d))return t[d];if(a&&a.hasOwnProperty(d))return a[d];if(d.indexOf(".")!==-1){for(var r=d.split("."),n=t,e=a,s=c,h=c,i=!0,o=!0,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.hasOwnProperty(d)};p.exports=C},41212:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){if(!t||typeof t!="object"||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}return!0};p.exports=C},46975:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41786),c=function(a,r){var n=d(a);for(var e in r)n.hasOwnProperty(e)||(n[e]=r[e]);return n};p.exports=c},269:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(41786),c=function(a,r){var n=d(a);for(var e in r)n.hasOwnProperty(e)&&(n[e]=r[e]);return n};p.exports=c},18254:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var d=t(97022),c=function(a,r){for(var n={},e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c){if(!t||typeof t=="number")return!1;if(t.hasOwnProperty(d))return t[d]=c,!0;if(d.indexOf(".")!==-1){for(var a=d.split("."),r=t,n=t,e=0;e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Clone:t(41786),DeepCopy:t(62644),Extend:t(79291),GetAdvancedValue:t(23568),GetFastValue:t(95540),GetMinMaxValue:t(82840),GetValue:t(35154),HasAll:t(69036),HasAny:t(1985),HasValue:t(97022),IsPlainObject:t(41212),Merge:t(46975),MergeRight:t(269),Pick:t(18254),SetValue:t(61622)}},27902:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return t.replace(/%([0-9]+)/g,function(c,a){return d[Number(a)-1]})};p.exports=C},41836:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d,c,a){d===void 0&&(d=0),c===void 0&&(c=" "),a===void 0&&(a=3),t=t.toString();var r=0;if(d+1>=t.length)switch(a){case 1:t=new Array(d+1-t.length).join(c)+t;break;case 3:var n=Math.ceil((r=d-t.length)/2),e=r-n;t=new Array(e+1).join(c)+t+new Array(n+1).join(c);break;default:t=t+new Array(d+1-t.length).join(c);break}return t};p.exports=C},33628:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t,d){return d===0?t.slice(1):t.slice(0,d-1)+t.slice(d)};p.exports=C},27671:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t.split("").reverse().join("")};p.exports=C},45650:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var d=Math.random()*16|0,c=t==="x"?d:d&3|8;return c.toString(16)})};p.exports=C},35355:p=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var C=function(t){return t&&t[0].toUpperCase()+t.slice(1)};p.exports=C},31749:(p,C,t)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */p.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},b={};function W(p){var C=b[p];if(C!==void 0)return C.exports;var t=b[p]={exports:{}};return A[p](t,t.exports,W),t.exports}W.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var J=W(85454);return J})())})(As);var Gn=As.exports;const Me=In(Gn);/*! Tweakpane 4.0.3 (c) 2016 cocopon, licensed under the MIT license. */function gt(w){return w==null}function Pi(w){return w!==null&&typeof w=="object"}function di(w){return w!==null&&typeof w=="object"}function Nn(w,S){if(w.length!==S.length)return!1;for(let A=0;A{const J=w[W],p=S[W];return di(J)&&di(p)?Object.assign(Object.assign({},b),{[W]:oe(J,p)}):Object.assign(Object.assign({},b),{[W]:W in S?p:J})},{})}function Ai(w){return Pi(w)?"target"in w:!1}const Vn={alreadydisposed:()=>"View has been already disposed",invalidparams:w=>`Invalid parameters for '${w.name}'`,nomatchingcontroller:w=>`No matching controller for '${w.key}'`,nomatchingview:w=>`No matching view for '${JSON.stringify(w.params)}'`,notbindable:()=>"Value is not bindable",notcompatible:w=>`Not compatible with plugin '${w.id}'`,propertynotfound:w=>`Property '${w.name}' not found`,shouldneverhappen:()=>"This error should never happen"};class Ct{static alreadyDisposed(){return new Ct({type:"alreadydisposed"})}static notBindable(){return new Ct({type:"notbindable"})}static notCompatible(S,A){return new Ct({type:"notcompatible",context:{id:`${S}.${A}`}})}static propertyNotFound(S){return new Ct({type:"propertynotfound",context:{name:S}})}static shouldNeverHappen(){return new Ct({type:"shouldneverhappen"})}constructor(S){var A;this.message=(A=Vn[S.type](S.context))!==null&&A!==void 0?A:"Unexpected error",this.name=this.constructor.name,this.stack=new Error(this.message).stack,this.type=S.type}toString(){return this.message}}class Je{constructor(S,A){this.obj_=S,this.key=A}static isBindable(S){return!(S===null||typeof S!="object"&&typeof S!="function")}read(){return this.obj_[this.key]}write(S){this.obj_[this.key]=S}writeProperty(S,A){const b=this.read();if(!Je.isBindable(b))throw Ct.notBindable();if(!(S in b))throw Ct.propertyNotFound(S);b[S]=A}}class Et{constructor(){this.observers_={}}on(S,A,b){var W;let J=this.observers_[S];return J||(J=this.observers_[S]=[]),J.push({handler:A,key:(W=b==null?void 0:b.key)!==null&&W!==void 0?W:A}),this}off(S,A){const b=this.observers_[S];return b&&(this.observers_[S]=b.filter(W=>W.key!==A)),this}emit(S,A){const b=this.observers_[S];b&&b.forEach(W=>{W.handler(A)})}}class Un{constructor(S,A){var b;this.constraint_=A==null?void 0:A.constraint,this.equals_=(b=A==null?void 0:A.equals)!==null&&b!==void 0?b:(W,J)=>W===J,this.emitter=new Et,this.rawValue_=S}get constraint(){return this.constraint_}get rawValue(){return this.rawValue_}set rawValue(S){this.setRawValue(S,{forceEmit:!1,last:!0})}setRawValue(S,A){const b=A??{forceEmit:!1,last:!0},W=this.constraint_?this.constraint_.constrain(S):S,J=this.rawValue_;this.equals_(J,W)&&!b.forceEmit||(this.emitter.emit("beforechange",{sender:this}),this.rawValue_=W,this.emitter.emit("change",{options:b,previousRawValue:J,rawValue:W,sender:this}))}}class zn{constructor(S){this.emitter=new Et,this.value_=S}get rawValue(){return this.value_}set rawValue(S){this.setRawValue(S,{forceEmit:!1,last:!0})}setRawValue(S,A){const b=A??{forceEmit:!1,last:!0},W=this.value_;W===S&&!b.forceEmit||(this.emitter.emit("beforechange",{sender:this}),this.value_=S,this.emitter.emit("change",{options:b,previousRawValue:W,rawValue:this.value_,sender:this}))}}class Xn{constructor(S){this.emitter=new Et,this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.value_=S,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_)}get rawValue(){return this.value_.rawValue}onValueBeforeChange_(S){this.emitter.emit("beforechange",Object.assign(Object.assign({},S),{sender:this}))}onValueChange_(S){this.emitter.emit("change",Object.assign(Object.assign({},S),{sender:this}))}}function yt(w,S){const A=S==null?void 0:S.constraint,b=S==null?void 0:S.equals;return!A&&!b?new zn(w):new Un(w,S)}function Yn(w){return[new Xn(w),(S,A)=>{w.setRawValue(S,A)}]}class ut{constructor(S){this.emitter=new Et,this.valMap_=S;for(const A in this.valMap_)this.valMap_[A].emitter.on("change",()=>{this.emitter.emit("change",{key:A,sender:this})})}static createCore(S){return Object.keys(S).reduce((b,W)=>Object.assign(b,{[W]:yt(S[W])}),{})}static fromObject(S){const A=this.createCore(S);return new ut(A)}get(S){return this.valMap_[S].rawValue}set(S,A){this.valMap_[S].rawValue=A}value(S){return this.valMap_[S]}}class be{constructor(S){this.values=ut.fromObject({max:S.max,min:S.min})}constrain(S){const A=this.values.get("max"),b=this.values.get("min");return Math.min(Math.max(S,b),A)}}class Wn{constructor(S){this.values=ut.fromObject({max:S.max,min:S.min})}constrain(S){const A=this.values.get("max"),b=this.values.get("min");let W=S;return gt(b)||(W=Math.max(W,b)),gt(A)||(W=Math.min(W,A)),W}}class Hn{constructor(S,A=0){this.step=S,this.origin=A}constrain(S){const A=this.origin%this.step,b=Math.round((S-A)/this.step);return A+b*this.step}}class Kn{constructor(S){this.text=S}evaluate(){return Number(this.text)}toString(){return this.text}}const Zn={"**":(w,S)=>Math.pow(w,S),"*":(w,S)=>w*S,"/":(w,S)=>w/S,"%":(w,S)=>w%S,"+":(w,S)=>w+S,"-":(w,S)=>w-S,"<<":(w,S)=>w<>":(w,S)=>w>>S,">>>":(w,S)=>w>>>S,"&":(w,S)=>w&S,"^":(w,S)=>w^S,"|":(w,S)=>w|S};class Jn{constructor(S,A,b){this.left=A,this.operator=S,this.right=b}evaluate(){const S=Zn[this.operator];if(!S)throw new Error(`unexpected binary operator: '${this.operator}`);return S(this.left.evaluate(),this.right.evaluate())}toString(){return["b(",this.left.toString(),this.operator,this.right.toString(),")"].join(" ")}}const Qn={"+":w=>w,"-":w=>-w,"~":w=>~w};class $n{constructor(S,A){this.operator=S,this.expression=A}evaluate(){const S=Qn[this.operator];if(!S)throw new Error(`unexpected unary operator: '${this.operator}`);return S(this.expression.evaluate())}toString(){return["u(",this.operator,this.expression.toString(),")"].join(" ")}}function Mi(w){return(S,A)=>{for(let b=0;bS.startsWith(W,A))[0];return b?(A+=b.length,A+=we(S,A).length,{cursor:A,operator:b}):null}function cr(w,S){return(A,b)=>{const W=w(A,b);if(!W)return null;b=W.cursor;let J=W.evaluable;for(;;){const p=vr(S,A,b);if(!p)break;b=p.cursor;const C=w(A,b);if(!C)return null;b=C.cursor,J=new Jn(p.operator,J,C.evaluable)}return J?{cursor:b,evaluable:J}:null}}const pr=[["**"],["*","/","%"],["+","-"],["<<",">>>",">>"],["&"],["^"],["|"]].reduce((w,S)=>cr(w,S),ws);function Rs(w,S){return S+=we(w,S).length,pr(w,S)}function mr(w){const S=Rs(w,0);return!S||S.cursor+we(w,S.cursor).length!==w.length?null:S.evaluable}function Ht(w){var S;const A=mr(w);return(S=A==null?void 0:A.evaluate())!==null&&S!==void 0?S:null}function Ls(w){if(typeof w=="number")return w;if(typeof w=="string"){const S=Ht(w);if(!gt(S))return S}return 0}function gr(w){return String(w)}function Ft(w){return S=>S.toFixed(Math.max(Math.min(w,20),0))}function ct(w,S,A,b,W){const J=(w-S)/(A-S);return b+J*(W-b)}function ki(w){return String(w.toFixed(10)).split(".")[1].replace(/0+$/,"").length}function Pt(w,S,A){return Math.min(Math.max(w,S),A)}function Fs(w,S){return(w%S+S)%S}function xr(w,S){return gt(w.step)?Math.max(ki(S),2):ki(w.step)}function Os(w){var S;return(S=w.step)!==null&&S!==void 0?S:1}function Ds(w,S){var A;const b=Math.abs((A=w.step)!==null&&A!==void 0?A:S);return b===0?.1:Math.pow(10,Math.floor(Math.log10(b))-1)}function bs(w,S){return gt(w.step)?null:new Hn(w.step,S)}function Bs(w){return!gt(w.max)&&!gt(w.min)?new be({max:w.max,min:w.min}):!gt(w.max)||!gt(w.min)?new Wn({max:w.max,min:w.min}):null}function Is(w,S){var A,b,W;return{formatter:(A=w.format)!==null&&A!==void 0?A:Ft(xr(w,S)),keyScale:(b=w.keyScale)!==null&&b!==void 0?b:Os(w),pointerScale:(W=w.pointerScale)!==null&&W!==void 0?W:Ds(w,S)}}function Gs(w){return{format:w.optional.function,keyScale:w.optional.number,max:w.optional.number,min:w.optional.number,pointerScale:w.optional.number,step:w.optional.number}}function Ri(w){return{constraint:w.constraint,textProps:ut.fromObject(Is(w.params,w.initialValue))}}class ue{constructor(S){this.controller=S}get element(){return this.controller.view.element}get disabled(){return this.controller.viewProps.get("disabled")}set disabled(S){this.controller.viewProps.set("disabled",S)}get hidden(){return this.controller.viewProps.get("hidden")}set hidden(S){this.controller.viewProps.set("hidden",S)}dispose(){this.controller.viewProps.set("disposed",!0)}importState(S){return this.controller.importState(S)}exportState(){return this.controller.exportState()}}class _e{constructor(S){this.target=S}}class Be extends _e{constructor(S,A,b){super(S),this.value=A,this.last=b??!0}}class yr extends _e{constructor(S,A){super(S),this.expanded=A}}class Tr extends _e{constructor(S,A){super(S),this.index=A}}class Cr extends _e{constructor(S,A){super(S),this.native=A}}class Le extends ue{constructor(S){super(S),this.onValueChange_=this.onValueChange_.bind(this),this.emitter_=new Et,this.controller.value.emitter.on("change",this.onValueChange_)}get label(){return this.controller.labelController.props.get("label")}set label(S){this.controller.labelController.props.set("label",S)}get key(){return this.controller.value.binding.target.key}get tag(){return this.controller.tag}set tag(S){this.controller.tag=S}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}refresh(){this.controller.value.fetch()}onValueChange_(S){const A=this.controller.value;this.emitter_.emit("change",new Be(this,A.binding.target.read(),S.options.last))}}class Sr{constructor(S,A){this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=A,this.value_=S,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.emitter=new Et}get rawValue(){return this.value_.rawValue}set rawValue(S){this.value_.rawValue=S}setRawValue(S,A){this.value_.setRawValue(S,A)}fetch(){this.value_.rawValue=this.binding.read()}push(){this.binding.write(this.value_.rawValue)}onValueBeforeChange_(S){this.emitter.emit("beforechange",Object.assign(Object.assign({},S),{sender:this}))}onValueChange_(S){this.push(),this.emitter.emit("change",Object.assign(Object.assign({},S),{sender:this}))}}function Er(w){if(!("binding"in w))return!1;const S=w.binding;return Ai(S)&&"read"in S&&"write"in S}function Pr(w,S){const b=Object.keys(S).reduce((W,J)=>{if(W===void 0)return;const p=S[J],C=p(w[J]);return C.succeeded?Object.assign(Object.assign({},W),{[J]:C.value}):void 0},{});return b}function Ar(w,S){return w.reduce((A,b)=>{if(A===void 0)return;const W=S(b);if(!(!W.succeeded||W.value===void 0))return[...A,W.value]},[])}function Mr(w){return w===null?!1:typeof w=="object"}function Xt(w){return S=>A=>{if(!S&&A===void 0)return{succeeded:!1,value:void 0};if(S&&A===void 0)return{succeeded:!0,value:void 0};const b=w(A);return b!==void 0?{succeeded:!0,value:b}:{succeeded:!1,value:void 0}}}function qi(w){return{custom:S=>Xt(S)(w),boolean:Xt(S=>typeof S=="boolean"?S:void 0)(w),number:Xt(S=>typeof S=="number"?S:void 0)(w),string:Xt(S=>typeof S=="string"?S:void 0)(w),function:Xt(S=>typeof S=="function"?S:void 0)(w),constant:S=>Xt(A=>A===S?S:void 0)(w),raw:Xt(S=>S)(w),object:S=>Xt(A=>{if(Mr(A))return Pr(A,S)})(w),array:S=>Xt(A=>{if(Array.isArray(A))return Ar(A,S)})(w)}}const vi={optional:qi(!0),required:qi(!1)};function Tt(w,S){const A=S(vi),b=vi.required.object(A)(w);return b.succeeded?b.value:void 0}function Dt(w,S,A,b){if(S&&!S(w))return!1;const W=Tt(w,A);return W?b(W):!1}function bt(w,S){var A;return oe((A=w==null?void 0:w())!==null&&A!==void 0?A:{},S)}function ae(w){return"value"in w}function Ns(w){if(!Pi(w)||!("binding"in w))return!1;const S=w.binding;return Ai(S)}const Nt="http://www.w3.org/2000/svg";function Qe(w){w.offsetHeight}function wr(w,S){const A=w.style.transition;w.style.transition="none",S(),w.style.transition=A}function Li(w){return w.ontouchstart!==void 0}function Rr(){return globalThis}function Lr(){return Rr().document}function Fr(w){const S=w.ownerDocument.defaultView;return S&&"document"in S?w.getContext("2d",{willReadFrequently:!0}):null}const Or={check:'',dropdown:'',p2dpad:''};function ti(w,S){const A=w.createElementNS(Nt,"svg");return A.innerHTML=Or[S],A}function Vs(w,S,A){w.insertBefore(S,w.children[A])}function Fi(w){w.parentElement&&w.parentElement.removeChild(w)}function Us(w){for(;w.children.length>0;)w.removeChild(w.children[0])}function Dr(w){for(;w.childNodes.length>0;)w.removeChild(w.childNodes[0])}function zs(w){return w.relatedTarget?w.relatedTarget:"explicitOriginalTarget"in w?w.explicitOriginalTarget:null}function Wt(w,S){w.emitter.on("change",A=>{S(A.rawValue)}),S(w.rawValue)}function Vt(w,S,A){Wt(w.value(S),A)}const br="tp";function dt(w){return(A,b)=>[br,"-",w,"v",A?`_${A}`:"",b?`-${b}`:""].join("")}const Se=dt("lbl");function Br(w,S){const A=w.createDocumentFragment();return S.split(` +`).map(W=>w.createTextNode(W)).forEach((W,J)=>{J>0&&A.appendChild(w.createElement("br")),A.appendChild(W)}),A}class Xs{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(Se()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(Se("l")),Vt(A.props,"label",J=>{gt(J)?this.element.classList.add(Se(void 0,"nol")):(this.element.classList.remove(Se(void 0,"nol")),Dr(b),b.appendChild(Br(S,J)))}),this.element.appendChild(b),this.labelElement=b;const W=S.createElement("div");W.classList.add(Se("v")),this.element.appendChild(W),this.valueElement=W}}class Ys{constructor(S,A){this.props=A.props,this.valueController=A.valueController,this.viewProps=A.valueController.viewProps,this.view=new Xs(S,{props:A.props,viewProps:this.viewProps}),this.view.valueElement.appendChild(this.valueController.view.element)}importProps(S){return Dt(S,null,A=>({label:A.optional.string}),A=>(this.props.set("label",A.label),!0))}exportProps(){return bt(null,{label:this.props.get("label")})}}function Ir(){return["veryfirst","first","last","verylast"]}const _i=dt(""),ts={veryfirst:"vfst",first:"fst",last:"lst",verylast:"vlst"};class ei{constructor(S){this.parent_=null,this.blade=S.blade,this.view=S.view,this.viewProps=S.viewProps;const A=this.view.element;this.blade.value("positions").emitter.on("change",()=>{Ir().forEach(b=>{A.classList.remove(_i(void 0,ts[b]))}),this.blade.get("positions").forEach(b=>{A.classList.add(_i(void 0,ts[b]))})}),this.viewProps.handleDispose(()=>{Fi(A)})}get parent(){return this.parent_}set parent(S){this.parent_=S,this.viewProps.set("parent",this.parent_?this.parent_.viewProps:null)}importState(S){return Dt(S,null,A=>({disabled:A.required.boolean,hidden:A.required.boolean}),A=>(this.viewProps.importState(A),!0))}exportState(){return bt(null,Object.assign({},this.viewProps.exportState()))}}class he extends ei{constructor(S,A){if(A.value!==A.valueController.value)throw Ct.shouldNeverHappen();const b=A.valueController.viewProps,W=new Ys(S,{blade:A.blade,props:A.props,valueController:A.valueController});super(Object.assign(Object.assign({},A),{view:new Xs(S,{props:A.props,viewProps:b}),viewProps:b})),this.labelController=W,this.value=A.value,this.valueController=A.valueController,this.view.valueElement.appendChild(this.valueController.view.element)}importState(S){return Dt(S,A=>{var b,W,J;return super.importState(A)&&this.labelController.importProps(A)&&((J=(W=(b=this.valueController).importProps)===null||W===void 0?void 0:W.call(b,S))!==null&&J!==void 0?J:!0)},A=>({value:A.optional.raw}),A=>(A.value&&(this.value.rawValue=A.value),!0))}exportState(){var S,A,b;return bt(()=>super.exportState(),Object.assign(Object.assign({value:this.value.rawValue},this.labelController.exportProps()),(b=(A=(S=this.valueController).exportProps)===null||A===void 0?void 0:A.call(S))!==null&&b!==void 0?b:{}))}}function es(w){const S=Object.assign({},w);return delete S.value,S}class Ws extends he{constructor(S,A){super(S,A),this.tag=A.tag}importState(S){return Dt(S,A=>super.importState(es(S)),A=>({tag:A.optional.string}),A=>(this.tag=A.tag,!0))}exportState(){return bt(()=>es(super.exportState()),{binding:{key:this.value.binding.target.key,value:this.value.binding.target.read()},tag:this.tag})}}function Gr(w){return ae(w)&&Ns(w.value)}class Nr extends Ws{importState(S){return Dt(S,A=>super.importState(A),A=>({binding:A.required.object({value:A.required.raw})}),A=>(this.value.binding.inject(A.binding.value),this.value.fetch(),!0))}}function Vr(w){return ae(w)&&Er(w.value)}function Hs(w,S){for(;w.lengthw.length?A.splice(0,A.length-w.length):Hs(A,w.length),A}class Yr{constructor(S){this.emitter=new Et,this.onTick_=this.onTick_.bind(this),this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=S.binding,this.value_=yt(Ur(S.bufferSize)),this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.ticker=S.ticker,this.ticker.emitter.on("tick",this.onTick_),this.fetch()}get rawValue(){return this.value_.rawValue}set rawValue(S){this.value_.rawValue=S}setRawValue(S,A){this.value_.setRawValue(S,A)}fetch(){this.value_.rawValue=Xr(this.value_.rawValue,this.binding.read())}onTick_(){this.fetch()}onValueBeforeChange_(S){this.emitter.emit("beforechange",Object.assign(Object.assign({},S),{sender:this}))}onValueChange_(S){this.emitter.emit("change",Object.assign(Object.assign({},S),{sender:this}))}}function Wr(w){if(!("binding"in w))return!1;const S=w.binding;return Ai(S)&&"read"in S&&!("write"in S)}class Hr extends Ws{exportState(){return bt(()=>super.exportState(),{binding:{readonly:!0}})}}function Kr(w){return ae(w)&&Wr(w.value)}class Zr extends ue{get label(){return this.controller.labelController.props.get("label")}set label(S){this.controller.labelController.props.set("label",S)}get title(){var S;return(S=this.controller.buttonController.props.get("title"))!==null&&S!==void 0?S:""}set title(S){this.controller.buttonController.props.set("title",S)}on(S,A){const b=A.bind(this);return this.controller.buttonController.emitter.on(S,J=>{b(new Cr(this,J.nativeEvent))}),this}off(S,A){return this.controller.buttonController.emitter.off(S,A),this}}function Jr(w,S,A){A?w.classList.add(S):w.classList.remove(S)}function xe(w,S){return A=>{Jr(w,S,A)}}function Oi(w,S){Wt(w,A=>{S.textContent=A??""})}const ni=dt("btn");class Qr{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(ni()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("button");b.classList.add(ni("b")),A.viewProps.bindDisabled(b),this.element.appendChild(b),this.buttonElement=b;const W=S.createElement("div");W.classList.add(ni("t")),Oi(A.props.value("title"),W),this.buttonElement.appendChild(W)}}class $r{constructor(S,A){this.emitter=new Et,this.onClick_=this.onClick_.bind(this),this.props=A.props,this.viewProps=A.viewProps,this.view=new Qr(S,{props:this.props,viewProps:this.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}importProps(S){return Dt(S,null,A=>({title:A.optional.string}),A=>(this.props.set("title",A.title),!0))}exportProps(){return bt(null,{title:this.props.get("title")})}onClick_(S){this.emitter.emit("click",{nativeEvent:S,sender:this})}}class is extends ei{constructor(S,A){const b=new $r(S,{props:A.buttonProps,viewProps:A.viewProps}),W=new Ys(S,{blade:A.blade,props:A.labelProps,valueController:b});super({blade:A.blade,view:W.view,viewProps:A.viewProps}),this.buttonController=b,this.labelController=W}importState(S){return Dt(S,A=>super.importState(A)&&this.buttonController.importProps(A)&&this.labelController.importProps(A),()=>({}),()=>!0)}exportState(){return bt(()=>super.exportState(),Object.assign(Object.assign({},this.buttonController.exportProps()),this.labelController.exportProps()))}}class Ks{constructor(S){const[A,b]=S.split("-"),W=A.split(".");this.major=parseInt(W[0],10),this.minor=parseInt(W[1],10),this.patch=parseInt(W[2],10),this.prerelease=b??null}toString(){const S=[this.major,this.minor,this.patch].join(".");return this.prerelease!==null?[S,this.prerelease].join("-"):S}}const ye=new Ks("2.0.3");function Rt(w){return Object.assign({core:ye},w)}const jr=Rt({id:"button",type:"blade",accept(w){const S=Tt(w,A=>({title:A.required.string,view:A.required.constant("button"),label:A.optional.string}));return S?{params:S}:null},controller(w){return new is(w.document,{blade:w.blade,buttonProps:ut.fromObject({title:w.params.title}),labelProps:ut.fromObject({label:w.params.label}),viewProps:w.viewProps})},api(w){return w.controller instanceof is?new Zr(w.controller):null}});function kr(w,S){return w.addBlade(Object.assign(Object.assign({},S),{view:"button"}))}function qr(w,S){return w.addBlade(Object.assign(Object.assign({},S),{view:"folder"}))}function _r(w,S){return w.addBlade(Object.assign(Object.assign({},S),{view:"tab"}))}function ta(w){return Pi(w)?"refresh"in w&&typeof w.refresh=="function":!1}function ea(w,S){if(!Je.isBindable(w))throw Ct.notBindable();return new Je(w,S)}class ia{constructor(S,A){this.onRackValueChange_=this.onRackValueChange_.bind(this),this.controller_=S,this.emitter_=new Et,this.pool_=A,this.controller_.rack.emitter.on("valuechange",this.onRackValueChange_)}get children(){return this.controller_.rack.children.map(S=>this.pool_.createApi(S))}addBinding(S,A,b){const W=b??{},J=this.controller_.element.ownerDocument,p=this.pool_.createBinding(J,ea(S,A),W),C=this.pool_.createBindingApi(p);return this.add(C,W.index)}addFolder(S){return qr(this,S)}addButton(S){return kr(this,S)}addTab(S){return _r(this,S)}add(S,A){const b=S.controller;return this.controller_.rack.add(b,A),S}remove(S){this.controller_.rack.remove(S.controller)}addBlade(S){const A=this.controller_.element.ownerDocument,b=this.pool_.createBlade(A,S),W=this.pool_.createApi(b);return this.add(W,S.index)}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}refresh(){this.children.forEach(S=>{ta(S)&&S.refresh()})}onRackValueChange_(S){const A=S.bladeController,b=this.pool_.createApi(A),W=Ns(A.value)?A.value.binding:null;this.emitter_.emit("change",new Be(b,W?W.target.read():A.value.rawValue,S.options.last))}}class Di extends ue{constructor(S,A){super(S),this.rackApi_=new ia(S.rackController,A)}refresh(){this.rackApi_.refresh()}}class bi extends ei{constructor(S){super({blade:S.blade,view:S.view,viewProps:S.rackController.viewProps}),this.rackController=S.rackController}importState(S){return Dt(S,A=>super.importState(A),A=>({children:A.required.array(A.required.raw)}),A=>this.rackController.rack.children.every((b,W)=>b.importState(A.children[W])))}exportState(){return bt(()=>super.exportState(),{children:this.rackController.rack.children.map(S=>S.exportState())})}}function ci(w){return"rackController"in w}class sa{constructor(S){this.emitter=new Et,this.items_=[],this.cache_=new Set,this.onSubListAdd_=this.onSubListAdd_.bind(this),this.onSubListRemove_=this.onSubListRemove_.bind(this),this.extract_=S}get items(){return this.items_}allItems(){return Array.from(this.cache_)}find(S){for(const A of this.allItems())if(S(A))return A;return null}includes(S){return this.cache_.has(S)}add(S,A){if(this.includes(S))throw Ct.shouldNeverHappen();const b=A!==void 0?A:this.items_.length;this.items_.splice(b,0,S),this.cache_.add(S);const W=this.extract_(S);W&&(W.emitter.on("add",this.onSubListAdd_),W.emitter.on("remove",this.onSubListRemove_),W.allItems().forEach(J=>{this.cache_.add(J)})),this.emitter.emit("add",{index:b,item:S,root:this,target:this})}remove(S){const A=this.items_.indexOf(S);if(A<0)return;this.items_.splice(A,1),this.cache_.delete(S);const b=this.extract_(S);b&&(b.allItems().forEach(W=>{this.cache_.delete(W)}),b.emitter.off("add",this.onSubListAdd_),b.emitter.off("remove",this.onSubListRemove_)),this.emitter.emit("remove",{index:A,item:S,root:this,target:this})}onSubListAdd_(S){this.cache_.add(S.item),this.emitter.emit("add",{index:S.index,item:S.item,root:this,target:S.target})}onSubListRemove_(S){this.cache_.delete(S.item),this.emitter.emit("remove",{index:S.index,item:S.item,root:this,target:S.target})}}function na(w,S){for(let A=0;A!W.viewProps.get("hidden")),A=S[0],b=S[S.length-1];this.bcSet_.items.forEach(W=>{const J=[];W===A&&(J.push("first"),(!this.blade_||this.blade_.get("positions").includes("veryfirst"))&&J.push("veryfirst")),W===b&&(J.push("last"),(!this.blade_||this.blade_.get("positions").includes("verylast"))&&J.push("verylast")),W.blade.set("positions",J)})}onChildPositionsChange_(){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildViewPropsChange_(S){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildDispose_(){this.bcSet_.items.filter(A=>A.viewProps.get("disposed")).forEach(A=>{this.bcSet_.remove(A)})}onChildValueChange_(S){const A=na(this.find(ae),S.sender);if(!A)throw Ct.alreadyDisposed();this.emitter.emit("valuechange",{bladeController:A,options:S.options,sender:this})}onRackLayout_(S){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onRackValueChange_(S){this.emitter.emit("valuechange",{bladeController:S.bladeController,options:S.options,sender:this})}onBladePositionsChange_(){this.updatePositions_()}}class Bi{constructor(S){this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this),this.element=S.element,this.viewProps=S.viewProps;const A=new aa({blade:S.root?void 0:S.blade,viewProps:S.viewProps});A.emitter.on("add",this.onRackAdd_),A.emitter.on("remove",this.onRackRemove_),this.rack=A,this.viewProps.handleDispose(()=>{for(let b=this.rack.children.length-1;b>=0;b--)this.rack.children[b].viewProps.set("disposed",!0)})}onRackAdd_(S){S.root&&Vs(this.element,S.bladeController.view.element,S.index)}onRackRemove_(S){S.root&&Fi(S.bladeController.view.element)}}function Te(){return new ut({positions:yt([],{equals:Nn})})}class Ie extends ut{constructor(S){super(S)}static create(S){const A={completed:!0,expanded:S,expandedHeight:null,shouldFixHeight:!1,temporaryExpanded:null},b=ut.createCore(A);return new Ie(b)}get styleExpanded(){var S;return(S=this.get("temporaryExpanded"))!==null&&S!==void 0?S:this.get("expanded")}get styleHeight(){if(!this.styleExpanded)return"0";const S=this.get("expandedHeight");return this.get("shouldFixHeight")&&!gt(S)?`${S}px`:"auto"}bindExpandedClass(S,A){const b=()=>{this.styleExpanded?S.classList.add(A):S.classList.remove(A)};Vt(this,"expanded",b),Vt(this,"temporaryExpanded",b)}cleanUpTransition(){this.set("shouldFixHeight",!1),this.set("expandedHeight",null),this.set("completed",!0)}}function oa(w,S){let A=0;return wr(S,()=>{w.set("expandedHeight",null),w.set("temporaryExpanded",!0),Qe(S),A=S.clientHeight,w.set("temporaryExpanded",null),Qe(S)}),A}function ss(w,S){S.style.height=w.styleHeight}function Ii(w,S){w.value("expanded").emitter.on("beforechange",()=>{if(w.set("completed",!1),gt(w.get("expandedHeight"))){const A=oa(w,S);A>0&&w.set("expandedHeight",A)}w.set("shouldFixHeight",!0),Qe(S)}),w.emitter.on("change",()=>{ss(w,S)}),ss(w,S),S.addEventListener("transitionend",A=>{A.propertyName==="height"&&w.cleanUpTransition()})}class Zs extends Di{constructor(S,A){super(S,A),this.emitter_=new Et,this.controller.foldable.value("expanded").emitter.on("change",b=>{this.emitter_.emit("fold",new yr(this,b.sender.rawValue))}),this.rackApi_.on("change",b=>{this.emitter_.emit("change",b)})}get expanded(){return this.controller.foldable.get("expanded")}set expanded(S){this.controller.foldable.set("expanded",S)}get title(){return this.controller.props.get("title")}set title(S){this.controller.props.set("title",S)}get children(){return this.rackApi_.children}addBinding(S,A,b){return this.rackApi_.addBinding(S,A,b)}addFolder(S){return this.rackApi_.addFolder(S)}addButton(S){return this.rackApi_.addButton(S)}addTab(S){return this.rackApi_.addTab(S)}add(S,A){return this.rackApi_.add(S,A)}remove(S){this.rackApi_.remove(S)}addBlade(S){return this.rackApi_.addBlade(S)}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}}const Js=dt("cnt");class ha{constructor(S,A){var b;this.className_=dt((b=A.viewName)!==null&&b!==void 0?b:"fld"),this.element=S.createElement("div"),this.element.classList.add(this.className_(),Js()),A.viewProps.bindClassModifiers(this.element),this.foldable_=A.foldable,this.foldable_.bindExpandedClass(this.element,this.className_(void 0,"expanded")),Vt(this.foldable_,"completed",xe(this.element,this.className_(void 0,"cpl")));const W=S.createElement("button");W.classList.add(this.className_("b")),Vt(A.props,"title",d=>{gt(d)?this.element.classList.add(this.className_(void 0,"not")):this.element.classList.remove(this.className_(void 0,"not"))}),A.viewProps.bindDisabled(W),this.element.appendChild(W),this.buttonElement=W;const J=S.createElement("div");J.classList.add(this.className_("i")),this.element.appendChild(J);const p=S.createElement("div");p.classList.add(this.className_("t")),Oi(A.props.value("title"),p),this.buttonElement.appendChild(p),this.titleElement=p;const C=S.createElement("div");C.classList.add(this.className_("m")),this.buttonElement.appendChild(C);const t=S.createElement("div");t.classList.add(this.className_("c")),this.element.appendChild(t),this.containerElement=t}}class pi extends bi{constructor(S,A){var b;const W=Ie.create((b=A.expanded)!==null&&b!==void 0?b:!0),J=new ha(S,{foldable:W,props:A.props,viewName:A.root?"rot":void 0,viewProps:A.viewProps});super(Object.assign(Object.assign({},A),{rackController:new Bi({blade:A.blade,element:J.containerElement,root:A.root,viewProps:A.viewProps}),view:J})),this.onTitleClick_=this.onTitleClick_.bind(this),this.props=A.props,this.foldable=W,Ii(this.foldable,this.view.containerElement),this.rackController.rack.emitter.on("add",()=>{this.foldable.cleanUpTransition()}),this.rackController.rack.emitter.on("remove",()=>{this.foldable.cleanUpTransition()}),this.view.buttonElement.addEventListener("click",this.onTitleClick_)}get document(){return this.view.element.ownerDocument}importState(S){return Dt(S,A=>super.importState(A),A=>({expanded:A.required.boolean,title:A.optional.string}),A=>(this.foldable.set("expanded",A.expanded),this.props.set("title",A.title),!0))}exportState(){return bt(()=>super.exportState(),{expanded:this.foldable.get("expanded"),title:this.props.get("title")})}onTitleClick_(){this.foldable.set("expanded",!this.foldable.get("expanded"))}}const la=Rt({id:"folder",type:"blade",accept(w){const S=Tt(w,A=>({title:A.required.string,view:A.required.constant("folder"),expanded:A.optional.boolean}));return S?{params:S}:null},controller(w){return new pi(w.document,{blade:w.blade,expanded:w.params.expanded,props:ut.fromObject({title:w.params.title}),viewProps:w.viewProps})},api(w){return w.controller instanceof pi?new Zs(w.controller,w.pool):null}}),ua=dt("");function ns(w,S){return xe(w,ua(void 0,S))}class Zt extends ut{constructor(S){var A;super(S),this.onDisabledChange_=this.onDisabledChange_.bind(this),this.onParentChange_=this.onParentChange_.bind(this),this.onParentGlobalDisabledChange_=this.onParentGlobalDisabledChange_.bind(this),[this.globalDisabled_,this.setGlobalDisabled_]=Yn(yt(this.getGlobalDisabled_())),this.value("disabled").emitter.on("change",this.onDisabledChange_),this.value("parent").emitter.on("change",this.onParentChange_),(A=this.get("parent"))===null||A===void 0||A.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_)}static create(S){var A,b,W;const J=S??{};return new Zt(ut.createCore({disabled:(A=J.disabled)!==null&&A!==void 0?A:!1,disposed:!1,hidden:(b=J.hidden)!==null&&b!==void 0?b:!1,parent:(W=J.parent)!==null&&W!==void 0?W:null}))}get globalDisabled(){return this.globalDisabled_}bindClassModifiers(S){Wt(this.globalDisabled_,ns(S,"disabled")),Vt(this,"hidden",ns(S,"hidden"))}bindDisabled(S){Wt(this.globalDisabled_,A=>{S.disabled=A})}bindTabIndex(S){Wt(this.globalDisabled_,A=>{S.tabIndex=A?-1:0})}handleDispose(S){this.value("disposed").emitter.on("change",A=>{A&&S()})}importState(S){this.set("disabled",S.disabled),this.set("hidden",S.hidden)}exportState(){return{disabled:this.get("disabled"),hidden:this.get("hidden")}}getGlobalDisabled_(){const S=this.get("parent");return(S?S.globalDisabled.rawValue:!1)||this.get("disabled")}updateGlobalDisabled_(){this.setGlobalDisabled_(this.getGlobalDisabled_())}onDisabledChange_(){this.updateGlobalDisabled_()}onParentGlobalDisabledChange_(){this.updateGlobalDisabled_()}onParentChange_(S){var A;const b=S.previousRawValue;b==null||b.globalDisabled.emitter.off("change",this.onParentGlobalDisabledChange_),(A=this.get("parent"))===null||A===void 0||A.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_),this.updateGlobalDisabled_()}}const rs=dt("tbp");class fa{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(rs()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(rs("c")),this.element.appendChild(b),this.containerElement=b}}const Ee=dt("tbi");class da{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(Ee()),A.viewProps.bindClassModifiers(this.element),Vt(A.props,"selected",J=>{J?this.element.classList.add(Ee(void 0,"sel")):this.element.classList.remove(Ee(void 0,"sel"))});const b=S.createElement("button");b.classList.add(Ee("b")),A.viewProps.bindDisabled(b),this.element.appendChild(b),this.buttonElement=b;const W=S.createElement("div");W.classList.add(Ee("t")),Oi(A.props.value("title"),W),this.buttonElement.appendChild(W),this.titleElement=W}}class va{constructor(S,A){this.emitter=new Et,this.onClick_=this.onClick_.bind(this),this.props=A.props,this.viewProps=A.viewProps,this.view=new da(S,{props:A.props,viewProps:A.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}onClick_(){this.emitter.emit("click",{sender:this})}}class mi extends bi{constructor(S,A){const b=new fa(S,{viewProps:A.viewProps});super(Object.assign(Object.assign({},A),{rackController:new Bi({blade:A.blade,element:b.containerElement,viewProps:A.viewProps}),view:b})),this.onItemClick_=this.onItemClick_.bind(this),this.ic_=new va(S,{props:A.itemProps,viewProps:Zt.create()}),this.ic_.emitter.on("click",this.onItemClick_),this.props=A.props,Vt(this.props,"selected",W=>{this.itemController.props.set("selected",W),this.viewProps.set("hidden",!W)})}get itemController(){return this.ic_}importState(S){return Dt(S,A=>super.importState(A),A=>({selected:A.required.boolean,title:A.required.string}),A=>(this.ic_.props.set("selected",A.selected),this.ic_.props.set("title",A.title),!0))}exportState(){return bt(()=>super.exportState(),{selected:this.ic_.props.get("selected"),title:this.ic_.props.get("title")})}onItemClick_(){this.props.set("selected",!0)}}class ca extends Di{constructor(S,A){super(S,A),this.emitter_=new Et,this.onSelect_=this.onSelect_.bind(this),this.pool_=A,this.rackApi_.on("change",b=>{this.emitter_.emit("change",b)}),this.controller.tab.selectedIndex.emitter.on("change",this.onSelect_)}get pages(){return this.rackApi_.children}addPage(S){const A=this.controller.view.element.ownerDocument,b=new mi(A,{blade:Te(),itemProps:ut.fromObject({selected:!1,title:S.title}),props:ut.fromObject({selected:!1}),viewProps:Zt.create()}),W=this.pool_.createApi(b);return this.rackApi_.add(W,S.index)}removePage(S){this.rackApi_.remove(this.rackApi_.children[S])}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}onSelect_(S){this.emitter_.emit("select",new Tr(this,S.rawValue))}}class pa extends Di{get title(){var S;return(S=this.controller.itemController.props.get("title"))!==null&&S!==void 0?S:""}set title(S){this.controller.itemController.props.set("title",S)}get selected(){return this.controller.props.get("selected")}set selected(S){this.controller.props.set("selected",S)}get children(){return this.rackApi_.children}addButton(S){return this.rackApi_.addButton(S)}addFolder(S){return this.rackApi_.addFolder(S)}addTab(S){return this.rackApi_.addTab(S)}add(S,A){this.rackApi_.add(S,A)}remove(S){this.rackApi_.remove(S)}addBinding(S,A,b){return this.rackApi_.addBinding(S,A,b)}addBlade(S){return this.rackApi_.addBlade(S)}}const as=-1;class ma{constructor(){this.onItemSelectedChange_=this.onItemSelectedChange_.bind(this),this.empty=yt(!0),this.selectedIndex=yt(as),this.items_=[]}add(S,A){const b=A??this.items_.length;this.items_.splice(b,0,S),S.emitter.on("change",this.onItemSelectedChange_),this.keepSelection_()}remove(S){const A=this.items_.indexOf(S);A<0||(this.items_.splice(A,1),S.emitter.off("change",this.onItemSelectedChange_),this.keepSelection_())}keepSelection_(){if(this.items_.length===0){this.selectedIndex.rawValue=as,this.empty.rawValue=!0;return}const S=this.items_.findIndex(A=>A.rawValue);S<0?(this.items_.forEach((A,b)=>{A.rawValue=b===0}),this.selectedIndex.rawValue=0):(this.items_.forEach((A,b)=>{A.rawValue=b===S}),this.selectedIndex.rawValue=S),this.empty.rawValue=!1}onItemSelectedChange_(S){if(S.rawValue){const A=this.items_.findIndex(b=>b===S.sender);this.items_.forEach((b,W)=>{b.rawValue=W===A}),this.selectedIndex.rawValue=A}else this.keepSelection_()}}const Pe=dt("tab");class ga{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(Pe(),Js()),A.viewProps.bindClassModifiers(this.element),Wt(A.empty,xe(this.element,Pe(void 0,"nop")));const b=S.createElement("div");b.classList.add(Pe("t")),this.element.appendChild(b),this.itemsElement=b;const W=S.createElement("div");W.classList.add(Pe("i")),this.element.appendChild(W);const J=S.createElement("div");J.classList.add(Pe("c")),this.element.appendChild(J),this.contentsElement=J}}class os extends bi{constructor(S,A){const b=new ma,W=new ga(S,{empty:b.empty,viewProps:A.viewProps});super({blade:A.blade,rackController:new Bi({blade:A.blade,element:W.contentsElement,viewProps:A.viewProps}),view:W}),this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this);const J=this.rackController.rack;J.emitter.on("add",this.onRackAdd_),J.emitter.on("remove",this.onRackRemove_),this.tab=b}add(S,A){this.rackController.rack.add(S,A)}remove(S){this.rackController.rack.remove(this.rackController.rack.children[S])}onRackAdd_(S){if(!S.root)return;const A=S.bladeController;Vs(this.view.itemsElement,A.itemController.view.element,S.index),A.itemController.viewProps.set("parent",this.viewProps),this.tab.add(A.props.value("selected"))}onRackRemove_(S){if(!S.root)return;const A=S.bladeController;Fi(A.itemController.view.element),A.itemController.viewProps.set("parent",null),this.tab.remove(A.props.value("selected"))}}const Qs=Rt({id:"tab",type:"blade",accept(w){const S=Tt(w,A=>({pages:A.required.array(A.required.object({title:A.required.string})),view:A.required.constant("tab")}));return!S||S.pages.length===0?null:{params:S}},controller(w){const S=new os(w.document,{blade:w.blade,viewProps:w.viewProps});return w.params.pages.forEach(A=>{const b=new mi(w.document,{blade:Te(),itemProps:ut.fromObject({selected:!1,title:A.title}),props:ut.fromObject({selected:!1}),viewProps:Zt.create()});S.add(b)}),S},api(w){return w.controller instanceof os?new ca(w.controller,w.pool):w.controller instanceof mi?new pa(w.controller,w.pool):null}});function xa(w,S){const A=w.accept(S.params);if(!A)return null;const b=Tt(S.params,W=>({disabled:W.optional.boolean,hidden:W.optional.boolean}));return w.controller({blade:Te(),document:S.document,params:Object.assign(Object.assign({},A.params),{disabled:b==null?void 0:b.disabled,hidden:b==null?void 0:b.hidden}),viewProps:Zt.create({disabled:b==null?void 0:b.disabled,hidden:b==null?void 0:b.hidden})})}class Gi extends Le{get options(){return this.controller.valueController.props.get("options")}set options(S){this.controller.valueController.props.set("options",S)}}class ya{constructor(){this.disabled=!1,this.emitter=new Et}dispose(){}tick(){this.disabled||this.emitter.emit("tick",{sender:this})}}class Ta{constructor(S,A){this.disabled_=!1,this.timerId_=null,this.onTick_=this.onTick_.bind(this),this.doc_=S,this.emitter=new Et,this.interval_=A,this.setTimer_()}get disabled(){return this.disabled_}set disabled(S){this.disabled_=S,this.disabled_?this.clearTimer_():this.setTimer_()}dispose(){this.clearTimer_()}clearTimer_(){if(this.timerId_===null)return;const S=this.doc_.defaultView;S&&S.clearInterval(this.timerId_),this.timerId_=null}setTimer_(){if(this.clearTimer_(),this.interval_<=0)return;const S=this.doc_.defaultView;S&&(this.timerId_=S.setInterval(this.onTick_,this.interval_))}onTick_(){this.disabled_||this.emitter.emit("tick",{sender:this})}}class Ge{constructor(S){this.constraints=S}constrain(S){return this.constraints.reduce((A,b)=>b.constrain(A),S)}}function $e(w,S){if(w instanceof S)return w;if(w instanceof Ge){const A=w.constraints.reduce((b,W)=>b||(W instanceof S?W:null),null);if(A)return A}return null}class Ne{constructor(S){this.values=ut.fromObject({options:S})}constrain(S){const A=this.values.get("options");return A.length===0||A.filter(W=>W.value===S).length>0?S:A[0].value}}function Ve(w){var S;const A=vi;if(Array.isArray(w))return(S=Tt({items:w},b=>({items:b.required.array(b.required.object({text:b.required.string,value:b.required.raw}))})))===null||S===void 0?void 0:S.items;if(typeof w=="object")return A.required.raw(w).value}function Ni(w){if(Array.isArray(w))return w;const S=[];return Object.keys(w).forEach(A=>{S.push({text:A,value:w[A]})}),S}function Vi(w){return gt(w)?null:new Ne(Ni(w))}const ri=dt("lst");class Ca{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),this.props_=A.props,this.element=S.createElement("div"),this.element.classList.add(ri()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("select");b.classList.add(ri("s")),A.viewProps.bindDisabled(b),this.element.appendChild(b),this.selectElement=b;const W=S.createElement("div");W.classList.add(ri("m")),W.appendChild(ti(S,"dropdown")),this.element.appendChild(W),A.value.emitter.on("change",this.onValueChange_),this.value_=A.value,Vt(this.props_,"options",J=>{Us(this.selectElement),J.forEach(p=>{const C=S.createElement("option");C.textContent=p.text,this.selectElement.appendChild(C)}),this.update_()})}update_(){const S=this.props_.get("options").map(A=>A.value);this.selectElement.selectedIndex=S.indexOf(this.value_.rawValue)}onValueChange_(){this.update_()}}class _t{constructor(S,A){this.onSelectChange_=this.onSelectChange_.bind(this),this.props=A.props,this.value=A.value,this.viewProps=A.viewProps,this.view=new Ca(S,{props:this.props,value:this.value,viewProps:this.viewProps}),this.view.selectElement.addEventListener("change",this.onSelectChange_)}onSelectChange_(S){const A=S.currentTarget;this.value.rawValue=this.props.get("options")[A.selectedIndex].value}importProps(S){return Dt(S,null,A=>({options:A.required.custom(Ve)}),A=>(this.props.set("options",Ni(A.options)),!0))}exportProps(){return bt(null,{options:this.props.get("options")})}}const hs=dt("pop");class Sa{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(hs()),A.viewProps.bindClassModifiers(this.element),Wt(A.shows,xe(this.element,hs(void 0,"v")))}}class $s{constructor(S,A){this.shows=yt(!1),this.viewProps=A.viewProps,this.view=new Sa(S,{shows:this.shows,viewProps:this.viewProps})}}const ls=dt("txt");class Ea{constructor(S,A){this.onChange_=this.onChange_.bind(this),this.element=S.createElement("div"),this.element.classList.add(ls()),A.viewProps.bindClassModifiers(this.element),this.props_=A.props,this.props_.emitter.on("change",this.onChange_);const b=S.createElement("input");b.classList.add(ls("i")),b.type="text",A.viewProps.bindDisabled(b),this.element.appendChild(b),this.inputElement=b,A.value.emitter.on("change",this.onChange_),this.value_=A.value,this.refresh()}refresh(){const S=this.props_.get("formatter");this.inputElement.value=S(this.value_.rawValue)}onChange_(){this.refresh()}}class Fe{constructor(S,A){this.onInputChange_=this.onInputChange_.bind(this),this.parser_=A.parser,this.props=A.props,this.value=A.value,this.viewProps=A.viewProps,this.view=new Ea(S,{props:A.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_)}onInputChange_(S){const b=S.currentTarget.value,W=this.parser_(b);gt(W)||(this.value.rawValue=W),this.view.refresh()}}function Pa(w){return String(w)}function js(w){return w==="false"?!1:!!w}function us(w){return Pa(w)}function Aa(w){return S=>w.reduce((A,b)=>A!==null?A:b(S),null)}const Ma=Ft(0);function je(w){return Ma(w)+"%"}function ks(w){return String(w)}function gi(w){return w}function Ce({primary:w,secondary:S,forward:A,backward:b}){let W=!1;function J(p){W||(W=!0,p(),W=!1)}w.emitter.on("change",p=>{J(()=>{S.setRawValue(A(w.rawValue,S.rawValue),p.options)})}),S.emitter.on("change",p=>{J(()=>{w.setRawValue(b(w.rawValue,S.rawValue),p.options)}),J(()=>{S.setRawValue(A(w.rawValue,S.rawValue),p.options)})}),J(()=>{S.setRawValue(A(w.rawValue,S.rawValue),{forceEmit:!1,last:!0})})}function Lt(w,S){const A=w*(S.altKey?.1:1)*(S.shiftKey?10:1);return S.upKey?+A:S.downKey?-A:0}function Oe(w){return{altKey:w.altKey,downKey:w.key==="ArrowDown",shiftKey:w.shiftKey,upKey:w.key==="ArrowUp"}}function Kt(w){return{altKey:w.altKey,downKey:w.key==="ArrowLeft",shiftKey:w.shiftKey,upKey:w.key==="ArrowRight"}}function wa(w){return w==="ArrowUp"||w==="ArrowDown"}function qs(w){return wa(w)||w==="ArrowLeft"||w==="ArrowRight"}function ai(w,S){var A,b;const W=S.ownerDocument.defaultView,J=S.getBoundingClientRect();return{x:w.pageX-(((A=W&&W.scrollX)!==null&&A!==void 0?A:0)+J.left),y:w.pageY-(((b=W&&W.scrollY)!==null&&b!==void 0?b:0)+J.top)}}class fe{constructor(S){this.lastTouch_=null,this.onDocumentMouseMove_=this.onDocumentMouseMove_.bind(this),this.onDocumentMouseUp_=this.onDocumentMouseUp_.bind(this),this.onMouseDown_=this.onMouseDown_.bind(this),this.onTouchEnd_=this.onTouchEnd_.bind(this),this.onTouchMove_=this.onTouchMove_.bind(this),this.onTouchStart_=this.onTouchStart_.bind(this),this.elem_=S,this.emitter=new Et,S.addEventListener("touchstart",this.onTouchStart_,{passive:!1}),S.addEventListener("touchmove",this.onTouchMove_,{passive:!0}),S.addEventListener("touchend",this.onTouchEnd_),S.addEventListener("mousedown",this.onMouseDown_)}computePosition_(S){const A=this.elem_.getBoundingClientRect();return{bounds:{width:A.width,height:A.height},point:S?{x:S.x,y:S.y}:null}}onMouseDown_(S){var A;S.preventDefault(),(A=S.currentTarget)===null||A===void 0||A.focus();const b=this.elem_.ownerDocument;b.addEventListener("mousemove",this.onDocumentMouseMove_),b.addEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("down",{altKey:S.altKey,data:this.computePosition_(ai(S,this.elem_)),sender:this,shiftKey:S.shiftKey})}onDocumentMouseMove_(S){this.emitter.emit("move",{altKey:S.altKey,data:this.computePosition_(ai(S,this.elem_)),sender:this,shiftKey:S.shiftKey})}onDocumentMouseUp_(S){const A=this.elem_.ownerDocument;A.removeEventListener("mousemove",this.onDocumentMouseMove_),A.removeEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("up",{altKey:S.altKey,data:this.computePosition_(ai(S,this.elem_)),sender:this,shiftKey:S.shiftKey})}onTouchStart_(S){S.preventDefault();const A=S.targetTouches.item(0),b=this.elem_.getBoundingClientRect();this.emitter.emit("down",{altKey:S.altKey,data:this.computePosition_(A?{x:A.clientX-b.left,y:A.clientY-b.top}:void 0),sender:this,shiftKey:S.shiftKey}),this.lastTouch_=A}onTouchMove_(S){const A=S.targetTouches.item(0),b=this.elem_.getBoundingClientRect();this.emitter.emit("move",{altKey:S.altKey,data:this.computePosition_(A?{x:A.clientX-b.left,y:A.clientY-b.top}:void 0),sender:this,shiftKey:S.shiftKey}),this.lastTouch_=A}onTouchEnd_(S){var A;const b=(A=S.targetTouches.item(0))!==null&&A!==void 0?A:this.lastTouch_,W=this.elem_.getBoundingClientRect();this.emitter.emit("up",{altKey:S.altKey,data:this.computePosition_(b?{x:b.clientX-W.left,y:b.clientY-W.top}:void 0),sender:this,shiftKey:S.shiftKey})}}const Bt=dt("txt");class Ra{constructor(S,A){this.onChange_=this.onChange_.bind(this),this.props_=A.props,this.props_.emitter.on("change",this.onChange_),this.element=S.createElement("div"),this.element.classList.add(Bt(),Bt(void 0,"num")),A.arrayPosition&&this.element.classList.add(Bt(void 0,A.arrayPosition)),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("input");b.classList.add(Bt("i")),b.type="text",A.viewProps.bindDisabled(b),this.element.appendChild(b),this.inputElement=b,this.onDraggingChange_=this.onDraggingChange_.bind(this),this.dragging_=A.dragging,this.dragging_.emitter.on("change",this.onDraggingChange_),this.element.classList.add(Bt()),this.inputElement.classList.add(Bt("i"));const W=S.createElement("div");W.classList.add(Bt("k")),this.element.appendChild(W),this.knobElement=W;const J=S.createElementNS(Nt,"svg");J.classList.add(Bt("g")),this.knobElement.appendChild(J);const p=S.createElementNS(Nt,"path");p.classList.add(Bt("gb")),J.appendChild(p),this.guideBodyElem_=p;const C=S.createElementNS(Nt,"path");C.classList.add(Bt("gh")),J.appendChild(C),this.guideHeadElem_=C;const t=S.createElement("div");t.classList.add(dt("tt")()),this.knobElement.appendChild(t),this.tooltipElem_=t,A.value.emitter.on("change",this.onChange_),this.value=A.value,this.refresh()}onDraggingChange_(S){if(S.rawValue===null){this.element.classList.remove(Bt(void 0,"drg"));return}this.element.classList.add(Bt(void 0,"drg"));const A=S.rawValue/this.props_.get("pointerScale"),b=A+(A>0?-1:A<0?1:0),W=Pt(-b,-4,4);this.guideHeadElem_.setAttributeNS(null,"d",[`M ${b+W},0 L${b},4 L${b+W},8`,`M ${A},-1 L${A},9`].join(" ")),this.guideBodyElem_.setAttributeNS(null,"d",`M 0,4 L${A},4`);const J=this.props_.get("formatter");this.tooltipElem_.textContent=J(this.value.rawValue),this.tooltipElem_.style.left=`${A}px`}refresh(){const S=this.props_.get("formatter");this.inputElement.value=S(this.value.rawValue)}onChange_(){this.refresh()}}class Ue{constructor(S,A){var b;this.originRawValue_=0,this.onInputChange_=this.onInputChange_.bind(this),this.onInputKeyDown_=this.onInputKeyDown_.bind(this),this.onInputKeyUp_=this.onInputKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.parser_=A.parser,this.props=A.props,this.sliderProps_=(b=A.sliderProps)!==null&&b!==void 0?b:null,this.value=A.value,this.viewProps=A.viewProps,this.dragging_=yt(null),this.view=new Ra(S,{arrayPosition:A.arrayPosition,dragging:this.dragging_,props:this.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.inputElement.addEventListener("keydown",this.onInputKeyDown_),this.view.inputElement.addEventListener("keyup",this.onInputKeyUp_);const W=new fe(this.view.knobElement);W.emitter.on("down",this.onPointerDown_),W.emitter.on("move",this.onPointerMove_),W.emitter.on("up",this.onPointerUp_)}constrainValue_(S){var A,b;const W=(A=this.sliderProps_)===null||A===void 0?void 0:A.get("min"),J=(b=this.sliderProps_)===null||b===void 0?void 0:b.get("max");let p=S;return W!==void 0&&(p=Math.max(p,W)),J!==void 0&&(p=Math.min(p,J)),p}onInputChange_(S){const b=S.currentTarget.value,W=this.parser_(b);gt(W)||(this.value.rawValue=this.constrainValue_(W)),this.view.refresh()}onInputKeyDown_(S){const A=Lt(this.props.get("keyScale"),Oe(S));A!==0&&this.value.setRawValue(this.constrainValue_(this.value.rawValue+A),{forceEmit:!1,last:!1})}onInputKeyUp_(S){Lt(this.props.get("keyScale"),Oe(S))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}onPointerDown_(){this.originRawValue_=this.value.rawValue,this.dragging_.rawValue=0}computeDraggingValue_(S){if(!S.point)return null;const A=S.point.x-S.bounds.width/2;return this.constrainValue_(this.originRawValue_+A*this.props.get("pointerScale"))}onPointerMove_(S){const A=this.computeDraggingValue_(S.data);A!==null&&(this.value.setRawValue(A,{forceEmit:!1,last:!1}),this.dragging_.rawValue=this.value.rawValue-this.originRawValue_)}onPointerUp_(S){const A=this.computeDraggingValue_(S.data);A!==null&&(this.value.setRawValue(A,{forceEmit:!0,last:!0}),this.dragging_.rawValue=null)}}const oi=dt("sld");class La{constructor(S,A){this.onChange_=this.onChange_.bind(this),this.props_=A.props,this.props_.emitter.on("change",this.onChange_),this.element=S.createElement("div"),this.element.classList.add(oi()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(oi("t")),A.viewProps.bindTabIndex(b),this.element.appendChild(b),this.trackElement=b;const W=S.createElement("div");W.classList.add(oi("k")),this.trackElement.appendChild(W),this.knobElement=W,A.value.emitter.on("change",this.onChange_),this.value=A.value,this.update_()}update_(){const S=Pt(ct(this.value.rawValue,this.props_.get("min"),this.props_.get("max"),0,100),0,100);this.knobElement.style.width=`${S}%`}onChange_(){this.update_()}}class Fa{constructor(S,A){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDownOrMove_=this.onPointerDownOrMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.props=A.props,this.view=new La(S,{props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new fe(this.view.trackElement),this.ptHandler_.emitter.on("down",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("move",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.trackElement.addEventListener("keydown",this.onKeyDown_),this.view.trackElement.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(S,A){S.point&&this.value.setRawValue(ct(Pt(S.point.x,0,S.bounds.width),0,S.bounds.width,this.props.get("min"),this.props.get("max")),A)}onPointerDownOrMove_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerUp_(S){this.handlePointerEvent_(S.data,{forceEmit:!0,last:!0})}onKeyDown_(S){const A=Lt(this.props.get("keyScale"),Kt(S));A!==0&&this.value.setRawValue(this.value.rawValue+A,{forceEmit:!1,last:!1})}onKeyUp_(S){Lt(this.props.get("keyScale"),Kt(S))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const hi=dt("sldtxt");class Oa{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(hi());const b=S.createElement("div");b.classList.add(hi("s")),this.sliderView_=A.sliderView,b.appendChild(this.sliderView_.element),this.element.appendChild(b);const W=S.createElement("div");W.classList.add(hi("t")),this.textView_=A.textView,W.appendChild(this.textView_.element),this.element.appendChild(W)}}class ke{constructor(S,A){this.value=A.value,this.viewProps=A.viewProps,this.sliderC_=new Fa(S,{props:A.sliderProps,value:A.value,viewProps:this.viewProps}),this.textC_=new Ue(S,{parser:A.parser,props:A.textProps,sliderProps:A.sliderProps,value:A.value,viewProps:A.viewProps}),this.view=new Oa(S,{sliderView:this.sliderC_.view,textView:this.textC_.view})}get sliderController(){return this.sliderC_}get textController(){return this.textC_}importProps(S){return Dt(S,null,A=>({max:A.required.number,min:A.required.number}),A=>{const b=this.sliderC_.props;return b.set("max",A.max),b.set("min",A.min),!0})}exportProps(){const S=this.sliderC_.props;return bt(null,{max:S.get("max"),min:S.get("min")})}}function _s(w){return{sliderProps:new ut({keyScale:w.keyScale,max:w.max,min:w.min}),textProps:new ut({formatter:yt(w.formatter),keyScale:w.keyScale,pointerScale:yt(w.pointerScale)})}}const Da={containerUnitSize:"cnt-usz"};function tn(w){return`--${Da[w]}`}function De(w){return Gs(w)}function kt(w){if(di(w))return Tt(w,De)}function Yt(w,S){if(!w)return;const A=[],b=bs(w,S);b&&A.push(b);const W=Bs(w);return W&&A.push(W),new Ge(A)}function ba(w){return w?w.major===ye.major:!1}function en(w){if(w==="inline"||w==="popup")return w}function ze(w,S){w.write(S)}const We=dt("ckb");class Ba{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),this.element=S.createElement("div"),this.element.classList.add(We()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("label");b.classList.add(We("l")),this.element.appendChild(b),this.labelElement=b;const W=S.createElement("input");W.classList.add(We("i")),W.type="checkbox",this.labelElement.appendChild(W),this.inputElement=W,A.viewProps.bindDisabled(this.inputElement);const J=S.createElement("div");J.classList.add(We("w")),this.labelElement.appendChild(J);const p=ti(S,"check");J.appendChild(p),A.value.emitter.on("change",this.onValueChange_),this.value=A.value,this.update_()}update_(){this.inputElement.checked=this.value.rawValue}onValueChange_(){this.update_()}}class Ia{constructor(S,A){this.onInputChange_=this.onInputChange_.bind(this),this.onLabelMouseDown_=this.onLabelMouseDown_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.view=new Ba(S,{value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.labelElement.addEventListener("mousedown",this.onLabelMouseDown_)}onInputChange_(S){const A=S.currentTarget;this.value.rawValue=A.checked,S.preventDefault(),S.stopPropagation()}onLabelMouseDown_(S){S.preventDefault()}}function Ga(w){const S=[],A=Vi(w.options);return A&&S.push(A),new Ge(S)}const Na=Rt({id:"input-bool",type:"input",accept:(w,S)=>{if(typeof w!="boolean")return null;const A=Tt(S,b=>({options:b.optional.custom(Ve),readonly:b.optional.constant(!1)}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>js,constraint:w=>Ga(w.params),writer:w=>ze},controller:w=>{const S=w.document,A=w.value,b=w.constraint,W=b&&$e(b,Ne);return W?new _t(S,{props:new ut({options:W.values.value("options")}),value:A,viewProps:w.viewProps}):new Ia(S,{value:A,viewProps:w.viewProps})},api(w){return typeof w.controller.value.rawValue!="boolean"?null:w.controller.valueController instanceof _t?new Gi(w.controller):null}}),re=dt("col");class Va{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(re()),A.foldable.bindExpandedClass(this.element,re(void 0,"expanded")),Vt(A.foldable,"completed",xe(this.element,re(void 0,"cpl")));const b=S.createElement("div");b.classList.add(re("h")),this.element.appendChild(b);const W=S.createElement("div");W.classList.add(re("s")),b.appendChild(W),this.swatchElement=W;const J=S.createElement("div");if(J.classList.add(re("t")),b.appendChild(J),this.textElement=J,A.pickerLayout==="inline"){const p=S.createElement("div");p.classList.add(re("p")),this.element.appendChild(p),this.pickerElement=p}else this.pickerElement=null}}function Ua(w,S,A){const b=Pt(w/255,0,1),W=Pt(S/255,0,1),J=Pt(A/255,0,1),p=Math.max(b,W,J),C=Math.min(b,W,J),t=p-C;let d=0,c=0;const a=(C+p)/2;return t!==0&&(c=t/(1-Math.abs(p+C-1)),b===p?d=(W-J)/t:W===p?d=2+(J-b)/t:d=4+(b-W)/t,d=d/6+(d<0?1:0)),[d*360,c*100,a*100]}function za(w,S,A){const b=(w%360+360)%360,W=Pt(S/100,0,1),J=Pt(A/100,0,1),p=(1-Math.abs(2*J-1))*W,C=p*(1-Math.abs(b/60%2-1)),t=J-p/2;let d,c,a;return b>=0&&b<60?[d,c,a]=[p,C,0]:b>=60&&b<120?[d,c,a]=[C,p,0]:b>=120&&b<180?[d,c,a]=[0,p,C]:b>=180&&b<240?[d,c,a]=[0,C,p]:b>=240&&b<300?[d,c,a]=[C,0,p]:[d,c,a]=[p,0,C],[(d+t)*255,(c+t)*255,(a+t)*255]}function Xa(w,S,A){const b=Pt(w/255,0,1),W=Pt(S/255,0,1),J=Pt(A/255,0,1),p=Math.max(b,W,J),C=Math.min(b,W,J),t=p-C;let d;t===0?d=0:p===b?d=60*(((W-J)/t%6+6)%6):p===W?d=60*((J-b)/t+2):d=60*((b-W)/t+4);const c=p===0?0:t/p,a=p;return[d,c*100,a*100]}function sn(w,S,A){const b=Fs(w,360),W=Pt(S/100,0,1),J=Pt(A/100,0,1),p=J*W,C=p*(1-Math.abs(b/60%2-1)),t=J-p;let d,c,a;return b>=0&&b<60?[d,c,a]=[p,C,0]:b>=60&&b<120?[d,c,a]=[C,p,0]:b>=120&&b<180?[d,c,a]=[0,p,C]:b>=180&&b<240?[d,c,a]=[0,C,p]:b>=240&&b<300?[d,c,a]=[C,0,p]:[d,c,a]=[p,0,C],[(d+t)*255,(c+t)*255,(a+t)*255]}function Ya(w,S,A){const b=A+S*(100-Math.abs(2*A-100))/200;return[w,b!==0?S*(100-Math.abs(2*A-100))/b:0,A+S*(100-Math.abs(2*A-100))/(2*100)]}function Wa(w,S,A){const b=100-Math.abs(A*(200-S)/100-100);return[w,b!==0?S*A/b:0,A*(200-S)/(2*100)]}function Ut(w){return[w[0],w[1],w[2]]}function ii(w,S){return[w[0],w[1],w[2],S]}const Ha={hsl:{hsl:(w,S,A)=>[w,S,A],hsv:Ya,rgb:za},hsv:{hsl:Wa,hsv:(w,S,A)=>[w,S,A],rgb:sn},rgb:{hsl:Ua,hsv:Xa,rgb:(w,S,A)=>[w,S,A]}};function ge(w,S){return[S==="float"?1:w==="rgb"?255:360,S==="float"?1:w==="rgb"?255:100,S==="float"?1:w==="rgb"?255:100]}function Ka(w,S){return w===S?S:Fs(w,S)}function nn(w,S,A){var b;const W=ge(S,A);return[S==="rgb"?Pt(w[0],0,W[0]):Ka(w[0],W[0]),Pt(w[1],0,W[1]),Pt(w[2],0,W[2]),Pt((b=w[3])!==null&&b!==void 0?b:1,0,1)]}function fs(w,S,A,b){const W=ge(S,A),J=ge(S,b);return w.map((p,C)=>p/W[C]*J[C])}function rn(w,S,A){const b=fs(w,S.mode,S.type,"int"),W=Ha[S.mode][A.mode](...b);return fs(W,A.mode,"int",A.type)}class vt{static black(){return new vt([0,0,0],"rgb")}constructor(S,A){this.type="int",this.mode=A,this.comps_=nn(S,A,this.type)}getComponents(S){return ii(rn(Ut(this.comps_),{mode:this.mode,type:this.type},{mode:S??this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){const S=this.getComponents("rgb");return{r:S[0],g:S[1],b:S[2],a:S[3]}}}const Jt=dt("colp");class Za{constructor(S,A){this.alphaViews_=null,this.element=S.createElement("div"),this.element.classList.add(Jt()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(Jt("hsv"));const W=S.createElement("div");W.classList.add(Jt("sv")),this.svPaletteView_=A.svPaletteView,W.appendChild(this.svPaletteView_.element),b.appendChild(W);const J=S.createElement("div");J.classList.add(Jt("h")),this.hPaletteView_=A.hPaletteView,J.appendChild(this.hPaletteView_.element),b.appendChild(J),this.element.appendChild(b);const p=S.createElement("div");if(p.classList.add(Jt("rgb")),this.textsView_=A.textsView,p.appendChild(this.textsView_.element),this.element.appendChild(p),A.alphaViews){this.alphaViews_={palette:A.alphaViews.palette,text:A.alphaViews.text};const C=S.createElement("div");C.classList.add(Jt("a"));const t=S.createElement("div");t.classList.add(Jt("ap")),t.appendChild(this.alphaViews_.palette.element),C.appendChild(t);const d=S.createElement("div");d.classList.add(Jt("at")),d.appendChild(this.alphaViews_.text.element),C.appendChild(d),this.element.appendChild(C)}}get allFocusableElements(){const S=[this.svPaletteView_.element,this.hPaletteView_.element,this.textsView_.modeSelectElement,...this.textsView_.inputViews.map(A=>A.inputElement)];return this.alphaViews_&&S.push(this.alphaViews_.palette.element,this.alphaViews_.text.inputElement),S}}function Ja(w){return w==="int"?"int":w==="float"?"float":void 0}function Ui(w){return Tt(w,S=>({color:S.optional.object({alpha:S.optional.boolean,type:S.optional.custom(Ja)}),expanded:S.optional.boolean,picker:S.optional.custom(en),readonly:S.optional.constant(!1)}))}function le(w){return w?.1:1}function an(w){var S;return(S=w.color)===null||S===void 0?void 0:S.type}class zi{constructor(S,A){this.type="float",this.mode=A,this.comps_=nn(S,A,this.type)}getComponents(S){return ii(rn(Ut(this.comps_),{mode:this.mode,type:this.type},{mode:S??this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){const S=this.getComponents("rgb");return{r:S[0],g:S[1],b:S[2],a:S[3]}}}const Qa={int:(w,S)=>new vt(w,S),float:(w,S)=>new zi(w,S)};function Xi(w,S,A){return Qa[A](w,S)}function $a(w){return w.type==="float"}function ja(w){return w.type==="int"}function ka(w){const S=w.getComponents(),A=ge(w.mode,"int");return new vt([Math.round(ct(S[0],0,1,0,A[0])),Math.round(ct(S[1],0,1,0,A[1])),Math.round(ct(S[2],0,1,0,A[2])),S[3]],w.mode)}function qa(w){const S=w.getComponents(),A=ge(w.mode,"int");return new zi([ct(S[0],0,A[0],0,1),ct(S[1],0,A[1],0,1),ct(S[2],0,A[2],0,1),S[3]],w.mode)}function wt(w,S){if(w.type===S)return w;if(ja(w)&&S==="float")return qa(w);if($a(w)&&S==="int")return ka(w);throw Ct.shouldNeverHappen()}function _a(w,S){return w.alpha===S.alpha&&w.mode===S.mode&&w.notation===S.notation&&w.type===S.type}function It(w,S){const A=w.match(/^(.+)%$/);return Math.min(A?parseFloat(A[1])*.01*S:parseFloat(w),S)}const to={deg:w=>w,grad:w=>w*360/400,rad:w=>w*360/(2*Math.PI),turn:w=>w*360};function on(w){const S=w.match(/^([0-9.]+?)(deg|grad|rad|turn)$/);if(!S)return parseFloat(w);const A=parseFloat(S[1]),b=S[2];return to[b](A)}function hn(w){const S=w.match(/^rgb\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!S)return null;const A=[It(S[1],255),It(S[2],255),It(S[3],255)];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])?null:A}function eo(w){const S=hn(w);return S?new vt(S,"rgb"):null}function ln(w){const S=w.match(/^rgba\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!S)return null;const A=[It(S[1],255),It(S[2],255),It(S[3],255),It(S[4],1)];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])||isNaN(A[3])?null:A}function io(w){const S=ln(w);return S?new vt(S,"rgb"):null}function un(w){const S=w.match(/^hsl\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!S)return null;const A=[on(S[1]),It(S[2],100),It(S[3],100)];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])?null:A}function so(w){const S=un(w);return S?new vt(S,"hsl"):null}function fn(w){const S=w.match(/^hsla\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!S)return null;const A=[on(S[1]),It(S[2],100),It(S[3],100),It(S[4],1)];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])||isNaN(A[3])?null:A}function no(w){const S=fn(w);return S?new vt(S,"hsl"):null}function dn(w){const S=w.match(/^#([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(S)return[parseInt(S[1]+S[1],16),parseInt(S[2]+S[2],16),parseInt(S[3]+S[3],16)];const A=w.match(/^(?:#|0x)([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);return A?[parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16)]:null}function ro(w){const S=dn(w);return S?new vt(S,"rgb"):null}function vn(w){const S=w.match(/^#?([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(S)return[parseInt(S[1]+S[1],16),parseInt(S[2]+S[2],16),parseInt(S[3]+S[3],16),ct(parseInt(S[4]+S[4],16),0,255,0,1)];const A=w.match(/^(?:#|0x)?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);return A?[parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16),ct(parseInt(A[4],16),0,255,0,1)]:null}function ao(w){const S=vn(w);return S?new vt(S,"rgb"):null}function cn(w){const S=w.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!S)return null;const A=[parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])?null:A}function ds(w){return S=>{const A=cn(S);return A?Xi(A,"rgb",w):null}}function pn(w){const S=w.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*a\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!S)return null;const A=[parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3]),parseFloat(S[4])];return isNaN(A[0])||isNaN(A[1])||isNaN(A[2])||isNaN(A[3])?null:A}function vs(w){return S=>{const A=pn(S);return A?Xi(A,"rgb",w):null}}const oo=[{parser:dn,result:{alpha:!1,mode:"rgb",notation:"hex"}},{parser:vn,result:{alpha:!0,mode:"rgb",notation:"hex"}},{parser:hn,result:{alpha:!1,mode:"rgb",notation:"func"}},{parser:ln,result:{alpha:!0,mode:"rgb",notation:"func"}},{parser:un,result:{alpha:!1,mode:"hsl",notation:"func"}},{parser:fn,result:{alpha:!0,mode:"hsl",notation:"func"}},{parser:cn,result:{alpha:!1,mode:"rgb",notation:"object"}},{parser:pn,result:{alpha:!0,mode:"rgb",notation:"object"}}];function ho(w){return oo.reduce((S,{parser:A,result:b})=>S||(A(w)?b:null),null)}function lo(w,S="int"){const A=ho(w);return A?A.notation==="hex"&&S!=="float"?Object.assign(Object.assign({},A),{type:"int"}):A.notation==="func"?Object.assign(Object.assign({},A),{type:S}):null:null}function Xe(w){const S=[ro,ao,eo,io,so,no];w==="int"&&S.push(ds("int"),vs("int")),w==="float"&&S.push(ds("float"),vs("float"));const A=Aa(S);return b=>{const W=A(b);return W?wt(W,w):null}}function uo(w){const S=Xe("int");if(typeof w!="string")return vt.black();const A=S(w);return A??vt.black()}function mn(w){const S=Pt(Math.floor(w),0,255).toString(16);return S.length===1?`0${S}`:S}function Yi(w,S="#"){const A=Ut(w.getComponents("rgb")).map(mn).join("");return`${S}${A}`}function Wi(w,S="#"){const A=w.getComponents("rgb"),b=[A[0],A[1],A[2],A[3]*255].map(mn).join("");return`${S}${b}`}function gn(w){const S=Ft(0),A=wt(w,"int");return`rgb(${Ut(A.getComponents("rgb")).map(W=>S(W)).join(", ")})`}function He(w){const S=Ft(2),A=Ft(0);return`rgba(${wt(w,"int").getComponents("rgb").map((J,p)=>(p===3?S:A)(J)).join(", ")})`}function fo(w){const S=[Ft(0),je,je],A=wt(w,"int");return`hsl(${Ut(A.getComponents("hsl")).map((W,J)=>S[J](W)).join(", ")})`}function vo(w){const S=[Ft(0),je,je,Ft(2)];return`hsla(${wt(w,"int").getComponents("hsl").map((W,J)=>S[J](W)).join(", ")})`}function xn(w,S){const A=Ft(S==="float"?2:0),b=["r","g","b"],W=wt(w,S);return`{${Ut(W.getComponents("rgb")).map((p,C)=>`${b[C]}: ${A(p)}`).join(", ")}}`}function co(w){return S=>xn(S,w)}function yn(w,S){const A=Ft(2),b=Ft(S==="float"?2:0),W=["r","g","b","a"];return`{${wt(w,S).getComponents("rgb").map((C,t)=>{const d=t===3?A:b;return`${W[t]}: ${d(C)}`}).join(", ")}}`}function po(w){return S=>yn(S,w)}const mo=[{format:{alpha:!1,mode:"rgb",notation:"hex",type:"int"},stringifier:Yi},{format:{alpha:!0,mode:"rgb",notation:"hex",type:"int"},stringifier:Wi},{format:{alpha:!1,mode:"rgb",notation:"func",type:"int"},stringifier:gn},{format:{alpha:!0,mode:"rgb",notation:"func",type:"int"},stringifier:He},{format:{alpha:!1,mode:"hsl",notation:"func",type:"int"},stringifier:fo},{format:{alpha:!0,mode:"hsl",notation:"func",type:"int"},stringifier:vo},...["int","float"].reduce((w,S)=>[...w,{format:{alpha:!1,mode:"rgb",notation:"object",type:S},stringifier:co(S)},{format:{alpha:!0,mode:"rgb",notation:"object",type:S},stringifier:po(S)}],[])];function Tn(w){return mo.reduce((S,A)=>S||(_a(A.format,w)?A.stringifier:null),null)}const Ae=dt("apl");class go{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),this.value=A.value,this.value.emitter.on("change",this.onValueChange_),this.element=S.createElement("div"),this.element.classList.add(Ae()),A.viewProps.bindClassModifiers(this.element),A.viewProps.bindTabIndex(this.element);const b=S.createElement("div");b.classList.add(Ae("b")),this.element.appendChild(b);const W=S.createElement("div");W.classList.add(Ae("c")),b.appendChild(W),this.colorElem_=W;const J=S.createElement("div");J.classList.add(Ae("m")),this.element.appendChild(J),this.markerElem_=J;const p=S.createElement("div");p.classList.add(Ae("p")),this.markerElem_.appendChild(p),this.previewElem_=p,this.update_()}update_(){const S=this.value.rawValue,A=S.getComponents("rgb"),b=new vt([A[0],A[1],A[2],0],"rgb"),W=new vt([A[0],A[1],A[2],255],"rgb"),J=["to right",He(b),He(W)];this.colorElem_.style.background=`linear-gradient(${J.join(",")})`,this.previewElem_.style.backgroundColor=He(S);const p=ct(A[3],0,1,0,100);this.markerElem_.style.left=`${p}%`}onValueChange_(){this.update_()}}class xo{constructor(S,A){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.view=new go(S,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new fe(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(S,A){if(!S.point)return;const b=S.point.x/S.bounds.width,W=this.value.rawValue,[J,p,C]=W.getComponents("hsv");this.value.setRawValue(new vt([J,p,C,b],"hsv"),A)}onPointerDown_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerMove_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerUp_(S){this.handlePointerEvent_(S.data,{forceEmit:!0,last:!0})}onKeyDown_(S){const A=Lt(le(!0),Kt(S));if(A===0)return;const b=this.value.rawValue,[W,J,p,C]=b.getComponents("hsv");this.value.setRawValue(new vt([W,J,p,C+A],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(S){Lt(le(!0),Kt(S))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const ve=dt("coltxt");function yo(w){const S=w.createElement("select"),A=[{text:"RGB",value:"rgb"},{text:"HSL",value:"hsl"},{text:"HSV",value:"hsv"},{text:"HEX",value:"hex"}];return S.appendChild(A.reduce((b,W)=>{const J=w.createElement("option");return J.textContent=W.text,J.value=W.value,b.appendChild(J),b},w.createDocumentFragment())),S}class To{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(ve()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(ve("m")),this.modeElem_=yo(S),this.modeElem_.classList.add(ve("ms")),b.appendChild(this.modeSelectElement),A.viewProps.bindDisabled(this.modeElem_);const W=S.createElement("div");W.classList.add(ve("mm")),W.appendChild(ti(S,"dropdown")),b.appendChild(W),this.element.appendChild(b);const J=S.createElement("div");J.classList.add(ve("w")),this.element.appendChild(J),this.inputsElem_=J,this.inputViews_=A.inputViews,this.applyInputViews_(),Wt(A.mode,p=>{this.modeElem_.value=p})}get modeSelectElement(){return this.modeElem_}get inputViews(){return this.inputViews_}set inputViews(S){this.inputViews_=S,this.applyInputViews_()}applyInputViews_(){Us(this.inputsElem_);const S=this.element.ownerDocument;this.inputViews_.forEach(A=>{const b=S.createElement("div");b.classList.add(ve("c")),b.appendChild(A.element),this.inputsElem_.appendChild(b)})}}function Co(w){return Ft(w==="float"?2:0)}function So(w,S,A){const b=ge(w,S)[A];return new be({min:0,max:b})}function Eo(w,S,A){return new Ue(w,{arrayPosition:A===0?"fst":A===2?"lst":"mid",parser:S.parser,props:ut.fromObject({formatter:Co(S.colorType),keyScale:le(!1),pointerScale:S.colorType==="float"?.01:1}),value:yt(0,{constraint:So(S.colorMode,S.colorType,A)}),viewProps:S.viewProps})}function Po(w,S){const A={colorMode:S.colorMode,colorType:S.colorType,parser:Ht,viewProps:S.viewProps};return[0,1,2].map(b=>{const W=Eo(w,A,b);return Ce({primary:S.value,secondary:W.value,forward(J){return wt(J,S.colorType).getComponents(S.colorMode)[b]},backward(J,p){const C=S.colorMode,d=wt(J,S.colorType).getComponents(C);d[b]=p;const c=Xi(ii(Ut(d),d[3]),C,S.colorType);return wt(c,"int")}}),W})}function Ao(w,S){const A=new Fe(w,{parser:Xe("int"),props:ut.fromObject({formatter:Yi}),value:yt(vt.black()),viewProps:S.viewProps});return Ce({primary:S.value,secondary:A.value,forward:b=>new vt(Ut(b.getComponents()),b.mode),backward:(b,W)=>new vt(ii(Ut(W.getComponents(b.mode)),b.getComponents()[3]),b.mode)}),[A]}function Mo(w){return w!=="hex"}class wo{constructor(S,A){this.onModeSelectChange_=this.onModeSelectChange_.bind(this),this.colorType_=A.colorType,this.value=A.value,this.viewProps=A.viewProps,this.colorMode=yt(this.value.rawValue.mode),this.ccs_=this.createComponentControllers_(S),this.view=new To(S,{mode:this.colorMode,inputViews:[this.ccs_[0].view,this.ccs_[1].view,this.ccs_[2].view],viewProps:this.viewProps}),this.view.modeSelectElement.addEventListener("change",this.onModeSelectChange_)}createComponentControllers_(S){const A=this.colorMode.rawValue;return Mo(A)?Po(S,{colorMode:A,colorType:this.colorType_,value:this.value,viewProps:this.viewProps}):Ao(S,{value:this.value,viewProps:this.viewProps})}onModeSelectChange_(S){const A=S.currentTarget;this.colorMode.rawValue=A.value,this.ccs_=this.createComponentControllers_(this.view.element.ownerDocument),this.view.inputViews=this.ccs_.map(b=>b.view)}}const li=dt("hpl");class Ro{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),this.value=A.value,this.value.emitter.on("change",this.onValueChange_),this.element=S.createElement("div"),this.element.classList.add(li()),A.viewProps.bindClassModifiers(this.element),A.viewProps.bindTabIndex(this.element);const b=S.createElement("div");b.classList.add(li("c")),this.element.appendChild(b);const W=S.createElement("div");W.classList.add(li("m")),this.element.appendChild(W),this.markerElem_=W,this.update_()}update_(){const S=this.value.rawValue,[A]=S.getComponents("hsv");this.markerElem_.style.backgroundColor=gn(new vt([A,100,100],"hsv"));const b=ct(A,0,360,0,100);this.markerElem_.style.left=`${b}%`}onValueChange_(){this.update_()}}class Lo{constructor(S,A){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.view=new Ro(S,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new fe(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(S,A){if(!S.point)return;const b=ct(Pt(S.point.x,0,S.bounds.width),0,S.bounds.width,0,360),W=this.value.rawValue,[,J,p,C]=W.getComponents("hsv");this.value.setRawValue(new vt([b,J,p,C],"hsv"),A)}onPointerDown_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerMove_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerUp_(S){this.handlePointerEvent_(S.data,{forceEmit:!0,last:!0})}onKeyDown_(S){const A=Lt(le(!1),Kt(S));if(A===0)return;const b=this.value.rawValue,[W,J,p,C]=b.getComponents("hsv");this.value.setRawValue(new vt([W+A,J,p,C],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(S){Lt(le(!1),Kt(S))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const ui=dt("svp"),cs=64;class Fo{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),this.value=A.value,this.value.emitter.on("change",this.onValueChange_),this.element=S.createElement("div"),this.element.classList.add(ui()),A.viewProps.bindClassModifiers(this.element),A.viewProps.bindTabIndex(this.element);const b=S.createElement("canvas");b.height=cs,b.width=cs,b.classList.add(ui("c")),this.element.appendChild(b),this.canvasElement=b;const W=S.createElement("div");W.classList.add(ui("m")),this.element.appendChild(W),this.markerElem_=W,this.update_()}update_(){const S=Fr(this.canvasElement);if(!S)return;const b=this.value.rawValue.getComponents("hsv"),W=this.canvasElement.width,J=this.canvasElement.height,p=S.getImageData(0,0,W,J),C=p.data;for(let c=0;cb.getComponents()[3],backward:(b,W)=>{const J=b.getComponents();return J[3]=W,new vt(J,b.mode)}}),this.textsC_=new wo(S,{colorType:A.colorType,value:this.value,viewProps:this.viewProps}),this.view=new Za(S,{alphaViews:this.alphaIcs_?{palette:this.alphaIcs_.palette.view,text:this.alphaIcs_.text.view}:null,hPaletteView:this.hPaletteC_.view,supportsAlpha:A.supportsAlpha,svPaletteView:this.svPaletteC_.view,textsView:this.textsC_.view,viewProps:this.viewProps})}get textsController(){return this.textsC_}}const fi=dt("colsw");class bo{constructor(S,A){this.onValueChange_=this.onValueChange_.bind(this),A.value.emitter.on("change",this.onValueChange_),this.value=A.value,this.element=S.createElement("div"),this.element.classList.add(fi()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(fi("sw")),this.element.appendChild(b),this.swatchElem_=b;const W=S.createElement("button");W.classList.add(fi("b")),A.viewProps.bindDisabled(W),this.element.appendChild(W),this.buttonElement=W,this.update_()}update_(){const S=this.value.rawValue;this.swatchElem_.style.backgroundColor=Wi(S)}onValueChange_(){this.update_()}}class Bo{constructor(S,A){this.value=A.value,this.viewProps=A.viewProps,this.view=new bo(S,{value:this.value,viewProps:this.viewProps})}}class Hi{constructor(S,A){this.onButtonBlur_=this.onButtonBlur_.bind(this),this.onButtonClick_=this.onButtonClick_.bind(this),this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.foldable_=Ie.create(A.expanded),this.swatchC_=new Bo(S,{value:this.value,viewProps:this.viewProps});const b=this.swatchC_.view.buttonElement;b.addEventListener("blur",this.onButtonBlur_),b.addEventListener("click",this.onButtonClick_),this.textC_=new Fe(S,{parser:A.parser,props:ut.fromObject({formatter:A.formatter}),value:this.value,viewProps:this.viewProps}),this.view=new Va(S,{foldable:this.foldable_,pickerLayout:A.pickerLayout}),this.view.swatchElement.appendChild(this.swatchC_.view.element),this.view.textElement.appendChild(this.textC_.view.element),this.popC_=A.pickerLayout==="popup"?new $s(S,{viewProps:this.viewProps}):null;const W=new Do(S,{colorType:A.colorType,supportsAlpha:A.supportsAlpha,value:this.value,viewProps:this.viewProps});W.view.allFocusableElements.forEach(J=>{J.addEventListener("blur",this.onPopupChildBlur_),J.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=W,this.popC_?(this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(W.view.element),Ce({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:J=>J,backward:(J,p)=>p})):this.view.pickerElement&&(this.view.pickerElement.appendChild(this.pickerC_.view.element),Ii(this.foldable_,this.view.pickerElement))}get textController(){return this.textC_}onButtonBlur_(S){if(!this.popC_)return;const A=this.view.element,b=S.relatedTarget;(!b||!A.contains(b))&&(this.popC_.shows.rawValue=!1)}onButtonClick_(){this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded")&&this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(S){if(!this.popC_)return;const A=this.popC_.view.element,b=zs(S);b&&A.contains(b)||b&&b===this.swatchC_.view.buttonElement&&!Li(A.ownerDocument)||(this.popC_.shows.rawValue=!1)}onPopupChildKeydown_(S){this.popC_?S.key==="Escape"&&(this.popC_.shows.rawValue=!1):this.view.pickerElement&&S.key==="Escape"&&this.swatchC_.view.buttonElement.focus()}}function Io(w){return Ut(w.getComponents("rgb")).reduce((S,A)=>S<<8|Math.floor(A)&255,0)}function Go(w){return w.getComponents("rgb").reduce((S,A,b)=>{const W=Math.floor(b===3?A*255:A)&255;return S<<8|W},0)>>>0}function No(w){return new vt([w>>16&255,w>>8&255,w&255],"rgb")}function Vo(w){return new vt([w>>24&255,w>>16&255,w>>8&255,ct(w&255,0,255,0,1)],"rgb")}function Uo(w){return typeof w!="number"?vt.black():No(w)}function zo(w){return typeof w!="number"?vt.black():Vo(w)}function Ke(w,S){return typeof w!="object"||gt(w)?!1:S in w&&typeof w[S]=="number"}function Cn(w){return Ke(w,"r")&&Ke(w,"g")&&Ke(w,"b")}function Sn(w){return Cn(w)&&Ke(w,"a")}function En(w){return Cn(w)}function Ki(w,S){if(w.mode!==S.mode||w.type!==S.type)return!1;const A=w.getComponents(),b=S.getComponents();for(let W=0;W{ze(A,S(b))}:null}function Yo(w){const S=w?Go:Io;return(A,b)=>{ze(A,S(b))}}function Wo(w,S,A){const W=wt(S,A).toRgbaObject();w.writeProperty("r",W.r),w.writeProperty("g",W.g),w.writeProperty("b",W.b),w.writeProperty("a",W.a)}function Ho(w,S,A){const W=wt(S,A).toRgbaObject();w.writeProperty("r",W.r),w.writeProperty("g",W.g),w.writeProperty("b",W.b)}function Ko(w,S){return(A,b)=>{w?Wo(A,b,S):Ho(A,b,S)}}function Zo(w){var S;return!!(!((S=w==null?void 0:w.color)===null||S===void 0)&&S.alpha)}function Jo(w){return w?S=>Wi(S,"0x"):S=>Yi(S,"0x")}function Qo(w){return"color"in w||w.view==="color"}const $o=Rt({id:"input-color-number",type:"input",accept:(w,S)=>{if(typeof w!="number"||!Qo(S))return null;const A=Ui(S);return A?{initialValue:w,params:Object.assign(Object.assign({},A),{supportsAlpha:Zo(S)})}:null},binding:{reader:w=>w.params.supportsAlpha?zo:Uo,equals:Ki,writer:w=>Yo(w.params.supportsAlpha)},controller:w=>{var S,A;return new Hi(w.document,{colorType:"int",expanded:(S=w.params.expanded)!==null&&S!==void 0?S:!1,formatter:Jo(w.params.supportsAlpha),parser:Xe("int"),pickerLayout:(A=w.params.picker)!==null&&A!==void 0?A:"popup",supportsAlpha:w.params.supportsAlpha,value:w.value,viewProps:w.viewProps})}});function jo(w,S){if(!En(w))return wt(vt.black(),S);if(S==="int"){const A=ps(w);return new vt(A,"rgb")}if(S==="float"){const A=ps(w);return new zi(A,"rgb")}return wt(vt.black(),"int")}function ko(w){return Sn(w)}function qo(w){return S=>{const A=jo(S,w);return wt(A,"int")}}function _o(w,S){return A=>w?yn(A,S):xn(A,S)}const th=Rt({id:"input-color-object",type:"input",accept:(w,S)=>{var A;if(!En(w))return null;const b=Ui(S);return b?{initialValue:w,params:Object.assign(Object.assign({},b),{colorType:(A=an(S))!==null&&A!==void 0?A:"int"})}:null},binding:{reader:w=>qo(w.params.colorType),equals:Ki,writer:w=>Ko(ko(w.initialValue),w.params.colorType)},controller:w=>{var S,A;const b=Sn(w.initialValue);return new Hi(w.document,{colorType:w.params.colorType,expanded:(S=w.params.expanded)!==null&&S!==void 0?S:!1,formatter:_o(b,w.params.colorType),parser:Xe("int"),pickerLayout:(A=w.params.picker)!==null&&A!==void 0?A:"popup",supportsAlpha:b,value:w.value,viewProps:w.viewProps})}}),eh=Rt({id:"input-color-string",type:"input",accept:(w,S)=>{if(typeof w!="string"||S.view==="text")return null;const A=lo(w,an(S));if(!A)return null;const b=Tn(A);if(!b)return null;const W=Ui(S);return W?{initialValue:w,params:Object.assign(Object.assign({},W),{format:A,stringifier:b})}:null},binding:{reader:()=>uo,equals:Ki,writer:w=>{const S=Xo(w.params.format);if(!S)throw Ct.notBindable();return S}},controller:w=>{var S,A;return new Hi(w.document,{colorType:w.params.format.type,expanded:(S=w.params.expanded)!==null&&S!==void 0?S:!1,formatter:w.params.stringifier,parser:Xe("int"),pickerLayout:(A=w.params.picker)!==null&&A!==void 0?A:"popup",supportsAlpha:w.params.format.alpha,value:w.value,viewProps:w.viewProps})}});class Zi{constructor(S){this.components=S.components,this.asm_=S.assembly}constrain(S){const A=this.asm_.toComponents(S).map((b,W)=>{var J,p;return(p=(J=this.components[W])===null||J===void 0?void 0:J.constrain(b))!==null&&p!==void 0?p:b});return this.asm_.fromComponents(A)}}const ms=dt("pndtxt");class ih{constructor(S,A){this.textViews=A.textViews,this.element=S.createElement("div"),this.element.classList.add(ms()),this.textViews.forEach(b=>{const W=S.createElement("div");W.classList.add(ms("a")),W.appendChild(b.element),this.element.appendChild(W)})}}function sh(w,S,A){return new Ue(w,{arrayPosition:A===0?"fst":A===S.axes.length-1?"lst":"mid",parser:S.parser,props:S.axes[A].textProps,value:yt(0,{constraint:S.axes[A].constraint}),viewProps:S.viewProps})}class Ji{constructor(S,A){this.value=A.value,this.viewProps=A.viewProps,this.acs_=A.axes.map((b,W)=>sh(S,A,W)),this.acs_.forEach((b,W)=>{Ce({primary:this.value,secondary:b.value,forward:J=>A.assembly.toComponents(J)[W],backward:(J,p)=>{const C=A.assembly.toComponents(J);return C[W]=p,A.assembly.fromComponents(C)}})}),this.view=new ih(S,{textViews:this.acs_.map(b=>b.view)})}get textControllers(){return this.acs_}}class nh extends Le{get max(){return this.controller.valueController.sliderController.props.get("max")}set max(S){this.controller.valueController.sliderController.props.set("max",S)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(S){this.controller.valueController.sliderController.props.set("min",S)}}function rh(w,S){const A=[],b=bs(w,S);b&&A.push(b);const W=Bs(w);W&&A.push(W);const J=Vi(w.options);return J&&A.push(J),new Ge(A)}const ah=Rt({id:"input-number",type:"input",accept:(w,S)=>{if(typeof w!="number")return null;const A=Tt(S,b=>Object.assign(Object.assign({},Gs(b)),{options:b.optional.custom(Ve),readonly:b.optional.constant(!1)}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>Ls,constraint:w=>rh(w.params,w.initialValue),writer:w=>ze},controller:w=>{const S=w.value,A=w.constraint,b=A&&$e(A,Ne);if(b)return new _t(w.document,{props:new ut({options:b.values.value("options")}),value:S,viewProps:w.viewProps});const W=Is(w.params,S.rawValue),J=A&&$e(A,be);return J?new ke(w.document,Object.assign(Object.assign({},_s(Object.assign(Object.assign({},W),{keyScale:yt(W.keyScale),max:J.values.value("max"),min:J.values.value("min")}))),{parser:Ht,value:S,viewProps:w.viewProps})):new Ue(w.document,{parser:Ht,props:ut.fromObject(W),value:S,viewProps:w.viewProps})},api(w){return typeof w.controller.value.rawValue!="number"?null:w.controller.valueController instanceof ke?new nh(w.controller):w.controller.valueController instanceof _t?new Gi(w.controller):null}});class qt{constructor(S=0,A=0){this.x=S,this.y=A}getComponents(){return[this.x,this.y]}static isObject(S){if(gt(S))return!1;const A=S.x,b=S.y;return!(typeof A!="number"||typeof b!="number")}static equals(S,A){return S.x===A.x&&S.y===A.y}toObject(){return{x:this.x,y:this.y}}}const Pn={toComponents:w=>w.getComponents(),fromComponents:w=>new qt(...w)},ce=dt("p2d");class oh{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(ce()),A.viewProps.bindClassModifiers(this.element),Wt(A.expanded,xe(this.element,ce(void 0,"expanded")));const b=S.createElement("div");b.classList.add(ce("h")),this.element.appendChild(b);const W=S.createElement("button");W.classList.add(ce("b")),W.appendChild(ti(S,"p2dpad")),A.viewProps.bindDisabled(W),b.appendChild(W),this.buttonElement=W;const J=S.createElement("div");if(J.classList.add(ce("t")),b.appendChild(J),this.textElement=J,A.pickerLayout==="inline"){const p=S.createElement("div");p.classList.add(ce("p")),this.element.appendChild(p),this.pickerElement=p}else this.pickerElement=null}}const Qt=dt("p2dp");class hh{constructor(S,A){this.onFoldableChange_=this.onFoldableChange_.bind(this),this.onPropsChange_=this.onPropsChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.props_=A.props,this.props_.emitter.on("change",this.onPropsChange_),this.element=S.createElement("div"),this.element.classList.add(Qt()),A.layout==="popup"&&this.element.classList.add(Qt(void 0,"p")),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("div");b.classList.add(Qt("p")),A.viewProps.bindTabIndex(b),this.element.appendChild(b),this.padElement=b;const W=S.createElementNS(Nt,"svg");W.classList.add(Qt("g")),this.padElement.appendChild(W),this.svgElem_=W;const J=S.createElementNS(Nt,"line");J.classList.add(Qt("ax")),J.setAttributeNS(null,"x1","0"),J.setAttributeNS(null,"y1","50%"),J.setAttributeNS(null,"x2","100%"),J.setAttributeNS(null,"y2","50%"),this.svgElem_.appendChild(J);const p=S.createElementNS(Nt,"line");p.classList.add(Qt("ax")),p.setAttributeNS(null,"x1","50%"),p.setAttributeNS(null,"y1","0"),p.setAttributeNS(null,"x2","50%"),p.setAttributeNS(null,"y2","100%"),this.svgElem_.appendChild(p);const C=S.createElementNS(Nt,"line");C.classList.add(Qt("l")),C.setAttributeNS(null,"x1","50%"),C.setAttributeNS(null,"y1","50%"),this.svgElem_.appendChild(C),this.lineElem_=C;const t=S.createElement("div");t.classList.add(Qt("m")),this.padElement.appendChild(t),this.markerElem_=t,A.value.emitter.on("change",this.onValueChange_),this.value=A.value,this.update_()}get allFocusableElements(){return[this.padElement]}update_(){const[S,A]=this.value.rawValue.getComponents(),b=this.props_.get("max"),W=ct(S,-b,+b,0,100),J=ct(A,-b,+b,0,100),p=this.props_.get("invertsY")?100-J:J;this.lineElem_.setAttributeNS(null,"x2",`${W}%`),this.lineElem_.setAttributeNS(null,"y2",`${p}%`),this.markerElem_.style.left=`${W}%`,this.markerElem_.style.top=`${p}%`}onValueChange_(){this.update_()}onPropsChange_(){this.update_()}onFoldableChange_(){this.update_()}}function gs(w,S,A){return[Lt(S[0],Kt(w)),Lt(S[1],Oe(w))*(A?1:-1)]}class lh{constructor(S,A){this.onPadKeyDown_=this.onPadKeyDown_.bind(this),this.onPadKeyUp_=this.onPadKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.props=A.props,this.value=A.value,this.viewProps=A.viewProps,this.view=new hh(S,{layout:A.layout,props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new fe(this.view.padElement),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.padElement.addEventListener("keydown",this.onPadKeyDown_),this.view.padElement.addEventListener("keyup",this.onPadKeyUp_)}handlePointerEvent_(S,A){if(!S.point)return;const b=this.props.get("max"),W=ct(S.point.x,0,S.bounds.width,-b,+b),J=ct(this.props.get("invertsY")?S.bounds.height-S.point.y:S.point.y,0,S.bounds.height,-b,+b);this.value.setRawValue(new qt(W,J),A)}onPointerDown_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerMove_(S){this.handlePointerEvent_(S.data,{forceEmit:!1,last:!1})}onPointerUp_(S){this.handlePointerEvent_(S.data,{forceEmit:!0,last:!0})}onPadKeyDown_(S){qs(S.key)&&S.preventDefault();const[A,b]=gs(S,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));A===0&&b===0||this.value.setRawValue(new qt(this.value.rawValue.x+A,this.value.rawValue.y+b),{forceEmit:!1,last:!1})}onPadKeyUp_(S){const[A,b]=gs(S,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));A===0&&b===0||this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}class uh{constructor(S,A){var b,W;this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.onPadButtonBlur_=this.onPadButtonBlur_.bind(this),this.onPadButtonClick_=this.onPadButtonClick_.bind(this),this.value=A.value,this.viewProps=A.viewProps,this.foldable_=Ie.create(A.expanded),this.popC_=A.pickerLayout==="popup"?new $s(S,{viewProps:this.viewProps}):null;const J=new lh(S,{layout:A.pickerLayout,props:new ut({invertsY:yt(A.invertsY),max:yt(A.max),xKeyScale:A.axes[0].textProps.value("keyScale"),yKeyScale:A.axes[1].textProps.value("keyScale")}),value:this.value,viewProps:this.viewProps});J.view.allFocusableElements.forEach(p=>{p.addEventListener("blur",this.onPopupChildBlur_),p.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=J,this.textC_=new Ji(S,{assembly:Pn,axes:A.axes,parser:A.parser,value:this.value,viewProps:this.viewProps}),this.view=new oh(S,{expanded:this.foldable_.value("expanded"),pickerLayout:A.pickerLayout,viewProps:this.viewProps}),this.view.textElement.appendChild(this.textC_.view.element),(b=this.view.buttonElement)===null||b===void 0||b.addEventListener("blur",this.onPadButtonBlur_),(W=this.view.buttonElement)===null||W===void 0||W.addEventListener("click",this.onPadButtonClick_),this.popC_?(this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(this.pickerC_.view.element),Ce({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:p=>p,backward:(p,C)=>C})):this.view.pickerElement&&(this.view.pickerElement.appendChild(this.pickerC_.view.element),Ii(this.foldable_,this.view.pickerElement))}get textController(){return this.textC_}onPadButtonBlur_(S){if(!this.popC_)return;const A=this.view.element,b=S.relatedTarget;(!b||!A.contains(b))&&(this.popC_.shows.rawValue=!1)}onPadButtonClick_(){this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded")&&this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(S){if(!this.popC_)return;const A=this.popC_.view.element,b=zs(S);b&&A.contains(b)||b&&b===this.view.buttonElement&&!Li(A.ownerDocument)||(this.popC_.shows.rawValue=!1)}onPopupChildKeydown_(S){this.popC_?S.key==="Escape"&&(this.popC_.shows.rawValue=!1):this.view.pickerElement&&S.key==="Escape"&&this.view.buttonElement.focus()}}function fh(w){return qt.isObject(w)?new qt(w.x,w.y):new qt}function dh(w,S){w.writeProperty("x",S.x),w.writeProperty("y",S.y)}function vh(w,S){return new Zi({assembly:Pn,components:[Yt(Object.assign(Object.assign({},w),w.x),S.x),Yt(Object.assign(Object.assign({},w),w.y),S.y)]})}function xs(w,S){var A,b;if(!gt(w.min)||!gt(w.max))return Math.max(Math.abs((A=w.min)!==null&&A!==void 0?A:0),Math.abs((b=w.max)!==null&&b!==void 0?b:0));const W=Os(w);return Math.max(Math.abs(W)*10,Math.abs(S)*10)}function ch(w,S){var A,b;const W=xs(oe(w,(A=w.x)!==null&&A!==void 0?A:{}),S.x),J=xs(oe(w,(b=w.y)!==null&&b!==void 0?b:{}),S.y);return Math.max(W,J)}function ph(w){if(!("y"in w))return!1;const S=w.y;return S&&"inverted"in S?!!S.inverted:!1}const mh=Rt({id:"input-point2d",type:"input",accept:(w,S)=>{if(!qt.isObject(w))return null;const A=Tt(S,b=>Object.assign(Object.assign({},De(b)),{expanded:b.optional.boolean,picker:b.optional.custom(en),readonly:b.optional.constant(!1),x:b.optional.custom(kt),y:b.optional.object(Object.assign(Object.assign({},De(b)),{inverted:b.optional.boolean}))}));return A?{initialValue:w,params:A}:null},binding:{reader:()=>fh,constraint:w=>vh(w.params,w.initialValue),equals:qt.equals,writer:()=>dh},controller:w=>{var S,A;const b=w.document,W=w.value,J=w.constraint,p=[w.params.x,w.params.y];return new uh(b,{axes:W.rawValue.getComponents().map((C,t)=>{var d;return Ri({constraint:J.components[t],initialValue:C,params:oe(w.params,(d=p[t])!==null&&d!==void 0?d:{})})}),expanded:(S=w.params.expanded)!==null&&S!==void 0?S:!1,invertsY:ph(w.params),max:ch(w.params,W.rawValue),parser:Ht,pickerLayout:(A=w.params.picker)!==null&&A!==void 0?A:"popup",value:W,viewProps:w.viewProps})}});class pe{constructor(S=0,A=0,b=0){this.x=S,this.y=A,this.z=b}getComponents(){return[this.x,this.y,this.z]}static isObject(S){if(gt(S))return!1;const A=S.x,b=S.y,W=S.z;return!(typeof A!="number"||typeof b!="number"||typeof W!="number")}static equals(S,A){return S.x===A.x&&S.y===A.y&&S.z===A.z}toObject(){return{x:this.x,y:this.y,z:this.z}}}const An={toComponents:w=>w.getComponents(),fromComponents:w=>new pe(...w)};function gh(w){return pe.isObject(w)?new pe(w.x,w.y,w.z):new pe}function xh(w,S){w.writeProperty("x",S.x),w.writeProperty("y",S.y),w.writeProperty("z",S.z)}function yh(w,S){return new Zi({assembly:An,components:[Yt(Object.assign(Object.assign({},w),w.x),S.x),Yt(Object.assign(Object.assign({},w),w.y),S.y),Yt(Object.assign(Object.assign({},w),w.z),S.z)]})}const Th=Rt({id:"input-point3d",type:"input",accept:(w,S)=>{if(!pe.isObject(w))return null;const A=Tt(S,b=>Object.assign(Object.assign({},De(b)),{readonly:b.optional.constant(!1),x:b.optional.custom(kt),y:b.optional.custom(kt),z:b.optional.custom(kt)}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>gh,constraint:w=>yh(w.params,w.initialValue),equals:pe.equals,writer:w=>xh},controller:w=>{const S=w.value,A=w.constraint,b=[w.params.x,w.params.y,w.params.z];return new Ji(w.document,{assembly:An,axes:S.rawValue.getComponents().map((W,J)=>{var p;return Ri({constraint:A.components[J],initialValue:W,params:oe(w.params,(p=b[J])!==null&&p!==void 0?p:{})})}),parser:Ht,value:S,viewProps:w.viewProps})}});class me{constructor(S=0,A=0,b=0,W=0){this.x=S,this.y=A,this.z=b,this.w=W}getComponents(){return[this.x,this.y,this.z,this.w]}static isObject(S){if(gt(S))return!1;const A=S.x,b=S.y,W=S.z,J=S.w;return!(typeof A!="number"||typeof b!="number"||typeof W!="number"||typeof J!="number")}static equals(S,A){return S.x===A.x&&S.y===A.y&&S.z===A.z&&S.w===A.w}toObject(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Mn={toComponents:w=>w.getComponents(),fromComponents:w=>new me(...w)};function Ch(w){return me.isObject(w)?new me(w.x,w.y,w.z,w.w):new me}function Sh(w,S){w.writeProperty("x",S.x),w.writeProperty("y",S.y),w.writeProperty("z",S.z),w.writeProperty("w",S.w)}function Eh(w,S){return new Zi({assembly:Mn,components:[Yt(Object.assign(Object.assign({},w),w.x),S.x),Yt(Object.assign(Object.assign({},w),w.y),S.y),Yt(Object.assign(Object.assign({},w),w.z),S.z),Yt(Object.assign(Object.assign({},w),w.w),S.w)]})}const Ph=Rt({id:"input-point4d",type:"input",accept:(w,S)=>{if(!me.isObject(w))return null;const A=Tt(S,b=>Object.assign(Object.assign({},De(b)),{readonly:b.optional.constant(!1),w:b.optional.custom(kt),x:b.optional.custom(kt),y:b.optional.custom(kt),z:b.optional.custom(kt)}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>Ch,constraint:w=>Eh(w.params,w.initialValue),equals:me.equals,writer:w=>Sh},controller:w=>{const S=w.value,A=w.constraint,b=[w.params.x,w.params.y,w.params.z,w.params.w];return new Ji(w.document,{assembly:Mn,axes:S.rawValue.getComponents().map((W,J)=>{var p;return Ri({constraint:A.components[J],initialValue:W,params:oe(w.params,(p=b[J])!==null&&p!==void 0?p:{})})}),parser:Ht,value:S,viewProps:w.viewProps})}});function Ah(w){const S=[],A=Vi(w.options);return A&&S.push(A),new Ge(S)}const Mh=Rt({id:"input-string",type:"input",accept:(w,S)=>{if(typeof w!="string")return null;const A=Tt(S,b=>({readonly:b.optional.constant(!1),options:b.optional.custom(Ve)}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>ks,constraint:w=>Ah(w.params),writer:w=>ze},controller:w=>{const S=w.document,A=w.value,b=w.constraint,W=b&&$e(b,Ne);return W?new _t(S,{props:new ut({options:W.values.value("options")}),value:A,viewProps:w.viewProps}):new Fe(S,{parser:J=>J,props:ut.fromObject({formatter:gi}),value:A,viewProps:w.viewProps})},api(w){return typeof w.controller.value.rawValue!="string"?null:w.controller.valueController instanceof _t?new Gi(w.controller):null}}),Ye={monitor:{defaultInterval:200,defaultRows:3}},ys=dt("mll");class wh{constructor(S,A){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=A.formatter,this.element=S.createElement("div"),this.element.classList.add(ys()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("textarea");b.classList.add(ys("i")),b.style.height=`calc(var(${tn("containerUnitSize")}) * ${A.rows})`,b.readOnly=!0,A.viewProps.bindDisabled(b),this.element.appendChild(b),this.textareaElem_=b,A.value.emitter.on("change",this.onValueUpdate_),this.value=A.value,this.update_()}update_(){const S=this.textareaElem_,A=S.scrollTop===S.scrollHeight-S.clientHeight,b=[];this.value.rawValue.forEach(W=>{W!==void 0&&b.push(this.formatter_(W))}),S.textContent=b.join(` +`),A&&(S.scrollTop=S.scrollHeight)}onValueUpdate_(){this.update_()}}class Qi{constructor(S,A){this.value=A.value,this.viewProps=A.viewProps,this.view=new wh(S,{formatter:A.formatter,rows:A.rows,value:this.value,viewProps:this.viewProps})}}const Ts=dt("sgl");class Rh{constructor(S,A){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=A.formatter,this.element=S.createElement("div"),this.element.classList.add(Ts()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("input");b.classList.add(Ts("i")),b.readOnly=!0,b.type="text",A.viewProps.bindDisabled(b),this.element.appendChild(b),this.inputElement=b,A.value.emitter.on("change",this.onValueUpdate_),this.value=A.value,this.update_()}update_(){const S=this.value.rawValue,A=S[S.length-1];this.inputElement.value=A!==void 0?this.formatter_(A):""}onValueUpdate_(){this.update_()}}class $i{constructor(S,A){this.value=A.value,this.viewProps=A.viewProps,this.view=new Rh(S,{formatter:A.formatter,value:this.value,viewProps:this.viewProps})}}const Lh=Rt({id:"monitor-bool",type:"monitor",accept:(w,S)=>{if(typeof w!="boolean")return null;const A=Tt(S,b=>({readonly:b.required.constant(!0),rows:b.optional.number}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>js},controller:w=>{var S;return w.value.rawValue.length===1?new $i(w.document,{formatter:us,value:w.value,viewProps:w.viewProps}):new Qi(w.document,{formatter:us,rows:(S=w.params.rows)!==null&&S!==void 0?S:Ye.monitor.defaultRows,value:w.value,viewProps:w.viewProps})}});class Fh extends Le{get max(){return this.controller.valueController.props.get("max")}set max(S){this.controller.valueController.props.set("max",S)}get min(){return this.controller.valueController.props.get("min")}set min(S){this.controller.valueController.props.set("min",S)}}const $t=dt("grl");class Oh{constructor(S,A){this.onCursorChange_=this.onCursorChange_.bind(this),this.onValueUpdate_=this.onValueUpdate_.bind(this),this.element=S.createElement("div"),this.element.classList.add($t()),A.viewProps.bindClassModifiers(this.element),this.formatter_=A.formatter,this.props_=A.props,this.cursor_=A.cursor,this.cursor_.emitter.on("change",this.onCursorChange_);const b=S.createElementNS(Nt,"svg");b.classList.add($t("g")),b.style.height=`calc(var(${tn("containerUnitSize")}) * ${A.rows})`,this.element.appendChild(b),this.svgElem_=b;const W=S.createElementNS(Nt,"polyline");this.svgElem_.appendChild(W),this.lineElem_=W;const J=S.createElement("div");J.classList.add($t("t"),dt("tt")()),this.element.appendChild(J),this.tooltipElem_=J,A.value.emitter.on("change",this.onValueUpdate_),this.value=A.value,this.update_()}get graphElement(){return this.svgElem_}update_(){const{clientWidth:S,clientHeight:A}=this.element,b=this.value.rawValue.length-1,W=this.props_.get("min"),J=this.props_.get("max"),p=[];this.value.rawValue.forEach((a,r)=>{if(a===void 0)return;const n=ct(r,0,b,0,S),e=ct(a,W,J,A,0);p.push([n,e].join(","))}),this.lineElem_.setAttributeNS(null,"points",p.join(" "));const C=this.tooltipElem_,t=this.value.rawValue[this.cursor_.rawValue];if(t===void 0){C.classList.remove($t("t","a"));return}const d=ct(this.cursor_.rawValue,0,b,0,S),c=ct(t,W,J,A,0);C.style.left=`${d}px`,C.style.top=`${c}px`,C.textContent=`${this.formatter_(t)}`,C.classList.contains($t("t","a"))||(C.classList.add($t("t","a"),$t("t","in")),Qe(C),C.classList.remove($t("t","in")))}onValueUpdate_(){this.update_()}onCursorChange_(){this.update_()}}class wn{constructor(S,A){if(this.onGraphMouseMove_=this.onGraphMouseMove_.bind(this),this.onGraphMouseLeave_=this.onGraphMouseLeave_.bind(this),this.onGraphPointerDown_=this.onGraphPointerDown_.bind(this),this.onGraphPointerMove_=this.onGraphPointerMove_.bind(this),this.onGraphPointerUp_=this.onGraphPointerUp_.bind(this),this.props=A.props,this.value=A.value,this.viewProps=A.viewProps,this.cursor_=yt(-1),this.view=new Oh(S,{cursor:this.cursor_,formatter:A.formatter,rows:A.rows,props:this.props,value:this.value,viewProps:this.viewProps}),!Li(S))this.view.element.addEventListener("mousemove",this.onGraphMouseMove_),this.view.element.addEventListener("mouseleave",this.onGraphMouseLeave_);else{const b=new fe(this.view.element);b.emitter.on("down",this.onGraphPointerDown_),b.emitter.on("move",this.onGraphPointerMove_),b.emitter.on("up",this.onGraphPointerUp_)}}importProps(S){return Dt(S,null,A=>({max:A.required.number,min:A.required.number}),A=>(this.props.set("max",A.max),this.props.set("min",A.min),!0))}exportProps(){return bt(null,{max:this.props.get("max"),min:this.props.get("min")})}onGraphMouseLeave_(){this.cursor_.rawValue=-1}onGraphMouseMove_(S){const{clientWidth:A}=this.view.element;this.cursor_.rawValue=Math.floor(ct(S.offsetX,0,A,0,this.value.rawValue.length))}onGraphPointerDown_(S){this.onGraphPointerMove_(S)}onGraphPointerMove_(S){if(!S.data.point){this.cursor_.rawValue=-1;return}this.cursor_.rawValue=Math.floor(ct(S.data.point.x,0,S.data.bounds.width,0,this.value.rawValue.length))}onGraphPointerUp_(){this.cursor_.rawValue=-1}}function xi(w){return gt(w.format)?Ft(2):w.format}function Dh(w){var S;return w.value.rawValue.length===1?new $i(w.document,{formatter:xi(w.params),value:w.value,viewProps:w.viewProps}):new Qi(w.document,{formatter:xi(w.params),rows:(S=w.params.rows)!==null&&S!==void 0?S:Ye.monitor.defaultRows,value:w.value,viewProps:w.viewProps})}function bh(w){var S,A,b;return new wn(w.document,{formatter:xi(w.params),rows:(S=w.params.rows)!==null&&S!==void 0?S:Ye.monitor.defaultRows,props:ut.fromObject({max:(A=w.params.max)!==null&&A!==void 0?A:100,min:(b=w.params.min)!==null&&b!==void 0?b:0}),value:w.value,viewProps:w.viewProps})}function Cs(w){return w.view==="graph"}const Bh=Rt({id:"monitor-number",type:"monitor",accept:(w,S)=>{if(typeof w!="number")return null;const A=Tt(S,b=>({format:b.optional.function,max:b.optional.number,min:b.optional.number,readonly:b.required.constant(!0),rows:b.optional.number,view:b.optional.string}));return A?{initialValue:w,params:A}:null},binding:{defaultBufferSize:w=>Cs(w)?64:1,reader:w=>Ls},controller:w=>Cs(w.params)?bh(w):Dh(w),api:w=>w.controller.valueController instanceof wn?new Fh(w.controller):null}),Ih=Rt({id:"monitor-string",type:"monitor",accept:(w,S)=>{if(typeof w!="string")return null;const A=Tt(S,b=>({multiline:b.optional.boolean,readonly:b.required.constant(!0),rows:b.optional.number}));return A?{initialValue:w,params:A}:null},binding:{reader:w=>ks},controller:w=>{var S;const A=w.value;return A.rawValue.length>1||w.params.multiline?new Qi(w.document,{formatter:gi,rows:(S=w.params.rows)!==null&&S!==void 0?S:Ye.monitor.defaultRows,value:A,viewProps:w.viewProps}):new $i(w.document,{formatter:gi,value:A,viewProps:w.viewProps})}});class Gh{constructor(){this.map_=new Map}get(S){var A;return(A=this.map_.get(S))!==null&&A!==void 0?A:null}has(S){return this.map_.has(S)}add(S,A){return this.map_.set(S,A),S.viewProps.handleDispose(()=>{this.map_.delete(S)}),A}}class Nh{constructor(S){this.target=S.target,this.reader_=S.reader,this.writer_=S.writer}read(){return this.reader_(this.target.read())}write(S){this.writer_(this.target,S)}inject(S){this.write(this.reader_(S))}}function Vh(w,S){var A;const b=w.accept(S.target.read(),S.params);if(gt(b))return null;const W={target:S.target,initialValue:b.initialValue,params:b.params},J=Tt(S.params,a=>({disabled:a.optional.boolean,hidden:a.optional.boolean,label:a.optional.string,tag:a.optional.string})),p=w.binding.reader(W),C=w.binding.constraint?w.binding.constraint(W):void 0,t=new Nh({reader:p,target:S.target,writer:w.binding.writer(W)}),d=new Sr(yt(p(b.initialValue),{constraint:C,equals:w.binding.equals}),t),c=w.controller({constraint:C,document:S.document,initialValue:b.initialValue,params:b.params,value:d,viewProps:Zt.create({disabled:J==null?void 0:J.disabled,hidden:J==null?void 0:J.hidden})});return new Nr(S.document,{blade:Te(),props:ut.fromObject({label:"label"in S.params?(A=J==null?void 0:J.label)!==null&&A!==void 0?A:null:S.target.key}),tag:J==null?void 0:J.tag,value:d,valueController:c})}class Uh{constructor(S){this.target=S.target,this.reader_=S.reader}read(){return this.reader_(this.target.read())}}function zh(w,S){return S===0?new ya:new Ta(w,S??Ye.monitor.defaultInterval)}function Xh(w,S){var A,b,W;const J=w.accept(S.target.read(),S.params);if(gt(J))return null;const p={target:S.target,initialValue:J.initialValue,params:J.params},C=Tt(S.params,r=>({bufferSize:r.optional.number,disabled:r.optional.boolean,hidden:r.optional.boolean,interval:r.optional.number,label:r.optional.string})),t=w.binding.reader(p),d=(b=(A=C==null?void 0:C.bufferSize)!==null&&A!==void 0?A:w.binding.defaultBufferSize&&w.binding.defaultBufferSize(J.params))!==null&&b!==void 0?b:1,c=new Yr({binding:new Uh({reader:t,target:S.target}),bufferSize:d,ticker:zh(S.document,C==null?void 0:C.interval)}),a=w.controller({document:S.document,params:J.params,value:c,viewProps:Zt.create({disabled:C==null?void 0:C.disabled,hidden:C==null?void 0:C.hidden})});return a.viewProps.bindDisabled(c.ticker),a.viewProps.handleDispose(()=>{c.ticker.dispose()}),new Hr(S.document,{blade:Te(),props:ut.fromObject({label:"label"in S.params?(W=C==null?void 0:C.label)!==null&&W!==void 0?W:null:S.target.key}),value:c,valueController:a})}class Yh{constructor(S){this.pluginsMap_={blades:[],inputs:[],monitors:[]},this.apiCache_=S}getAll(){return[...this.pluginsMap_.blades,...this.pluginsMap_.inputs,...this.pluginsMap_.monitors]}register(S,A){if(!ba(A.core))throw Ct.notCompatible(S,A.id);A.type==="blade"?this.pluginsMap_.blades.unshift(A):A.type==="input"?this.pluginsMap_.inputs.unshift(A):A.type==="monitor"&&this.pluginsMap_.monitors.unshift(A)}createInput_(S,A,b){return this.pluginsMap_.inputs.reduce((W,J)=>W??Vh(J,{document:S,target:A,params:b}),null)}createMonitor_(S,A,b){return this.pluginsMap_.monitors.reduce((W,J)=>W??Xh(J,{document:S,params:b,target:A}),null)}createBinding(S,A,b){const W=A.read();if(gt(W))throw new Ct({context:{key:A.key},type:"nomatchingcontroller"});const J=this.createInput_(S,A,b);if(J)return J;const p=this.createMonitor_(S,A,b);if(p)return p;throw new Ct({context:{key:A.key},type:"nomatchingcontroller"})}createBlade(S,A){const b=this.pluginsMap_.blades.reduce((W,J)=>W??xa(J,{document:S,params:A}),null);if(!b)throw new Ct({type:"nomatchingview",context:{params:A}});return b}createInputBindingApi_(S){const A=this.pluginsMap_.inputs.reduce((b,W)=>{var J,p;return b||((p=(J=W.api)===null||J===void 0?void 0:J.call(W,{controller:S}))!==null&&p!==void 0?p:null)},null);return this.apiCache_.add(S,A??new Le(S))}createMonitorBindingApi_(S){const A=this.pluginsMap_.monitors.reduce((b,W)=>{var J,p;return b||((p=(J=W.api)===null||J===void 0?void 0:J.call(W,{controller:S}))!==null&&p!==void 0?p:null)},null);return this.apiCache_.add(S,A??new Le(S))}createBindingApi(S){if(this.apiCache_.has(S))return this.apiCache_.get(S);if(Vr(S))return this.createInputBindingApi_(S);if(Kr(S))return this.createMonitorBindingApi_(S);throw Ct.shouldNeverHappen()}createApi(S){if(this.apiCache_.has(S))return this.apiCache_.get(S);if(Gr(S))return this.createBindingApi(S);const A=this.pluginsMap_.blades.reduce((b,W)=>b??W.api({controller:S,pool:this}),null);if(!A)throw Ct.shouldNeverHappen();return this.apiCache_.add(S,A)}}const Wh=new Gh;function Hh(){const w=new Yh(Wh);return[mh,Th,Ph,Mh,ah,eh,th,$o,Na,Lh,Ih,Bh,jr,la,Qs].forEach(S=>{w.register("core",S)}),w}class Kh extends ue{constructor(S){super(S),this.emitter_=new Et,this.controller.value.emitter.on("change",A=>{this.emitter_.emit("change",new Be(this,A.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(S){this.controller.labelController.props.set("label",S)}get options(){return this.controller.valueController.props.get("options")}set options(S){this.controller.valueController.props.set("options",S)}get value(){return this.controller.value.rawValue}set value(S){this.controller.value.rawValue=S}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}}class Zh extends ue{}class Jh extends ue{constructor(S){super(S),this.emitter_=new Et,this.controller.value.emitter.on("change",A=>{this.emitter_.emit("change",new Be(this,A.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(S){this.controller.labelController.props.set("label",S)}get max(){return this.controller.valueController.sliderController.props.get("max")}set max(S){this.controller.valueController.sliderController.props.set("max",S)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(S){this.controller.valueController.sliderController.props.set("min",S)}get value(){return this.controller.value.rawValue}set value(S){this.controller.value.rawValue=S}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}}class Qh extends ue{constructor(S){super(S),this.emitter_=new Et,this.controller.value.emitter.on("change",A=>{this.emitter_.emit("change",new Be(this,A.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(S){this.controller.labelController.props.set("label",S)}get formatter(){return this.controller.valueController.props.get("formatter")}set formatter(S){this.controller.valueController.props.set("formatter",S)}get value(){return this.controller.value.rawValue}set value(S){this.controller.value.rawValue=S}on(S,A){const b=A.bind(this);return this.emitter_.on(S,W=>{b(W)},{key:A}),this}off(S,A){return this.emitter_.off(S,A),this}}const $h=function(){return{id:"list",type:"blade",core:ye,accept(w){const S=Tt(w,A=>({options:A.required.custom(Ve),value:A.required.raw,view:A.required.constant("list"),label:A.optional.string}));return S?{params:S}:null},controller(w){const S=new Ne(Ni(w.params.options)),A=yt(w.params.value,{constraint:S}),b=new _t(w.document,{props:new ut({options:S.values.value("options")}),value:A,viewProps:w.viewProps});return new he(w.document,{blade:w.blade,props:ut.fromObject({label:w.params.label}),value:A,valueController:b})},api(w){return!(w.controller instanceof he)||!(w.controller.valueController instanceof _t)?null:new Kh(w.controller)}}}();class jh extends Zs{constructor(S,A){super(S,A)}get element(){return this.controller.view.element}}class kh extends pi{constructor(S,A){super(S,{expanded:A.expanded,blade:A.blade,props:A.props,root:!0,viewProps:A.viewProps})}}const Ss=dt("spr");class qh{constructor(S,A){this.element=S.createElement("div"),this.element.classList.add(Ss()),A.viewProps.bindClassModifiers(this.element);const b=S.createElement("hr");b.classList.add(Ss("r")),this.element.appendChild(b)}}class Es extends ei{constructor(S,A){super(Object.assign(Object.assign({},A),{view:new qh(S,{viewProps:A.viewProps})}))}}const _h={id:"separator",type:"blade",core:ye,accept(w){const S=Tt(w,A=>({view:A.required.constant("separator")}));return S?{params:S}:null},controller(w){return new Es(w.document,{blade:w.blade,viewProps:w.viewProps})},api(w){return w.controller instanceof Es?new Zh(w.controller):null}},tl={id:"slider",type:"blade",core:ye,accept(w){const S=Tt(w,A=>({max:A.required.number,min:A.required.number,view:A.required.constant("slider"),format:A.optional.function,label:A.optional.string,value:A.optional.number}));return S?{params:S}:null},controller(w){var S,A;const b=(S=w.params.value)!==null&&S!==void 0?S:0,W=new be({max:w.params.max,min:w.params.min}),J=yt(b,{constraint:W}),p=new ke(w.document,Object.assign(Object.assign({},_s({formatter:(A=w.params.format)!==null&&A!==void 0?A:gr,keyScale:yt(1),max:W.values.value("max"),min:W.values.value("min"),pointerScale:Ds(w.params,b)})),{parser:Ht,value:J,viewProps:w.viewProps}));return new he(w.document,{blade:w.blade,props:ut.fromObject({label:w.params.label}),value:J,valueController:p})},api(w){return!(w.controller instanceof he)||!(w.controller.valueController instanceof ke)?null:new Jh(w.controller)}},el=function(){return{id:"text",type:"blade",core:ye,accept(w){const S=Tt(w,A=>({parse:A.required.function,value:A.required.raw,view:A.required.constant("text"),format:A.optional.function,label:A.optional.string}));return S?{params:S}:null},controller(w){var S;const A=yt(w.params.value),b=new Fe(w.document,{parser:w.params.parse,props:ut.fromObject({formatter:(S=w.params.format)!==null&&S!==void 0?S:W=>String(W)}),value:A,viewProps:w.viewProps});return new he(w.document,{blade:w.blade,props:ut.fromObject({label:w.params.label}),value:A,valueController:b})},api(w){return!(w.controller instanceof he)||!(w.controller.valueController instanceof Fe)?null:new Qh(w.controller)}}}();function il(w){const S=w.createElement("div");return S.classList.add(dt("dfw")()),w.body&&w.body.appendChild(S),S}function sl(w,S,A){if(w.querySelector(`style[data-tp-style=${S}]`))return;const b=w.createElement("style");b.dataset.tpStyle=S,b.textContent=A,w.head.appendChild(b)}class nl extends jh{constructor(S){var A,b;const W=S??{},J=(A=W.document)!==null&&A!==void 0?A:Lr(),p=Hh(),C=new kh(J,{expanded:W.expanded,blade:Te(),props:ut.fromObject({title:W.title}),viewProps:Zt.create()});super(C,p),this.pool_=p,this.containerElem_=(b=W.container)!==null&&b!==void 0?b:il(J),this.containerElem_.appendChild(this.element),this.doc_=J,this.usesDefaultWrapper_=!W.container,this.setUpDefaultPlugins_()}get document(){if(!this.doc_)throw Ct.alreadyDisposed();return this.doc_}dispose(){const S=this.containerElem_;if(!S)throw Ct.alreadyDisposed();if(this.usesDefaultWrapper_){const A=S.parentElement;A&&A.removeChild(S)}this.containerElem_=null,this.doc_=null,super.dispose()}registerPlugin(S){S.css&&sl(this.document,`plugin-${S.id}`,S.css),("plugin"in S?[S.plugin]:"plugins"in S?S.plugins:[]).forEach(b=>{this.pool_.register(S.id,b)})}setUpDefaultPlugins_(){this.registerPlugin({id:"default",css:'.tp-tbiv_b,.tp-coltxtv_ms,.tp-colswv_b,.tp-ckbv_i,.tp-sglv_i,.tp-mllv_i,.tp-grlv_g,.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw,.tp-rotv_b,.tp-fldv_b,.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:rgba(0,0,0,0);border-width:0;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0;outline:none;padding:0}.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{background-color:var(--btn-bg);border-radius:var(--bld-br);color:var(--btn-fg);cursor:pointer;display:block;font-weight:bold;height:var(--cnt-usz);line-height:var(--cnt-usz);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-p2dv_b:hover,.tp-btnv_b:hover,.tp-lstv_s:hover{background-color:var(--btn-bg-h)}.tp-p2dv_b:focus,.tp-btnv_b:focus,.tp-lstv_s:focus{background-color:var(--btn-bg-f)}.tp-p2dv_b:active,.tp-btnv_b:active,.tp-lstv_s:active{background-color:var(--btn-bg-a)}.tp-p2dv_b:disabled,.tp-btnv_b:disabled,.tp-lstv_s:disabled{opacity:.5}.tp-rotv_c>.tp-cntv.tp-v-lst,.tp-tbpv_c>.tp-cntv.tp-v-lst,.tp-fldv_c>.tp-cntv.tp-v-lst{margin-bottom:calc(-1*var(--cnt-vp))}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_c{border-bottom-left-radius:0}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_b{border-bottom-left-radius:0}.tp-rotv_c>*:not(.tp-v-fst),.tp-tbpv_c>*:not(.tp-v-fst),.tp-fldv_c>*:not(.tp-v-fst){margin-top:var(--cnt-usp)}.tp-rotv_c>.tp-sprv:not(.tp-v-fst),.tp-tbpv_c>.tp-sprv:not(.tp-v-fst),.tp-fldv_c>.tp-sprv:not(.tp-v-fst),.tp-rotv_c>.tp-cntv:not(.tp-v-fst),.tp-tbpv_c>.tp-cntv:not(.tp-v-fst),.tp-fldv_c>.tp-cntv:not(.tp-v-fst){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-rotv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-cntv+*:not(.tp-v-hidden){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-tbpv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-fldv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-rotv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-tbpv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-fldv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv{margin-top:0}.tp-tbpv_c>.tp-cntv,.tp-fldv_c>.tp-cntv{margin-left:4px}.tp-tbpv_c>.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-fldv>.tp-fldv_b{border-top-left-radius:var(--bld-br);border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b{border-bottom-left-radius:0}.tp-tbpv_c .tp-fldv>.tp-fldv_c,.tp-fldv_c .tp-fldv>.tp-fldv_c{border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-cntv+.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-cntv+.tp-fldv>.tp-fldv_b{border-top-left-radius:0}.tp-tbpv_c>.tp-cntv+.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-cntv+.tp-tabv>.tp-tabv_t{border-top-left-radius:0}.tp-tbpv_c>.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-tabv>.tp-tabv_t{border-top-left-radius:var(--bld-br)}.tp-tbpv_c .tp-tabv>.tp-tabv_c,.tp-fldv_c .tp-tabv>.tp-tabv_c{border-bottom-left-radius:var(--bld-br)}.tp-rotv_b,.tp-fldv_b{background-color:var(--cnt-bg);color:var(--cnt-fg);cursor:pointer;display:block;height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);overflow:hidden;padding-left:var(--cnt-hp);padding-right:calc(4px + var(--cnt-usz) + var(--cnt-hp));position:relative;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:border-radius .2s ease-in-out .2s}.tp-rotv_b:hover,.tp-fldv_b:hover{background-color:var(--cnt-bg-h)}.tp-rotv_b:focus,.tp-fldv_b:focus{background-color:var(--cnt-bg-f)}.tp-rotv_b:active,.tp-fldv_b:active{background-color:var(--cnt-bg-a)}.tp-rotv_b:disabled,.tp-fldv_b:disabled{opacity:.5}.tp-rotv_m,.tp-fldv_m{background:linear-gradient(to left, var(--cnt-fg), var(--cnt-fg) 2px, transparent 2px, transparent 4px, var(--cnt-fg) 4px);border-radius:2px;bottom:0;content:"";display:block;height:6px;right:calc(var(--cnt-hp) + (var(--cnt-usz) + 4px - 6px)/2 - 2px);margin:auto;opacity:.5;position:absolute;top:0;transform:rotate(90deg);transition:transform .2s ease-in-out;width:6px}.tp-rotv.tp-rotv-expanded .tp-rotv_m,.tp-fldv.tp-fldv-expanded>.tp-fldv_b>.tp-fldv_m{transform:none}.tp-rotv_c,.tp-fldv_c{box-sizing:border-box;height:0;opacity:0;overflow:hidden;padding-bottom:0;padding-top:0;position:relative;transition:height .2s ease-in-out,opacity .2s linear,padding .2s ease-in-out}.tp-rotv.tp-rotv-cpl:not(.tp-rotv-expanded) .tp-rotv_c,.tp-fldv.tp-fldv-cpl:not(.tp-fldv-expanded)>.tp-fldv_c{display:none}.tp-rotv.tp-rotv-expanded .tp-rotv_c,.tp-fldv.tp-fldv-expanded>.tp-fldv_c{opacity:1;padding-bottom:var(--cnt-vp);padding-top:var(--cnt-vp);transform:none;overflow:visible;transition:height .2s ease-in-out,opacity .2s linear .2s,padding .2s ease-in-out}.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw{background-color:var(--in-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--in-fg);font-family:inherit;height:var(--cnt-usz);line-height:var(--cnt-usz);min-width:0;width:100%}.tp-txtv_i:hover,.tp-p2dpv_p:hover,.tp-colswv_sw:hover{background-color:var(--in-bg-h)}.tp-txtv_i:focus,.tp-p2dpv_p:focus,.tp-colswv_sw:focus{background-color:var(--in-bg-f)}.tp-txtv_i:active,.tp-p2dpv_p:active,.tp-colswv_sw:active{background-color:var(--in-bg-a)}.tp-txtv_i:disabled,.tp-p2dpv_p:disabled,.tp-colswv_sw:disabled{opacity:.5}.tp-lstv,.tp-coltxtv_m{position:relative}.tp-lstv_s{padding:0 20px 0 4px;width:100%}.tp-lstv_m,.tp-coltxtv_mm{bottom:0;margin:auto;pointer-events:none;position:absolute;right:2px;top:0}.tp-lstv_m svg,.tp-coltxtv_mm svg{bottom:0;height:16px;margin:auto;position:absolute;right:0;top:0;width:16px}.tp-lstv_m svg path,.tp-coltxtv_mm svg path{fill:currentColor}.tp-sglv_i,.tp-mllv_i,.tp-grlv_g{background-color:var(--mo-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--mo-fg);height:var(--cnt-usz);scrollbar-color:currentColor rgba(0,0,0,0);scrollbar-width:thin;width:100%}.tp-sglv_i::-webkit-scrollbar,.tp-mllv_i::-webkit-scrollbar,.tp-grlv_g::-webkit-scrollbar{height:8px;width:8px}.tp-sglv_i::-webkit-scrollbar-corner,.tp-mllv_i::-webkit-scrollbar-corner,.tp-grlv_g::-webkit-scrollbar-corner{background-color:rgba(0,0,0,0)}.tp-sglv_i::-webkit-scrollbar-thumb,.tp-mllv_i::-webkit-scrollbar-thumb,.tp-grlv_g::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:currentColor;border:rgba(0,0,0,0) solid 2px;border-radius:4px}.tp-pndtxtv,.tp-coltxtv_w{display:flex}.tp-pndtxtv_a,.tp-coltxtv_c{width:100%}.tp-pndtxtv_a+.tp-pndtxtv_a,.tp-coltxtv_c+.tp-pndtxtv_a,.tp-pndtxtv_a+.tp-coltxtv_c,.tp-coltxtv_c+.tp-coltxtv_c{margin-left:2px}.tp-rotv{--bs-bg: var(--tp-base-background-color, hsl(230, 7%, 17%));--bs-br: var(--tp-base-border-radius, 6px);--bs-ff: var(--tp-base-font-family, Roboto Mono, Source Code Pro, Menlo, Courier, monospace);--bs-sh: var(--tp-base-shadow-color, rgba(0, 0, 0, 0.2));--bld-br: var(--tp-blade-border-radius, 2px);--bld-hp: var(--tp-blade-horizontal-padding, 4px);--bld-vw: var(--tp-blade-value-width, 160px);--btn-bg: var(--tp-button-background-color, hsl(230, 7%, 70%));--btn-bg-a: var(--tp-button-background-color-active, #d6d7db);--btn-bg-f: var(--tp-button-background-color-focus, #c8cad0);--btn-bg-h: var(--tp-button-background-color-hover, #bbbcc4);--btn-fg: var(--tp-button-foreground-color, hsl(230, 7%, 17%));--cnt-bg: var(--tp-container-background-color, rgba(187, 188, 196, 0.1));--cnt-bg-a: var(--tp-container-background-color-active, rgba(187, 188, 196, 0.25));--cnt-bg-f: var(--tp-container-background-color-focus, rgba(187, 188, 196, 0.2));--cnt-bg-h: var(--tp-container-background-color-hover, rgba(187, 188, 196, 0.15));--cnt-fg: var(--tp-container-foreground-color, hsl(230, 7%, 75%));--cnt-hp: var(--tp-container-horizontal-padding, 4px);--cnt-vp: var(--tp-container-vertical-padding, 4px);--cnt-usp: var(--tp-container-unit-spacing, 4px);--cnt-usz: var(--tp-container-unit-size, 20px);--in-bg: var(--tp-input-background-color, rgba(187, 188, 196, 0.1));--in-bg-a: var(--tp-input-background-color-active, rgba(187, 188, 196, 0.25));--in-bg-f: var(--tp-input-background-color-focus, rgba(187, 188, 196, 0.2));--in-bg-h: var(--tp-input-background-color-hover, rgba(187, 188, 196, 0.15));--in-fg: var(--tp-input-foreground-color, hsl(230, 7%, 75%));--lbl-fg: var(--tp-label-foreground-color, rgba(187, 188, 196, 0.7));--mo-bg: var(--tp-monitor-background-color, rgba(0, 0, 0, 0.2));--mo-fg: var(--tp-monitor-foreground-color, rgba(187, 188, 196, 0.7));--grv-fg: var(--tp-groove-foreground-color, rgba(187, 188, 196, 0.1))}.tp-btnv_b{width:100%}.tp-btnv_t{text-align:center}.tp-ckbv_l{display:block;position:relative}.tp-ckbv_i{left:0;opacity:0;position:absolute;top:0}.tp-ckbv_w{background-color:var(--in-bg);border-radius:var(--bld-br);cursor:pointer;display:block;height:var(--cnt-usz);position:relative;width:var(--cnt-usz)}.tp-ckbv_w svg{bottom:0;display:block;height:16px;left:0;margin:auto;opacity:0;position:absolute;right:0;top:0;width:16px}.tp-ckbv_w svg path{fill:none;stroke:var(--in-fg);stroke-width:2}.tp-ckbv_i:hover+.tp-ckbv_w{background-color:var(--in-bg-h)}.tp-ckbv_i:focus+.tp-ckbv_w{background-color:var(--in-bg-f)}.tp-ckbv_i:active+.tp-ckbv_w{background-color:var(--in-bg-a)}.tp-ckbv_i:checked+.tp-ckbv_w svg{opacity:1}.tp-ckbv.tp-v-disabled .tp-ckbv_w{opacity:.5}.tp-colv{position:relative}.tp-colv_h{display:flex}.tp-colv_s{flex-grow:0;flex-shrink:0;width:var(--cnt-usz)}.tp-colv_t{flex:1;margin-left:4px}.tp-colv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-colv.tp-colv-expanded.tp-colv-cpl .tp-colv_p{overflow:visible}.tp-colv.tp-colv-expanded .tp-colv_p{margin-top:var(--cnt-usp);opacity:1}.tp-colv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-colpv_h,.tp-colpv_ap{margin-left:6px;margin-right:6px}.tp-colpv_h{margin-top:var(--cnt-usp)}.tp-colpv_rgb{display:flex;margin-top:var(--cnt-usp);width:100%}.tp-colpv_a{display:flex;margin-top:var(--cnt-vp);padding-top:calc(var(--cnt-vp) + 2px);position:relative}.tp-colpv_a::before{background-color:var(--grv-fg);content:"";height:2px;left:calc(-1*var(--cnt-hp));position:absolute;right:calc(-1*var(--cnt-hp));top:0}.tp-colpv.tp-v-disabled .tp-colpv_a::before{opacity:.5}.tp-colpv_ap{align-items:center;display:flex;flex:3}.tp-colpv_at{flex:1;margin-left:4px}.tp-svpv{border-radius:var(--bld-br);outline:none;overflow:hidden;position:relative}.tp-svpv.tp-v-disabled{opacity:.5}.tp-svpv_c{cursor:crosshair;display:block;height:calc(var(--cnt-usz)*4);width:100%}.tp-svpv_m{border-radius:100%;border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;filter:drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));height:12px;margin-left:-6px;margin-top:-6px;pointer-events:none;position:absolute;width:12px}.tp-svpv:focus .tp-svpv_m{border-color:#fff}.tp-hplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative}.tp-hplv.tp-v-disabled{opacity:.5}.tp-hplv_c{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAAQ0lEQVQoU2P8z8Dwn0GCgQEDi2OK/RBgYHjBgIpfovFh8j8YBIgzFGQxuqEgPhaDOT5gOhPkdCxOZeBg+IDFZZiGAgCaSSMYtcRHLgAAAABJRU5ErkJggg==);background-position:left top;background-repeat:no-repeat;background-size:100% 100%;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;position:absolute;top:50%;width:100%}.tp-hplv_m{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;height:12px;left:50%;margin-left:-6px;margin-top:-6px;pointer-events:none;position:absolute;top:50%;width:12px}.tp-hplv:focus .tp-hplv_m{border-color:#fff}.tp-aplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative;width:100%}.tp-aplv.tp-v-disabled{opacity:.5}.tp-aplv_b{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:4px 4px;background-position:0 0,2px 2px;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;overflow:hidden;position:absolute;top:50%;width:100%}.tp-aplv_c{bottom:0;left:0;position:absolute;right:0;top:0}.tp-aplv_m{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:12px 12px;background-position:0 0,6px 6px;border-radius:var(--bld-br);box-shadow:0 0 2px rgba(0,0,0,.1);height:12px;left:50%;margin-left:-6px;margin-top:-6px;overflow:hidden;pointer-events:none;position:absolute;top:50%;width:12px}.tp-aplv_p{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;bottom:0;left:0;position:absolute;right:0;top:0}.tp-aplv:focus .tp-aplv_p{border-color:#fff}.tp-colswv{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:10px 10px;background-position:0 0,5px 5px;border-radius:var(--bld-br);overflow:hidden}.tp-colswv.tp-v-disabled{opacity:.5}.tp-colswv_sw{border-radius:0}.tp-colswv_b{cursor:pointer;display:block;height:var(--cnt-usz);left:0;position:absolute;top:0;width:var(--cnt-usz)}.tp-colswv_b:focus::after{border:rgba(255,255,255,.75) solid 2px;border-radius:var(--bld-br);bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.tp-coltxtv{display:flex;width:100%}.tp-coltxtv_m{margin-right:4px}.tp-coltxtv_ms{border-radius:var(--bld-br);color:var(--lbl-fg);cursor:pointer;height:var(--cnt-usz);line-height:var(--cnt-usz);padding:0 18px 0 4px}.tp-coltxtv_ms:hover{background-color:var(--in-bg-h)}.tp-coltxtv_ms:focus{background-color:var(--in-bg-f)}.tp-coltxtv_ms:active{background-color:var(--in-bg-a)}.tp-coltxtv_mm{color:var(--lbl-fg)}.tp-coltxtv.tp-v-disabled .tp-coltxtv_mm{opacity:.5}.tp-coltxtv_w{flex:1}.tp-dfwv{position:absolute;top:8px;right:8px;width:256px}.tp-fldv{position:relative}.tp-fldv_t{padding-left:4px}.tp-fldv_b:disabled .tp-fldv_m{display:none}.tp-fldv_c{padding-left:4px}.tp-fldv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-fldv_i::before{background-color:currentColor;bottom:0;content:"";left:0;position:absolute;top:0;width:4px}.tp-fldv_b:hover+.tp-fldv_i{color:var(--cnt-bg-h)}.tp-fldv_b:focus+.tp-fldv_i{color:var(--cnt-bg-f)}.tp-fldv_b:active+.tp-fldv_i{color:var(--cnt-bg-a)}.tp-fldv.tp-v-disabled>.tp-fldv_i{opacity:.5}.tp-grlv{position:relative}.tp-grlv_g{display:block;height:calc(var(--cnt-usz)*3)}.tp-grlv_g polyline{fill:none;stroke:var(--mo-fg);stroke-linejoin:round}.tp-grlv_t{margin-top:-4px;transition:left .05s,top .05s;visibility:hidden}.tp-grlv_t.tp-grlv_t-a{visibility:visible}.tp-grlv_t.tp-grlv_t-in{transition:none}.tp-grlv.tp-v-disabled .tp-grlv_g{opacity:.5}.tp-grlv .tp-ttv{background-color:var(--mo-fg)}.tp-grlv .tp-ttv::before{border-top-color:var(--mo-fg)}.tp-lblv{align-items:center;display:flex;line-height:1.3;padding-left:var(--cnt-hp);padding-right:var(--cnt-hp)}.tp-lblv.tp-lblv-nol{display:block}.tp-lblv_l{color:var(--lbl-fg);flex:1;-webkit-hyphens:auto;hyphens:auto;overflow:hidden;padding-left:4px;padding-right:16px}.tp-lblv.tp-v-disabled .tp-lblv_l{opacity:.5}.tp-lblv.tp-lblv-nol .tp-lblv_l{display:none}.tp-lblv_v{align-self:flex-start;flex-grow:0;flex-shrink:0;width:var(--bld-vw)}.tp-lblv.tp-lblv-nol .tp-lblv_v{width:100%}.tp-lstv_s{padding:0 20px 0 var(--bld-hp);width:100%}.tp-lstv_m{color:var(--btn-fg)}.tp-sglv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-sglv.tp-v-disabled .tp-sglv_i{opacity:.5}.tp-mllv_i{display:block;height:calc(var(--cnt-usz)*3);line-height:var(--cnt-usz);padding-left:var(--bld-hp);padding-right:var(--bld-hp);resize:none;white-space:pre}.tp-mllv.tp-v-disabled .tp-mllv_i{opacity:.5}.tp-p2dv{position:relative}.tp-p2dv_h{display:flex}.tp-p2dv_b{height:var(--cnt-usz);margin-right:4px;position:relative;width:var(--cnt-usz)}.tp-p2dv_b svg{display:block;height:16px;left:50%;margin-left:-8px;margin-top:-8px;position:absolute;top:50%;width:16px}.tp-p2dv_b svg path{stroke:currentColor;stroke-width:2}.tp-p2dv_b svg circle{fill:currentColor}.tp-p2dv_t{flex:1}.tp-p2dv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-p2dv.tp-p2dv-expanded .tp-p2dv_p{margin-top:var(--cnt-usp);opacity:1}.tp-p2dv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-p2dpv{padding-left:calc(var(--cnt-usz) + 4px)}.tp-p2dpv_p{cursor:crosshair;height:0;overflow:hidden;padding-bottom:100%;position:relative}.tp-p2dpv.tp-v-disabled .tp-p2dpv_p{opacity:.5}.tp-p2dpv_g{display:block;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.tp-p2dpv_ax{opacity:.1;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_l{opacity:.5;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_m{border:var(--in-fg) solid 1px;border-radius:50%;box-sizing:border-box;height:4px;margin-left:-2px;margin-top:-2px;position:absolute;width:4px}.tp-p2dpv_p:focus .tp-p2dpv_m{background-color:var(--in-fg);border-width:0}.tp-popv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);display:none;max-width:var(--bld-vw);padding:var(--cnt-vp) var(--cnt-hp);position:absolute;visibility:hidden;z-index:1000}.tp-popv.tp-popv-v{display:block;visibility:visible}.tp-sldv.tp-v-disabled{opacity:.5}.tp-sldv_t{box-sizing:border-box;cursor:pointer;height:var(--cnt-usz);margin:0 6px;outline:none;position:relative}.tp-sldv_t::before{background-color:var(--in-bg);border-radius:1px;bottom:0;content:"";display:block;height:2px;left:0;margin:auto;position:absolute;right:0;top:0}.tp-sldv_k{height:100%;left:0;position:absolute;top:0}.tp-sldv_k::before{background-color:var(--in-fg);border-radius:1px;bottom:0;content:"";display:block;height:2px;left:0;margin-bottom:auto;margin-top:auto;position:absolute;right:0;top:0}.tp-sldv_k::after{background-color:var(--btn-bg);border-radius:var(--bld-br);bottom:0;content:"";display:block;height:12px;margin-bottom:auto;margin-top:auto;position:absolute;right:-6px;top:0;width:12px}.tp-sldv_t:hover .tp-sldv_k::after{background-color:var(--btn-bg-h)}.tp-sldv_t:focus .tp-sldv_k::after{background-color:var(--btn-bg-f)}.tp-sldv_t:active .tp-sldv_k::after{background-color:var(--btn-bg-a)}.tp-sldtxtv{display:flex}.tp-sldtxtv_s{flex:2}.tp-sldtxtv_t{flex:1;margin-left:4px}.tp-tabv{position:relative}.tp-tabv_t{align-items:flex-end;color:var(--cnt-bg);display:flex;overflow:hidden;position:relative}.tp-tabv_t:hover{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus){color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active){color:var(--cnt-bg-a)}.tp-tabv_t::before{background-color:currentColor;bottom:0;content:"";height:2px;left:0;pointer-events:none;position:absolute;right:0}.tp-tabv.tp-v-disabled .tp-tabv_t::before{opacity:.5}.tp-tabv.tp-tabv-nop .tp-tabv_t{height:calc(var(--cnt-usz) + 4px);position:relative}.tp-tabv.tp-tabv-nop .tp-tabv_t::before{background-color:var(--cnt-bg);bottom:0;content:"";height:2px;left:0;position:absolute;right:0}.tp-tabv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-tabv_i::before{background-color:currentColor;bottom:0;content:"";left:0;position:absolute;top:0;width:4px}.tp-tabv_t:hover+.tp-tabv_i{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus)+.tp-tabv_i{color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active)+.tp-tabv_i{color:var(--cnt-bg-a)}.tp-tabv.tp-v-disabled>.tp-tabv_i{opacity:.5}.tp-tbiv{flex:1;min-width:0;position:relative}.tp-tbiv+.tp-tbiv{margin-left:2px}.tp-tbiv+.tp-tbiv.tp-v-disabled::before{opacity:.5}.tp-tbiv_b{display:block;padding-left:calc(var(--cnt-hp) + 4px);padding-right:calc(var(--cnt-hp) + 4px);position:relative;width:100%}.tp-tbiv_b:disabled{opacity:.5}.tp-tbiv_b::before{background-color:var(--cnt-bg);bottom:2px;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.tp-tbiv_b:hover::before{background-color:var(--cnt-bg-h)}.tp-tbiv_b:focus::before{background-color:var(--cnt-bg-f)}.tp-tbiv_b:active::before{background-color:var(--cnt-bg-a)}.tp-tbiv_t{color:var(--cnt-fg);height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);opacity:.5;overflow:hidden;position:relative;text-overflow:ellipsis}.tp-tbiv.tp-tbiv-sel .tp-tbiv_t{opacity:1}.tp-tbpv_c{padding-bottom:var(--cnt-vp);padding-left:4px;padding-top:var(--cnt-vp)}.tp-txtv{position:relative}.tp-txtv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-txtv.tp-txtv-fst .tp-txtv_i{border-bottom-right-radius:0;border-top-right-radius:0}.tp-txtv.tp-txtv-mid .tp-txtv_i{border-radius:0}.tp-txtv.tp-txtv-lst .tp-txtv_i{border-bottom-left-radius:0;border-top-left-radius:0}.tp-txtv.tp-txtv-num .tp-txtv_i{text-align:right}.tp-txtv.tp-txtv-drg .tp-txtv_i{opacity:.3}.tp-txtv_k{cursor:pointer;height:100%;left:calc(var(--bld-hp) - 5px);position:absolute;top:0;width:12px}.tp-txtv_k::before{background-color:var(--in-fg);border-radius:1px;bottom:0;content:"";height:calc(var(--cnt-usz) - 4px);left:50%;margin-bottom:auto;margin-left:-1px;margin-top:auto;opacity:.1;position:absolute;top:0;transition:border-radius .1s,height .1s,transform .1s,width .1s;width:2px}.tp-txtv_k:hover::before,.tp-txtv.tp-txtv-drg .tp-txtv_k::before{opacity:1}.tp-txtv.tp-txtv-drg .tp-txtv_k::before{border-radius:50%;height:4px;transform:translateX(-1px);width:4px}.tp-txtv_g{bottom:0;display:block;height:8px;left:50%;margin:auto;overflow:visible;pointer-events:none;position:absolute;top:0;visibility:hidden;width:100%}.tp-txtv.tp-txtv-drg .tp-txtv_g{visibility:visible}.tp-txtv_gb{fill:none;stroke:var(--in-fg);stroke-dasharray:1}.tp-txtv_gh{fill:none;stroke:var(--in-fg)}.tp-txtv .tp-ttv{margin-left:6px;visibility:hidden}.tp-txtv.tp-txtv-drg .tp-ttv{visibility:visible}.tp-ttv{background-color:var(--in-fg);border-radius:var(--bld-br);color:var(--bs-bg);padding:2px 4px;pointer-events:none;position:absolute;transform:translate(-50%, -100%)}.tp-ttv::before{border-color:var(--in-fg) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:2px;box-sizing:border-box;content:"";font-size:.9em;height:4px;left:50%;margin-left:-2px;position:absolute;top:100%;width:4px}.tp-rotv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);font-family:var(--bs-ff);font-size:11px;font-weight:500;line-height:1;text-align:left}.tp-rotv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br);border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br);padding-left:calc(4px + var(--cnt-usz) + var(--cnt-hp));text-align:center}.tp-rotv.tp-rotv-expanded .tp-rotv_b{border-bottom-left-radius:0;border-bottom-right-radius:0;transition-delay:0s;transition-duration:0s}.tp-rotv.tp-rotv-not>.tp-rotv_b{display:none}.tp-rotv_b:disabled .tp-rotv_m{display:none}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst.tp-fldv-expanded>.tp-fldv_b{transition-delay:0s;transition-duration:0s}.tp-rotv_c .tp-fldv.tp-v-vlst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-right-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst>.tp-fldv_b{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst>.tp-tabv_t{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv.tp-v-disabled,.tp-rotv .tp-v-disabled{pointer-events:none}.tp-rotv.tp-v-hidden,.tp-rotv .tp-v-hidden{display:none}.tp-sprv_r{background-color:var(--grv-fg);border-width:0;display:block;height:2px;margin:0;width:100%}.tp-sprv.tp-v-disabled .tp-sprv_r{opacity:.5}',plugins:[$h,_h,tl,Qs,el]})}}new Ks("4.0.3");class de extends Phaser.Renderer.WebGL.Pipelines.PostFXPipeline{constructor(A,b){super({game:A,fragShader:b});ji(this,"_progress");this._progress=0}get progress(){return this._progress}set progress(A){this._progress=A}onPreRender(){this.set1f("uCutoff",this._progress)}}const rl=` +#define SHADER_NAME WIPE_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +void main() { + if (outTexCoord.x < uCutoff) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } else { + // returns the original color of the pixel that is being processed + gl_FragColor = texture2D(uMainSampler, outTexCoord); + } +} +`;class Ze extends de{constructor(S){super(S,rl)}}const al=` +#define SHADER_NAME CURTAIN_RISE_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +void main() { + if (outTexCoord.y > uCutoff) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } else { + // returns the original color of the pixel that is being processed + gl_FragColor = texture2D(uMainSampler, outTexCoord); + } +} +`;class yi extends de{constructor(S){super(S,al),this._progress=1}}const ol=` +#define SHADER_NAME CURTAIN_FALL_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +void main() { + float dif = abs(1.0 - uCutoff); + if (outTexCoord.y > dif) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } else { + // returns the original color of the pixel that is being processed + gl_FragColor = texture2D(uMainSampler, outTexCoord); + } +} +`;class Rn extends de{constructor(S){super(S,ol)}}const hl=` +#define SHADER_NAME CLOSING_BARS_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +void main() { + float diff = uCutoff / 2.0; + if ((outTexCoord.y >= 1.0 - diff) || (outTexCoord.y <= 0.0 + diff)) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } else { + gl_FragColor = texture2D(uMainSampler, outTexCoord); + } +} +`;class Ti extends de{constructor(S){super(S,hl)}}const ll=` +#define SHADER_NAME OPENING_BARS_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +void main() { + float diff = uCutoff / 2.0; + if ((outTexCoord.y <= 0.5 - diff) || (outTexCoord.y >= 0.5 + diff)) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } else { + gl_FragColor = texture2D(uMainSampler, outTexCoord); + } +} +`;class Ci extends de{constructor(S){super(S,ll),this._progress=1}}const ul=` +#define SHADER_NAME FADE_TO_WHITE_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +vec4 white = vec4(1.0, 1.0, 1.0, 1.0); + +void main() { + vec4 color = texture2D(uMainSampler, outTexCoord); + gl_FragColor = mix(color, white, uCutoff); +} +`;class Si extends de{constructor(S){super(S,ul)}}const fl=` +#define SHADER_NAME FADE_TO_BLACK_POST_FX + +#ifdef GL_ES +precision mediump float; +#endif + +uniform sampler2D uMainSampler; +// coordinate from the vertex shader +varying vec2 outTexCoord; +uniform float uCutoff; + +vec4 black = vec4(0.0, 0.0, 0.0, 1.0); + +void main() { + vec4 color = texture2D(uMainSampler, outTexCoord); + gl_FragColor = mix(color, black, uCutoff); +} +`;class Ei extends de{constructor(S){super(S,fl)}}const Ps="BG",dl=[Ze,yi,Rn,Ti,Ci,Si,Ei];var qe,Ln,Gt,jt;class vl extends Me.Scene{constructor(){super({key:"MainScene"});si(this,qe);si(this,Gt)}preload(){this.load.image(Ps,"assets/images/bg.png")}create(){this.add.image(0,0,Ps).setOrigin(0),dl.forEach(A=>{this.renderer.pipelines.addPostPipeline(A.name,A),this.cameras.main.setPostPipeline(A)}),zt(this,qe,Ln).call(this)}}qe=new WeakSet,Ln=function(){const A={NONE:"NONE",WIPE:"WIPE",CURTAIN_RISE:"CURTAIN_RISE",CURTAIN_FALL:"CURTAIN_FALL",OPEN_BARS:"OPEN_BARS",CLOSE_BARS:"CLOSE_BARS",FADE_TO_WHITE:"FADE_TO_WHITE",FADE_TO_BLACK:"FADE_TO_BLACK"},b=new nl,W=b.addBlade({view:"list",label:"shader",options:[{text:"none",value:A.NONE},{text:"wipe",value:A.WIPE},{text:"curtain rise",value:A.CURTAIN_RISE},{text:"curtain fall",value:A.CURTAIN_FALL},{text:"open bars",value:A.OPEN_BARS},{text:"closing bars",value:A.CLOSE_BARS},{text:"fade to white",value:A.FADE_TO_WHITE},{text:"fade to black",value:A.FADE_TO_BLACK}],value:A.NONE});b.addBlade({view:"separator"});const J=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Wipe Fx",pipeline:Ze}),p=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Curtain Rise Fx",pipeline:yi,flipProgressValue:!0}),C=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Curtain Fall Fx",pipeline:Rn}),t=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Opening Bars Fx",pipeline:Ci,flipProgressValue:!0}),d=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Closing Bars Fx",pipeline:Ti}),c=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Fade To White Fx",pipeline:Si}),a=zt(this,Gt,jt).call(this,{pane:b,paneTitle:"Fade To Black Fx",pipeline:Ei});b.on("change",r=>{if(r.target===W){if(J.hidden=!0,p.hidden=!0,C.hidden=!0,t.hidden=!0,d.hidden=!0,c.hidden=!0,a.hidden=!0,this.cameras.main.getPostPipeline(Ze).progress=0,this.cameras.main.getPostPipeline(yi).progress=1,this.cameras.main.getPostPipeline(Ze).progress=0,this.cameras.main.getPostPipeline(Ci).progress=1,this.cameras.main.getPostPipeline(Ti).progress=0,this.cameras.main.getPostPipeline(Si).progress=0,this.cameras.main.getPostPipeline(Ei).progress=0,b.refresh(),r.value===A.WIPE){J.hidden=!1;return}if(r.value===A.CURTAIN_RISE){p.hidden=!1;return}if(r.value===A.CURTAIN_FALL){C.hidden=!1;return}if(r.value===A.OPEN_BARS){t.hidden=!1;return}if(r.value===A.CLOSE_BARS){d.hidden=!1;return}if(r.value===A.FADE_TO_WHITE){c.hidden=!1;return}if(r.value===A.FADE_TO_BLACK){a.hidden=!1;return}}})},Gt=new WeakSet,jt=function(A){const{pane:b,pipeline:W,paneTitle:J,flipProgressValue:p=!1}=A,C=b.addFolder({title:J,hidden:!0});return C.addBinding(this.cameras.main.getPostPipeline(W),"progress",{min:0,max:1}),C.addButton({title:"Play Transition"}).on("click",()=>{b.disabled=!0,this.cameras.main.getPostPipeline(W).progress=0,b.refresh(),this.tweens.add({targets:this.cameras.main.getPostPipeline(W),progress:1,duration:2e3,onUpdate:()=>b.refresh(),onComplete:()=>{this.time.delayedCall(600,()=>{this.cameras.main.getPostPipeline(W).progress=p?1:0,b.refresh(),b.disabled=!1})}})}),C};const cl={type:Me.WEBGL,pixelArt:!0,scale:{parent:"game-container",width:1024,height:576,mode:Me.Scale.FIT,autoCenter:Me.Scale.CENTER_BOTH},backgroundColor:"#5c5b5b"},Fn=new Me.Game(cl);Fn.scene.add("MainScene",vl);Fn.scene.start("MainScene"); diff --git a/examples/shader-battle-scene-transitions/index.html b/examples/shader-battle-scene-transitions/index.html new file mode 100644 index 0000000..a56343b --- /dev/null +++ b/examples/shader-battle-scene-transitions/index.html @@ -0,0 +1,22 @@ + + + + + Basic Phaser 3 Example Template + + + + +
+ + diff --git a/index.html b/index.html index 448c810..cd2d53b 100644 --- a/index.html +++ b/index.html @@ -32,6 +32,7 @@

Examples

  • Dependency Injection Example
  • Scene Communication Example
  • Shader Examples
  • +
  • Shader Battle Scene Transitions Examples