UNPKG

phaser4-rex-plugins

Version:
1 lines 54.4 kB
var t,e;t=void 0,e=function(){class t{constructor(t){this.scene=t,this.displayList=t.sys.displayList,this.updateList=t.sys.updateList,t.events.once("destroy",this.destroy,this)}destroy(){this.scene=null,this.displayList=null,this.updateList=null}static register(e,s){t.prototype[e]=s}}const e=Phaser.GameObjects.GetCalcMatrix,s=Phaser.Renderer.Canvas.SetTransform;var i={renderWebGL:function(t,s,i,r){s.updateData();var h=i.camera;h.addToRenderList(s);for(var a,n=e(s,h,r,!i.useCanvas).calc,o=s._displayOriginX,l=s._displayOriginY,u=s.alpha,d=s.customRenderNodes.Submitter||s.defaultRenderNodes.Submitter,p=s.geom,c=0,g=p.length;c<g;c++)(a=p[c]).visible&&a.webglRender(i,d,n,s,u,o,l)},renderCanvas:function(t,e,i,r){e.updateData(),i.addToRenderList(e);var h=t.currentContext;if(s(t,h,e,i,r)){for(var a,n=e._displayOriginX,o=e._displayOriginY,l=e.geom,u=0,d=l.length;u<d;u++)(a=l[u]).visible&&a.canvasRender(h,n,o);h.restore()}}},r=function(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))t.length=0;else for(var e in t)delete t[e];return t};const h=Phaser.GameObjects.Shape,a=Phaser.Utils.Array.Remove;class n extends h{constructor(t,e,s,i,r){void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=2),void 0===r&&(r=i),super(t,"rexShapes",[]),this._width=-1,this._height=-1,this.dirty=!0,this.isSizeChanged=!0,this.shapes={},this.setPosition(e,s),this.setSize(i,r),this.updateDisplayOrigin()}get width(){return this._width}set width(t){this.setSize(t,this._height)}get height(){return this._height}set height(t){this.setSize(this._width,t)}setDirty(t){return void 0===t&&(t=!0),this.dirty=t,this}setSize(t,e){this.isSizeChanged=this.isSizeChanged||this._width!==t||this._height!==e,this.dirty=this.dirty||this.isSizeChanged,this._width=t,this._height=e,this.updateDisplayOrigin();var s=this.input;return s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this}resize(t,e){return this.setSize(t,e),this}get fillColor(){return this._fillColor}set fillColor(t){this.setFillStyle(t,this._fillAlpha)}get fillAlpha(){return this._fillAlpha}set fillAlpha(t){this.setFillStyle(this._fillColor,t)}setFillStyle(t,e){return void 0===e&&(e=1),this.dirty=this.dirty||this.fillColor!==t||this.fillAlpha!==e,this._fillColor=t,this._fillAlpha=e,this}get lineWidth(){return this._lineWidth}set lineWidth(t){this.setStrokeStyle(t,this._strokeColor,this._strokeAlpha)}get strokeColor(){return this._strokeColor}set strokeColor(t){this.setStrokeStyle(this._lineWidth,t,this._strokeAlpha)}get strokeAlpha(){return this._strokeAlpha}set strokeAlpha(t){this.setStrokeStyle(this._lineWidth,this._strokeColor,t)}setStrokeStyle(t,e,s){return void 0===s&&(s=1),this.dirty=this.dirty||this.lineWidth!==t||this.strokeColor!==e||this.strokeAlpha!==s,this._lineWidth=t,this._strokeColor=e,this._strokeAlpha=s,this}updateShapes(){}updateData(){if(!this.dirty)return this;this.updateShapes();for(var t=this.geom,e=0,s=t.length;e<s;e++){var i=t[e];i.dirty&&i.updateData()}return this.isSizeChanged=!1,this.dirty=!1,this}clear(){return this.geom.length=0,r(this.shapes),this.dirty=!0,this}getShape(t){return this.shapes[t]}getShapes(){return this.geom}addShape(t){this.geom.push(t);var e=t.name;return e&&(this.shapes[e]=t),this.dirty=!0,this}deleteShape(t){var e=this.getShape(t);return e&&(delete this.shapes[t],a(this.geom,e)),this}}Object.assign(n.prototype,i);var o={setEventEmitter(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter(){return this._eventEmitter},on(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}};const l=Phaser.Scene;var u=function(t){return t instanceof l};const d=Phaser.Game;var p=function(t){return t instanceof d};const c=Phaser.Utils.Objects.GetValue;class g{constructor(t,e){this.setParent(t),this.isShutdown=!1,this.setEventEmitter(c(e,"eventEmitter",!0)),this.parent&&(this.parent===this.scene?this.scene.sys.events.once("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.once("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.once("destroy",this.onParentDestroy,this))}shutdown(t){this.isShutdown||(this.parent&&(this.parent===this.scene?this.scene.sys.events.off("shutdown",this.onEnvDestroy,this):this.parent===this.game?this.game.events.off("shutdown",this.onEnvDestroy,this):this.parent.once&&this.parent.off("destroy",this.onParentDestroy,this)),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this.game=void 0,this.isShutdown=!0)}destroy(t){this.shutdown(t)}onEnvDestroy(){this.destroy(!0)}onParentDestroy(t,e){this.destroy(e)}setParent(t){var e;return this.parent=t,this.scene=null==(e=t)||"object"!=typeof e?null:u(e)?e:e.scene&&u(e.scene)?e.scene:e.parent&&e.parent.scene&&u(e.parent.scene)?e.parent.scene:null,this.game=function(t){return null==t||"object"!=typeof t?null:p(t)?t:p(t.game)?t.game:u(t)?t.sys.game:u(t.scene)?t.scene.sys.game:void 0}(t),this}}Object.assign(g.prototype,o);const v=Phaser.Utils.Objects.GetValue;class y extends g{constructor(t,e){super(t,e),this._isRunning=!1,this.isPaused=!1,this.tickingState=!1,this.setTickingMode(v(e,"tickingMode",1))}boot(){2!==this.tickingMode||this.tickingState||this.startTicking()}shutdown(t){this.isShutdown||(this.stop(),this.tickingState&&this.stopTicking(),super.shutdown(t))}setTickingMode(t){"string"==typeof t&&(t=f[t]),this.tickingMode=t}startTicking(){this.tickingState=!0}stopTicking(){this.tickingState=!1}get isRunning(){return this._isRunning}set isRunning(t){this._isRunning!==t&&(this._isRunning=t,1===this.tickingMode&&t!=this.tickingState&&(t?this.startTicking():this.stopTicking()))}start(){return this.isPaused=!1,this.isRunning=!0,this}pause(){return this.isRunning&&(this.isPaused=!0,this.isRunning=!1),this}resume(){return this.isPaused&&(this.isPaused=!1,this.isRunning=!0),this}stop(){return this.isPaused=!1,this.isRunning=!1,this}complete(){this.isPaused=!1,this.isRunning=!1,this.emit("complete",this.parent,this)}}const f={no:0,lazy:1,always:2},S=Phaser.Utils.Objects.GetValue;class P extends y{constructor(t,e){super(t,e);var s=this.scene?"update":"step";this.tickEventName=S(e,"tickEventName",s),this.isSceneTicker=!m(this.tickEventName)}startTicking(){super.startTicking(),this.isSceneTicker?this.scene.sys.events.on(this.tickEventName,this.update,this):this.game.events.on(this.tickEventName,this.update,this)}stopTicking(){super.stopTicking(),this.isSceneTicker&&this.scene?this.scene.sys.events.off(this.tickEventName,this.update,this):this.game&&this.game.events.off(this.tickEventName,this.update,this)}}var m=function(t){return"step"===t||"poststep"===t};const x=Phaser.Utils.Objects.GetValue,D=Phaser.Math.Clamp;class w{constructor(t){this.resetFromJSON(t)}resetFromJSON(t){this.state=x(t,"state",b),this.timeScale=x(t,"timeScale",1),this.delay=x(t,"delay",0),this.repeat=x(t,"repeat",0),this.repeatCounter=x(t,"repeatCounter",0),this.repeatDelay=x(t,"repeatDelay",0),this.duration=x(t,"duration",0),this.nowTime=x(t,"nowTime",0),this.justRestart=x(t,"justRestart",!1)}toJSON(){return{state:this.state,timeScale:this.timeScale,delay:this.delay,repeat:this.repeat,repeatCounter:this.repeatCounter,repeatDelay:this.repeatDelay,duration:this.duration,nowTime:this.nowTime,justRestart:this.justRestart}}destroy(){}setTimeScale(t){return this.timeScale=t,this}setDelay(t){return void 0===t&&(t=0),this.delay=t,this}setDuration(t){return this.duration=t,this}setRepeat(t){return this.repeat=t,this}setRepeatInfinity(){return this.repeat=-1,this}setRepeatDelay(t){return this.repeatDelay=t,this}start(){return this.nowTime=this.delay>0?-this.delay:0,this.state=this.nowTime>=0?R:_,this.repeatCounter=0,this}stop(){return this.state=b,this}update(t,e){this.state!==b&&this.state!==k&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.justRestart=!1,this.nowTime>=this.duration?-1===this.repeat||this.repeatCounter<this.repeat?(this.repeatCounter++,this.justRestart=!0,this.nowTime-=this.duration,this.repeatDelay>0&&(this.nowTime-=this.repeatDelay,this.state=T)):(this.nowTime=this.duration,this.state=k):this.nowTime>=0&&(this.state=R))}get t(){var t;switch(this.state){case b:case _:case T:t=0;break;case R:t=this.nowTime/this.duration;break;case k:t=1}return D(t,0,1)}set t(t){(t=D(t,-1,1))<0?(this.state=_,this.nowTime=-this.delay*t):(this.state=R,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++)}setT(t){return this.t=t,this}get isIdle(){return this.state===b}get isDelay(){return this.state===_}get isCountDown(){return this.state===R}get isRunning(){return this.state===_||this.state===R}get isDone(){return this.state===k}get isOddIteration(){return!(1&~this.repeatCounter)}get isEvenIteration(){return!(1&this.repeatCounter)}}const b=0,_=1,R=2,T=3,k=-1;class A extends P{constructor(t,e){super(t,e),this.timer=new w}shutdown(t){this.isShutdown||(super.shutdown(t),this.timer.destroy(),this.timer=void 0)}start(){return this.timer.start(),super.start(),this}stop(){return this.timer.stop(),super.stop(),this}complete(){return this.timer.stop(),super.complete(),this}}const M=Phaser.Utils.Objects.GetValue,C=Phaser.Utils.Objects.GetAdvancedValue,E=Phaser.Tweens.Builders.GetEaseFunction;class L extends A{resetFromJSON(t){return this.timer.resetFromJSON(M(t,"timer")),this.setEnable(M(t,"enable",!0)),this.setTarget(M(t,"target",this.parent)),this.setDelay(C(t,"delay",0)),this.setDuration(C(t,"duration",1e3)),this.setEase(M(t,"ease","Linear")),this.setRepeat(M(t,"repeat",0)),this}setEnable(t){return null==t&&(t=!0),this.enable=t,this}setTarget(t){return void 0===t&&(t=this.parent),this.target=t,this}setDelay(t){return this.delay=t,this}setDuration(t){return this.duration=t,this}setRepeat(t){return this.repeat=t,this}setRepeatDelay(t){return this.repeatDelay=t,this}setEase(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=E(t),this}start(){return this.timer.isRunning||super.start(),this}restart(){return this.timer.stop(),this.start.apply(this,arguments),this}stop(t){return void 0===t&&(t=!1),super.stop(),t&&(this.timer.setT(1),this.updateTarget(this.target,this.timer),this.complete()),this}update(t,e){if(!this.isRunning||!this.enable||this.parent.hasOwnProperty("active")&&!this.parent.active)return this;var s=this.target,i=this.timer;return i.update(t,e),i.isDelay||this.updateTarget(s,i),this.emit("update",s,this),i.isDone&&this.complete(),this}updateTarget(t,e){}}const O=Phaser.Utils.Objects.GetValue,X=Phaser.Math.Linear;class Y extends L{constructor(t,e){super(t,e),this.resetFromJSON(),this.boot()}start(t){if(this.timer.isRunning)return this;var e=this.target;this.propertyKey=O(t,"key","value");var s=e[this.propertyKey];return this.fromValue=O(t,"from",s),this.toValue=O(t,"to",s),this.setEase(O(t,"ease",this.ease)),this.setDuration(O(t,"duration",this.duration)),this.setRepeat(O(t,"repeat",0)),this.setDelay(O(t,"delay",0)),this.setRepeatDelay(O(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),e[this.propertyKey]=this.fromValue,super.start(),this}updateTarget(t,e){var s=e.t;s=this.easeFn(s),t[this.propertyKey]=X(this.fromValue,this.toValue,s)}}var j={start:function(t){return this.easeValueTask||(this.easeValueTask=new Y(this,{eventEmitter:null})),void 0!==t&&(this.duration=t,this.easeValueTask.stop()),this.easeValueTask.isRunning||(this.easeValueTask.restart({key:"value",from:0,to:1,duration:this.duration,ease:this.ease,repeat:-1,delay:this.delay,repeatDelay:this.repeatDelay}),this.setDirty()),this},stop:function(){return this.easeValueTask?(this.easeValueTask.stop(),this.setDirty(),this):this},pause:function(){return this.easeValueTask?(this.easeValueTask.pause(),this.setDirty(),this):this},resume:function(){return this.easeValueTask?(this.easeValueTask.pause(),this.setDirty(),this):this}};const I=Phaser.Utils.Objects.GetValue;class B extends n{constructor(t,e){super(t,I(e,"x",0),I(e,"y",0),I(e,"width",64),I(e,"height",64)),this.resetFromConfig(e,!0),this.buildShapes(e),I(e,"start",!0)&&this.start()}resetFromConfig(t,e){var s;return void 0===e&&(e=!1),s=e?1e3:this.duration,this.setDuration(I(t,"duration",s)),s=e?"Linear":this.ease,this.setEase(I(t,"ease",s)),s=e?0:this.delay,this.setDelay(I(t,"delay",s)),s=e?0:this.repeatDelay,this.setRepeatDelay(I(t,"repeatDelay",s)),s=e?16777215:this.color,this.setColor(I(t,"color",s)),s=e?0:this.value,this.setValue(I(t,"value",s)),this}buildShapes(){}get centerX(){return this.width/2}get centerY(){return this.height/2}get radius(){return Math.min(this.centerX,this.centerY)}get color(){return this._color}set color(t){this.isColorChanged=this.isColorChanged||this._color!==t,this.dirty=this.dirty||this.isColorChanged,this._color=t,this.setShapesColor(t)}setColor(t){return this.color=t,this}setShapesColor(t){}get value(){return this._value}set value(t){t=Phaser.Math.Clamp(t,0,1),this.dirty=this.dirty||this._value!=t,this._value=t}setValue(t){return this.value=t,this}setDuration(t){return this.duration=t,this}setDelay(t){return this.delay=t,this}setRepeatDelay(t){return this.repeatDelay=t,this}setEase(t){return this.ease=t,this}get isRunning(){return!!this.tweenTask&&this.tweenTask.isRunning}}Object.assign(B.prototype,j);var V={fillStyle:function(t,e){return null==t?this.isFilled=!1:(void 0===e&&(e=1),this.isFilled=!0,this.fillColor=t,this.fillAlpha=e),this},lineStyle:function(t,e,s){return null==t||null==e?this.isStroked=!1:(void 0===s&&(s=1),this.isStroked=!0,this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=s),this}},z={enableData(){return void 0===this.data&&(this.data={}),this},setData(t,e){if(this.enableData(),1===arguments.length){var s=t;for(t in s)this.data[t]=s[t]}else this.data[t]=e;return this},getData(t,e){return this.enableData(),void 0===t?this.data:function(t,e,s){if(!t||"number"==typeof t)return s;if("string"==typeof e){if(t.hasOwnProperty(e))return t[e];if(-1===e.indexOf("."))return s;e=e.split(".")}for(var i=e,r=t,h=s,a=0;a<i.length;a++){if(e=i[a],!r.hasOwnProperty(e)){h=s;break}r=h=r[e]}return h}(this.data,t,e)},incData(t,e,s){return void 0===s&&(s=0),this.enableData(),this.setData(t,this.getData(t,s)+e),this},mulData(t,e,s){return void 0===s&&(s=0),this.enableData(),this.setData(t,this.getData(t,s)*e),this},clearData(){return this.data&&r(this.data),this}};class F{constructor(){this.name=void 0,this.dirty=!0,this.visible=!0,this.data=void 0,this.isFilled=!1,this.fillColor=void 0,this.fillAlpha=1,this.isStroked=!1,this.lineWidth=1,this.strokeColor=void 0,this.strokeAlpha=1}setName(t){return this.name=t,this}setVisible(t){return void 0===t&&(t=!0),this.visible=t,this}reset(){return this.setVisible().fillStyle().lineStyle(),this}webglRender(t,e,s,i,r,h,a){}canvasRender(t,e,s){}updateData(){this.dirty=!1}}Object.assign(F.prototype,V,z);var N=Phaser.Renderer.WebGL.Utils,G=Phaser.Renderer.WebGL.Utils,U=function(t,e,s,i,r,h,a,n){var o=G.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*h),l=r.pathData,u=l.length-1,d=r.lineWidth,p=!r.closePath,c=i.customRenderNodes.StrokePath||i.defaultRenderNodes.StrokePath,g=[];p&&(u-=2);for(var v=0;v<u;v+=2){var y=l[v]-a,f=l[v+1]-n;v>0&&y===l[v-2]&&f===l[v-1]||g.push({x:y,y:f,width:d})}c.run(t,e,g,d,p,s,o,o,o,o)},W=function(t,e,s,i){var r=s||e.fillColor,h=i||e.fillAlpha,a=(16711680&r)>>>16,n=(65280&r)>>>8,o=255&r;t.fillStyle="rgba("+a+","+n+","+o+","+h+")"},H=function(t,e,s,i){var r=s||e.strokeColor,h=i||e.strokeAlpha,a=(16711680&r)>>>16,n=(65280&r)>>>8,o=255&r;t.strokeStyle="rgba("+a+","+n+","+o+","+h+")",t.lineWidth=e.lineWidth};const J=Phaser.Geom.Polygon.Earcut;class K extends F{constructor(){super(),this.pathData=[],this.pathIndexes=[],this.closePath=!1}updateData(){return this.pathIndexes=J(this.pathData),super.updateData(),this}webglRender(t,e,s,i,r,h,a){this.isFilled&&function(t,e,s,i,r,h,a,n){var o,l,u,d,p,c=N.getTintAppendFloatAlpha(r.fillColor,r.fillAlpha*h),g=r.pathData,v=r.pathIndexes,y=g.length,f=Array(2*y),S=Array(y),P=0,m=0;for(o=0;o<y;o+=2)l=g[o]-a,u=g[o+1]-n,d=s.getX(l,u),p=s.getY(l,u),f[P++]=d,f[P++]=p,S[m++]=c;e.batch(t,v,f,S)}(t,e,s,0,this,r,h,a),this.isStroked&&U(t,e,s,i,this,r,h,a)}canvasRender(t,e,s){var i=this.pathData,r=i.length-1,h=i[0]-e,a=i[1]-s;t.beginPath(),t.moveTo(h,a),this.closePath||(r-=2);for(var n=2;n<r;n+=2){var o=i[n]-e,l=i[n+1]-s;t.lineTo(o,l)}this.closePath&&t.closePath(),this.isFilled&&(W(t,this),t.fill()),this.isStroked&&(H(t,this),t.stroke())}}var q=function(t,e,s){var i=s.length;if(i>=2){var r=s[i-2],h=s[i-1];if(t===r&&e===h)return s}return s.push(t,e),s};const Q=Phaser.Math.DegToRad;var $=function(t,e,s,i,r,h,a,n,o){a&&h>r?h-=360:!a&&h<r&&(h+=360);var l=Q(h-r)/n;r=Q(r);for(var u=0;u<=n;u++){var d=r+l*u,p=t+s*Math.cos(d),c=e+i*Math.sin(d);q(p,c,o)}return o};const Z=Phaser.Math.Interpolation.QuadraticBezier,tt=Phaser.Math.Interpolation.CubicBezier,et=Phaser.Math.Interpolation.CatmullRom;var st=function(t){var e=t.length;if(e<2)return t;var s=t[e-2],i=t[e-1];return t.push(s),t.push(i),t},it={clear(){return this.start(),this},start(){return this.startAt(),this},startAt(t,e){return this.restorePathData(),this.accumulationLengths=void 0,function(t,e,s){s.length=0,null!=t&&s.push(t,e)}(t,e,this.pathData),this.firstPointX=t,this.firstPointY=e,this.lastPointX=t,this.lastPointY=e,this},lineTo(t,e,s){return void 0===s&&(s=!1),s&&(t+=this.lastPointX,e+=this.lastPointY),q(t,e,this.pathData),this.lastPointX=t,this.lastPointY=e,this},verticalLineTo(t,e){return this.lineTo(t,this.lastPointY,e),this},horizontalLineTo(t,e){return this.lineTo(this.lastPointX,t,e),this},ellipticalArc(t,e,s,i,r,h,a){return void 0===a&&(a=!1),$(t,e,s,i,r,h,a,this.iterations,this.pathData),this.lastPointX=this.pathData[this.pathData.length-2],this.lastPointY=this.pathData[this.pathData.length-1],this},arc(t,e,s,i,r,h){return this.ellipticalArc(t,e,s,s,i,r,h),this},quadraticBezierTo(t,e,s,i){return function(t,e,s,i,r,h){for(var a=h.length,n=h[a-2],o=h[a-1],l=1,u=r-1;l<=u;l++){var d=l/u;h.push(Z(d,n,t,s),Z(d,o,e,i))}}(t,e,s,i,this.iterations,this.pathData),this.lastPointX=s,this.lastPointY=i,this},cubicBezierTo(t,e,s,i,r,h){return function(t,e,s,i,r,h,a,n){for(var o=n.length,l=n[o-2],u=n[o-1],d=1,p=a-1;d<=p;d++){var c=d/p;n.push(tt(c,l,t,s,r),tt(c,u,e,i,h))}}(t,e,s,i,r,h,this.iterations,this.pathData),this.lastPointX=r,this.lastPointY=h,this},catmullRomTo(...t){return function(t,e,s){for(var i=s.length,r=[s[i-2]],h=[s[i-1]],a=0,n=t.length;a<n;a+=2)r.push(t[a]),h.push(t[a+1]);a=1;for(var o=e-1;a<=o;a++){var l=a/o;s.push(et(r,l),et(h,l))}}(t,this.iterations,this.pathData),this.lastPointX=t[t.length-2],this.lastPointY=t[t.length-1],this},close(){var t=this.pathData[0],e=this.pathData[1];return t===this.lastPointX&&e===this.lastPointY||this.lineTo(t,e),this.closePath=!0,this},end(){return st(this.pathData),this}};const rt=Phaser.Math.RotateAround;var ht=function(t,e,s){for(var i=0,r=s.length-1;i<r;i+=2)s[i]+=t,s[i+1]+=e;return s};const at=Phaser.Math.DegToRad;Phaser.Math.RotateAround;var nt={rotateAround(t,e,s){if(0===this.pathData.length)return this;!function(t,e,s,i){for(var r={x:0,y:0},h=0,a=i.length-1;h<a;h+=2)r.x=i[h],r.y=i[h+1],rt(r,t,e,s),i[h]=r.x,i[h+1]=r.y}(t,e,s=at(s),this.pathData);var i=this.pathData.length;return this.lastPointX=this.pathData[i-2],this.lastPointY=this.pathData[i-1],this},scale(t,e,s,i){return 0===this.pathData.length||(function(t,e,s,i,r){for(var h=0,a=r.length-1;h<a;h+=2){var n=r[h]-t,o=r[h+1]-e;n*=s,o*=i,r[h]=n+t,r[h+1]=o+e}}(t,e,s,i,this.pathData),this.lastPointX=this.pathData[pathDataCnt-2],this.lastPointY=this.pathData[pathDataCnt-1]),this},offset(t,e){return ht(t,e,this.pathData),this}},ot={savePathData(){return this.pathDataSaved||(this.pathDataSave=[...this.pathData],this.pathData.length=0,this.pathDataSaved=!0),this},restorePathData(){return this.pathDataSaved?(function(t,e,s,i){void 0===s&&(s=0),void 0===i&&(i=e.length),t.length=i-s;for(var r=0,h=t.length;r<h;r++)t[r]=e[r+s]}(this.pathData,this.pathDataSave),this.pathDataSave=void 0,this.pathDataSaved=!1,this):this}};const lt=Phaser.Math.Distance.Between,ut=Phaser.Math.Wrap,dt=Phaser.Math.Linear;var pt=function(t,e,s,i,r){if(void 0===i&&(i=s,s=0),(s=vt(s))!==(i=vt(i))){var h=e[e.length-1],a=h*s,n=h*i;s<i?ct(t,e,a,n,r):(ct(t,e,a,h,r),ct(t,e,0,n,r)),st(r)}},ct=function(t,e,s,i,r){for(var h=s>0,a=0,n=e.length;a<n;a++){var o=2*a,l=e[a];if(h){if(l<s)continue;if(l==s)h=!1;else{var u=1-(l-s)/(l-e[a-1]);r.push(gt(t,o-2,o,u)),r.push(gt(t,o-1,o+1,u)),h=!1}}if(!(l<=i)){u=1-(l-i)/(l-e[a-1]),r.push(gt(t,o-2,o,u)),r.push(gt(t,o-1,o+1,u));break}if(r.push(t[o]),r.push(t[o+1]),l===i)break}},gt=function(t,e,s,i){var r=t[e],h=t[s];return dt(r,h,i)},vt=function(t){return 0===t?0:t%1==0?1:ut(t,0,1)},yt={updateAccumulationLengths(){if(null==this.accumulationLengths)this.accumulationLengths=[];else if(this.accumulationLengths.length===this.pathData.length/2)return this;for(var t,e,s,i,r=this.accumulationLengths,h=this.pathData,a=0,n=0,o=h.length;n<o;n+=2)s=h[n],i=h[n+1],a+=void 0===t?0:lt(t,e,s,i),r.push(a),t=s,e=i;return this.totalPathLength=a,this},setDisplayPathSegment(t,e){return this.pathDataSaved||(this.updateAccumulationLengths(),this.savePathData()),this.pathData.length=0,pt(this.pathDataSave,this.accumulationLengths,t,e,this.pathData),this},appendFromPathSegment(t,e,s){return void 0===e?this.pathData.push(...t.pathData):(t.updateAccumulationLengths(),pt(t.pathData,t.accumulationLengths,e,s,this.pathData)),this.firstPointX=this.pathData[0],this.firstPointY=this.pathData[1],this.lastPointX=this.pathData[this.pathData.length-2],this.lastPointY=this.pathData[this.pathData.length-1],this}},ft={draw(t,e,s){var i=this.toPoints();return e&&t.fillPoints(i,this.closePath,this.closePath),s&&t.strokePoints(i,this.closePath,this.closePath),this}};const St=Phaser.Geom.Polygon;class Pt{constructor(t){void 0===t&&(t=[]),this.pathData=t,this.closePath=!1,this.setIterations(32),this.firstPointX=void 0,this.firstPointY=void 0,this.lastPointX=void 0,this.lastPointY=void 0,this.accumulationLengths=void 0}setIterations(t){return this.iterations=t,this}toPoints(){return function(t,e){void 0===e&&(e=[]);for(var s=0,i=t.length-1;s<i;s+=2)e.push({x:t[s],y:t[s+1]});return e}(this.pathData)}toPolygon(t){return function(t,e){return void 0===e&&(e=new St),e.setTo(t),e}(this.pathData,t)}}Object.assign(Pt.prototype,it,nt,ot,yt,ft);class mt extends K{constructor(){super(),this.builder=new Pt(this.pathData)}get iterations(){return this.builder.iterations}set iterations(t){this.dirty=this.dirty||this.builder.iterations!==t,this.builder.setIterations(t)}setIterations(t){return this.iterations=t,this}get lastPointX(){return this.builder.lastPointX}get lastPointY(){return this.builder.lastPointY}start(){return this.builder.start(),this.dirty=!0,this}startAt(t,e){return this.builder.startAt(t,e),this.dirty=!0,this}lineTo(t,e,s){return this.builder.lineTo(t,e,s),this.dirty=!0,this}verticalLineTo(t,e){return this.builder.verticalLineTo(t,e),this.dirty=!0,this}horizontalLineTo(t,e){return this.builder.horizontalLineTo(t,e),this.dirty=!0,this}ellipticalArc(t,e,s,i,r,h,a){return this.builder.ellipticalArc(t,e,s,i,r,h,a),this.dirty=!0,this}arc(t,e,s,i,r,h){return this.builder.arc(t,e,s,i,r,h),this.dirty=!0,this}quadraticBezierTo(t,e,s,i){return this.builder.quadraticBezierTo(t,e,s,i),this.dirty=!0,this}cubicBezierTo(t,e,s,i,r,h){return this.builder.cubicBezierTo(t,e,s,i,r,h),this.dirty=!0,this}catmullRomTo(...t){return this.builder.catmullRomTo(...t),this.dirty=!0,this}close(){return this.builder.close(),this.closePath=this.builder.closePath,this.dirty=!0,this}end(){return this.builder.end(),this.dirty=!0,this}rotateAround(t,e,s){return this.builder.rotateAround(t,e,s),this.dirty=!0,this}scale(t,e,s,i){return this.builder.scale(t,e,s,i),this.dirty=!0,this}offset(t,e){return this.builder.offset(t,e),this.dirty=!0,this}toPolygon(t){return this.builder.toPolygon(t)}appendPathFrom(t,e,s){return this.builder.appendFromPathSegment(t.builder,e,s),this}copyPathFrom(t,e,s){return this.builder.clear().appendFromPathSegment(t.builder,e,s),this}setDisplayPathSegment(t,e){return this.builder.setDisplayPathSegment(t,e),this}}var xt=function(t,e){return void 0===e&&(e=.5),t<=e?t/=e:t=1-(t-e)/(1-e),t};const Dt=Phaser.Math.DegToRad,wt=Phaser.Math.Linear,bt=Phaser.Math.Easing.Expo.In,_t={right:0,down:1,left:2,up:3};var Rt=function(t,e,s,i,r,h,a,n,o,l,u){var d=kt(e,0,i,r,h,a,n,o,l,u);t.startAt(d.x,d.y);var p=kt(s,0,i,r,h,a,n,o,l,u);t.lineTo(p.x,p.y);var c=kt(s,s,i,r,h,a,n,o,l,u);t.lineTo(c.x,c.y);var g=kt(0,s,i,r,h,a,n,o,l,u);t.lineTo(g.x,g.y);var v=kt(0,e,i,r,h,a,n,o,l,u);t.lineTo(v.x,v.y);var y=kt(e,e,i,r,h,a,n,o,l,u);t.lineTo(y.x,y.y),t.close()},Tt={},kt=function(t,e,s,i,r,h,a,n,o,l){var u=t*s,d=e*i;return Tt.x=a*u+n*d+r,Tt.y=o*u+l*d+h,Tt},At={setDirection(t){return"string"==typeof t&&(t=_t[t]),this.direction=t,this},buildShapes(){for(var t=0;t<3;t++)this.addShape(new mt)},updateShapes(){var t,e,s,i,r,h;switch(this.direction){case 1:t=this.centerX,e=this.centerY-this.radius;var a=Dt(315);s=Math.cos(a),i=Math.sin(a);var n=Dt(45);r=Math.cos(n),h=Math.sin(n);break;case 3:t=this.centerX,e=this.centerY+this.radius,a=Dt(135),s=Math.cos(a),i=Math.sin(a),n=Dt(225),r=Math.cos(n),h=Math.sin(n);break;case 2:t=this.centerX+this.radius,e=this.centerY,a=Dt(225),s=Math.cos(a),i=Math.sin(a),n=Dt(315),r=Math.cos(n),h=Math.sin(n);break;default:t=this.centerX-this.radius,e=this.centerY,a=Dt(45),s=Math.cos(a),i=Math.sin(a),n=Dt(135),r=Math.cos(n),h=Math.sin(n)}for(var o=this.radius/7,l=this.getShapes(),u=0,d=l.length;u<d;u++){var p=l[u],c=(this.value+.1*(d-u))%1;c=bt(xt(c));var g=wt(.25,1,c);p.fillStyle(this.color,g);var v=3*u+1;Rt(p,v,v+2,o,o,t,e,s,i,r,h)}}};class Mt extends K{constructor(t,e,s,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=0),super(),this.setP0(t,e),this.setP1(s,i)}get x0(){return this._x0}set x0(t){this.dirty=this.dirty||this._x0!==t,this._x0=t}get y0(){return this._y0}set y0(t){this.dirty=this.dirty||this._y0!==t,this._y0=t}setP0(t,e){return this.x0=t,this.y0=e,this}get x1(){return this._x1}set x1(t){this.dirty=this.dirty||this._x1!==t,this._x1=t}get y1(){return this._y1}set y1(t){this.dirty=this.dirty||this._y1!==t,this._y1=t}setP1(t,e){return this.x1=t,this.y1=e,this}updateData(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x0,this.y0),super.updateData(),this}}const Ct=Phaser.Math.Linear;var Et={buildShapes(){for(var t=0;t<4;t++)this.addShape(new Mt);this.prevValue=void 0},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=t-s,r=e+s,h=2*s,a=this.getShapes(),n=a.length,o=2*s/n,l=.7*o;if(void 0===this.prevValue||this.prevValue>this.value)for(var u=0;u<n;u++){var d=a[u],p=void 0===this.prevValue?Math.random():d.getData("to");d.setData("from",p).setData("to",Math.random())}for(this.prevValue=this.value,u=0;u<n;u++){p=(d=a[u]).getData("from");var c=d.getData("to"),g=Ct(p,c,this.value)*h,v=i+o*(u+.5);d.lineStyle(l,this.color,1).setP0(v,r).setP1(v,r-g)}}};const Lt=Phaser.Math.DegToRad;class Ot extends K{constructor(t,e,s,i,r,h,a,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===h&&(h=360),void 0===a&&(a=!1),void 0===n&&(n=!1),super(),this.setCenterPosition(t,e),this.setRadius(s,i),this.setAngle(r,h,a),this.setPie(n),this.setIterations(32)}get x(){return this._x}set x(t){this.dirty=this.dirty||this._x!==t,this._x=t}get y(){return this._y}set y(t){this.dirty=this.dirty||this._y!==t,this._y=t}setCenterPosition(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this}get radiusX(){return this._radiusX}set radiusX(t){this.dirty=this.dirty||this._radiusX!==t,this._radiusX=t}get radiusY(){return this._radiusY}set radiusY(t){this.dirty=this.dirty||this._radiusY!==t,this._radiusY=t}setRadius(t,e){return void 0===e&&(e=t),this.radiusX=t,this.radiusY=e,this}get startAngle(){return this._startAngle}set startAngle(t){this.dirty=this.dirty||this._startAngle!==t,this._startAngle=t}get endAngle(){return this._endAngle}set endAngle(t){this.dirty=this.dirty||this._endAngle!==t,this._endAngle=t}get anticlockwise(){return this._anticlockwise}set anticlockwise(t){this.dirty=this.dirty||this._anticlockwise!==t,this._anticlockwise=t}setAngle(t,e,s){return void 0===s&&(s=!1),this.startAngle=t,this.endAngle=e,this.anticlockwise=s,this}get pie(){return this._pie}set pie(t){this.dirty=this.dirty||this._pie!==t,this._pie=t}setPie(t){return void 0===t&&(t=!0),this.pie=t,this}get iterations(){return this._iterations}set iterations(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t}setIterations(t){return this.iterations=t,this}updateData(){return this.pathData.length=0,this.pie&&this.pathData.push(this.x,this.y),$(this.x,this.y,this.radiusX,this.radiusY,this.startAngle,this.endAngle,this.anticlockwise,this.iterations,this.pathData),this.pie&&this.pathData.push(this.x,this.y),this.pathData.push(this.pathData[0],this.pathData[1]),super.updateData(),this}canvasRender(t,e,s){t.beginPath();var i=this.x-e,r=this.y-s,h=Lt(this.startAngle),a=Lt(this.endAngle);this.pie&&(t.moveTo(i,r),t.lineTo(i+Math.cos(h)*this.radiusX,r+Math.sin(h)*this.radiusY)),t.ellipse(i,r,this.radiusX,this.radiusY,0,h,a,this.anticlockwise),this.pie&&t.lineTo(i,r),this.isFilled&&(W(t,this),t.fill()),this.isStroked&&(H(t,this),t.stroke())}}class Xt extends Ot{constructor(t,e,s){super(t,e,s,s,0,360)}}const Yt=Phaser.Math.Linear;var jt={buildShapes(){for(var t=0;t<3;t++)this.addShape(new Xt)},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=.1*s,r=Math.ceil(.25*i),h=1-xt(this.value),a=Yt(.3,.9,h)*s,n=this.getShapes(),o=0,l=n.length;o<l;o++){var u=n[o],d=(h=(this.value+o/l)%1,2*Math.PI*h);u.lineStyle(r,this.color).setRadius(i).setCenterPosition(t+Math.cos(d)*a,e+Math.sin(d)*a)}}};const It=Phaser.Math.Linear,Bt=Phaser.Math.Easing.Expo.In;var Vt={buildShapes(){for(var t=0;t<5;t++){var e=new Mt;this.addShape(e);var s=xt(t/4)/2;e.setData("offset",s)}},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=t-s,r=2*s,h=this.getShapes(),a=h.length,n=2*s/a,o=.7*n,l=0;l<a;l++){var u=h[l],d=(this.value+u.getData("offset"))%1;d=Bt(xt(d));var p=It(.4,1,d)*r,c=i+n*(l+.5);u.lineStyle(o,this.color,1).setP0(c,e-p/2).setP1(c,e+p/2)}}},zt={buildShapes(){this.addShape((new mt).setName("border")),this.addShape((new mt).setName("fill"))},updateShapes(){var t=this.centerX,e=this.centerY,s=.7*this.radius,i=t-s,r=e-s,h=2*s;if(this.getShape("border").lineStyle(2,this.color,1).startAt(i,r).lineTo(h,0,!0).lineTo(0,h,!0).lineTo(-h,0,!0).lineTo(0,-h,!0).close(),this.value<.5){var a=h*(2*(.5-this.value));this.getShape("fill").fillStyle(this.color,1).startAt(i,r).lineTo(h,0,!0).lineTo(0,a,!0).lineTo(-h,0,!0).lineTo(0,-a,!0).close()}else{var n=2*(this.value-.5)*180;this.getShape("border").rotateAround(t,e,n),this.getShape("fill").fillStyle().lineStyle()}}};const Ft=Phaser.Math.RadToDeg,Nt=Phaser.Math.Angle.WrapDegrees,Gt=Phaser.Math.Angle.Wrap,Ut=Phaser.Math.Angle.ShortestBetween,Wt=Phaser.Math.DegToRad,Ht=Phaser.Math.DegToRad(270);var Jt={buildShapes(){this.addShape((new Xt).setName("border")),this.addShape((new Mt).setName("minuteHand")),this.addShape((new Mt).setName("hourHand")),this.minuteHandAngle=0,this.hourHandAngle=0},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=Math.ceil(s/25),r=s-i/2,h=.8*s,a=.5*s,n=this.minuteHandAngle;this.minuteHandAngle=2*Math.PI*this.value;var o=Nt(Ft(n)),l=Nt(Ft(this.minuteHandAngle)),u=Ut(o,l);this.hourHandAngle=Gt(this.hourHandAngle+Wt(u)/12),this.getShape("border").lineStyle(i,this.color).setRadius(r).setCenterPosition(t,e);var d=this.minuteHandAngle+Ht;this.getShape("minuteHand").lineStyle(i,this.color).setP0(t,e).setP1(t+Math.cos(d)*h,e+Math.sin(d)*h),d=this.hourHandAngle+Ht,this.getShape("hourHand").lineStyle(i,this.color).setP0(t,e).setP1(t+Math.cos(d)*a,e+Math.sin(d)*a)}};const Kt=Phaser.Math.Linear,qt=Phaser.Math.Easing.Expo.In;var Qt={buildShapes(){for(var t=0;t<4;t++){var e=new Mt;this.addShape(e)}},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=t-s,r=e-s,h=2*s/2,a=2*s/2,n=this.getShapes(),o=n.length,l=0;l<o;l++){var u=i+h*(l%2+.5),d=r+a*(Math.floor(l/2)+.5),p=n[l],c=(this.value+.1*(o-l))%1;c=qt(xt(c));var g=(o-l)/o,v=Kt(.7,1,c)*a,y=Kt(.7,1,c)*h;p.lineStyle(y,this.color,g).setP0(u-v/2,d).setP1(u+v/2,d)}}};const $t=Phaser.Math.Linear;var Zt={buildShapes(){for(var t=0;t<3;t++){var e=new Xt;this.addShape(e);var s=xt(t/2)/2;e.setData("offset",s)}},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=t-s,r=this.getShapes(),h=r.length,a=2*s/h,n=a/2,o=0;o<h;o++){var l=r[o],u=(this.value+l.getData("offset"))%1;u=xt(u);var d=$t(.25,1,u),p=$t(.5,1,u)*n;l.fillStyle(this.color,d).setRadius(p).setCenterPosition(i+a*(o+.5),e)}}};const te=Phaser.Math.Linear,ee=Phaser.Math.Easing.Expo.In;var se={buildShapes(){for(var t=0;t<3;t++){var e=new Mt;this.addShape(e)}},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=t-s,r=this.getShapes(),h=r.length,a=2*s/h,n=2*s,o=0;o<h;o++){var l=r[o],u=(this.value+.1*(h-o))%1;u=ee(xt(u));var d=(o+1)/h,p=te(.7,1,u)*n,c=te(.7,1,u)*a,g=i+a*(o+.5);l.lineStyle(c,this.color,d).setP0(g,e-p/2).setP1(g,e+p/2)}}};const ie=Phaser.Math.Linear;var re={buildShapes(){for(var t=0;t<9;t++){var e=new Xt;this.addShape(e),e.setData("offset",Math.random())}this.isInitialize=!0},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=this.isInitialize||this.isSizeChanged,r=t-s,h=e-s,a=2*s/3,n=2*s/3,o=Math.min(a,n)/2*.8,l=this.getShapes(),u=0,d=l.length;u<d;u++){var p=r+a*(u%3+.5),c=h+n*(Math.floor(u/3)+.5),g=l[u],v=(this.value+g.getData("offset"))%1;v=xt(v),g.fillStyle(this.color,ie(.25,1,v)),i&&g.setRadius(o).setCenterPosition(p,c)}this.isInitialize=!1}},he={buildShapes(){for(var t=0;t<2;t++)this.addShape(new mt)},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=Math.ceil(s/25),r=s-i,h=.6*r,a=.7*r,n=1.2*r,o=this.getShapes(),l=0,u=o.length;l<u;l++){var d=o[l],p=(this.value+l/u)%1,c=xt(p),g=t,v=e-15*p,y=r*p,f=h*p,S=a*p,P=n*p;d.lineStyle(i,this.color,c).startAt(g,v).cubicBezierTo(g,v-f,g-y,v-f,g-y,v).cubicBezierTo(g-y,v+f,g,v+S,g,v+P).cubicBezierTo(g,v+S,g+y,v+f,g+y,v).cubicBezierTo(g+y,v-f,g,v-f,g,v).close()}}};const ae=Phaser.Math.Linear;var ne={buildShapes(){for(var t=0;t<12;t++)this.addShape(new Mt);this.isInitialize=!0},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.isInitialize||this.isSizeChanged,i=this.radius,r=i/2,h=Math.ceil(i/20),a=this.getShapes(),n=0,o=a.length;n<o;n++){var l=a[n],u=n/o,d=2*Math.PI*u,p=ae(.25,1,(1-this.value+u)%1);l.lineStyle(h,this.color,p),s&&l.setP0(t+Math.cos(d)*r,e+Math.sin(d)*r).setP1(t+Math.cos(d)*i,e+Math.sin(d)*i)}this.isInitialize=!1}},oe={buildShapes(){this.addShape((new Xt).setName("track")),this.addShape((new Xt).setName("thumb"))},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=.9*s,r=Math.ceil(i/25),h=.1*s,a=2*Math.PI*this.value;this.getShape("track").lineStyle(r,this.color,.7).setRadius(i).setCenterPosition(t,e),this.getShape("thumb").fillStyle(this.color).setRadius(h).setCenterPosition(t+Math.cos(a)*i,e+Math.sin(a)*i)}},le={buildShapes(){this.addShape((new Xt).setName("track")),this.addShape((new Ot).setName("arc"))},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=Math.ceil(s/25),r=s-i/2;this.getShape("track").lineStyle(i,this.color,.5).setRadius(r).setCenterPosition(t,e);var h=360*this.value,a=h+60;this.getShape("arc").lineStyle(i,this.color,1).setRadius(r).setCenterPosition(t,e).setAngle(h,a)}};const ue=Phaser.Math.Linear;var de={buildShapes(){for(var t=0;t<4;t++){var e=(new Ot).setPie();this.addShape(e),e.setData("speed",ue(180,360,Math.random()))}this.prevValue=void 0},updateShapes(){var t,e=this.centerX,s=this.centerY,i=this.radius;void 0!==this.prevValue&&(t=this.value-this.prevValue,this.prevValue>this.value&&(t+=1));for(var r=this.getShapes(),h=0,a=r.length;h<a;h++){var n=r[h],o=(h+1)/a;if(void 0===this.prevValue){var l=90+(u=h/a*360);n.fillStyle(this.color,o).setRadius(i).setCenterPosition(e,s).setAngle(u,l).setData("angle",u)}else{var u=n.getData("angle")+n.getData("speed")*t;l=90+(u%=360),n.fillStyle(this.color,o).setRadius(i).setCenterPosition(e,s).setAngle(u,l).setData("angle",u)}}this.prevValue=this.value}},pe={buildShapes(){this.addShape(new Xt)},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=s*this.value,r=Math.ceil(s/25),h=xt(this.value);this.getShapes()[0].lineStyle(r,this.color,h).setRadius(i).setCenterPosition(t,e)}};const ce=Phaser.Math.Linear,ge=Phaser.Math.Easing.Expo.In;var ve={buildShapes(){this.addShape((new Xt).setName("center")),this.addShape((new mt).setName("arc0")),this.addShape((new mt).setName("arc1")),this.isInitialize=!0},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=this.isInitialize||this.isSizeChanged,r=2*s/6,h=t-s+r,a=e+s-r,n=this.getShapes(),o=0,l=n.length;o<l;o++){var u=n[o],d=(this.value+.1*(l-o))%1;d=ge(xt(d));var p=ce(.25,1,d);switch(u.name){case"center":u.fillStyle(this.color,p),i&&u.setRadius(r).setCenterPosition(h,a);break;case"arc0":if(u.fillStyle(this.color,p),i){var c=2*r,g=3*r;u.startAt(h,a-c).lineTo(h,a-g).setIterations(8).arc(h,a,g,270,360).lineTo(h+c,a).setIterations(6).arc(h,a,c,360,270,!0).close()}break;case"arc1":u.fillStyle(this.color,p),i&&(c=4*r,g=5*r,u.startAt(h,a-c).lineTo(h,a-g).setIterations(8).arc(h,a,g,270,360).lineTo(h+c,a).setIterations(6).arc(h,a,c,360,270,!0).close())}}this.isInitialize=!1}},ye={buildShapes(){for(var t=0;t<2;t++)this.addShape(new Xt)},updateShapes(){for(var t=this.centerX,e=this.centerY,s=this.radius,i=Math.ceil(s/25),r=s-i,h=this.getShapes(),a=0,n=h.length;a<n;a++){var o=h[a],l=(this.value+a/n)%1,u=xt(l);o.lineStyle(i,this.color,u).setRadius(l*r).setCenterPosition(t,e)}}},fe={buildShapes(){this.addShape((new Ot).setName("arc"))},updateShapes(){var t=this.centerX,e=this.centerY,s=this.radius,i=Math.ceil(s/10),r=s-i,h=720*this.value,a=h-180*xt(this.value);this.getShape("arc").lineStyle(i,this.color,1).setRadius(r).setCenterPosition(t,e).setAngle(a+315,h+315)}};Phaser.Utils.Objects.GetValue;const Se={leftArrow:At,rightArrow:At,upArrow:At,downArrow:At,audio:Et,ball:jt,bars:Vt,box:zt,clock:Jt,cube:Qt,dots:Zt,facebook:se,grid:re,hearts:he,ios:ne,oribit:oe,oval:le,pie:de,puff:pe,radio:ve,rings:ye,spinner:fe},Pe=[];for(var me in Se)Pe.push(me);const xe=Phaser.Utils.Array.GetRandom;var De={setAnimationMode(t,e){Se.hasOwnProperty(t)||(t=xe(Pe)),this.animationMode=t;var s=Se[t];switch(e&&this.resetFromConfig(e),t){case"leftArrow":s.setDirection.call(this,"left");break;case"rightArrow":s.setDirection.call(this,"right");break;case"upArrow":s.setDirection.call(this,"up");break;case"downArrow":s.setDirection.call(this,"down")}return this.clear(),s.buildShapes.call(this),this.updateShapes=s.updateShapes.bind(this),this.stop().start(),this},setRandomAnimationMode(t){var e=xe(Pe);return this.setAnimationMode(e,t),this}};const we=Phaser.Utils.Objects.GetValue;class be extends B{constructor(t,e){super(t,e),this.type="rexSpinnerAIO",this.setAnimationMode(we(e,"animationMode"))}}Object.assign(be.prototype,De);var _e=function(t){return null==t||""===t||0===t.length},Re=function(t,e,s,i){if(void 0===i&&(i="."),"object"==typeof t){if(_e(e)){if(null==s)return;"object"==typeof s&&(t=s)}else{"string"==typeof e&&(e=e.split(i));var r=e.pop(),h=function(t,e,s){var i=t;if(_e(e));else{var r;"string"==typeof e&&(e=e.split("."));for(var h=0,a=e.length;h<a;h++){var n;null!=i[r=e[h]]&&"object"==typeof i[r]||(n=h===a-1?void 0===s?{}:s:{},i[r]=n),i=i[r]}}return i}(t,e);h[r]=s}return t}};t.register("aio",(function(t){var e=new be(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.AIO",be);class Te extends B{constructor(t,e){super(t,e),this.type="rexSpinnerAudio"}}Object.assign(Te.prototype,Et),t.register("audio",(function(t){var e=new Te(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Audio",Te);const ke=Phaser.Utils.Objects.GetValue;class Ae extends B{constructor(t,e){super(t,e),this.type="rexSpinnerArrow"}resetFromConfig(t,e){var s;return void 0===e&&(e=!1),super.resetFromConfig(t,e),s=e?"down":this.direction,this.setDirection(ke(t,"direction",s)),this}}Object.assign(Ae.prototype,At),t.register("arrow",(function(t){var e=new Ae(this.scene,t);return this.scene.add.existing(e),e}));const Me=["left","right","up","down"];for(var Ce=0,Ee=Me.length;Ce<Ee;Ce++){let e=Me[Ce];t.register(`${e}Arrow`,(function(t){void 0===t&&(t={}),t.direction=e;var s=new Ae(this.scene,t);return this.scene.add.existing(s),s}))}Re(window,"RexPlugins.Spinner.Arrow",Ae);class Le extends B{constructor(t,e){super(t,e),this.type="rexSpinnerBall"}}Object.assign(Le.prototype,jt),t.register("ball",(function(t){var e=new Le(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Ball",Le);class Oe extends B{constructor(t,e){super(t,e),this.type="rexSpinnerBars"}}Object.assign(Oe.prototype,Vt),t.register("bars",(function(t){var e=new Oe(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Bars",Oe);class Xe extends B{constructor(t,e){super(t,e),this.type="rexSpinnerBox"}}Object.assign(Xe.prototype,zt),t.register("box",(function(t){var e=new Xe(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Box",Xe);class Ye extends B{constructor(t,e){super(t,e),this.type="rexSpinnerClock"}}Object.assign(Ye.prototype,Jt),t.register("clock",(function(t){var e=new Ye(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Clock",Ye);class je extends B{constructor(t,e){super(t,e),this.type="rexSpinnerCube"}}Object.assign(je.prototype,Qt),t.register("cube",(function(t){var e=new je(this.scene,t);return this.scene.add.existing(e),e})),Re(window,"RexPlugins.Spinner.Cube",je);var Ie=Phaser.Renderer.WebGL.Utils;const Be=Phaser.Utils.Objects.GetValue;var Ve=Phaser.Renderer.WebGL.Utils;const ze={arc:Ot,circle:Xt,curve:class extends K{constructor(t){super(),this.setCurve(t),this.setIterations(32)}get curve(){return this._curve}set curve(t){this.dirty=this.dirty||this._curve!==t,this._curve=t}setCurve(t){return this.curve=t,this}get iterations(){return this._iterations}set iterations(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t}setIterations(t){return this.iterations=t,this}updateData(){this.pathData.length=0;for(var t=this.curve.getPoints(this.iterations),e=0,s=t.length;e<s;e++)this.pathData.push(t[e].x,t[e].y);return this.pathData.push(t[0].x,t[0].y),super.updateData(),this}},ellipse:class extends Ot{constructor(t,e,s,i){super(t,e,s,i,0,360)}},line:Mt,lines:mt,rectangle:class extends F{constructor(t,e,s,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=s),super(),this.pathData=[],this.closePath=!0,this.setTopLeftPosition(t,e),this.setSize(s,i)}get x(){return this._x}set x(t){this.dirty=this.dirty||this._x!==t,this._x=t}get y(){return this._y}set y(t){this.dirty=this.dirty||this._y!==t,this._y=t}setTopLeftPosition(t,e){return this.x=t,this.y=e,this}get width(){return this._width}set width(t){this.dirty=this.dirty||this._width!==t,this._width=t}get height(){return this._height}set height(t){this.dirty=this.dirty||this._height!==t,this._height=t}setSize(t,e){return this.width=t,this.height=e,this}get centerX(){return this.x+this.width/2}set centerX(t){this.x=t-this.width/2}get centerY(){return this.y+this.height/2}set centerY(t){this.y=t-this.height/2}setCenterPosition(t,e){return this.centerX=t,this.centerY=e,this}updateData(){this.pathData.length=0;var t=this.x,e=t+this.width,s=this.y,i=s+this.height;return this.pathData.push(t,s),this.pathData.push(e,s),this.pathData.push(e,i),this.pathData.push(t,i),this.pathData.push(t,s),super.updateData(),this}webglRender(t,e,s,i,r,h,a){if(this.isFilled){var n=Ie.getTintAppendFloatAlpha(this.fillColor,this.fillAlpha*r);(i.customRenderNodes.FillRect||i.defaultRenderNodes.FillRect).run(t,s,e,-h+this.x,-a+this.y,this.width,this.height,n,n,n,n)}this.isStroked&&U(t,e,s,i,this,r,h,a)}canvasRender(t,e,s){this.isFilled&&(W(t,this),t.fillRect(-e,-s,this.width,this.height)),this.isStroked&&(H(t,this),t.beginPath(),t.rect(-e,-s,this.width,this.height),t.stroke())}},roundRectangle:class extends K{constructor(t,e,s,i,r,h){void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=s),void 0===r&&(r=0),void 0===h&&(h=6),super(),this.setTopLeftPosition(t,e),this.setSize(s,i),this.setRadius(r),this.setIterations(h),this.closePath=!0}get x(){return this._x}set x(t){this.dirty=this.dirty||this._x!==t,this._x=t}get y(){return this._y}set y(t){this.dirty=this.dirty||this._y!==t,this._y=t}setTopLeftPosition(t,e){return this.x=t,this.y=e,this}get width(){return this._width}set width(t){this.dirty=this.dirty||this._width!==t,this._width=t}get height(){return this._height}set height(t){this.dirty=this.dirty||this._height!==t,this._height=t}setSize(t,e){return this.width=t,this.height=e,this}get centerX(){return this.x+this.width/2}set centerX(t){this.x=t-this.width/2}get centerY(){return this.y+this.height/2}set centerY(t){this.y=t-this.height/2}setCenterPosition(t,e){return this.centerX=t,this.centerY=e,this}get radiusTL(){return this._radiusTL}set radiusTL(t){var e=t>0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==e,this._convexTL=e,this._radiusTL=Math.abs(t)}get radiusTR(){return this._radiusTR}set radiusTR(t){var e=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==e,this._convexTR=e,this._radiusTR=Math.abs(t)}get radiusBL(){return this._radiusBL}set radiusBL(t){var e=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==e,this._convexBL=e,this._radiusBL=Math.abs(t)}get radiusBR(){return this._radiusBR}set radiusBR(t){var e=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==e,this._convexBR=e,this._radiusBR=Math.abs(t)}get radius(){return Math.max(this.radiusTL,this.radiusTR,this.radiusBL,this.radiusBR)}set radius(t){"number"==typeof t?(this.radiusTL=t,this.radiusTR=t,this.radiusBL=t,this.radiusBR=t):(this.radiusTL=Be(t,"tl",0),this.radiusTR=Be(t,"tr",0),this.radiusBL=Be(t,"bl",0),this.radiusBR=Be(t,"br",0))}setRadius(t){return void 0===t&&(t=0),this.radius=t,this}get iterations(){return this._iterations}set iterations(t){this.dirty=this.dirty||this._iterations!==t,this._iterations=t}setIterations(t){return this.iterations=t,this}updateData(){var t=this.pathData;t.length=0;var e,s=this.width,i=this.height,r=this.iterations+1;return(e=this.radiusTL)>0?this._convexTL?$(e,e,e,e,180,270,!1,r,t):$(0,0,e,e,90,0,!0,r,t):q(0,0,t),(e=this.radiusTR)>0?this._convexTR?$(s-e,e,e,e,270,360,!1,r,t):$(s,0,e,e,180,90,!0,r,t):q(s,0,t),(e=this.radiusBR)>0?this._convexBR?$(s-e,i-e,e,e,0,90,!1,r,t):$(s,i,e,e,270,180,!0,r,t):q(s,i,t),(e=this.radiusBL)>0?this._convexBL?$(e,i-e,e,e,90,180,!1,r,t):$(0,i,e,e,360,270,!0,r,t):q(0,i,t),t.push(t[0],t[1]),ht(this.x,this.y,t),super.updateData(),this}},triangle:class extends F{constructor(t,e,s,i,r,h){void 0===t&&(t=0),void 0===e&&(e=0),void 0===s&&(s=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===h&&(h=0),super(),this.pathData=[],this.closePath=!0,this.setP0(t,e),this.setP1(s,i),this.setP2(r,h)}get x0(){return this._x0}set x0(t){this.dirty=this.dirty||this._x0!==t,this._x0=t}get y0(){return this._y0}set y0(t){this.dirty=this.dirty||this._y0!==t,this._y0=t}setP0(t,e){return this.x0=t,this.y0=e,this}get x1(){return this._x1}set x1(t){this.dirty=this.dirty||this._x1!==t,this._x1=t}get y1(){return this._y1}set y1(t){this.dirty=this.dirty||this._y1!==t,this._y1=t}setP1(t,e){return this.x1=t,this.y1=e,this}get x2(){return this._x2}set x2(t){this.dirty=this.dirty||this._x2!==t,this._x2=t}get y2(){return this._y2}set y2(t){this.dirty=this.dirty||this._y2!==t,this._y2=t}setP2(t,e){return this.dirty=this.dirty||this.x2!==t||this.y2!==e,this.x2=t,this.y2=e,this}updateData(){return this.pathData.length=0,this.pathData.push(this.x0,this.y0),this.pathData.push(this.x1,this.y1),this.pathData.push(this.x2,this.y2),this.pathData.push(this.x0,this.y0),super.updateData(),this}webglRender(t,e,s,i,r,h,a){if(this.isFilled){var n=Ve.getTintAppendFloatAlpha(this.fillColor,this.fillAlpha*r),o=this.x0-h,l=this.y0-a,u=this.x1-h,d=this.y1-a,p=this.x2-h,c=this.y2-a;(i.customRenderNodes.FillTri||i.defaultRenderNodes.FillTri).run(t,s,e,o,l,u,d,p,c,n,n,n)}this.isStroked&&U(t,e,s,i,this,r,h,a)}canvasRender(t,e,s){var i=this.x1-e,r=this.y1-s,h=this.x2-e,a=this.y2-s,n=this.x3-e,o=this.y3-s;t.beginPath(),t.moveTo(i,r),t.lineTo(h,a),t.lineTo(n,o),t.closePath(),this.isFilled&&(W(t,this),t.fill()),this.isStroked&&(H(t,this),t.stroke())}}},Fe=Phaser.Utils.Objects.GetValue,Ne=Phaser.Utils.Objects.IsPlainObject,Ge=function(){for(var t=this.getShapes(),e=0,s=t.length;e<s;e++)t[e].lineStyle().fillStyle()};var Ue={createSha