phaser3-rex-plugins
Version:
8 lines (7 loc) • 38 kB
JavaScript
var t,i;t=void 0,i=function(){const t=Phaser.GameObjects.GetCalcMatrix,i=Phaser.Renderer.Canvas.SetTransform;var s={renderWebGL:function(i,s,e,h){s.updateData(),e.addToRenderList(s);var r=i.pipelines.set(s.pipeline),a=t(s,e,h),n=r.calcMatrix.copyFrom(a.calc),o=s._displayOriginX,l=s._displayOriginY,u=e.alpha*s.alpha;i.pipelines.preBatch(s);for(var d,p=s.geom,c=0,v=p.length;c<v;c++)(d=p[c]).visible&&d.webglRender(r,n,u,o,l);i.pipelines.postBatch(s)},renderCanvas:function(t,s,e,h){s.updateData(),e.addToRenderList(s);var r=t.currentContext;if(i(t,r,s,e,h)){for(var a,n=s._displayOriginX,o=s._displayOriginY,l=s.geom,u=0,d=l.length;u<d;u++)(a=l[u]).visible&&a.canvasRender(r,n,o);r.restore()}}},e=function(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))t.length=0;else for(var i in t)delete t[i];return t};const h=Phaser.GameObjects.Shape,r=Phaser.Utils.Array.Remove;class a extends h{constructor(t,i,s,e,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===e&&(e=2),void 0===h&&(h=e),super(t,"rexShapes",[]),this._width=-1,this._height=-1,this.dirty=!0,this.isSizeChanged=!0,this.shapes={},this.setPosition(i,s),this.setSize(e,h),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,i){this.isSizeChanged=this.isSizeChanged||this._width!==t||this._height!==i,this.dirty=this.dirty||this.isSizeChanged,this._width=t,this._height=i,this.updateDisplayOrigin();var s=this.input;return s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=i),this}resize(t,i){return this.setSize(t,i),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,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.fillColor!==t||this.fillAlpha!==i,this._fillColor=t,this._fillAlpha=i,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,i,s){return void 0===s&&(s=1),this.dirty=this.dirty||this.lineWidth!==t||this.strokeColor!==i||this.strokeAlpha!==s,this._lineWidth=t,this._strokeColor=i,this._strokeAlpha=s,this}updateShapes(){}updateData(){if(!this.dirty)return this;this.updateShapes();for(var t=this.geom,i=0,s=t.length;i<s;i++){var e=t[i];e.dirty&&e.updateData()}return this.isSizeChanged=!1,this.dirty=!1,this}clear(){return this.geom.length=0,e(this.shapes),this.dirty=!0,this}getShape(t){return this.shapes[t]}getShapes(){return this.geom}addShape(t){this.geom.push(t);var i=t.name;return i&&(this.shapes[i]=t),this.dirty=!0,this}deleteShape(t){var i=this.getShape(t);return i&&(delete this.shapes[t],r(this.geom,i)),this}}Object.assign(a.prototype,s);var n={setTrackFillStyle(t,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.trackFillColor!==t||this.trackFillAlpha!==i,this.trackFillColor=t,this.trackFillAlpha=i,this},setFalseValueTrackFillStyle(t,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.falseValueTrackColor!==t||this.uncheckedTrackFillAlpha!==i,this.falseValueTrackColor=t,this.falseValueTrackFillAlpha=i,this},setThumbStyle(t,i){return void 0===i&&(i=1),this.dirty=this.dirty||this.thumbColor!==t||this.checkAlpha!==i,this.thumbColor=t,this.thumbAlpha=i,this}},o={setTrackSize(t,i){return this.dirty=this.dirty||this.trackWidth!==t||this.trackHeight!==i,this.trackWidth=t,this.trackHeight=i,this},setTrackRadius(t){return this.dirty=this.dirty||this.trackRadius!==t,this.trackRadius=t,this},setThumbSize(t,i){return void 0===i&&(i=t),this.dirty=this.dirty||this.thumbWidth!==t||this.thumbHeight!==i,this.thumbWidth=t,this.thumbHeight=i,this},setThumbRadius(t){return this.dirty=this.dirty||this.thumbRadius!==t,this.thumbRadius=t,this}},l={setThumbPosition(t,i){return void 0===i&&(i=1-t),this.thumbLeftX=t,this.thumbRightX=i,this},setRTL(t){return void 0===t&&(t=!0),this.rtl=t,this}},u={fillStyle:function(t,i){return null==t?this.isFilled=!1:(void 0===i&&(i=1),this.isFilled=!0,this.fillColor=t,this.fillAlpha=i),this},lineStyle:function(t,i,s){return null==t||null==i?this.isStroked=!1:(void 0===s&&(s=1),this.isStroked=!0,this.lineWidth=t,this.strokeColor=i,this.strokeAlpha=s),this}},d=function(t,i,s){for(var e=t,h=s,r=0,a=i.length;r<a;r++){var n=i[r];if(!e||"object"!=typeof e&&"function"!=typeof e||!(n in e))return p.found=!1,p;e=h=e[n]}return p.found=!0,p.value=h,p},p={},c={enableData(){return void 0===this.data&&(this.data={}),this},setData(t,i){if(this.enableData(),1===arguments.length){var s=t;for(t in s)this.data[t]=s[t]}else this.data[t]=i;return this},getData(t,i){return this.enableData(),void 0===t?this.data:function(t,i,s,e){var h=t&&("object"==typeof t||"function"==typeof t),r=e&&("object"==typeof e||"function"==typeof e);if(!h&&!r)return s;var a=String(i);if(h&&a in t)return t[a];if(r&&a in e)return e[a];if(-1===a.indexOf("."))return s;var n=a.split(".");if(h){var o=d(t,n,s);if(o.found)return o.value}if(r){var l=d(e,n,s);if(l.found)return l.value}return s}(this.data,t,i)},incData(t,i,s){return void 0===s&&(s=0),this.enableData(),this.setData(t,this.getData(t,s)+i),this},mulData(t,i,s){return void 0===s&&(s=0),this.enableData(),this.setData(t,this.getData(t,s)*i),this},clearData(){return this.data&&e(this.data),this}};class v{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,i,s,e,h){}canvasRender(t,i,s){}updateData(){this.dirty=!1}}Object.assign(v.prototype,u,c);var g=Phaser.Renderer.WebGL.Utils,y=function(t,i,s,e,h,r){for(var a=g.getTintAppendFloatAlpha(s.fillColor,s.fillAlpha*e),n=s.pathData,o=s.pathIndexes,l=0;l<o.length;l+=3){var u=2*o[l],d=2*o[l+1],p=2*o[l+2],c=n[u+0]-h,v=n[u+1]-r,y=n[d+0]-h,m=n[d+1]-r,f=n[p+0]-h,P=n[p+1]-r,D=i.getX(c,v),k=i.getY(c,v),_=i.getX(y,m),T=i.getY(y,m),b=i.getX(f,P),S=i.getY(f,P);t.batchTri(s,D,k,_,T,b,S,0,0,1,1,a,a,a,2)}},m=Phaser.Renderer.WebGL.Utils,f=function(t,i,s,e,h){var r=t.strokeTint,a=m.getTintAppendFloatAlpha(i.strokeColor,i.strokeAlpha*s);r.TL=a,r.TR=a,r.BL=a,r.BR=a;var n,o,l=i.isDashed&&!!i.strokePathData,u=l?i.strokePathData:i.pathData,d=u.length-1,p=i.lineWidth,c=p/2,v=u[0]-e,g=u[1]-h;if(i.closePath||(d-=2),l){var y=i.strokePathMask,f=0,P=0;for(D=2;D<d;D+=2)n=u[D]-e,o=u[D+1]-h,y[f]?(t.batchLine(v,g,n,o,c,c,p,P,!1),P++):P=0,v=n,g=o,f++}else for(var D=2;D<d;D+=2)n=u[D]-e,o=u[D+1]-h,t.batchLine(v,g,n,o,c,c,p,D-2,!!i.closePath&&D===d-1),v=n,g=o},P=function(t,i,s,e){var h=s||i.fillColor,r=e||i.fillAlpha,a=(16711680&h)>>>16,n=(65280&h)>>>8,o=255&h;t.fillStyle="rgba("+a+","+n+","+o+","+r+")"},D=function(t,i,s,e){var h=i.pathData;if(h&&!(h.length<4)){var r=h.length-1,a=h[0]-s,n=h[1]-e;t.beginPath(),t.moveTo(a,n),i.closePath||(r-=2);for(var o=2;o<r;o+=2){var l=h[o]-s,u=h[o+1]-e;t.lineTo(l,u)}i.closePath&&t.closePath(),P(t,i),t.fill()}},k=function(t,i,s,e){var h=i.isDashed&&!!i.strokePathData,r=h?i.strokePathData:i.pathData;if(r&&!(r.length<4)){var a=r.length-1,n=r[0]-s,o=r[1]-e;if(function(t,i,s,e){var h=s||i.strokeColor,r=e||i.strokeAlpha,a=(16711680&h)>>>16,n=(65280&h)>>>8,o=255&h;t.strokeStyle="rgba("+a+","+n+","+o+","+r+")",t.lineWidth=i.lineWidth}(t,i),t.beginPath(),i.closePath||(a-=2),h){var l=i.strokePathMask,u=0;for(d=2;d<a;d+=2)p=r[d]-s,c=r[d+1]-e,l[u]&&(t.moveTo(n,o),t.lineTo(p,c)),n=p,o=c,u++}else{t.moveTo(n,o);for(var d=2;d<a;d+=2){var p=r[d]-s,c=r[d+1]-e;t.lineTo(p,c)}i.closePath&&t.closePath()}t.stroke()}};const _=1e-6,T=10,b=.5;var S=function(t,i){return function(t){if(!Array.isArray(t))return null;for(var i=[],s=0,e=t.length;s<e;s++){var h=Number(t[s]);isFinite(h)&&h>0&&i.push(h)}return i.length>0?i:null}(t)||function(t,i){var{segments:s=T,drawRatio:e=b}=t;if(s=Math.round(s),!isFinite(s)||s<=0)return null;if(!(i>_))return null;var h=i/s;if(!(h>_))return null;if((e=Math.max(0,Math.min(1,e)))>=.999999)return null;var r=h*e;r<=_&&(r=_);var a=h-r;return a<=_?null:[r,a]}(t,i)},R=function(t,i,s){if(t&&!(t.length<4)){var e=t.length-1;if(i||(e-=2),!(e<2))for(var h=t[0],r=t[1],a=2;a<e;a+=2){var n=t[a],o=t[a+1];s(h,r,n,o),h=n,r=o}}},w=function(t,i,s){void 0===i&&(i={}),void 0===s&&(s={});var{closePath:e=!1,dashPattern:h,dashOffset:r=0}=i,a=function(t,i){var s=0;return R(t,i,(function(t,i,e,h){var r=e-t,a=h-i;s+=Math.sqrt(r*r+a*a)})),s}(t,e);if(null===(h=S(h,a)))return null;for(var n=[],o=[],l=0,u=0,d=h.length;u<d;u++)l+=h[u];if(l<=_)return s.strokePathData=t?t.slice():[],s.strokePathMask=void 0,s;for(var p=0,c=!0,v=h[p],g=function(){p=(p+1)%h.length,c=!c,v=h[p]},y=function(t,i){return isFinite(t)||(t=0),(t%=i)<0&&(t+=i),t}(r,l);y>_;)y<v-_?(v-=y,y=0):(y-=v,g());var m=function(t,i,s,e,h){if(0===n.length)n.push(t,i);else{var r=n[n.length-2],a=n[n.length-1];r===t&&a===i||n.push(t,i)}n.push(s,e),o.push(h?1:0)};return R(t,e,(function(t,i,s,e){var h=s-t,r=e-i,a=Math.sqrt(h*h+r*r);if(!(a<=_))for(var n=0;n<a-_;){var o=Math.min(v,a-n);if(o<=_)g();else{var l=n/a,u=(n+o)/a;m(t+h*l,i+r*l,t+h*u,i+r*u,c),n+=o,(v-=o)<=_&&g()}}})),!e&&n.length>=2&&n.push(n[n.length-2],n[n.length-1]),s.strokePathData=n,s.strokePathMask=o,s},x={setDashPattern:function(t,i){return this.dashPattern=t,this.dashOffset=i||0,this.isDashed=!!t,this},clearDashPattern:function(){return this.setDashPattern(),this},setDashed:function(t){return void 0===t&&(t=!0),this.isDashed=t,this}},A={buildStrokePath:function(){if(this.isDashed){var t=w(this.pathData,{closePath:this.closePath,dashPattern:this.dashPattern,dashOffset:this.dashOffset},this);t?(this.strokePathData=t.strokePathData,this.strokePathMask=t.strokePathMask):this.isDashed=!1}return this}};Object.assign(A,x);const E=Phaser.Geom.Polygon.Earcut;class C extends v{constructor(){super(),this.pathData=[],this.isDashed=!1,this.strokePathData=void 0,this.strokePathMask=void 0,this.dashPattern=void 0,this.dashOffset=0,this.pathIndexes=[],this.closePath=!1}updateData(){return this.pathIndexes=E(this.pathData),super.updateData(),this.buildStrokePath(),this}webglRender(t,i,s,e,h){this.isFilled&&y(t,i,this,s,e,h),this.isStroked&&f(t,this,s,e,h)}canvasRender(t,i,s){this.isFilled&&D(t,this,i,s),this.isStroked&&k(t,this,i,s)}}Object.assign(C.prototype,A);var L=function(t,i,s){var e=s.length;if(e>=2){var h=s[e-2],r=s[e-1];if(t===h&&i===r)return s}return s.push(t,i),s};const O=Phaser.Math.DegToRad;var F=function(t,i,s,e,h,r,a,n,o){a&&r>h?r-=360:!a&&r<h&&(r+=360);var l=O(r-h)/n;h=O(h);for(var u=0;u<=n;u++){var d=h+l*u,p=t+s*Math.cos(d),c=i+e*Math.sin(d);L(p,c,o)}return o};Phaser.Math.DegToRad;const M=Phaser.Math.Interpolation.QuadraticBezier,j=Phaser.Math.Interpolation.CubicBezier,B=Phaser.Math.Interpolation.CatmullRom;var V=function(t){var i=t.length;if(i<2)return t;var s=t[i-2],e=t[i-1];return t.push(s),t.push(e),t},X={clear(){return this.start(),this},start(){return this.startAt(),this},startAt(t,i){return this.restorePathData(),this.accumulationLengths=void 0,function(t,i,s){s.length=0,null!=t&&s.push(t,i)}(t,i,this.pathData),this.firstPointX=t,this.firstPointY=i,this.lastPointX=t,this.lastPointY=i,this},lineTo(t,i,s){return void 0===s&&(s=!1),s&&(t+=this.lastPointX,i+=this.lastPointY),L(t,i,this.pathData),this.lastPointX=t,this.lastPointY=i,this},verticalLineTo(t,i){return this.lineTo(t,this.lastPointY,i),this},horizontalLineTo(t,i){return this.lineTo(this.lastPointX,t,i),this},ellipticalArc(t,i,s,e,h,r,a){return void 0===a&&(a=!1),F(t,i,s,e,h,r,a,this.iterations,this.pathData),this.lastPointX=this.pathData[this.pathData.length-2],this.lastPointY=this.pathData[this.pathData.length-1],this},arc(t,i,s,e,h,r){return this.ellipticalArc(t,i,s,s,e,h,r),this},quadraticBezierTo(t,i,s,e){return function(t,i,s,e,h,r){for(var a=r.length,n=r[a-2],o=r[a-1],l=1,u=h-1;l<=u;l++){var d=l/u;r.push(M(d,n,t,s),M(d,o,i,e))}}(t,i,s,e,this.iterations,this.pathData),this.lastPointX=s,this.lastPointY=e,this},cubicBezierTo(t,i,s,e,h,r){return function(t,i,s,e,h,r,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(j(c,l,t,s,h),j(c,u,i,e,r))}}(t,i,s,e,h,r,this.iterations,this.pathData),this.lastPointX=h,this.lastPointY=r,this},catmullRomTo(...t){return function(t,i,s){for(var e=s.length,h=[s[e-2]],r=[s[e-1]],a=0,n=t.length;a<n;a+=2)h.push(t[a]),r.push(t[a+1]);a=1;for(var o=i-1;a<=o;a++){var l=a/o;s.push(B(h,l),B(r,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],i=this.pathData[1];return t===this.lastPointX&&i===this.lastPointY||this.lineTo(t,i),this.closePath=!0,this},end(){return V(this.pathData),this}};const z=Phaser.Math.RotateAround;var Y=function(t,i,s){for(var e=0,h=s.length-1;e<h;e+=2)s[e]+=t,s[e+1]+=i;return s};const W=Phaser.Math.DegToRad;Phaser.Math.RotateAround;var G={rotateAround(t,i,s){if(0===this.pathData.length)return this;!function(t,i,s,e){for(var h={x:0,y:0},r=0,a=e.length-1;r<a;r+=2)h.x=e[r],h.y=e[r+1],z(h,t,i,s),e[r]=h.x,e[r+1]=h.y}(t,i,s=W(s),this.pathData);var e=this.pathData.length;return this.lastPointX=this.pathData[e-2],this.lastPointY=this.pathData[e-1],this},scale(t,i,s,e){return 0===this.pathData.length||(function(t,i,s,e,h){for(var r=0,a=h.length-1;r<a;r+=2){var n=h[r]-t,o=h[r+1]-i;n*=s,o*=e,h[r]=n+t,h[r+1]=o+i}}(t,i,s,e,this.pathData),this.lastPointX=this.pathData[pathDataCnt-2],this.lastPointY=this.pathData[pathDataCnt-1]),this},offset(t,i){return Y(t,i,this.pathData),this}},I={savePathData(){return this.pathDataSaved||(this.pathDataSave=[...this.pathData],this.pathData.length=0,this.pathDataSaved=!0),this},restorePathData(){return this.pathDataSaved?(function(t,i,s,e){void 0===s&&(s=0),void 0===e&&(e=i.length),t.length=e-s;for(var h=0,r=t.length;h<r;h++)t[h]=i[h+s]}(this.pathData,this.pathDataSave),this.pathDataSave=void 0,this.pathDataSaved=!1,this):this}};const N=Phaser.Math.Distance.Between,U=Phaser.Math.Wrap,H=Phaser.Math.Linear;var J=function(t,i,s,e,h){if(void 0===e&&(e=s,s=0),(s=Q(s))!==(e=Q(e))){var r=i[i.length-1],a=r*s,n=r*e;s<e?K(t,i,a,n,h):(K(t,i,a,r,h),K(t,i,0,n,h)),V(h)}},K=function(t,i,s,e,h){for(var r=s>0,a=0,n=i.length;a<n;a++){var o=2*a,l=i[a];if(r){if(l<s)continue;if(l==s)r=!1;else{var u=1-(l-s)/(l-i[a-1]);h.push(q(t,o-2,o,u)),h.push(q(t,o-1,o+1,u)),r=!1}}if(!(l<=e)){u=1-(l-e)/(l-i[a-1]),h.push(q(t,o-2,o,u)),h.push(q(t,o-1,o+1,u));break}if(h.push(t[o]),h.push(t[o+1]),l===e)break}},q=function(t,i,s,e){var h=t[i],r=t[s];return H(h,r,e)},Q=function(t){return 0===t?0:t%1==0?1:U(t,0,1)},Z={updateAccumulationLengths(){if(null==this.accumulationLengths)this.accumulationLengths=[];else if(this.accumulationLengths.length===this.pathData.length/2)return this;for(var t,i,s,e,h=this.accumulationLengths,r=this.pathData,a=0,n=0,o=r.length;n<o;n+=2)s=r[n],e=r[n+1],a+=void 0===t?0:N(t,i,s,e),h.push(a),t=s,i=e;return this.totalPathLength=a,this},setDisplayPathSegment(t,i){return this.pathDataSaved||(this.updateAccumulationLengths(),this.savePathData()),this.pathData.length=0,J(this.pathDataSave,this.accumulationLengths,t,i,this.pathData),this},appendFromPathSegment(t,i,s){return void 0===i?this.pathData.push(...t.pathData):(t.updateAccumulationLengths(),J(t.pathData,t.accumulationLengths,i,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}},$={draw(t,i,s){var e=this.toPoints();return i&&t.fillPoints(e,this.closePath,this.closePath),s&&t.strokePoints(e,this.closePath,this.closePath),this}};const tt=Phaser.Geom.Polygon;Object.assign(class{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,i){void 0===i&&(i=[]);for(var s=0,e=t.length-1;s<e;s+=2)i.push({x:t[s],y:t[s+1]});return i}(this.pathData)}toPolygon(t){return function(t,i){return void 0===i&&(i=new tt),i.setTo(t),i}(this.pathData,t)}}.prototype,X,G,I,Z,$);const it=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha;Object.assign(class extends v{constructor(t,i,s,e){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===e&&(e=s),super(),this.pathData=[],this.isDashed=!1,this.strokePathData=void 0,this.strokePathMask=void 0,this.dashPattern=void 0,this.dashOffset=0,this.closePath=!0,this.setTopLeftPosition(t,i),this.setSize(s,e)}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,i){return this.x=t,this.y=i,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,i){return this.width=t,this.height=i,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,i){return this.centerX=t,this.centerY=i,this}updateData(){this.pathData.length=0;var t=this.x,i=t+this.width,s=this.y,e=s+this.height;return this.pathData.push(t,s),this.pathData.push(i,s),this.pathData.push(i,e),this.pathData.push(t,e),this.pathData.push(t,s),super.updateData(),this.buildStrokePath(),this}webglRender(t,i,s,e,h){if(this.isFilled){var r=t.fillTint,a=it(this.fillColor,this.fillAlpha*s);r.TL=a,r.TR=a,r.BL=a,r.BR=a,t.batchFillRect(-e+this.x,-h+this.y,this.width,this.height)}this.isStroked&&f(t,this,s,e,h)}canvasRender(t,i,s){this.isFilled&&(P(t,this),t.fillRect(-i,-s,this.width,this.height)),this.isStroked&&k(t,this,i,s)}}.prototype,A);const st=Phaser.Utils.Objects.GetValue;class et extends C{constructor(t,i,s,e,h,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===e&&(e=s),void 0===h&&(h=0),void 0===r&&(r=6),super(),this.setTopLeftPosition(t,i),this.setSize(s,e),this.setRadius(h),this.setIterations(r),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,i){return this.x=t,this.y=i,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,i){return this.width=t,this.height=i,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,i){return this.centerX=t,this.centerY=i,this}get radiusTL(){return this._radiusTL}set radiusTL(t){var i=t>0;this.dirty=this.dirty||this._radiusTL!==t||this._convexTL!==i,this._convexTL=i,this._radiusTL=Math.abs(t)}get radiusTR(){return this._radiusTR}set radiusTR(t){var i=t>0;this.dirty=this.dirty||this._radiusTR!==t||this._convexTR!==i,this._convexTR=i,this._radiusTR=Math.abs(t)}get radiusBL(){return this._radiusBL}set radiusBL(t){var i=t>0;this.dirty=this.dirty||this._radiusBL!==t||this._convexBL!==i,this._convexBL=i,this._radiusBL=Math.abs(t)}get radiusBR(){return this._radiusBR}set radiusBR(t){var i=t>0;this.dirty=this.dirty||this._radiusBR!==t||this._convexBR!==i,this._convexBR=i,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=st(t,"tl",0),this.radiusTR=st(t,"tr",0),this.radiusBL=st(t,"bl",0),this.radiusBR=st(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 i,s=this.width,e=this.height,h=this.iterations+1;return(i=this.radiusTL)>0?this._convexTL?F(i,i,i,i,180,270,!1,h,t):F(0,0,i,i,90,0,!0,h,t):L(0,0,t),(i=this.radiusTR)>0?this._convexTR?F(s-i,i,i,i,270,360,!1,h,t):F(s,0,i,i,180,90,!0,h,t):L(s,0,t),(i=this.radiusBR)>0?this._convexBR?F(s-i,e-i,i,i,0,90,!1,h,t):F(s,e,i,i,270,180,!0,h,t):L(s,e,t),(i=this.radiusBL)>0?this._convexBL?F(i,e-i,i,i,90,180,!1,h,t):F(0,e,i,i,360,270,!0,h,t):L(0,e,t),t.push(t[0],t[1]),Y(this.x,this.y,t),super.updateData(),this}}const ht=Phaser.Geom.Polygon.Earcut;Object.assign(class extends v{constructor(t,i,s,e,h,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===e&&(e=0),void 0===h&&(h=0),void 0===r&&(r=0),super(),this.pathData=[],this.isDashed=!1,this.strokePathData=void 0,this.strokePathMask=void 0,this.dashPattern=void 0,this.dashOffset=0,this.pathIndexes=[],this.closePath=!0,this.setP0(t,i),this.setP1(s,e),this.setP2(h,r)}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,i){return this.x0=t,this.y0=i,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,i){return this.x1=t,this.y1=i,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,i){return this.dirty=this.dirty||this.x2!==t||this.y2!==i,this.x2=t,this.y2=i,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),this.pathIndexes=ht(this.pathData),super.updateData(),this.buildStrokePath(),this}webglRender(t,i,s,e,h){this.isFilled&&y(t,i,this,s,e,h),this.isStroked&&f(t,this,s,e,h)}canvasRender(t,i,s){this.isFilled&&D(t,this,i,s),this.isStroked&&k(t,this,i,s)}}.prototype,A);
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var rt=function(t,i,s){return(i-t)*s+t},at=function(t){return t>>16&255},nt=function(t){return t>>8&255},ot=function(t){return 255&t};const lt=Phaser.Math.Linear;var ut={buildShapes(){this.addShape((new et).setName("track")).addShape((new et).setName("thumb"))},updateShapes(){var t=this.width,i=this.height,s=this.value?this.toggleAnimProgress:1-this.toggleAnimProgress,e=this.getShape("track");if(this.isSizeChanged){var h=t*this.trackWidth,r=i*this.trackHeight,a=(t-h)/2,n=(i-r)/2,o=i*this.trackRadius;e.setTopLeftPosition(a,n).setSize(h,r).setRadius(o)}var l,u,d,p=(l=this.falseValueTrackColor,u=this.trackFillColor,d=s,(255&rt(at(l),at(u),d))<<16|(255&rt(nt(l),nt(u),d))<<8|255&rt(ot(l),ot(u),d)),c=lt(this.falseValueTrackFillAlpha,this.trackFillAlpha,s);e.fillStyle(p,c);var v=this.getShape("thumb");if(this.isSizeChanged){var g=t*this.thumbWidth,y=i*this.thumbHeight,m=i*this.thumbRadius;v.setSize(g,y).setRadius(m)}var f=lt(this.thumbLeftX,this.thumbRightX,s)*t;this.rtl&&(f=t-f);var P=i/2;v.setCenterPosition(f,P),v.fillStyle(this.thumbColor,this.thumbAlpha)}},dt={setEventEmitter(t,i){return void 0===i&&(i=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new i: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 pt=Phaser.Scene;var ct=function(t){return t instanceof pt};const vt=Phaser.Game;var gt=function(t){return t instanceof vt};const yt=Phaser.Utils.Objects.GetValue;class mt{constructor(t,i){this.setParent(t),this.isShutdown=!1,this.setEventEmitter(yt(i,"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,i){this.destroy(i)}setParent(t){var i;return this.parent=t,this.scene=null==(i=t)||"object"!=typeof i?null:ct(i)?i:i.scene&&ct(i.scene)?i.scene:i.parent&&i.parent.scene&&ct(i.parent.scene)?i.parent.scene:null,this.game=function(t){return null==t||"object"!=typeof t?null:gt(t)?t:gt(t.game)?t.game:ct(t)?t.sys.game:ct(t.scene)?t.scene.sys.game:void 0}(t),this}}Object.assign(mt.prototype,dt);const ft=Phaser.Utils.Objects.GetValue;class Pt extends mt{constructor(t,i){super(t,i),this._isRunning=!1,this.isPaused=!1,this.tickingState=!1,this.setTickingMode(ft(i,"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=Dt[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 Dt={no:0,lazy:1,always:2},kt=Phaser.Utils.Objects.GetValue;class _t extends Pt{constructor(t,i){super(t,i);var s=this.scene?"update":"step";this.tickEventName=kt(i,"tickEventName",s),this.isSceneTicker=!Tt(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 Tt=function(t){return"step"===t||"poststep"===t};const bt=Phaser.Utils.Objects.GetValue,St=Phaser.Math.Clamp;class Rt{constructor(t){this.resetFromJSON(t)}resetFromJSON(t){this.state=bt(t,"state",wt),this.timeScale=bt(t,"timeScale",1),this.delay=bt(t,"delay",0),this.repeat=bt(t,"repeat",0),this.repeatCounter=bt(t,"repeatCounter",0),this.repeatDelay=bt(t,"repeatDelay",0),this.duration=bt(t,"duration",0),this.nowTime=bt(t,"nowTime",0),this.justRestart=bt(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?At:xt,this.repeatCounter=0,this}stop(){return this.state=wt,this}update(t,i){this.state!==wt&&this.state!==Ct&&0!==i&&0!==this.timeScale&&(this.nowTime+=i*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=Et)):(this.nowTime=this.duration,this.state=Ct):this.nowTime>=0&&(this.state=At))}get t(){var t;switch(this.state){case wt:case xt:case Et:t=0;break;case At:t=this.nowTime/this.duration;break;case Ct:t=1}return St(t,0,1)}set t(t){(t=St(t,-1,1))<0?(this.state=xt,this.nowTime=-this.delay*t):(this.state=At,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++)}setT(t){return this.t=t,this}get isIdle(){return this.state===wt}get isDelay(){return this.state===xt}get isCountDown(){return this.state===At}get isRunning(){return this.state===xt||this.state===At}get isDone(){return this.state===Ct}get isOddIteration(){return!(1&~this.repeatCounter)}get isEvenIteration(){return!(1&this.repeatCounter)}}const wt=0,xt=1,At=2,Et=3,Ct=-1;class Lt extends _t{constructor(t,i){super(t,i),this.timer=new Rt}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 Ot=Phaser.Utils.Objects.GetValue,Ft=Phaser.Utils.Objects.GetAdvancedValue,Mt=Phaser.Tweens.Builders.GetEaseFunction;class jt extends Lt{resetFromJSON(t){return this.timer.resetFromJSON(Ot(t,"timer")),this.setEnable(Ot(t,"enable",!0)),this.setTarget(Ot(t,"target",this.parent)),this.setDelay(Ft(t,"delay",0)),this.setDuration(Ft(t,"duration",1e3)),this.setEase(Ot(t,"ease","Linear")),this.setRepeat(Ot(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=Mt(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,i){if(!this.isRunning||!this.enable||this.parent.hasOwnProperty("active")&&!this.parent.active)return this;var s=this.target,e=this.timer;return e.update(t,i),e.isDelay||this.updateTarget(s,e),this.emit("update",s,this),e.isDone&&this.complete(),this}updateTarget(t,i){}}const Bt=Phaser.Utils.Objects.GetValue,Vt=Phaser.Math.Linear;class Xt extends jt{constructor(t,i){super(t,i),this.resetFromJSON(),this.boot()}start(t){if(this.timer.isRunning)return this;var i=this.target;this.propertyKey=Bt(t,"key","value");var s=i[this.propertyKey];return this.fromValue=Bt(t,"from",s),this.toValue=Bt(t,"to",s),this.setEase(Bt(t,"ease",this.ease)),this.setDuration(Bt(t,"duration",this.duration)),this.setRepeat(Bt(t,"repeat",0)),this.setDelay(Bt(t,"delay",0)),this.setRepeatDelay(Bt(t,"repeatDelay",0)),this.timer.setDuration(this.duration).setRepeat(this.repeat).setDelay(this.delay).setRepeatDelay(this.repeatDelay),i[this.propertyKey]=this.fromValue,super.start(),this}updateTarget(t,i){var s=i.t;s=this.easeFn(s),t[this.propertyKey]=Vt(this.fromValue,this.toValue,s)}}var zt={setToggleAnimationDuration(t){return void 0===t&&(t=0),this.toggleAnimDuration=t,this},playToggleAnimation(){return void 0===this.toggleAnimProgressTask&&(this.toggleAnimProgressTask=new Xt(this,{eventEmitter:null})),this.toggleAnimProgressTask.restart({key:"toggleAnimProgress",from:0,to:1,duration:this.toggleAnimDuration}),this},stopToggleAnimation(){return void 0===this.toggleAnimProgressTask||this.toggleAnimProgressTask.stop(),this}},Yt={};Object.assign(Yt,n,o,l,ut,zt);const Wt=Phaser.Utils.Objects.GetValue,Gt=Phaser.Utils.Objects.IsPlainObject,It=23730;class Nt extends a{constructor(t,i,s,e,h,r,a){Gt(i)?(i=Wt(a=i,"x",0),s=Wt(a,"y",0),e=Wt(a,"width",2),h=Wt(a,"height",2),r=Wt(a,"color",It)):Gt(r)&&(r=Wt(a=r,"color",It)),super(t,i,s,e,h),this.type="rexToggleSwitch",void 0===r&&(r=It),this.setTrackFillStyle(r,Wt(a,"trackFillAlpha",1)),this.setFalseValueTrackFillStyle(Wt(a,"falseValueTrackColor",function(t){var i=.3*at(t)+.59*nt(t)+.11*ot(t);return(255&i)<<16|(255&i)<<8|255&i}(r)),Wt(a,"falseValueTrackFillAlpha",1)),this.setThumbStyle(Wt(a,"thumbColor",16777215),Wt(a,"thumbAlpha",1)),this.setTrackSize(Wt(a,"trackWidth",.9),Wt(a,"trackHeight",.5)),this.setTrackRadius(Wt(a,"trackRadius",.5*this.trackHeight));var n=Wt(a,"thumbHeight",void 0),o=Wt(a,"thumbWidth",n);void 0===o&&(o=.9*this.trackHeight),this.setThumbSize(o,n),this.setThumbRadius(Wt(a,"thumbRadius",.5*this.thumbHeight)),this.setThumbPosition(Wt(a,"thumbLeft",.3),Wt(a,"thumbRight",void 0)),this.setRTL(Wt(a,"rtl",!1)),this.setToggleAnimationDuration(Wt(a,"animationDuration",150)),this.buildShapes(),this.setValue(Wt(a,"value",!1),0)}get value(){return this._value}set value(t){t=!!t,this._value!==t&&(this.dirty=!0,this._value=t,this.playToggleAnimation(),this.emit("valuechange",t))}setValue(t,i){void 0===i&&(i=this.toggleAnimDuration);var s=this.toggleAnimDuration;return this.toggleAnimDuration=i,this.value=t,this.toggleAnimDuration=s,this}toggleValue(t){return this.setValue(!this.value,t),this}get toggleAnimProgress(){return this._toggleAnimProgress}set toggleAnimProgress(t){this._toggleAnimProgress!==t&&(this._toggleAnimProgress=t,this.dirty=!0)}}Object.assign(Nt.prototype,Yt);const Ut=Phaser.Utils.Objects.GetValue;class Ht extends mt{constructor(t,i){super(t,i),this._enable=void 0,t.setInteractive(Ut(i,"inputConfig",void 0)),this.resetFromJSON(i),this.boot()}resetFromJSON(t){return this.pointer=void 0,this.lastClickTime=void 0,this.isDown=!1,this.isOver=!1,this.setEnable(Ut(t,"enable",!0)),this.setMode(Ut(t,"mode",1)),this.setClickInterval(Ut(t,"clickInterval",100)),this.setDragThreshold(Ut(t,"threshold",void 0)),this}boot(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this),t.on("pointerover",this.onOver,this),t.on("pointerout",this.onOut,this)}shutdown(t){this.isShutdown||(this.pointer=null,super.shutdown(t))}get enable(){return this._enable}set enable(t){if(this._enable!==t){t||this.cancel(),this._enable=t;var i=t?"enable":"disable";this.emit(i,this,this.parent)}}setEnable(t){return void 0===t&&(t=!0),this.enable=t,this}toggleEnable(){return this.setEnable(!this.enable),this}setMode(t){return"string"==typeof t&&(t=Jt[t]),this.mode=t,this}setClickInterval(t){return this.clickInterval=t,this}setDragThreshold(t){return this.dragThreshold=t,this}onPress(t,i,s,e){void 0===this.pointer&&(this.pointer=t,this.isDown=!0,this.emit("down",this,this.parent,t,e),0===this.mode&&this.click(t.downTime,t,e))}onRelease(t,i,s,e){this.pointer===t&&(this.isDown=!1,this.emit("up",this,this.parent,t,e),1===this.mode&&this.click(t.upTime,t,e),this.pointer=void 0)}onPointOut(t,i){this.pointer===t&&this.cancel()}onMove(t,i,s,e){this.pointer===t&&void 0!==this.dragThreshold&&1===this.mode&&t.getDistance()>=this.dragThreshold&&this.cancel()}onOver(t,i,s,e){return this.enable?(this.isOver=!0,this.emit("over",this,this.parent,t,e),this):this}onOut(t,i){return this.enable?(this.isOver=!1,this.emit("out",this,this.parent,t,i),this):this}click(t,i,s){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,i,s),this;this.pointer=void 0;var e=this.lastClickTime;return void 0!==e&&t-e<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,i,s)),this}cancel(){return this.pointer=void 0,this}}const Jt={press:0,pointerdown:0,release:1,pointerup:1},Kt=Phaser.Utils.Objects.GetValue;return class extends Nt{constructor(t,i,s,e,h,r,a){super(t,i,s,e,h,r,a),this._click=new Ht(this,Kt(a,"click")),this._click.on("click",(function(){this.toggleValue()}),this),this.setReadOnly(Kt(a,"readOnly",!1))}get readOnly(){return!this._click.enable}set readOnly(t){this._click.enable=!t}setReadOnly(t){return void 0===t&&(t=!0),this.readOnly=t,this}}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).rextoggleswitch=i();