From c14543c1639162e974c32d059575e098e95f993c Mon Sep 17 00:00:00 2001 From: h0lybyte <5599058+h0lybyte@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:03:05 +0000 Subject: [PATCH] Merge pull request #2479 from KBVE/beta Preparing Release Branch --- docs/_astro/App.CPgSZwf1.js | 10218 ++++++++++++++++ docs/_astro/App.DxAk5t4Z.js | 6405 ---------- ...Form.UCu5_xT9.js => ConchForm.DdDcKdtv.js} | 2 +- docs/_astro/JukeboxPlayer.B8Wx8jK4.js | 3 - docs/_astro/JukeboxPlayer.JZvzSQHP.js | 3 + ...gueMM.B5Xus8e-.js => LeagueMM.D0X0v9cE.js} | 2 +- docs/_astro/LoginForm.Bzp5Rll5.js | 1 - docs/_astro/RegisterForm.DNp7V74y.js | 1 - ...eApp.8yIrdsGm.js => ResumeApp.DTTfIcsY.js} | 2 +- docs/_astro/globals.D0QH3NT1.js | 1 - docs/_astro/index.BUYXiDtP.js | 1 + docs/_astro/index.v-SePH8U.js | 1 - docs/_astro/npchandler.B5V8c1BD.js | 3814 ------ docs/index.html | 10 +- 14 files changed, 10233 insertions(+), 10231 deletions(-) create mode 100644 docs/_astro/App.CPgSZwf1.js delete mode 100644 docs/_astro/App.DxAk5t4Z.js rename docs/_astro/{ConchForm.UCu5_xT9.js => ConchForm.DdDcKdtv.js} (97%) delete mode 100644 docs/_astro/JukeboxPlayer.B8Wx8jK4.js create mode 100644 docs/_astro/JukeboxPlayer.JZvzSQHP.js rename docs/_astro/{LeagueMM.B5Xus8e-.js => LeagueMM.D0X0v9cE.js} (98%) delete mode 100644 docs/_astro/LoginForm.Bzp5Rll5.js delete mode 100644 docs/_astro/RegisterForm.DNp7V74y.js rename docs/_astro/{ResumeApp.8yIrdsGm.js => ResumeApp.DTTfIcsY.js} (99%) delete mode 100644 docs/_astro/globals.D0QH3NT1.js create mode 100644 docs/_astro/index.BUYXiDtP.js delete mode 100644 docs/_astro/index.v-SePH8U.js delete mode 100644 docs/_astro/npchandler.B5V8c1BD.js diff --git a/docs/_astro/App.CPgSZwf1.js b/docs/_astro/App.CPgSZwf1.js new file mode 100644 index 0000000..02a1b29 --- /dev/null +++ b/docs/_astro/App.CPgSZwf1.js @@ -0,0 +1,10218 @@ +import{j as Yt}from"./jsx-runtime.BPj4-Rfu.js";import{g as kd,R as Ou,r as Me,c as Ty}from"./index.SSXOyoI7.js";import{p as FL,a as jd}from"./index.DxhZiom7.js";import{t as Ir}from"./index.BH1EYZ08.js";var PM={exports:{}},ln={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Nx=Symbol.for("react.element"),Bx=Symbol.for("react.portal"),Fm=Symbol.for("react.fragment"),Om=Symbol.for("react.strict_mode"),Dm=Symbol.for("react.profiler"),Im=Symbol.for("react.provider"),Nm=Symbol.for("react.context"),OL=Symbol.for("react.server_context"),Bm=Symbol.for("react.forward_ref"),Um=Symbol.for("react.suspense"),zm=Symbol.for("react.suspense_list"),Gm=Symbol.for("react.memo"),Vm=Symbol.for("react.lazy"),DL=Symbol.for("react.offscreen"),RM;RM=Symbol.for("react.module.reference");function Pa(g){if(typeof g=="object"&&g!==null){var t=g.$$typeof;switch(t){case Nx:switch(g=g.type,g){case Fm:case Dm:case Om:case Um:case zm:return g;default:switch(g=g&&g.$$typeof,g){case OL:case Nm:case Bm:case Vm:case Gm:case Im:return g;default:return t}}case Bx:return t}}}ln.ContextConsumer=Nm;ln.ContextProvider=Im;ln.Element=Nx;ln.ForwardRef=Bm;ln.Fragment=Fm;ln.Lazy=Vm;ln.Memo=Gm;ln.Portal=Bx;ln.Profiler=Dm;ln.StrictMode=Om;ln.Suspense=Um;ln.SuspenseList=zm;ln.isAsyncMode=function(){return!1};ln.isConcurrentMode=function(){return!1};ln.isContextConsumer=function(g){return Pa(g)===Nm};ln.isContextProvider=function(g){return Pa(g)===Im};ln.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===Nx};ln.isForwardRef=function(g){return Pa(g)===Bm};ln.isFragment=function(g){return Pa(g)===Fm};ln.isLazy=function(g){return Pa(g)===Vm};ln.isMemo=function(g){return Pa(g)===Gm};ln.isPortal=function(g){return Pa(g)===Bx};ln.isProfiler=function(g){return Pa(g)===Dm};ln.isStrictMode=function(g){return Pa(g)===Om};ln.isSuspense=function(g){return Pa(g)===Um};ln.isSuspenseList=function(g){return Pa(g)===zm};ln.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===Fm||g===Dm||g===Om||g===Um||g===zm||g===DL||typeof g=="object"&&g!==null&&(g.$$typeof===Vm||g.$$typeof===Gm||g.$$typeof===Im||g.$$typeof===Nm||g.$$typeof===Bm||g.$$typeof===RM||g.getModuleId!==void 0)};ln.typeOf=Pa;PM.exports=ln;var bM=PM.exports;function IL(g){function t(tt,Y,Z,U,H){for(var J=0,_=0,q=0,at=0,ot,rt,gt=0,yt=0,Et,At=Et=ot=0,Pt=0,Vt=0,dt=0,ut=0,Rt=Z.length,Dt=Rt-1,Ht,Bt="",re="",le="",ge="",xe;Ptot)&&(ut=(Bt=Bt.replace(" ",":")).length),0U&&(U=(Y=Y.trim()).charCodeAt(0)),U){case 38:return Y.replace(o,"$1"+tt.trim());case 58:return tt.trim()+Y.replace(o,"$1"+tt.trim());default:if(0<1*Z&&0_.charCodeAt(8))break;case 115:H=H.replace(_,"-webkit-"+_)+";"+H;break;case 207:case 102:H=H.replace(_,"-webkit-"+(102Z.charCodeAt(0)&&(Z=Z.trim()),Q=Z,Z=[Q],01?t-1:0),x=1;x0?" Args: "+i.join(", "):""))}var tF=function(){function g(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var t=g.prototype;return t.indexOfGroup=function(i){for(var x=0,T=0;T=this.groupSizes.length){for(var T=this.groupSizes,E=T.length,s=E;i>=s;)(s<<=1)<0&&Kd(16,""+i);this.groupSizes=new Uint32Array(s),this.groupSizes.set(T),this.length=s;for(var y=E;y=this.length||this.groupSizes[i]===0)return x;for(var T=this.groupSizes[i],E=this.indexOfGroup(i),s=E+T,y=E;y=ld&&(ld=t+1),_v.set(g,t),vm.set(t,g)},nF="style["+Jf+'][data-styled-version="5.3.6"]',rF=new RegExp("^"+Jf+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),sF=function(g,t,i){for(var x,T=i.split(","),E=0,s=T.length;E=0;r--){var p=e[r];if(p&&p.nodeType===1&&p.hasAttribute(Jf))return p}}(i),E=T!==void 0?T.nextSibling:null;x.setAttribute(Jf,"active"),x.setAttribute("data-styled-version","5.3.6");var s=oF();return s&&x.setAttribute("nonce",s),i.insertBefore(x,E),x},lF=function(){function g(i){var x=this.element=IM(i);x.appendChild(document.createTextNode("")),this.sheet=function(T){if(T.sheet)return T.sheet;for(var E=document.styleSheets,s=0,y=E.length;s=0){var T=document.createTextNode(x),E=this.nodes[i];return this.element.insertBefore(T,E||null),this.length++,!0}return!1},t.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},t.getRule=function(i){return i0&&(h+=a+",")}),E+=""+r+p+'{content:"'+h+`"}/*!sc*/ +`}}}return E}(this)},g}(),cF=/(a)(d)/gi,JS=function(g){return String.fromCharCode(g+(g>25?39:97))};function My(g){var t,i="";for(t=Math.abs(g);t>52;t=t/52|0)i=JS(t%52)+i;return(JS(t%52)+i).replace(cF,"$1-$2")}var Bf=function(g,t){for(var i=t.length;i;)g=33*g^t.charCodeAt(--i);return g},BM=function(g){return Bf(5381,g)};function dF(g){for(var t=0;t>>0);if(!i.hasNameForId(T,y)){var e=x(s,"."+y,void 0,T);i.insertRules(T,y,e)}E.push(y),this.staticRulesId=y}else{for(var r=this.rules.length,p=Bf(this.baseHash,x.hash),h="",a=0;a>>0);if(!i.hasNameForId(T,f)){var o=x(h,"."+f,void 0,T);i.insertRules(T,f,o)}E.push(f)}}return E.join(" ")},g}(),mF=/^\s*\/\/.*$/gm,gF=[":","[",".","#"];function yF(g){var t,i,x,T,E=g===void 0?fh:g,s=E.options,y=s===void 0?fh:s,e=E.plugins,r=e===void 0?pm:e,p=new IL(y),h=[],a=function(u){function f(o){if(o)try{u(o+"}")}catch{}}return function(o,c,d,v,m,S,M,w,C,A){switch(o){case 1:if(C===0&&c.charCodeAt(0)===64)return u(c+";"),"";break;case 2:if(w===0)return c+"/*|*/";break;case 3:switch(w){case 102:case 112:return u(d[0]+c),"";default:return c+(A===0?"/*|*/":"")}case-2:c.split("/*|*/}").forEach(f)}}}(function(u){h.push(u)}),l=function(u,f,o){return f===0&&gF.indexOf(o[i.length])!==-1||o.match(T)?u:"."+t};function n(u,f,o,c){c===void 0&&(c="&");var d=u.replace(mF,""),v=f&&o?o+" "+f+" { "+d+" }":d;return t=c,i=f,x=new RegExp("\\"+i+"\\b","g"),T=new RegExp("(\\"+i+"\\b){2,}"),p(o||!f?"":f,v)}return p.use([].concat(r,[function(u,f,o){u===2&&o.length&&o[0].lastIndexOf(i)>0&&(o[0]=o[0].replace(x,l))},a,function(u){if(u===-2){var f=h;return h=[],f}}])),n.hash=r.length?r.reduce(function(u,f){return f.name||Kd(15),Bf(u,f.name)},5381).toString():"",n}var UM=Ou.createContext();UM.Consumer;var zM=Ou.createContext(),xF=(zM.Consumer,new NM),Cy=yF();function SF(){return Me.useContext(UM)||xF}function TF(){return Me.useContext(zM)||Cy}var EF=function(){function g(t,i){var x=this;this.inject=function(T,E){E===void 0&&(E=Cy);var s=x.name+E.hash;T.hasNameForId(x.id,s)||T.insertRules(x.id,s,E(x.rules,s,"@keyframes"))},this.toString=function(){return Kd(12,String(x.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=i}return g.prototype.getName=function(t){return t===void 0&&(t=Cy),this.name+t.hash},g}(),MF=/([A-Z])/,CF=/([A-Z])/g,wF=/^ms-/,AF=function(g){return"-"+g.toLowerCase()};function $S(g){return MF.test(g)?g.replace(CF,AF).replace(wF,"-ms-"):g}var QS=function(g){return g==null||g===!1||g===""};function $f(g,t,i,x){if(Array.isArray(g)){for(var T,E=[],s=0,y=g.length;s1?t-1:0),x=1;x?@[\\\]^`{|}~-]+/g,LF=/(^-|-$)/g;function d0(g){return g.replace(bF,"-").replace(LF,"")}var FF=function(g){return My(BM(g)>>>0)};function iv(g){return typeof g=="string"&&!0}var wy=function(g){return typeof g=="function"||typeof g=="object"&&g!==null&&!Array.isArray(g)},OF=function(g){return g!=="__proto__"&&g!=="constructor"&&g!=="prototype"};function DF(g,t,i){var x=g[i];wy(t)&&wy(x)?GM(x,t):g[i]=t}function GM(g){for(var t=arguments.length,i=new Array(t>1?t-1:0),x=1;x=0||(A[w]=S[w]);return A}(t,["componentId"]),m=d&&d+"-"+(iv(c)?c:d0(KS(c)));return HM(c,Sl({},v,{attrs:a,componentId:m}),i)},Object.defineProperty(n,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(c){this._foldedDefaultProps=x?GM({},g.defaultProps,c):c}}),n.toString=function(){return"."+n.styledComponentId},T&&_L(n,g,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),n}var mm=function(g){return function t(i,x,T){if(T===void 0&&(T=fh),!bM.isValidElementType(x))return Kd(1,String(x));var E=function(){return i(x,T,PF.apply(void 0,arguments))};return E.withConfig=function(s){return t(i,x,Sl({},T,{},s))},E.attrs=function(s){return t(i,x,Sl({},T,{attrs:Array.prototype.concat(T.attrs,s).filter(Boolean)}))},E}(HM,g)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(g){mm[g]=mm(g)});var WM={exports:{}};(function(g,t){(function(x,T){g.exports=T()})(Ty,()=>(()=>{var i={50792:s=>{var y=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function p(n,u,f){this.fn=n,this.context=u,this.once=f||!1}function h(n,u,f,o,c){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new p(f,o||n,c),v=e?e+u:u;return n._events[v]?n._events[v].fn?n._events[v]=[n._events[v],d]:n._events[v].push(d):(n._events[v]=d,n._eventsCount++),n}function a(n,u){--n._eventsCount===0?n._events=new r:delete n._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,o;if(this._eventsCount===0)return u;for(o in f=this._events)y.call(f,o)&&u.push(e?o.slice(1):o);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=e?e+u:u,o=this._events[f];if(!o)return[];if(o.fn)return[o.fn];for(var c=0,d=o.length,v=new Array(d);c{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38829),p=function(h,a,l,n){for(var u=h[0],f=1;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"angle",a,l,n,u)};s.exports=p},60757:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=0);for(var h=p;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=0);for(var h=e.length-1;h>=p;h--){var a=e[h],l=!0;for(var n in r)a[n]!==r[n]&&(l=!1);if(l)return a}return null};s.exports=y},94420:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(11879),p=e(60461),h=e(95540),a=e(29747),l=e(41481),n=new l({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0),u=function(f,o){o===void 0&&(o={});var c=o.hasOwnProperty("width"),d=o.hasOwnProperty("height"),v=h(o,"width",-1),m=h(o,"height",-1),S=h(o,"cellWidth",1),M=h(o,"cellHeight",S),w=h(o,"position",p.TOP_LEFT),C=h(o,"x",0),A=h(o,"y",0),P=0,b=0,O=v*S,I=m*M;n.setPosition(C,A),n.setSize(S,M);for(var D=0;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"alpha",a,l,n,u)};s.exports=p},67285:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"x",a,l,n,u)};s.exports=p},9074:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"x",a,n,f,o),r(h,"y",l,u,f,o)};s.exports=p},75222:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"y",a,l,n,u)};s.exports=p},22983:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var a=p,l=(h-p)/e.length,n=r.x,u=r.y,f=r.radius,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var a=p,l=(h-p)/e.length,n=r.width/2,u=r.height/2,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15258),p=e(26708),h=function(a,l,n){var u;n?u=p(l,n,a.length):u=r(l,a.length);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14649),p=e(86003),h=e(49498),a=function(l,n,u){u===void 0&&(u=0);var f=r(n,!1,l.length);u>0?p(f,u):u<0&&h(f,Math.abs(u));for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84993),p=function(h,a,l){var n=r({x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},l),u=r({x1:a.x2,y1:a.y2,x2:a.x3,y2:a.y3},l),f=r({x1:a.x3,y1:a.y3,x2:a.x1,y2:a.y1},l);n.pop(),u.pop(),f.pop(),n=n.concat(u,f);for(var o=n.length/h.length,c=0,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=1);var n,u=0,f=e.length;if(l===1)for(n=a;n=0;n--)e[n][r]+=p+u*h,u++;return e};s.exports=y},43967:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=1);var n,u=0,f=e.length;if(l===1)for(n=a;n=0;n--)e[n][r]=p+u*h,u++;return e};s.exports=y},88926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28176),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(24820),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65822),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26597),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90260),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"rotation",a,l,n,u)};s.exports=p},91051:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1163),p=e(20339),h=function(a,l,n){for(var u=l.x,f=l.y,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1163),p=function(h,a,l,n){var u=a.x,f=a.y;if(n===0)return 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 r=e(66979),p=function(h,a,l,n,u){return r(h,"scaleX",a,l,n,u)};s.exports=p},94868:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scaleX",a,n,f,o),r(h,"scaleY",l,u,f,o)};s.exports=p},95532:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"scaleY",a,l,n,u)};s.exports=p},8689:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"alpha",a,l,n,u)};s.exports=p},2645:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n){return r(h,"blendMode",a,0,l,n)};s.exports=p},32372:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"depth",a,l,n,u)};s.exports=p},85373:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"originX",a,n,f,o),r(h,"originY",l,u,f,o),h.forEach(function(c){c.updateDisplayOrigin()}),h};s.exports=p},79939:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"rotation",a,l,n,u)};s.exports=p},2699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scaleX",a,n,f,o),r(h,"scaleY",l,u,f,o)};s.exports=p},98739:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scaleX",a,l,n,u)};s.exports=p},98476:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scaleY",a,l,n,u)};s.exports=p},6207:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scrollFactorX",a,n,f,o),r(h,"scrollFactorY",l,u,f,o)};s.exports=p},6607:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scrollFactorX",a,l,n,u)};s.exports=p},72248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scrollFactorY",a,l,n,u)};s.exports=p},14036:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n){return r(h,"visible",a,0,l,n)};s.exports=p},77597:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"x",a,l,n,u)};s.exports=p},83194:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"x",a,n,f,o),r(h,"y",l,u,f,o)};s.exports=p},67678:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"y",a,l,n,u)};s.exports=p},35850:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=new r);var f,o,c=h.length;if(c===1)f=h[0].x,o=h[0].y,h[0].x=a,h[0].y=l;else{var d=1,v=0;n===0&&(v=c-1,d=c-2),f=h[v].x,o=h[v].y,h[v].x=a,h[v].y=l;for(var m=0;m=c||d===-1)){var S=h[d],M=S.x,w=S.y;S.x=f,S.y=o,f=M,o=w,n===0?d--:d++}}return u.x=f,u.y=o,u};s.exports=p},8628:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33680),p=function(h){return r(h)};s.exports=p},21837:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7602),p=function(h,a,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,o;if(u)for(o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54261),p=function(h,a,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,o;if(u)for(o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){if(a===void 0&&(a=!1),e.length===0)return e;if(e.length===1)return a?e[0][r]+=(h+p)/2:e[0][r]=(h+p)/2,e;var l=Math.abs(h-p)/(e.length-1),n;if(a)for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0;r{/** + * @author Richard Davey + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h,a,l){l===void 0&&(l=0);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AlignTo:e(11517),Angle:e(80318),Call:e(60757),GetFirst:e(69927),GetLast:e(32265),GridAlign:e(94420),IncAlpha:e(41721),IncX:e(67285),IncXY:e(9074),IncY:e(75222),PlaceOnCircle:e(22983),PlaceOnEllipse:e(95253),PlaceOnLine:e(88505),PlaceOnRectangle:e(41346),PlaceOnTriangle:e(11575),PlayAnimation:e(29953),PropertyValueInc:e(66979),PropertyValueSet:e(43967),RandomCircle:e(88926),RandomEllipse:e(33286),RandomLine:e(96e3),RandomRectangle:e(28789),RandomTriangle:e(97154),Rotate:e(20510),RotateAround:e(91051),RotateAroundDistance:e(76332),ScaleX:e(61619),ScaleXY:e(94868),ScaleY:e(95532),SetAlpha:e(8689),SetBlendMode:e(2645),SetDepth:e(32372),SetHitArea:e(85373),SetOrigin:e(81583),SetRotation:e(79939),SetScale:e(2699),SetScaleX:e(98739),SetScaleY:e(98476),SetScrollFactor:e(6207),SetScrollFactorX:e(6607),SetScrollFactorY:e(72248),SetTint:e(14036),SetVisible:e(50159),SetX:e(77597),SetXY:e(83194),SetY:e(67678),ShiftPosition:e(35850),Shuffle:e(8628),SmootherStep:e(21910),SmoothStep:e(21837),Spread:e(62054),ToggleVisible:e(79815),WrapInRectangle:e(39665)}},42099:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(74943),a=e(81957),l=e(41138),n=e(35154),u=e(90126),f=new p({initialize:function(c,d,v){this.manager=c,this.key=d,this.type="frame",this.frames=this.getFrames(c.textureManager,n(v,"frames",[]),n(v,"defaultTextureKey",null),n(v,"sortFrames",!0)),this.frameRate=n(v,"frameRate",null),this.duration=n(v,"duration",null),this.msPerFrame,this.skipMissedFrames=n(v,"skipMissedFrames",!0),this.delay=n(v,"delay",0),this.repeat=n(v,"repeat",0),this.repeatDelay=n(v,"repeatDelay",0),this.yoyo=n(v,"yoyo",!1),this.showBeforeDelay=n(v,"showBeforeDelay",!1),this.showOnStart=n(v,"showOnStart",!1),this.hideOnComplete=n(v,"hideOnComplete",!1),this.randomFrame=n(v,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(h.PAUSE_ALL,this.pause,this),this.manager.on(h.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(o,c,d,v){d===null&&v===null?(o.frameRate=24,o.duration=24/c*1e3):d&&v===null?(o.duration=d,o.frameRate=c/(d/1e3)):(o.frameRate=v,o.duration=c/v*1e3),o.msPerFrame=1e3/o.frameRate},addFrame:function(o){return this.addFrameAt(this.frames.length,o)},addFrameAt:function(o,c){var d=this.getFrames(this.manager.textureManager,c);if(d.length>0){if(o===0)this.frames=d.concat(this.frames);else if(o===this.frames.length)this.frames=this.frames.concat(d);else{var v=this.frames.slice(0,o),m=this.frames.slice(o);this.frames=v.concat(d,m)}this.updateFrameSequence()}return this},checkFrame:function(o){return o>=0&&o0){M.isLast=!0,M.nextFrame=m[0],m[0].prevFrame=M;var G=1/(m.length-1);for(C=0;C0?o.inReverse&&o.forward?o.forward=!1:this.repeatAnimation(o):o.complete():this.updateAndGetNextTick(o,c.nextFrame)},handleYoyoFrame:function(o,c){if(c||(c=!1),o.inReverse===!c&&o.repeatCounter>0){(o.repeatDelay===0||o.pendingRepeat)&&(o.forward=c),this.repeatAnimation(o);return}if(o.inReverse!==c&&o.repeatCounter===0){o.complete();return}o.forward=c;var d=c?o.currentFrame.nextFrame:o.currentFrame.prevFrame;this.updateAndGetNextTick(o,d)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(o){var c=o.currentFrame;c.isFirst?o.yoyo?this.handleYoyoFrame(o,!0):o.repeatCounter>0?o.inReverse&&!o.forward?this.repeatAnimation(o):(o.forward=!0,this.repeatAnimation(o)):o.complete():this.updateAndGetNextTick(o,c.prevFrame)},updateAndGetNextTick:function(o,c){o.setCurrentFrame(c),this.getNextTick(o)},removeFrame:function(o){var c=this.frames.indexOf(o);return c!==-1&&this.removeFrameAt(c),this},removeFrameAt:function(o){return this.frames.splice(o,1),this.updateFrameSequence(),this},repeatAnimation:function(o){if(o._pendingStop===2){if(o._pendingStopValue===0)return o.stop();o._pendingStopValue--}o.repeatDelay>0&&!o.pendingRepeat?(o.pendingRepeat=!0,o.accumulator-=o.nextTick,o.nextTick+=o.repeatDelay):(o.repeatCounter--,o.forward?o.setCurrentFrame(o.currentFrame.nextFrame):o.setCurrentFrame(o.currentFrame.prevFrame),o.isPlaying&&(this.getNextTick(o),o.handleRepeat()))},toJSON:function(){var o={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(c){o.frames.push(c.toJSON())}),o},updateFrameSequence:function(){for(var o=this.frames.length,c=1/(o-1),d,v=0;v1?(d.isLast=!0,d.prevFrame=this.frames[o-2],d.nextFrame=this.frames[0]):o>1&&(d.prevFrame=this.frames[v-1],d.nextFrame=this.frames[v+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(h.PAUSE_ALL,this.pause,this),this.manager.off(h.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f){f===void 0&&(f=!1),this.textureKey=a,this.textureFrame=l,this.index=n,this.frame=u,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=f},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});s.exports=p},60848:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42099),p=e(83419),h=e(90330),a=e(50792),l=e(74943),n=e(8443),u=e(95540),f=e(35154),o=e(36383),c=e(20283),d=e(41836),v=new p({Extends:a,initialize:function(S){a.call(this),this.game=S,this.textureManager=null,this.globalTimeScale=1,this.anims=new h,this.mixes=new h,this.paused=!1,this.name="AnimationManager",S.events.once(n.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(n.DESTROY,this.destroy,this)},addMix:function(m,S,M){var w=this.anims,C=this.mixes,A=typeof m=="string"?m:m.key,P=typeof S=="string"?S:S.key;if(w.has(A)&&w.has(P)){var b=C.get(A);b||(b={}),b[P]=M,C.set(A,b)}return this},removeMix:function(m,S){var M=this.mixes,w=typeof m=="string"?m:m.key,C=M.get(w);if(C)if(S){var A=typeof S=="string"?S:S.key;C.hasOwnProperty(A)&&delete C[A]}else S||M.delete(w);return this},getMix:function(m,S){var M=this.mixes,w=typeof m=="string"?m:m.key,C=typeof S=="string"?S:S.key,A=M.get(w);return A&&A.hasOwnProperty(C)?A[C]:0},add:function(m,S){return this.anims.has(m)?(console.warn("Animation key exists: "+m),this):(S.key=m,this.anims.set(m,S),this.emit(l.ADD_ANIMATION,m,S),this)},exists:function(m){return this.anims.has(m)},createFromAseprite:function(m,S,M){var w=[],C=this.game.cache.json.get(m);if(!C)return console.warn("No Aseprite data found for: "+m),w;var A=this,P=f(C,"meta",null),b=f(C,"frames",null);if(P&&b){var O=f(P,"frameTags",[]);O.forEach(function(I){var D=[],B=u(I,"name",null),G=u(I,"from",0),z=u(I,"to",0),X=u(I,"direction","forward");if(B&&(!S||S&&S.indexOf(B)>-1)){for(var j=0,Q=G;Q<=z;Q++){var tt=Q.toString(),Y=b[tt];if(Y){var Z=u(Y,"duration",o.MAX_SAFE_INTEGER);D.push({key:m,frame:tt,duration:Z}),j+=Z}}X==="reverse"&&(D=D.reverse());var U={key:B,frames:D,duration:j,yoyo:X==="pingpong"},H;M?M.anims&&(H=M.anims.create(U)):H=A.create(U),H&&w.push(H)}})}return w},create:function(m){var S=m.key,M=!1;return S&&(M=this.get(S),M?console.warn("AnimationManager key already exists: "+S):(M=new r(this,S,m),this.anims.set(S,M),this.emit(l.ADD_ANIMATION,S,M))),M},fromJSON:function(m,S){S===void 0&&(S=!1),S&&this.anims.clear(),typeof m=="string"&&(m=JSON.parse(m));var M=[];if(m.hasOwnProperty("anims")&&Array.isArray(m.anims)){for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42099),p=e(30976),h=e(83419),a=e(90330),l=e(74943),n=e(95540),u=new h({initialize:function(o){this.parent=o,this.animationManager=o.scene.sys.anims,this.animationManager.on(l.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(f){var o=this.parent;if(f===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,o;Array.isArray(f)||(f=[f]);for(var c=0;cv&&(M=0),this.randomFrame&&(M=p(0,v-1));var w=d.frames[M];M===0&&!this.forward&&(w=d.getLastFrame()),this.currentFrame=w}return this.parent},pause:function(f){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),f!==void 0&&this.setCurrentFrame(f),this.parent},resume:function(f){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),f!==void 0&&this.setCurrentFrame(f),this.parent},playAfterDelay:function(f,o){if(!this.isPlaying)this.delayCounter=o,this.play(f,!0);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.nextAnim=f,this._pendingStop=1,this._pendingStopValue=o}return this.parent},playAfterRepeat:function(f,o){if(o===void 0&&(o=1),!this.isPlaying)this.play(f);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.repeatCounter!==-1&&o>this.repeatCounter&&(o=this.repeatCounter),this.nextAnim=f,this._pendingStop=2,this._pendingStopValue=o}return this.parent},play:function(f,o){o===void 0&&(o=!1);var c=this.currentAnim,d=this.parent,v=typeof f=="string"?f:f.key;if(o&&this.isPlaying&&c.key===v)return d;if(c&&this.isPlaying){var m=this.animationManager.getMix(c.key,f);if(m>0)return this.playAfterDelay(f,m)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f)},playReverse:function(f,o){o===void 0&&(o=!1);var c=typeof f=="string"?f:f.key;return o&&this.isPlaying&&this.currentAnim.key===c?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f))},startAnimation:function(f){this.load(f);var o=this.currentAnim,c=this.parent;return o&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,o.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)),c},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(l.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(l.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(l.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(l.ANIMATION_COMPLETE,l.ANIMATION_COMPLETE_KEY)},emitEvents:function(f,o){var c=this.currentAnim;if(c){var d=this.currentFrame,v=this.parent,m=d.textureFrame;v.emit(f,c,d,v,m),o&&v.emit(o+c.key,c,d,v,m)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var f=this.currentFrame;if(!f)return 0;var o=f.progress;return this.inReverse&&(o*=-1),o},setProgress:function(f){return this.forward||(f=1-f),this.setCurrentFrame(this.currentAnim.getFrameByProgress(f)),this.parent},setRepeat:function(f){return this.repeatCounter=f===-1?Number.MAX_VALUE:f,this.parent},globalRemove:function(f,o){o===void 0&&(o=this.currentAnim),this.isPlaying&&o.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(f,o){f===void 0&&(f=!1),o===void 0&&(o=!1);var c=this.currentAnim,d=this.parent;return c?(o&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),c.getFirstTick(this),this.emitEvents(l.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!f,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(c.frames[0]),this.parent):d},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(f)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(f)}return this.parent},stopAfterDelay:function(f){return this._pendingStop=1,this._pendingStopValue=f,this.parent},stopAfterRepeat:function(f){return f===void 0&&(f=1),this.repeatCounter!==-1&&f>this.repeatCounter&&(f=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=f,this.parent},stopOnFrame:function(f){return this._pendingStop=3,this._pendingStopValue=f,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(f,o){var c=this.currentAnim;if(!(!this.isPlaying||!c||c.paused)){if(this.accumulator+=o*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=o,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?c.nextFrame(this):c.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var d=0;do this.forward?c.nextFrame(this):c.previousFrame(this),d++;while(this.isPlaying&&this.accumulator>this.nextTick&&d<60)}}},setCurrentFrame:function(f){var o=this.parent;return this.currentFrame=f,o.texture=f.frame.texture,o.frame=f.frame,o.isCropped&&o.frame.updateCropUVs(o._crop,o.flipX,o.flipY),f.setAlpha&&(o.alpha=f.alpha),o.setSizeToFrame(),o._originComponent&&(f.frame.customPivot?o.setOrigin(f.frame.pivotX,f.frame.pivotY):o.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(l.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===f&&this.stop()),o},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(f){return this.anims?this.anims.get(f):null},exists:function(f){return this.anims?this.anims.has(f):!1},create:function(f){var o=f.key,c=!1;return o&&(c=this.get(o),c?console.warn("Animation key already exists: "+o):(c=new r(this,o,f),this.anims||(this.anims=new a),this.anims.set(o,c))),c},createFromAseprite:function(f,o){return this.animationManager.createFromAseprite(f,o,this.parent)},generateFrameNames:function(f,o){return this.animationManager.generateFrameNames(f,o)},generateFrameNumbers:function(f,o){return this.animationManager.generateFrameNumbers(f,o)},remove:function(f){var o=this.get(f);return o&&(this.currentAnim===o&&this.stop(),this.anims.delete(f)),o},destroy:function(){this.animationManager.off(l.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}}});s.exports=u},57090:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},25312:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationcomplete"},89580:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationcomplete-"},52860:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationrepeat"},63850:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationrestart"},99085:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationstart"},28087:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationstop"},1794:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationupdate"},52562:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pauseall"},57953:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},68339:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resumeall"},74943:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD_ANIMATION:e(57090),ANIMATION_COMPLETE:e(25312),ANIMATION_COMPLETE_KEY:e(89580),ANIMATION_REPEAT:e(52860),ANIMATION_RESTART:e(63850),ANIMATION_START:e(99085),ANIMATION_STOP:e(28087),ANIMATION_UPDATE:e(1794),PAUSE_ALL:e(52562),REMOVE_ANIMATION:e(57953),RESUME_ALL:e(68339)}},60421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Animation:e(42099),AnimationFrame:e(41138),AnimationManager:e(60848),AnimationState:e(9674),Events:e(74943)}},2161:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(90330),h=e(50792),a=e(24736),l=new r({initialize:function(){this.entries=new p,this.events=new h},add:function(n,u){return this.entries.set(n,u),this.events.emit(a.ADD,this,n,u),this},has:function(n){return this.entries.has(n)},exists:function(n){return this.entries.has(n)},get:function(n){return this.entries.get(n)},remove:function(n){var u=this.get(n);return u&&(this.entries.delete(n),this.events.emit(a.REMOVE,this,n,u.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});s.exports=l},24047:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2161),p=e(83419),h=e(8443),a=new p({initialize:function(n){this.game=n,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.obj=new r,this.tilemap=new r,this.xml=new r,this.custom={},this.game.events.once(h.DESTROY,this.destroy,this)},addCustom:function(l){return this.custom.hasOwnProperty(l)||(this.custom[l]=new r),this.custom[l]},destroy:function(){for(var l=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},59261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},24736:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(51464),REMOVE:e(59261)}},83388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BaseCache:e(2161),CacheManager:e(24047),Events:e(24736)}},71911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(39506),a=e(50792),l=e(19715),n=e(87841),u=e(61340),f=e(80333),o=e(26099),c=new r({Extends:a,Mixins:[p.AlphaSingle,p.Visible],initialize:function(v,m,S,M){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new n,this.dirty=!0,this._x=v,this._y=m,this._width=S,this._height=M,this._bounds=new n,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new u,this.transparent=!0,this.backgroundColor=f("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new o(S/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(d){this.renderList.push(d)},setOrigin:function(d,v){return d===void 0&&(d=.5),v===void 0&&(v=d),this.originX=d,this.originY=v,this},getScroll:function(d,v,m){m===void 0&&(m=new o);var S=this.width*.5,M=this.height*.5;return m.x=d-S,m.y=v-M,this.useBounds&&(m.x=this.clampX(m.x),m.y=this.clampY(m.y)),m},centerOnX:function(d){var v=this.width*.5;return this.midPoint.x=d,this.scrollX=d-v,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(d){var v=this.height*.5;return this.midPoint.y=d,this.scrollY=d-v,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(d,v){return this.centerOnX(d),this.centerOnY(v),this},centerToBounds:function(){if(this.useBounds){var d=this._bounds,v=this.width*.5,m=this.height*.5;this.midPoint.set(d.centerX,d.centerY),this.scrollX=d.centerX-v,this.scrollY=d.centerY-m}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(d){if(this.disableCull)return d;var v=this.matrix.matrix,m=v[0],S=v[1],M=v[2],w=v[3],C=m*w-S*M;if(!C)return d;var A=v[4],P=v[5],b=this.scrollX,O=this.scrollY,I=this.width,D=this.height,B=this.y,G=B+D,z=this.x,X=z+I,j=this.culledObjects,Q=d.length;C=1/C,j.length=0;for(var tt=0;ttz&&_B&&qM&&(d=M),d},clampY:function(d){var v=this._bounds,m=this.displayHeight,S=v.y+(m-this.height)/2,M=Math.max(S,S+v.height-m);return dM&&(d=M),d},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(d){return d===void 0&&(d=0),this.rotation=h(d),this},setBackgroundColor:function(d){return d===void 0&&(d="rgba(0,0,0,0)"),this.backgroundColor=f(d),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(d,v,m,S,M){return M===void 0&&(M=!1),this._bounds.setTo(d,v,m,S),this.dirty=!0,this.useBounds=!0,M?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(d){d===void 0&&(d=new n);var v=this._bounds;return d.setTo(v.x,v.y,v.width,v.height),d},setName:function(d){return d===void 0&&(d=""),this.name=d,this},setPosition:function(d,v){return v===void 0&&(v=d),this.x=d,this.y=v,this},setRotation:function(d){return d===void 0&&(d=0),this.rotation=d,this},setRoundPixels:function(d){return this.roundPixels=d,this},setScene:function(d,v){v===void 0&&(v=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=d,this.isSceneCamera=v;var m=d.sys;return this.sceneManager=m.game.scene,this.scaleManager=m.scale,this.cameraManager=m.cameras,this.updateSystem(),this},setScroll:function(d,v){return v===void 0&&(v=d),this.scrollX=d,this.scrollY=v,this},setSize:function(d,v){return v===void 0&&(v=d),this.width=d,this.height=v,this},setViewport:function(d,v,m,S){return this.x=d,this.y=v,this.width=m,this.height=S,this},setZoom:function(d,v){return d===void 0&&(d=1),v===void 0&&(v=d),d===0&&(d=.001),v===0&&(v=.001),this.zoomX=d,this.zoomY=v,this},setMask:function(d,v){return v===void 0&&(v=!0),this.mask=d,this._maskCamera=v?this.cameraManager.default:this,this},clearMask:function(d){return d===void 0&&(d=!1),d&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var d={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&&(d.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),d},update:function(){},setIsSceneCamera:function(d){return this.isSceneCamera=d,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var d=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,v=this.sceneManager;d&&!this._customViewport?v.customViewports++:!d&&this._customViewport&&v.customViewports--,this.dirty=!0,this._customViewport=d}},destroy:function(){this.emit(l.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(d){this._x=d,this.updateSystem()}},y:{get:function(){return this._y},set:function(d){this._y=d,this.updateSystem()}},width:{get:function(){return this._width},set:function(d){this._width=d,this.updateSystem()}},height:{get:function(){return this._height},set:function(d){this._height=d,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(d){d!==this._scrollX&&(this._scrollX=d,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(d){d!==this._scrollY&&(this._scrollY=d,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(d){this._zoomX=d,this._zoomY=d,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(d){this._zoomX=d,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(d){this._zoomY=d,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(d){this._rotation=d,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}}});s.exports=c},38058:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71911),p=e(67502),h=e(45319),a=e(83419),l=e(31401),n=e(20052),u=e(19715),f=e(28915),o=e(87841),c=e(26099),d=new a({Extends:r,Mixins:[l.PostPipeline],initialize:function(m,S,M,w){r.call(this,m,S,M,w),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new n.Fade(this),this.flashEffect=new n.Flash(this),this.shakeEffect=new n.Shake(this),this.panEffect=new n.Pan(this),this.rotateToEffect=new n.RotateTo(this),this.zoomEffect=new n.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(v,m){if(v===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=v,this.deadzone.height=m):this.deadzone=new o(0,0,v,m),this._follow){var S=this.width/2,M=this.height/2,w=this._follow.x-this.followOffset.x,C=this._follow.y-this.followOffset.y;this.midPoint.set(w,C),this.scrollX=w-S,this.scrollY=C-M}p(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(v,m,S,M,w,C){return this.fadeEffect.start(!1,v,m,S,M,!0,w,C)},fadeOut:function(v,m,S,M,w,C){return this.fadeEffect.start(!0,v,m,S,M,!0,w,C)},fadeFrom:function(v,m,S,M,w,C,A){return this.fadeEffect.start(!1,v,m,S,M,w,C,A)},fade:function(v,m,S,M,w,C,A){return this.fadeEffect.start(!0,v,m,S,M,w,C,A)},flash:function(v,m,S,M,w,C,A){return this.flashEffect.start(v,m,S,M,w,C,A)},shake:function(v,m,S,M,w){return this.shakeEffect.start(v,m,S,M,w)},pan:function(v,m,S,M,w,C,A){return this.panEffect.start(v,m,S,M,w,C,A)},rotateTo:function(v,m,S,M,w,C,A){return this.rotateToEffect.start(v,m,S,M,w,C,A)},zoomTo:function(v,m,S,M,w,C){return this.zoomEffect.start(v,m,S,M,w,C)},preRender:function(){this.renderList.length=0;var v=this.width,m=this.height,S=v*.5,M=m*.5,w=this.zoom,C=this.matrix,A=v*this.originX,P=m*this.originY,b=this._follow,O=this.deadzone,I=this.scrollX,D=this.scrollY;O&&p(O,this.midPoint.x,this.midPoint.y);var B=!1;if(b&&!this.panEffect.isRunning){var G=this.lerp,z=b.x-this.followOffset.x,X=b.y-this.followOffset.y;O?(zO.right&&(I=f(I,I+(z-O.right),G.x)),XO.bottom&&(D=f(D,D+(X-O.bottom),G.y))):(I=f(I,z-A,G.x),D=f(D,X-P,G.y)),B=!0}this.useBounds&&(I=this.clampX(I),D=this.clampY(D)),this.scrollX=I,this.scrollY=D;var j=I+S,Q=D+M;this.midPoint.set(j,Q);var tt=v/w,Y=m/w,Z=Math.floor(j-tt/2),U=Math.floor(Q-Y/2);this.worldView.setTo(Z,U,tt,Y),C.applyITRS(Math.floor(this.x+A),Math.floor(this.y+P),this.rotation,w,w),C.translate(-A,-P),this.shakeEffect.preRender(),B&&this.emit(u.FOLLOW_UPDATE,this,b)},setLerp:function(v,m){return v===void 0&&(v=1),m===void 0&&(m=v),this.lerp.set(v,m),this},setFollowOffset:function(v,m){return v===void 0&&(v=0),m===void 0&&(m=0),this.followOffset.set(v,m),this},startFollow:function(v,m,S,M,w,C){m===void 0&&(m=!1),S===void 0&&(S=1),M===void 0&&(M=S),w===void 0&&(w=0),C===void 0&&(C=w),this._follow=v,this.roundPixels=m,S=h(S,0,1),M=h(M,0,1),this.lerp.set(S,M),this.followOffset.set(w,C);var A=this.width/2,P=this.height/2,b=v.x-w,O=v.y-C;return this.midPoint.set(b,O),this.scrollX=b-A,this.scrollY=O-P,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(v,m){this.visible&&(this.rotateToEffect.update(v,m),this.panEffect.update(v,m),this.zoomEffect.update(v,m),this.shakeEffect.update(v,m),this.flashEffect.update(v,m),this.fadeEffect.update(v,m))},destroy:function(){this.resetFX(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});s.exports=d},32743:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38058),p=e(83419),h=e(95540),a=e(37277),l=e(37303),n=e(97480),u=e(44594),f=new p({initialize:function(c){this.scene=c,this.systems=c.sys,this.roundPixels=c.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,c.sys.events.once(u.BOOT,this.boot,this),c.sys.events.on(u.START,this.start,this)},boot:function(){var o=this.systems;o.settings.cameras?this.fromJSON(o.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,o.scale.width,o.scale.height).setScene(this.scene),o.game.scale.on(n.RESIZE,this.onResize,this),this.systems.events.once(u.DESTROY,this.destroy,this)},start:function(){if(!this.main){var o=this.systems;o.settings.cameras?this.fromJSON(o.settings.cameras):this.add(),this.main=this.cameras[0]}var c=this.systems.events;c.on(u.UPDATE,this.update,this),c.once(u.SHUTDOWN,this.shutdown,this)},add:function(o,c,d,v,m,S){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),m===void 0&&(m=!1),S===void 0&&(S="");var M=new r(o,c,d,v);return M.setName(S),M.setScene(this.scene),M.setRoundPixels(this.roundPixels),M.id=this.getNextID(),this.cameras.push(M),m&&(this.main=M),M},addExisting:function(o,c){c===void 0&&(c=!1);var d=this.cameras.indexOf(o);return d===-1?(o.id=this.getNextID(),o.setRoundPixels(this.roundPixels),this.cameras.push(o),c&&(this.main=o),o):null},getNextID:function(){for(var o=this.cameras,c=1,d=0;d<32;d++){for(var v=!1,m=0;m0){S.preRender();var M=this.getVisibleChildren(c.getChildren(),S);o.render(d,M,S)}}},getVisibleChildren:function(o,c){return o.filter(function(d){return d.willRender(c)})},resetAll:function(){for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=new p({initialize:function(n){this.camera=n,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(l,n,u,f,o,c,d,v){if(l===void 0&&(l=!0),n===void 0&&(n=1e3),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),!c&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=n,this.direction=l,this.progress=0,this.red=u,this.green=f,this.blue=o,this.alpha=l?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v;var m=l?h.FADE_OUT_START:h.FADE_IN_START;return this.camera.emit(m,this.camera,this,n,u,f,o),this.camera},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(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 r=e(45319),p=e(83419),h=e(19715),a=new p({initialize:function(n){this.camera=n,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(l,n,u,f,o,c,d){return l===void 0&&(l=250),n===void 0&&(n=255),u===void 0&&(u=255),f===void 0&&(f=255),o===void 0&&(o=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene),!o&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=l,this.progress=0,this.red=n,this.green=u,this.blue=f,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(h.FLASH_START,this.camera,this,l,n,u,f),this.camera)},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(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 r=e(45319),p=e(83419),h=e(62640),a=e(19715),l=e(26099),n=new p({initialize:function(f){this.camera=f,this.isRunning=!1,this.duration=0,this.source=new l,this.current=new l,this.destination=new l,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(u,f,o,c,d,v,m){o===void 0&&(o=1e3),c===void 0&&(c=h.Linear),d===void 0&&(d=!1),v===void 0&&(v=null),m===void 0&&(m=this.camera.scene);var S=this.camera;return!d&&this.isRunning||(this.isRunning=!0,this.duration=o,this.progress=0,this.source.set(S.scrollX,S.scrollY),this.destination.set(u,f),S.getScroll(u,f,this.current),typeof c=="string"&&h.hasOwnProperty(c)?this.ease=h[c]:typeof c=="function"&&(this.ease=c),this._elapsed=0,this._onUpdate=v,this._onUpdateScope=m,this.camera.emit(a.PAN_START,this.camera,this,o,u,f)),S},update:function(u,f){if(this.isRunning){this._elapsed+=f;var o=r(this._elapsed/this.duration,0,1);this.progress=o;var c=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 r=e(45319),p=e(83419),h=e(19715),a=e(62640),l=new p({initialize:function(u){this.camera=u,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(n,u,f,o,c,d,v){f===void 0&&(f=1e3),o===void 0&&(o=a.Linear),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),u===void 0&&(u=!1),this.shortestPath=u;var m=n;n<0?(m=-1*n,this.clockwise=!1):this.clockwise=!0;var S=360*Math.PI/180;m=m-Math.floor(m/S)*S;var M=this.camera;if(!c&&this.isRunning)return M;if(this.isRunning=!0,this.duration=f,this.progress=0,this.source=M.rotation,this.destination=m,typeof o=="string"&&a.hasOwnProperty(o)?this.ease=a[o]:typeof o=="function"&&(this.ease=o),this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v,this.shortestPath){var w=0,C=0;this.destination>this.source?w=Math.abs(this.destination-this.source):w=Math.abs(this.destination+S)-this.source,this.source>this.destination?C=Math.abs(this.source-this.destination):C=Math.abs(this.source+S)-this.destination,wC&&(this.clockwise=!1)}return this.camera.emit(h.ROTATE_START,this.camera,this,f,m),M},update:function(n,u){if(this.isRunning){this._elapsed+=u;var f=r(this._elapsed/this.duration,0,1);this.progress=f;var o=this.camera;if(this._elapsed=S?d=Math.abs(m-S):d=Math.abs(m+v)-S;var M=0;this.clockwise?M=o.rotation+d*c:M=o.rotation-d*c,o.rotation=M,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,o,f,M)}else o.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,o,f,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(h.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}});s.exports=l},30330:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=e(26099),l=new p({initialize:function(u){this.camera=u,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(n,u,f,o,c){return n===void 0&&(n=100),u===void 0&&(u=.05),f===void 0&&(f=!1),o===void 0&&(o=null),c===void 0&&(c=this.camera.scene),!f&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=n,this.progress=0,typeof u=="number"?this.intensity.set(u):this.intensity.set(u.x,u.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=o,this._onUpdateScope=c,this.camera.emit(h.SHAKE_START,this.camera,this,n,u),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(n,u){if(this.isRunning)if(this._elapsed+=u,this.progress=r(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 r=e(45319),p=e(83419),h=e(62640),a=e(19715),l=new p({initialize:function(u){this.camera=u,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(n,u,f,o,c,d){u===void 0&&(u=1e3),f===void 0&&(f=h.Linear),o===void 0&&(o=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene);var v=this.camera;return!o&&this.isRunning||(this.isRunning=!0,this.duration=u,this.progress=0,this.source=v.zoom,this.destination=n,typeof f=="string"&&h.hasOwnProperty(f)?this.ease=h[f]:typeof f=="function"&&(this.ease=f),this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(a.ZOOM_START,this.camera,this,u,n)),v},update:function(n,u){this.isRunning&&(this._elapsed+=u,this.progress=r(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} + */s.exports={Fade:e(5020),Flash:e(10662),Pan:e(20359),Shake:e(30330),RotateTo:e(34208),Zoom:e(45641)}},16438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameradestroy"},32726:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeincomplete"},87807:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeinstart"},45917:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeoutcomplete"},95666:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeoutstart"},47056:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameraflashcomplete"},91261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameraflashstart"},45047:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="followupdate"},81927:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerapancomplete"},74264:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerapanstart"},54419:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},79330:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},93183:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerarotatecomplete"},80112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerarotatestart"},62252:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerashakecomplete"},86017:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerashakestart"},539:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerazoomcomplete"},51892:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerazoomstart"},19715:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DESTROY:e(16438),FADE_IN_COMPLETE:e(32726),FADE_IN_START:e(87807),FADE_OUT_COMPLETE:e(45917),FADE_OUT_START:e(95666),FLASH_COMPLETE:e(47056),FLASH_START:e(91261),FOLLOW_UPDATE:e(45047),PAN_COMPLETE:e(81927),PAN_START:e(74264),POST_RENDER:e(54419),PRE_RENDER:e(79330),ROTATE_COMPLETE:e(93183),ROTATE_START:e(80112),SHAKE_COMPLETE:e(62252),SHAKE_START:e(86017),ZOOM_COMPLETE:e(539),ZOOM_START:e(51892)}},87969:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Camera:e(38058),BaseCamera:e(71911),CameraManager:e(32743),Effects:e(20052),Events:e(19715)}},63091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.speedX=0,this.speedY=0;var n=p(l,"speed",null);typeof n=="number"?(this.speedX=n,this.speedY=n):(this.speedX=p(l,"speed.x",0),this.speedY=p(l,"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(a){return this.camera=a,this},update:function(a){if(this.active){a===void 0&&(a=1);var l=this.camera;this.up&&this.up.isDown?l.scrollY-=this.speedY*a|0:this.down&&this.down.isDown&&(l.scrollY+=this.speedY*a|0),this.left&&this.left.isDown?l.scrollX-=this.speedX*a|0:this.right&&this.right.isDown&&(l.scrollX+=this.speedX*a|0),this.zoomIn&&this.zoomIn.isDown?(l.zoom-=this.zoomSpeed,l.zoomthis.maxZoom&&(l.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}});s.exports=h},58818:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.accelX=0,this.accelY=0;var n=p(l,"acceleration",null);typeof n=="number"?(this.accelX=n,this.accelY=n):(this.accelX=p(l,"acceleration.x",0),this.accelY=p(l,"acceleration.y",0)),this.dragX=0,this.dragY=0;var u=p(l,"drag",null);typeof u=="number"?(this.dragX=u,this.dragY=u):(this.dragX=p(l,"drag.x",0),this.dragY=p(l,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var f=p(l,"maxSpeed",null);typeof f=="number"?(this.maxSpeedX=f,this.maxSpeedY=f):(this.maxSpeedX=p(l,"maxSpeed.x",0),this.maxSpeedY=p(l,"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(a){return this.camera=a,this},update:function(a){if(this.active){a===void 0&&(a=1);var l=this.camera;this._speedX>0?(this._speedX-=this.dragX*a,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*a,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*a,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*a,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&&(l.scrollX-=this._speedX*a|0),this._speedY!==0&&(l.scrollY-=this._speedY*a|0),this._zoom!==0&&(l.zoom+=this._zoom,l.zoomthis.maxZoom&&(l.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}});s.exports=h},38865:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={FixedKeyControl:e(63091),SmoothedKeyControl:e(58818)}},26638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Controls:e(38865),Scene2D:e(87969)}},8054:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={VERSION:"3.80.1",BlendModes:e(10312),ScaleModes:e(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};s.exports=r},69547:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8054),h=e(42363),a=e(82264),l=e(95540),n=e(35154),u=e(41212),f=e(29747),o=e(75508),c=e(36060),d=e(80333),v=new r({initialize:function(S){S===void 0&&(S={});var M=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],w="#ffffff",C=n(S,"scale",null);this.width=n(C,"width",1024,S),this.height=n(C,"height",768,S),this.zoom=n(C,"zoom",1,S),this.parent=n(C,"parent",void 0,S),this.scaleMode=n(C,C?"mode":"scaleMode",0,S),this.expandParent=n(C,"expandParent",!0,S),this.autoRound=n(C,"autoRound",!1,S),this.autoCenter=n(C,"autoCenter",0,S),this.resizeInterval=n(C,"resizeInterval",500,S),this.fullscreenTarget=n(C,"fullscreenTarget",null,S),this.minWidth=n(C,"min.width",0,S),this.maxWidth=n(C,"max.width",0,S),this.minHeight=n(C,"min.height",0,S),this.maxHeight=n(C,"max.height",0,S),this.snapWidth=n(C,"snap.width",0,S),this.snapHeight=n(C,"snap.height",0,S),this.renderType=n(S,"type",p.AUTO),this.canvas=n(S,"canvas",null),this.context=n(S,"context",null),this.canvasStyle=n(S,"canvasStyle",null),this.customEnvironment=n(S,"customEnvironment",!1),this.sceneConfig=n(S,"scene",null),this.seed=n(S,"seed",[(Date.now()*Math.random()).toString()]),o.RND=new o.RandomDataGenerator(this.seed),this.gameTitle=n(S,"title",""),this.gameURL=n(S,"url","https://phaser.io"),this.gameVersion=n(S,"version",""),this.autoFocus=n(S,"autoFocus",!0),this.stableSort=n(S,"stableSort",-1),this.stableSort===-1&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=n(S,"dom.createContainer",!1),this.domPointerEvents=n(S,"dom.pointerEvents","none"),this.inputKeyboard=n(S,"input.keyboard",!0),this.inputKeyboardEventTarget=n(S,"input.keyboard.target",window),this.inputKeyboardCapture=n(S,"input.keyboard.capture",[]),this.inputMouse=n(S,"input.mouse",!0),this.inputMouseEventTarget=n(S,"input.mouse.target",null),this.inputMousePreventDefaultDown=n(S,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=n(S,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=n(S,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=n(S,"input.mouse.preventDefaultWheel",!0),this.inputTouch=n(S,"input.touch",a.input.touch),this.inputTouchEventTarget=n(S,"input.touch.target",null),this.inputTouchCapture=n(S,"input.touch.capture",!0),this.inputActivePointers=n(S,"input.activePointers",1),this.inputSmoothFactor=n(S,"input.smoothFactor",0),this.inputWindowEvents=n(S,"input.windowEvents",!0),this.inputGamepad=n(S,"input.gamepad",!1),this.inputGamepadEventTarget=n(S,"input.gamepad.target",window),this.disableContextMenu=n(S,"disableContextMenu",!1),this.audio=n(S,"audio",{}),this.hideBanner=n(S,"banner",null)===!1,this.hidePhaser=n(S,"banner.hidePhaser",!1),this.bannerTextColor=n(S,"banner.text",w),this.bannerBackgroundColor=n(S,"banner.background",M),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=n(S,"fps",null),this.disablePreFX=n(S,"disablePreFX",!1),this.disablePostFX=n(S,"disablePostFX",!1);var A=n(S,"render",null);this.pipeline=n(A,"pipeline",null,S),this.autoMobilePipeline=n(A,"autoMobilePipeline",!0,S),this.defaultPipeline=n(A,"defaultPipeline",c.MULTI_PIPELINE,S),this.antialias=n(A,"antialias",!0,S),this.antialiasGL=n(A,"antialiasGL",!0,S),this.mipmapFilter=n(A,"mipmapFilter","",S),this.desynchronized=n(A,"desynchronized",!1,S),this.roundPixels=n(A,"roundPixels",!0,S),this.pixelArt=n(A,"pixelArt",this.zoom!==1,S),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=n(A,"transparent",!1,S),this.clearBeforeRender=n(A,"clearBeforeRender",!0,S),this.preserveDrawingBuffer=n(A,"preserveDrawingBuffer",!1,S),this.premultipliedAlpha=n(A,"premultipliedAlpha",!0,S),this.failIfMajorPerformanceCaveat=n(A,"failIfMajorPerformanceCaveat",!1,S),this.powerPreference=n(A,"powerPreference","default",S),this.batchSize=n(A,"batchSize",4096,S),this.maxTextures=n(A,"maxTextures",-1,S),this.maxLights=n(A,"maxLights",10,S);var P=n(S,"backgroundColor",0);this.backgroundColor=d(P),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=n(S,"callbacks.preBoot",f),this.postBoot=n(S,"callbacks.postBoot",f),this.physics=n(S,"physics",{}),this.defaultPhysicsSystem=n(this.physics,"default",!1),this.loaderBaseURL=n(S,"loader.baseURL",""),this.loaderPath=n(S,"loader.path",""),this.loaderMaxParallelDownloads=n(S,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=n(S,"loader.crossOrigin",void 0),this.loaderResponseType=n(S,"loader.responseType",""),this.loaderAsync=n(S,"loader.async",!0),this.loaderUser=n(S,"loader.user",""),this.loaderPassword=n(S,"loader.password",""),this.loaderTimeout=n(S,"loader.timeout",0),this.loaderWithCredentials=n(S,"loader.withCredentials",!1),this.loaderImageLoadType=n(S,"loader.imageLoadType","XHR"),this.loaderLocalScheme=n(S,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=n(S,"fx.glow.quality",.1),this.glowFXDistance=n(S,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var b=n(S,"plugins",null),O=h.DefaultScene;b&&(Array.isArray(b)?this.defaultPlugins=b:u(b)&&(this.installGlobalPlugins=l(b,"global",[]),this.installScenePlugins=l(b,"scene",[]),Array.isArray(b.default)?O=b.default:Array.isArray(b.defaultMerge)&&(O=O.concat(b.defaultMerge)))),this.defaultPlugins=O;var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=n(S,"images.default",I+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=n(S,"images.missing",I+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=n(S,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=p.WEBGL:window.FORCE_CANVAS&&(this.renderType=p.CANVAS))}});s.exports=v},86054:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20623),p=e(27919),h=e(8054),a=e(89357),l=function(n){var u=n.config;if((u.customEnvironment||u.canvas)&&u.renderType===h.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!u.customEnvironment&&!u.canvas&&u.renderType!==h.HEADLESS)if(u.renderType===h.AUTO&&(u.renderType=a.webGL?h.WEBGL:h.CANVAS),u.renderType===h.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else if(u.renderType===h.CANVAS){if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}else throw new Error("Unknown value for renderer type: "+u.renderType);u.antialias||p.disableSmoothing();var f=n.scale.baseSize,o=f.width,c=f.height;if(u.canvas?(n.canvas=u.canvas,n.canvas.width=o,n.canvas.height=c):n.canvas=p.create(n,o,c,u.renderType),u.canvasStyle&&(n.canvas.style=u.canvasStyle),u.antialias||r.setCrisp(n.canvas),u.renderType!==h.HEADLESS){var d,v;d=e(68627),v=e(74797),u.renderType===h.WEBGL?n.renderer=new v(n):(n.renderer=new d(n),n.context=n.renderer.gameContext)}};s.exports=l},96391:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8054),p=function(h){var a=h.config;if(!a.hideBanner){var l="WebGL";a.renderType===r.CANVAS?l="Canvas":a.renderType===r.HEADLESS&&(l="Headless");var n=a.audio,u=h.device.audio,f;if(u.webAudio&&!n.disableWebAudio?f="Web Audio":n.noAudio||!u.webAudio&&!u.audioData?f="No Audio":f="HTML5 Audio",h.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="",c=[o];if(Array.isArray(a.bannerBackgroundColor)){var d;a.bannerBackgroundColor.forEach(function(m){o=o.concat("%c "),c.push("background: "+m),d=m}),c[c.length-1]="color: "+a.bannerTextColor+"; background: "+d}else o=o.concat("%c "),c.push("color: "+a.bannerTextColor+"; background: "+a.bannerBackgroundColor);c.push("background: transparent"),a.gameTitle&&(o=o.concat(a.gameTitle),a.gameVersion&&(o=o.concat(" v"+a.gameVersion)),a.hidePhaser||(o=o.concat(" / ")));var v="";a.hidePhaser||(o=o.concat("Phaser v"+r.VERSION+v+" ("+l+" | "+f+")")),o=o.concat(" %c "+a.gameURL),c[0]=o,console.log.apply(console,c)}}};s.exports=p},50127:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=e(60848),h=e(24047),a=e(27919),l=e(83419),n=e(69547),u=e(83719),f=e(86054),o=e(45893),c=e(96391),d=e(82264),v=e(57264),m=e(50792),S=e(8443),M=e(7003),w=e(37277),C=e(77332),A=e(76531),P=e(60903),b=e(69442),O=e(17130),I=e(65898),D=e(51085),B=e(14747),G=new l({initialize:function(X){this.config=new n(X),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new p(this),this.textures=new O(this),this.cache=new h(this),this.registry=new o(this,new m),this.input=new M(this,this.config),this.scene=new P(this,this.config.sceneConfig),this.device=d,this.scale=new A(this,this.config),this.sound=null,this.sound=B.create(this),this.loop=new I(this,this.config.fps),this.plugins=new C(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,v(this.boot.bind(this))},boot:function(){if(!w.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),f(this),u(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(S.BOOT)},texturesReady:function(){this.events.emit(S.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)),D(this);var z=this.events;z.on(S.HIDDEN,this.onHidden,this),z.on(S.VISIBLE,this.onVisible,this),z.on(S.BLUR,this.onBlur,this),z.on(S.FOCUS,this.onFocus,this)},step:function(z,X){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var j=this.events;j.emit(S.PRE_STEP,z,X),j.emit(S.STEP,z,X),this.scene.update(z,X),j.emit(S.POST_STEP,z,X);var Q=this.renderer;Q.preRender(),j.emit(S.PRE_RENDER,Q,z,X),this.scene.render(Q),Q.postRender(),j.emit(S.POST_RENDER,Q,z,X)}},headlessStep:function(z,X){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var j=this.events;j.emit(S.PRE_STEP,z,X),j.emit(S.STEP,z,X),this.scene.update(z,X),j.emit(S.POST_STEP,z,X),this.scene.isProcessing=!1,j.emit(S.PRE_RENDER,null,z,X),j.emit(S.POST_RENDER,null,z,X)}},onHidden:function(){this.loop.pause(),this.events.emit(S.PAUSE)},pause:function(){var z=this.isPaused;this.isPaused=!0,z||this.events.emit(S.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(S.RESUME)},resume:function(){var z=this.isPaused;this.isPaused=!1,z&&this.events.emit(S.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(z,X){X===void 0&&(X=!1),this.pendingDestroy=!0,this.removeCanvas=z,this.noReturn=X},runDestroy:function(){this.scene.destroy(),this.events.emit(S.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.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}});s.exports=G},65898:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=e(29747),a=e(43092),l=new r({initialize:function(u,f){this.game=u,this.raf=new a,this.started=!1,this.running=!1,this.minFps=p(f,"min",5),this.targetFps=p(f,"target",60),this.fpsLimit=p(f,"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=h,this.forceSetTimeOut=p(f,"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=p(f,"deltaHistory",10),this.panicMax=p(f,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=p(f,"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 n=window.performance.now();this.time=n,this.lastTime=n,this.nextFpsUpdate=n+1e3,this.framesThisSecond=0;for(var u=0;u0||!this.inFocus)&&(this._coolDown--,n=Math.min(n,this._target)),n>this._min&&(n=f[u],n=Math.min(n,this._min)),f[u]=n,this.deltaIndex++,this.deltaIndex>=o&&(this.deltaIndex=0);for(var c=0,d=0;d=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(n,this.delta),this.delta=0),this.lastTime=n,this.frame++},step:function(n){this.now=n;var u=Math.max(0,n-this.lastTime);this.rawDelta=u,this.time+=this.rawDelta,this.smoothStep&&(u=this.smoothDelta(u)),this.delta=u,n>=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.callback(n,u),this.lastTime=n,this.frame++},tick:function(){var n=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(n):this.step(n)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(n){n===void 0&&(n=!1);var u=window.performance.now();if(!this.running){n&&(this.startTime+=-this.lastTime+(this.lastTime+u));var f=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(f,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=u+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}});s.exports=l},51085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8443),p=function(h){var a,l=h.events;if(document.hidden!==void 0)a="visibilitychange";else{var n=["webkit","moz","ms"];n.forEach(function(f){document[f+"Hidden"]!==void 0&&(document.hidden=function(){return document[f+"Hidden"]},a=f+"visibilitychange")})}var u=function(f){document.hidden||f.type==="pause"?l.emit(r.HIDDEN):l.emit(r.VISIBLE)};a&&document.addEventListener(a,u,!1),window.onblur=function(){l.emit(r.BLUR)},window.onfocus=function(){l.emit(r.FOCUS)},window.focus&&h.config.autoFocus&&window.focus()};s.exports=p},97217:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="blur"},47548:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},19814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="contextlost"},68446:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},41700:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="focus"},25432:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="hidden"},65942:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},59211:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},47789:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="poststep"},39066:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},460:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prestep"},16175:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},42331:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},11966:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="step"},32969:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="systemready"},94830:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="visible"},8443:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BLUR:e(97217),BOOT:e(47548),CONTEXT_LOST:e(19814),DESTROY:e(68446),FOCUS:e(41700),HIDDEN:e(25432),PAUSE:e(65942),POST_RENDER:e(59211),POST_STEP:e(47789),PRE_RENDER:e(39066),PRE_STEP:e(460),READY:e(16175),RESUME:e(42331),STEP:e(11966),SYSTEM_READY:e(32969),VISIBLE:e(94830)}},42857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Config:e(69547),CreateRenderer:e(86054),DebugHeader:e(96391),Events:e(8443),TimeStep:e(65898),VisibilityHandler:e(51085)}},99584:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(5290),p=e(27919),h=e(35154),a=function(l){var n=h(l,"data",[]),u=h(l,"canvas",null),f=h(l,"palette",r),o=h(l,"pixelWidth",1),c=h(l,"pixelHeight",o),d=h(l,"resizeCanvas",!0),v=h(l,"clearCanvas",!0),m=h(l,"preRender",null),S=h(l,"postRender",null),M=Math.floor(Math.abs(n[0].length*o)),w=Math.floor(Math.abs(n.length*c));u||(u=p.create2D(this,M,w),d=!1,v=!1),d&&(u.width=M,u.height=w);var C=u.getContext("2d",{willReadFrequently:!0});v&&C.clearRect(0,0,M,w),m&&m(u,C);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GenerateTexture:e(99584),Palettes:e(57763)}},5290:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ARNE16:e(5290),C64:e(23816),CGA:e(9866),JMP:e(77552),MSX:e(92259)}},46728:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36316),h=e(80021),a=e(26099),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,"CubicBezierCurve"),Array.isArray(u)&&(c=new a(u[6],u[7]),o=new a(u[4],u[5]),f=new a(u[2],u[3]),u=new a(u[0],u[1])),this.p0=u,this.p1=f,this.p2=o,this.p3=c},getStartPoint:function(n){return n===void 0&&(n=new a),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new a);var f=this.p0,o=this.p1,c=this.p2,d=this.p3;return u.set(p(n,f.x,o.x,c.x,d.x),p(n,f.y,o.y,c.y,d.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var o=1;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(19217),h=e(87841),a=e(26099),l=new r({initialize:function(u){this.type=u,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(n,u){return u===void 0&&(u=32),n.strokePoints(this.getPoints(u))},getBounds:function(n,u){n||(n=new h),u===void 0&&(u=16);var f=this.getLength();u>f&&(u=f/2);var o=Math.max(1,Math.round(f/u));return p(this.getSpacedPoints(o),n)},getDistancePoints:function(n){var u=this.getLength(),f=Math.max(1,u/n);return this.getSpacedPoints(f)},getEndPoint:function(n){return n===void 0&&(n=new a),this.getPointAt(1,n)},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){if(n===void 0&&(n=this.arcLengthDivisions),this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var u=[],f,o=this.getPoint(0,this._tmpVec2A),c=0;u.push(0);for(var d=1;d<=n;d++)f=this.getPoint(d/n,this._tmpVec2B),c+=f.distance(o),u.push(c),o.copy(f);return this.cacheArcLengths=u,u},getPointAt:function(n,u){var f=this.getUtoTmapping(n);return this.getPoint(f,u)},getPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var o=0;o<=n;o++)f.push(this.getPoint(o/n));return f},getRandomPoint:function(n){return n===void 0&&(n=new a),this.getPoint(Math.random(),n)},getSpacedPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var o=0;o<=n;o++){var c=this.getUtoTmapping(o/n,null,n);f.push(this.getPoint(c))}return f},getStartPoint:function(n){return n===void 0&&(n=new a),this.getPointAt(0,n)},getTangent:function(n,u){u===void 0&&(u=new a);var f=1e-4,o=n-f,c=n+f;return o<0&&(o=0),c>1&&(c=1),this.getPoint(o,this._tmpVec2A),this.getPoint(c,u),u.subtract(this._tmpVec2A).normalize()},getTangentAt:function(n,u){var f=this.getUtoTmapping(n);return this.getTangent(f,u)},getTFromDistance:function(n,u){return n<=0?0:this.getUtoTmapping(0,n,u)},getUtoTmapping:function(n,u,f){var o=this.getLengths(f),c=0,d=o.length,v;u?v=Math.min(u,o[d-1]):v=n*o[d-1];for(var m=0,S=d-1,M;m<=S;)if(c=Math.floor(m+(S-m)/2),M=o[c]-v,M<0)m=c+1;else if(M>0)S=c-1;else{S=c;break}if(c=S,o[c]===v)return c/(d-1);var w=o[c],C=o[c+1],A=C-w,P=(v-w)/A;return(c+P)/(d-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});s.exports=l},73825:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(39506),a=e(35154),l=e(43396),n=e(26099),u=new r({Extends:p,initialize:function(o,c,d,v,m,S,M,w){if(typeof o=="object"){var C=o;o=a(C,"x",0),c=a(C,"y",0),d=a(C,"xRadius",0),v=a(C,"yRadius",d),m=a(C,"startAngle",0),S=a(C,"endAngle",360),M=a(C,"clockwise",!1),w=a(C,"rotation",0)}else v===void 0&&(v=d),m===void 0&&(m=0),S===void 0&&(S=360),M===void 0&&(M=!1),w===void 0&&(w=0);p.call(this,"EllipseCurve"),this.p0=new n(o,c),this._xRadius=d,this._yRadius=v,this._startAngle=h(m),this._endAngle=h(S),this._clockwise=M,this._rotation=h(w)},getStartPoint:function(f){return f===void 0&&(f=new n),this.getPoint(0,f)},getResolution:function(f){return f*2},getPoint:function(f,o){o===void 0&&(o=new n);for(var c=Math.PI*2,d=this._endAngle-this._startAngle,v=Math.abs(d)c;)d-=c;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(19217),a=e(87841),l=e(26099),n=new r({Extends:p,initialize:function(f,o){p.call(this,"LineCurve"),Array.isArray(f)&&(o=new l(f[2],f[3]),f=new l(f[0],f[1])),this.p0=f,this.p1=o,this.arcLengthDivisions=1},getBounds:function(u){return u===void 0&&(u=new a),h([this.p0,this.p1],u)},getStartPoint:function(u){return u===void 0&&(u=new l),u.copy(this.p0)},getResolution:function(u){return u===void 0&&(u=1),u},getPoint:function(u,f){return f===void 0&&(f=new l),u===1?f.copy(this.p1):(f.copy(this.p1).subtract(this.p0).scale(u).add(this.p0),f)},getPointAt:function(u,f){return this.getPoint(u,f)},getTangent:function(u,f){return f===void 0&&(f=new l),f.copy(this.p1).subtract(this.p0).normalize(),f},getUtoTmapping:function(u,f,o){var c;if(f){var d=this.getLengths(o),v=d[d.length-1],m=Math.min(f,v);c=m/v}else c=u;return c},draw:function(u){return u.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),u},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});n.fromJSON=function(u){var f=u.points,o=new l(f[0],f[1]),c=new l(f[2],f[3]);return new n(o,c)},s.exports=n},14744:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(32112),a=e(26099),l=new r({Extends:p,initialize:function(u,f,o){p.call(this,"QuadraticBezierCurve"),Array.isArray(u)&&(o=new a(u[4],u[5]),f=new a(u[2],u[3]),u=new a(u[0],u[1])),this.p0=u,this.p1=f,this.p2=o},getStartPoint:function(n){return n===void 0&&(n=new a),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new a);var f=this.p0,o=this.p1,c=this.p2;return u.set(h(n,f.x,o.x,c.x),h(n,f.y,o.y,c.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var o=1;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87842),p=e(83419),h=e(80021),a=e(26099),l=new p({Extends:h,initialize:function(u){u===void 0&&(u=[]),h.call(this,"SplineCurve"),this.points=[],this.addPoints(u)},addPoints:function(n){for(var u=0;uf.length-2?f.length-1:c+1],M=f[c>f.length-3?f.length-1:c+2];return u.set(r(d,v.x,m.x,S.x,M.x),r(d,v.y,m.y,S.y,M.y))},toJSON:function(){for(var n=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Path:e(46669),MoveTo:e(68618),CubicBezier:e(46728),Curve:e(80021),Ellipse:e(73825),Line:e(33951),QuadraticBezier:e(14744),Spline:e(42534)}},68618:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l,n){this.active=!1,this.p0=new p(l,n)},getPoint:function(a,l){return l===void 0&&(l=new p),l.copy(this.p0)},getPointAt:function(a,l){return this.getPoint(a,l)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});s.exports=h},46669:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(46728),h=e(73825),a=e(39429),l=e(33951),n=e(68618),u=e(14744),f=e(87841),o=e(42534),c=e(26099),d=e(36383),v=new r({initialize:function(S,M){S===void 0&&(S=0),M===void 0&&(M=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new c,this._tmpVec2A=new c,this._tmpVec2B=new c,typeof S=="object"?this.fromJSON(S):this.startPoint.set(S,M)},add:function(m){return this.curves.push(m),this},circleTo:function(m,S,M){return S===void 0&&(S=!1),this.ellipseTo(m,m,0,360,S,M)},closePath:function(){var m=this.curves[0].getPoint(0),S=this.curves[this.curves.length-1].getPoint(1);return m.equals(S)||this.curves.push(new l(S,m)),this},cubicBezierTo:function(m,S,M,w,C,A){var P=this.getEndPoint(),b,O,I;return m instanceof c?(b=m,O=S,I=M):(b=new c(M,w),O=new c(C,A),I=new c(m,S)),this.add(new p(P,b,O,I))},quadraticBezierTo:function(m,S,M,w){var C=this.getEndPoint(),A,P;return m instanceof c?(A=m,P=S):(A=new c(M,w),P=new c(m,S)),this.add(new u(C,A,P))},draw:function(m,S){for(var M=0;M=S)return this.curves[w];w++}return null},getEndPoint:function(m){return m===void 0&&(m=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,m):m.copy(this.startPoint),m},getLength:function(){var m=this.getCurveLengths();return m[m.length-1]},getPoint:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),w=this.getCurveLengths(),C=0;C=M){var A=w[C]-M,P=this.curves[C],b=P.getLength(),O=b===0?0:1-A/b;return P.getPointAt(O,S)}C++}return null},getPoints:function(m,S){!m&&!S&&(m=this.defaultDivisions);for(var M=[],w,C=0;C1&&!M[M.length-1].equals(M[0])&&M.push(M[0]),M},getRandomPoint:function(m){return m===void 0&&(m=new c),this.getPoint(Math.random(),m)},getSpacedPoints:function(m){m===void 0&&(m=40);for(var S=[],M=0;M<=m;M++)S.push(this.getPoint(M/m));return this.autoClose&&S.push(S[0]),S},getStartPoint:function(m){return m===void 0&&(m=new c),m.copy(this.startPoint)},getTangent:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),w=this.getCurveLengths(),C=0;C=M){var A=w[C]-M,P=this.curves[C],b=P.getLength(),O=b===0?0:1-A/b;return P.getTangentAt(O,S)}C++}return null},lineTo:function(m,S){m instanceof c?this._tmpVec2B.copy(m):typeof m=="object"?this._tmpVec2B.setFromObject(m):this._tmpVec2B.set(m,S);var M=this.getEndPoint(this._tmpVec2A);return this.add(new l([M.x,M.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(m){return m.unshift(this.getEndPoint()),this.add(new o(m))},moveTo:function(m,S){return m instanceof c?this.add(new n(m.x,m.y)):this.add(new n(m,S))},toJSON:function(){for(var m=[],S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(24882),h=new r({initialize:function(l,n){this.parent=l,this.events=n,n||(this.events=l.events?l.events:l),this.list={},this.values={},this._frozen=!1,!l.hasOwnProperty("sys")&&this.events&&this.events.once(p.DESTROY,this.destroy,this)},get:function(a){var l=this.list;if(Array.isArray(a)){for(var n=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45893),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){p.call(this,u,u.sys.events),this.scene=u,this.systems=u.sys,u.sys.events.once(a.BOOT,this.boot,this),u.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){p.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});h.register("DataManagerPlugin",l,"data"),s.exports=l},10700:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="changedata"},93608:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="changedata-"},60883:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},69780:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedata"},22166:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="setdata"},24882:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CHANGE_DATA:e(10700),CHANGE_DATA_KEY:e(93608),DESTROY:e(60883),REMOVE_DATA:e(69780),SET_DATA:e(22166)}},44965:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DataManager:e(45893),DataManagerPlugin:e(63646),Events:e(24882)}},7098:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84148),p={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};function h(){if(typeof importScripts=="function")return p;p.audioData=!!window.Audio,p.webAudio=!!(window.AudioContext||window.webkitAudioContext);var a=document.createElement("audio"),l=!!a.canPlayType;try{if(l){var n=function(o,c){var d=a.canPlayType("audio/"+o).replace(/^no$/,"");return c?!!(d||a.canPlayType("audio/"+c).replace(/^no$/,"")):!!d};if(p.ogg=n('ogg; codecs="vorbis"'),p.opus=n('ogg; codecs="opus"',"opus"),p.mp3=n("mpeg"),p.wav=n("wav"),p.m4a=n("x-m4a"),p.aac=n("aac"),p.flac=n("flac","x-flac"),p.webm=n('webm; codecs="vorbis"'),a.canPlayType('audio/mp4; codecs="ec-3"')!==""){if(r.edge)p.dolby=!0;else if(r.safari&&r.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var u=parseInt(RegExp.$1,10),f=parseInt(RegExp.$2,10);(u===10&&f>=11||u>10)&&(p.dolby=!0)}}}}catch{}return p}s.exports=h()},84148:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p={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 h(){var a=navigator.userAgent;return/Edg\/\d+/.test(a)?(p.edge=!0,p.es2019=!0):/OPR/.test(a)?(p.opera=!0,p.es2019=!0):/Chrome\/(\d+)/.test(a)&&!r.windowsPhone?(p.chrome=!0,p.chromeVersion=parseInt(RegExp.$1,10),p.es2019=p.chromeVersion>69):/Firefox\D+(\d+)/.test(a)?(p.firefox=!0,p.firefoxVersion=parseInt(RegExp.$1,10),p.es2019=p.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(a)&&r.iOS?(p.mobileSafari=!0,p.es2019=!0):/MSIE (\d+\.\d+);/.test(a)?(p.ie=!0,p.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(a)&&!r.windowsPhone?(p.safari=!0,p.safariVersion=parseInt(RegExp.$1,10),p.es2019=p.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(a)&&(p.ie=!0,p.trident=!0,p.tridentVersion=parseInt(RegExp.$1,10),p.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(a)&&(p.silk=!0),p}s.exports=h()},89289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p={supportInverseAlpha:!1,supportNewBlendModes:!1};function h(){var n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",u="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",f=new Image;return f.onload=function(){var o=new Image;o.onload=function(){var c=r.create2D(o,6),d=c.getContext("2d",{willReadFrequently:!0});if(d.globalCompositeOperation="multiply",d.drawImage(f,0,0),d.drawImage(o,2,0),!d.getImageData(2,0,1,1))return!1;var v=d.getImageData(2,0,1,1).data;r.remove(o),p.supportNewBlendModes=v[0]===255&&v[1]===0&&v[2]===0},o.src=n+"/wCKxvRF"+u},f.src=n+"AP804Oa6"+u,!1}function a(){var n=r.create2D(this,2),u=n.getContext("2d",{willReadFrequently:!0});u.fillStyle="rgba(10, 20, 30, 0.5)",u.fillRect(0,0,1,1);var f=u.getImageData(0,0,1,1);if(f===null)return!1;u.putImageData(f,1,0);var o=u.getImageData(1,0,1,1),c=o.data[0]===f.data[0]&&o.data[1]===f.data[1]&&o.data[2]===f.data[2]&&o.data[3]===f.data[3];return r.remove(this),c}function l(){return typeof importScripts!="function"&&document!==void 0&&(p.supportNewBlendModes=h(),p.supportInverseAlpha=a()),p}s.exports=l()},89357:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p=e(84148),h=e(27919),a={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 l(){var u=new ArrayBuffer(4),f=new Uint8Array(u),o=new Uint32Array(u);return f[0]=161,f[1]=178,f[2]=195,f[3]=212,o[0]===3569595041?!0:o[0]===2712847316?!1:null}function n(){if(typeof importScripts=="function")return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch{a.localStorage=!1}a.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob,a.fileSystem=!!window.requestFileSystem;var u=!1,f=function(){if(window.WebGLRenderingContext)try{var o=h.createWebGL(this),c=o.getContext("webgl")||o.getContext("experimental-webgl"),d=h.create2D(this),v=d.getContext("2d",{willReadFrequently:!0}),m=v.createImageData(1,1);return u=m.data instanceof Uint8ClampedArray,h.remove(o),h.remove(d),!!c}catch{return!1}return!1};return a.webGL=f(),a.worker=!!window.Worker,a.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,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,p.firefox&&p.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(p.ie||p.firefox||p.chrome)&&(a.canvasBitBltShift=!0),(p.safari||p.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint32Array<"u"&&(a.littleEndian=l()),a.support32bit=typeof ArrayBuffer<"u"&&typeof Uint8ClampedArray<"u"&&typeof Int32Array<"u"&&a.littleEndian!==null&&u,a}s.exports=n()},91639:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={available:!1,cancel:"",keyboard:!1,request:""};function e(){if(typeof importScripts=="function")return y;var r,p="Fullscreen",h="FullScreen",a=["request"+p,"request"+h,"webkitRequest"+p,"webkitRequest"+h,"msRequest"+p,"msRequest"+h,"mozRequest"+h,"mozRequest"+p];for(r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84148),p={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};function h(){return typeof importScripts=="function"||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(p.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(p.mspointer=!0),navigator.getGamepads&&(p.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?p.wheelEvent="wheel":"onmousewheel"in window?p.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(p.wheelEvent="DOMMouseScroll")),p}s.exports=h()},25892:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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 e(){if(typeof importScripts=="function")return y;var r=navigator.userAgent;/Windows/.test(r)?y.windows=!0:/Mac OS/.test(r)&&!/like Mac OS/.test(r)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(y.iOS=!0,y.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),y.iOSVersion=parseInt(RegExp.$1,10)):y.macOS=!0:/Android/.test(r)?y.android=!0:/Linux/.test(r)?y.linux=!0:/iP[ao]d|iPhone/i.test(r)?(y.iOS=!0,navigator.appVersion.match(/OS (\d+)/),y.iOSVersion=parseInt(RegExp.$1,10),y.iPhone=r.toLowerCase().indexOf("iphone")!==-1,y.iPad=r.toLowerCase().indexOf("ipad")!==-1):/Kindle/.test(r)||/\bKF[A-Z][A-Z]+/.test(r)||/Silk.*Mobile Safari/.test(r)?y.kindle=!0:/CrOS/.test(r)&&(y.chromeOS=!0),(/Windows Phone/i.test(r)||/IEMobile/i.test(r))&&(y.android=!1,y.iOS=!1,y.macOS=!1,y.windows=!0,y.windowsPhone=!0);var p=/Silk/.test(r);return(y.windows||y.macOS||y.linux&&!p||y.chromeOS)&&(y.desktop=!0),(y.windowsPhone||/Windows NT/i.test(r)&&/Touch/i.test(r))&&(y.desktop=!1),navigator.standalone&&(y.webApp=!0),typeof importScripts!="function"&&(window.cordova!==void 0&&(y.cordova=!0),window.ejecta!==void 0&&(y.ejecta=!0)),typeof process<"u"&&process.versions&&process.versions.node&&(y.node=!0),y.node&&typeof process.versions=="object"&&(y.nodeWebkit=!!process.versions["node-webkit"],y.electron=!!process.versions.electron),/Crosswalk/.test(r)&&(y.crosswalk=!0),y.pixelRatio=window.devicePixelRatio||1,y}s.exports=e()},43267:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};function h(){if(typeof importScripts=="function")return p;var a=document.createElement("video"),l=!!a.canPlayType,n=/^no$/;try{l&&(a.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(p.ogg=!0),a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(p.h264=!0,p.mp4=!0),a.canPlayType("video/x-m4v").replace(n,"")&&(p.m4v=!0),a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(p.webm=!0),a.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(p.vp9=!0),a.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(p.hls=!0))}catch{}return a.parentNode&&a.parentNode.removeChild(a),p.getVideoURL=function(u){Array.isArray(u)||(u=[u]);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={os:e(25892),browser:e(84148),features:e(89357),input:e(31784),audio:e(7098),video:e(43267),fullscreen:e(91639),canvasFeatures:e(89289)}},89422:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new Float32Array(20),h=new r({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(a){return this._matrix.set(a),this._dirty=!0,this},reset:function(){var a=this._matrix;return a.fill(0),a[0]=1,a[6]=1,a[12]=1,a[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var a=this._data;return this._dirty&&(a.set(this._matrix),a[4]/=255,a[9]/=255,a[14]/=255,a[19]/=255,this._dirty=!1),a},brightness:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a;return this.multiply([n,0,0,0,0,0,n,0,0,0,0,0,n,0,0,0,0,0,1,0],l)},saturate:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a*2/3+1,u=(n-1)*-.5;return this.multiply([n,u,u,0,0,u,n,u,0,0,u,u,n,0,0,0,0,0,1,0],l)},desaturate:function(a){return a===void 0&&(a=!1),this.saturate(-1,a)},hue:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1),a=a/180*Math.PI;var n=Math.cos(a),u=Math.sin(a),f=.213,o=.715,c=.072;return this.multiply([f+n*(1-f)+u*-f,o+n*-o+u*-o,c+n*-c+u*(1-c),0,0,f+n*-f+u*.143,o+n*(1-o)+u*.14,c+n*-c+u*-.283,0,0,f+n*-f+u*-(1-f),o+n*-o+u*o,c+n*(1-c)+u*c,0,0,0,0,0,1,0],l)},grayscale:function(a,l){return a===void 0&&(a=1),l===void 0&&(l=!1),this.saturate(-a,l)},blackWhite:function(a){return a===void 0&&(a=!1),this.multiply(h.BLACK_WHITE,a)},contrast:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a+1,u=-.5*(n-1);return this.multiply([n,0,0,0,u,0,n,0,0,u,0,0,n,0,u,0,0,0,1,0],l)},negative:function(a){return a===void 0&&(a=!1),this.multiply(h.NEGATIVE,a)},desaturateLuminance:function(a){return a===void 0&&(a=!1),this.multiply(h.DESATURATE_LUMINANCE,a)},sepia:function(a){return a===void 0&&(a=!1),this.multiply(h.SEPIA,a)},night:function(a,l){return a===void 0&&(a=.1),l===void 0&&(l=!1),this.multiply([a*-2,-a,0,0,0,-a,0,a,0,0,0,a,a*2,0,0,0,0,0,1,0],l)},lsd:function(a){return a===void 0&&(a=!1),this.multiply(h.LSD,a)},brown:function(a){return a===void 0&&(a=!1),this.multiply(h.BROWN,a)},vintagePinhole:function(a){return a===void 0&&(a=!1),this.multiply(h.VINTAGE,a)},kodachrome:function(a){return a===void 0&&(a=!1),this.multiply(h.KODACHROME,a)},technicolor:function(a){return a===void 0&&(a=!1),this.multiply(h.TECHNICOLOR,a)},polaroid:function(a){return a===void 0&&(a=!1),this.multiply(h.POLAROID,a)},shiftToBGR:function(a){return a===void 0&&(a=!1),this.multiply(h.SHIFT_BGR,a)},multiply:function(a,l){l===void 0&&(l=!1),l||this.reset();var n=this._matrix,u=p;return u.set(n),n.set([u[0]*a[0]+u[1]*a[5]+u[2]*a[10]+u[3]*a[15],u[0]*a[1]+u[1]*a[6]+u[2]*a[11]+u[3]*a[16],u[0]*a[2]+u[1]*a[7]+u[2]*a[12]+u[3]*a[17],u[0]*a[3]+u[1]*a[8]+u[2]*a[13]+u[3]*a[18],u[0]*a[4]+u[1]*a[9]+u[2]*a[14]+u[3]*a[19]+u[4],u[5]*a[0]+u[6]*a[5]+u[7]*a[10]+u[8]*a[15],u[5]*a[1]+u[6]*a[6]+u[7]*a[11]+u[8]*a[16],u[5]*a[2]+u[6]*a[7]+u[7]*a[12]+u[8]*a[17],u[5]*a[3]+u[6]*a[8]+u[7]*a[13]+u[8]*a[18],u[5]*a[4]+u[6]*a[9]+u[7]*a[14]+u[8]*a[19]+u[9],u[10]*a[0]+u[11]*a[5]+u[12]*a[10]+u[13]*a[15],u[10]*a[1]+u[11]*a[6]+u[12]*a[11]+u[13]*a[16],u[10]*a[2]+u[11]*a[7]+u[12]*a[12]+u[13]*a[17],u[10]*a[3]+u[11]*a[8]+u[12]*a[13]+u[13]*a[18],u[10]*a[4]+u[11]*a[9]+u[12]*a[14]+u[13]*a[19]+u[14],u[15]*a[0]+u[16]*a[5]+u[17]*a[10]+u[18]*a[15],u[15]*a[1]+u[16]*a[6]+u[17]*a[11]+u[18]*a[16],u[15]*a[2]+u[16]*a[7]+u[17]*a[12]+u[18]*a[17],u[15]*a[3]+u[16]*a[8]+u[17]*a[13]+u[18]*a[18],u[15]*a[4]+u[16]*a[9]+u[17]*a[14]+u[18]*a[19]+u[19]]),this._dirty=!0,this}});h.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],h.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],h.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],h.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],h.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],h.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],h.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],h.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],h.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],h.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],h.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],s.exports=h},51767:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(29747),h=new r({initialize:function(l,n,u){this._rgb=[0,0,0],this.onChangeCallback=p,this.dirty=!1,this.set(l,n,u)},set:function(a,l,n){return a===void 0&&(a=0),l===void 0&&(l=0),n===void 0&&(n=0),this._rgb=[a,l,n],this.onChange(),this},equals:function(a,l,n){var u=this._rgb;return u[0]===a&&u[1]===l&&u[2]===n},onChange:function(){this.dirty=!0;var a=this._rgb;this.onChangeCallback.call(this,a[0],a[1],a[2])},r:{get:function(){return this._rgb[0]},set:function(a){this._rgb[0]=a,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(a){this._rgb[1]=a,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(a){this._rgb[2]=a,this.onChange()}},destroy:function(){this.onChangeCallback=null}});s.exports=h},60461:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},54312:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(35893),h=e(86327),a=e(88417),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},46768:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},35827:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},46871:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66786),p=e(35893),h=e(7702),a=function(l,n,u,f){return u===void 0&&(u=0),f===void 0&&(f=0),r(l,p(n)+u,h(n)+f),l};s.exports=a},5198:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(26541),h=e(20786),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},11879:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=[];p[r.BOTTOM_CENTER]=e(54312),p[r.BOTTOM_LEFT]=e(46768),p[r.BOTTOM_RIGHT]=e(35827),p[r.CENTER]=e(46871),p[r.LEFT_CENTER]=e(5198),p[r.RIGHT_CENTER]=e(80503),p[r.TOP_CENTER]=e(89698),p[r.TOP_LEFT]=e(922),p[r.TOP_RIGHT]=e(21373),p[r.LEFT_BOTTOM]=p[r.BOTTOM_LEFT],p[r.LEFT_TOP]=p[r.TOP_LEFT],p[r.RIGHT_BOTTOM]=p[r.BOTTOM_RIGHT],p[r.RIGHT_TOP]=p[r.TOP_RIGHT];var h=function(a,l,n,u,f){return p[n](a,l,u,f)};s.exports=h},80503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(54380),h=e(20786),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},89698:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35893),p=e(17717),h=e(88417),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)-f),a(n,p(u)-o),n};s.exports=l},21373:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},91660:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BottomCenter:e(54312),BottomLeft:e(46768),BottomRight:e(35827),Center:e(46871),LeftCenter:e(5198),QuickSet:e(11879),RightCenter:e(80503),TopCenter:e(89698),TopLeft:e(922),TopRight:e(21373)}},71926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=e(79291),h={In:e(91660),To:e(16694)};h=p(!1,h,r),s.exports=h},21578:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(35893),h=e(88417),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)+f),a(n,r(u)+o),n};s.exports=l},10210:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)-f),a(n,r(u)+o),n};s.exports=l},82341:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)+f),a(n,r(u)+o),n};s.exports=l},87958:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},40080:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(26541),h=e(20786),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},88466:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)-f),a(n,p(u)-o),n};s.exports=l},38829:(s,y,e)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=[];p[r.BOTTOM_CENTER]=e(21578),p[r.BOTTOM_LEFT]=e(10210),p[r.BOTTOM_RIGHT]=e(82341),p[r.LEFT_BOTTOM]=e(87958),p[r.LEFT_CENTER]=e(40080),p[r.LEFT_TOP]=e(88466),p[r.RIGHT_BOTTOM]=e(19211),p[r.RIGHT_CENTER]=e(34609),p[r.RIGHT_TOP]=e(48741),p[r.TOP_CENTER]=e(49440),p[r.TOP_LEFT]=e(81288),p[r.TOP_RIGHT]=e(61323);var h=function(a,l,n,u,f){return p[n](a,l,u,f)};s.exports=h},19211:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},34609:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(54380),h=e(20786),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},48741:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},49440:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35893),p=e(17717),h=e(86327),a=e(88417),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)+f),h(n,p(u)-o),n};s.exports=l},81288:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)-f),h(n,p(u)-o),n};s.exports=l},61323:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)+f),h(n,p(u)-o),n};s.exports=l},16694:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BottomCenter:e(21578),BottomLeft:e(10210),BottomRight:e(82341),LeftBottom:e(87958),LeftCenter:e(40080),LeftTop:e(88466),QuickSet:e(38829),RightBottom:e(19211),RightCenter:e(34609),RightTop:e(48741),TopCenter:e(49440),TopLeft:e(81288),TopRight:e(61323)}},66786:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(88417),p=e(20786),h=function(a,l,n){return r(a,l),p(a,n)};s.exports=h},62235:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y+e.height-e.height*e.originY};s.exports=y},72873:(s,y,e)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(54380),a=e(17717),l=e(87841),n=function(u,f){f===void 0&&(f=new l);var o=p(u),c=a(u);return f.x=o,f.y=c,f.width=h(u)-o,f.height=r(u)-c,f};s.exports=n},35893:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x-e.width*e.originX+e.width*.5};s.exports=y},7702:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y-e.height*e.originY+e.height*.5};s.exports=y},26541:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x-e.width*e.originX};s.exports=y},87431:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.width*e.originX};s.exports=y},46928:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.height*e.originY};s.exports=y},54380:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x+e.width-e.width*e.originX};s.exports=y},17717:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y-e.height*e.originY};s.exports=y},86327:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.y=r-e.height+e.height*e.originY,e};s.exports=y},88417:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.width*e.originX;return e.x=r+p-e.width*.5,e};s.exports=y},20786:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.height*e.originY;return e.y=r+p-e.height*.5,e};s.exports=y},385:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x=r+e.width*e.originX,e};s.exports=y},40136:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x=r-e.width+e.width*e.originX,e};s.exports=y},66737:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.y=r+e.height*e.originY,e};s.exports=y},58724:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CenterOn:e(66786),GetBottom:e(62235),GetBounds:e(72873),GetCenterX:e(35893),GetCenterY:e(7702),GetLeft:e(26541),GetOffsetX:e(87431),GetOffsetY:e(46928),GetRight:e(54380),GetTop:e(17717),SetBottom:e(86327),SetCenterX:e(88417),SetCenterY:e(20786),SetLeft:e(385),SetRight:e(40136),SetTop:e(66737)}},20623:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setCrisp:function(e){var r=["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"];return r.forEach(function(p){e.style["image-rendering"]=p}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(e){return e.style["image-rendering"]="auto",e.style.msInterpolationMode="bicubic",e}};s.exports=y},27919:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8054),p=e(68703),h=[],a=!1,l=function(){var n=function(M,w,C,A,P){w===void 0&&(w=1),C===void 0&&(C=1),A===void 0&&(A=r.CANVAS),P===void 0&&(P=!1);var b,O=o(A);return O===null?(O={parent:M,canvas:document.createElement("canvas"),type:A},A===r.CANVAS&&h.push(O),b=O.canvas):(O.parent=M,b=O.canvas),P&&(O.parent=b),b.width=w,b.height=C,a&&A===r.CANVAS&&p.disable(b.getContext("2d",{willReadFrequently:!1})),b},u=function(M,w,C){return n(M,w,C,r.CANVAS)},f=function(M,w,C){return n(M,w,C,r.WEBGL)},o=function(M){if(M===void 0&&(M=r.CANVAS),M===r.WEBGL)return null;for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y="",e=function(){var r=function(l){for(var n=["i","webkitI","msI","mozI","oI"],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r="none"),e.style.msTouchAction=r,e.style["ms-touch-action"]=r,e.style["touch-action"]=r,e};s.exports=y},91610:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r="none");var p=["-webkit-","-khtml-","-moz-","-ms-",""];return p.forEach(function(h){e.style[h+"user-select"]=r}),e.style["-webkit-touch-callout"]=r,e.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",e};s.exports=y},26253:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CanvasInterpolation:e(20623),CanvasPool:e(27919),Smoothing:e(68703),TouchAction:e(65208),UserSelect:e(91610)}},40987:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37589),h=e(1e3),a=e(7537),l=e(87837),n=new r({initialize:function(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=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(f,o,c,d)},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(u,f,o,c,d){return c===void 0&&(c=255),d===void 0&&(d=!0),this._locked=!0,this.red=u,this.green=f,this.blue=o,this.alpha=c,this._locked=!1,this.update(d)},setGLTo:function(u,f,o,c){return c===void 0&&(c=1),this._locked=!0,this.redGL=u,this.greenGL=f,this.blueGL=o,this.alphaGL=c,this._locked=!1,this.update(!0)},setFromRGB:function(u){return this._locked=!0,this.red=u.r,this.green=u.g,this.blue=u.b,u.hasOwnProperty("a")&&(this.alpha=u.a),this._locked=!1,this.update(!0)},setFromHSV:function(u,f,o){return a(u,f,o,this)},update:function(u){if(u===void 0&&(u=!1),this._locked)return this;var f=this.r,o=this.g,c=this.b,d=this.a;return this._color=p(f,o,c),this._color32=h(f,o,c,d),this._rgba="rgba("+f+","+o+","+c+","+d/255+")",u&&l(f,o,c,this),this},updateHSV:function(){var u=this.r,f=this.g,o=this.b;return l(u,f,o,this),this},clone:function(){return new n(this.r,this.g,this.b,this.a)},gray:function(u){return this.setTo(u,u,u)},random:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var o=Math.floor(u+Math.random()*(f-u)),c=Math.floor(u+Math.random()*(f-u)),d=Math.floor(u+Math.random()*(f-u));return this.setTo(o,c,d)},randomGray:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var o=Math.floor(u+Math.random()*(f-u));return this.setTo(o,o,o)},saturate:function(u){return this.s+=u/100,this},desaturate:function(u){return this.s-=u/100,this},lighten:function(u){return this.v+=u/100,this},darken:function(u){return this.v-=u/100,this},brighten:function(u){var f=this.r,o=this.g,c=this.b;return f=Math.max(0,Math.min(255,f-Math.round(255*-(u/100)))),o=Math.max(0,Math.min(255,o-Math.round(255*-(u/100)))),c=Math.max(0,Math.min(255,c-Math.round(255*-(u/100)))),this.setTo(f,o,c)},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(u){this.gl[0]=Math.min(Math.abs(u),1),this.r=Math.floor(this.gl[0]*255),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(u){this.gl[1]=Math.min(Math.abs(u),1),this.g=Math.floor(this.gl[1]*255),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(u){this.gl[2]=Math.min(Math.abs(u),1),this.b=Math.floor(this.gl[2]*255),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(u){this.gl[3]=Math.min(Math.abs(u),1),this.a=Math.floor(this.gl[3]*255),this.update()}},red:{get:function(){return this.r},set:function(u){u=Math.floor(Math.abs(u)),this.r=Math.min(u,255),this.gl[0]=u/255,this.update(!0)}},green:{get:function(){return this.g},set:function(u){u=Math.floor(Math.abs(u)),this.g=Math.min(u,255),this.gl[1]=u/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(u){u=Math.floor(Math.abs(u)),this.b=Math.min(u,255),this.gl[2]=u/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(u){u=Math.floor(Math.abs(u)),this.a=Math.min(u,255),this.gl[3]=u/255,this.update()}},h:{get:function(){return this._h},set:function(u){this._h=u,a(u,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(u){this._s=u,a(this._h,u,this._v,this)}},v:{get:function(){return this._v},set:function(u){this._v=u,a(this._h,this._s,u,this)}}});s.exports=n},92728:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589),p=function(h){h===void 0&&(h=1024);var a=[],l=255,n,u=255,f=0,o=0;for(n=0;n<=l;n++)a.push({r:u,g:n,b:o,color:r(u,n,o)});for(f=255,n=l;n>=0;n--)a.push({r:n,g:f,b:o,color:r(n,f,o)});for(u=0,n=0;n<=l;n++,f--)a.push({r:u,g:f,b:n,color:r(u,f,n)});for(f=0,o=255,n=0;n<=l;n++,o--,u++)a.push({r:u,g:f,b:o,color:r(u,f,o)});if(h===1024)return a;var c=[],d=0,v=1024/h;for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={r:e>>16&255,g:e>>8&255,b:e&255,a:255};return e>16777215&&(r.a=e>>>24),r};s.exports=y},62957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.toString(16);return r.length===1?"0"+r:r};s.exports=y},37589:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e<<16|r<<8|p};s.exports=y},1e3:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return h<<24|e<<16|r<<8|p};s.exports=y},62183:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=e(89528),h=function(a,l,n){var u=n,f=n,o=n;if(l!==0){var c=n<.5?n*(1+l):n+l-n*l,d=2*n-c;u=p(d,c,a+1/3),f=p(d,c,a),o=p(d,c,a-1/3)}var v=new r;return v.setGLTo(u,f,o,1)};s.exports=h},27939:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7537),p=function(h,a){h===void 0&&(h=1),a===void 0&&(a=1);for(var l=[],n=0;n<=359;n++)l.push(r(n/359,h,a));return l};s.exports=p},7537:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589);function p(a,l,n,u){var f=(a+l*6)%6,o=Math.min(f,4-f,1);return Math.round(255*(u-u*n*Math.max(0,o)))}var h=function(a,l,n,u){l===void 0&&(l=1),n===void 0&&(n=1);var f=p(5,a,l,n),o=p(3,a,l,n),c=p(1,a,l,n);return u?u.setTo?u.setTo(f,o,c,u.alpha,!0):(u.r=f,u.g=o,u.b=c,u.color=r(f,o,c),u):{r:f,g:o,b:c,color:r(f,o,c)}};s.exports=h},70238:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){var a=new r;h=h.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(o,c,d,v){return c+c+d+d+v+v});var l=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);if(l){var n=parseInt(l[1],16),u=parseInt(l[2],16),f=parseInt(l[3],16);a.setTo(n,u,f)}return a};s.exports=p},89528:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?e+(r-e)*6*p:p<.5?r:p<.6666666666666666?e+(r-e)*(.6666666666666666-p)*6:e};s.exports=y},30100:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=e(90664),h=function(a){var l=p(a);return new r(l.r,l.g,l.b,l.a)};s.exports=h},90664:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>16777215?{a:e>>>24,r:e>>16&255,g:e>>8&255,b:e&255}:{a:255,r:e>>16&255,g:e>>8&255,b:e&255}};s.exports=y},13699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28915),p=function(l,n,u,f,o,c,d,v){d===void 0&&(d=100),v===void 0&&(v=0);var m=v/d;return{r:r(l,f,m),g:r(n,o,m),b:r(u,c,m)}},h=function(l,n,u,f){return u===void 0&&(u=100),f===void 0&&(f=0),p(l.r,l.g,l.b,n.r,n.g,n.b,u,f)},a=function(l,n,u,f,o,c){return o===void 0&&(o=100),c===void 0&&(c=0),p(l.r,l.g,l.b,n,u,f,o,c)};s.exports={RGBWithRGB:p,ColorWithRGB:a,ColorWithColor:h}},68957:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){return new r(h.r,h.g,h.b,h.a)};s.exports=p},87388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){var a=new r,l=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(h.toLowerCase());if(l){var n=parseInt(l[1],10),u=parseInt(l[2],10),f=parseInt(l[3],10),o=l[4]!==void 0?parseFloat(l[4]):1;a.setTo(n,u,f,o*255)}return a};s.exports=p},87837:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){h===void 0&&(h={h:0,s:0,v:0}),e/=255,r/=255,p/=255;var a=Math.min(e,r,p),l=Math.max(e,r,p),n=l-a,u=0,f=l===0?0:n/l,o=l;return l!==a&&(l===e?u=(r-p)/n+(r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62957),p=function(h,a,l,n,u){return n===void 0&&(n=255),u===void 0&&(u="#"),u==="#"?"#"+((1<<24)+(h<<16)+(a<<8)+l).toString(16).slice(1,7):"0x"+r(n)+r(h)+r(a)+r(l)};s.exports=p},85386:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(40987),h=function(a,l){return a===void 0&&(a=0),l===void 0&&(l=255),new p(r(a,l),r(a,l),r(a,l))};s.exports=h},80333:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70238),p=e(30100),h=e(68957),a=e(87388),l=function(n){var u=typeof n;switch(u){case"string":return n.substr(0,3).toLowerCase()==="rgb"?a(n):r(n);case"number":return p(n);case"object":return h(n)}};s.exports=l},3956:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987);r.ColorSpectrum=e(92728),r.ColorToRGBA=e(91588),r.ComponentToHex=e(62957),r.GetColor=e(37589),r.GetColor32=e(1e3),r.HexStringToColor=e(70238),r.HSLToColor=e(62183),r.HSVColorWheel=e(27939),r.HSVToRGB=e(7537),r.HueToComponent=e(89528),r.IntegerToColor=e(30100),r.IntegerToRGB=e(90664),r.Interpolate=e(13699),r.ObjectToColor=e(68957),r.RandomRGB=e(85386),r.RGBStringToColor=e(87388),r.RGBToHSV=e(87837),r.RGBToString=e(75723),r.ValueToColor=e(80333),s.exports=r},27460:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Align:e(71926),BaseShader:e(73894),Bounds:e(58724),Canvas:e(26253),Color:e(3956),ColorMatrix:e(89422),Masks:e(69781),RGB:e(51767)}},6858:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39429),h=new r({initialize:function(l,n,u,f,o,c){n||(n=l.sys.make.image({x:u,y:f,key:o,frame:c,add:!1})),this.bitmapMask=n,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(a){this.bitmapMask=a},preRenderWebGL:function(a,l,n){a.pipelines.BITMAPMASK_PIPELINE.beginMask(this,l,n)},postRenderWebGL:function(a,l,n){a.pipelines.BITMAPMASK_PIPELINE.endMask(this,l,n)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});p.register("bitmapMask",function(a,l,n,u,f){return new h(this.scene,a,l,n,u,f)}),s.exports=h},80661:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.geometryMask=l,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(h){return this.geometryMask=h,this},setInvertAlpha:function(h){return h===void 0&&(h=!0),this.invertAlpha=h,this},preRenderWebGL:function(h,a,l){var n=h.gl;h.flush(),h.maskStack.length===0&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),h.maskCount=0),h.currentCameraMask.mask!==this&&(h.currentMask.mask=this),h.maskStack.push({mask:this,camera:l}),this.applyStencil(h,l,!0),h.maskCount++},applyStencil:function(h,a,l){var n=h.gl,u=this.geometryMask,f=h.maskCount,o=255;n.colorMask(!1,!1,!1,!1),l?(n.stencilFunc(n.EQUAL,f,o),n.stencilOp(n.KEEP,n.KEEP,n.INCR),f++):(n.stencilFunc(n.EQUAL,f+1,o),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=f,u.renderWebGL(h,u,a),h.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,f,o):n.stencilFunc(n.EQUAL,f,o)},postRenderWebGL:function(h){var a=h.gl;h.maskStack.pop(),h.maskCount--,h.flush();var l=h.currentMask;if(h.maskStack.length===0)l.mask=null,a.disable(a.STENCIL_TEST);else{var n=h.maskStack[h.maskStack.length-1];n.mask.applyStencil(h,n.camera,!1),h.currentCameraMask.mask!==n.mask?(l.mask=n.mask,l.camera=n.camera):l.mask=null}},preRenderCanvas:function(h,a,l){var n=this.geometryMask;h.currentContext.save(),n.renderCanvas(h,n,l,null,null,!0),h.currentContext.clip()},postRenderCanvas:function(h){h.currentContext.restore()},destroy:function(){this.geometryMask=null}});s.exports=p},69781:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BitmapMask:e(6858),GeometryMask:e(80661)}},73894:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){(!l||l==="")&&(l=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join(` +`)),(!n||n==="")&&(n=["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(` +`)),u===void 0&&(u=null),this.key=a,this.fragmentSrc=l,this.vertexSrc=n,this.uniforms=u}});s.exports=p},40366:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p;if(r)typeof r=="string"?p=document.getElementById(r):typeof r=="object"&&r.nodeType===1&&(p=r);else if(e.parentElement||r===null)return e;return p||(p=document.body),p.appendChild(e),e};s.exports=y},83719:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=function(h){var a=h.config;if(!(!a.parent||!a.domCreateContainer)){var l=document.createElement("div");l.style.cssText=["display: block;","width: "+h.scale.width+"px;","height: "+h.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+a.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),h.domContainer=l,r(l,a.parent)}};s.exports=p},57264:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p=function(h){if(document.readyState==="complete"||document.readyState==="interactive"){h();return}var a=function(){document.removeEventListener("deviceready",a,!0),document.removeEventListener("DOMContentLoaded",a,!0),window.removeEventListener("load",a,!0),h()};document.body?r.cordova?document.addEventListener("deviceready",a,!1):(document.addEventListener("DOMContentLoaded",a,!0),window.addEventListener("load",a,!0)):window.setTimeout(a,20)};s.exports=p},57811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!e)return window.innerHeight;var r=Math.abs(window.orientation),p={w:0,h:0},h=document.createElement("div");return h.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(h),p.w=r===90?h.offsetHeight:window.innerWidth,p.h=r===90?window.innerWidth:h.offsetHeight,document.documentElement.removeChild(h),h=null,Math.abs(window.orientation)!==90?p.h:p.w};s.exports=y},45818:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13560),p=function(h,a){var l=window.screen,n=l?l.orientation||l.mozOrientation||l.msOrientation:!1;if(n&&typeof n.type=="string")return n.type;if(typeof n=="string")return n;if(typeof window.orientation=="number")return window.orientation===0||window.orientation===180?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return r.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return r.ORIENTATION.LANDSCAPE}else return a>h?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE};s.exports=p},74403:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r;return e!==""&&(typeof e=="string"?r=document.getElementById(e):e&&e.nodeType===1&&(r=e)),r||(r=document.body),r};s.exports=y},56836:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r="";try{if(window.DOMParser){var p=new DOMParser;r=p.parseFromString(e,"text/xml")}else r=new ActiveXObject("Microsoft.XMLDOM"),r.loadXML(e)}catch{r=null}return!r||!r.documentElement||r.getElementsByTagName("parsererror").length?null:r};s.exports=y},35846:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){e.parentNode&&e.parentNode.removeChild(e)};s.exports=y},43092:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(29747),h=new r({initialize:function(){this.isRunning=!1,this.callback=p,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var l=this;this.step=function n(u){l.callback(u),l.isRunning&&(l.timeOutID=window.requestAnimationFrame(n))},this.stepTimeout=function n(){l.isRunning&&(l.timeOutID=window.setTimeout(n,l.delay)),l.callback(window.performance.now())}},start:function(a,l,n){this.isRunning||(this.callback=a,this.isSetTimeOut=l,this.delay=n,this.isRunning=!0,this.timeOutID=l?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=p}});s.exports=h},84902:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={AddToDOM:e(40366),DOMContentLoaded:e(57264),GetInnerHeight:e(57811),GetScreenOrientation:e(45818),GetTarget:e(74403),ParseXML:e(56836),RemoveFromDOM:e(35846),RequestAnimationFrame:e(43092)};s.exports=r},47565:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(37277),a=new r({Extends:p,initialize:function(){p.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});h.register("EventEmitter",a,"events"),s.exports=a},93055:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={EventEmitter:e(47565)}},20122:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.BARREL,n),this.amount=u}});s.exports=a},32251:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v){f===void 0&&(f=1),o===void 0&&(o=1),c===void 0&&(c=1),d===void 0&&(d=1),v===void 0&&(v=4),p.call(this,h.BLOOM,n),this.steps=v,this.offsetX=f,this.offsetY=o,this.blurStrength=c,this.strength=d,this.glcolor=[1,1,1],u!=null&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},9047:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v){u===void 0&&(u=0),f===void 0&&(f=2),o===void 0&&(o=2),c===void 0&&(c=1),v===void 0&&(v=4),p.call(this,h.BLUR,n),this.quality=u,this.x=f,this.y=o,this.steps=v,this.strength=c,this.glcolor=[1,1,1],d!=null&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},27885:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=.5),f===void 0&&(f=1),o===void 0&&(o=.2),c===void 0&&(c=!1),d===void 0&&(d=1),v===void 0&&(v=1),m===void 0&&(m=1),p.call(this,h.BOKEH,n),this.radius=u,this.amount=f,this.contrast=o,this.isTiltShift=c,this.strength=m,this.blurX=d,this.blurY=v}});s.exports=a},12578:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d){u===void 0&&(u=8),c===void 0&&(c=1),d===void 0&&(d=.005),p.call(this,h.CIRCLE,n),this.scale=c,this.feather=d,this.thickness=u,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],f!=null&&(this.color=f),o!=null&&(this.backgroundColor=o)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundColor:{get:function(){var l=this.glcolor2;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor2;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(l){this.glcolor2[3]=l}}});s.exports=a},15802:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89422),h=e(14811),a=new r({Extends:p,initialize:function(n){p.call(this),this.type=h.COLOR_MATRIX,this.gameObject=n,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});s.exports=a},72898:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.type=a,this.gameObject=l,this.active=!0},setActive:function(h){return this.active=h,this},destroy:function(){this.gameObject=null,this.active=!1}});s.exports=p},44553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o){u===void 0&&(u="__WHITE"),f===void 0&&(f=.005),o===void 0&&(o=.005),p.call(this,h.DISPLACEMENT,n),this.x=f,this.y=o,this.glTexture,this.setTexture(u)},setTexture:function(l){var n=this.gameObject.scene.sys.textures.getFrame(l);return n&&(this.glTexture=n.glTexture),this}});s.exports=a},68531:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){f===void 0&&(f=4),o===void 0&&(o=0),c===void 0&&(c=!1),p.call(this,h.GLOW,n),this.outerStrength=f,this.innerStrength=o,this.knockout=c,this.glcolor=[1,1,1,1],u!==void 0&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},37102:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m,S){o===void 0&&(o=.2),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=1),S===void 0&&(S=0),p.call(this,h.GRADIENT,n),this.alpha=o,this.size=S,this.fromX=c,this.fromY=d,this.toX=v,this.toY=m,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],u!=null&&(this.color1=u),f!=null&&(this.color2=f)},color1:{get:function(){var l=this.glcolor1;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor1;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}},color2:{get:function(){var l=this.glcolor2;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor2;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}}});s.exports=a},86886:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.PIXELATE,n),this.amount=u}});s.exports=a},92322:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=.1),c===void 0&&(c=1),v===void 0&&(v=6),m===void 0&&(m=1),p.call(this,h.SHADOW,n),this.x=u,this.y=f,this.decay=o,this.power=c,this.glcolor=[0,0,0,1],this.samples=v,this.intensity=m,d!==void 0&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},39563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.5),f===void 0&&(f=.5),o===void 0&&(o=3),c===void 0&&(c=!1),p.call(this,h.SHINE,n),this.speed=u,this.lineWidth=f,this.gradient=o,this.reveal=c}});s.exports=a},56448:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.5),f===void 0&&(f=.5),o===void 0&&(o=.5),c===void 0&&(c=.5),p.call(this,h.VIGNETTE,n),this.x=u,this.y=f,this.radius=o,this.strength=c}});s.exports=a},38433:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.1),f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=!1),p.call(this,h.WIPE,n),this.progress=0,this.wipeWidth=u,this.direction=f,this.axis=o,this.reveal=c}});s.exports=a},14811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},66064:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(14811),h={Barrel:e(20122),Controller:e(72898),Bloom:e(32251),Blur:e(9047),Bokeh:e(27885),Circle:e(12578),ColorMatrix:e(15802),Displacement:e(44553),Glow:e(68531),Gradient:e(37102),Pixelate:e(86886),Shadow:e(92322),Shine:e(39563),Vignette:e(56448),Wipe:e(38433)};h=r(!1,h,p),s.exports=h},25305:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(23568),h=function(a,l,n){l.x=p(n,"x",0),l.y=p(n,"y",0),l.depth=p(n,"depth",0),l.flipX=p(n,"flipX",!1),l.flipY=p(n,"flipY",!1);var u=p(n,"scale",null);typeof u=="number"?l.setScale(u):u!==null&&(l.scaleX=p(u,"x",1),l.scaleY=p(u,"y",1));var f=p(n,"scrollFactor",null);typeof f=="number"?l.setScrollFactor(f):f!==null&&(l.scrollFactorX=p(f,"x",1),l.scrollFactorY=p(f,"y",1)),l.rotation=p(n,"rotation",0);var o=p(n,"angle",null);o!==null&&(l.angle=o),l.alpha=p(n,"alpha",1);var c=p(n,"origin",null);if(typeof c=="number")l.setOrigin(c);else if(c!==null){var d=p(c,"x",.5),v=p(c,"y",.5);l.setOrigin(d,v)}l.blendMode=p(n,"blendMode",r.NORMAL),l.visible=p(n,"visible",!0);var m=p(n,"add",!0);return m&&a.sys.displayList.add(l),l.preUpdate&&a.sys.updateList.add(l),l};s.exports=h},13059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23568),p=function(h,a){var l=r(a,"anims",null);if(l===null)return h;if(typeof l=="string")h.anims.play(l);else if(typeof l=="object"){var n=h.anims,u=r(l,"key",void 0);if(u){var f=r(l,"startFrame",void 0),o=r(l,"delay",0),c=r(l,"repeat",0),d=r(l,"repeatDelay",0),v=r(l,"yoyo",!1),m=r(l,"play",!1),S=r(l,"delayedPlay",0),M={key:u,delay:o,repeat:c,repeatDelay:d,yoyo:v,startFrame:f};m?n.play(M):S>0?n.playAfterDelay(M,S):n.load(M)}}return h};s.exports=p},8050:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(73162),h=e(37277),a=e(51708),l=e(44594),n=e(19186),u=new r({Extends:p,initialize:function(o){p.call(this,o),this.sortChildrenFlag=!1,this.scene=o,this.systems=o.sys,this.events=o.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(l.BOOT,this.boot,this),this.events.on(l.START,this.start,this)},boot:function(){this.events.once(l.DESTROY,this.destroy,this)},addChildCallback:function(f){f.displayList&&f.displayList!==this&&f.removeFromDisplayList(),f.parentContainer&&f.parentContainer.remove(f),f.displayList||(this.queueDepthSort(),f.displayList=this,f.emit(a.ADDED_TO_SCENE,f,this.scene),this.events.emit(l.ADDED_TO_SCENE,f,this.scene))},removeChildCallback:function(f){this.queueDepthSort(),f.displayList=null,f.emit(a.REMOVED_FROM_SCENE,f,this.scene),this.events.emit(l.REMOVED_FROM_SCENE,f,this.scene)},start:function(){this.events.once(l.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(n(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(f,o){return f._depth-o._depth},getChildren:function(){return this.list},shutdown:function(){for(var f=this.list;f.length;)f[0].destroy(!0);this.events.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(l.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});h.register("DisplayList",u,"displayList"),s.exports=u},95643:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(53774),h=e(45893),a=e(50792),l=e(51708),n=e(44594),u=new r({Extends:a,initialize:function(o,c){a.call(this),this.scene=o,this.displayList=null,this.type=c,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(l.ADDED_TO_SCENE,this.addedToScene,this),this.on(l.REMOVED_FROM_SCENE,this.removedFromScene,this),o.sys.queueDepthSort()},setActive:function(f){return this.active=f,this},setName:function(f){return this.name=f,this},setState:function(f){return this.state=f,this},setDataEnabled:function(){return this.data||(this.data=new h(this)),this},setData:function(f,o){return this.data||(this.data=new h(this)),this.data.set(f,o),this},incData:function(f,o){return this.data||(this.data=new h(this)),this.data.inc(f,o),this},toggleData:function(f){return this.data||(this.data=new h(this)),this.data.toggle(f),this},getData:function(f){return this.data||(this.data=new h(this)),this.data.get(f)},setInteractive:function(f,o,c){return this.scene.sys.input.enable(this,f,o,c),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 p(this)},willRender:function(f){var o=this.displayList&&this.displayList.active?this.displayList.willRender(f):!0;return!(!o||u.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&f.id)},getIndexList:function(){for(var f=this,o=this.parentContainer,c=[];o&&(c.unshift(o.getIndex(f)),f=o,o.parentContainer);)o=o.parentContainer;return this.displayList?c.unshift(this.displayList.getIndex(f)):c.unshift(this.scene.sys.displayList.getIndex(f)),c},addToDisplayList:function(f){return f===void 0&&(f=this.scene.sys.displayList),this.displayList&&this.displayList!==f&&this.removeFromDisplayList(),f.exists(this)||(this.displayList=f,f.add(this,!0),f.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),f.events.emit(n.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var f=this.displayList||this.scene.sys.displayList;return f&&f.exists(this)&&(f.remove(this,!0),f.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),f.events.emit(n.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(f){!this.scene||this.ignoreDestroy||(f===void 0&&(f=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(l.DESTROY,this,f),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)}});u.RENDER_MASK=15,s.exports=u},44603:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(l,n){a.prototype.hasOwnProperty(l)||(a.prototype[l]=n)},a.remove=function(l){a.prototype.hasOwnProperty(l)&&delete a.prototype[l]},p.register("GameObjectCreator",a,"make"),s.exports=a},39429:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},existing:function(l){return(l.renderCanvas||l.renderWebGL)&&this.displayList.add(l),l.preUpdate&&this.updateList.add(l),l},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(l,n){a.prototype.hasOwnProperty(l)||(a.prototype[l]=n)},a.remove=function(l){a.prototype.hasOwnProperty(l)&&delete a.prototype[l]},p.register("GameObjectFactory",a,"add"),s.exports=a},91296:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=new r,h=new r,a=new r,l={camera:p,sprite:h,calc:a},n=function(u,f,o){var c=p,d=h,v=a;return d.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),c.copyFrom(f.matrix),o?(c.multiplyWithOffset(o,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),d.e=u.x,d.f=u.y):(d.e-=f.scrollX*u.scrollFactorX,d.f-=f.scrollY*u.scrollFactorY),c.multiply(d,v),l};s.exports=n},45027:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(25774),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){p.call(this),this.checkQueue=!0,this.scene=u,this.systems=u.sys,u.sys.events.once(a.BOOT,this.boot,this),u.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var n=this.systems.events;n.on(a.PRE_UPDATE,this.update,this),n.on(a.UPDATE,this.sceneUpdate,this),n.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(n,u){for(var f=this._active,o=f.length,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l,n,u,f,o,c,d,v,m,S){var M=p.x-r.displayOriginX+a,w=p.y-r.displayOriginY+l,C=M+p.w,A=w+p.h,P=n.getXRound(M,w,u),b=n.getYRound(M,w,u),O=n.getXRound(M,A,u),I=n.getYRound(M,A,u),D=n.getXRound(C,A,u),B=n.getYRound(C,A,u),G=n.getXRound(C,w,u),z=n.getYRound(C,w,u);e.batchQuad(r,P,b,O,I,D,B,G,z,h.u0,h.v0,h.u1,h.v1,f,o,c,d,v,m,S)};s.exports=y},53048:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(p===void 0&&(p=!1),h===void 0)return h={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},h;var a=e.text,l=a.length,n=e.maxWidth,u=e.wordWrapCharCode,f=Number.MAX_VALUE,o=Number.MAX_VALUE,c=0,d=0,v=e.fontData.chars,m=e.fontData.lineHeight,S=e.letterSpacing,M=e.lineSpacing,w=0,C=0,A=0,P=null,b=e._align,O=0,I=0,D=e.fontSize/e.fontData.size,B=D*e.scaleX,G=D*e.scaleY,z=null,X=0,j=[],Q=Number.MAX_VALUE,tt=0,Y=0,Z=0,U,H=[],J=[],_=null;if(n>0){for(U=0;Un||Vt>n?(rt.push(gt.i-1),gt.cr?(rt.push(gt.i+gt.word.length),ot=0,at=null):at=gt):gt.cr&&(rt.push(gt.i+gt.word.length),ot=0,at=null)}var dt=function(Oe,Be,Le){return Oe.substr(0,Be)+Le+Oe.substr(Be+1)};for(U=rt.length-1;U>=0;U--)a=dt(a,rt[U],` +`);h.wrappedText=a,l=a.length,H=[],_=null}var ut=0;for(U=0;Utt&&(tt=Z),ZO&&(f=O),o>I&&(o=I);var Dt=O+P.xAdvance,Ht=I+m;ctt&&(tt=Z),Z0)for(var re=0;re{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21859),p=function(h,a,l,n,u,f,o){var c=h.sys.textures.get(l),d=c.get(n),v=h.sys.cache.xml.get(u);if(d&&v){var m=r(v,d,f,o,c);return h.sys.cache.bitmapFont.add(a,{data:m,texture:l,frame:n,fromAtlas:!0}),!0}else return!1};s.exports=p},6925:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=function(h,a){var l=a.width,n=a.height,u=Math.floor(l/2),f=Math.floor(n/2),o=r(a,"chars","");if(o!==""){var c=r(a,"image",""),d=h.sys.textures.getFrame(c),v=d.cutX,m=d.cutY,S=d.source.width,M=d.source.height,w=r(a,"offset.x",0),C=r(a,"offset.y",0),A=r(a,"spacing.x",0),P=r(a,"spacing.y",0),b=r(a,"lineSpacing",0),O=r(a,"charsPerRow",null);O===null&&(O=S/l,O>o.length&&(O=o.length));for(var I=w,D=C,B={retroFont:!0,font:c,size:l,lineHeight:n+b,chars:{}},G=0,z=0;z{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(r,p){return parseInt(r.getAttribute(p),10)}var e=function(r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0);var n=p.cutX,u=p.cutY,f=p.source.width,o=p.source.height,c=p.sourceIndex,d={},v=r.getElementsByTagName("info")[0],m=r.getElementsByTagName("common")[0];d.font=v.getAttribute("face"),d.size=y(v,"size"),d.lineHeight=y(m,"lineHeight")+a,d.chars={};var S=r.getElementsByTagName("char"),M=p!==void 0&&p.trimmed;if(M)var w=p.height,C=p.width;for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87662),p=e(79291),h={Parse:e(6925)};h=p(!1,h,r),s.exports=h},87662:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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`};s.exports=y},2638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(83419),h=e(12310),a=new p({Extends:r,Mixins:[h],initialize:function(n,u,f,o,c,d,v){r.call(this,n,u,f,o,c,d,v),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(l,n){return this.cropWidth=l,this.cropHeight=n,this},setDisplayCallback:function(l){return this.displayCallback=l,this},setScrollX:function(l){return this.scrollX=l,this},setScrollY:function(l){return this.scrollY=l,this}});s.exports=a},86741:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20926),p=function(h,a,l,n){var u=a._text,f=u.length,o=h.currentContext;if(!(f===0||!r(h,o,a,l,n))){l.addToRenderList(a);var c=a.fromAtlas?a.frame:a.texture.frames.__BASE,d=a.displayCallback,v=a.callbackData,m=a.fontData.chars,S=a.fontData.lineHeight,M=a._letterSpacing,w=0,C=0,A=0,P=null,b=0,O=0,I=0,D=0,B=0,G=0,z=null,X=0,j=a.frame.source.image,Q=c.cutX,tt=c.cutY,Y=0,Z=0,U=a._fontSize/a.fontData.size,H=a._align,J=0,_=0;a.getTextBounds(!1);var q=a._bounds.lines;H===1?_=(q.longest-q.lengths[0])/2:H===2&&(_=q.longest-q.lengths[0]),o.translate(-a.displayOriginX,-a.displayOriginY);var at=l.roundPixels;a.cropWidth>0&&a.cropHeight>0&&(o.beginPath(),o.rect(0,0,a.cropWidth,a.cropHeight),o.clip());for(var ot=0;ot{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2638),p=e(25305),h=e(44603),a=e(23568);h.register("dynamicBitmapText",function(l,n){l===void 0&&(l={});var u=a(l,"font",""),f=a(l,"text",""),o=a(l,"size",!1),c=new r(this.scene,0,0,u,f,o);return n!==void 0&&(l.add=n),p(this.scene,c,l),c})},72566:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2638),p=e(39429);p.register("dynamicBitmapText",function(h,a,l,n,u){return this.displayList.add(new r(this.scene,h,a,l,n,u))})},12310:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(73482),h=e(86741),s.exports={renderWebGL:p,renderCanvas:h}},73482:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(61340),h=e(70554),a=new p,l=function(n,u,f,o){var c=u.text,d=c.length;if(d!==0){f.addToRenderList(u);var v=n.pipelines.set(u.pipeline,u),m=r(u,f,o);n.pipelines.preBatch(u);var S=m.sprite,M=m.calc,w=a,C=u.cropWidth>0||u.cropHeight>0;C&&(v.flush(),n.pushScissor(M.tx,M.ty,u.cropWidth*M.scaleX,u.cropHeight*M.scaleY));var A=u.frame,P=A.glTexture,b=u.tintFill,O=h.getTintAppendFloatAlpha(u.tintTopLeft,f.alpha*u._alphaTL),I=h.getTintAppendFloatAlpha(u.tintTopRight,f.alpha*u._alphaTR),D=h.getTintAppendFloatAlpha(u.tintBottomLeft,f.alpha*u._alphaBL),B=h.getTintAppendFloatAlpha(u.tintBottomRight,f.alpha*u._alphaBR),G=v.setGameObject(u),z=0,X=0,j=0,Q=0,tt=u.letterSpacing,Y,Z=0,U=0,H,J=u.scrollX,_=u.scrollY,q=u.fontData,at=q.chars,ot=q.lineHeight,rt=u.fontSize/q.size,gt=0,yt=u._align,Et=0,At=0,Pt=u.getTextBounds(!1);u.maxWidth>0&&(c=Pt.wrappedText,d=c.length);var Vt=u._bounds.lines;yt===1?At=(Vt.longest-Vt.lengths[0])/2:yt===2&&(At=Vt.longest-Vt.lengths[0]);for(var dt=f.roundPixels,ut=u.displayCallback,Rt=u.callbackData,Dt=0;Dt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(31401),a=e(95643),l=e(53048),n=e(61327),u=e(21859),f=e(87841),o=e(18658),c=new r({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Texture,h.Tint,h.Transform,h.Visible,o],initialize:function(v,m,S,M,w,C,A){w===void 0&&(w=""),A===void 0&&(A=0),a.call(this,v,"BitmapText"),this.font=M;var P=this.scene.sys.cache.bitmapFont.get(M);P||console.warn("Invalid BitmapText key: "+M),this.fontData=P.data,this._text="",this._fontSize=C||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=A,this._bounds=l(),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=P.fromAtlas,this.setTexture(P.texture,P.frame),this.setPosition(m,S),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(w)},setLeftAlign:function(){return this._align=c.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=c.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=c.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(d){return this._fontSize=d,this._dirty=!0,this},setLetterSpacing:function(d){return d===void 0&&(d=0),this._letterSpacing=d,this._dirty=!0,this},setLineSpacing:function(d){return d===void 0&&(d=0),this.lineSpacing=d,this},setText:function(d){return!d&&d!==0&&(d=""),Array.isArray(d)&&(d=d.join(` +`)),d!==this.text&&(this._text=d.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=.5),this.dropShadowX=d,this.dropShadowY=v,this.dropShadowColor=m,this.dropShadowAlpha=S,this},setCharacterTint:function(d,v,m,S,M,w,C){d===void 0&&(d=0),v===void 0&&(v=1),m===void 0&&(m=!1),S===void 0&&(S=-1),M===void 0&&(M=S,w=S,C=S);var A=this.text.length;v===-1&&(v=A),d<0&&(d=A+d),d=p(d,0,A-1);for(var P=p(d+v,d,A),b=this.charColors,O=d;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20926),p=function(h,a,l,n){var u=a._text,f=u.length,o=h.currentContext;if(!(f===0||!r(h,o,a,l,n))){l.addToRenderList(a);var c=a.fromAtlas?a.frame:a.texture.frames.__BASE,d=a.fontData.chars,v=a.fontData.lineHeight,m=a._letterSpacing,S=a._lineSpacing,M=0,w=0,C=0,A=null,P=0,b=0,O=0,I=0,D=0,B=0,G=null,z=0,X=c.source.image,j=c.cutX,Q=c.cutY,tt=a._fontSize/a.fontData.size,Y=a._align,Z=0,U=0,H=a.getTextBounds(!1);a.maxWidth>0&&(u=H.wrappedText,f=u.length);var J=a._bounds.lines;Y===1?U=(J.longest-J.lengths[0])/2:Y===2&&(U=J.longest-J.lengths[0]),o.translate(-a.displayOriginX,-a.displayOriginY);for(var _=l.roundPixels,q=0;q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(25305),h=e(44603),a=e(23568),l=e(35154);h.register("bitmapText",function(n,u){n===void 0&&(n={});var f=l(n,"font",""),o=a(n,"text",""),c=a(n,"size",!1),d=l(n,"align",0),v=new r(this.scene,0,0,f,o,c,d);return u!==void 0&&(n.add=u),p(this.scene,v,n),v})},34914:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(39429);p.register("bitmapText",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},18658:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(33590),h=e(37289),s.exports={renderWebGL:p,renderCanvas:h}},33590:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3217),p=e(91296),h=e(70554),a=function(l,n,u,f){var o=n._text,c=o.length;if(c!==0){u.addToRenderList(n);var d=l.pipelines.set(n.pipeline,n),v=p(n,u,f).calc;l.pipelines.preBatch(n);var m=u.roundPixels,S=u.alpha,M=n.charColors,w=n.tintFill,C=h.getTintAppendFloatAlpha,A=C(n.tintTopLeft,S*n._alphaTL),P=C(n.tintTopRight,S*n._alphaTR),b=C(n.tintBottomLeft,S*n._alphaBL),O=C(n.tintBottomRight,S*n._alphaBR),I=n.frame.glTexture,D=d.setGameObject(n),B=n.getTextBounds(!1),G,z,X,j=B.characters,Q=n.dropShadowX,tt=n.dropShadowY,Y=Q!==0||tt!==0;if(Y){var Z=n.dropShadowColor,U=n.dropShadowAlpha,H=C(Z,S*U*n._alphaTL),J=C(Z,S*U*n._alphaTR),_=C(Z,S*U*n._alphaBL),q=C(Z,S*U*n._alphaBR);for(G=0;G{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(48011),p=e(46590),h=e(83419),a=e(31401),l=e(4327),n=e(95643),u=e(73162),f=new h({Extends:n,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Size,a.Texture,a.Transform,a.Visible,r],initialize:function(c,d,v,m,S){n.call(this,c,"Blitter"),this.setTexture(m,S),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(),this.children=new u,this.renderList=[],this.dirty=!1},create:function(o,c,d,v,m){v===void 0&&(v=!0),m===void 0&&(m=this.children.length),d===void 0?d=this.frame:d instanceof l||(d=this.texture.get(d));var S=new p(this,o,c,d,v);return this.children.addAt(S,m,!1),this.dirty=!0,S},createFromCallback:function(o,c,d,v){for(var m=this.createMultiple(c,d,v),S=0;S0},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=[]}});s.exports=f},72396:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=r.getRenderList();if(a.length!==0){var l=e.currentContext,n=p.alpha*r.alpha;if(n!==0){p.addToRenderList(r),l.globalCompositeOperation=e.blendModes[r.blendMode],l.imageSmoothingEnabled=!r.frame.source.scaleMode;var u=r.x-p.scrollX*r.scrollFactorX,f=r.y-p.scrollY*r.scrollFactorY;l.save(),h&&h.copyToContext(l);for(var o=p.roundPixels,c=0;c0&&S.height>0&&(l.save(),l.translate(d.x+u,d.y+f),l.scale(C,A),l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M,w,S.width,S.height),l.restore())):(o&&(M=Math.round(M),w=Math.round(w)),S.width>0&&S.height>0&&l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M+d.x+u,w+d.y+f,S.width,S.height)))}l.restore()}}};s.exports=y},9403:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6107),p=e(25305),h=e(44603),a=e(23568);h.register("blitter",function(l,n){l===void 0&&(l={});var u=a(l,"key",null),f=a(l,"frame",null),o=new r(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),p(this.scene,o,l),o})},12709:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6107),p=e(39429);p.register("blitter",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},48011:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99485),h=e(72396),s.exports={renderWebGL:p,renderCanvas:h}},99485:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=e(70554),h=new r,a=function(l,n,u,f){var o=n.getRenderList(),c=u.alpha*n.alpha;if(!(o.length===0||c===0)){u.addToRenderList(n);var d=l.pipelines.set(this.pipeline,n),v=u.scrollX*n.scrollFactorX,m=u.scrollY*n.scrollFactorY,S=h.copyFrom(u.matrix);f&&(S.multiplyWithOffset(f,-v,-m),v=0,m=0);var M=n.x-v,w=n.y-m,C=-1,A=!1;l.pipelines.preBatch(n);for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(4327),h=new r({initialize:function(l,n,u,f,o){this.parent=l,this.x=n,this.y=u,this.frame=f,this.data={},this.tint=16777215,this._visible=o,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(a){return a===void 0?this.frame=this.parent.frame:a instanceof p&&a.texture===this.parent.texture?this.frame=a:this.frame=this.parent.texture.get(a),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(a,l,n){return this.x=a,this.y=l,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,n&&this.setFrame(n),this},setPosition:function(a,l){return this.x=a,this.y=l,this},setFlipX:function(a){return this.flipX=a,this},setFlipY:function(a){return this.flipY=a,this},setFlip:function(a,l){return this.flipX=a,this.flipY=l,this},setVisible:function(a){return this.visible=a,this},setAlpha:function(a){return this.alpha=a,this},setTint:function(a){return this.tint=a,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(a){this.parent.dirty|=this._visible!==a,this._visible=a}},alpha:{get:function(){return this._alpha},set:function(a){this.parent.dirty|=this._alpha>0!=a>0,this._alpha=a}}});s.exports=h},16005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=2,h={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(a,l,n,u){return a===void 0&&(a=1),l===void 0?this.alpha=a:(this._alphaTL=r(a,0,1),this._alphaTR=r(l,0,1),this._alphaBL=r(n,0,1),this._alphaBR=r(u,0,1)),this},alpha:{get:function(){return this._alpha},set:function(a){var l=r(a,0,1);this._alpha=l,this._alphaTL=l,this._alphaTR=l,this._alphaBL=l,this._alphaBR=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(a){var l=r(a,0,1);this._alphaTL=l,l!==0&&(this.renderFlags|=p)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(a){var l=r(a,0,1);this._alphaTR=l,l!==0&&(this.renderFlags|=p)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(a){var l=r(a,0,1);this._alphaBL=l,l!==0&&(this.renderFlags|=p)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(a){var l=r(a,0,1);this._alphaBR=l,l!==0&&(this.renderFlags|=p)}}};s.exports=h},88509:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=2,h={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(a){return a===void 0&&(a=1),this.alpha=a,this},alpha:{get:function(){return this._alpha},set:function(a){var l=r(a,0,1);this._alpha=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}}};s.exports=h},90065:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(h){typeof h=="string"&&(h=r[h]),h|=0,h>=-1&&(this._blendMode=h)}},setBlendMode:function(h){return this.blendMode=h,this}};s.exports=p},94215:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={width:0,height:0,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}},setSize:function(e,r){return this.width=e,this.height=r,this},setDisplaySize:function(e,r){return this.displayWidth=e,this.displayHeight=r,this}};s.exports=y},61683:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={texture:null,frame:null,isCropped:!1,setCrop:function(e,r,p,h){if(e===void 0)this.isCropped=!1;else if(this.frame){if(typeof e=="number")this.frame.setCropUVs(this._crop,e,r,p,h,this.flipX,this.flipY);else{var a=e;this.frame.setCropUVs(this._crop,a.x,a.y,a.width,a.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}}};s.exports=y},89272:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_depth:0,depth:{get:function(){return this._depth},set:function(e){this.displayList&&this.displayList.queueDepthSort(),this._depth=e}},setDepth:function(e){return e===void 0&&(e=0),this.depth=e,this}};s.exports=y},47059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(66064),h=e(19133),a=new r({initialize:function(n,u){this.gameObject=n,this.isPost=u,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(l){return l===void 0&&(l=0),this.padding=l,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(l){if(!this.isPost){var n=this.gameObject.scene.sys.renderer;n&&n.pipelines?(this.gameObject.pipeline=n.pipelines.FX_PIPELINE,l!==void 0&&(this.padding=l),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var l=this.list,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(e){return this.flipX=e,this},setFlipY:function(e){return this.flipY=e,this},setFlip:function(e,r){return this.flipX=e,this.flipY=r,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}};s.exports=y},8004:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(11520),h=e(26099),a={prepareBoundsOutput:function(l,n){if(n===void 0&&(n=!1),this.rotation!==0&&p(l,this.x,this.y,this.rotation),n&&this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();u.transformPoint(l.x,l.y,l)}return l},getCenter:function(l,n){return l===void 0&&(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getTopLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getLeftCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getRightCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getBottomLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBounds:function(l){l===void 0&&(l=new r);var n,u,f,o,c,d,v,m;if(this.parentContainer){var S=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(l),S.transformPoint(l.x,l.y,l),n=l.x,u=l.y,this.getTopRight(l),S.transformPoint(l.x,l.y,l),f=l.x,o=l.y,this.getBottomLeft(l),S.transformPoint(l.x,l.y,l),c=l.x,d=l.y,this.getBottomRight(l),S.transformPoint(l.x,l.y,l),v=l.x,m=l.y}else this.getTopLeft(l),n=l.x,u=l.y,this.getTopRight(l),f=l.x,o=l.y,this.getBottomLeft(l),c=l.x,d=l.y,this.getBottomRight(l),v=l.x,m=l.y;return l.x=Math.min(n,f,c,v),l.y=Math.min(u,o,d,m),l.width=Math.max(n,f,c,v)-l.x,l.height=Math.max(u,o,d,m)-l.y,l}};s.exports=a},8573:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6858),p=e(80661),h={mask:null,setMask:function(a){return this.mask=a,this},clearMask:function(a){return a===void 0&&(a=!1),a&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(a,l,n,u,f){return a===void 0&&(this.texture||this.shader||this.geom)&&(a=this),new r(this.scene,a,l,n,u,f)},createGeometryMask:function(a){return a===void 0&&(this.type==="Graphics"||this.geom)&&(a=this),new p(this.scene,a)}};s.exports=h},27387:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(e){this._displayOriginX=e,this.originX=e/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(e){this._displayOriginY=e,this.originY=e/this.height}},setOrigin:function(e,r){return e===void 0&&(e=.5),r===void 0&&(r=e),this.originX=e,this.originY=r,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(e,r){return e===void 0&&(e=0),r===void 0&&(r=e),this.displayOriginX=e,this.displayOriginY=r,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};s.exports=y},37640:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39506),p=e(57355),h=e(35154),a=e(86353),l=e(26099),n={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(u,f){f===void 0&&(f=this.pathConfig);var o=this.pathTween;return o&&o.isPlaying()&&o.stop(),this.path=u,f&&this.startFollow(f),this},setRotateToPath:function(u,f){return f===void 0&&(f=0),this.rotateToPath=u,this.pathRotationOffset=f,this},isFollowing:function(){var u=this.pathTween;return u&&u.isPlaying()},startFollow:function(u,f){u===void 0&&(u={}),f===void 0&&(f=0);var o=this.pathTween;o&&o.isPlaying()&&o.stop(),typeof u=="number"&&(u={duration:u}),u.from=h(u,"from",0),u.to=h(u,"to",1);var c=p(u,"positionOnPath",!1);this.rotateToPath=p(u,"rotateToPath",!1),this.pathRotationOffset=h(u,"rotationOffset",0);var d=h(u,"startAt",f);if(d&&(u.onStart=function(m){var S=m.data[0];S.progress=d,S.elapsed=S.duration*d;var M=S.ease(S.progress);S.current=S.start+(S.end-S.start)*M,S.setTargetValue()}),this.pathOffset||(this.pathOffset=new l(this.x,this.y)),this.pathVector||(this.pathVector=new l),this.pathDelta||(this.pathDelta=new l),this.pathDelta.reset(),u.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(u),this.path.getStartPoint(this.pathOffset),c&&(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=a.PLAYING_FORWARD,this.rotateToPath){var v=this.path.getPoint(.1);this.rotation=Math.atan2(v.y-this.y,v.x-this.x)+r(this.pathRotationOffset)}return this.pathConfig=u,this},pauseFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.pause(),this},resumeFollow:function(){var u=this.pathTween;return u&&u.isPaused()&&u.resume(),this},stopFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.stop(),this},pathUpdate:function(){var u=this.pathTween;if(u&&u.data){var f=u.data[0],o=this.pathDelta,c=this.pathVector;if(o.copy(c).negate(),f.state===a.COMPLETE){this.path.getPoint(f.end,c),o.add(c),c.add(this.pathOffset),this.setPosition(c.x,c.y);return}else if(f.state!==a.PLAYING_FORWARD&&f.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(u.getValue(),c),o.add(c),c.add(this.pathOffset);var d=this.x,v=this.y;this.setPosition(c.x,c.y);var m=this.x-d,S=this.y-v;if(m===0&&S===0)return;if(f.state!==this._prevDirection){this._prevDirection=f.state;return}this.rotateToPath&&(this.rotation=Math.atan2(S,m)+r(this.pathRotationOffset))}}};s.exports=n},72699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(h){this.pipelineData={};var a=this.scene.sys.renderer;if(!a)return!1;var l=a.pipelines;if(l){h===void 0&&(h=l.default);var n=l.get(h);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(h,a,l){var n=this.scene.sys.renderer;if(!n)return this;var u=n.pipelines;if(u){var f=u.get(h);f&&(this.pipeline=f),a&&(this.pipelineData=l?r(a):a)}return this},setPipelineData:function(h,a){var l=this.pipelineData;return a===void 0?delete l[h]:l[h]=a,this},resetPipeline:function(h){return h===void 0&&(h=!1),this.pipeline=this.defaultPipeline,h&&(this.pipelineData={}),this.pipeline!==null},getPipelineName:function(){return this.pipeline.name}};s.exports=p},17581:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p=e(47059),h=e(19133),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(l){this.postPipelines=[],this.postPipelineData={},this.postFX=new p(this,!0),l&&(this.preFX=new p(this,!1))},setPostPipeline:function(l,n,u){var f=this.scene.sys.renderer;if(!f)return this;var o=f.pipelines;if(o){Array.isArray(l)||(l=[l]);for(var c=0;c0,this},setPostPipelineData:function(l,n){var u=this.postPipelineData;return n===void 0?delete u[l]:u[l]=n,this},getPostPipeline:function(l){for(var n=typeof l=="string",u=this.postPipelines,f=[],o=0;o=0;f--){var o=u[f];(n&&o.name===l||!n&&o===l)&&(o.destroy(),h(u,f))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};s.exports=a},80227:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(e,r){return r===void 0&&(r=e),this.scrollFactorX=e,this.scrollFactorY=r,this}};s.exports=y},16736:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(e){this.scaleX=e/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(e){this.scaleY=e/this.frame.realHeight}},setSizeToFrame:function(e){e||(e=this.frame),this.width=e.realWidth,this.height=e.realHeight;var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=this.width,r.hitArea.height=this.height),this},setSize:function(e,r){return this.width=e,this.height=r,this},setDisplaySize:function(e,r){return this.displayWidth=e,this.displayHeight=r,this}};s.exports=y},37726:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4327),p=8,h={texture:null,frame:null,isCropped:!1,setTexture:function(a,l,n,u){return this.texture=this.scene.sys.textures.get(a),this.setFrame(l,n,u)},setFrame:function(a,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),a instanceof r?(this.texture=this.scene.sys.textures.get(a.texture.key),this.frame=a):this.frame=this.texture.get(a),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};s.exports=h},79812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4327),p=8,h={texture:null,frame:null,isCropped:!1,setCrop:function(a,l,n,u){if(a===void 0)this.isCropped=!1;else if(this.frame){if(typeof a=="number")this.frame.setCropUVs(this._crop,a,l,n,u,this.flipX,this.flipY);else{var f=a;this.frame.setCropUVs(this._crop,f.x,f.y,f.width,f.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(a,l){return this.texture=this.scene.sys.textures.get(a),this.setFrame(l)},setFrame:function(a,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),a instanceof r?(this.texture=this.scene.sys.textures.get(a.texture.key),this.frame=a):this.frame=this.texture.get(a),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(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}}};s.exports=h},27472:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(e,r,p,h){return e===void 0&&(e=16777215),r===void 0&&(r=e,p=e,h=e),this.tintTopLeft=e,this.tintTopRight=r,this.tintBottomLeft=p,this.tintBottomRight=h,this.tintFill=!1,this},setTintFill:function(e,r,p,h){return this.setTint(e,r,p,h),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(e){this.setTint(e,e,e,e)}},isTinted:{get:function(){var e=16777215;return this.tintFill||this.tintTopLeft!==e||this.tintTopRight!==e||this.tintBottomLeft!==e||this.tintBottomRight!==e}}};s.exports=y},53774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={name:e.name,type:e.type,x:e.x,y:e.y,depth:e.depth,scale:{x:e.scaleX,y:e.scaleY},origin:{x:e.originX,y:e.originY},flipX:e.flipX,flipY:e.flipY,rotation:e.rotation,alpha:e.alpha,visible:e.visible,blendMode:e.blendMode,textureKey:"",frameKey:"",data:{}};return e.texture&&(r.textureKey=e.texture.key,r.frameKey=e.frame.name),r};s.exports=y},16901:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(61340),h=e(85955),a=e(86554),l=e(30954),n=e(26099),u=4,f={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(o){this._scaleX=o,this._scaleY=o,o===0?this.renderFlags&=~u:this.renderFlags|=u}},scaleX:{get:function(){return this._scaleX},set:function(o){this._scaleX=o,o===0?this.renderFlags&=~u:this._scaleY!==0&&(this.renderFlags|=u)}},scaleY:{get:function(){return this._scaleY},set:function(o){this._scaleY=o,o===0?this.renderFlags&=~u:this._scaleX!==0&&(this.renderFlags|=u)}},angle:{get:function(){return l(this._rotation*r.RAD_TO_DEG)},set:function(o){this.rotation=l(o)*r.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(o){this._rotation=a(o)}},setPosition:function(o,c,d,v){return o===void 0&&(o=0),c===void 0&&(c=o),d===void 0&&(d=0),v===void 0&&(v=0),this.x=o,this.y=c,this.z=d,this.w=v,this},copyPosition:function(o){return o.x!==void 0&&(this.x=o.x),o.y!==void 0&&(this.y=o.y),o.z!==void 0&&(this.z=o.z),o.w!==void 0&&(this.w=o.w),this},setRandomPosition:function(o,c,d,v){return o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),this.x=o+Math.random()*d,this.y=c+Math.random()*v,this},setRotation:function(o){return o===void 0&&(o=0),this.rotation=o,this},setAngle:function(o){return o===void 0&&(o=0),this.angle=o,this},setScale:function(o,c){return o===void 0&&(o=1),c===void 0&&(c=o),this.scaleX=o,this.scaleY=c,this},setX:function(o){return o===void 0&&(o=0),this.x=o,this},setY:function(o){return o===void 0&&(o=0),this.y=o,this},setZ:function(o){return o===void 0&&(o=0),this.z=o,this},setW:function(o){return o===void 0&&(o=0),this.w=o,this},getLocalTransformMatrix:function(o){return o===void 0&&(o=new p),o.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(o,c){o===void 0&&(o=new p);var d=this.parentContainer;if(!d)return this.getLocalTransformMatrix(o);for(c||(c=new p),o.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);d;)c.applyITRS(d.x,d.y,d._rotation,d._scaleX,d._scaleY),c.multiply(o,o),d=d.parentContainer;return o},getLocalPoint:function(o,c,d,v){d||(d=new n),v||(v=this.scene.sys.cameras.main);var m=v.scrollX,S=v.scrollY,M=o+m*this.scrollFactorX-m,w=c+S*this.scrollFactorY-S;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(M,w,d):h(M,w,this.x,this.y,this.rotation,this.scaleX,this.scaleY,d),this._originComponent&&(d.x+=this._displayOriginX,d.y+=this._displayOriginY),d},getParentRotation:function(){for(var o=0,c=this.parentContainer;c;)o+=c.rotation,c=c.parentContainer;return o}};s.exports=f},61340:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36383),h=e(26099),a=new r({initialize:function(n,u,f,o,c,d){n===void 0&&(n=1),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=1),c===void 0&&(c=0),d===void 0&&(d=0),this.matrix=new Float32Array([n,u,f,o,c,d,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(l){this.matrix[0]=l}},b:{get:function(){return this.matrix[1]},set:function(l){this.matrix[1]=l}},c:{get:function(){return this.matrix[2]},set:function(l){this.matrix[2]=l}},d:{get:function(){return this.matrix[3]},set:function(l){this.matrix[3]=l}},e:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},f:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},tx:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},ty:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],o=l[3];return n||u?u>0?Math.acos(n/this.scaleX):-Math.acos(n/this.scaleX):f||o?p.TAU-(o>0?Math.acos(-f/this.scaleY):-Math.acos(f/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 l=this.matrix;return l[0]=1,l[1]=0,l[2]=0,l[3]=1,l[4]=0,l[5]=0,this},translate:function(l,n){var u=this.matrix;return u[4]=u[0]*l+u[2]*n+u[4],u[5]=u[1]*l+u[3]*n+u[5],this},scale:function(l,n){var u=this.matrix;return u[0]*=l,u[1]*=l,u[2]*=n,u[3]*=n,this},rotate:function(l){var n=Math.sin(l),u=Math.cos(l),f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3];return f[0]=o*u+d*n,f[1]=c*u+v*n,f[2]=o*-n+d*u,f[3]=c*-n+v*u,this},multiply:function(l,n){var u=this.matrix,f=l.matrix,o=u[0],c=u[1],d=u[2],v=u[3],m=u[4],S=u[5],M=f[0],w=f[1],C=f[2],A=f[3],P=f[4],b=f[5],O=n===void 0?u:n.matrix;return O[0]=M*o+w*d,O[1]=M*c+w*v,O[2]=C*o+A*d,O[3]=C*c+A*v,O[4]=P*o+b*d+m,O[5]=P*c+b*v+S,O},multiplyWithOffset:function(l,n,u){var f=this.matrix,o=l.matrix,c=f[0],d=f[1],v=f[2],m=f[3],S=f[4],M=f[5],w=n*c+u*v+S,C=n*d+u*m+M,A=o[0],P=o[1],b=o[2],O=o[3],I=o[4],D=o[5];return f[0]=A*c+P*v,f[1]=A*d+P*m,f[2]=b*c+O*v,f[3]=b*d+O*m,f[4]=I*c+D*v+w,f[5]=I*d+D*m+C,this},transform:function(l,n,u,f,o,c){var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5];return d[0]=l*v+n*S,d[1]=l*m+n*M,d[2]=u*v+f*S,d[3]=u*m+f*M,d[4]=o*v+c*S+w,d[5]=o*m+c*M+C,this},transformPoint:function(l,n,u){u===void 0&&(u={x:0,y:0});var f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5];return u.x=l*o+n*d+m,u.y=l*c+n*v+S,u},invert:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],o=l[3],c=l[4],d=l[5],v=n*o-u*f;return l[0]=o/v,l[1]=-u/v,l[2]=-f/v,l[3]=n/v,l[4]=(f*d-o*c)/v,l[5]=-(n*d-u*c)/v,this},copyFrom:function(l){var n=this.matrix;return n[0]=l.a,n[1]=l.b,n[2]=l.c,n[3]=l.d,n[4]=l.e,n[5]=l.f,this},copyFromArray:function(l){var n=this.matrix;return n[0]=l[0],n[1]=l[1],n[2]=l[2],n[3]=l[3],n[4]=l[4],n[5]=l[5],this},copyToContext:function(l){var n=this.matrix;return l.transform(n[0],n[1],n[2],n[3],n[4],n[5]),l},setToContext:function(l){return l.setTransform(this),l},copyToArray:function(l){var n=this.matrix;return l===void 0?l=[n[0],n[1],n[2],n[3],n[4],n[5]]:(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3],l[4]=n[4],l[5]=n[5]),l},setTransform:function(l,n,u,f,o,c){var d=this.matrix;return d[0]=l,d[1]=n,d[2]=u,d[3]=f,d[4]=o,d[5]=c,this},decomposeMatrix:function(){var l=this.decomposedMatrix,n=this.matrix,u=n[0],f=n[1],o=n[2],c=n[3],d=u*c-f*o;if(l.translateX=n[4],l.translateY=n[5],u||f){var v=Math.sqrt(u*u+f*f);l.rotation=f>0?Math.acos(u/v):-Math.acos(u/v),l.scaleX=v,l.scaleY=d/v}else if(o||c){var m=Math.sqrt(o*o+c*c);l.rotation=Math.PI*.5-(c>0?Math.acos(-o/m):-Math.acos(o/m)),l.scaleX=d/m,l.scaleY=m}else l.rotation=0,l.scaleX=0,l.scaleY=0;return l},applyITRS:function(l,n,u,f,o){var c=this.matrix,d=Math.sin(u),v=Math.cos(u);return c[4]=l,c[5]=n,c[0]=v*f,c[1]=d*f,c[2]=-d*o,c[3]=v*o,this},applyInverse:function(l,n,u){u===void 0&&(u=new h);var f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5],M=1/(o*v+d*-c);return u.x=v*M*l+-d*M*n+(S*d-m*v)*M,u.y=o*M*n+-c*M*l+(-S*o+m*c)*M,u},setQuad:function(l,n,u,f,o,c){o===void 0&&(o=!1),c===void 0&&(c=this.quad);var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5];return o?(c[0]=Math.round(l*v+n*S+w),c[1]=Math.round(l*m+n*M+C),c[2]=Math.round(l*v+f*S+w),c[3]=Math.round(l*m+f*M+C),c[4]=Math.round(u*v+f*S+w),c[5]=Math.round(u*m+f*M+C),c[6]=Math.round(u*v+n*S+w),c[7]=Math.round(u*m+n*M+C)):(c[0]=l*v+n*S+w,c[1]=l*m+n*M+C,c[2]=l*v+f*S+w,c[3]=l*m+f*M+C,c[4]=u*v+f*S+w,c[5]=u*m+f*M+C,c[6]=u*v+n*S+w,c[7]=u*m+n*M+C),c},getX:function(l,n){return l*this.a+n*this.c+this.e},getY:function(l,n){return l*this.b+n*this.d+this.f},getXRound:function(l,n,u){var f=this.getX(l,n);return u&&(f=Math.round(f)),f},getYRound:function(l,n,u){var f=this.getY(l,n);return u&&(f=Math.round(f)),f},getCSSMatrix:function(){var l=this.matrix;return"matrix("+l[0]+","+l[1]+","+l[2]+","+l[3]+","+l[4]+","+l[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});s.exports=a},59715:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=1,e={_visible:!0,visible:{get:function(){return this._visible},set:function(r){r?(this._visible=!0,this.renderFlags|=y):(this._visible=!1,this.renderFlags&=~y)}},setVisible:function(r){return this.visible=r,this}};s.exports=e},31401:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Alpha:e(16005),AlphaSingle:e(88509),BlendMode:e(90065),ComputedSize:e(94215),Crop:e(61683),Depth:e(89272),Flip:e(54434),FX:e(47059),GetBounds:e(8004),Mask:e(8573),Origin:e(27387),PathFollower:e(37640),Pipeline:e(72699),PostPipeline:e(17581),ScrollFactor:e(80227),Size:e(16736),Texture:e(37726),TextureCrop:e(79812),Tint:e(27472),ToJSON:e(53774),Transform:e(16901),TransformMatrix:e(61340),Visible:e(59715)}},31559:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37105),p=e(10312),h=e(83419),a=e(31401),l=e(51708),n=e(95643),u=e(87841),f=e(29959),o=e(36899),c=e(26099),d=new h({Extends:n,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,f],initialize:function(m,S,M,w){n.call(this,m,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=m.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(S,M),this.setBlendMode(p.SKIP_CHECK),w&&this.add(w)},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(v){return v===void 0&&(v=!0),this.exclusive=v,this},getBounds:function(v){if(v===void 0&&(v=new u),v.setTo(this.x,this.y,0,0),this.parentContainer){var m=this.parentContainer.getBoundsTransformMatrix(),S=m.transformPoint(this.x,this.y);v.setTo(S.x,S.y,0,0)}if(this.list.length>0){var M=this.list,w=new u,C=!1;v.setEmpty();for(var A=0;A-1},setAll:function(v,m,S,M){return r.SetAll(this.list,v,m,S,M),this},each:function(v,m){var S=[null],M,w=this.list.slice(),C=w.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(v){r.Remove(this.list,v),this.exclusive&&(v.parentContainer=null,v.removedFromScene())}});s.exports=d},53584:s=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r);var a=r.list;if(a.length!==0){var l=r.localTransform;h?(l.loadIdentity(),l.multiply(h),l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.scaleX,r.scaleY)):l.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY);var n=r.blendMode!==-1;n||e.setBlendMode(0);var u=r._alpha,f=r.scrollFactorX,o=r.scrollFactorY;r.mask&&r.mask.preRenderCanvas(e,null,p);for(var c=0;c{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(31559),h=e(44603),a=e(23568),l=e(95540);h.register("container",function(n,u){n===void 0&&(n={});var f=a(n,"x",0),o=a(n,"y",0),c=l(n,"children",null),d=new p(this.scene,f,o,c);return u!==void 0&&(n.add=u),r(this.scene,d,n),d})},24961:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31559),p=e(39429);p.register("container",function(h,a,l){return this.displayList.add(new r(this.scene,h,a,l))})},29959:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(72249),h=e(53584),s.exports={renderWebGL:p,renderCanvas:h}},72249:s=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r);var a=r.list,l=a.length;if(l!==0){var n=r.localTransform;h?(n.loadIdentity(),n.multiply(h),n.translate(r.x,r.y),n.rotate(r.rotation),n.scale(r.scaleX,r.scaleY)):n.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY),e.pipelines.preBatch(r);var u=r.blendMode!==-1;u||e.setBlendMode(0);for(var f=r.alpha,o=r.scrollFactorX,c=r.scrollFactorY,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(441),a=e(95643),l=e(41212),n=e(35846),u=e(44594),f=e(61369),o=new r({Extends:a,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Origin,p.ScrollFactor,p.Transform,p.Visible,h],initialize:function(d,v,m,S,M,w){a.call(this,d,"DOMElement"),this.parent=d.sys.game.domContainer,this.cache=d.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new f,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(v,m),typeof S=="string"?S[0]==="#"?this.setElement(S.substr(1),M,w):this.createElement(S,M,w):S&&this.setElement(S,M,w),d.sys.events.on(u.SLEEP,this.handleSceneEvent,this),d.sys.events.on(u.WAKE,this.handleSceneEvent,this),d.sys.events.on(u.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(c){var d=this.node,v=d.style;d&&(v.display=c.settings.visible?"block":"none")},setSkew:function(c,d){return c===void 0&&(c=0),d===void 0&&(d=c),this.skewX=c,this.skewY=d,this},setPerspective:function(c){return this.parent.style.perspective=c+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(c){this.parent.style.perspective=c+"px"}},addListener:function(c){if(this.node){c=c.split(" ");for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(47407),p=e(95643),h=e(61340),a=new h,l=new h,n=new h,u=function(f,o,c,d){if(o.node){var v=o.node.style,m=o.scene.sys.settings;if(!v||!m.visible||p.RENDER_MASK!==o.renderFlags||o.cameraFilter!==0&&o.cameraFilter&c.id||o.parentContainer&&!o.parentContainer.willRender()){v.display="none";return}var S=o.parentContainer,M=c.alpha*o.alpha;S&&(M*=S.alpha);var w=a,C=l,A=n,P=0,b=0,O="0%",I="0%";d?(P=o.width*o.scaleX*o.originX,b=o.height*o.scaleY*o.originY,C.applyITRS(o.x-P,o.y-b,o.rotation,o.scaleX,o.scaleY),w.copyFrom(c.matrix),w.multiplyWithOffset(d,-c.scrollX*o.scrollFactorX,-c.scrollY*o.scrollFactorY),C.e=o.x-P,C.f=o.y-b,w.multiply(C,A)):(P=o.width*o.originX,b=o.height*o.originY,C.applyITRS(o.x-P,o.y-b,o.rotation,o.scaleX,o.scaleY),w.copyFrom(c.matrix),O=100*o.originX+"%",I=100*o.originY+"%",C.e-=c.scrollX*o.scrollFactorX,C.f-=c.scrollY*o.scrollFactorY,w.multiply(C,A)),o.transformOnly||(v.display="block",v.opacity=M,v.zIndex=o._depth,v.pointerEvents=o.pointerEvents,v.mixBlendMode=r[o._blendMode]),v.transform=A.getCSSMatrix()+" skew("+o.skewX+"rad, "+o.skewY+"rad) rotate3d("+o.rotate3d.x+","+o.rotate3d.y+","+o.rotate3d.z+","+o.rotate3d.w+o.rotate3dAngle+")",v.transformOrigin=O+" "+I}};s.exports=u},2611:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3069),p=e(39429);p.register("dom",function(h,a,l,n,u){var f=new r(this.scene,h,a,l,n,u);return this.displayList.add(f),f})},441:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(49381),h=e(49381),s.exports={renderWebGL:p,renderCanvas:h}},62980:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addedtoscene"},41337:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},44947:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedfromscene"},49358:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},35163:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="created"},97249:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="error"},19483:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="locked"},56059:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},26772:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="metadata"},64437:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="playing"},83411:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="play"},75780:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seeked"},67799:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seeking"},63500:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stalled"},55541:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},53208:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="textureready"},4992:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unlocked"},12:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unsupported"},51708:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADDED_TO_SCENE:e(62980),DESTROY:e(41337),REMOVED_FROM_SCENE:e(44947),VIDEO_COMPLETE:e(49358),VIDEO_CREATED:e(35163),VIDEO_ERROR:e(97249),VIDEO_LOCKED:e(19483),VIDEO_LOOP:e(56059),VIDEO_METADATA:e(26772),VIDEO_PLAY:e(83411),VIDEO_PLAYING:e(64437),VIDEO_SEEKED:e(75780),VIDEO_SEEKING:e(67799),VIDEO_STALLED:e(63500),VIDEO_STOP:e(55541),VIDEO_TEXTURE:e(53208),VIDEO_UNLOCKED:e(4992),VIDEO_UNSUPPORTED:e(12)}},42421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(64993),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.Origin,p.ScrollFactor,p.Size,p.Texture,p.Tint,p.Transform,p.Visible,a],initialize:function(u){h.call(this,u,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});s.exports=l},70217:()=>{},56315:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42421),p=e(39429);p.register("extern",function(){var h=new r(this.scene);return this.displayList.add(h),h})},64993:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(80287),h=e(70217),s.exports={renderWebGL:p,renderCanvas:h}},80287:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){h.pipelines.clear();var u=r(a,l,n).calc;a.render.call(a,h,l,u),h.pipelines.rebind()};s.exports=p},85592:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71911),p=e(83419),h=e(85592),a=e(31401),l=e(8497),n=e(95643),u=e(95540),f=e(35154),o=e(36383),c=e(84503),d=new p({Extends:n,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,c],initialize:function(m,S){var M=f(S,"x",0),w=f(S,"y",0);n.call(this,m,"Graphics"),this.setPosition(M,w),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(S)},setDefaultStyles:function(v){return f(v,"lineStyle",null)&&(this.defaultStrokeWidth=f(v,"lineStyle.width",1),this.defaultStrokeColor=f(v,"lineStyle.color",16777215),this.defaultStrokeAlpha=f(v,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),f(v,"fillStyle",null)&&(this.defaultFillColor=f(v,"fillStyle.color",16777215),this.defaultFillAlpha=f(v,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(v,m,S){return S===void 0&&(S=1),this.commandBuffer.push(h.LINE_STYLE,v,m,S),this._lineWidth=v,this},fillStyle:function(v,m){return m===void 0&&(m=1),this.commandBuffer.push(h.FILL_STYLE,v,m),this},fillGradientStyle:function(v,m,S,M,w,C,A,P){return w===void 0&&(w=1),C===void 0&&(C=w),A===void 0&&(A=w),P===void 0&&(P=w),this.commandBuffer.push(h.GRADIENT_FILL_STYLE,w,C,A,P,v,m,S,M),this},lineGradientStyle:function(v,m,S,M,w,C){return C===void 0&&(C=1),this.commandBuffer.push(h.GRADIENT_LINE_STYLE,v,C,m,S,M,w),this},beginPath:function(){return this.commandBuffer.push(h.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(h.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(h.FILL_PATH),this},fill:function(){return this.commandBuffer.push(h.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(h.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(h.STROKE_PATH),this},fillCircleShape:function(v){return this.fillCircle(v.x,v.y,v.radius)},strokeCircleShape:function(v){return this.strokeCircle(v.x,v.y,v.radius)},fillCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,o.PI2),this.fillPath(),this},strokeCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,o.PI2),this.strokePath(),this},fillRectShape:function(v){return this.fillRect(v.x,v.y,v.width,v.height)},strokeRectShape:function(v){return this.strokeRect(v.x,v.y,v.width,v.height)},fillRect:function(v,m,S,M){return this.commandBuffer.push(h.FILL_RECT,v,m,S,M),this},strokeRect:function(v,m,S,M){var w=this._lineWidth/2,C=v-w,A=v+w;return this.beginPath(),this.moveTo(v,m),this.lineTo(v,m+M),this.strokePath(),this.beginPath(),this.moveTo(v+S,m),this.lineTo(v+S,m+M),this.strokePath(),this.beginPath(),this.moveTo(C,m),this.lineTo(A+S,m),this.strokePath(),this.beginPath(),this.moveTo(C,m+M),this.lineTo(A+S,m+M),this.strokePath(),this},fillRoundedRect:function(v,m,S,M,w){w===void 0&&(w=20);var C=w,A=w,P=w,b=w;typeof w!="number"&&(C=u(w,"tl",20),A=u(w,"tr",20),P=u(w,"bl",20),b=u(w,"br",20));var O=C>=0,I=A>=0,D=P>=0,B=b>=0;return C=Math.abs(C),A=Math.abs(A),P=Math.abs(P),b=Math.abs(b),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-A,m),I?this.arc(v+S-A,m+A,A,-o.TAU,0):this.arc(v+S,m,A,Math.PI,o.TAU,!0),this.lineTo(v+S,m+M-b),B?this.arc(v+S-b,m+M-b,b,0,o.TAU):this.arc(v+S,m+M,b,-o.TAU,Math.PI,!0),this.lineTo(v+P,m+M),D?this.arc(v+P,m+M-P,P,o.TAU,Math.PI):this.arc(v,m+M,P,0,-o.TAU,!0),this.lineTo(v,m+C),O?this.arc(v+C,m+C,C,-Math.PI,-o.TAU):this.arc(v,m,C,o.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(v,m,S,M,w){w===void 0&&(w=20);var C=w,A=w,P=w,b=w,O=Math.min(S,M)/2;typeof w!="number"&&(C=u(w,"tl",20),A=u(w,"tr",20),P=u(w,"bl",20),b=u(w,"br",20));var I=C>=0,D=A>=0,B=P>=0,G=b>=0;return C=Math.min(Math.abs(C),O),A=Math.min(Math.abs(A),O),P=Math.min(Math.abs(P),O),b=Math.min(Math.abs(b),O),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-A,m),this.moveTo(v+S-A,m),D?this.arc(v+S-A,m+A,A,-o.TAU,0):this.arc(v+S,m,A,Math.PI,o.TAU,!0),this.lineTo(v+S,m+M-b),this.moveTo(v+S,m+M-b),G?this.arc(v+S-b,m+M-b,b,0,o.TAU):this.arc(v+S,m+M,b,-o.TAU,Math.PI,!0),this.lineTo(v+P,m+M),this.moveTo(v+P,m+M),B?this.arc(v+P,m+M-P,P,o.TAU,Math.PI):this.arc(v,m+M,P,0,-o.TAU,!0),this.lineTo(v,m+C),this.moveTo(v,m+C),I?this.arc(v+C,m+C,C,-Math.PI,-o.TAU):this.arc(v,m,C,o.TAU,0,!0),this.strokePath(),this},fillPointShape:function(v,m){return this.fillPoint(v.x,v.y,m)},fillPoint:function(v,m,S){return!S||S<1?S=1:(v-=S/2,m-=S/2),this.commandBuffer.push(h.FILL_RECT,v,m,S,S),this},fillTriangleShape:function(v){return this.fillTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},strokeTriangleShape:function(v){return this.strokeTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},fillTriangle:function(v,m,S,M,w,C){return this.commandBuffer.push(h.FILL_TRIANGLE,v,m,S,M,w,C),this},strokeTriangle:function(v,m,S,M,w,C){return this.commandBuffer.push(h.STROKE_TRIANGLE,v,m,S,M,w,C),this},strokeLineShape:function(v){return this.lineBetween(v.x1,v.y1,v.x2,v.y2)},lineBetween:function(v,m,S,M){return this.beginPath(),this.moveTo(v,m),this.lineTo(S,M),this.strokePath(),this},lineTo:function(v,m){return this.commandBuffer.push(h.LINE_TO,v,m),this},moveTo:function(v,m){return this.commandBuffer.push(h.MOVE_TO,v,m),this},strokePoints:function(v,m,S,M){m===void 0&&(m=!1),S===void 0&&(S=!1),M===void 0&&(M=v.length),this.beginPath(),this.moveTo(v[0].x,v[0].y);for(var w=1;w-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(v,m,S){var M=this.scene.sys,w=M.game.renderer;m===void 0&&(m=M.scale.width),S===void 0&&(S=M.scale.height),d.TargetCamera.setScene(this.scene),d.TargetCamera.setViewport(0,0,m,S),d.TargetCamera.scrollX=this.x,d.TargetCamera.scrollY=this.y;var C,A,P={willReadFrequently:!0};if(typeof v=="string")if(M.textures.exists(v)){C=M.textures.get(v);var b=C.getSourceImage();b instanceof HTMLCanvasElement&&(A=b.getContext("2d",P))}else C=M.textures.createCanvas(v,m,S),A=C.getSourceImage().getContext("2d",P);else v instanceof HTMLCanvasElement&&(A=v.getContext("2d",P));return A&&(this.renderCanvas(w,this,d.TargetCamera,null,A,!1),C&&C.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});d.TargetCamera=new r,s.exports=d},32768:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85592),p=e(20926),h=function(a,l,n,u,f,o){var c=l.commandBuffer,d=c.length,v=f||a.currentContext;if(!(d===0||!p(a,v,l,n,u))){n.addToRenderList(l);var m=1,S=1,M=0,w=0,C=1,A=0,P=0,b=0;v.beginPath();for(var O=0;O>>16,P=(M&65280)>>>8,b=M&255,v.strokeStyle="rgba("+A+","+P+","+b+","+m+")",v.lineWidth=C,O+=3;break;case r.FILL_STYLE:w=c[O+1],S=c[O+2],A=(w&16711680)>>>16,P=(w&65280)>>>8,b=w&255,v.fillStyle="rgba("+A+","+P+","+b+","+S+")",O+=2;break;case r.BEGIN_PATH:v.beginPath();break;case r.CLOSE_PATH:v.closePath();break;case r.FILL_PATH:o||v.fill();break;case r.STROKE_PATH:o||v.stroke();break;case r.FILL_RECT:o?v.rect(c[O+1],c[O+2],c[O+3],c[O+4]):v.fillRect(c[O+1],c[O+2],c[O+3],c[O+4]),O+=4;break;case r.FILL_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),o||v.fill(),O+=6;break;case r.STROKE_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),o||v.stroke(),O+=6;break;case r.LINE_TO:v.lineTo(c[O+1],c[O+2]),O+=2;break;case r.MOVE_TO:v.moveTo(c[O+1],c[O+2]),O+=2;break;case r.LINE_FX_TO:v.lineTo(c[O+1],c[O+2]),O+=5;break;case r.MOVE_FX_TO:v.moveTo(c[O+1],c[O+2]),O+=5;break;case r.SAVE:v.save();break;case r.RESTORE:v.restore();break;case r.TRANSLATE:v.translate(c[O+1],c[O+2]),O+=2;break;case r.SCALE:v.scale(c[O+1],c[O+2]),O+=2;break;case r.ROTATE:v.rotate(c[O+1]),O+=1;break;case r.GRADIENT_FILL_STYLE:O+=5;break;case r.GRADIENT_LINE_STYLE:O+=6;break}}v.restore()}};s.exports=h},87079:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(43831);r.register("graphics",function(h,a){h===void 0&&(h={}),a!==void 0&&(h.add=a);var l=new p(this.scene,h);return h.add&&this.scene.sys.displayList.add(l),l})},1201:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43831),p=e(39429);p.register("graphics",function(h){return this.displayList.add(new r(this.scene,h))})},84503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(77545),h=e(32768),h=e(32768),s.exports={renderWebGL:p,renderCanvas:h}},77545:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85592),p=e(91296),h=e(61340),a=e(70554),l=function(c,d,v){this.x=c,this.y=d,this.width=v},n=function(c,d,v){this.points=[],this.pointsLength=1,this.points[0]=new l(c,d,v)},u=[],f=new h,o=function(c,d,v,m){if(d.commandBuffer.length!==0){v.addToRenderList(d);var S=c.pipelines.set(d.pipeline,d);c.pipelines.preBatch(d);for(var M=p(d,v,m).calc,w=f.loadIdentity(),C=d.commandBuffer,A=v.alpha*d.alpha,P=1,b=S.fillTint,O=S.strokeTint,I=0,D=0,B=0,G=.01,z=Math.PI*2,X,j=[],Q=0,tt=!0,Y=null,Z=a.getTintAppendFloatAlpha,U=0;U0&&(Dt=-z+Dt%z):Dt>z?Dt=z:Dt<0&&(Dt=z+Dt%z),Y===null&&(Y=new n(Vt+Math.cos(Rt)*ut,dt+Math.sin(Rt)*ut,P),j.push(Y),Pt+=G);Pt<1+Bt;)B=Dt*Pt+Rt,I=Vt+Math.cos(B)*ut,D=dt+Math.sin(B)*ut,Y.points.push(new l(I,D,P)),Pt+=G;B=Dt+Rt,I=Vt+Math.cos(B)*ut,D=dt+Math.sin(B)*ut,Y.points.push(new l(I,D,P));break}case r.FILL_RECT:{S.batchFillRect(C[++U],C[++U],C[++U],C[++U],w,M);break}case r.FILL_TRIANGLE:{S.batchFillTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],w,M);break}case r.STROKE_TRIANGLE:{S.batchStrokeTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],P,w,M);break}case r.LINE_TO:{Y!==null?Y.points.push(new l(C[++U],C[++U],P)):(Y=new n(C[++U],C[++U],P),j.push(Y));break}case r.MOVE_TO:{Y=new n(C[++U],C[++U],P),j.push(Y);break}case r.SAVE:{u.push(w.copyToArray());break}case r.RESTORE:{w.copyFromArray(u.pop());break}case r.TRANSLATE:{Vt=C[++U],dt=C[++U],w.translate(Vt,dt);break}case r.SCALE:{Vt=C[++U],dt=C[++U],w.scale(Vt,dt);break}case r.ROTATE:{w.rotate(C[++U]);break}}c.pipelines.postBatch(d)}};s.exports=o},26479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61061),p=e(83419),h=e(51708),a=e(50792),l=e(46710),n=e(95540),u=e(35154),f=e(97022),o=e(41212),c=e(88492),d=e(35072),v=e(68287),m=new p({Extends:a,initialize:function(M,w,C){a.call(this),C?w&&!Array.isArray(w)&&(w=[w]):Array.isArray(w)?o(w[0])&&(C=w,w=null):o(w)&&(C=w,w=null),this.scene=M,this.children=new d,this.isParent=!0,this.type="Group",this.classType=n(C,"classType",v),this.name=n(C,"name",""),this.active=n(C,"active",!0),this.maxSize=n(C,"maxSize",-1),this.defaultKey=n(C,"defaultKey",null),this.defaultFrame=n(C,"defaultFrame",null),this.runChildUpdate=n(C,"runChildUpdate",!1),this.createCallback=n(C,"createCallback",null),this.removeCallback=n(C,"removeCallback",null),this.createMultipleCallback=n(C,"createMultipleCallback",null),this.internalCreateCallback=n(C,"internalCreateCallback",null),this.internalRemoveCallback=n(C,"internalRemoveCallback",null),w&&this.addMultiple(w),C&&this.createMultiple(C),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(S,M,w,C,A,P){if(S===void 0&&(S=0),M===void 0&&(M=0),w===void 0&&(w=this.defaultKey),C===void 0&&(C=this.defaultFrame),A===void 0&&(A=!0),P===void 0&&(P=!0),this.isFull())return null;var b=new this.classType(this.scene,S,M,w,C);return b.addToDisplayList(this.scene.sys.displayList),b.addToUpdateList(),b.visible=A,b.setActive(P),this.add(b),b},createMultiple:function(S){if(this.isFull())return[];Array.isArray(S)||(S=[S]);var M=[];if(S[0].key)for(var w=0;w=0;B--)if(D=z[B],D.active===w){if(G++,G===M)break}else D=null;return D?(typeof A=="number"&&(D.x=A),typeof P=="number"&&(D.y=P),D):C?this.create(A,P,b,O,I):null},get:function(S,M,w,C,A){return this.getFirst(!1,!0,S,M,w,C,A)},getFirstAlive:function(S,M,w,C,A,P){return this.getFirst(!0,S,M,w,C,A,P)},getFirstDead:function(S,M,w,C,A,P){return this.getFirst(!1,S,M,w,C,A,P)},playAnimation:function(S,M){return r.PlayAnimation(this.children.entries,S,M),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(S){S===void 0&&(S=!0);for(var M=0,w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(26479);r.register("group",function(h){return new p(this.scene,null,h)})},3385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26479),p=e(39429);p.register("group",function(h,a){return this.updateList.add(new r(this.scene,h,a))})},88571:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(59819),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.TextureCrop,p.Tint,p.Transform,p.Visible,a],initialize:function(u,f,o,c,d){h.call(this,u,"Image"),this._crop=this.resetCropObject(),this.setTexture(c,d),this.setPosition(f,o),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=l},40652:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},82459:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(88571);p.register("image",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"frame",null),o=new a(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,o,l),o})},2117:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(88571),p=e(39429);p.register("image",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},59819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99517),h=e(40652),s.exports={renderWebGL:p,renderCanvas:h}},99517:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),this.pipeline.batchSprite(r,p,h)};s.exports=y},77856:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Events:e(51708),DisplayList:e(8050),GameObjectCreator:e(44603),GameObjectFactory:e(39429),UpdateList:e(45027),Components:e(31401),GetCalcMatrix:e(91296),BuildGameObject:e(25305),BuildGameObjectAnimation:e(13059),GameObject:e(95643),BitmapText:e(22186),Blitter:e(6107),Bob:e(46590),Container:e(31559),DOMElement:e(3069),DynamicBitmapText:e(2638),Extern:e(42421),Graphics:e(43831),Group:e(26479),Image:e(88571),Layer:e(93595),Particles:e(18404),PathFollower:e(1159),RenderTexture:e(591),RetroFont:e(196),Rope:e(77757),Sprite:e(68287),Text:e(50171),GetTextSize:e(14220),MeasureText:e(79557),TextStyle:e(35762),TileSprite:e(20839),Zone:e(41481),Video:e(18471),Shape:e(17803),Arc:e(23629),Curve:e(89),Ellipse:e(19921),Grid:e(30479),IsoBox:e(61475),IsoTriangle:e(16933),Line:e(57847),Polygon:e(24949),Rectangle:e(74561),Star:e(55911),Triangle:e(36931),Factories:{Blitter:e(12709),Container:e(24961),DOMElement:e(2611),DynamicBitmapText:e(72566),Extern:e(56315),Graphics:e(1201),Group:e(3385),Image:e(2117),Layer:e(20005),Particles:e(676),PathFollower:e(90145),RenderTexture:e(60505),Rope:e(96819),Sprite:e(46409),StaticBitmapText:e(34914),Text:e(68005),TileSprite:e(91681),Zone:e(84175),Video:e(89025),Arc:e(42563),Curve:e(40511),Ellipse:e(1543),Grid:e(34137),IsoBox:e(3933),IsoTriangle:e(49803),Line:e(2481),Polygon:e(64827),Rectangle:e(87959),Star:e(93697),Triangle:e(45245)},Creators:{Blitter:e(9403),Container:e(77143),DynamicBitmapText:e(11164),Graphics:e(87079),Group:e(94975),Image:e(82459),Layer:e(25179),Particles:e(92730),RenderTexture:e(34495),Rope:e(26209),Sprite:e(15567),StaticBitmapText:e(57336),Text:e(71259),TileSprite:e(14167),Zone:e(95261),Video:e(11511)}};r.Shader=e(20071),r.Mesh=e(4703),r.NineSlice=e(28103),r.PointLight=e(80321),r.Plane=e(33663),r.Factories.Shader=e(74177),r.Factories.Mesh=e(9225),r.Factories.NineSlice=e(47521),r.Factories.PointLight=e(71255),r.Factories.Plane=e(30985),r.Creators.Shader=e(54935),r.Creators.Mesh=e(20527),r.Creators.NineSlice=e(28279),r.Creators.PointLight=e(39829),r.Creators.Plane=e(56015),r.Light=e(41432),r.LightsManager=e(61356),r.LightsPlugin=e(88992),s.exports=r},93595:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(83419),h=e(31401),a=e(53774),l=e(45893),n=e(50792),u=e(51708),f=e(73162),o=e(33963),c=e(44594),d=e(19186),v=new p({Extends:f,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Mask,h.PostPipeline,h.Visible,n,o],initialize:function(S,M){f.call(this,S),n.call(this),this.scene=S,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=S.sys,this.events=S.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),M&&this.add(M),S.sys.queueDepthSort()},setActive:function(m){return this.active=m,this},setName:function(m){return this.name=m,this},setState:function(m){return this.state=m,this},setDataEnabled:function(){return this.data||(this.data=new l(this)),this},setData:function(m,S){return this.data||(this.data=new l(this)),this.data.set(m,S),this},incData:function(m,S){return this.data||(this.data=new l(this)),this.data.inc(m,S),this},toggleData:function(m){return this.data||(this.data=new l(this)),this.data.toggle(m),this},getData:function(m){return this.data||(this.data=new l(this)),this.data.get(m)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return a(this)},willRender:function(m){return!(this.renderFlags!==15||this.list.length===0||this.cameraFilter!==0&&this.cameraFilter&m.id)},getIndexList:function(){for(var m=this,S=this.parentContainer,M=[];S&&(M.unshift(S.getIndex(m)),m=S,S.parentContainer);)S=S.parentContainer;return M.unshift(this.displayList.getIndex(m)),M},addChildCallback:function(m){var S=m.displayList;S&&S!==this&&m.removeFromDisplayList(),m.displayList||(this.queueDepthSort(),m.displayList=this,m.emit(u.ADDED_TO_SCENE,m,this.scene),this.events.emit(c.ADDED_TO_SCENE,m,this.scene))},removeChildCallback:function(m){this.queueDepthSort(),m.displayList=null,m.emit(u.REMOVED_FROM_SCENE,m,this.scene),this.events.emit(c.REMOVED_FROM_SCENE,m,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(d(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(m,S){return m._depth-S._depth},getChildren:function(){return this.list},addToDisplayList:function(m){return m===void 0&&(m=this.scene.sys.displayList),this.displayList&&this.displayList!==m&&this.removeFromDisplayList(),m.exists(this)||(this.displayList=m,m.add(this,!0),m.queueDepthSort(),this.emit(u.ADDED_TO_SCENE,this,this.scene),m.events.emit(c.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var m=this.displayList||this.scene.sys.displayList;return m.exists(this)&&(m.remove(this,!0),m.queueDepthSort(),this.displayList=null,this.emit(u.REMOVED_FROM_SCENE,this,this.scene),m.events.emit(c.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(m){if(!(!this.scene||this.ignoreDestroy)){this.emit(u.DESTROY,this);for(var S=this.list;S.length;)S[0].destroy(m);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}}});s.exports=v},2956:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r.list;if(h.length!==0){r.depthSort();var a=r.blendMode!==-1;a||e.setBlendMode(0);var l=r._alpha;r.mask&&r.mask.preRenderCanvas(e,null,p);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(93595),h=e(44603),a=e(23568);h.register("layer",function(l,n){l===void 0&&(l={});var u=a(l,"children",null),f=new p(this.scene,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},20005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(93595),p=e(39429);p.register("layer",function(h){return this.displayList.add(new r(this.scene,h))})},33963:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(15869),h=e(2956),s.exports={renderWebGL:p,renderCanvas:h}},15869:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r.list,a=h.length;if(a!==0){r.depthSort(),e.pipelines.preBatch(r);var l=r.blendMode!==-1;l||e.setBlendMode(0);for(var n=r.alpha,u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=e(83419),h=e(31401),a=e(51767),l=e(70554),n=new p({Extends:r,Mixins:[h.Origin,h.ScrollFactor,h.Visible],initialize:function(f,o,c,d,v,m,S){r.call(this,f,o,c),this.color=new a(d,v,m),this.intensity=S,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(c)},displayWidth:{get:function(){return this.diameter},set:function(u){this.diameter=u}},displayHeight:{get:function(){return this.diameter},set:function(u){this.diameter=u}},width:{get:function(){return this.diameter},set:function(u){this.diameter=u}},height:{get:function(){return this.diameter},set:function(u){this.diameter=u}},willRender:function(u){return!(n.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setColor:function(u){var f=l.getFloatsFromUintRGB(u);return this.color.set(f[0],f[1],f[2]),this},setIntensity:function(u){return this.intensity=u,this},setRadius:function(u){return this.radius=u,this}});n.RENDER_MASK=15,s.exports=n},61356:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81491),p=e(83419),h=e(20339),a=e(41432),l=e(80321),n=e(51767),u=e(19133),f=e(19186),o=e(70554),c=new p({initialize:function(){this.lights=[],this.ambientColor=new n(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(d,v,m,S,M,w){return this.systems.displayList.add(new l(this.scene,d,v,m,S,M,w))},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(d){for(var v=this.lights,m=d.worldView,S=[],M=0;Mthis.maxLights&&(f(S,this.sortByDistance),S=S.slice(0,this.maxLights)),this.visibleLights=S.length,S},sortByDistance:function(d,v){return d.distance>=v.distance},setAmbientColor:function(d){var v=o.getFloatsFromUintRGB(d);return this.ambientColor.set(v[0],v[1],v[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=16777215),M===void 0&&(M=1);var w=o.getFloatsFromUintRGB(S),C=new a(d,v,m,w[0],w[1],w[2],M);return this.lights.push(C),C},removeLight:function(d){var v=this.lights.indexOf(d);return v>=0&&u(this.lights,v),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});s.exports=c},88992:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(61356),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){this.scene=u,this.systems=u.sys,u.sys.settings.isBooted||u.sys.events.once(a.BOOT,this.boot,this),p.call(this)},boot:function(){var n=this.systems.events;n.on(a.SHUTDOWN,this.shutdown,this),n.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});h.register("LightsPlugin",l,"lights"),s.exports=l},4703:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(39506),a=e(83997),l=e(95643),n=e(34684),u=e(92515),f=e(91296),o=e(37867),c=e(29807),d=e(43396),v=e(19186),m=e(25836),S=e(39318),M=new r({Extends:l,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.Texture,p.Transform,p.Visible,c],initialize:function(C,A,P,b,O,I,D,B,G,z,X,j){A===void 0&&(A=0),P===void 0&&(P=0),b===void 0&&(b="__WHITE"),l.call(this,C,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new m,this.modelScale=new m(1,1,1),this.modelRotation=new m,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new o,this.viewPosition=new m,this.viewMatrix=new o,this.projectionMatrix=new o,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var Q=C.sys.renderer;this.setPosition(A,P),this.setTexture(b,O),this.setSize(Q.width,Q.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(Q.width,Q.height),I&&this.addVertices(I,D,B,G,z,X,j)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(w){return this.viewPosition.addScale(m.LEFT,w),this.dirtyCache[10]=1,this},panY:function(w){return this.viewPosition.y+=m.DOWN.y*w,this.dirtyCache[10]=1,this},panZ:function(w){return this.viewPosition.z+=w,this.dirtyCache[10]=1,this},setPerspective:function(w,C,A,P,b){return A===void 0&&(A=45),P===void 0&&(P=.01),b===void 0&&(b=1e3),this.fov=A,this.projectionMatrix.perspective(h(A),w/C,P,b),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(w,C,A,P){return w===void 0&&(w=this.scene.sys.renderer.getAspectRatio()),C===void 0&&(C=1),A===void 0&&(A=-1e3),P===void 0&&(P=1e3),this.fov=0,this.projectionMatrix.ortho(-w,w,-C,C,A,P),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(w){w.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(w,C,A,P,b,O,I,D,B){var G=this.scene.sys.cache.obj.get(w),z;return G&&(z=n(G,this,C,A,P,b,O,I,D,B)),(!z||z.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",w),this},sortByDepth:function(w,C){return w.depth-C.depth},depthSort:function(){return v(this.faces,this.sortByDepth),this},addVertex:function(w,C,A,P,b,O,I){var D=new S(w,C,A,P,b,O,I);return this.vertices.push(D),D},addFace:function(w,C,A){var P=new a(w,C,A);return this.faces.push(P),this.dirtyCache[9]=-1,P},addVertices:function(w,C,A,P,b,O,I){var D=u(w,C,A,P,b,O,I);return D?(this.faces=this.faces.concat(D.faces),this.vertices=this.vertices.concat(D.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(w){return this.faces[w]},hasFaceAt:function(w,C,A){A===void 0&&(A=this.scene.sys.cameras.main);for(var P=f(this,A).calc,b=this.faces,O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},20527:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(4703);p.register("mesh",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=a(n,"vertices",[]),d=a(n,"uvs",[]),v=a(n,"indicies",[]),m=a(n,"containsZ",!1),S=a(n,"normals",[]),M=a(n,"colors",16777215),w=a(n,"alphas",1),C=new l(this.scene,0,0,f,o,c,d,v,m,S,M,w);return u!==void 0&&(n.add=u),r(this.scene,C,n),C})},9225:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4703),p=e(39429);p.register("mesh",function(h,a,l,n,u,f,o,c,d,v,m){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c,d,v,m))})},29807:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(48833),h=e(36488),s.exports={renderWebGL:p,renderCanvas:h}},48833:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){var u=a.faces,f=u.length;if(f!==0){l.addToRenderList(a);var o=h.pipelines.set(a.pipeline,a),c=r(a,l,n).calc;h.pipelines.preBatch(a);for(var d=o.setGameObject(a),v=o.vertexViewF32,m=o.vertexViewU32,S=o.vertexCount*o.currentShader.vertexComponentCount-1,M=a.tintFill,w=[],C=a.debugCallback,A=c.a,P=c.b,b=c.c,O=c.d,I=c.e,D=c.f,B=a.viewPosition.z,G=a.hideCCW,z=l.roundPixels,X=l.alpha*a.alpha,j=0,Q=0;Q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(78023),l=e(39318),n=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,a],initialize:function(f,o,c,d,v,m,S,M,w,C,A){h.call(this,f,"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 P=f.textures.getFrame(d,v);this.is3Slice=!C&&!A,P.scale9&&(this.is3Slice=P.is3Slice);for(var b=this.is3Slice?18:54,O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(28103);p.register("nineslice",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=a(n,"width",256),d=a(n,"height",256),v=a(n,"leftWidth",10),m=a(n,"rightWidth",10),S=a(n,"topHeight",0),M=a(n,"bottomHeight",0),w=new l(this.scene,0,0,f,o,c,d,v,m,S,M);return u!==void 0&&(n.add=u),r(this.scene,w,n),w})},47521:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28103),p=e(39429);p.register("nineslice",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c,d,v))})},78023:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(52230),s.exports={renderWebGL:p,renderCanvas:h}},52230:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){var f=l.vertices,o=f.length;if(o!==0){n.addToRenderList(l);var c=a.pipelines.set(l.pipeline,l),d=r(l,n,u,!1).calc;a.pipelines.preBatch(l);var v=c.setGameObject(l),m=c.vertexViewF32,S=c.vertexViewU32,M=c.vertexCount*c.currentShader.vertexComponentCount-1,w=n.roundPixels,C=l.tintFill,A=n.alpha*l.alpha,P=p.getTintAppendFloatAlpha(l.tint,A),b=c.vertexAvailable(),O=-1;b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(44777),h=e(37589),a=e(6113),l=e(91389),n=e(90664),u=new r({Extends:p,initialize:function(o){p.call(this,o,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 f=this.propertyValue,o=f,c=this.defaultEmit,d=this.defaultUpdate;if(this.method===9){this.start=f[0],this.ease=a("Linear"),this.interpolation=l("linear"),c=this.easedValueEmit,d=this.easeValueUpdate,o=f[0],this.active=!0;for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(45319),h=e(83419),a=e(99472),l=e(6113),n=e(95540),u=e(91389),f=e(77720),o=e(15994),c=new h({initialize:function(v,m,S){S===void 0&&(S=!1),this.propertyKey=v,this.propertyValue=m,this.defaultValue=m,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=S,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(d,v){d===void 0&&(d={}),v&&(this.propertyKey=v),this.propertyValue=n(d,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(d){var v;switch(this.method){case 1:case 3:case 8:v=d;break;case 2:this.propertyValue.indexOf(d)>=0&&(v=d);break;case 4:var m=(this.end-this.start)/this.steps;v=f(d,m),this.counter=v;break;case 5:case 6:case 7:v=p(d,this.start,this.end);break;case 9:v=this.start[0];break}return this.current=v,this},getMethod:function(){var d=this.propertyValue;if(d===null)return 0;var v=typeof d;if(v==="number")return 1;if(Array.isArray(d))return 2;if(v==="function")return 3;if(v==="object"){if(this.hasBoth(d,"start","end"))return this.has(d,"steps")?4:5;if(this.hasBoth(d,"min","max"))return 6;if(this.has(d,"random"))return 7;if(this.hasEither(d,"onEmit","onUpdate"))return 8;if(this.hasEither(d,"values","interpolation"))return 9}return 0},setMethods:function(){var d=this.propertyValue,v=d,m=this.defaultEmit,S=this.defaultUpdate;switch(this.method){case 1:m=this.staticValueEmit;break;case 2:m=this.randomStaticValueEmit,v=d[0];break;case 3:this._onEmit=d,m=this.proxyEmit;break;case 4:this.start=d.start,this.end=d.end,this.steps=d.steps,this.counter=this.start,this.yoyo=this.has(d,"yoyo")?d.yoyo:!1,this.direction=0,m=this.steppedEmit,v=this.start;break;case 5:this.start=d.start,this.end=d.end;var M=this.has(d,"ease")?d.ease:"Linear";this.ease=l(M,d.easeParams),m=this.has(d,"random")&&d.random?this.randomRangedValueEmit:this.easedValueEmit,S=this.easeValueUpdate,v=this.start;break;case 6:this.start=d.min,this.end=d.max,m=this.has(d,"int")&&d.int?this.randomRangedIntEmit:this.randomRangedValueEmit,v=this.start;break;case 7:var w=d.random;Array.isArray(w)&&(this.start=w[0],this.end=w[1]),m=this.randomRangedIntEmit,v=this.start;break;case 8:this._onEmit=this.has(d,"onEmit")?d.onEmit:this.defaultEmit,this._onUpdate=this.has(d,"onUpdate")?d.onUpdate:this.defaultUpdate,m=this.proxyEmit,S=this.proxyUpdate;break;case 9:this.start=d.values;var C=this.has(d,"ease")?d.ease:"Linear";this.ease=l(C,d.easeParams),this.interpolation=u(d.interpolation),m=this.easedValueEmit,S=this.easeValueUpdate,v=this.start[0];break}return this.onEmit=m,this.onUpdate=S,this.current=v,this},has:function(d,v){return d.hasOwnProperty(v)},hasBoth:function(d,v,m){return d.hasOwnProperty(v)&&d.hasOwnProperty(m)},hasEither:function(d,v,m){return d.hasOwnProperty(v)||d.hasOwnProperty(m)},defaultEmit:function(d,v,m){return m},defaultUpdate:function(d,v,m,S){return S},proxyEmit:function(d,v,m){var S=this._onEmit(d,v,m);return this.current=S,S},proxyUpdate:function(d,v,m,S){var M=this._onUpdate(d,v,m,S);return this.current=M,M},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var d=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[d],this.current},randomRangedValueEmit:function(d,v){var m=a(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},randomRangedIntEmit:function(d,v){var m=r(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},steppedEmit:function(){var d=this.counter,v=d,m=(this.end-this.start)/this.steps;if(this.yoyo){var S;this.direction===0?(v+=m,v>=this.end&&(S=v-this.end,v=this.end-S,this.direction=1)):(v-=m,v<=this.start&&(S=this.start-v,v=this.start+S,this.direction=0)),this.counter=v}else this.counter=o(v+m,this.start,this.end);return this.current=d,d},easedValueEmit:function(d,v){if(d&&d.data[v]){var m=d.data[v];m.min=this.start,m.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(d,v,m){var S=d.data[v],M,w=this.ease(m);return this.interpolation?M=this.interpolation(this.start,w):M=(S.max-S.min)*w+S.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}});s.exports=c},24502:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(20286),a=new r({Extends:h,initialize:function(n,u,f,o,c){if(typeof n=="object"){var d=n;n=p(d,"x",0),u=p(d,"y",0),f=p(d,"power",0),o=p(d,"epsilon",100),c=p(d,"gravity",50)}else n===void 0&&(n=0),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=100),c===void 0&&(c=50);h.call(this,n,u,!0),this._gravity=c,this._power=f*c,this._epsilon=o*o},update:function(l,n){var u=this.x-l.x,f=this.y-l.y,o=u*u+f*f;if(o!==0){var c=Math.sqrt(o);o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(45319),h=e(83419),a=e(39506),l=e(87841),n=e(11520),u=e(26099),f=new h({initialize:function(c){this.emitter=c,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new u,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=c.scene,this.anims=new r(this),this.bounds=new l},emit:function(o,c,d,v,m,S){return this.emitter.emit(o,c,d,v,m,S)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(o,c){o===void 0&&(o=0),c===void 0&&(c=0),this.x=o,this.y=c},fire:function(o,c){var d=this.emitter,v=d.ops,m=d.getAnim();if(m?this.anims.play(m):(this.frame=d.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(d.getEmitZone(this),o===void 0?this.x+=v.x.onEmit(this,"x"):v.x.steps>0?this.x+=o+v.x.onEmit(this,"x"):this.x+=o,c===void 0?this.y+=v.y.onEmit(this,"y"):v.y.steps>0?this.y+=c+v.y.onEmit(this,"y"):this.y+=c,this.life=v.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=v.delay.onEmit(this,"delay"),this.holdCurrent=v.hold.onEmit(this,"hold"),this.scaleX=v.scaleX.onEmit(this,"scaleX"),this.scaleY=v.scaleY.active?v.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=v.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),d.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&d.getDeathZone(this))return this.lifeCurrent=0,!1;var S=v.speedX.onEmit(this,"speedX"),M=v.speedY.active?v.speedY.onEmit(this,"speedY"):S;if(d.radial){var w=a(v.angle.onEmit(this,"angle"));this.velocityX=Math.cos(w)*Math.abs(S),this.velocityY=Math.sin(w)*Math.abs(M)}else if(d.moveTo){var C=v.moveToX.onEmit(this,"moveToX"),A=v.moveToY.onEmit(this,"moveToY"),P=this.life/1e3;this.velocityX=(C-this.x)/P,this.velocityY=(A-this.y)/P}else this.velocityX=S,this.velocityY=M;return d.acceleration&&(this.accelerationX=v.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=v.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=v.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=v.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=v.bounce.onEmit(this,"bounce"),this.alpha=v.alpha.onEmit(this,"alpha"),v.color.active?this.tint=v.color.onEmit(this,"tint"):this.tint=v.tint.onEmit(this,"tint"),!0},update:function(o,c,d){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=o,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=o,!1;this.anims.update(0,o);var v=this.emitter,m=v.ops,S=1-this.lifeCurrent/this.life;if(this.lifeT=S,this.x=m.x.onUpdate(this,"x",S,this.x),this.y=m.y.onUpdate(this,"y",S,this.y),v.moveTo){var M=m.moveToX.onUpdate(this,"moveToX",S,v.moveToX),w=m.moveToY.onUpdate(this,"moveToY",S,v.moveToY),C=this.lifeCurrent/1e3;this.velocityX=(M-this.x)/C,this.velocityY=(w-this.y)/C}return this.computeVelocity(v,o,c,d,S),this.scaleX=m.scaleX.onUpdate(this,"scaleX",S,this.scaleX),m.scaleY.active?this.scaleY=m.scaleY.onUpdate(this,"scaleY",S,this.scaleY):this.scaleY=this.scaleX,this.angle=m.rotate.onUpdate(this,"rotate",S,this.angle),this.rotation=a(this.angle),v.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=p(m.alpha.onUpdate(this,"alpha",S,this.alpha),0,1),m.color.active?this.tint=m.color.onUpdate(this,"color",S,this.tint):this.tint=m.tint.onUpdate(this,"tint",S,this.tint),this.lifeCurrent-=o,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(o,c,d,v,m){var S=o.ops,M=this.velocityX,w=this.velocityY,C=S.accelerationX.onUpdate(this,"accelerationX",m,this.accelerationX),A=S.accelerationY.onUpdate(this,"accelerationY",m,this.accelerationY),P=S.maxVelocityX.onUpdate(this,"maxVelocityX",m,this.maxVelocityX),b=S.maxVelocityY.onUpdate(this,"maxVelocityY",m,this.maxVelocityY);this.bounce=S.bounce.onUpdate(this,"bounce",m,this.bounce),M+=o.gravityX*d+C*d,w+=o.gravityY*d+A*d,M=p(M,-P,P),w=p(w,-b,b),this.velocityX=M,this.velocityY=w,this.x+=M*d,this.y+=w*d,o.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(20286),h=e(87841),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){c===void 0&&(c=!0),d===void 0&&(d=!0),v===void 0&&(v=!0),m===void 0&&(m=!0),p.call(this,n,u,!0),this.bounds=new h(n,u,f,o),this.collideLeft=c,this.collideRight=d,this.collideTop=v,this.collideBottom=m},update:function(l){var n=this.bounds,u=-l.bounce,f=l.worldPosition;f.xn.right&&this.collideRight&&(l.x-=f.x-n.right,l.velocityX*=u),f.yn.bottom&&this.collideBottom&&(l.y-=f.y-n.bottom,l.velocityY*=u)}});s.exports=a},31600:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(53774),a=e(43459),l=e(26388),n=e(19909),u=e(76472),f=e(44777),o=e(20696),c=e(95643),d=e(95540),v=e(26546),m=e(24502),S=e(1985),M=e(97022),w=e(86091),C=e(73162),A=e(20074),P=e(56480),b=e(68875),O=e(87841),I=e(59996),D=e(72905),B=e(90668),G=e(19186),z=e(61340),X=e(26099),j=e(15994),Q=e(69601),tt=["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"],Y=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],Z=new r({Extends:c,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,B],initialize:function(H,J,_,q,at){c.call(this,H,"ParticleEmitter"),this.particleClass=P,this.ops={accelerationX:new f("accelerationX",0),accelerationY:new f("accelerationY",0),alpha:new f("alpha",1),angle:new f("angle",{min:0,max:360},!0),bounce:new f("bounce",0),color:new u("color"),delay:new f("delay",0,!0),hold:new f("hold",0,!0),lifespan:new f("lifespan",1e3,!0),maxVelocityX:new f("maxVelocityX",1e4),maxVelocityY:new f("maxVelocityY",1e4),moveToX:new f("moveToX",0),moveToY:new f("moveToY",0),quantity:new f("quantity",1,!0),rotate:new f("rotate",0),scaleX:new f("scaleX",1),scaleY:new f("scaleY",1),speedX:new f("speedX",0,!0),speedY:new f("speedY",0,!0),tint:new f("tint",16777215),x:new f("x",0),y:new f("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 X,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 z,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new C(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(J,_),this.setTexture(q),at&&this.setConfig(at)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(U){if(!U)return this;var H=0,J="",_=this.ops;for(H=0;H=this.animQuantity&&(this.animCounter=0,this.currentAnim=j(this.currentAnim+1,0,H)),J},setAnim:function(U,H,J){H===void 0&&(H=!0),J===void 0&&(J=1),this.randomAnim=H,this.animQuantity=J,this.currentAnim=0;var _=typeof U;if(this.anims.length=0,Array.isArray(U))this.anims=this.anims.concat(U);else if(_==="string")this.anims.push(U);else if(_==="object"){var q=U;U=d(q,"anims",null),U&&(this.anims=this.anims.concat(U));var at=d(q,"cycle",!1);this.randomAnim=!at,this.animQuantity=d(q,"quantity",J)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(U){return U===void 0&&(U=!0),this.radial=U,this},addParticleBounds:function(U,H,J,_,q,at,ot,rt){if(typeof U=="object"){var gt=U;U=gt.x,H=gt.y,J=M(gt,"w")?gt.w:gt.width,_=M(gt,"h")?gt.h:gt.height}return this.addParticleProcessor(new Q(U,H,J,_,q,at,ot,rt))},setParticleSpeed:function(U,H){return H===void 0&&(H=U),this.ops.speedX.onChange(U),U===H?this.ops.speedY.active=!1:this.ops.speedY.onChange(H),this.radial=!0,this},setParticleScale:function(U,H){return U===void 0&&(U=1),H===void 0&&(H=U),this.ops.scaleX.onChange(U),this.ops.scaleY.onChange(H),this},setParticleGravity:function(U,H){return this.gravityX=U,this.gravityY=H,this},setParticleAlpha:function(U){return this.ops.alpha.onChange(U),this},setParticleTint:function(U){return this.ops.tint.onChange(U),this},setEmitterAngle:function(U){return this.ops.angle.onChange(U),this},setParticleLifespan:function(U){return this.ops.lifespan.onChange(U),this},setQuantity:function(U){return this.quantity=U,this},setFrequency:function(U,H){return this.frequency=U,this.flowCounter=U>0?U:0,H&&(this.quantity=H),this},addDeathZone:function(U){Array.isArray(U)||(U=[U]);for(var H,J=[],_=0;_-1&&(this.zoneTotal++,this.zoneTotal===_.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===J&&(this.zoneIndex=0)))}},getDeathZone:function(U){for(var H=this.deathZones,J=0;J=0&&(this.zoneIndex=H),this},addParticleProcessor:function(U){return this.processors.exists(U)||(U.emitter&&U.emitter.removeParticleProcessor(U),this.processors.add(U),U.emitter=this),U},removeParticleProcessor:function(U){return this.processors.exists(U)&&(this.processors.remove(U,!0),U.emitter=null),U},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(U){return this.addParticleProcessor(new m(U))},reserve:function(U){var H=this.dead;if(this.maxParticles>0){var J=this.getParticleCount();J+U>this.maxParticles&&(U=this.maxParticles-(J+U))}for(var _=0;_0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(U,H){return U===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof U=="function"&&(this.emitCallback=U,H&&(this.emitCallbackScope=H)),this},onParticleDeath:function(U,H){return U===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof U=="function"&&(this.deathCallback=U,H&&(this.deathCallbackScope=H)),this},killAll:function(){for(var U=this.dead,H=this.alive;H.length>0;)U.push(H.pop());return this},forEachAlive:function(U,H){for(var J=this.alive,_=J.length,q=0;q<_;q++)U.call(H,J[q],this);return this},forEachDead:function(U,H){for(var J=this.dead,_=J.length,q=0;q<_;q++)U.call(H,J[q],this);return this},start:function(U,H){return U===void 0&&(U=0),this.emitting||(U>0&&this.fastForward(U),this.emitting=!0,this.resetCounters(this.frequency,!0),H!==void 0&&(this.duration=Math.abs(H)),this.emit(o.START,this)),this},stop:function(U){return U===void 0&&(U=!1),this.emitting&&(this.emitting=!1,U&&this.killAll(),this.emit(o.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(U,H){return U===void 0&&(U=""),H===void 0&&(H=this.true),this.sortProperty=U,this.sortOrderAsc=H,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(U){return this.sortProperty!==""?U=this.depthSortCallback:U=null,this.sortCallback=U,this},depthSort:function(){return G(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(U,H){var J=this.sortProperty;return this.sortOrderAsc?U[J]-H[J]:H[J]-U[J]},flow:function(U,H,J){return H===void 0&&(H=1),this.emitting=!1,this.frequency=U,this.quantity=H,J!==void 0&&(this.stopAfter=J),this.start()},explode:function(U,H,J){this.frequency=-1,this.resetCounters(-1,!0);var _=this.emitParticle(U,H,J);return this.emit(o.EXPLODE,this,_),_},emitParticleAt:function(U,H,J){return this.emitParticle(J,U,H)},emitParticle:function(U,H,J){if(!this.atLimit()){U===void 0&&(U=this.ops.quantity.onEmit());for(var _=this.dead,q=this.stopAfter,at=this.follow?this.follow.x+this.followOffset.x:H,ot=this.follow?this.follow.y+this.followOffset.y:J,rt=0;rt0&&(this.stopCounter++,this.stopCounter>=q)||this.atLimit())break}return gt}},fastForward:function(U,H){H===void 0&&(H=1e3/60);var J=0;for(this.skipping=!0;J0){var Et=this.deathCallback,At=this.deathCallbackScope;for(ot=gt-1;ot>=0;ot--){var Pt=rt[ot];q.splice(Pt.index,1),at.push(Pt.particle),Et&&Et.call(At,Pt.particle),Pt.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&q.length===0&&(this.completeFlag=0,this.emit(o.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=H;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=H,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(U){for(var H=this.getWorldTransformMatrix(),J=this.alive,_=J.length,q=[],at=0;at<_;at++){var ot=J[at];I(U,ot.getBounds(H))&&q.push(ot)}return q},getBounds:function(U,H,J,_){U===void 0&&(U=0),H===void 0&&(H=0),J===void 0&&(J=1e3/60),_===void 0&&(_=new O);var q=this.getWorldTransformMatrix(),at,ot,rt=this.alive,gt=!1;if(_.setTo(0,0,0,0),H>0){var yt=0;for(this.skipping=!0;yt0&&w(_,U,U),_},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(U){this.ops.x.onChange(U)}},particleY:{get:function(){return this.ops.y.current},set:function(U){this.ops.y.onChange(U)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(U){this.ops.accelerationX.onChange(U)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(U){this.ops.accelerationY.onChange(U)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(U){this.ops.maxVelocityX.onChange(U)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(U){this.ops.maxVelocityY.onChange(U)}},speed:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U),this.ops.speedY.onChange(U)}},speedX:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U)}},speedY:{get:function(){return this.ops.speedY.current},set:function(U){this.ops.speedY.onChange(U)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(U){this.ops.moveToX.onChange(U)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(U){this.ops.moveToY.onChange(U)}},bounce:{get:function(){return this.ops.bounce.current},set:function(U){this.ops.bounce.onChange(U)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(U){this.ops.scaleX.onChange(U)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(U){this.ops.scaleY.onChange(U)}},particleColor:{get:function(){return this.ops.color.current},set:function(U){this.ops.color.onChange(U)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(U){this.ops.color.setEase(U)}},particleTint:{get:function(){return this.ops.tint.current},set:function(U){this.ops.tint.onChange(U)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(U){this.ops.alpha.onChange(U)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(U){this.ops.lifespan.onChange(U)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(U){this.ops.angle.onChange(U)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(U){this.ops.rotate.onChange(U)}},quantity:{get:function(){return this.ops.quantity.current},set:function(U){this.ops.quantity.onChange(U)}},delay:{get:function(){return this.ops.delay.current},set:function(U){this.ops.delay.onChange(U)}},hold:{get:function(){return this.ops.hold.current},set:function(U){this.ops.hold.onChange(U)}},flowCounter:{get:function(){return this.counters[0]},set:function(U){this.counters[0]=U}},frameCounter:{get:function(){return this.counters[1]},set:function(U){this.counters[1]=U}},animCounter:{get:function(){return this.counters[2]},set:function(U){this.counters[2]=U}},elapsed:{get:function(){return this.counters[3]},set:function(U){this.counters[3]=U}},stopCounter:{get:function(){return this.counters[4]},set:function(U){this.counters[4]=U}},completeFlag:{get:function(){return this.counters[5]},set:function(U){this.counters[5]=U}},zoneIndex:{get:function(){return this.counters[6]},set:function(U){this.counters[6]=U}},zoneTotal:{get:function(){return this.counters[7]},set:function(U){this.counters[7]=U}},currentFrame:{get:function(){return this.counters[8]},set:function(U){this.counters[8]=U}},currentAnim:{get:function(){return this.counters[9]},set:function(U){this.counters[9]=U}},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 U,H=this.ops;for(U=0;U{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(59996),p=e(61340),h=new p,a=new p,l=new p,n=new p,u=function(f,o,c,d){var v=h,m=a,S=l,M=n;d?(M.loadIdentity(),M.multiply(d),M.translate(o.x,o.y),M.rotate(o.rotation),M.scale(o.scaleX,o.scaleY)):M.applyITRS(o.x,o.y,o.rotation,o.scaleX,o.scaleY);var w=f.currentContext,C=c.roundPixels,A=c.alpha,P=o.alpha,b=o.alive,O=b.length,I=o.viewBounds;if(!(!o.visible||O===0||I&&!r(I,c.worldView))){o.sortCallback&&o.depthSort(),c.addToRenderList(o);var D=o.scrollFactorX,B=o.scrollFactorY;w.save(),w.globalCompositeOperation=f.blendModes[o.blendMode];for(var G=0;G0&&Q.height>0){var tt=-j.halfWidth,Y=-j.halfHeight;w.globalAlpha=X,w.save(),m.setToContext(w),C&&(tt=Math.round(tt),Y=Math.round(Y)),w.imageSmoothingEnabled=!j.source.scaleMode,w.drawImage(j.source.image,Q.x,Q.y,Q.width,Q.height,tt,Y,Q.width,Q.height),w.restore()}}}w.restore()}};s.exports=u},92730:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(95540),l=e(31600);p.register("particles",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=a(n,"config",null),c=new l(this.scene,0,0,f);return u!==void 0&&(n.add=u),r(this.scene,c,n),o&&c.setConfig(o),c})},676:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(31600);r.register("particles",function(h,a,l,n){return h!==void 0&&typeof h=="string"&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new p(this.scene,h,a,l,n))})},90668:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(21188),h=e(9871),s.exports={renderWebGL:p,renderCanvas:h}},21188:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(59996),p=e(61340),h=e(70554),a=new p,l=new p,n=new p,u=new p,f=function(o,c,d,v){var m=o.pipelines.set(c.pipeline),S=a,M=l,w=n,C=u;v?(C.loadIdentity(),C.multiply(v),C.translate(c.x,c.y),C.rotate(c.rotation),C.scale(c.scaleX,c.scaleY)):C.applyITRS(c.x,c.y,c.rotation,c.scaleX,c.scaleY);var A=h.getTintAppendFloatAlpha,P=d.alpha,b=c.alpha;o.pipelines.preBatch(c);var O=c.alive,I=O.length,D=c.viewBounds;if(!(I===0||D&&!r(D,d.worldView))){c.sortCallback&&c.depthSort(),d.addToRenderList(c),S.copyFrom(d.matrix),S.multiplyWithOffset(C,-d.scrollX*c.scrollFactorX,-d.scrollY*c.scrollFactorY),o.setBlendMode(c.blendMode),c.mask&&(c.mask.preRenderWebGL(o,c,d),o.pipelines.set(c.pipeline));for(var B=c.tintFill,G,z,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){a===void 0&&(a=0),l===void 0&&(l=0),n===void 0&&(n=!0),this.emitter,this.x=a,this.y=l,this.active=n},update:function(){},destroy:function(){this.emitter=null}});s.exports=p},9774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},812:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="deathzone"},30522:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="explode"},96695:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},18677:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},20696:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(9774),DEATH_ZONE:e(812),EXPLODE:e(30522),START:e(96695),STOP:e(18677)}},18404:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={EmitterColorOp:e(76472),EmitterOp:e(44777),Events:e(20696),GravityWell:e(24502),Particle:e(56480),ParticleBounds:e(69601),ParticleEmitter:e(31600),ParticleProcessor:e(20286),Zones:e(21024)}},26388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.source=a,this.killOnEnter=l},willKill:function(h){var a=h.worldPosition,l=this.source.contains(a.x,a.y);return l&&this.killOnEnter||!l&&!this.killOnEnter}});s.exports=p},19909:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o){u===void 0&&(u=!1),f===void 0&&(f=!0),o===void 0&&(o=-1),this.source=a,this.points=[],this.quantity=l,this.stepRate=n,this.yoyo=u,this.counter=-1,this.seamless=f,this._length=0,this._direction=0,this.total=o,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var h=this.points[0],a=this.points[this.points.length-1];h.x===a.x&&h.y===a.y&&this.points.pop()}var l=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(h){return this.source=h,this.updateSource()},getPoint:function(h){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 a=this.points[this.counter];a&&(h.x=a.x,h.y=a.y)}});s.exports=p},68875:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l){this.source=l,this._tempVec=new p,this.total=-1},getPoint:function(a){var l=this._tempVec;this.source.getRandomPoint(l),a.x=l.x,a.y=l.y}});s.exports=h},21024:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DeathZone:e(26388),EdgeZone:e(19909),RandomZone:e(68875)}},1159:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(68287),a=new r({Extends:h,Mixins:[p.PathFollower],initialize:function(n,u,f,o,c,d){h.call(this,n,f,o,c,d),this.path=u},preUpdate:function(l,n){this.anims.update(l,n),this.pathUpdate(l)}});s.exports=a},90145:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(1159);r.register("follower",function(h,a,l,n,u){var f=new p(this.scene,h,a,l,n,u);return this.displayList.add(f),this.updateList.add(f),f})},33663:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(48803),a=e(90664),l=e(4703),n=e(45650),u=new p({Extends:l,initialize:function(o,c,d,v,m,S,M,w){v||(v="__DEFAULT"),l.call(this,o,c,d,v,m),this.type="Plane",this.anims=new r(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(S,M,w),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(f,o,c){f===void 0&&(f=8),o===void 0&&(o=8),c===void 0&&(c=!1);var d=!1;return c&&(d=!0),this.gridWidth=f,this.gridHeight=o,this.isTiled=c,this.clear(),h({mesh:this,widthSegments:f,heightSegments:o,isOrtho:!1,tile:c,flipY:d}),this},setSizeToFrame:function(f){f===void 0&&(f=!0);var o=this.frame;if(this.setPerspective(this.width/o.width,this.height/o.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!f)return this;var c=this.gridWidth,d=this.gridHeight,v=this.vertices,m=o.u0,S=o.u1,M=o.v0,w=o.v1,C,A,P=0;if(this.isTiled)for(M=o.v1,w=o.v0,A=0;A7&&C>7?M.push(m.r,m.g,m.b,c):M.push(S.r,S.g,S.b,d);var A=this.scene.sys.textures.addUint8Array(n(),new Uint8Array(M),16,16);return this.removeCheckerboard(),this.setTexture(A),this.setSizeToFrame(),this.setViewHeight(v),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(f,o){return this.anims.play(f,o)},playReverse:function(f,o){return this.anims.playReverse(f,o)},playAfterDelay:function(f,o){return this.anims.playAfterDelay(f,o)},playAfterRepeat:function(f,o){return this.anims.playAfterRepeat(f,o)},stop:function(){return this.anims.stop()},stopAfterDelay:function(f){return this.anims.stopAfterDelay(f)},stopAfterRepeat:function(f){return this.anims.stopAfterRepeat(f)},stopOnFrame:function(f){return this.anims.stopOnFrame(f)},preUpdate:function(f,o){l.prototype.preUpdate.call(this,f,o),this.anims.update(f,o)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});s.exports=u},56015:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(13059),h=e(44603),a=e(23568),l=e(35154),n=e(33663);h.register("plane",function(u,f){u===void 0&&(u={});var o=a(u,"key",null),c=a(u,"frame",null),d=l(u,"width",8),v=l(u,"height",8),m=l(u,"tile",!1),S=new n(this.scene,0,0,o,c,d,v,m);f!==void 0&&(u.add=f);var M=l(u,"checkerboard",null);if(M){var w=l(M,"color1",16777215),C=l(M,"color2",255),A=l(M,"alpha1",255),P=l(M,"alpha2",255),b=l(M,"height",128);S.createCheckerboard(w,C,A,P,b)}return r(this.scene,S,u),p(S,u),S})},30985:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33663),p=e(39429);p.register("plane",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},80321:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(30100),l=e(36060),n=e(67277),u=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible,n],initialize:function(o,c,d,v,m,S,M){v===void 0&&(v=16777215),m===void 0&&(m=128),S===void 0&&(S=1),M===void 0&&(M=.1),h.call(this,o,"PointLight"),this.initPipeline(l.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(c,d),this.color=a(v),this.intensity=S,this.attenuation=M,this.width=m*2,this.height=m*2,this._radius=m},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this.width=f*2,this.height=f*2}},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});s.exports=u},39829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(80321);p.register("pointlight",function(l,n){l===void 0&&(l={});var u=h(l,"color",16777215),f=h(l,"radius",128),o=h(l,"intensity",1),c=h(l,"attenuation",.1),d=new a(this.scene,0,0,u,f,o,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},71255:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(80321);r.register("pointlight",function(h,a,l,n,u,f){return this.displayList.add(new p(this.scene,h,a,l,n,u,f))})},67277:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(57787),s.exports={renderWebGL:p,renderCanvas:h}},57787:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){l.addToRenderList(a);var u=h.pipelines.set(a.pipeline),f=r(a,l,n).calc,o=a.width,c=a.height,d=-a._radius,v=-a._radius,m=d+o,S=v+c,M=f.getX(0,0),w=f.getY(0,0),C=f.getX(d,v),A=f.getY(d,v),P=f.getX(d,S),b=f.getY(d,S),O=f.getX(m,S),I=f.getY(m,S),D=f.getX(m,v),B=f.getY(m,v);h.pipelines.preBatch(a),u.batchPointLight(a,l,C,A,P,b,O,I,D,B,M,w),h.pipelines.postBatch(a)};s.exports=p},591:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(81320),h=e(88571),a=new r({Extends:h,initialize:function(n,u,f,o,c){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=32),c===void 0&&(c=32);var d=new p(n.sys.textures,"",o,c);h.call(this,n,u,f,d),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(l,n){this.width=l,this.height=n,this.texture.setSize(l,n),this.updateDisplayOrigin();var u=this.input;return u&&!u.customHitArea&&(u.hitArea.width=l,u.hitArea.height=n),this},resize:function(l,n){return this.setSize(l,n),this},saveTexture:function(l){var n=this.texture;return n.key=l,n.manager.addDynamicTexture(n)&&(this._saved=!0),n},fill:function(l,n,u,f,o,c){return this.texture.fill(l,n,u,f,o,c),this},clear:function(){return this.texture.clear(),this},stamp:function(l,n,u,f,o){return this.texture.stamp(l,n,u,f,o),this},erase:function(l,n,u){return this.texture.erase(l,n,u),this},draw:function(l,n,u,f,o){return this.texture.draw(l,n,u,f,o),this},drawFrame:function(l,n,u,f,o,c){return this.texture.drawFrame(l,n,u,f,o,c),this},repeat:function(l,n,u,f,o,c,d,v,m){return this.texture.repeat(l,n,u,f,o,c,d,v,m),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(l,n,u,f,o){return this.texture.batchDraw(l,n,u,f,o),this},batchDrawFrame:function(l,n,u,f,o,c){return this.texture.batchDrawFrame(l,n,u,f,o,c),this},endDraw:function(l){return this.texture.endDraw(l),this},snapshotArea:function(l,n,u,f,o,c,d){return this.texture.snapshotArea(l,n,u,f,o,c,d),this},snapshot:function(l,n,u){return this.snapshotArea(0,0,this.width,this.height,l,n,u)},snapshotPixel:function(l,n,u){return this.snapshotArea(l,n,1,1,u,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});s.exports=a},34495:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(591);p.register("renderTexture",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),o=h(l,"width",32),c=h(l,"height",32),d=new a(this.scene,u,f,o,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},60505:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(591);r.register("renderTexture",function(h,a,l,n){return this.displayList.add(new p(this.scene,h,a,l,n))})},77757:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31401),a=e(95643),l=e(36060),n=e(38745),u=e(26099),f=new p({Extends:a,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Flip,h.Mask,h.Pipeline,h.PostPipeline,h.Size,h.Texture,h.Transform,h.Visible,h.ScrollFactor,n],initialize:function(c,d,v,m,S,M,w,C,A){m===void 0&&(m="__DEFAULT"),M===void 0&&(M=2),w===void 0&&(w=!0),a.call(this,c,"Rope"),this.anims=new r(this),this.points=M,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=m==="__DEFAULT",this.dirty=!1,this.horizontal=w,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(m,S),this.setPosition(d,v),this.setSizeToFrame(),this.initPipeline(l.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(M)&&this.resizeArrays(M.length),this.setPoints(M,C,A),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(o,c){var d=this.anims.currentFrame;this.anims.update(o,c),this.anims.currentFrame!==d&&(this.updateUVs(),this.updateVertices())},play:function(o,c,d){return this.anims.play(o,c,d),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(o,c,d){return o===void 0&&(o=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(o,c,d))},setVertical:function(o,c,d){return o===void 0&&(o=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(o,c,d)):this},setTintFill:function(o){return o===void 0&&(o=!1),this.tintFill=o,this},setAlphas:function(o,c){var d=this.points.length;if(d<1)return this;var v=this.alphas;o===void 0?o=[1]:!Array.isArray(o)&&c===void 0&&(o=[o]);var m,S=0;if(c!==void 0)for(m=0;mS&&(M=o[S]),v[S]=M,o.length>S+1&&(M=o[S+1]),v[S+1]=M}return this},setColors:function(o){var c=this.points.length;if(c<1)return this;var d=this.colors;o===void 0?o=[16777215]:Array.isArray(o)||(o=[o]);var v,m=0;if(o.length===c)for(v=0;vm&&(S=o[m]),d[m]=S,o.length>m+1&&(S=o[m+1]),d[m+1]=S}return this},setPoints:function(o,c,d){if(o===void 0&&(o=2),typeof o=="number"){var v=o;v<2&&(v=2),o=[];var m,S,M;if(this.horizontal)for(M=-this.frame.halfWidth,S=this.frame.width/(v-1),m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},26209:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(77757);p.register("rope",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=h(n,"horizontal",!0),d=a(n,"points",void 0),v=a(n,"colors",void 0),m=a(n,"alphas",void 0),S=new l(this.scene,0,0,f,o,d,c,v,m);return u!==void 0&&(n.add=u),r(this.scene,S,n),S})},96819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(77757),p=e(39429);p.register("rope",function(h,a,l,n,u,f,o,c){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c))})},38745:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(20439),h=e(95262),s.exports={renderWebGL:p,renderCanvas:h}},20439:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline,l),o=r(l,n,u).calc,c=l.vertices,d=l.uv,v=l.colors,m=l.alphas,S=l.alpha,M=p.getTintAppendFloatAlpha,w=n.roundPixels,C=c.length,A=Math.floor(C*.5);f.flush(),a.pipelines.preBatch(l);var P=f.setGameObject(l),b=f.vertexViewF32,O=f.vertexViewU32,I=f.vertexCount*f.currentShader.vertexComponentCount-1,D=0,B=l.tintFill;l.dirty&&l.updateVertices();for(var G=l.debugCallback,z=[],X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(95540),l=e(79291),n=e(61622),u=e(25479),f=e(61340),o=e(95428),c=e(92503),d=new r({Extends:h,Mixins:[p.ComputedSize,p.Depth,p.GetBounds,p.Mask,p.Origin,p.ScrollFactor,p.Transform,p.Visible,u],initialize:function(m,S,M,w,C,A,P,b){M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=128),A===void 0&&(A=128),h.call(this,m,"Shader"),this.blendMode=-1,this.shader;var O=m.sys.renderer;this.renderer=O,this.gl=O.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=O.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 f,this._tempMatrix2=new f,this._tempMatrix3=new f,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=O.width,this._rendererHeight=O.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(M,w),this.setSize(C,A),this.setOrigin(.5,.5),this.setShader(S,P,b),this.renderer.on(c.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(v){return this.renderToTexture?!0:!(h.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&v.id)},setRenderToTexture:function(v,m){if(!this.renderToTexture){var S=this.width,M=this.height,w=this.renderer;this.glTexture=w.createTextureFromSource(null,S,M,0),this.framebuffer=w.createFramebuffer(S,M,this.glTexture,!1),this._rendererWidth=S,this._rendererHeight=M,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),v&&(this.texture=this.scene.sys.textures.addGLTexture(v,this.glTexture))}return this.shader&&(w.pipelines.clear(),this.load(),this.flush(),w.pipelines.rebind()),this},setShader:function(v,m,S){if(this.renderer.contextLost)return this._deferSetShader={key:v,textures:m,textureData:S},this;if(m===void 0&&(m=[]),typeof v=="string"){var M=this.scene.sys.cache.shader;if(!M.has(v))return console.warn("Shader missing: "+v),this;this.shader=M.get(v)}else this.shader=v;var w=this.gl,C=this.renderer;this.program&&C.deleteProgram(this.program);var A=C.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);w.uniformMatrix4fv(w.getUniformLocation(A.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),w.uniformMatrix4fv(w.getUniformLocation(A.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),w.uniform2f(w.getUniformLocation(A.webGLProgram,"uResolution"),this.width,this.height),this.program=A;var P=new Date,b={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:[P.getFullYear(),P.getMonth(),P.getDate(),P.getHours()*60*60+P.getMinutes()*60+P.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=l(!0,{},this.shader.uniforms,b):this.uniforms=b;for(var O=0;O<4;O++)m[O]&&this.setSampler2D("iChannel"+O,m[O],O,S);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(v){return this.pointer=v,this},projOrtho:function(v,m,S,M){if(this.renderer.contextLost){this._deferProjOrtho={left:v,right:m,bottom:S,top:M};return}var w=-1e3,C=1e3,A=1/(v-m),P=1/(S-M),b=1/(w-C),O=this.projectionMatrix;O[0]=-2*A,O[5]=-2*P,O[10]=2*b,O[12]=(v+m)*A,O[13]=(M+S)*P,O[14]=(C+w)*b;var I=this.program,D=this.gl,B=this.renderer;B.setProgram(I),D.uniformMatrix4fv(D.getUniformLocation(I.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=m,this._rendererHeight=S},initUniforms:function(){var v=this.renderer.glFuncMap,m=this.program;this._textureCount=0;for(var S in this.uniforms){var M=this.uniforms[S],w=M.type,C=v[w];M.uniformLocation=this.renderer.createUniformLocation(m,S),w!=="sampler2D"&&(M.glMatrix=C.matrix,M.glValueLength=C.length,M.glFunc=C.func)}},setSampler2DBuffer:function(v,m,S,M,w,C){w===void 0&&(w=0),C===void 0&&(C={});var A=this.uniforms[v];return A.value=m,C.width=S,C.height=M,A.textureData=C,this._textureCount=w,this.initSampler2D(A),this},setSampler2D:function(v,m,S,M){S===void 0&&(S=0);var w=this.scene.sys.textures;if(w.exists(m)){var C=w.getFrame(m);if(C.glTexture&&C.glTexture.isRenderTexture)return this.setSampler2DBuffer(v,C.glTexture,C.width,C.height,S,M);var A=this.uniforms[v],P=C.source;A.textureKey=m,A.source=P.image,A.value=C.glTexture,P.isGLTexture&&(M||(M={}),M.width=P.width,M.height=P.height),M&&(A.textureData=M),this._textureCount=S,this.initSampler2D(A)}return this},setUniform:function(v,m){return n(this.uniforms,v,m),this},getUniform:function(v){return a(this.uniforms,v,null)},setChannel0:function(v,m){return this.setSampler2D("iChannel0",v,0,m)},setChannel1:function(v,m){return this.setSampler2D("iChannel1",v,1,m)},setChannel2:function(v,m){return this.setSampler2D("iChannel2",v,2,m)},setChannel3:function(v,m){return this.setSampler2D("iChannel3",v,3,m)},initSampler2D:function(v){if(v.value){var m=v.textureData;if(m&&!v.value.isRenderTexture){var S=this.gl,M=v.value,w=S[a(m,"magFilter","linear").toUpperCase()],C=S[a(m,"minFilter","linear").toUpperCase()],A=S[a(m,"wrapS","repeat").toUpperCase()],P=S[a(m,"wrapT","repeat").toUpperCase()],b=S[a(m,"format","rgba").toUpperCase()],O=a(m,"flipY",!1),I=a(m,"width",M.width),D=a(m,"height",M.height),B=a(m,"source",M.pixels);m.repeat&&(A=S.REPEAT,P=S.REPEAT),m.width&&(B=null),M.update(B,I,D,O,A,P,C,w,b)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var v=this.gl,m=this.uniforms,S,M,w,C,A,P=0;for(var b in m)S=m[b],w=S.glFunc,M=S.glValueLength,C=S.uniformLocation,A=S.value,A!==null&&(M===1?S.glMatrix?w.call(v,C.webGLUniformLocation,S.transpose,A):w.call(v,C.webGLUniformLocation,A):M===2?w.call(v,C.webGLUniformLocation,A.x,A.y):M===3?w.call(v,C.webGLUniformLocation,A.x,A.y,A.z):M===4?w.call(v,C.webGLUniformLocation,A.x,A.y,A.z,A.w):S.type==="sampler2D"&&(v.activeTexture(v.TEXTURE0+P),v.bindTexture(v.TEXTURE_2D,A.webGLTexture),v.uniform1i(C.webGLUniformLocation,P),P++))},load:function(v){var m=this.gl,S=this.width,M=this.height,w=this.renderer,C=this.program,A=this.viewMatrix;if(!this.renderToTexture){var P=-this._displayOriginX,b=-this._displayOriginY;A[0]=v[0],A[1]=v[1],A[4]=v[2],A[5]=v[3],A[8]=v[4],A[9]=v[5],A[12]=A[0]*P+A[4]*b,A[13]=A[1]*P+A[5]*b}m.useProgram(C.webGLProgram),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uViewMatrix"),!1,A),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),m.uniform2f(m.getUniformLocation(C.webGLProgram,"uResolution"),this.width,this.height);var O=this.uniforms,I=O.resolution;I.value.x=S,I.value.y=M,O.time.value=w.game.loop.getDuration();var D=this.pointer;if(D){var B=O.mouse,G=D.x/S,z=1-D.y/M;B.value.x=G.toFixed(2),B.value.y=z.toFixed(2)}this.syncUniforms()},flush:function(){var v=this.width,m=this.height,S=this.program,M=this.gl,w=this.vertexBuffer,C=this.renderer,A=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(C.setFramebuffer(this.framebuffer),M.clearColor(0,0,0,0),M.clear(M.COLOR_BUFFER_BIT)),M.bindBuffer(M.ARRAY_BUFFER,w.webGLBuffer);var P=M.getAttribLocation(S.webGLProgram,"inPosition");P!==-1&&(M.enableVertexAttribArray(P),M.vertexAttribPointer(P,2,M.FLOAT,!1,A,0));var b=this.vertexViewF32;b[3]=m,b[4]=v,b[5]=m,b[8]=v,b[9]=m,b[10]=v;var O=6;M.bufferSubData(M.ARRAY_BUFFER,0,this.bytes.subarray(0,O*A)),M.drawArrays(M.TRIANGLES,0,O),this.renderToTexture&&C.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var v=this._deferSetShader.key,m=this._deferSetShader.textures,S=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(v,m,S)}if(this._deferProjOrtho!==null){var M=this._deferProjOrtho.left,w=this._deferProjOrtho.right,C=this._deferProjOrtho.bottom,A=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(M,w,C,A)}},preDestroy:function(){var v=this.renderer;v.off(c.RESTORE_WEBGL,this.onContextRestored,this),v.deleteProgram(this.program),v.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(v.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),o(this.uniforms,function(m){v.deleteUniformLocation(m.uniformLocation),m.uniformLocation=null})}});s.exports=d},80464:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},54935:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(20071);p.register("shader",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"x",0),o=h(l,"y",0),c=h(l,"width",128),d=h(l,"height",128),v=new a(this.scene,u,f,o,c,d);return n!==void 0&&(l.add=n),r(this.scene,v,l),v})},74177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20071),p=e(39429);p.register("shader",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},25479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(19257),h=e(80464),s.exports={renderWebGL:p,renderCanvas:h}},19257:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){if(a.shader){if(l.addToRenderList(a),h.pipelines.clear(),a.renderToTexture)a.load(),a.flush();else{var u=r(a,l,n).calc;(h.width!==a._rendererWidth||h.height!==a._rendererHeight)&&a.projOrtho(0,h.width,h.height,0),a.load(u.matrix),a.flush()}h.pipelines.rebind()}};s.exports=p},10441:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n,u,f){for(var o=r.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*n),c=l.pathData,d=l.pathIndexes,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=p||r.fillColor,l=h||r.fillAlpha,n=(a&16711680)>>>16,u=(a&65280)>>>8,f=a&255;e.fillStyle="rgba("+n+","+u+","+f+","+l+")"};s.exports=y},75177:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=p||r.strokeColor,l=h||r.strokeAlpha,n=(a&16711680)>>>16,u=(a&65280)>>>8,f=a&255;e.strokeStyle="rgba("+n+","+u+","+f+","+l+")",e.lineWidth=r.lineWidth};s.exports=y},17803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(23031),l=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible],initialize:function(u,f,o){f===void 0&&(f="Shape"),h.call(this,u,f),this.geom=o,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 a,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(n,u){return u===void 0&&(u=1),n===void 0?this.isFilled=!1:(this.fillColor=n,this.fillAlpha=u,this.isFilled=!0),this},setStrokeStyle:function(n,u,f){return f===void 0&&(f=1),n===void 0?this.isStroked=!1:(this.lineWidth=n,this.strokeColor=u,this.strokeAlpha=f,this.isStroked=!0),this},setClosePath:function(n){return this.closePath=n,this},setSize:function(n,u){return this.width=n,this.height=u,this},setDisplaySize:function(n,u){return this.displayWidth=n,this.displayHeight=u,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(n){this.scaleX=n/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(n){this.scaleY=n/this.height}}});s.exports=l},34682:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n,u){var f=h.strokeTint,o=r.getTintAppendFloatAlpha(a.strokeColor,a.strokeAlpha*l);f.TL=o,f.TR=o,f.BL=o,f.BR=o;var c=a.pathData,d=c.length-1,v=a.lineWidth,m=v/2,S=c[0]-n,M=c[1]-u;a.closePath||(d-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13609),p=e(83419),h=e(39506),a=e(94811),l=e(96503),n=e(36383),u=e(17803),f=new p({Extends:u,Mixins:[r],initialize:function(c,d,v,m,S,M,w,C,A){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=0),M===void 0&&(M=360),w===void 0&&(w=!1),u.call(this,c,"Arc",new l(0,0,m)),this._startAngle=S,this._endAngle=M,this._anticlockwise=w,this._iterations=.01,this.setPosition(d,v);var P=this.geom.radius*2;this.setSize(P,P),C!==void 0&&this.setFillStyle(C,A),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(o){this._iterations=o,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(o){this.geom.radius=o;var c=o*2;this.setSize(c,c),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(o){this._startAngle=o,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(o){this._endAngle=o,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(o){this._anticlockwise=o,this.updateData()}},setRadius:function(o){return this.radius=o,this},setIterations:function(o){return o===void 0&&(o=.01),this.iterations=o,this},setStartAngle:function(o,c){return this._startAngle=o,c!==void 0&&(this._anticlockwise=c),this.updateData()},setEndAngle:function(o,c){return this._endAngle=o,c!==void 0&&(this._anticlockwise=c),this.updateData()},updateData:function(){var o=this._iterations,c=o,d=this.geom.radius,v=h(this._startAngle),m=h(this._endAngle),S=this._anticlockwise,M=d,w=d;m-=v,S?m<-n.PI2?m=-n.PI2:m>0&&(m=-n.PI2+m%n.PI2):m>n.PI2?m=n.PI2:m<0&&(m=n.PI2+m%n.PI2);for(var C=[M+Math.cos(v)*d,w+Math.sin(v)*d],A;c<1;)A=m*c+v,C.push(M+Math.cos(A)*d,w+Math.sin(A)*d),c+=o;return A=m+v,C.push(M+Math.cos(A)*d,w+Math.sin(A)*d),C.push(M+Math.cos(v)*d,w+Math.sin(v)*d),this.pathIndexes=a(C),this.pathData=C,this}});s.exports=f},42542:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39506),p=e(65960),h=e(75177),a=e(20926),l=function(n,u,f,o){f.addToRenderList(u);var c=n.currentContext;if(a(n,c,u,f,o)){var d=u.radius;c.beginPath(),c.arc(d-u.originX*(d*2),d-u.originY*(d*2),d,r(u._startAngle),r(u._endAngle),u.anticlockwise),u.closePath&&c.closePath(),u.isFilled&&(p(c,u),c.fill()),u.isStroked&&(h(c,u),c.stroke()),c.restore()}};s.exports=l},42563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23629),p=e(39429);p.register("arc",function(h,a,l,n,u,f,o,c){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c))}),p.register("circle",function(h,a,l,n,u){return this.displayList.add(new r(this.scene,h,a,l,0,360,!1,n,u))})},13609:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(41447),h=e(42542),s.exports={renderWebGL:p,renderCanvas:h}},41447:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(10441),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&p(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},89:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(33141),h=e(94811),a=e(87841),l=e(17803),n=new r({Extends:l,Mixins:[p],initialize:function(f,o,c,d,v,m){o===void 0&&(o=0),c===void 0&&(c=0),l.call(this,f,"Curve",d),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(o,c),v!==void 0&&this.setFillStyle(v,m),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){var u=this._curveBounds,f=this._smoothness;this.geom.getBounds(u,f),this.setSize(u.width,u.height),this.updateDisplayOrigin();for(var o=[],c=this.geom.getPoints(f),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX+n._curveBounds.x,d=n._displayOriginY+n._curveBounds.y,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(89);r.register("curve",function(h,a,l,n,u){return this.displayList.add(new p(this.scene,h,a,l,n,u))})},33141:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(53987),h=e(3170),s.exports={renderWebGL:p,renderCanvas:h}},53987:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX+n._curveBounds.x,m=n._displayOriginY+n._curveBounds.y,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},19921:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94811),h=e(54205),a=e(8497),l=e(17803),n=new r({Extends:l,Mixins:[h],initialize:function(f,o,c,d,v,m,S){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=128),l.call(this,f,"Ellipse",new a(d/2,v/2,d,v)),this._smoothness=64,this.setPosition(o,c),this.width=d,this.height=v,m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSize:function(u,f){return this.width=u,this.height=f,this.geom.setPosition(u/2,f/2),this.geom.setSize(u,f),this.updateData()},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){for(var u=[],f=this.geom.getPoints(this._smoothness),o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19921),p=e(39429);p.register("ellipse",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},54205:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(19467),h=e(7930),s.exports={renderWebGL:p,renderCanvas:h}},19467:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},30479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(26015),a=new r({Extends:p,Mixins:[h],initialize:function(n,u,f,o,c,d,v,m,S,M,w){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=128),c===void 0&&(c=128),d===void 0&&(d=32),v===void 0&&(v=32),p.call(this,n,"Grid",null),this.cellWidth=d,this.cellHeight=v,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(u,f),this.setSize(o,c),this.setFillStyle(m,S),M!==void 0&&this.setOutlineStyle(M,w),this.updateDisplayOrigin()},setFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showCells=!1:(this.fillColor=l,this.fillAlpha=n,this.showCells=!0),this},setAltFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showAltCells=!1:(this.altFillColor=l,this.altFillAlpha=n,this.showAltCells=!0),this},setOutlineStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showOutline=!1:(this.outlineFillColor=l,this.outlineFillAlpha=n,this.showOutline=!0),this}});s.exports=a},49912:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=-n._displayOriginX,d=-n._displayOriginY,v=u.alpha*n.alpha,m=n.width,S=n.height,M=n.cellWidth,w=n.cellHeight,C=Math.ceil(m/M),A=Math.ceil(S/w),P=M,b=w,O=M-(C*M-m),I=w-(A*w-S),D=n.showCells,B=n.showAltCells,G=n.showOutline,z=0,X=0,j=0,Q=0,tt=0;if(G&&(P--,b--,O===M&&O--,I===w&&I--),D&&n.fillAlpha>0)for(r(o,n),X=0;X0)for(r(o,n,n.altFillColor,n.altFillAlpha*v),X=0;X0){for(p(o,n,n.outlineFillColor,n.outlineFillAlpha*v),z=1;z{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(30479);r.register("grid",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c,d,v))})},26015:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(46161),h=e(49912),s.exports={renderWebGL:p,renderCanvas:h}},46161:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc);c.translate(-l._displayOriginX,-l._displayOriginY);var d=n.alpha*l.alpha,v=l.width,m=l.height,S=l.cellWidth,M=l.cellHeight,w=Math.ceil(v/S),C=Math.ceil(m/M),A=S,P=M,b=S-(w*S-v),O=M-(C*M-m),I,D,B=l.showCells,G=l.showAltCells,z=l.showOutline,X=0,j=0,Q=0,tt=0,Y=0;if(z&&(A--,P--,b===S&&b--,O===M&&O--),a.pipelines.preBatch(l),B&&l.fillAlpha>0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,j=0;j0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.altFillColor,l.altFillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,j=0;j0){var Z=f.strokeTint,U=p.getTintAppendFloatAlpha(l.outlineFillColor,l.outlineFillAlpha*d);for(Z.TL=U,Z.TR=U,Z.BL=U,Z.BR=U,X=1;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99651),p=e(83419),h=e(17803),a=new p({Extends:h,Mixins:[r],initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=48),c===void 0&&(c=32),d===void 0&&(d=15658734),v===void 0&&(v=10066329),m===void 0&&(m=13421772),h.call(this,n,"IsoBox",null),this.projection=4,this.fillTop=d,this.fillLeft=v,this.fillRight=m,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(u,f),this.setSize(o,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});s.exports=a},11508:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)&&l.isFilled){var o=l.width,c=l.height,d=o/2,v=o/l.projection;l.showTop&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(d,-1),f.lineTo(0,v-1),f.lineTo(-d,-1),f.lineTo(-d,-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(-d,-c),f.lineTo(-d,0),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(d,-c),f.lineTo(d,0),f.fill()),f.restore()}};s.exports=h},3933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(61475);r.register("isobox",function(h,a,l,n,u,f,o){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o))})},99651:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(68149),h=e(11508),s.exports={renderWebGL:p,renderCanvas:h}},68149:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=n.alpha*l.alpha;if(l.isFilled){var w,C,A,P,b,O,I,D,B;a.pipelines.preBatch(l),l.showTop&&(w=p.getTintAppendFloatAlpha(l.fillTop,M),C=c.getX(-m,-v),A=c.getY(-m,-v),P=c.getX(0,-S-v),b=c.getY(0,-S-v),O=c.getX(m,-v),I=c.getY(m,-v),D=c.getX(0,S-v),B=c.getY(0,S-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),l.showLeft&&(w=p.getTintAppendFloatAlpha(l.fillLeft,M),C=c.getX(-m,0),A=c.getY(-m,0),P=c.getX(0,S),b=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(-m,-v),B=c.getY(-m,-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),l.showRight&&(w=p.getTintAppendFloatAlpha(l.fillRight,M),C=c.getX(m,0),A=c.getY(m,0),P=c.getX(0,S),b=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(m,-v),B=c.getY(m,-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),a.pipelines.postBatch(l)}};s.exports=h},16933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(60561),h=e(17803),a=new r({Extends:h,Mixins:[p],initialize:function(n,u,f,o,c,d,v,m,S){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=48),c===void 0&&(c=32),d===void 0&&(d=!1),v===void 0&&(v=15658734),m===void 0&&(m=10066329),S===void 0&&(S=13421772),h.call(this,n,"IsoTriangle",null),this.projection=4,this.fillTop=v,this.fillLeft=m,this.fillRight=S,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=d,this.isFilled=!0,this.setPosition(u,f),this.setSize(o,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setReversed:function(l){return this.isReversed=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});s.exports=a},79590:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)&&l.isFilled){var o=l.width,c=l.height,d=o/2,v=o/l.projection,m=l.isReversed;l.showTop&&m&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(0,v-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),m?(f.moveTo(-d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),m?(f.moveTo(d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),f.restore()}};s.exports=h},49803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(16933);r.register("isotriangle",function(h,a,l,n,u,f,o,c){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c))})},60561:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(51503),h=e(79590),s.exports={renderWebGL:p,renderCanvas:h}},51503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=l.isReversed,w=n.alpha*l.alpha;if(l.isFilled){a.pipelines.preBatch(l);var C,A,P,b,O,I,D;if(l.showTop&&M){C=p.getTintAppendFloatAlpha(l.fillTop,w),A=c.getX(-m,-v),P=c.getY(-m,-v),b=c.getX(0,-S-v),O=c.getY(0,-S-v),I=c.getX(m,-v),D=c.getY(m,-v);var B=c.getX(0,S-v),G=c.getY(0,S-v);f.batchQuad(l,A,P,b,O,I,D,B,G,0,0,1,1,C,C,C,C,2)}l.showLeft&&(C=p.getTintAppendFloatAlpha(l.fillLeft,w),M?(A=c.getX(-m,-v),P=c.getY(-m,-v),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(A=c.getX(-m,0),P=c.getY(-m,0),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,A,P,b,O,I,D,0,0,1,1,C,C,C,2)),l.showRight&&(C=p.getTintAppendFloatAlpha(l.fillRight,w),M?(A=c.getX(m,-v),P=c.getY(m,-v),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(A=c.getX(m,0),P=c.getY(m,0),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,A,P,b,O,I,D,0,0,1,1,C,C,C,2)),a.pipelines.postBatch(l)}};s.exports=h},57847:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(23031),a=e(36823),l=new r({Extends:p,Mixins:[a],initialize:function(u,f,o,c,d,v,m,S,M){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=128),m===void 0&&(m=0),p.call(this,u,"Line",new h(c,d,v,m));var w=Math.max(1,this.geom.right-this.geom.left),C=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(f,o),this.setSize(w,C),S!==void 0&&this.setStrokeStyle(1,S,M),this.updateDisplayOrigin()},setLineWidth:function(n,u){return u===void 0&&(u=n),this._startWidth=n,this._endWidth=u,this.lineWidth=n,this},setTo:function(n,u,f,o){return this.geom.setTo(n,u,f,o),this}});s.exports=l},17440:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(75177),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)){var o=l._displayOriginX,c=l._displayOriginY;l.isStroked&&(r(f,l),f.beginPath(),f.moveTo(l.geom.x1-o,l.geom.y1-c),f.lineTo(l.geom.x2-o,l.geom.y2-c),f.stroke()),f.restore()}};s.exports=h},2481:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(57847);r.register("line",function(h,a,l,n,u,f,o,c){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c))})},36823:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(77385),h=e(17440),s.exports={renderWebGL:p,renderCanvas:h}},77385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u);f.calcMatrix.copyFrom(o.calc);var c=l._displayOriginX,d=l._displayOriginY,v=n.alpha*l.alpha;if(a.pipelines.preBatch(l),l.isStroked){var m=f.strokeTint,S=p.getTintAppendFloatAlpha(l.strokeColor,l.strokeAlpha*v);m.TL=S,m.TR=S,m.BL=S,m.BR=S,f.batchLine(l.geom.x1-c,l.geom.y1-d,l.geom.x2-c,l.geom.y2-d,l._startWidth/2,l._endWidth/2,1,0,!1,o.sprite,o.camera)}a.pipelines.postBatch(l)};s.exports=h},24949:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90273),p=e(83419),h=e(94811),a=e(13829),l=e(25717),n=e(17803),u=e(5469),f=new p({Extends:n,Mixins:[r],initialize:function(c,d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),n.call(this,c,"Polygon",new l(m));var w=a(this.geom);this.setPosition(d,v),this.setSize(w.width,w.height),S!==void 0&&this.setFillStyle(S,M),this.updateDisplayOrigin(),this.updateData()},smooth:function(o){o===void 0&&(o=1);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(24949);r.register("polygon",function(h,a,l,n,u){return this.displayList.add(new p(this.scene,h,a,l,n,u))})},90273:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(73695),h=e(38710),s.exports={renderWebGL:p,renderCanvas:h}},73695:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},74561:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87841),h=e(17803),a=e(95597),l=new r({Extends:h,Mixins:[a],initialize:function(u,f,o,c,d,v,m){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=128),d===void 0&&(d=128),h.call(this,u,"Rectangle",new p(0,0,c,d)),this.setPosition(f,o),this.setSize(c,d),v!==void 0&&this.setFillStyle(v,m),this.updateDisplayOrigin(),this.updateData()},setSize:function(n,u){this.width=n,this.height=u,this.geom.setSize(n,u),this.updateData(),this.updateDisplayOrigin();var f=this.input;return f&&!f.customHitArea&&(f.hitArea.width=n,f.hitArea.height=u),this},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),u.getLineD(f),n.push(f.x2,f.y2),this.pathData=n,this}});s.exports=l},48682:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY;n.isFilled&&(r(o,n),o.fillRect(-c,-d,n.width,n.height)),n.isStroked&&(p(o,n),o.beginPath(),o.rect(-c,-d,n.width,n.height),o.stroke()),o.restore()}};s.exports=a},87959:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(74561);r.register("rectangle",function(h,a,l,n,u,f){return this.displayList.add(new p(this.scene,h,a,l,n,u,f))})},95597:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(52059),h=e(48682),s.exports={renderWebGL:p,renderCanvas:h}},52059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(34682),h=e(70554),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f);o.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=o.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M,o.batchFillRect(-d,-v,n.width,n.height)}n.isStroked&&p(o,n,m,d,v),l.pipelines.postBatch(n)};s.exports=a},55911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81991),p=e(83419),h=e(94811),a=e(17803),l=new p({Extends:a,Mixins:[r],initialize:function(u,f,o,c,d,v,m,S){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=5),d===void 0&&(d=32),v===void 0&&(v=64),a.call(this,u,"Star",null),this._points=c,this._innerRadius=d,this._outerRadius=v,this.setPosition(f,o),this.setSize(v*2,v*2),m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},setPoints:function(n){return this._points=n,this.updateData()},setInnerRadius:function(n){return this._innerRadius=n,this.updateData()},setOuterRadius:function(n){return this._outerRadius=n,this.updateData()},points:{get:function(){return this._points},set:function(n){this._points=n,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this.updateData()}},updateData:function(){var n=[],u=this._points,f=this._innerRadius,o=this._outerRadius,c=Math.PI/2*3,d=Math.PI/u,v=o,m=o;n.push(v,m+-o);for(var S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55911),p=e(39429);p.register("star",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},81991:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(57017),h=e(64272),s.exports={renderWebGL:p,renderCanvas:h}},57017:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},36931:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(16483),a=e(96195),l=new r({Extends:p,Mixins:[a],initialize:function(u,f,o,c,d,v,m,S,M,w,C){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=64),m===void 0&&(m=0),S===void 0&&(S=128),M===void 0&&(M=128),p.call(this,u,"Triangle",new h(c,d,v,m,S,M));var A=this.geom.right-this.geom.left,P=this.geom.bottom-this.geom.top;this.setPosition(f,o),this.setSize(A,P),w!==void 0&&this.setFillStyle(w,C),this.updateDisplayOrigin(),this.updateData()},setTo:function(n,u,f,o,c,d){return this.geom.setTo(n,u,f,o,c,d),this.updateData()},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),this.pathData=n,this}});s.exports=l},85172:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.geom.x1-c,m=n.geom.y1-d,S=n.geom.x2-c,M=n.geom.y2-d,w=n.geom.x3-c,C=n.geom.y3-d;o.beginPath(),o.moveTo(v,m),o.lineTo(S,M),o.lineTo(w,C),o.closePath(),n.isFilled&&(r(o,n),o.fill()),n.isStroked&&(p(o,n),o.stroke()),o.restore()}};s.exports=a},45245:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(36931);r.register("triangle",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c,d,v))})},96195:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(83253),h=e(85172),s.exports={renderWebGL:p,renderCanvas:h}},83253:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(34682),h=e(70554),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f);o.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=o.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M;var w=n.geom.x1-d,C=n.geom.y1-v,A=n.geom.x2-d,P=n.geom.y2-v,b=n.geom.x3-d,O=n.geom.y3-v;o.batchFillTriangle(w,C,A,P,b,O,c.sprite,c.camera)}n.isStroked&&p(o,n,m,d,v),l.pipelines.postBatch(n)};s.exports=a},68287:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31401),a=e(95643),l=e(92751),n=new p({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Size,h.TextureCrop,h.Tint,h.Transform,h.Visible,l],initialize:function(f,o,c,d,v){a.call(this,f,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(d,v),this.setPosition(o,c),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(u,f){this.anims.update(u,f)},play:function(u,f){return this.anims.play(u,f)},playReverse:function(u,f){return this.anims.playReverse(u,f)},playAfterDelay:function(u,f){return this.anims.playAfterDelay(u,f)},playAfterRepeat:function(u,f){return this.anims.playAfterRepeat(u,f)},chain:function(u){return this.anims.chain(u)},stop:function(){return this.anims.stop()},stopAfterDelay:function(u){return this.anims.stopAfterDelay(u)},stopAfterRepeat:function(u){return this.anims.stopAfterRepeat(u)},stopOnFrame:function(u){return this.anims.stopOnFrame(u)},toJSON:function(){return h.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});s.exports=n},76552:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},15567:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(13059),h=e(44603),a=e(23568),l=e(68287);h.register("sprite",function(n,u){n===void 0&&(n={});var f=a(n,"key",null),o=a(n,"frame",null),c=new l(this.scene,0,0,f,o);return u!==void 0&&(n.add=u),r(this.scene,c,n),p(c,n),c})},46409:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(68287);r.register("sprite",function(h,a,l,n){return this.displayList.add(new p(this.scene,h,a,l,n))})},92751:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(9409),h=e(76552),s.exports={renderWebGL:p,renderCanvas:h}},9409:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),r.pipeline.batchSprite(r,p,h)};s.exports=y},14220:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.canvas,a=e.context,l=e.style,n=[],u=0,f=p.length;l.maxLines>0&&l.maxLines1&&(c+=e.letterSpacing*(p[o].length-1)),l.wordWrap&&(c-=a.measureText(" ").width),n[o]=Math.ceil(c),u=Math.max(u,n[o])}var d=r.fontSize+l.strokeThickness,v=d*f,m=e.lineSpacing;return f>1&&(v+=m*(f-1)),{width:u,height:v,lines:f,lineWidths:n,lineSpacing:m,lineHeight:d}};s.exports=y},79557:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=function(h){var a=r.create(this),l=a.getContext("2d",{willReadFrequently:!0});h.syncFont(a,l);var n=l.measureText(h.testString);if("actualBoundingBoxAscent"in n){var u=n.actualBoundingBoxAscent,f=n.actualBoundingBoxDescent;return r.remove(a),{ascent:u,descent:f,fontSize:u+f}}var o=Math.ceil(n.width*h.baselineX),c=o,d=2*c;c=c*h.baselineY|0,a.width=o,a.height=d,l.fillStyle="#f00",l.fillRect(0,0,o,d),l.font=h._font,l.textBaseline="alphabetic",l.fillStyle="#000",l.fillText(h.testString,0,c);var v={ascent:0,descent:0,fontSize:0},m=l.getImageData(0,0,o,d);if(!m)return v.ascent=c,v.descent=c+6,v.fontSize=v.ascent+v.descent,r.remove(a),v;var S=m.data,M=S.length,w=o*4,C,A,P=0,b=!1;for(C=0;Cc;C--){for(A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=e(27919),h=e(83419),a=e(31401),l=e(95643),n=e(14220),u=e(35154),f=e(35846),o=e(61771),c=e(35762),d=e(45650),v=new h({Extends:l,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,o],initialize:function(S,M,w,C,A){M===void 0&&(M=0),w===void 0&&(w=0),l.call(this,S,"Text"),this.renderer=S.sys.renderer,this.setPosition(M,w),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=p.create(this),this.context,this.style=new c(this,A),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=d(),this.texture=S.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(C),A&&A.padding&&this.setPadding(A.padding),A&&A.lineSpacing&&this.setLineSpacing(A.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",r(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(m){var S=this.style;if(S.wordWrapCallback){var M=S.wordWrapCallback.call(S.wordWrapCallbackScope,m,this);return Array.isArray(M)&&(M=M.join(` +`)),M}else return S.wordWrapWidth?S.wordWrapUseAdvanced?this.advancedWordWrap(m,this.context,this.style.wordWrapWidth):this.basicWordWrap(m,this.context,this.style.wordWrapWidth):m},advancedWordWrap:function(m,S,M){for(var w="",C=m.replace(/ +/gi," ").split(this.splitRegExp),A=C.length,P=0;PD){if(G===0){for(var Q=X;Q.length&&(Q=Q.slice(0,-1),j=S.measureText(Q).width,!(j<=D)););if(!Q.length)throw new Error("wordWrapWidth < a single character");var tt=z.substr(Q.length);B[G]=tt,O+=Q}var Y=B[G].length?G:G+1,Z=B.slice(Y).join(" ").replace(/[ \n]*$/gi,"");C.splice(P+1,0,Z),A=C.length;break}else O+=X,D-=j}w+=O.replace(/[ \n]*$/gi,"")+` +`}return w=w.replace(/[\s|\n]*$/gi,""),w},basicWordWrap:function(m,S,M){for(var w="",C=m.split(this.splitRegExp),A=C.length-1,P=S.measureText(" ").width,b=0;b<=A;b++){for(var O=M,I=C[b].split(" "),D=I.length-1,B=0;B<=D;B++){var G=I[B],z=S.measureText(G).width,X=z;BO&&B>0&&(w+=` +`,O=M),w+=G,B0&&(z+=b.lineSpacing*X),M.rtl)G=D-G-O.left-O.right;else if(M.align==="right")G+=I-b.lineWidths[X];else if(M.align==="center")G+=(I-b.lineWidths[X])/2;else if(M.align==="justify"){var j=.85;if(b.lineWidths[X]/b.width>=j){var Q=b.width-b.lineWidths[X],tt=S.measureText(" ").width,Y=P[X].trim(),Z=Y.split(" ");Q+=(P[X].length-Y.length)*tt;for(var U=Math.floor(Q/tt),H=0;U>0;)Z[H]+=" ",H=(H+1)%(Z.length-1||1),--U;P[X]=Z.join(" ")}}if(this.autoRound&&(G=Math.round(G),z=Math.round(z)),M.strokeThickness&&(M.syncShadow(S,M.shadowStroke),S.strokeText(P[X],G,z)),M.color){M.syncShadow(S,M.shadowFill);var J=this.letterSpacing;if(J!==0)for(var _=0,q=P[X].split(""),at=0;at{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.width===0||r.height===0||(p.addToRenderList(r),e.batchSprite(r,r.frame,p,h))};s.exports=y},71259:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(50171);p.register("text",function(l,n){l===void 0&&(l={});var u=h(l,"text",""),f=h(l,"style",null),o=h(l,"padding",null);o!==null&&(f.padding=o);var c=new a(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,c,l),c.autoRound=h(l,"autoRound",!0),c.resolution=h(l,"resolution",1),c})},68005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(50171),p=e(39429);p.register("text",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},61771:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(34397),h=e(79724),s.exports={renderWebGL:p,renderCanvas:h}},35762:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23568),h=e(35154),a=e(79557),l={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]},n=new r({initialize:function(f,o){this.parent=f,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(o,!1,!0)},setStyle:function(u,f,o){f===void 0&&(f=!0),o===void 0&&(o=!1),u&&u.hasOwnProperty("fontSize")&&typeof u.fontSize=="number"&&(u.fontSize=u.fontSize.toString()+"px");for(var c in l){var d=o?l[c][1]:this[c];c==="wordWrapCallback"||c==="wordWrapCallbackScope"?this[c]=h(u,l[c][0],d):this[c]=p(u,l[c][0],d)}var v=h(u,"font",null);v!==null&&this.setFont(v,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var m=h(u,"fill",null);m!==null&&(this.color=m);var S=h(u,"metrics",!1);return S?this.metrics={ascent:h(S,"ascent",0),descent:h(S,"descent",0),fontSize:h(S,"fontSize",0)}:(f||!this.metrics)&&(this.metrics=a(this)),f?this.parent.updateText():this.parent},syncFont:function(u,f){f.font=this._font},syncStyle:function(u,f){f.textBaseline="alphabetic",f.fillStyle=this.color,f.strokeStyle=this.stroke,f.lineWidth=this.strokeThickness,f.lineCap="round",f.lineJoin="round"},syncShadow:function(u,f){f?(u.shadowOffsetX=this.shadowOffsetX,u.shadowOffsetY=this.shadowOffsetY,u.shadowColor=this.shadowColor,u.shadowBlur=this.shadowBlur):(u.shadowOffsetX=0,u.shadowOffsetY=0,u.shadowColor=0,u.shadowBlur=0)},update:function(u){return u&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(u,f){f===void 0&&(f=!0);var o=u,c="",d="";if(typeof u!="string")o=h(u,"fontFamily","Courier"),c=h(u,"fontSize","16px"),d=h(u,"fontStyle","");else{var v=u.split(" "),m=0;d=v.length>2?v[m++]:"",c=v[m++]||"16px",o=v[m++]||"Courier"}return(o!==this.fontFamily||c!==this.fontSize||d!==this.fontStyle)&&(this.fontFamily=o,this.fontSize=c,this.fontStyle=d,f&&this.update(!0)),this.parent},setFontFamily:function(u){return this.fontFamily!==u&&(this.fontFamily=u,this.update(!0)),this.parent},setFontStyle:function(u){return this.fontStyle!==u&&(this.fontStyle=u,this.update(!0)),this.parent},setFontSize:function(u){return typeof u=="number"&&(u=u.toString()+"px"),this.fontSize!==u&&(this.fontSize=u,this.update(!0)),this.parent},setTestString:function(u){return this.testString=u,this.update(!0)},setFixedSize:function(u,f){return this.fixedWidth=u,this.fixedHeight=f,u&&(this.parent.width=u),f&&(this.parent.height=f),this.update(!1)},setBackgroundColor:function(u){return this.backgroundColor=u,this.update(!1)},setFill:function(u){return this.color=u,this.update(!1)},setColor:function(u){return this.color=u,this.update(!1)},setResolution:function(u){return this.resolution=u,this.update(!1)},setStroke:function(u,f){return f===void 0&&(f=this.strokeThickness),u===void 0&&this.strokeThickness!==0?(this.strokeThickness=0,this.update(!0)):(this.stroke!==u||this.strokeThickness!==f)&&(this.stroke=u,this.strokeThickness=f,this.update(!0)),this.parent},setShadow:function(u,f,o,c,d,v){return u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o="#000"),c===void 0&&(c=0),d===void 0&&(d=!1),v===void 0&&(v=!0),this.shadowOffsetX=u,this.shadowOffsetY=f,this.shadowColor=o,this.shadowBlur=c,this.shadowStroke=d,this.shadowFill=v,this.update(!1)},setShadowOffset:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this.shadowOffsetX=u,this.shadowOffsetY=f,this.update(!1)},setShadowColor:function(u){return u===void 0&&(u="#000"),this.shadowColor=u,this.update(!1)},setShadowBlur:function(u){return u===void 0&&(u=0),this.shadowBlur=u,this.update(!1)},setShadowStroke:function(u){return this.shadowStroke=u,this.update(!1)},setShadowFill:function(u){return this.shadowFill=u,this.update(!1)},setWordWrapWidth:function(u,f){return f===void 0&&(f=!1),this.wordWrapWidth=u,this.wordWrapUseAdvanced=f,this.update(!1)},setWordWrapCallback:function(u,f){return f===void 0&&(f=null),this.wordWrapCallback=u,this.wordWrapCallbackScope=f,this.update(!1)},setAlign:function(u){return u===void 0&&(u="left"),this.align=u,this.update(!1)},setMaxLines:function(u){return u===void 0&&(u=0),this.maxLines=u,this.update(!1)},getTextMetrics:function(){var u=this.metrics;return{ascent:u.ascent,descent:u.descent,fontSize:u.fontSize}},toJSON:function(){var u={};for(var f in l)u[f]=this[f];return u.metrics=this.getTextMetrics(),u},destroy:function(){this.parent=void 0}});s.exports=n},34397:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n){if(!(a.width===0||a.height===0)){l.addToRenderList(a);var u=a.frame,f=u.width,o=u.height,c=r.getTintAppendFloatAlpha,d=h.pipelines.set(a.pipeline,a),v=d.setTexture2D(u.glTexture,a);d.batchTexture(a,u.glTexture,f,o,a.x,a.y,f/a.style.resolution,o/a.style.resolution,a.scaleX,a.scaleY,a.rotation,a.flipX,a.flipY,a.scrollFactorX,a.scrollFactorY,a.displayOriginX,a.displayOriginY,0,0,f,o,c(a.tintTopLeft,l.alpha*a._alphaTL),c(a.tintTopRight,l.alpha*a._alphaTR),c(a.tintBottomLeft,l.alpha*a._alphaBL),c(a.tintBottomRight,l.alpha*a._alphaBR),a.tintFill,0,0,l,n,!1,v)}};s.exports=p},20839:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(83419),h=e(31401),a=e(95643),l=e(98439),n=e(68703),u=e(56295),f=e(45650),o=e(26099),c=8,d=new p({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Crop,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Tint,h.Transform,h.Visible,u],initialize:function(m,S,M,w,C,A,P){var b=m.sys.renderer;a.call(this,m,"TileSprite");var O=m.sys.textures.get(A),I=O.get(P);I.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),O.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),!w||!C?(w=I.width,C=I.height):(w=Math.floor(w),C=Math.floor(C)),this._tilePosition=new o,this._tileScale=new o(1,1),this.dirty=!1,this.renderer=b,this.canvas=r.create(this,w,C),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=O,this.displayFrame=I,this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=m.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=l(I.width),this.potHeight=l(I.height),this.fillCanvas=r.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(S,M),this.setSize(w,C),this.setFrame(P),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(v,m){return this.displayTexture=this.scene.sys.textures.get(v),this.setFrame(m)},setFrame:function(v){var m=this.displayTexture.get(v);return this.potWidth=l(m.width),this.potHeight=l(m.height),this.canvas.width=0,!m.cutWidth||!m.cutHeight?this.renderFlags&=~c:this.renderFlags|=c,this.displayFrame=m,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(v,m){return v!==void 0&&(this.tilePositionX=v),m!==void 0&&(this.tilePositionY=m),this},setTileScale:function(v,m){return v===void 0&&(v=this.tileScaleX),m===void 0&&(m=v),this.tileScaleX=v,this.tileScaleY=m,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var v=this.displayFrame;if(v.source.isRenderTexture||v.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var m=this.fillContext,S=this.fillCanvas,M=this.potWidth,w=this.potHeight;(!this.renderer||!this.renderer.gl)&&(M=v.cutWidth,w=v.cutHeight),m.clearRect(0,0,M,w),S.width=M,S.height=w,m.drawImage(v.source.image,v.cutX,v.cutY,v.cutWidth,v.cutHeight,0,0,M,w),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(S,this.fillPattern):this.fillPattern=m.createPattern(S,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var v=this.canvas;if((v.width!==this.width||v.height!==this.height)&&(v.width=this.width,v.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 m=this.context;this.scene.sys.game.config.antialias||n.disable(m);var S=this._tileScale.x,M=this._tileScale.y,w=this._tilePosition.x,C=this._tilePosition.y;m.clearRect(0,0,this.width,this.height),m.save(),m.scale(S,M),m.translate(-w,-C),m.fillStyle=this.fillPattern,m.fillRect(w,C,this.width/S,this.height/M),m.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),r.remove(this.canvas),r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var v=this.texture;v&&v.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(v){this._tilePosition.x=v,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(v){this._tilePosition.y=v,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(v){this._tileScale.x=v,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(v){this._tileScale.y=v,this.dirty=!0}}});s.exports=d},46992:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.updateCanvas(),p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},14167:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(20839);p.register("tileSprite",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),o=h(l,"width",512),c=h(l,"height",512),d=h(l,"key",""),v=h(l,"frame",""),m=new a(this.scene,u,f,o,c,d,v);return n!==void 0&&(l.add=n),r(this.scene,m,l),m})},91681:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20839),p=e(39429);p.register("tileSprite",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},56295:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(18553),h=e(46992),s.exports={renderWebGL:p,renderCanvas:h}},18553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n){a.updateCanvas();var u=a.width,f=a.height;if(!(u===0||f===0)){l.addToRenderList(a);var o=r.getTintAppendFloatAlpha,c=h.pipelines.set(a.pipeline,a),d=c.setTexture2D(a.fillPattern,a);c.batchTexture(a,a.fillPattern,a.displayFrame.width*a.tileScaleX,a.displayFrame.height*a.tileScaleY,a.x,a.y,u,f,a.scaleX,a.scaleY,a.rotation,a.flipX,a.flipY,a.scrollFactorX,a.scrollFactorY,a.originX*u,a.originY*f,0,0,u,f,o(a.tintTopLeft,l.alpha*a._alphaTL),o(a.tintTopRight,l.alpha*a._alphaTR),o(a.tintBottomLeft,l.alpha*a._alphaBL),o(a.tintBottomRight,l.alpha*a._alphaBR),a.tintFill,a.tilePositionX%a.displayFrame.width/a.displayFrame.width,a.tilePositionY%a.displayFrame.height/a.displayFrame.height,l,n,!1,d)}};s.exports=p},18471:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(31401),a=e(51708),l=e(8443),n=e(95643),u=e(36383),f=e(14463),o=e(45650),c=e(10247),d=new p({Extends:n,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.TextureCrop,h.Tint,h.Transform,h.Visible,c],initialize:function(m,S,M,w){n.call(this,m,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=o(),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 C=m.sys.game;this._device=C.device.video,this.setPosition(S,M),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),C.events.on(l.PAUSE,this.globalPause,this),C.events.on(l.RESUME,this.globalResume,this);var A=m.sys.sound;A&&A.on(f.GLOBAL_MUTE,this.globalMute,this),w&&this.load(w)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(v){var m=this.scene.sys.cache.video.get(v);return m?(this.cacheKey=v,this.loadHandler(m.url,m.noAudio,m.crossOrigin)):console.warn("No video in cache for key: "+v),this},changeSource:function(v,m,S,M,w){m===void 0&&(m=!0),S===void 0&&(S=!1),this.cacheKey!==v&&(this.load(v),m&&this.play(S,M,w))},getVideoKey:function(){return this.cacheKey},loadURL:function(v,m,S){m===void 0&&(m=!1);var M=this._device.getVideoURL(v);return M?(this.cacheKey="",this.loadHandler(M.url,m,S)):console.warn("No supported video format found for "+v),this},loadMediaStream:function(v,m,S){return this.loadHandler(null,m,S,v)},loadHandler:function(v,m,S,M){m||(m=!1);var w=this.video;if(w?(this.removeLoadEventHandlers(),this.stop()):(w=document.createElement("video"),w.controls=!1,w.setAttribute("playsinline","playsinline"),w.setAttribute("preload","auto"),w.setAttribute("disablePictureInPicture","true")),m?(w.muted=!0,w.defaultMuted=!0,w.setAttribute("autoplay","autoplay")):(w.muted=!1,w.defaultMuted=!1,w.removeAttribute("autoplay")),S?w.setAttribute("crossorigin",S):w.removeAttribute("crossorigin"),M)if("srcObject"in w)try{w.srcObject=M}catch(A){if(A.name!=="TypeError")throw A;w.src=URL.createObjectURL(M)}else w.src=URL.createObjectURL(M);else w.src=v;this.retry=0,this.video=w,this._playCalled=!1,w.load(),this.addLoadEventHandlers();var C=this.scene.sys.textures.get(this._key);return this.setTexture(C),this},requestVideoFrame:function(v,m){var S=this.video;if(S){var M=m.width,w=m.height,C=this.videoTexture,A=this.videoTextureSource,P=!C||A.source!==S;P?(this._codePaused=S.paused,this._codeMuted=S.muted,C?(A.source=S,A.width=M,A.height=w,C.get().setSize(M,w)):(C=this.scene.sys.textures.create(this._key,S,M,w),C.add("__BASE",0,0,0,M,w),this.setTexture(C),this.videoTexture=C,this.videoTextureSource=C.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(a.VIDEO_TEXTURE,this,C)),this.setSizeToFrame(),this.updateDisplayOrigin()):A.update(),this.isStalled=!1,this.metadata=m;var b=m.mediaTime;P&&(this._lastUpdate=b,this.emit(a.VIDEO_CREATED,this,M,w),this.frameReady||(this.frameReady=!0,this.emit(a.VIDEO_PLAY,this))),this._playingMarker?b>=this._markerOut&&(S.loop?(S.currentTime=this._markerIn,this.emit(a.VIDEO_LOOP,this)):(this.stop(!1),this.emit(a.VIDEO_COMPLETE,this))):b-1&&S>m&&S=0&&!isNaN(S)&&S>m&&(this.markers[v]=[m,S]),this},playMarker:function(v,m){var S=this.markers[v];return S&&this.play(m,S[0],S[1]),this},removeMarker:function(v){return delete this.markers[v],this},snapshot:function(v,m){return v===void 0&&(v=this.width),m===void 0&&(m=this.height),this.snapshotArea(0,0,this.width,this.height,v,m)},snapshotArea:function(v,m,S,M,w,C){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=this.width),M===void 0&&(M=this.height),w===void 0&&(w=S),C===void 0&&(C=M);var A=this.video,P=this.snapshotTexture;return P?(P.setSize(w,C),A&&P.context.drawImage(A,v,m,S,M,0,0,w,C)):(P=this.scene.sys.textures.createCanvas(o(),w,C),this.snapshotTexture=P,A&&P.context.drawImage(A,v,m,S,M,0,0,w,C)),P.update()},saveSnapshotTexture:function(v){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,v):this.snapshotTexture=this.scene.sys.textures.createCanvas(v,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(a.VIDEO_UNLOCKED,this));var v=this.scene.sys.sound;v&&v.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(v){var m=v.name;m==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(a.VIDEO_LOCKED,this)):m==="NotSupportedError"?(this.stop(!1),this.emit(a.VIDEO_UNSUPPORTED,this,v)):(this.stop(!1),this.emit(a.VIDEO_ERROR,this,v))},legacyPlayHandler:function(){var v=this.video;v&&(this.playSuccess(),v.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(a.VIDEO_PLAYING,this)},loadErrorHandler:function(v){this.stop(!1),this.emit(a.VIDEO_ERROR,this,v)},metadataHandler:function(v){this.emit(a.VIDEO_METADATA,this,v)},setSizeToFrame:function(v){v||(v=this.frame),this.width=v.realWidth,this.height=v.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var m=this.input;return m&&!m.customHitArea&&(m.hitArea.width=this.width,m.hitArea.height=this.height),this},stalledHandler:function(v){this.isStalled=!0,this.emit(a.VIDEO_STALLED,this,v)},completeHandler:function(){this._playCalled=!1,this.emit(a.VIDEO_COMPLETE,this)},preUpdate:function(v,m){var S=this.video;!S||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=m,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(v){var m=this.video;if(m){var S=m.duration;if(S!==1/0&&!isNaN(S)){var M=S*v;this.setCurrentTime(M)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(v){var m=this.video;if(m){if(typeof v=="string"){var S=v[0],M=parseFloat(v.substr(1));S==="+"?v=m.currentTime+M:S==="-"&&(v=m.currentTime-M)}m.currentTime=v}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(a.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(a.VIDEO_SEEKED,this)},getProgress:function(){var v=this.video;if(v){var m=v.duration;if(m!==1/0&&!isNaN(m))return v.currentTime/m}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(v){v===void 0&&(v=!0),this._codeMuted=v;var m=this.video;return m&&(m.muted=this._systemMuted?!0:v),this},isMuted:function(){return this._codeMuted},globalMute:function(v,m){this._systemMuted=m;var S=this.video;S&&(S.muted=this._codeMuted?!0:m)},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(v){v===void 0&&(v=!0);var m=this.video;return this._codePaused=v,m&&!m.ended&&(v?m.paused||(this.removeEventHandlers(),m.pause()):v||(this._playCalled?m.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(v){return v===void 0&&(v=1),this.video&&(this.video.volume=r(v,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(v){return this.video&&(this.video.playbackRate=v),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(v){return v===void 0&&(v=!0),this.video&&(this.video.loop=v),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(v,m){return m===void 0&&(m=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,v),this.videoTextureSource.setFlipY(m)),this._key=v,this.flipY=m,!!this.videoTexture},stop:function(v){v===void 0&&(v=!0);var m=this.video;return m&&(this.removeEventHandlers(),m.cancelVideoFrameCallback(this._rfvCallbackId),m.pause()),this.retry=0,this._playCalled=!1,v&&this.emit(a.VIDEO_STOP,this),this},removeVideoElement:function(){var v=this.video;if(v){for(v.parentNode&&v.parentNode.removeChild(v);v.hasChildNodes();)v.removeChild(v.firstChild);v.removeAttribute("autoplay"),v.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var v=this.scene.sys.game.events;v.off(l.PAUSE,this.globalPause,this),v.off(l.RESUME,this.globalResume,this);var m=this.scene.sys.sound;m&&m.off(f.GLOBAL_MUTE,this.globalMute,this)}});s.exports=d},58352:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.videoTexture&&(p.addToRenderList(r),e.batchSprite(r,r.frame,p,h))};s.exports=y},11511:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(18471);p.register("video",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=new a(this.scene,0,0,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},89025:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(18471),p=e(39429);p.register("video",function(h,a,l){return this.displayList.add(new r(this.scene,h,a,l))})},10247:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(29849),h=e(58352),s.exports={renderWebGL:p,renderCanvas:h}},29849:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.videoTexture&&(p.addToRenderList(r),r.pipeline.batchSprite(r,p,h))};s.exports=y},41481:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(96503),h=e(87902),a=e(83419),l=e(31401),n=e(95643),u=e(87841),f=e(37303),o=new a({Extends:n,Mixins:[l.Depth,l.GetBounds,l.Origin,l.Transform,l.ScrollFactor,l.Visible],initialize:function(d,v,m,S,M){S===void 0&&(S=1),M===void 0&&(M=S),n.call(this,d,"Zone"),this.setPosition(v,m),this.width=S,this.height=M,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(c){this.scaleX=c/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(c){this.scaleY=c/this.height}},setSize:function(c,d,v){v===void 0&&(v=!0),this.width=c,this.height=d,this.updateDisplayOrigin();var m=this.input;return v&&m&&!m.customHitArea&&(m.hitArea.width=c,m.hitArea.height=d),this},setDisplaySize:function(c,d){return this.displayWidth=c,this.displayHeight=d,this},setCircleDropZone:function(c){return this.setDropZone(new p(0,0,c),h)},setRectangleDropZone:function(c,d){return this.setDropZone(new u(0,0,c,d),f)},setDropZone:function(c,d){return this.input||this.setInteractive(c,d,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(c,d,v){v.addToRenderList(d)},renderWebGL:function(c,d,v){v.addToRenderList(d)}});s.exports=o},95261:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(23568),h=e(41481);r.register("zone",function(a){var l=p(a,"x",0),n=p(a,"y",0),u=p(a,"width",1),f=p(a,"height",u);return new h(this.scene,l,n,u,f)})},84175:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41481),p=e(39429);p.register("zone",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},95166:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.radius>0?Math.PI*e.radius*e.radius:0};s.exports=y},96503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87902),h=e(26241),a=e(79124),l=e(23777),n=e(28176),u=new r({initialize:function(o,c,d){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),this.type=l.CIRCLE,this.x=o,this.y=c,this._radius=d,this._diameter=d*2},contains:function(f,o){return p(this,f,o)},getPoint:function(f,o){return h(this,f,o)},getPoints:function(f,o,c){return a(this,f,o,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,o,c){return this.x=f,this.y=o,this._radius=c,this._diameter=c*2,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(f,o){return o===void 0&&(o=f),this.x=f,this.y=o,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this._diameter=f*2}},diameter:{get:function(){return this._diameter},set:function(f){this._diameter=f,this._radius=f*.5}},left:{get:function(){return this.x-this._radius},set:function(f){this.x=f+this._radius}},right:{get:function(){return this.x+this._radius},set:function(f){this.x=f-this._radius}},top:{get:function(){return this.y-this._radius},set:function(f){this.y=f+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(f){this.y=f-this._radius}}});s.exports=u},71562:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 2*(Math.PI*e.radius)};s.exports=y},92110:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){return l===void 0&&(l=new r),l.x=h.x+h.radius*Math.cos(a),l.y=h.y+h.radius*Math.sin(a),l};s.exports=p},42250:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=function(h){return new r(h.x,h.y,h.radius)};s.exports=p},87902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(e.radius>0&&r>=e.left&&r<=e.right&&p>=e.top&&p<=e.bottom){var h=(e.x-r)*(e.x-r),a=(e.y-p)*(e.y-p);return h+a<=e.radius*e.radius}else return!1};s.exports=y},5698:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},70588:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=function(h,a){return r(h,a.x,a.y)&&r(h,a.right,a.y)&&r(h,a.x,a.bottom)&&r(h,a.right,a.bottom)};s.exports=p},26394:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.radius)};s.exports=y},76278:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.radius===r.radius};s.exports=y},2074:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){return a===void 0&&(a=new r),a.x=h.left,a.y=h.top,a.width=h.diameter,a.height=h.diameter,a};s.exports=p},26241:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(92110),p=e(62945),h=e(36383),a=e(2141),l=function(n,u,f){f===void 0&&(f=new a);var o=p(u,0,h.PI2);return r(n,o,f)};s.exports=l},79124:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71562),p=e(92110),h=e(62945),a=e(36383),l=function(n,u,f,o){o===void 0&&(o=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},39212:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},28176:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=2*Math.PI*Math.random(),n=Math.random()+Math.random(),u=n>1?2-n:n,f=u*Math.cos(l),o=u*Math.sin(l);return a.x=h.x+f*h.radius,a.y=h.y+o*h.radius,a};s.exports=p},88911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503);r.Area=e(95166),r.Circumference=e(71562),r.CircumferencePoint=e(92110),r.Clone=e(42250),r.Contains=e(87902),r.ContainsPoint=e(5698),r.ContainsRect=e(70588),r.CopyFrom=e(26394),r.Equals=e(76278),r.GetBounds=e(2074),r.GetPoint=e(26241),r.GetPoints=e(79124),r.Offset=e(50884),r.OffsetPoint=e(39212),r.Random=e(28176),s.exports=r},23777:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6};s.exports=y},78874:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.isEmpty()?0:e.getMajorRadius()*e.getMinorRadius()*Math.PI};s.exports=y},92990:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.width/2,p=e.height/2,h=Math.pow(r-p,2)/Math.pow(r+p,2);return Math.PI*(r+p)*(1+3*h/(10+Math.sqrt(4-3*h)))};s.exports=y},79522:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.width/2,u=h.height/2;return l.x=h.x+n*Math.cos(a),l.y=h.y+u*Math.sin(a),l};s.exports=p},58102:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8497),p=function(h){return new r(h.x,h.y,h.width,h.height)};s.exports=p},81154:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(e.width<=0||e.height<=0)return!1;var h=(r-e.x)/e.width,a=(p-e.y)/e.height;return h*=h,a*=a,h+a<.25};s.exports=y},46662:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81154),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},1632:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81154),p=function(h,a){return r(h,a.x,a.y)&&r(h,a.right,a.y)&&r(h,a.x,a.bottom)&&r(h,a.right,a.bottom)};s.exports=p},65534:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.width,e.height)};s.exports=y},8497:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(81154),h=e(90549),a=e(48320),l=e(23777),n=e(24820),u=new r({initialize:function(o,c,d,v){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=l.ELLIPSE,this.x=o,this.y=c,this.width=d,this.height=v},contains:function(f,o){return p(this,f,o)},getPoint:function(f,o){return h(this,f,o)},getPoints:function(f,o,c){return a(this,f,o,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,o,c,d){return this.x=f,this.y=o,this.width=c,this.height=d,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(f,o){return o===void 0&&(o=f),this.x=f,this.y=o,this},setSize:function(f,o){return o===void 0&&(o=f),this.width=f,this.height=o,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(f){this.x=f+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(f){this.x=f-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(f){this.y=f+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(f){this.y=f-this.height/2}}});s.exports=u},36146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height};s.exports=y},23694:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){return a===void 0&&(a=new r),a.x=h.left,a.y=h.top,a.width=h.width,a.height=h.height,a};s.exports=p},90549:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79522),p=e(62945),h=e(36383),a=e(2141),l=function(n,u,f){f===void 0&&(f=new a);var o=p(u,0,h.PI2);return r(n,o,f)};s.exports=l},48320:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(92990),p=e(79522),h=e(62945),a=e(36383),l=function(n,u,f,o){o===void 0&&(o=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},44808:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},24820:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return a.x=h.x+n*Math.cos(l)*h.width/2,a.y=h.y+n*Math.sin(l)*h.height/2,a};s.exports=p},49203:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8497);r.Area=e(78874),r.Circumference=e(92990),r.CircumferencePoint=e(79522),r.Clone=e(58102),r.Contains=e(81154),r.ContainsPoint=e(46662),r.ContainsRect=e(1632),r.CopyFrom=e(65534),r.Equals=e(36146),r.GetBounds=e(23694),r.GetPoint=e(90549),r.GetPoints=e(48320),r.Offset=e(73424),r.OffsetPoint=e(44808),r.Random=e(24820),s.exports=r},55738:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23777),p=e(79291),h={Circle:e(88911),Ellipse:e(49203),Intersects:e(91865),Line:e(2529),Mesh:e(73090),Point:e(43711),Polygon:e(58423),Rectangle:e(93232),Triangle:e(84435)};h=p(!1,h,r),s.exports=h},2044:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20339),p=function(h,a){return r(h.x,h.y,a.x,a.y)<=h.radius+a.radius};s.exports=p},81491:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=r.width/2,h=r.height/2,a=Math.abs(e.x-r.x-p),l=Math.abs(e.y-r.y-h),n=p+e.radius,u=h+e.radius;if(a>n||l>u)return!1;if(a<=p||l<=h)return!0;var f=a-p,o=l-h,c=f*f,d=o*o,v=e.radius*e.radius;return c+d<=v};s.exports=y},63376:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(2044),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.x,f=a.y,o=a.radius,c=l.x,d=l.y,v=l.radius,m,S,M,w,C;if(f===d)C=(v*v-o*o-c*c+u*u)/(2*(u-c)),m=1,S=-2*d,M=c*c+C*C-2*c*C+d*d-v*v,w=S*S-4*m*M,w===0?n.push(new r(C,-S/(2*m))):w>0&&(n.push(new r(C,(-S+Math.sqrt(w))/(2*m))),n.push(new r(C,(-S-Math.sqrt(w))/(2*m))));else{var A=(u-c)/(f-d),P=(v*v-o*o-c*c+u*u-d*d+f*f)/(2*(f-d));m=A*A+1,S=2*f*A-2*P*A-2*u,M=u*u+f*f+P*P-o*o-2*f*P,w=S*S-4*m*M,w===0?(C=-S/(2*m),n.push(new r(C,P-C*A))):w>0&&(C=(-S+Math.sqrt(w))/(2*m),n.push(new r(C,P-C*A)),C=(-S-Math.sqrt(w))/(2*m),n.push(new r(C,P-C*A)))}}return n};s.exports=h},97439:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4042),p=e(81491),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC(),c=l.getLineD();r(u,a,n),r(f,a,n),r(o,a,n),r(c,a,n)}return n};s.exports=h},4042:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(80462),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.x1,f=a.y1,o=a.x2,c=a.y2,d=l.x,v=l.y,m=l.radius,S=o-u,M=c-f,w=u-d,C=f-v,A=S*S+M*M,P=2*(S*w+M*C),b=w*w+C*C-m*m,O=P*P-4*A*b,I,D;if(O===0){var B=-P/(2*A);I=u+B*S,D=f+B*M,B>=0&&B<=1&&n.push(new r(I,D))}else if(O>0){var G=(-P-Math.sqrt(O))/(2*A);I=u+G*S,D=f+G*M,G>=0&&G<=1&&n.push(new r(I,D));var z=(-P+Math.sqrt(O))/(2*A);I=u+z*S,D=f+z*M,z>=0&&z<=1&&n.push(new r(I,D))}}return n};s.exports=h},36100:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=function(h,a,l,n){l===void 0&&(l=!1);var u=h.x1,f=h.y1,o=h.x2,c=h.y2,d=a.x1,v=a.y1,m=a.x2,S=a.y2,M=o-u,w=c-f,C=m-d,A=S-v,P=M*A-w*C;if(P===0)return null;var b,O,I;if(l){if(b=(M*(v-f)+w*(u-d))/(C*w-A*M),O=(d+C*b-u)/M,O<0||b<0||b>1)return null;I=O}else{if(b=((d-u)*A-(v-f)*C)/P,O=((f-v)*M-(u-d)*w)/P,b<0||b>1||O<0||O>1)return null;I=b}return n===void 0&&(n=new r),n.set(u+M*I,f+w*I,I)};s.exports=p},3073:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36100),p=e(23031),h=e(25836),a=new p,l=new h,n=function(u,f,o,c){o===void 0&&(o=!1),c===void 0&&(c=new h);var d=!1;c.set(),l.set();for(var v=f[f.length-1],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=e(61369),h=e(3073),a=new r,l=function(n,u,f,o){o===void 0&&(o=new p),Array.isArray(u)||(u=[u]);var c=!1;o.set(),a.set();for(var d=0;d{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(76112),h=e(92773),a=function(l,n,u){if(u===void 0&&(u=[]),h(l,n))for(var f=n.getLineA(),o=n.getLineB(),c=n.getLineC(),d=n.getLineD(),v=[new r,new r,new r,new r],m=[p(f,l,v[0]),p(o,l,v[1]),p(c,l,v[2]),p(d,l,v[3])],S=0;S<4;S++)m[S]&&u.push(v[S]);return u};s.exports=a},71147:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61369),p=e(56362),h=e(23031),a=new h;function l(f,o,c,d,v){var m=Math.cos(f),S=Math.sin(f);a.setTo(o,c,o+m,c+S);var M=p(a,d,!0);M&&v.push(new r(M.x,M.y,f,M.w))}function n(f,o){return f.z-o.z}var u=function(f,o,c){Array.isArray(c)||(c=[c]);for(var d=[],v=[],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(59996),h=function(a,l,n){return n===void 0&&(n=new r),p(a,l)&&(n.x=Math.max(a.x,l.x),n.y=Math.max(a.y,l.y),n.width=Math.min(a.right,l.right)-n.x,n.height=Math.min(a.bottom,l.bottom)-n.y),n};s.exports=h},52784:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60646),p=e(59996),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.getLineA(),f=a.getLineB(),o=a.getLineC(),c=a.getLineD();r(u,l,n),r(f,l,n),r(o,l,n),r(c,l,n)}return n};s.exports=h},26341:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89265),p=e(60646),h=function(a,l,n){if(n===void 0&&(n=[]),r(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC();p(u,a,n),p(f,a,n),p(o,a,n)}return n};s.exports=h},38720:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4042),p=e(67636),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.getLineA(),f=a.getLineB(),o=a.getLineC();r(u,l,n),r(f,l,n),r(o,l,n)}return n};s.exports=h},13882:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(2822),h=e(76112),a=function(l,n,u){if(u===void 0&&(u=[]),p(l,n))for(var f=l.getLineA(),o=l.getLineB(),c=l.getLineC(),d=[new r,new r,new r],v=[h(f,n,d[0]),h(o,n,d[1]),h(c,n,d[2])],m=0;m<3;m++)v[m]&&u.push(d[m]);return u};s.exports=a},75636:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82944),p=e(13882),h=function(a,l,n){if(n===void 0&&(n=[]),r(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC();p(a,u,n),p(a,f,n),p(a,o,n)}return n};s.exports=h},80462:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=e(2141),h=new p,a=function(l,n,u){if(u===void 0&&(u=h),r(n,l.x1,l.y1))return u.x=l.x1,u.y=l.y1,!0;if(r(n,l.x2,l.y2))return u.x=l.x2,u.y=l.y2,!0;var f=l.x2-l.x1,o=l.y2-l.y1,c=n.x-l.x1,d=n.y-l.y1,v=f*f+o*o,m=f,S=o;if(v>0){var M=(c*f+d*o)/v;m*=M,S*=M}u.x=l.x1+m,u.y=l.y1+S;var w=m*m+S*S;return w<=v&&m*f+S*o>=0&&r(n,u.x,u.y)};s.exports=a},76112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.x1,a=e.y1,l=e.x2,n=e.y2,u=r.x1,f=r.y1,o=r.x2,c=r.y2;if(h===l&&a===n||u===o&&f===c)return!1;var d=(c-f)*(l-h)-(o-u)*(n-a);if(d===0)return!1;var v=((o-u)*(a-f)-(c-f)*(h-u))/d,m=((l-h)*(a-f)-(n-a)*(h-u))/d;return v<0||v>1||m<0||m>1?!1:(p&&(p.x=h+v*(l-h),p.y=a+v*(n-a)),!0)};s.exports=y},92773:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x1,h=e.y1,a=e.x2,l=e.y2,n=r.x,u=r.y,f=r.right,o=r.bottom,c=0;if(p>=n&&p<=f&&h>=u&&h<=o||a>=n&&a<=f&&l>=u&&l<=o)return!0;if(p=n){if(c=h+(l-h)*(n-p)/(a-p),c>u&&c<=o)return!0}else if(p>f&&a<=f&&(c=h+(l-h)*(f-p)/(a-p),c>=u&&c<=o))return!0;if(h=u){if(c=p+(a-p)*(u-h)/(l-h),c>=n&&c<=f)return!0}else if(h>o&&l<=o&&(c=p+(a-p)*(o-h)/(l-h),c>=n&&c<=f))return!0;return!1};s.exports=y},16204:s=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=1);var h=r.x1,a=r.y1,l=r.x2,n=r.y2,u=e.x,f=e.y,o=(l-h)*(l-h)+(n-a)*(n-a);if(o===0)return!1;var c=((u-h)*(l-h)+(f-a)*(n-a))/o;if(c<0)return Math.sqrt((h-u)*(h-u)+(a-f)*(a-f))<=p;if(c>=0&&c<=1){var d=((a-f)*(l-h)-(h-u)*(n-a))/o;return Math.abs(d)*Math.sqrt(o)<=p}else return Math.sqrt((l-u)*(l-u)+(n-f)*(n-f))<=p};s.exports=y},14199:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16204),p=function(h,a){if(!r(h,a))return!1;var l=Math.min(a.x1,a.x2),n=Math.max(a.x1,a.x2),u=Math.min(a.y1,a.y2),f=Math.max(a.y1,a.y2);return h.x>=l&&h.x<=n&&h.y>=u&&h.y<=f};s.exports=p},59996:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.width<=0||e.height<=0||r.width<=0||r.height<=0?!1:!(e.rightr.right||e.y>r.bottom)};s.exports=y},89265:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(76112),p=e(37303),h=e(48653),a=e(77493),l=function(n,u){if(u.left>n.right||u.rightn.bottom||u.bottom0};s.exports=l},84411:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){return l===void 0&&(l=0),!(r>e.right+l||pe.bottom+l||a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80462),p=e(10690),h=function(a,l){return a.left>l.right||a.rightl.bottom||a.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(76112),p=function(h,a){return!!(h.contains(a.x1,a.y1)||h.contains(a.x2,a.y2)||r(h.getLineA(),a)||r(h.getLineB(),a)||r(h.getLineC(),a))};s.exports=p},82944:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(48653),p=e(71694),h=e(76112),a=function(l,n){if(l.left>n.right||l.rightn.bottom||l.bottom0||(m=p(n),S=r(l,m,!0),S.length>0)};s.exports=a},91865:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CircleToCircle:e(2044),CircleToRectangle:e(81491),GetCircleToCircle:e(63376),GetCircleToRectangle:e(97439),GetLineToCircle:e(4042),GetLineToLine:e(36100),GetLineToPoints:e(3073),GetLineToPolygon:e(56362),GetLineToRectangle:e(60646),GetRaysFromPointToPolygon:e(71147),GetRectangleIntersection:e(68389),GetRectangleToRectangle:e(52784),GetRectangleToTriangle:e(26341),GetTriangleToCircle:e(38720),GetTriangleToLine:e(13882),GetTriangleToTriangle:e(75636),LineToCircle:e(80462),LineToLine:e(76112),LineToRectangle:e(92773),PointToLine:e(16204),PointToLineSegment:e(14199),RectangleToRectangle:e(59996),RectangleToTriangle:e(89265),RectangleToValues:e(84411),TriangleToCircle:e(67636),TriangleToLine:e(2822),TriangleToTriangle:e(82944)}},91938:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.atan2(e.y2-e.y1,e.x2-e.x1)};s.exports=y},84993:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=1),p===void 0&&(p=[]);var h=Math.round(e.x1),a=Math.round(e.y1),l=Math.round(e.x2),n=Math.round(e.y2),u=Math.abs(l-h),f=Math.abs(n-a),o=h-f&&(d-=f,h+=o),m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r-(e.x1+e.x2)/2,a=p-(e.y1+e.y2)/2;return e.x1+=h,e.y1+=a,e.x2+=h,e.y2+=a,e};s.exports=y},31116:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23031),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2)};s.exports=p},59944:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x1,e.y1,e.x2,e.y2)};s.exports=y},59220:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x1===r.x1&&e.y1===r.y1&&e.x2===r.x2&&e.y2===r.y2};s.exports=y},78177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=function(h,a,l){l===void 0&&(l=a);var n=r(h),u=h.x2-h.x1,f=h.y2-h.y1;return a&&(h.x1=h.x1-u/n*a,h.y1=h.y1-f/n*a),l&&(h.x2=h.x2+u/n*l,h.y2=h.y2+f/n*l),h};s.exports=p},26708:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(52816),p=e(6113),h=e(2141),a=function(l,n,u,f,o){f===void 0&&(f=0),o===void 0&&(o=[]);var c=[],d=l.x1,v=l.y1,m=l.x2-d,S=l.y2-v,M=p(n,o),w,C,A=u-1;for(w=0;w0){var P=c[0],b=[P];for(w=1;w=f&&(b.push(O),P=O)}var I=c[c.length-1];return r(P,I){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=(h.x1+h.x2)/2,a.y=(h.y1+h.y2)/2,a};s.exports=p},99569:(s,y,e)=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.x1,u=h.y1,f=h.x2,o=h.y2,c=(f-n)*(f-n)+(o-u)*(o-u);if(c===0)return l;var d=((a.x-n)*(f-n)+(a.y-u)*(o-u))/c;return l.x=n+d*(f-n),l.y=u+d*(o-u),l};s.exports=p},34638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=e(2141),a=function(l,n){n===void 0&&(n=new h);var u=p(l)-r.TAU;return n.x=Math.cos(u),n.y=Math.sin(u),n};s.exports=a},13151:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){return l===void 0&&(l=new r),l.x=h.x1+(h.x2-h.x1)*a,l.y=h.y1+(h.y2-h.y1)*a,l};s.exports=p},15258:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(2141),h=function(a,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=r(a)/n);for(var f=a.x1,o=a.y1,c=a.x2,d=a.y2,v=0;v{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x1,h=e.y1,a=e.x2,l=e.y2,n=(a-p)*(a-p)+(l-h)*(l-h);if(n===0)return!1;var u=((h-r.y)*(a-p)-(p-r.x)*(l-h))/n;return Math.abs(u)*Math.sqrt(n)};s.exports=y},98770:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.abs(e.y1-e.y2)};s.exports=y},35001:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt((e.x2-e.x1)*(e.x2-e.x1)+(e.y2-e.y1)*(e.y2-e.y1))};s.exports=y},23031:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(13151),h=e(15258),a=e(23777),l=e(65822),n=e(26099),u=new r({initialize:function(o,c,d,v){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=a.LINE,this.x1=o,this.y1=c,this.x2=d,this.y2=v},getPoint:function(f,o){return p(this,f,o)},getPoints:function(f,o,c){return h(this,f,o,c)},getRandomPoint:function(f){return l(this,f)},setTo:function(f,o,c,d){return f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),this.x1=f,this.y1=o,this.x2=c,this.y2=d,this},setFromObjects:function(f,o){return this.x1=f.x,this.y1=f.y,this.x2=o.x,this.y2=o.y,this},getPointA:function(f){return f===void 0&&(f=new n),f.set(this.x1,this.y1),f},getPointB:function(f){return f===void 0&&(f=new n),f.set(this.x2,this.y2),f},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(f){this.x1<=this.x2?this.x1=f:this.x2=f}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(f){this.x1>this.x2?this.x1=f:this.x2=f}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(f){this.y1<=this.y2?this.y1=f:this.y2=f}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(f){this.y1>this.y2?this.y1=f:this.y2=f}}});s.exports=u},64795:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(15994),h=e(91938),a=function(l){var n=h(l)-r.TAU;return p(n,-Math.PI,Math.PI)};s.exports=a},52616:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=function(a){return Math.cos(p(a)-r.TAU)};s.exports=h},87231:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=function(a){return Math.sin(p(a)-r.TAU)};s.exports=h},89662:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x1+=r,e.y1+=p,e.x2+=r,e.y2+=p,e};s.exports=y},71165:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return-((e.x2-e.x1)/(e.y2-e.y1))};s.exports=y},65822:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=Math.random();return a.x=h.x1+l*(h.x2-h.x1),a.y=h.y1+l*(h.y2-h.y1),a};s.exports=p},69777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91938),p=e(64795),h=function(a,l){return 2*p(l)-Math.PI-r(a)};s.exports=h},39706:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64400),p=function(h,a){var l=(h.x1+h.x2)/2,n=(h.y1+h.y2)/2;return r(h,l,n,a)};s.exports=p},82585:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64400),p=function(h,a,l){return r(h,a.x,a.y,l)};s.exports=p},64400:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x1-r,u=e.y1-p;return e.x1=n*a-u*l+r,e.y1=n*l+u*a+p,n=e.x2-r,u=e.y2-p,e.x2=n*a-u*l+r,e.y2=n*l+u*a+p,e};s.exports=y},62377:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return e.x1=r,e.y1=p,e.x2=r+Math.cos(h)*a,e.y2=p+Math.sin(h)*a,e};s.exports=y},71366:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e.y2-e.y1)/(e.x2-e.x1)};s.exports=y},10809:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.abs(e.x1-e.x2)};s.exports=y},2529:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23031);r.Angle=e(91938),r.BresenhamPoints=e(84993),r.CenterOn=e(36469),r.Clone=e(31116),r.CopyFrom=e(59944),r.Equals=e(59220),r.Extend=e(78177),r.GetEasedPoints=e(26708),r.GetMidPoint=e(32125),r.GetNearestPoint=e(99569),r.GetNormal=e(34638),r.GetPoint=e(13151),r.GetPoints=e(15258),r.GetShortestDistance=e(26408),r.Height=e(98770),r.Length=e(35001),r.NormalAngle=e(64795),r.NormalX=e(52616),r.NormalY=e(87231),r.Offset=e(89662),r.PerpSlope=e(71165),r.Random=e(65822),r.ReflectAngle=e(69777),r.Rotate=e(39706),r.RotateAroundPoint=e(82585),r.RotateAroundXY=e(64400),r.SetToAngle=e(62377),r.Slope=e(71366),r.Width=e(10809),s.exports=r},83997:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87841),h=e(26099);function a(n,u,f,o){var c=n-f,d=u-o,v=c*c+d*d;return Math.sqrt(v)}var l=new r({initialize:function(u,f,o){this.vertex1=u,this.vertex2=f,this.vertex3=o,this.bounds=new p,this._inCenter=new h},getInCenter:function(n){n===void 0&&(n=!0);var u=this.vertex1,f=this.vertex2,o=this.vertex3,c,d,v,m,S,M;n?(c=u.x,d=u.y,v=f.x,m=f.y,S=o.x,M=o.y):(c=u.vx,d=u.vy,v=f.vx,m=f.vy,S=o.vx,M=o.vy);var w=a(S,M,v,m),C=a(c,d,S,M),A=a(v,m,c,d),P=w+C+A;return this._inCenter.set((c*w+v*C+S*A)/P,(d*w+m*C+M*A)/P)},contains:function(n,u,f){var o=this.vertex1,c=this.vertex2,d=this.vertex3,v=o.vx,m=o.vy,S=c.vx,M=c.vy,w=d.vx,C=d.vy;if(f){var A=f.a,P=f.b,b=f.c,O=f.d,I=f.e,D=f.f;v=o.vx*A+o.vy*b+I,m=o.vx*P+o.vy*O+D,S=c.vx*A+c.vy*b+I,M=c.vx*P+c.vy*O+D,w=d.vx*A+d.vy*b+I,C=d.vx*P+d.vy*O+D}var B=w-v,G=C-m,z=S-v,X=M-m,j=n-v,Q=u-m,tt=B*B+G*G,Y=B*z+G*X,Z=B*j+G*Q,U=z*z+X*X,H=z*j+X*Q,J=tt*U-Y*Y,_=J===0?0:1/J,q=(U*Z-Y*H)*_,at=(tt*H-Y*Z)*_;return q>=0&&at>=0&&q+at<1},isCounterClockwise:function(n){var u=this.vertex1,f=this.vertex2,o=this.vertex3,c=(f.vx-u.vx)*(o.vy-u.vy)-(f.vy-u.vy)*(o.vx-u.vx);return n<=0?c>=0:c<0},load:function(n,u,f,o,c){return f=this.vertex1.load(n,u,f,o,c),f=this.vertex2.load(n,u,f,o,c),f=this.vertex3.load(n,u,f,o,c),f},transformCoordinatesLocal:function(n,u,f,o){return this.vertex1.transformCoordinatesLocal(n,u,f,o),this.vertex2.transformCoordinatesLocal(n,u,f,o),this.vertex3.transformCoordinatesLocal(n,u,f,o),this},updateBounds:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3,o=this.bounds;return o.x=Math.min(n.vx,u.vx,f.vx),o.y=Math.min(n.vy,u.vy,f.vy),o.width=Math.max(n.vx,u.vx,f.vx)-o.x,o.height=Math.max(n.vy,u.vy,f.vy)-o.y,this},isInView:function(n,u,f,o,c,d,v,m,S,M,w){this.update(o,c,d,v,m,S,M,w);var C=this.vertex1,A=this.vertex2,P=this.vertex3;if(C.ta<=0&&A.ta<=0&&P.ta<=0||u&&!this.isCounterClockwise(f))return!1;var b=this.bounds;b.x=Math.min(C.tx,A.tx,P.tx),b.y=Math.min(C.ty,A.ty,P.ty),b.width=Math.max(C.tx,A.tx,P.tx)-b.x,b.height=Math.max(C.ty,A.ty,P.ty)-b.y;var O=n.x+n.width,I=n.y+n.height;return b.width<=0||b.height<=0||n.width<=0||n.height<=0?!1:!(b.rightO||b.y>I)},scrollUV:function(n,u){return this.vertex1.scrollUV(n,u),this.vertex2.scrollUV(n,u),this.vertex3.scrollUV(n,u),this},scaleUV:function(n,u){return this.vertex1.scaleUV(n,u),this.vertex2.scaleUV(n,u),this.vertex3.scaleUV(n,u),this},setColor:function(n){return this.vertex1.color=n,this.vertex2.color=n,this.vertex3.color=n,this},update:function(n,u,f,o,c,d,v,m){return this.vertex1.update(u,f,o,c,d,v,m,n),this.vertex2.update(u,f,o,c,d,v,m,n),this.vertex3.update(u,f,o,c,d,v,m,n),this},translate:function(n,u){u===void 0&&(u=0);var f=this.vertex1,o=this.vertex2,c=this.vertex3;return f.x+=n,f.y+=u,o.x+=n,o.y+=u,c.x+=n,c.y+=u,this},x:{get:function(){return this.getInCenter().x},set:function(n){var u=this.getInCenter();this.translate(n-u.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(n){var u=this.getInCenter();this.translate(0,n-u.y)}},alpha:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.alpha+u.alpha+f.alpha)/3},set:function(n){this.vertex1.alpha=n,this.vertex2.alpha=n,this.vertex3.alpha=n}},depth:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.vz+u.vz+f.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});s.exports=l},48803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(95540),h=e(37867),a=e(25836),l=e(39318),n=new a,u=new a,f=new h,o=function(c){var d=p(c,"mesh"),v=p(c,"texture",null),m=p(c,"frame"),S=p(c,"width",1),M=p(c,"height",S),w=p(c,"widthSegments",1),C=p(c,"heightSegments",w),A=p(c,"x",0),P=p(c,"y",0),b=p(c,"z",0),O=p(c,"rotateX",0),I=p(c,"rotateY",0),D=p(c,"rotateZ",0),B=p(c,"zIsUp",!0),G=p(c,"isOrtho",d?d.dirtyCache[11]:!1),z=p(c,"colors",[16777215]),X=p(c,"alphas",[1]),j=p(c,"tile",!1),Q=p(c,"flipY",!1),tt=p(c,"width",null),Y={faces:[],verts:[]};n.set(A,P,b),u.set(O,I,D),f.fromRotationXYTranslation(u,n,B);var Z;if(!v&&d)v=d.texture,m||(Z=d.frame);else if(d&&typeof v=="string")v=d.scene.sys.textures.get(v);else if(!v)return Y;Z||(Z=v.get(m)),!tt&&G&&v&&d&&(S=Z.width/d.height,M=Z.height/d.height);var U=S/2,H=M/2,J=Math.floor(w),_=Math.floor(C),q=J+1,at=_+1,ot=S/J,rt=M/_,gt=[],yt=[],Et,At,Pt=0,Vt=1,dt=0,ut=1;Z&&(Pt=Z.u0,Vt=Z.u1,Q?(dt=Z.v1,ut=Z.v0):(dt=Z.v0,ut=Z.v1));var Rt=Vt-Pt,Dt=ut-dt;for(At=0;At{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(37867),h=e(25836),a=e(39318),l=new h,n=new h,u=new p,f=function(o,c,d,v,m,S,M,w,C,A){d===void 0&&(d=1),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=0),A===void 0&&(A=!0);var P={faces:[],verts:[]},b=o.materials;l.set(v,m,S),n.set(M,w,C),u.fromRotationXYTranslation(n,l,A);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(39318),h=function(a,l,n,u,f,o,c,d){if(u===void 0&&(u=!1),o===void 0&&(o=16777215),c===void 0&&(c=1),d===void 0&&(d=!1),a.length!==l.length&&!u){console.warn("GenerateVerts: vertices and uvs count not equal");return}var v={faces:[],vertices:[]},m,S,M,w,C,A,P,b,O,I,D,B=u?3:2,G=Array.isArray(o),z=Array.isArray(c);if(Array.isArray(n)&&n.length>0)for(m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=!0,e="untitled",r="",p="";function h(S){var M=S.indexOf("#");return M>-1?S.substring(0,M):S}function a(S){return S.models.length===0&&S.models.push({faces:[],name:e,textureCoords:[],vertexNormals:[],vertices:[]}),r="",S.models[S.models.length-1]}function l(S,M){var w=S.length>=2?S[1]:e;M.models.push({faces:[],name:w,textureCoords:[],vertexNormals:[],vertices:[]}),r=""}function n(S){S.length===2&&(r=S[1])}function u(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;a(M).vertices.push({x:C,y:A,z:P})}function f(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;isNaN(C)&&(C=0),isNaN(A)&&(A=0),isNaN(P)&&(P=0),y&&(A=1-A),a(M).textureCoords.push({u:C,v:A,w:P})}function o(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;a(M).vertexNormals.push({x:C,y:A,z:P})}function c(S,M){var w=S.length-1;if(!(w<3)){for(var C={group:r,material:p,vertices:[]},A=0;A3)){var I=0,D=0,B=0;I=parseInt(b[0],10),O>1&&b[1]!==""&&(D=parseInt(b[1],10)),O>2&&(B=parseInt(b[2],10)),I!==0&&(I<0&&(I=a(M).vertices.length+1+I),D-=1,I-=1,B-=1,C.vertices.push({textureCoordsIndex:D,vertexIndex:I,vertexNormalIndex:B}))}}a(M).faces.push(C)}}function d(S,M){S.length>=2&&M.materialLibraries.push(S[1])}function v(S){S.length>=2&&(p=S[1])}var m=function(S,M){M===void 0&&(M=!0),y=M;var w={materials:{},materialLibraries:[],models:[]};r="",p="";for(var C=S.split(` +`),A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589),p=function(h){for(var a={},l=h.split(` +`),n="",u=0;u=2?Math.floor(o[2]*255):c,v=o.length>=3?Math.floor(o[3]*255):c;a[n]=r(c,d,v);break}}}}return a};s.exports=p},92570:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a,l;if(p===void 0&&h===void 0){var n=e.getInCenter();a=n.x,l=n.y}var u=Math.cos(r),f=Math.sin(r),o=e.vertex1,c=e.vertex2,d=e.vertex3,v=o.x-a,m=o.y-l;o.set(v*u-m*f+a,v*f+m*u+l),v=c.x-a,m=c.y-l,c.set(v*u-m*f+a,v*f+m*u+l),v=d.x-a,m=d.y-l,d.set(v*u-m*f+a,v*f+m*u+l)};s.exports=y},39318:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(70554),h=e(25836),a=new r({Extends:h,initialize:function(n,u,f,o,c,d,v,m,S,M){d===void 0&&(d=16777215),v===void 0&&(v=1),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),h.call(this,n,u,f),this.vx=0,this.vy=0,this.vz=0,this.nx=m,this.ny=S,this.nz=M,this.u=o,this.v=c,this.color=d,this.alpha=v,this.tx=0,this.ty=0,this.ta=0,this.tu=o,this.tv=c},setUVs:function(l,n){return this.u=l,this.v=n,this.tu=l,this.tv=n,this},scrollUV:function(l,n){return this.tu+=l,this.tv+=n,this},scaleUV:function(l,n){return this.tu=this.u*l,this.tv=this.v*n,this},transformCoordinatesLocal:function(l,n,u,f){var o=this.x,c=this.y,d=this.z,v=l.val,m=o*v[0]+c*v[4]+d*v[8]+v[12],S=o*v[1]+c*v[5]+d*v[9]+v[13],M=o*v[2]+c*v[6]+d*v[10]+v[14],w=o*v[3]+c*v[7]+d*v[11]+v[15];this.vx=m/w*n,this.vy=-(S/w)*u,f<=0?this.vz=M/w:this.vz=-(M/w)},resize:function(l,n,u,f,o,c){return this.x=l,this.y=n,this.vx=this.x*u,this.vy=-this.y*f,this.vz=0,o<.5?this.vx+=u*(.5-o):o>.5&&(this.vx-=u*(o-.5)),c<.5?this.vy+=f*(.5-c):c>.5&&(this.vy-=f*(c-.5)),this},update:function(l,n,u,f,o,c,d,v){var m=this.vx*l+this.vy*u+o,S=this.vx*n+this.vy*f+c;return d&&(m=Math.round(m),S=Math.round(S)),this.tx=m,this.ty=S,this.ta=this.alpha*v,this},load:function(l,n,u,f,o){return l[++u]=this.tx,l[++u]=this.ty,l[++u]=this.tu,l[++u]=this.tv,l[++u]=f,l[++u]=o,n[++u]=p.getTintAppendFloatAlpha(this.color,this.ta),u}});s.exports=a},73090:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Face:e(83997),GenerateGridVerts:e(48803),GenerateObjVerts:e(34684),GenerateVerts:e(92515),ParseObj:e(85048),ParseObjMaterial:e(61485),RotateFace:e(92570),Vertex:e(39318)};s.exports=r},96550:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(Math.ceil(e.x),Math.ceil(e.y))};s.exports=y},99706:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h){return new r(h.x,h.y)};s.exports=p},68010:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y)};s.exports=y},27814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y};s.exports=y},73565:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(Math.floor(e.x),Math.floor(e.y))};s.exports=y},87555:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){if(a===void 0&&(a=new r),!Array.isArray(h))throw new Error("GetCentroid points argument must be an array");var l=h.length;if(l<1)throw new Error("GetCentroid points array must not be empty");if(l===1)a.x=h[0].x,a.y=h[0].y;else{for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)};s.exports=y},44405:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x*e.x+e.y*e.y};s.exports=y},20873:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){a===void 0&&(a=new r);for(var l=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,o=0;ol&&(l=c.x),c.xu&&(u=c.y),c.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l,n){return l===void 0&&(l=0),n===void 0&&(n=new r),n.x=h.x+(a.x-h.x)*l,n.y=h.y+(a.y-h.y)*l,n};s.exports=p},55767:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(e.y,e.x)};s.exports=y},79432:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.setTo(-h.x,-h.y)};s.exports=p},2141:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23777),h=new r({initialize:function(l,n){l===void 0&&(l=0),n===void 0&&(n=l),this.type=p.POINT,this.x=l,this.y=n},setTo:function(a,l){return a===void 0&&(a=0),l===void 0&&(l=a),this.x=a,this.y=l,this}});s.exports=h},72930:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(44405),h=function(a,l,n){n===void 0&&(n=new r);var u=a.x*l.x+a.y*l.y,f=u/p(l);return f!==0&&(n.x=f*l.x,n.y=f*l.y),n};s.exports=h},62880:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.x*a.x+h.y*a.y;return n!==0&&(l.x=n*a.x,l.y=n*a.y),l};s.exports=p},15093:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28793),p=function(h,a){if(h.x!==0||h.y!==0){var l=r(h);h.x/=l,h.y/=l}return h.x*=a,h.y*=a,h};s.exports=p},43711:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141);r.Ceil=e(96550),r.Clone=e(99706),r.CopyFrom=e(68010),r.Equals=e(27814),r.Floor=e(73565),r.GetCentroid=e(87555),r.GetMagnitude=e(28793),r.GetMagnitudeSq=e(44405),r.GetRectangleFromPoints=e(20873),r.Interpolate=e(26152),r.Invert=e(55767),r.Negative=e(79432),r.Project=e(72930),r.ProjectUnit=e(62880),r.SetMagnitude=e(15093),s.exports=r},12306:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25717),p=function(h){return new r(h.points)};s.exports=p},63814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=!1,a=-1,l=e.points.length-1;++a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63814),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},94811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(Y,Z,U){U=U||2;var H=Z&&Z.length,J=H?Z[0]*U:Y.length,_=e(Y,0,J,U,!0),q=[];if(!_||_.next===_.prev)return q;var at,ot,rt,gt,yt,Et,At;if(H&&(_=u(Y,Z,_,U)),Y.length>80*U){at=rt=Y[0],ot=gt=Y[1];for(var Pt=U;Ptrt&&(rt=yt),Et>gt&&(gt=Et);At=Math.max(rt-at,gt-ot),At=At!==0?32767/At:0}return p(_,q,U,at,ot,At,0),q}function e(Y,Z,U,H,J){var _,q;if(J===tt(Y,Z,U,H)>0)for(_=Z;_=Z;_-=H)q=X(_,Y[_],Y[_+1],q);return q&&P(q,q.next)&&(j(q),q=q.next),q}function r(Y,Z){if(!Y)return Y;Z||(Z=Y);var U=Y,H;do if(H=!1,!U.steiner&&(P(U,U.next)||A(U.prev,U,U.next)===0)){if(j(U),U=Z=U.prev,U===U.next)break;H=!0}else U=U.next;while(H||U!==Z);return Z}function p(Y,Z,U,H,J,_,q){if(Y){!q&&_&&v(Y,H,J,_);for(var at=Y,ot,rt;Y.prev!==Y.next;){if(ot=Y.prev,rt=Y.next,_?a(Y,H,J,_):h(Y)){Z.push(ot.i/U|0),Z.push(Y.i/U|0),Z.push(rt.i/U|0),j(Y),Y=rt.next,at=rt.next;continue}if(Y=rt,Y===at){q?q===1?(Y=l(r(Y),Z,U),p(Y,Z,U,H,J,_,2)):q===2&&n(Y,Z,U,H,J,_):p(r(Y),Z,U,H,J,_,1);break}}}}function h(Y){var Z=Y.prev,U=Y,H=Y.next;if(A(Z,U,H)>=0)return!1;for(var J=Z.x,_=U.x,q=H.x,at=Z.y,ot=U.y,rt=H.y,gt=J<_?J_?J>q?J:q:_>q?_:q,At=at>ot?at>rt?at:rt:ot>rt?ot:rt,Pt=H.next;Pt!==Z;){if(Pt.x>=gt&&Pt.x<=Et&&Pt.y>=yt&&Pt.y<=At&&w(J,at,_,ot,q,rt,Pt.x,Pt.y)&&A(Pt.prev,Pt,Pt.next)>=0)return!1;Pt=Pt.next}return!0}function a(Y,Z,U,H){var J=Y.prev,_=Y,q=Y.next;if(A(J,_,q)>=0)return!1;for(var at=J.x,ot=_.x,rt=q.x,gt=J.y,yt=_.y,Et=q.y,At=atot?at>rt?at:rt:ot>rt?ot:rt,dt=gt>yt?gt>Et?gt:Et:yt>Et?yt:Et,ut=S(At,Pt,Z,U,H),Rt=S(Vt,dt,Z,U,H),Dt=Y.prevZ,Ht=Y.nextZ;Dt&&Dt.z>=ut&&Ht&&Ht.z<=Rt;){if(Dt.x>=At&&Dt.x<=Vt&&Dt.y>=Pt&&Dt.y<=dt&&Dt!==J&&Dt!==q&&w(at,gt,ot,yt,rt,Et,Dt.x,Dt.y)&&A(Dt.prev,Dt,Dt.next)>=0||(Dt=Dt.prevZ,Ht.x>=At&&Ht.x<=Vt&&Ht.y>=Pt&&Ht.y<=dt&&Ht!==J&&Ht!==q&&w(at,gt,ot,yt,rt,Et,Ht.x,Ht.y)&&A(Ht.prev,Ht,Ht.next)>=0))return!1;Ht=Ht.nextZ}for(;Dt&&Dt.z>=ut;){if(Dt.x>=At&&Dt.x<=Vt&&Dt.y>=Pt&&Dt.y<=dt&&Dt!==J&&Dt!==q&&w(at,gt,ot,yt,rt,Et,Dt.x,Dt.y)&&A(Dt.prev,Dt,Dt.next)>=0)return!1;Dt=Dt.prevZ}for(;Ht&&Ht.z<=Rt;){if(Ht.x>=At&&Ht.x<=Vt&&Ht.y>=Pt&&Ht.y<=dt&&Ht!==J&&Ht!==q&&w(at,gt,ot,yt,rt,Et,Ht.x,Ht.y)&&A(Ht.prev,Ht,Ht.next)>=0)return!1;Ht=Ht.nextZ}return!0}function l(Y,Z,U){var H=Y;do{var J=H.prev,_=H.next.next;!P(J,_)&&b(J,H,H.next,_)&&B(J,_)&&B(_,J)&&(Z.push(J.i/U|0),Z.push(H.i/U|0),Z.push(_.i/U|0),j(H),j(H.next),H=Y=_),H=H.next}while(H!==Y);return r(H)}function n(Y,Z,U,H,J,_){var q=Y;do{for(var at=q.next.next;at!==q.prev;){if(q.i!==at.i&&C(q,at)){var ot=z(q,at);q=r(q,q.next),ot=r(ot,ot.next),p(q,Z,U,H,J,_,0),p(ot,Z,U,H,J,_,0);return}at=at.next}q=q.next}while(q!==Y)}function u(Y,Z,U,H){var J=[],_,q,at,ot,rt;for(_=0,q=Z.length;_=U.next.y&&U.next.y!==U.y){var at=U.x+(J-U.y)*(U.next.x-U.x)/(U.next.y-U.y);if(at<=H&&at>_&&(_=at,q=U.x=U.x&&U.x>=rt&&H!==U.x&&w(Jq.x||U.x===q.x&&d(q,U)))&&(q=U,yt=Et)),U=U.next;while(U!==ot);return q}function d(Y,Z){return A(Y.prev,Y,Z.prev)<0&&A(Z.next,Y,Y.next)<0}function v(Y,Z,U,H){var J=Y;do J.z===0&&(J.z=S(J.x,J.y,Z,U,H)),J.prevZ=J.prev,J.nextZ=J.next,J=J.next;while(J!==Y);J.prevZ.nextZ=null,J.prevZ=null,m(J)}function m(Y){var Z,U,H,J,_,q,at,ot,rt=1;do{for(U=Y,Y=null,_=null,q=0;U;){for(q++,H=U,at=0,Z=0;Z0||ot>0&&H;)at!==0&&(ot===0||!H||U.z<=H.z)?(J=U,U=U.nextZ,at--):(J=H,H=H.nextZ,ot--),_?_.nextZ=J:Y=J,J.prevZ=_,_=J;U=H}_.nextZ=null,rt*=2}while(q>1);return Y}function S(Y,Z,U,H,J){return Y=(Y-U)*J|0,Z=(Z-H)*J|0,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,Z=(Z|Z<<8)&16711935,Z=(Z|Z<<4)&252645135,Z=(Z|Z<<2)&858993459,Z=(Z|Z<<1)&1431655765,Y|Z<<1}function M(Y){var Z=Y,U=Y;do(Z.x=(Y-q)*(_-at)&&(Y-q)*(H-at)>=(U-q)*(Z-at)&&(U-q)*(_-at)>=(J-q)*(H-at)}function C(Y,Z){return Y.next.i!==Z.i&&Y.prev.i!==Z.i&&!D(Y,Z)&&(B(Y,Z)&&B(Z,Y)&&G(Y,Z)&&(A(Y.prev,Y,Z.prev)||A(Y,Z.prev,Z))||P(Y,Z)&&A(Y.prev,Y,Y.next)>0&&A(Z.prev,Z,Z.next)>0)}function A(Y,Z,U){return(Z.y-Y.y)*(U.x-Z.x)-(Z.x-Y.x)*(U.y-Z.y)}function P(Y,Z){return Y.x===Z.x&&Y.y===Z.y}function b(Y,Z,U,H){var J=I(A(Y,Z,U)),_=I(A(Y,Z,H)),q=I(A(U,H,Y)),at=I(A(U,H,Z));return!!(J!==_&&q!==at||J===0&&O(Y,U,Z)||_===0&&O(Y,H,Z)||q===0&&O(U,Y,H)||at===0&&O(U,Z,H))}function O(Y,Z,U){return Z.x<=Math.max(Y.x,U.x)&&Z.x>=Math.min(Y.x,U.x)&&Z.y<=Math.max(Y.y,U.y)&&Z.y>=Math.min(Y.y,U.y)}function I(Y){return Y>0?1:Y<0?-1:0}function D(Y,Z){var U=Y;do{if(U.i!==Y.i&&U.next.i!==Y.i&&U.i!==Z.i&&U.next.i!==Z.i&&b(U,U.next,Y,Z))return!0;U=U.next}while(U!==Y);return!1}function B(Y,Z){return A(Y.prev,Y,Y.next)<0?A(Y,Z,Y.next)>=0&&A(Y,Y.prev,Z)>=0:A(Y,Z,Y.prev)<0||A(Y,Y.next,Z)<0}function G(Y,Z){var U=Y,H=!1,J=(Y.x+Z.x)/2,_=(Y.y+Z.y)/2;do U.y>_!=U.next.y>_&&U.next.y!==U.y&&J<(U.next.x-U.x)*(_-U.y)/(U.next.y-U.y)+U.x&&(H=!H),U=U.next;while(U!==Y);return H}function z(Y,Z){var U=new Q(Y.i,Y.x,Y.y),H=new Q(Z.i,Z.x,Z.y),J=Y.next,_=Z.prev;return Y.next=Z,Z.prev=Y,U.next=J,J.prev=U,H.next=U,U.prev=H,_.next=H,H.prev=_,H}function X(Y,Z,U,H){var J=new Q(Y,Z,U);return H?(J.next=H.next,J.prev=H,H.next.prev=J,H.next=J):(J.prev=J,J.next=J),J}function j(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function Q(Y,Z,U){this.i=Y,this.x=Z,this.y=U,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}y.deviation=function(Y,Z,U,H){var J=Z&&Z.length,_=J?Z[0]*U:Y.length,q=Math.abs(tt(Y,0,_,U));if(J)for(var at=0,ot=Z.length;at0&&(H+=Y[J-1].length,U.holes.push(H))}return U},s.exports=y},13829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){a===void 0&&(a=new r);for(var l=1/0,n=1/0,u=-l,f=-n,o,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=[]);for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(23031),h=e(30052),a=function(l,n,u,f){f===void 0&&(f=[]);var o=l.points,c=h(l);!n&&u>0&&(n=c/u);for(var d=0;dm+A){m+=A;continue}var P=C.getPoint((v-m)/A);f.push(P);break}return f};s.exports=a},30052:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(23031),h=function(a){for(var l=a.points,n=0,u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(63814),h=e(9564),a=e(23777),l=new r({initialize:function(u){this.type=a.POLYGON,this.area=0,this.points=[],u&&this.setTo(u)},contains:function(n,u){return p(this,n,u)},setTo:function(n){if(this.area=0,this.points=[],typeof n=="string"&&(n=n.split(" ")),!Array.isArray(n))return this;for(var u,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.points.reverse(),e};s.exports=y},29524:s=>{function y(l,n){var u=l.x-n.x,f=l.y-n.y;return u*u+f*f}function e(l,n,u){var f=n.x,o=n.y,c=u.x-f,d=u.y-o;if(c!==0||d!==0){var v=((l.x-f)*c+(l.y-o)*d)/(c*c+d*d);v>1?(f=u.x,o=u.y):v>0&&(f+=c*v,o+=d*v)}return c=l.x-f,d=l.y-o,c*c+d*d}function r(l,n){for(var u=l[0],f=[u],o,c=1,d=l.length;cn&&(f.push(o),u=o);return u!==o&&f.push(o),f}function p(l,n,u,f,o){for(var c=f,d,v=n+1;vc&&(d=v,c=m)}c>f&&(d-n>1&&p(l,n,d,f,o),o.push(l[d]),u-d>1&&p(l,d,u,f,o))}function h(l,n){var u=l.length-1,f=[l[0]];return p(l,0,u,n,f),f.push(l[u]),f}var a=function(l,n,u){n===void 0&&(n=1),u===void 0&&(u=!1);var f=l.points;if(f.length>2){var o=n*n;u||(f=r(f,o)),l.setTo(h(f,o))}return l};s.exports=a},5469:s=>{/** + * @author Richard Davey + * @author Igor Ognichenko + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(r,p){return r[0]=p[0],r[1]=p[1],r},e=function(r){var p,h=[],a=r.points;for(p=0;p0&&l.push(y([0,0],h[0])),p=0;p1&&l.push(y([0,0],h[h.length-1])),r.setTo(l)};s.exports=e},24709:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=e.points,a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25717);r.Clone=e(12306),r.Contains=e(63814),r.ContainsPoint=e(99338),r.Earcut=e(94811),r.GetAABB=e(13829),r.GetNumberArray=e(26173),r.GetPoints=e(9564),r.Perimeter=e(30052),r.Reverse=e(8133),r.Simplify=e(29524),r.Smooth=e(5469),r.Translate=e(24709),s.exports=r},62224:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.width*e.height};s.exports=y},98615:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e};s.exports=y},31688:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height),e};s.exports=y},67502:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x=r-e.width/2,e.y=p-e.height/2,e};s.exports=y},65085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h){return new r(h.x,h.y,h.width,h.height)};s.exports=p},37303:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.width<=0||e.height<=0?!1:e.x<=r&&e.x+e.width>=r&&e.y<=p&&e.y+e.height>=p};s.exports=y},96553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37303),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},70273:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.width*r.height>e.width*e.height?!1:r.x>e.x&&r.xe.x&&r.righte.y&&r.ye.y&&r.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.width,e.height)};s.exports=y},77493:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=[]),r.push({x:e.x,y:e.y}),r.push({x:e.right,y:e.y}),r.push({x:e.right,y:e.bottom}),r.push({x:e.x,y:e.bottom}),r};s.exports=y},9219:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height};s.exports=y},53751:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8249),p=function(h,a){var l=r(h);return l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8249),p=function(h,a){var l=r(h);return l>r(a)?h.setSize(a.height*l,a.height):h.setSize(a.width,a.width/l),h.setPosition(a.centerX-h.width/2,a.centerY-h.height/2)};s.exports=p},80774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.floor(e.x),e.y=Math.floor(e.y),e};s.exports=y},83859:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height),e};s.exports=y},19217:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(36383),h=function(a,l){if(l===void 0&&(l=new r),a.length===0)return l;for(var n=Number.MAX_VALUE,u=Number.MAX_VALUE,f=p.MIN_SAFE_INTEGER,o=p.MIN_SAFE_INTEGER,c,d,v,m=0;m{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a,l,n,u){return u===void 0&&(u=new r),u.setTo(Math.min(h,l),Math.min(a,n),Math.abs(h-l),Math.abs(a-n))};s.exports=p},8249:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.height===0?NaN:e.width/e.height};s.exports=y},27165:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.centerX,a.y=h.centerY,a};s.exports=p},20812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13019),p=e(2141),h=function(a,l,n){if(n===void 0&&(n=new p),l<=0||l>=1)return n.x=a.x,n.y=a.y,n;var u=r(a)*l;return l>.5?(u-=a.width+a.height,u<=a.width?(n.x=a.right-u,n.y=a.bottom):(n.x=a.x,n.y=a.bottom-(u-a.width))):u<=a.width?(n.x=a.x+u,n.y=a.y):(n.x=a.right,n.y=a.y+(u-a.width)),n};s.exports=h},34819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20812),p=e(13019),h=function(a,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=p(a)/n);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.width,a.y=h.height,a};s.exports=p},86091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(67502),p=function(h,a,l){var n=h.centerX,u=h.centerY;return h.setSize(h.width+a*2,h.height+l*2),r(h,n,u)};s.exports=p},53951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(59996),h=function(a,l,n){return n===void 0&&(n=new r),p(a,l)?(n.x=Math.max(a.x,l.x),n.y=Math.max(a.y,l.y),n.width=Math.min(a.right,l.right)-n.x,n.height=Math.min(a.bottom,l.bottom)-n.y):n.setEmpty(),n};s.exports=h},14649:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13019),p=e(2141),h=function(a,l,n,u){if(u===void 0&&(u=[]),!l&&!n)return u;l?n=Math.round(r(a)/l):l=r(a)/n;for(var f=a.x,o=a.y,c=0,d=0;d=a.right&&(c=1,o+=f-a.right,f=a.right);break;case 1:o+=l,o>=a.bottom&&(c=2,f-=o-a.bottom,o=a.bottom);break;case 2:f-=l,f<=a.left&&(c=3,o-=a.left-f,f=a.left);break;case 3:o-=l,o<=a.top&&(c=0,o=a.top);break}return u};s.exports=h},33595:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=e.x,h=e.right,a=e.y,l=e.bottom,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=Math.min(e.x,r.x),h=Math.max(e.right,r.right);e.x=p,e.width=h-p;var a=Math.min(e.y,r.y),l=Math.max(e.bottom,r.bottom);return e.y=a,e.height=l-a,e};s.exports=y},92171:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=Math.min(e.x,r),a=Math.max(e.right,r);e.x=h,e.width=a-h;var l=Math.min(e.y,p),n=Math.max(e.bottom,p);return e.y=l,e.height=n-l,e};s.exports=y},42981:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},46907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},60170:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.xr.x&&e.yr.y};s.exports=y},13019:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 2*(e.width+e.height)};s.exports=y},85133:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(39506),h=function(a,l,n){n===void 0&&(n=new r),l=p(l);var u=Math.sin(l),f=Math.cos(l),o=f>0?a.width/2:a.width/-2,c=u>0?a.height/2:a.height/-2;return Math.abs(o*u){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.x+Math.random()*h.width,a.y=h.y+Math.random()*h.height,a};s.exports=p},86470:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(70273),h=e(2141),a=function(l,n,u){if(u===void 0&&(u=new h),p(l,n))switch(r(0,3)){case 0:u.x=l.x+Math.random()*(n.right-l.x),u.y=l.y+Math.random()*(n.top-l.y);break;case 1:u.x=n.x+Math.random()*(l.right-n.x),u.y=n.bottom+Math.random()*(l.bottom-n.bottom);break;case 2:u.x=l.x+Math.random()*(n.x-l.x),u.y=n.y+Math.random()*(l.bottom-n.y);break;case 3:u.x=n.right+Math.random()*(l.right-n.right),u.y=l.y+Math.random()*(n.bottom-l.y);break}return u};s.exports=a},87841:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37303),h=e(20812),a=e(34819),l=e(23777),n=e(23031),u=e(26597),f=new r({initialize:function(c,d,v,m){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),this.type=l.RECTANGLE,this.x=c,this.y=d,this.width=v,this.height=m},contains:function(o,c){return p(this,o,c)},getPoint:function(o,c){return h(this,o,c)},getPoints:function(o,c,d){return a(this,o,c,d)},getRandomPoint:function(o){return u(this,o)},setTo:function(o,c,d,v){return this.x=o,this.y=c,this.width=d,this.height=v,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(o,c){return c===void 0&&(c=o),this.x=o,this.y=c,this},setSize:function(o,c){return c===void 0&&(c=o),this.width=o,this.height=c,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(o){return o===void 0&&(o=new n),o.setTo(this.x,this.y,this.right,this.y),o},getLineB:function(o){return o===void 0&&(o=new n),o.setTo(this.right,this.y,this.right,this.bottom),o},getLineC:function(o){return o===void 0&&(o=new n),o.setTo(this.right,this.bottom,this.x,this.bottom),o},getLineD:function(o){return o===void 0&&(o=new n),o.setTo(this.x,this.bottom,this.x,this.y),o},left:{get:function(){return this.x},set:function(o){o>=this.right?this.width=0:this.width=this.right-o,this.x=o}},right:{get:function(){return this.x+this.width},set:function(o){o<=this.x?this.width=0:this.width=o-this.x}},top:{get:function(){return this.y},set:function(o){o>=this.bottom?this.height=0:this.height=this.bottom-o,this.y=o}},bottom:{get:function(){return this.y+this.height},set:function(o){o<=this.y?this.height=0:this.height=o-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(o){this.x=o-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(o){this.y=o-this.height/2}}});s.exports=f},94845:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.width===r.width&&e.height===r.height};s.exports=y},31730:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=r),e.width*=r,e.height*=p,e};s.exports=y},36899:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a,l){l===void 0&&(l=new r);var n=Math.min(h.x,a.x),u=Math.min(h.y,a.y),f=Math.max(h.right,a.right)-n,o=Math.max(h.bottom,a.bottom)-u;return l.setTo(n,u,f,o)};s.exports=p},93232:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841);r.Area=e(62224),r.Ceil=e(98615),r.CeilAll=e(31688),r.CenterOn=e(67502),r.Clone=e(65085),r.Contains=e(37303),r.ContainsPoint=e(96553),r.ContainsRect=e(70273),r.CopyFrom=e(43459),r.Decompose=e(77493),r.Equals=e(9219),r.FitInside=e(53751),r.FitOutside=e(16088),r.Floor=e(80774),r.FloorAll=e(83859),r.FromPoints=e(19217),r.FromXY=e(9477),r.GetAspectRatio=e(8249),r.GetCenter=e(27165),r.GetPoint=e(20812),r.GetPoints=e(34819),r.GetSize=e(51313),r.Inflate=e(86091),r.Intersection=e(53951),r.MarchingAnts=e(14649),r.MergePoints=e(33595),r.MergeRect=e(20074),r.MergeXY=e(92171),r.Offset=e(42981),r.OffsetPoint=e(46907),r.Overlaps=e(60170),r.Perimeter=e(13019),r.PerimeterPoint=e(85133),r.Random=e(26597),r.RandomOutside=e(86470),r.SameDimensions=e(94845),r.Scale=e(31730),r.Union=e(36899),s.exports=r},41658:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.x1,p=e.y1,h=e.x2,a=e.y2,l=e.x3,n=e.y3;return Math.abs(((l-r)*(a-p)-(h-r)*(n-p))/2)};s.exports=y},39208:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h,a,l){var n=l*(Math.sqrt(3)/2),u=h,f=a,o=h+l/2,c=a+n,d=h-l/2,v=a+n;return new r(u,f,o,c,d,v)};s.exports=p},39545:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(94811),p=e(16483),h=function(a,l,n,u,f){l===void 0&&(l=null),n===void 0&&(n=1),u===void 0&&(u=1),f===void 0&&(f=[]);for(var o=r(a,l),c,d,v,m,S,M,w,C,A,P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h,a,l,n){n===void 0&&(n=l);var u=h,f=a,o=h,c=a-n,d=h+l,v=a;return new r(u,f,o,c,d,v)};s.exports=p},23707:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97523),p=e(13584),h=function(a,l,n,u){u===void 0&&(u=r);var f=u(a),o=l-f.x,c=n-f.y;return p(a,o,c)};s.exports=h},97523:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=(h.x1+h.x2+h.x3)/3,a.y=(h.y1+h.y2+h.y3)/3,a};s.exports=p},24951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099);function p(a,l,n,u){return a*u-l*n}var h=function(a,l){l===void 0&&(l=new r);var n=a.x3,u=a.y3,f=a.x1-n,o=a.y1-u,c=a.x2-n,d=a.y2-u,v=2*p(f,o,c,d),m=p(o,f*f+o*o,d,c*c+d*d),S=p(f,f*f+o*o,c,c*c+d*d);return l.x=n-m/v,l.y=u+S/v,l};s.exports=h},85614:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=function(h,a){a===void 0&&(a=new r);var l=h.x1,n=h.y1,u=h.x2,f=h.y2,o=h.x3,c=h.y3,d=u-l,v=f-n,m=o-l,S=c-n,M=d*(l+u)+v*(n+f),w=m*(l+o)+S*(n+c),C=2*(d*(c-f)-v*(o-u)),A,P;if(Math.abs(C)<1e-6){var b=Math.min(l,u,o),O=Math.min(n,f,c);A=(Math.max(l,u,o)-b)*.5,P=(Math.max(n,f,c)-O)*.5,a.x=b+A,a.y=O+P,a.radius=Math.sqrt(A*A+P*P)}else a.x=(S*M-v*w)/C,a.y=(d*w-m*M)/C,A=a.x-l,P=a.y-n,a.radius=Math.sqrt(A*A+P*P);return a};s.exports=p},74422:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2,h.x3,h.y3)};s.exports=p},10690:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.x3-e.x1,a=e.y3-e.y1,l=e.x2-e.x1,n=e.y2-e.y1,u=r-e.x1,f=p-e.y1,o=h*h+a*a,c=h*l+a*n,d=h*u+a*f,v=l*l+n*n,m=l*u+n*f,S=o*v-c*c,M=S===0?0:1/S,w=(v*d-c*m)*M,C=(o*m-c*d)*M;return w>=0&&C>=0&&w+C<1};s.exports=y},48653:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=!1),h===void 0&&(h=[]);for(var a=e.x3-e.x1,l=e.y3-e.y1,n=e.x2-e.x1,u=e.y2-e.y1,f=a*a+l*l,o=a*n+l*u,c=n*n+u*u,d=f*c-o*o,v=d===0?0:1/d,m,S,M,w,C,A,P=e.x1,b=e.y1,O=0;O=0&&S>=0&&m+S<1&&(h.push({x:r[O].x,y:r[O].y}),p)));O++);return h};s.exports=y},96006:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10690),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},71326:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)};s.exports=y},71694:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=[]),r.push({x:e.x1,y:e.y1}),r.push({x:e.x2,y:e.y2}),r.push({x:e.x3,y:e.y3}),r};s.exports=y},33522:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x1===r.x1&&e.y1===r.y1&&e.x2===r.x2&&e.y2===r.y2&&e.x3===r.x3&&e.y3===r.y3};s.exports=y},20437:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(35001),h=function(a,l,n){n===void 0&&(n=new r);var u=a.getLineA(),f=a.getLineB(),o=a.getLineC();if(l<=0||l>=1)return n.x=u.x1,n.y=u.y1,n;var c=p(u),d=p(f),v=p(o),m=c+d+v,S=m*l,M=0;return Sc+d?(S-=c+d,M=S/v,n.x=o.x1+(o.x2-o.x1)*M,n.y=o.y1+(o.y2-o.y1)*M):(S-=c,M=S/d,n.x=f.x1+(f.x2-f.x1)*M,n.y=f.y1+(f.y2-f.y1)*M),n};s.exports=h},80672:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(2141),h=function(a,l,n,u){u===void 0&&(u=[]);var f=a.getLineA(),o=a.getLineB(),c=a.getLineC(),d=r(f),v=r(o),m=r(c),S=d+v+m;!l&&n>0&&(l=S/n);for(var M=0;Md+v?(w-=d+v,C=w/m,A.x=c.x1+(c.x2-c.x1)*C,A.y=c.y1+(c.y2-c.y1)*C):(w-=d,C=w/v,A.x=o.x1+(o.x2-o.x1)*C,A.y=o.y1+(o.y2-o.y1)*C),u.push(A)}return u};s.exports=h},39757:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141);function p(a,l,n,u){var f=a-n,o=l-u,c=f*f+o*o;return Math.sqrt(c)}var h=function(a,l){l===void 0&&(l=new r);var n=a.x1,u=a.y1,f=a.x2,o=a.y2,c=a.x3,d=a.y3,v=p(c,d,f,o),m=p(n,u,c,d),S=p(f,o,n,u),M=v+m+S;return l.x=(n*v+f*m+c*S)/M,l.y=(u*v+o*m+d*S)/M,l};s.exports=h},13584:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x1+=r,e.y1+=p,e.x2+=r,e.y2+=p,e.x3+=r,e.y3+=p,e};s.exports=y},1376:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=function(h){var a=h.getLineA(),l=h.getLineB(),n=h.getLineC();return r(a)+r(l)+r(n)};s.exports=p},90260:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=h.x2-h.x1,n=h.y2-h.y1,u=h.x3-h.x1,f=h.y3-h.y1,o=Math.random(),c=Math.random();return o+c>=1&&(o=1-o,c=1-c),a.x=h.x1+(l*o+u*c),a.y=h.y1+(n*o+f*c),a};s.exports=p},52172:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99614),p=e(39757),h=function(a,l){var n=p(a);return r(a,n.x,n.y,l)};s.exports=h},49907:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99614),p=function(h,a,l){return r(h,a.x,a.y,l)};s.exports=p},99614:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x1-r,u=e.y1-p;return e.x1=n*a-u*l+r,e.y1=n*l+u*a+p,n=e.x2-r,u=e.y2-p,e.x2=n*a-u*l+r,e.y2=n*l+u*a+p,n=e.x3-r,u=e.y3-p,e.x3=n*a-u*l+r,e.y3=n*l+u*a+p,e};s.exports=y},16483:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(10690),h=e(20437),a=e(80672),l=e(23777),n=e(23031),u=e(90260),f=new r({initialize:function(c,d,v,m,S,M){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),this.type=l.TRIANGLE,this.x1=c,this.y1=d,this.x2=v,this.y2=m,this.x3=S,this.y3=M},contains:function(o,c){return p(this,o,c)},getPoint:function(o,c){return h(this,o,c)},getPoints:function(o,c,d){return a(this,o,c,d)},getRandomPoint:function(o){return u(this,o)},setTo:function(o,c,d,v,m,S){return o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),this.x1=o,this.y1=c,this.x2=d,this.y2=v,this.x3=m,this.y3=S,this},getLineA:function(o){return o===void 0&&(o=new n),o.setTo(this.x1,this.y1,this.x2,this.y2),o},getLineB:function(o){return o===void 0&&(o=new n),o.setTo(this.x2,this.y2,this.x3,this.y3),o},getLineC:function(o){return o===void 0&&(o=new n),o.setTo(this.x3,this.y3,this.x1,this.y1),o},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(o){var c=0;this.x1<=this.x2&&this.x1<=this.x3?c=this.x1-o:this.x2<=this.x1&&this.x2<=this.x3?c=this.x2-o:c=this.x3-o,this.x1-=c,this.x2-=c,this.x3-=c}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(o){var c=0;this.x1>=this.x2&&this.x1>=this.x3?c=this.x1-o:this.x2>=this.x1&&this.x2>=this.x3?c=this.x2-o:c=this.x3-o,this.x1-=c,this.x2-=c,this.x3-=c}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(o){var c=0;this.y1<=this.y2&&this.y1<=this.y3?c=this.y1-o:this.y2<=this.y1&&this.y2<=this.y3?c=this.y2-o:c=this.y3-o,this.y1-=c,this.y2-=c,this.y3-=c}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(o){var c=0;this.y1>=this.y2&&this.y1>=this.y3?c=this.y1-o:this.y2>=this.y1&&this.y2>=this.y3?c=this.y2-o:c=this.y3-o,this.y1-=c,this.y2-=c,this.y3-=c}}});s.exports=f},84435:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483);r.Area=e(41658),r.BuildEquilateral=e(39208),r.BuildFromPolygon=e(39545),r.BuildRight=e(90301),r.CenterOn=e(23707),r.Centroid=e(97523),r.CircumCenter=e(24951),r.CircumCircle=e(85614),r.Clone=e(74422),r.Contains=e(10690),r.ContainsArray=e(48653),r.ContainsPoint=e(96006),r.CopyFrom=e(71326),r.Decompose=e(71694),r.Equals=e(33522),r.GetPoint=e(20437),r.GetPoints=e(80672),r.InCenter=e(39757),r.Perimeter=e(1376),r.Offset=e(13584),r.Random=e(90260),r.Rotate=e(52172),r.RotateAroundPoint=e(49907),r.RotateAroundXY=e(99614),s.exports=r},74457:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return{gameObject:e,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:r,hitAreaCallback:p,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}};s.exports=y},84409:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return function(p,h,a,l){var n=e.getPixelAlpha(h,a,l.texture.key,l.frame.name);return n&&n>=r}};s.exports=y},7003:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(93301),h=e(50792),a=e(8214),l=e(8443),n=e(78970),u=e(85098),f=e(42515),o=e(36210),c=e(61340),d=e(85955),v=new r({initialize:function(S,M){this.game=S,this.scaleManager,this.canvas,this.config=M,this.enabled=!0,this.events=new h,this.isOver=!0,this.defaultCursor="",this.keyboard=M.inputKeyboard?new n(this):null,this.mouse=M.inputMouse?new u(this):null,this.touch=M.inputTouch?new o(this):null,this.pointers=[],this.pointersTotal=M.inputActivePointers,M.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var w=0;w<=this.pointersTotal;w++){var C=new f(this,w);C.smoothFactor=M.inputSmoothFactor,this.pointers.push(C)}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 c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],S.events.once(l.BOOT,this.boot,this)},boot:function(){var m=this.game,S=m.events;this.canvas=m.canvas,this.scaleManager=m.scale,this.events.emit(a.MANAGER_BOOT),S.on(l.PRE_RENDER,this.preRender,this),S.once(l.DESTROY,this.destroy,this)},setCanvasOver:function(m){this.isOver=!0,this.events.emit(a.GAME_OVER,m)},setCanvasOut:function(m){this.isOver=!1,this.events.emit(a.GAME_OUT,m)},preRender:function(){var m=this.game.loop.now,S=this.game.loop.delta,M=this.game.scene.getScenes(!0,!0);this.time=m,this.events.emit(a.MANAGER_UPDATE);for(var w=0;w10&&(m=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 r=e(96503),p=e(87902),h=e(83419),a=e(93301),l=e(74457),n=e(84409),u=e(20339),f=e(8497),o=e(81154),c=e(8214),d=e(50792),v=e(95540),m=e(23777),S=e(89639),M=e(41212),w=e(37277),C=e(87841),A=e(37303),P=e(44594),b=e(16483),O=e(10690),I=new h({Extends:d,initialize:function(B){d.call(this),this.scene=B,this.systems=B.sys,this.settings=B.sys.settings,this.manager=B.sys.game.input,this.pluginEvents=new d,this.enabled=!0,this.displayList,this.cameras,S.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var G={cancelled:!1};this._eventContainer={stopPropagation:function(){G.cancelled=!0}},this._eventData=G,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,B.sys.events.once(P.BOOT,this.boot,this),B.sys.events.on(P.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(P.DESTROY,this.destroy,this),this.pluginEvents.emit(c.BOOT)},start:function(){var D=this.systems.events;D.on(P.TRANSITION_START,this.transitionIn,this),D.on(P.TRANSITION_OUT,this.transitionOut,this),D.on(P.TRANSITION_COMPLETE,this.transitionComplete,this),D.on(P.PRE_UPDATE,this.preUpdate,this),D.once(P.SHUTDOWN,this.shutdown,this),this.manager.events.on(c.GAME_OUT,this.onGameOut,this),this.manager.events.on(c.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(c.START)},onGameOver:function(D){this.isActive()&&this.emit(c.GAME_OVER,D.timeStamp,D)},onGameOut:function(D){this.isActive()&&this.emit(c.GAME_OUT,D.timeStamp,D)},preUpdate:function(){this.pluginEvents.emit(c.PRE_UPDATE);var D=this._pendingRemoval,B=this._pendingInsertion,G=D.length,z=B.length;if(!(G===0&&z===0)){for(var X=this._list,j=0;j-1&&(X.splice(tt,1),this.clear(Q,!0))}this._pendingRemoval.length=0,this._list=X.concat(B.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(D,B){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,D,B),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var G,z=this.manager,X=z.pointers,j=z.pointersTotal;for(G=0;G0)if(this._pollTimer-=B,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var tt=!1;for(G=0;G0&&(tt=!0)}return tt},update:function(D,B){if(!this.isActive())return!1;for(var G=B.length,z=!1,X=0;X0&&(z=!0)}return this._updatedThisFrame=!0,z},clear:function(D,B){B===void 0&&(B=!1),this.disable(D);var G=D.input;G&&(this.removeDebug(D),this.manager.resetCursor(G),G.gameObject=void 0,G.target=void 0,G.hitArea=void 0,G.hitAreaCallback=void 0,G.callbackContext=void 0,D.input=null),B||this.queueForRemoval(D);var z=this._draggable.indexOf(D);return z>-1&&this._draggable.splice(z,1),D},disable:function(D){var B=D.input;B&&(B.enabled=!1,B.dragState=0);for(var G=this._drag,z=this._over,X=this.manager,j=0,Q;j-1&&G[j].splice(Q,1),Q=z[j].indexOf(D),Q>-1&&z[j].splice(Q,1);return this},enable:function(D,B,G,z){return z===void 0&&(z=!1),D.input?D.input.enabled=!0:this.setHitArea(D,B,G),D.input&&z&&!D.input.dropZone&&(D.input.dropZone=z),this},hitTestPointer:function(D){for(var B=this.cameras.getCamerasBelowPointer(D),G=0;G0)return D.camera=z,X}return D.camera=B[0],[]},processDownEvents:function(D){var B=0,G=this._temp,z=this._eventData,X=this._eventContainer;z.cancelled=!1;for(var j=!1,Q=0;Q0&&u(D.x,D.y,D.downX,D.downY)>=X||z>0&&B>=D.downTime+z)&&(G=!0),G)return this.setDragState(D,3),this.processDragStartList(D)},processDragStartList:function(D){if(this.getDragState(D)!==3)return 0;for(var B=this._drag[D.id],G=0;G1&&(this.sortGameObjects(G,D),this.topOnly&&G.splice(1)),this._drag[D.id]=G,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(D,3),this.processDragStartList(D)):(this.setDragState(D,2),0))},processDragMoveEvent:function(D){if(this.getDragState(D)===2&&this.processDragThresholdEvent(D,this.manager.game.loop.now),this.getDragState(D)!==4)return 0;for(var B=this._tempZones,G=this._drag[D.id],z=0;z0?(X.emit(c.GAMEOBJECT_DRAG_LEAVE,D,Q),this.emit(c.DRAG_LEAVE,D,X,Q),j.target=B[0],Q=j.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q)):(X.emit(c.GAMEOBJECT_DRAG_LEAVE,D,Q),this.emit(c.DRAG_LEAVE,D,X,Q),B[0]?(j.target=B[0],Q=j.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q)):j.target=null)}else!Q&&B[0]&&(j.target=B[0],Q=j.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q));var Y,Z;if(!X.parentContainer)Y=D.worldX-j.dragX,Z=D.worldY-j.dragY;else{var U=D.worldX-j.dragStartXGlobal,H=D.worldY-j.dragStartYGlobal,J=X.getParentRotation(),_=U*Math.cos(J)+H*Math.sin(J),q=H*Math.cos(J)-U*Math.sin(J);_*=1/X.parentContainer.scaleX,q*=1/X.parentContainer.scaleY,Y=_+j.dragStartX,Z=q+j.dragStartY}X.emit(c.GAMEOBJECT_DRAG,D,Y,Z),this.emit(c.DRAG,D,X,Y,Z)}return G.length},processDragUpEvent:function(D){for(var B=this._drag[D.id],G=0;G0){var j=this.manager,Q=this._eventData,tt=this._eventContainer;Q.cancelled=!1;for(var Y=!1,Z=0;Z0){var X=this.manager,j=this._eventData,Q=this._eventContainer;j.cancelled=!1;var tt=!1;this.sortGameObjects(B,D);for(var Y=0;Y0){for(this.sortGameObjects(X,D),G=0;G0){for(this.sortGameObjects(j,D),G=0;G-1&&this._draggable.splice(X,1)}return this},makePixelPerfect:function(D){D===void 0&&(D=1);var B=this.systems.textures;return n(B,D)},setHitArea:function(D,B,G){if(B===void 0)return this.setHitAreaFromTexture(D);Array.isArray(D)||(D=[D]);var z=!1,X=!1,j=!1,Q=!1,tt=!1,Y=!0;if(M(B)&&Object.keys(B).length){var Z=B,U=D.some(function(at){return at.hasOwnProperty("faces")});if(!U){B=v(Z,"hitArea",null),G=v(Z,"hitAreaCallback",null),tt=v(Z,"pixelPerfect",!1);var H=v(Z,"alphaTolerance",1);tt&&(B={},G=this.makePixelPerfect(H))}z=v(Z,"draggable",!1),X=v(Z,"dropZone",!1),j=v(Z,"cursor",!1),Q=v(Z,"useHandCursor",!1),(!B||!G)&&(this.setHitAreaFromTexture(D),Y=!1)}else typeof B=="function"&&!G&&(G=B,B={});for(var J=0;J{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p={},h={};h.register=function(a,l,n,u,f){p[a]={plugin:l,mapping:n,settingsKey:u,configKey:f}},h.getPlugin=function(a){return p[a]},h.install=function(a){var l=a.scene.sys,n=l.settings.input,u=l.game.config;for(var f in p){var o=p[f].plugin,c=p[f].mapping,d=p[f].settingsKey,v=p[f].configKey;r(n,d,u[v])&&(a[c]=new o(a))}},h.remove=function(a){p.hasOwnProperty(a)&&delete p[a]},s.exports=h},42515:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31040),p=e(83419),h=e(20339),a=e(43855),l=e(47235),n=e(26099),u=e(25892),f=new p({initialize:function(c,d){this.manager=c,this.id=d,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new n,this.prevPosition=new n,this.midPoint=new n(-1,-1),this.velocity=new n,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=d===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(o){var c=o.getWorldPoint(this.x,this.y);return this.worldX=c.x,this.worldY=c.y,this},positionToCamera:function(o,c){return o.getWorldPoint(this.x,this.y,c)},updateMotion:function(){var o=this.position.x,c=this.position.y,d=this.midPoint.x,v=this.midPoint.y;if(!(o===d&&c===v)){var m=l(this.motionFactor,d,o),S=l(this.motionFactor,v,c);a(m,o,.1)&&(m=o),a(S,c,.1)&&(S=c),this.midPoint.set(m,S);var M=o-m,w=c-S;this.velocity.set(M,w),this.angle=r(m,S,o,c),this.distance=Math.sqrt(M*M+w*w)}},up:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.button=o.button,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),o.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=o.timeStamp,this.wasTouch=!1)},down:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.button=o.button,this.downElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),o.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),u.macOS&&o.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=o.timeStamp),this.wasTouch=!1},move:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.manager.transformPointer(this,o.pageX,o.pageY,!0),this.locked&&(this.movementX=o.movementX||o.mozMovementX||o.webkitMovementX||0,this.movementY=o.movementY||o.mozMovementY||o.webkitMovementY||0),this.moveTime=o.timeStamp,this.wasTouch=!1},wheel:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.deltaX=o.deltaX,this.deltaY=o.deltaY,this.deltaZ=o.deltaZ,this.wasTouch=!1},touchstart:function(o,c){o.pointerId&&(this.pointerId=o.pointerId),this.identifier=o.identifier,this.target=o.target,this.active=!0,this.buttons=1,this.event=c,this.downElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=c.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(o,c){this.event=c,this.manager.transformPointer(this,o.pageX,o.pageY,!0),this.moveTime=c.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(o,c){this.buttons=0,this.event=c,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=c.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(o,c){this.buttons=0,this.event=c,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=c.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?h(this.downX,this.downY,this.x,this.y):h(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?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(o,c){o===void 0&&(o=10),c===void 0&&(c=[]);for(var d=this.prevPosition.x,v=this.prevPosition.y,m=this.position.x,S=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 y={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};s.exports=y},7179:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},85375:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},39843:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},23388:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragenter"},16133:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},27829:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragleave"},53904:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragover"},56058:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},2642:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drop"},88171:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectdown"},36147:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},71692:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragenter"},96149:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},81285:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragleave"},74048:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragover"},21322:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},49378:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drop"},86754:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectmove"},86433:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectout"},60709:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectover"},24081:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdown"},11172:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointermove"},18907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerout"},95579:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerover"},35368:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerup"},26972:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wheel"},47078:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectup"},73802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectwheel"},56718:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameout"},25936:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameover"},27503:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},50852:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="process"},96438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},59152:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerlockchange"},47777:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdown"},27957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdownoutside"},19444:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointermove"},54251:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerout"},18667:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerover"},27192:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerup"},24652:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerupoutside"},45132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wheel"},44512:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="preupdate"},15757:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="shutdown"},41637:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},93802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},8214:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BOOT:e(7179),DESTROY:e(85375),DRAG_END:e(39843),DRAG_ENTER:e(23388),DRAG:e(16133),DRAG_LEAVE:e(27829),DRAG_OVER:e(53904),DRAG_START:e(56058),DROP:e(2642),GAME_OUT:e(56718),GAME_OVER:e(25936),GAMEOBJECT_DOWN:e(88171),GAMEOBJECT_DRAG_END:e(36147),GAMEOBJECT_DRAG_ENTER:e(71692),GAMEOBJECT_DRAG:e(96149),GAMEOBJECT_DRAG_LEAVE:e(81285),GAMEOBJECT_DRAG_OVER:e(74048),GAMEOBJECT_DRAG_START:e(21322),GAMEOBJECT_DROP:e(49378),GAMEOBJECT_MOVE:e(86754),GAMEOBJECT_OUT:e(86433),GAMEOBJECT_OVER:e(60709),GAMEOBJECT_POINTER_DOWN:e(24081),GAMEOBJECT_POINTER_MOVE:e(11172),GAMEOBJECT_POINTER_OUT:e(18907),GAMEOBJECT_POINTER_OVER:e(95579),GAMEOBJECT_POINTER_UP:e(35368),GAMEOBJECT_POINTER_WHEEL:e(26972),GAMEOBJECT_UP:e(47078),GAMEOBJECT_WHEEL:e(73802),MANAGER_BOOT:e(27503),MANAGER_PROCESS:e(50852),MANAGER_UPDATE:e(96438),POINTER_DOWN:e(47777),POINTER_DOWN_OUTSIDE:e(27957),POINTER_MOVE:e(19444),POINTER_OUT:e(54251),POINTER_OVER:e(18667),POINTER_UP:e(27192),POINTER_UP_OUTSIDE:e(24652),POINTER_WHEEL:e(45132),POINTERLOCK_CHANGE:e(59152),PRE_UPDATE:e(44512),SHUTDOWN:e(15757),START:e(41637),UPDATE:e(93802)}},97421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.pad=a,this.events=a.events,this.index=l,this.value=0,this.threshold=.1},update:function(h){this.value=h},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 r=e(83419),p=e(92734),h=new r({initialize:function(l,n){this.pad=l,this.events=l.manager,this.index=n,this.value=0,this.threshold=1,this.pressed=!1},update:function(a){this.value=a;var l=this.pad,n=this.index;a>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(p.BUTTON_DOWN,l,this,a),this.pad.emit(p.GAMEPAD_BUTTON_DOWN,n,a,this)):this.pressed&&(this.pressed=!1,this.events.emit(p.BUTTON_UP,l,this,a),this.pad.emit(p.GAMEPAD_BUTTON_UP,n,a,this))},destroy:function(){this.pad=null,this.events=null}});s.exports=h},99125:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97421),p=e(28884),h=e(83419),a=e(50792),l=e(26099),n=new h({Extends:a,initialize:function(f,o){a.call(this),this.manager=f,this.pad=o,this.id=o.id,this.index=o.index;for(var c=[],d=0;d=2&&(this.leftStick.set(v[0].getValue(),v[1].getValue()),d>=4&&this.rightStick.set(v[2].getValue(),v[3].getValue()))}},destroy:function(){this.removeAllListeners(),this.manager=null,this.pad=null;var u;for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(92734),a=e(99125),l=e(35154),n=e(89639),u=e(8214),f=new r({Extends:p,initialize:function(c){p.call(this),this.scene=c.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=c,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,c.pluginEvents.once(u.BOOT,this.boot,this),c.pluginEvents.on(u.START,this.start,this)},boot:function(){var o=this.scene.sys.game,c=this.settings.input,d=o.config;this.enabled=l(c,"gamepad",d.inputGamepad)&&o.device.input.gamepads,this.target=l(c,"gamepad.target",d.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(u.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(u.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var o=this,c=this.target,d=function(v){v.defaultPrevented||!o.isActive()||(o.refreshPads(),o.queue.push(v))};this.onGamepadHandler=d,c.addEventListener("gamepadconnected",d,!1),c.addEventListener("gamepaddisconnected",d,!1),this.sceneInputPlugin.pluginEvents.on(u.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(u.UPDATE,this.update);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DUALSHOCK_4:e(65294),SNES_USB:e(89651),XBOX_360:e(90089)}},46008:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},7629:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},42206:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="connected"},86544:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="disconnected"},94784:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},14325:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},92734:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BUTTON_DOWN:e(46008),BUTTON_UP:e(7629),CONNECTED:e(42206),DISCONNECTED:e(86544),GAMEPAD_BUTTON_DOWN:e(94784),GAMEPAD_BUTTON_UP:e(14325)}},48646:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Axis:e(97421),Button:e(28884),Events:e(92734),Gamepad:e(99125),GamepadPlugin:e(56654),Configs:e(64894)}},14350:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(93301),p=e(79291),h={CreatePixelPerfectHandler:e(84409),CreateInteractiveObject:e(74457),Events:e(8214),Gamepad:e(48646),InputManager:e(7003),InputPlugin:e(48205),InputPluginCache:e(89639),Keyboard:e(51442),Mouse:e(87078),Pointer:e(42515),Touch:e(95618)};h=p(!1,h,r),s.exports=h},78970:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(83419),h=e(8443),a=e(8214),l=e(46032),n=e(29747),u=new p({initialize:function(o){this.manager=o,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=n,this.onKeyUp=n,o.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var f=this.manager.config;this.enabled=f.inputKeyboard,this.target=f.inputKeyboardEventTarget,this.addCapture(f.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(h.POST_STEP,this.postUpdate,this)},startListeners:function(){var f=this;this.onKeyDown=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(a.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}},this.onKeyUp=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(a.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}};var o=this.target;o&&(o.addEventListener("keydown",this.onKeyDown,!1),o.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var f=this.target;f.removeEventListener("keydown",this.onKeyDown,!1),f.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var o=this.captures,c=0;c0},removeCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var o=this.captures,c=0;c0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(h.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});s.exports=u},28846:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(95922),a=e(8443),l=e(35154),n=e(8214),u=e(89639),f=e(30472),o=e(46032),c=e(87960),d=e(74600),v=e(44594),m=e(56583),S=new r({Extends:p,initialize:function(w){p.call(this),this.game=w.systems.game,this.scene=w.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=w,this.manager=w.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,w.pluginEvents.once(n.BOOT,this.boot,this),w.pluginEvents.on(n.START,this.start,this)},boot:function(){var M=this.settings.input;this.enabled=l(M,"keyboard",!0);var w=l(M,"keyboard.capture",null);w&&this.addCaptures(w),this.sceneInputPlugin.pluginEvents.once(n.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(n.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(n.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(v.PAUSE,this.resetKeys,this),this.scene.sys.events.on(v.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:o.UP,down:o.DOWN,left:o.LEFT,right:o.RIGHT,space:o.SPACE,shift:o.SHIFT})},addKeys:function(M,w,C){w===void 0&&(w=!0),C===void 0&&(C=!1);var A={};if(typeof M=="string"){M=M.split(",");for(var P=0;P-1?A[P]=M:A[M.keyCode]=M,w&&this.addCapture(M.keyCode),M.setEmitOnRepeat(C),M}return typeof M=="string"&&(M=o[M.toUpperCase()]),A[M]||(A[M]=new f(this,M),w&&this.addCapture(M),A[M].setEmitOnRepeat(C)),A[M]},removeKey:function(M,w,C){w===void 0&&(w=!1),C===void 0&&(C=!1);var A=this.keys,P;if(M instanceof f){var b=A.indexOf(M);b>-1&&(P=this.keys[b],this.keys[b]=void 0)}else typeof M=="string"&&(M=o[M.toUpperCase()]);return A[M]&&(P=A[M],A[M]=void 0),P&&(P.plugin=null,C&&this.removeCapture(P.keyCode),w&&P.destroy()),this},removeAllKeys:function(M,w){M===void 0&&(M=!1),w===void 0&&(w=!1);for(var C=this.keys,A=0;AM._tick)return M._tick=C,!0}return!1},update:function(){var M=this.manager.queue,w=M.length;if(!(!this.isActive()||w===0))for(var C=this.keys,A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.timeLastMatched=e.timeStamp,r.index++,r.index===r.size?!0:(r.current=r.keyCodes[r.index],!1)};s.exports=y},87960:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95922),h=e(95540),a=e(68769),l=e(92803),n=new r({initialize:function(f,o,c){if(c===void 0&&(c={}),o.length<2)return!1;this.manager=f,this.enabled=!0,this.keyCodes=[];for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66970),p=function(h,a){if(a.matched)return!0;var l=!1,n=!1;if(h.keyCode===a.current)if(a.index>0&&a.maxKeyDelay>0){var u=a.timeLastMatched+a.maxKeyDelay;h.timeStamp<=u&&(n=!0,l=r(h,a))}else n=!0,l=r(h,a);return!n&&a.resetOnWrongKey&&(a.index=0,a.current=a.keyCodes[0]),l&&(a.timeLastMatched=h.timeStamp,a.matched=!0,a.timeMatched=h.timeStamp),l};s.exports=p},92803:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.current=e.keyCodes[0],e.index=0,e.timeLastMatched=0,e.matched=!1,e.timeMatched=0,e};s.exports=y},92612:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keydown"},23345:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keyup"},21957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keycombomatch"},44743:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},3771:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keydown-"},46358:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keyup-"},75674:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},95922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ANY_KEY_DOWN:e(92612),ANY_KEY_UP:e(23345),COMBO_MATCH:e(21957),DOWN:e(44743),KEY_DOWN:e(3771),KEY_UP:e(46358),UP:e(75674)}},51442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(95922),KeyboardManager:e(78970),KeyboardPlugin:e(28846),Key:e(30472),KeyCodes:e(46032),KeyCombo:e(87960),AdvanceKeyCombo:e(66970),ProcessKeyCombo:e(68769),ResetKeyCombo:e(92803),JustDown:e(90229),JustUp:e(38796),DownDuration:e(37015),UpDuration:e(41170)}},37015:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=50);var p=e.plugin.game.loop.time-e.timeDown;return e.isDown&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e._justDown?(e._justDown=!1,!0):!1};s.exports=y},38796:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e._justUp?(e._justUp=!1,!0):!1};s.exports=y},30472:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(95922),a=new r({Extends:p,initialize:function(n,u){p.call(this),this.plugin=n,this.keyCode=u,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(l){return this.emitOnRepeat=l,this},onDown:function(l){this.originalEvent=l,this.enabled&&(this.altKey=l.altKey,this.ctrlKey=l.ctrlKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.location=l.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(h.DOWN,this,l):(this.isDown=!0,this.isUp=!1,this.timeDown=l.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(h.DOWN,this,l)))},onUp:function(l){this.originalEvent=l,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=l.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(h.UP,this,l))},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}});s.exports=a},46032:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},74600:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(46032),p={};for(var h in r)p[r[h]]=h;s.exports=p},41170:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=50);var p=e.plugin.game.loop.time-e.timeUp;return e.isUp&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89357),h=e(8214),a=e(29747),l=new r({initialize:function(u){this.manager=u,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,u.events.once(h.MANAGER_BOOT,this.boot,this)},boot:function(){var n=this.manager.config;this.enabled=n.inputMouse,this.target=n.inputMouseEventTarget,this.passive=n.inputMousePassive,this.preventDefaultDown=n.inputMousePreventDefaultDown,this.preventDefaultUp=n.inputMousePreventDefaultUp,this.preventDefaultMove=n.inputMousePreventDefaultMove,this.preventDefaultWheel=n.inputMousePreventDefaultWheel,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},requestPointerLock:function(){if(p.pointerLock){var n=this.target;n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock,n.requestPointerLock()}},releasePointerLock:function(){p.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var n=this.target;if(n){var u=this,f=this.manager,o=f.canvas,c=window&&window.focus&&f.game.config.autoFocus;this.onMouseMove=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseMove(v),u.preventDefaultMove&&v.preventDefault())},this.onMouseDown=function(v){c&&window.focus(),!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseDown(v),u.preventDefaultDown&&v.target===o&&v.preventDefault())},this.onMouseDownWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==o&&f.onMouseDown(v)},this.onMouseUp=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseUp(v),u.preventDefaultUp&&v.target===o&&v.preventDefault())},this.onMouseUpWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==o&&f.onMouseUp(v)},this.onMouseOver=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOver(v)},this.onMouseOut=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOut(v)},this.onMouseWheel=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.onMouseWheel(v),u.preventDefaultWheel&&v.target===o&&v.preventDefault()};var d={passive:!0};if(n.addEventListener("mousemove",this.onMouseMove),n.addEventListener("mousedown",this.onMouseDown),n.addEventListener("mouseup",this.onMouseUp),n.addEventListener("mouseover",this.onMouseOver,d),n.addEventListener("mouseout",this.onMouseOut,d),this.preventDefaultWheel?n.addEventListener("wheel",this.onMouseWheel,{passive:!1}):n.addEventListener("wheel",this.onMouseWheel,d),window&&f.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,d),window.top.addEventListener("mouseup",this.onMouseUpWindow,d)}catch{window.addEventListener("mousedown",this.onMouseDownWindow,d),window.addEventListener("mouseup",this.onMouseUpWindow,d),this.isTop=!1}p.pointerLock&&(this.pointerLockChange=function(v){var m=u.target;u.locked=document.pointerLockElement===m||document.mozPointerLockElement===m||document.webkitPointerLockElement===m,f.onPointerLockChange(v)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var n=this.target;n.removeEventListener("mousemove",this.onMouseMove),n.removeEventListener("mousedown",this.onMouseDown),n.removeEventListener("mouseup",this.onMouseUp),n.removeEventListener("mouseover",this.onMouseOver),n.removeEventListener("mouseout",this.onMouseOut),window&&(n=this.isTop?window.top:window,n.removeEventListener("mousedown",this.onMouseDownWindow),n.removeEventListener("mouseup",this.onMouseUpWindow)),p.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}});s.exports=l},87078:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={MouseManager:e(85098)}},36210:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8214),h=e(29747),a=new r({initialize:function(n){this.manager=n,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=h,this.onTouchStartWindow=h,this.onTouchMove=h,this.onTouchEnd=h,this.onTouchEndWindow=h,this.onTouchCancel=h,this.onTouchCancelWindow=h,this.isTop=!0,n.events.once(p.MANAGER_BOOT,this.boot,this)},boot:function(){var l=this.manager.config;this.enabled=l.inputTouch,this.target=l.inputTouchEventTarget,this.capture=l.inputTouchCapture,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,l.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(l){return l.preventDefault(),!1}),this},startListeners:function(){var l=this.target;if(l){var n=this,u=this.manager,f=u.canvas,o=window&&window.focus&&u.game.config.autoFocus;this.onTouchMove=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchMove(m),n.capture&&m.cancelable&&m.preventDefault())},this.onTouchStart=function(m){o&&window.focus(),!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchStart(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchStartWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchStart(m)},this.onTouchEnd=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchEnd(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchEndWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchEnd(m)},this.onTouchCancel=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchCancel(m),n.capture&&m.preventDefault())},this.onTouchCancelWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&u.onTouchCancel(m)};var c=this.capture,d={passive:!0},v={passive:!1};if(l.addEventListener("touchstart",this.onTouchStart,c?v:d),l.addEventListener("touchmove",this.onTouchMove,c?v:d),l.addEventListener("touchend",this.onTouchEnd,c?v:d),l.addEventListener("touchcancel",this.onTouchCancel,c?v:d),window&&u.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,v),window.top.addEventListener("touchend",this.onTouchEndWindow,v),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,v)}catch{window.addEventListener("touchstart",this.onTouchStartWindow,v),window.addEventListener("touchend",this.onTouchEndWindow,v),window.addEventListener("touchcancel",this.onTouchCancelWindow,v),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var l=this.target;l.removeEventListener("touchstart",this.onTouchStart),l.removeEventListener("touchmove",this.onTouchMove),l.removeEventListener("touchend",this.onTouchEnd),l.removeEventListener("touchcancel",this.onTouchCancel),window&&(l=this.isTop?window.top:window,l.removeEventListener("touchstart",this.onTouchStartWindow),l.removeEventListener("touchend",this.onTouchEndWindow),l.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});s.exports=a},95618:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={TouchManager:e(36210)}},41299:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(54899),a=e(95540),l=e(98356),n=e(3374),u=e(84376),f=e(92638),o=new r({initialize:function(d,v){if(this.loader=d,this.cache=a(v,"cache",!1),this.type=a(v,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(v,"key",!1);var m=this.key;if(d.prefix&&d.prefix!==""&&(this.key=d.prefix+m),!this.key)throw new Error("Invalid File key: "+this.key);var S=a(v,"url");S===void 0?S=d.path+m+"."+a(v,"extension",""):typeof S=="string"&&!S.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)&&(S=d.path+S),this.url=S,this.src="",this.xhrSettings=f(a(v,"responseType",void 0)),a(v,"xhrSettings",!1)&&(this.xhrSettings=n(this.xhrSettings,a(v,"xhrSettings",{}))),this.xhrLoader=null,this.state=typeof this.url=="function"?p.FILE_POPULATED:p.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(v,"config",{}),this.multiFile,this.linkFile,this.base64=typeof S=="string"&&S.indexOf("data:")===0},setLink:function(c){this.linkFile=c,c.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===p.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=p.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.src.indexOf("data:")===0&&(this.base64=!0),this.xhrLoader=u(this,this.loader.xhr))},onLoad:function(c,d){var v=c.responseURL&&this.loader.localSchemes.some(function(M){return c.responseURL.indexOf(M)===0}),m=v&&d.target.status===0,S=!(d.target&&d.target.status!==200)||m;c.readyState===4&&c.status>=400&&c.status<=599&&(S=!1),this.state=p.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,S)},onBase64Load:function(c){this.xhrLoader=c,this.state=p.FILE_LOADED,this.percentComplete=1,this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(c){c.lengthComputable&&(this.bytesLoaded=c.loaded,this.bytesTotal=c.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=p.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=p.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=p.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(c){if(this.state!==p.FILE_PENDING_DESTROY){c===void 0&&(c=this.data);var d=this.key,v=this.type;this.loader.emit(h.FILE_COMPLETE,d,v,c),this.loader.emit(h.FILE_KEY_COMPLETE+v+"-"+d,d,v,c),this.loader.flagForRemoval(this),this.state=p.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});o.createObjectURL=function(c,d,v){if(typeof URL=="function")c.src=URL.createObjectURL(d);else{var m=new FileReader;m.onload=function(){c.removeAttribute("crossOrigin"),c.src="data:"+(d.type||v)+";base64,"+m.result.split(",")[1]},m.onerror=c.onerror,m.readAsDataURL(d)}},o.revokeObjectURL=function(c){typeof URL=="function"&&URL.revokeObjectURL(c.src)},s.exports=o},74099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={},e={install:function(r){for(var p in y)r[p]=y[p]},register:function(r,p){y[r]=p},destroy:function(){y={}}};s.exports=e},98356:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.url?e.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?e.url:r+e.url:!1};s.exports=y},74261:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(35072),a=e(50792),l=e(54899),n=e(74099),u=e(95540),f=e(35154),o=e(37277),c=e(44594),d=e(92638),v=new r({Extends:a,initialize:function(S){a.call(this);var M=S.sys.game.config,w=S.sys.settings.loader;this.scene=S,this.systems=S.sys,this.cacheManager=S.sys.cache,this.textureManager=S.sys.textures,this.sceneManager=S.sys.game.scene,n.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(u(w,"baseURL",M.loaderBaseURL)),this.setPath(u(w,"path",M.loaderPath)),this.setPrefix(u(w,"prefix",M.loaderPrefix)),this.maxParallelDownloads=u(w,"maxParallelDownloads",M.loaderMaxParallelDownloads),this.xhr=d(u(w,"responseType",M.loaderResponseType),u(w,"async",M.loaderAsync),u(w,"user",M.loaderUser),u(w,"password",M.loaderPassword),u(w,"timeout",M.loaderTimeout),u(w,"withCredentials",M.loaderWithCredentials)),this.crossOrigin=u(w,"crossOrigin",M.loaderCrossOrigin),this.imageLoadType=u(w,"imageLoadType",M.loaderImageLoadType),this.localSchemes=u(w,"localScheme",M.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new h,this.inflight=new h,this.queue=new h,this._deleteQueue=new h,this.totalFailed=0,this.totalComplete=0,this.state=p.LOADER_IDLE,this.multiKeyIndex=0,S.sys.events.once(c.BOOT,this.boot,this),S.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.baseURL=m,this},setPath:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.path=m,this},setPrefix:function(m){return m===void 0&&(m=""),this.prefix=m,this},setCORS:function(m){return this.crossOrigin=m,this},addFile:function(m){Array.isArray(m)||(m=[m]);for(var S=0;S0},isLoading:function(){return this.state===p.LOADER_LOADING||this.state===p.LOADER_PROCESSING},isReady:function(){return this.state===p.LOADER_IDLE||this.state===p.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(l.START,this),this.list.size===0?this.loadComplete():(this.state=p.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(l.PROGRESS,this.progress)},update:function(){this.state===p.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 r=e(79291),p=e(92638),h=function(a,l){var n=a===void 0?p():r({},a);if(l)for(var u in l)l[u]!==void 0&&(n[u]=l[u]);return n};s.exports=h},26430:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(54899),a=new r({initialize:function(n,u,f,o){var c=[];o.forEach(function(m){m&&c.push(m)}),this.loader=n,this.type=u,this.key=f;var d=this.key;n.prefix&&n.prefix!==""&&(this.key=n.prefix+d),this.multiKeyIndex=n.multiKeyIndex++,this.files=c,this.state=p.FILE_PENDING,this.complete=!1,this.pending=c.length,this.failed=0,this.config={},this.baseURL=n.baseURL,this.path=n.path,this.prefix=n.prefix;for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3374),p=function(h,a){var l=r(a,h.xhrSettings);if(h.base64){var n=h.url.split(";base64,").pop()||h.url.split(",").pop(),u={responseText:atob(n)};h.onBase64Load(u);return}var f=new XMLHttpRequest;if(f.open("GET",h.src,l.async,l.user,l.password),f.responseType=h.xhrSettings.responseType,f.timeout=l.timeout,l.headers)for(var o in l.headers)f.setRequestHeader(o,l.headers[o]);return l.header&&l.headerValue&&f.setRequestHeader(l.header,l.headerValue),l.requestedWith&&f.setRequestHeader("X-Requested-With",l.requestedWith),l.overrideMimeType&&f.overrideMimeType(l.overrideMimeType),l.withCredentials&&(f.withCredentials=!0),f.onload=h.onLoad.bind(h,f),f.onerror=h.onError.bind(h,f),f.onprogress=h.onProgress.bind(h),f.ontimeout=h.onError.bind(h,f),f.send(),f};s.exports=p},92638:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){return e===void 0&&(e=""),r===void 0&&(r=!0),p===void 0&&(p=""),h===void 0&&(h=""),a===void 0&&(a=0),l===void 0&&(l=!1),{responseType:e,async:r,user:p,password:h,timeout:a,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:l}};s.exports=y},23906:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},42155:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addfile"},38991:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},27540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="filecomplete"},87464:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="filecomplete-"},94486:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loaderror"},13035:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="load"},38144:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fileprogress"},97520:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postprocess"},85595:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="progress"},55680:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},54899:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(42155),COMPLETE:e(38991),FILE_COMPLETE:e(27540),FILE_KEY_COMPLETE:e(87464),FILE_LOAD_ERROR:e(94486),FILE_LOAD:e(13035),FILE_PROGRESS:e(38144),POST_PROCESS:e(97520),PROGRESS:e(85595),START:e(55680)}},14135:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(518),a=e(54899),l=new r({Extends:h,initialize:function(u,f,o,c,d){h.call(this,u,f,o,c,d),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),h.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});p.register("animation",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new n(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","json"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new n(c,d,m,M);w.linkFile?u.call(this,c,"atlasjson",d,[w,C,w.linkFile]):u.call(this,c,"atlasjson",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(o.key,o.data,c.data,d),c.addToCache(),this.complete=!0}}});p.register("aseprite",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new n(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","json"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new n(c,d,m,M);w.linkFile?u.call(this,c,"atlasjson",d,[w,C,w.linkFile]):u.call(this,c,"atlasjson",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(o.key,o.data,c.data,d),this.complete=!0}}});p.register("atlas",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(57318),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new u(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","xml"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new u(c,d,m,M);w.linkFile?n.call(this,c,"atlasxml",d,[w,C,w.linkFile]):n.call(this,c,"atlasxml",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(o.key,o.data,c.data,d),this.complete=!0}}});p.register("atlasXML",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(89749),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){if(u(d)){var M=d;d=l(M,"key"),m=l(M,"xhrSettings"),S=l(M,"context",S)}var w={type:"audio",cache:c.cacheManager.audio,extension:v.type,responseType:"arraybuffer",key:d,url:v.url,xhrSettings:m,config:{context:S}};h.call(this,c,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var o=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(c){o.data=c,o.onProcessComplete()},function(c){console.error("Error decoding audio: "+o.key+" - ",c?c.message:null),o.onProcessError()}),this.config.context=null}});f.create=function(o,c,d,v,m){var S=o.systems.game,M=S.config.audio,w=S.device.audio;u(c)&&(d=l(c,"url",[]),v=l(c,"config",{}));var C=f.getAudioURL(S,d);return C?w.webAudio&&!M.disableWebAudio?new f(o,c,C,m,S.sound.context):new n(o,c,C,v):(console.warn('No audio URLs for "%s" matched this device',c),null)},f.getAudioURL=function(o,c){Array.isArray(c)||(c=[c]);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21097),p=e(83419),h=e(74099),a=e(95540),l=e(41212),n=e(518),u=e(26430),f=new p({Extends:u,initialize:function(c,d,v,m,S,M,w){if(l(d)){var C=d;d=a(C,"key"),v=a(C,"jsonURL"),m=a(C,"audioURL"),S=a(C,"audioConfig"),M=a(C,"audioXhrSettings"),w=a(C,"jsonXhrSettings")}var A;if(!m)A=new n(c,d,v,w),u.call(this,c,"audiosprite",d,[A]),this.config.resourceLoad=!0,this.config.audioConfig=S,this.config.audioXhrSettings=M;else{var P=r.create(c,d,m,S,M);P&&(A=new n(c,d,v,w),u.call(this,c,"audiosprite",d,[P,A]),this.config.resourceLoad=!1)}},onFileComplete:function(o){var c=this.files.indexOf(o);if(c!==-1&&(this.pending--,this.config.resourceLoad&&o.type==="json"&&o.data.hasOwnProperty("resources"))){var d=o.data.resources,v=a(this.config,"audioConfig"),m=a(this.config,"audioXhrSettings"),S=r.create(this.loader,o.key,d,v,m);S&&(this.addToMultiFile(S),this.loader.addFile(S))}},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1];o.addToCache(),c.addToCache(),this.complete=!0}}});h.register("audioSprite",function(o,c,d,v,m,S){var M=this.systems.game,w=M.config.audio,C=M.device.audio;if(w&&w.noAudio||!C.webAudio&&!C.audioData)return this;var A;if(Array.isArray(o))for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="bin";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"xhrSettings"),S=l(M,"extension",S),m=l(M,"dataType",m)}var w={type:"binary",cache:o.cacheManager.binary,extension:S,responseType:"arraybuffer",key:c,url:d,xhrSettings:v,config:{dataType:m}};h.call(this,o,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.dataType;this.data=f?new f(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(21859),f=e(57318),o=new r({Extends:n,initialize:function(d,v,m,S,M,w){var C,A;if(l(v)){var P=v;v=h(P,"key"),C=new a(d,{key:v,url:h(P,"textureURL"),extension:h(P,"textureExtension","png"),normalMap:h(P,"normalMap"),xhrSettings:h(P,"textureXhrSettings")}),A=new f(d,{key:v,url:h(P,"fontDataURL"),extension:h(P,"fontDataExtension","xml"),xhrSettings:h(P,"fontDataXhrSettings")})}else C=new a(d,v,m,M),A=new f(d,v,S,w);C.linkFile?n.call(this,d,"bitmapfont",v,[C,A,C.linkFile]):n.call(this,d,"bitmapfont",v,[C,A])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1];c.addToCache();var v=c.cache.get(c.key),m=u(d.data,c.cache.getFrame(c.key),0,0,v);this.loader.cacheManager.bitmapFont.add(c.key,{data:m,texture:c.key,frame:null}),this.complete=!0}}});p.register("bitmapFont",function(c,d,v,m,S){var M;if(Array.isArray(c))for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="css";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"script",cache:!1,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38734),p=e(85722),h=e(83419),a=e(74099),l=e(95540),n=e(19550),u=e(41212),f=e(518),o=e(31403),c=e(46975),d=e(59327),v=e(26430),m=e(82038),S=e(55222),M=new h({Extends:v,initialize:function(C,A,P,b){if(P.multiAtlasURL){var O=new f(C,{key:A,url:P.multiAtlasURL,xhrSettings:b,config:P});v.call(this,C,"texture",A,[O])}else{var I=P.textureURL.substr(P.textureURL.length-3);P.type||(P.type=I.toLowerCase()==="ktx"?"KTX":"PVR");var D=new p(C,{key:A,url:P.textureURL,extension:I,xhrSettings:b,config:P});if(P.atlasURL){var B=new f(C,{key:A,url:P.atlasURL,xhrSettings:b,config:P});v.call(this,C,"texture",A,[D,B])}else v.call(this,C,"texture",A,[D])}this.config=P},onFileComplete:function(w){var C=this.files.indexOf(w);if(C!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(w.type==="json"&&w.data.hasOwnProperty("textures")){var A=w.data.textures,P=this.config,b=this.loader,O=b.baseURL,I=b.path,D=b.prefix,B=l(P,"multiBaseURL",this.baseURL),G=l(P,"multiPath",this.path),z=l(P,"prefix",this.prefix),X=l(P,"textureXhrSettings");B&&b.setBaseURL(B),G&&b.setPath(G),z&&b.setPrefix(z);for(var j=0;j{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(73894),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="glsl";if(n(d)){var w=d;d=l(w,"key"),v=l(w,"url"),m=l(w,"shaderType","fragment"),S=l(w,"xhrSettings"),M=l(w,"extension",M)}else m===void 0&&(m="fragment");var C={type:"glsl",cache:c.cacheManager.shader,extension:M,responseType:"text",key:d,url:v,config:{shaderType:m},xhrSettings:S};h.call(this,c,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var o=this.data.split(` +`),c=this.extractBlock(o,0);if(c)for(;c;){var d=this.getShaderName(c.header),v=this.getShaderType(c.header),m=this.getShaderUniforms(c.header),S=c.shader;if(this.cache.has(d)){var M=this.cache.get(d);v==="fragment"?M.fragmentSrc=S:M.vertexSrc=S,M.uniforms||(M.uniforms=m)}else v==="fragment"?this.cache.add(d,new u(d,S,"",m)):this.cache.add(d,new u(d,"",S,m));c=this.extractBlock(o,c.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new u(this.key,this.data)):this.cache.add(this.key,new u(this.key,"",this.data))},getShaderName:function(o){for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(54899),h=e(41299),a=e(95540),l=e(98356),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){if(n(c)){var m=c;c=a(m,"key"),v=a(m,"config",v)}var S={type:"audio",cache:o.cacheManager.audio,extension:d.type,key:c,url:d.url,config:v};h.call(this,o,S),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 f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="html";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",cache:o.cacheManager.html,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){v===void 0&&(v=512),m===void 0&&(m=512);var M="html";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"width",v),m=l(w,"height",m)}var C={type:"html",cache:o.textureManager,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{width:v,height:m}};h.call(this,o,C)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.width,o=this.config.height,c=[];c.push(''),c.push(''),c.push(''),c.push(this.xhrLoader.responseText),c.push(""),c.push(""),c.push("");var d=[c.join(` +`)],v=this;try{var m=new window.Blob(d,{type:"image/svg+xml;charset=utf-8"})}catch{v.state=p.FILE_ERRORED,v.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){h.revokeObjectURL(v.data),v.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(v.data),v.onProcessError()},h.createObjectURL(this.data,m,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(98356),f=new r({Extends:h,initialize:function o(c,d,v,m,S){var M="png",w;if(n(d)){var C=d;d=l(C,"key"),v=l(C,"url"),w=l(C,"normalMap"),m=l(C,"xhrSettings"),M=l(C,"extension",M),S=l(C,"frameConfig")}Array.isArray(v)&&(w=v[1],v=v[0]);var A={type:"image",cache:c.textureManager,extension:M,responseType:"blob",key:d,url:v,xhrSettings:m,config:S};if(h.call(this,c,A),w){var P=new o(c,this.key,w,m,S);P.type="normalMap",this.setLink(P),c.addFile(P)}this.useImageElementLoad=c.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var o=this;this.data.onload=function(){h.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(o.data),o.onProcessError()},h.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var o=this.state;this.state=p.FILE_PROCESSING,o===p.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=p.FILE_LOADING,this.src=u(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var o=this;this.data.onload=function(){o.state=p.FILE_LOADED,o.loader.nextFile(o,!0)},this.data.onerror=function(){o.loader.nextFile(o,!1)},this.data.src=this.src},addToCache:function(){var o=this.linkFile;o?o.state>=p.FILE_COMPLETE&&(o.type==="spritesheet"?o.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,o.data,this.data):this.cache.addImage(this.key,this.data,o.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(35154),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="json";if(u(d)){var w=d;d=l(w,"key"),v=l(w,"url"),m=l(w,"xhrSettings"),M=l(w,"extension",M),S=l(w,"dataKey",S)}var C={type:"json",cache:c.cacheManager.json,extension:M,responseType:"text",key:d,url:v,xhrSettings:m,config:S};h.call(this,c,C),u(v)&&(S?this.data=n(v,S):this.data=v,this.state=p.FILE_POPULATED)},onProcess:function(){if(this.state!==p.FILE_POPULATED){this.state=p.FILE_PROCESSING;try{var o=JSON.parse(this.xhrLoader.responseText)}catch(d){throw this.onProcessError(),d}var c=this.config;typeof c=="string"?this.data=n(o,c,o):this.data=o}this.onProcessComplete()}});a.register("json",function(o,c,d,v){if(Array.isArray(o))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M,w){if(l(d)){var C=d;d=h(C,"key"),h(C,"url",!1)?v=h(C,"url"):v=h(C,"atlasURL"),M=h(C,"xhrSettings"),m=h(C,"path"),S=h(C,"baseURL"),w=h(C,"textureXhrSettings")}var A=new n(c,d,v,M);u.call(this,c,"multiatlas",d,[A]),this.config.path=m,this.config.baseURL=S,this.config.textureXhrSettings=w},onFileComplete:function(o){var c=this.files.indexOf(o);if(c!==-1&&(this.pending--,o.type==="json"&&o.data.hasOwnProperty("textures"))){var d=o.data.textures,v=this.config,m=this.loader,S=m.baseURL,M=m.path,w=m.prefix,C=h(v,"baseURL",this.baseURL),A=h(v,"path",this.path),P=h(v,"prefix",this.prefix),b=h(v,"textureXhrSettings");m.setBaseURL(C),m.setPath(A),m.setPrefix(P);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(41212),l=e(26430),n=e(34328),u=new r({Extends:l,initialize:function(o,c,d,v){var m="js",S=[];if(a(c)){var M=c;c=h(M,"key"),d=h(M,"url"),v=h(M,"xhrSettings"),m=h(M,"extension",m)}Array.isArray(d)||(d=[d]);for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(41212),l=e(26430),n=e(85048),u=e(61485),f=e(78776),o=new r({Extends:l,initialize:function(d,v,m,S,M,w){var C,A,P=d.cacheManager.obj;if(a(v)){var b=v;v=h(b,"key"),C=new f(d,{key:v,type:"obj",cache:P,url:h(b,"url"),extension:h(b,"extension","obj"),xhrSettings:h(b,"xhrSettings"),config:{flipUV:h(b,"flipUV",M)}}),S=h(b,"matURL"),S&&(A=new f(d,{key:v,type:"mat",cache:P,url:S,extension:h(b,"matExtension","mat"),xhrSettings:h(b,"xhrSettings")}))}else C=new f(d,{key:v,url:m,type:"obj",cache:P,extension:"obj",xhrSettings:w,config:{flipUV:M}}),S&&(A=new f(d,{key:v,url:S,type:"mat",cache:P,extension:"mat",xhrSettings:w}));l.call(this,d,"obj",v,[C,A])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1],v=n(c.data,c.config.flipUV);d&&(v.materials=u(d.data)),c.cache.add(c.key,v),this.complete=!0}}});p.register("obj",function(c,d,v,m,S){var M;if(Array.isArray(c))for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(74099),a=e(518),l=new r({Extends:a,initialize:function(u,f,o,c,d){a.call(this,u,f,o,c,d),this.type="packfile"},onProcess:function(){if(this.state!==p.FILE_POPULATED&&(this.state=p.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var n={};n[this.config]=this.data,this.data=n}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});h.register("pack",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){var M="js";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"start"),m=l(w,"mapping")}var C={type:"plugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{start:v,mapping:m}};h.call(this,o,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,o=this.config,c=l(o,"start",!1),d=l(o,"mapping",null);if(this.state===p.FILE_POPULATED)f.install(this.key,this.data,c,d);else{this.state=p.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 v=f.install(this.key,window[this.key],c,d);(c||d)&&(this.loader.systems[d]=v,this.loader.scene[d]=v)}this.onProcessComplete()}});a.register("plugin",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="svg";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"svgConfig",{}),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"svg",cache:o.textureManager,extension:S,responseType:"text",key:c,url:d,xhrSettings:m,config:{width:l(v,"width"),height:l(v,"height"),scale:l(v,"scale")}};h.call(this,o,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.xhrLoader.responseText,o=[f],c=this.config.width,d=this.config.height,v=this.config.scale;t:if(c&&d||v){var m=null,S=new DOMParser;m=S.parseFromString(f,"text/xml");var M=m.getElementsByTagName("svg")[0],w=M.hasAttribute("viewBox"),C=parseFloat(M.getAttribute("width")),A=parseFloat(M.getAttribute("height"));if(!w&&C&&A)M.setAttribute("viewBox","0 0 "+C+" "+A);else if(w&&!C&&!A){var P=M.getAttribute("viewBox").split(/\s+|,/);C=P[2],A=P[3]}if(v)if(C&&A)c=C*v,d=A*v;else break t;M.setAttribute("width",c.toString()+"px"),M.setAttribute("height",d.toString()+"px"),o=[new XMLSerializer().serializeToString(M)]}try{var b=new window.Blob(o,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var O=this,I=!1;this.data.onload=function(){I||h.revokeObjectURL(O.data),O.onProcessComplete()},this.data.onerror=function(){I?O.onProcessError():(I=!0,h.revokeObjectURL(O.data),O.data.src="data:image/svg+xml,"+encodeURIComponent(o.join("")))},h.createObjectURL(this.data,b,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="js";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var f=this.data.concat(`(function(){ +return new `+this.key+`(); +}).call(this);`),o=eval;this.loader.sceneManager.add(this.key,o(f)),this.complete=!0}});a.register("sceneFile",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){var M="js";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"systemKey"),m=l(w,"sceneKey")}var C={type:"scenePlugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{systemKey:v,sceneKey:m}};h.call(this,o,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,o=this.config,c=this.key,d=l(o,"systemKey",c),v=l(o,"sceneKey",c);this.state===p.FILE_POPULATED?f.installScenePlugin(d,this.data,v,this.loader.scene,!0):(this.state=p.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),f.installScenePlugin(d,window[this.key],v,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="js";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"type","script"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}else v===void 0&&(v="script");var w={type:v,cache:!1,extension:S,responseType:"text",key:c,url:d,xhrSettings:m};h.call(this,o,w)},onProcess:function(){this.state=p.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()}});a.register("script",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(74099),a=e(19550),l=new r({Extends:a,initialize:function(u,f,o,c,d){a.call(this,u,f,o,d,c),this.type="spritesheet"},addToCache:function(){var n=this.linkFile;n?n.state>=p.FILE_COMPLETE&&(this.type==="normalMap"?this.cache.addSpriteSheet(this.key,n.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,n.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});h.register("spritesheet",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="text",S="txt",M=o.cacheManager.text;if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),v=l(w,"xhrSettings"),S=l(w,"extension",S),m=l(w,"type",m),M=l(w,"cache",M)}var C={type:m,cache:M,extension:S,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(80341),f=new r({Extends:h,initialize:function(c,d,v,m){var S="csv";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"tilemapCSV",cache:c.cacheManager.tilemap,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,w),this.tilemapFormat=u.CSV},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var o={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,o)}});a.register("tilemapCSV",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(518),a=e(80341),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,u,f,o,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapImpact",function(n,u,f){if(Array.isArray(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 r=e(83419),p=e(74099),h=e(518),a=e(80341),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,u,f,o,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapTiledJSON",function(n,u,f){if(Array.isArray(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 r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(78776),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new u(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","txt"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new u(c,d,m,M);w.linkFile?n.call(this,c,"unityatlas",d,[w,C,w.linkFile]):n.call(this,c,"unityatlas",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(o.key,o.data,c.data,d),this.complete=!0}}});p.register("unityAtlas",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(98356),n=e(95540),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m){if(m===void 0&&(m=!1),u(d)){var S=d;d=n(S,"key"),v=n(S,"url",[]),m=n(S,"noAudio",!1)}var M=c.systems.game.device.video.getVideoURL(v);M||console.warn("VideoFile: No supported format for "+d);var w={type:"video",cache:c.cacheManager.video,extension:M.type,key:d,url:M.url,config:{noAudio:m}};h.call(this,c,w)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=l(this,this.loader.baseURL),this.state=p.FILE_LOADED,this.loader.nextFile(this,!0)}});a.register("video",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(56836),f=new r({Extends:h,initialize:function(c,d,v,m){var S="xml";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"xml",cache:c.cacheManager.xml,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,w)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=u(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AnimationJSONFile:e(14135),AsepriteFile:e(76272),AtlasJSONFile:e(38734),AtlasXMLFile:e(74599),AudioFile:e(21097),AudioSpriteFile:e(89524),BinaryFile:e(85722),BitmapFontFile:e(97025),CompressedTextureFile:e(69559),CSSFile:e(16024),GLSLFile:e(47931),HTML5AudioFile:e(89749),HTMLFile:e(88470),HTMLTextureFile:e(14643),ImageFile:e(19550),JSONFile:e(518),MultiAtlasFile:e(59327),MultiScriptFile:e(99297),OBJFile:e(41846),PackFile:e(58610),PluginFile:e(48988),SceneFile:e(88423),ScenePluginFile:e(56812),ScriptFile:e(34328),SpriteSheetFile:e(85035),SVGFile:e(67397),TextFile:e(78776),TilemapCSVFile:e(49477),TilemapImpactFile:e(40807),TilemapJSONFile:e(56775),UnityAtlasFile:e(25771),VideoFile:e(33720),XMLFile:e(57318)}},57777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23906),p=e(79291),h={Events:e(54899),FileTypes:e(64589),File:e(41299),FileTypesManager:e(74099),GetURL:e(98356),LoaderPlugin:e(74261),MergeXHRSettings:e(3374),MultiFile:e(26430),XHRLoader:e(84376),XHRSettings:e(92638)};h=p(!1,h,r),s.exports=h},53307:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0,p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6411),p=function(h,a){return r(h)/r(a)/r(h-a)};s.exports=p},30976:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.floor(Math.random()*(r-e+1)+e)};s.exports=y},87842:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){var l=(h-r)*.5,n=(a-p)*.5,u=e*e,f=e*u;return(2*p-2*h+l+n)*f+(-3*p+3*h-2*l-n)*u+l*e+p};s.exports=y},26302:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.ceil(e*h)/h};s.exports=y},45319:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.max(r,Math.min(p,e))};s.exports=y},39506:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h*r.DEG_TO_RAD};s.exports=p},61241:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.abs(e-r)};s.exports=y},38857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(37867),a=e(29747),l=new h,n=new p({initialize:function u(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=u.DefaultOrder),this._x=f,this._y=o,this._z=c,this._order=d,this.onChangeCallback=a},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)}},order:{get:function(){return this._order},set:function(u){this._order=u,this.onChangeCallback(this)}},set:function(u,f,o,c){return c===void 0&&(c=this._order),this._x=u,this._y=f,this._z=o,this._order=c,this.onChangeCallback(this),this},copy:function(u){return this.set(u.x,u.y,u.z,u.order)},setFromQuaternion:function(u,f,o){return f===void 0&&(f=this._order),o===void 0&&(o=!1),l.fromQuat(u),this.setFromRotationMatrix(l,f,o)},setFromRotationMatrix:function(u,f,o){f===void 0&&(f=this._order),o===void 0&&(o=!1);var c=u.val,d=c[0],v=c[4],m=c[8],S=c[1],M=c[5],w=c[9],C=c[2],A=c[6],P=c[10],b=0,O=0,I=0,D=.99999;switch(f){case"XYZ":{O=Math.asin(r(m,-1,1)),Math.abs(m){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(e===0)return 1;for(var r=e;--e;)r*=e;return r};s.exports=y},99472:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.random()*(r-e)+e};s.exports=y},77623:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.floor(e*h)/h};s.exports=y},62945:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=function(h,a,l){return h=r(h,0,1),(l-a)*h+a};s.exports=p},38265:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e/r/1e3};s.exports=y},78702:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e==parseFloat(e)?!(e%2):void 0};s.exports=y},94883:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===parseFloat(e)?!(e%2):void 0};s.exports=y},28915:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return(r-e)*p+e};s.exports=y},94908:s=>{/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=0),e.clone().lerp(r,p)};s.exports=y},94434:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){this.val=new Float32Array(9),a?this.copy(a):this.identity()},clone:function(){return new p(this)},set:function(h){return this.copy(h)},copy:function(h){var a=this.val,l=h.val;return a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=l[6],a[7]=l[7],a[8]=l[8],this},fromMat4:function(h){var a=h.val,l=this.val;return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[4],l[4]=a[5],l[5]=a[6],l[6]=a[8],l[7]=a[9],l[8]=a[10],this},fromArray:function(h){var a=this.val;return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[3],a[4]=h[4],a[5]=h[5],a[6]=h[6],a[7]=h[7],a[8]=h[8],this},identity:function(){var h=this.val;return h[0]=1,h[1]=0,h[2]=0,h[3]=0,h[4]=1,h[5]=0,h[6]=0,h[7]=0,h[8]=1,this},transpose:function(){var h=this.val,a=h[1],l=h[2],n=h[5];return h[1]=h[3],h[2]=h[6],h[3]=a,h[5]=h[7],h[6]=l,h[7]=n,this},invert:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8],m=v*f-o*d,S=-v*u+o*c,M=d*u-f*c,w=a*m+l*S+n*M;return w?(w=1/w,h[0]=m*w,h[1]=(-v*l+n*d)*w,h[2]=(o*l-n*f)*w,h[3]=S*w,h[4]=(v*a-n*c)*w,h[5]=(-o*a+n*u)*w,h[6]=M*w,h[7]=(-d*a+l*c)*w,h[8]=(f*a-l*u)*w,this):null},adjoint:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8];return h[0]=f*v-o*d,h[1]=n*d-l*v,h[2]=l*o-n*f,h[3]=o*c-u*v,h[4]=a*v-n*c,h[5]=n*u-a*o,h[6]=u*d-f*c,h[7]=l*c-a*d,h[8]=a*f-l*u,this},determinant:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8];return a*(v*f-o*d)+l*(-v*u+o*c)+n*(d*u-f*c)},multiply:function(h){var a=this.val,l=a[0],n=a[1],u=a[2],f=a[3],o=a[4],c=a[5],d=a[6],v=a[7],m=a[8],S=h.val,M=S[0],w=S[1],C=S[2],A=S[3],P=S[4],b=S[5],O=S[6],I=S[7],D=S[8];return a[0]=M*l+w*f+C*d,a[1]=M*n+w*o+C*v,a[2]=M*u+w*c+C*m,a[3]=A*l+P*f+b*d,a[4]=A*n+P*o+b*v,a[5]=A*u+P*c+b*m,a[6]=O*l+I*f+D*d,a[7]=O*n+I*o+D*v,a[8]=O*u+I*c+D*m,this},translate:function(h){var a=this.val,l=h.x,n=h.y;return a[6]=l*a[0]+n*a[3]+a[6],a[7]=l*a[1]+n*a[4]+a[7],a[8]=l*a[2]+n*a[5]+a[8],this},rotate:function(h){var a=this.val,l=a[0],n=a[1],u=a[2],f=a[3],o=a[4],c=a[5],d=Math.sin(h),v=Math.cos(h);return a[0]=v*l+d*f,a[1]=v*n+d*o,a[2]=v*u+d*c,a[3]=v*f-d*l,a[4]=v*o-d*n,a[5]=v*c-d*u,this},scale:function(h){var a=this.val,l=h.x,n=h.y;return a[0]=l*a[0],a[1]=l*a[1],a[2]=l*a[2],a[3]=n*a[3],a[4]=n*a[4],a[5]=n*a[5],this},fromQuat:function(h){var a=h.x,l=h.y,n=h.z,u=h.w,f=a+a,o=l+l,c=n+n,d=a*f,v=a*o,m=a*c,S=l*o,M=l*c,w=n*c,C=u*f,A=u*o,P=u*c,b=this.val;return b[0]=1-(S+w),b[3]=v+P,b[6]=m-A,b[1]=v-P,b[4]=1-(d+w),b[7]=M+C,b[2]=m+A,b[5]=M-C,b[8]=1-(d+S),this},normalFromMat4:function(h){var a=h.val,l=this.val,n=a[0],u=a[1],f=a[2],o=a[3],c=a[4],d=a[5],v=a[6],m=a[7],S=a[8],M=a[9],w=a[10],C=a[11],A=a[12],P=a[13],b=a[14],O=a[15],I=n*d-u*c,D=n*v-f*c,B=n*m-o*c,G=u*v-f*d,z=u*m-o*d,X=f*m-o*v,j=S*P-M*A,Q=S*b-w*A,tt=S*O-C*A,Y=M*b-w*P,Z=M*O-C*P,U=w*O-C*b,H=I*U-D*Z+B*Y+G*tt-z*Q+X*j;return H?(H=1/H,l[0]=(d*U-v*Z+m*Y)*H,l[1]=(v*tt-c*U-m*Q)*H,l[2]=(c*Z-d*tt+m*j)*H,l[3]=(f*Z-u*U-o*Y)*H,l[4]=(n*U-f*tt+o*Q)*H,l[5]=(u*tt-n*Z-o*j)*H,l[6]=(P*X-b*z+O*G)*H,l[7]=(b*B-A*X-O*D)*H,l[8]=(A*z-P*B+O*I)*H,this):null}});s.exports=p},37867:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(25836),h=1e-6,a=new r({initialize:function(d){this.val=new Float32Array(16),d?this.copy(d):this.identity()},clone:function(){return new a(this)},set:function(c){return this.copy(c)},setValues:function(c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G){var z=this.val;return z[0]=c,z[1]=d,z[2]=v,z[3]=m,z[4]=S,z[5]=M,z[6]=w,z[7]=C,z[8]=A,z[9]=P,z[10]=b,z[11]=O,z[12]=I,z[13]=D,z[14]=B,z[15]=G,this},copy:function(c){var d=c.val;return this.setValues(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15])},fromArray:function(c){return this.setValues(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(c,d,v){var m=l.fromQuat(v),S=m.val,M=d.x,w=d.y,C=d.z;return this.setValues(S[0]*M,S[1]*M,S[2]*M,0,S[4]*w,S[5]*w,S[6]*w,0,S[8]*C,S[9]*C,S[10]*C,0,c.x,c.y,c.z,1)},xyz:function(c,d,v){this.identity();var m=this.val;return m[12]=c,m[13]=d,m[14]=v,this},scaling:function(c,d,v){this.zero();var m=this.val;return m[0]=c,m[5]=d,m[10]=v,m[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 c=this.val,d=c[1],v=c[2],m=c[3],S=c[6],M=c[7],w=c[11];return c[1]=c[4],c[2]=c[8],c[3]=c[12],c[4]=d,c[6]=c[9],c[7]=c[13],c[8]=v,c[9]=S,c[11]=c[14],c[12]=m,c[13]=M,c[14]=w,this},getInverse:function(c){return this.copy(c),this.invert()},invert:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],X=d*w-v*M,j=d*C-m*M,Q=d*A-S*M,tt=v*C-m*w,Y=v*A-S*w,Z=m*A-S*C,U=P*B-b*D,H=P*G-O*D,J=P*z-I*D,_=b*G-O*B,q=b*z-I*B,at=O*z-I*G,ot=X*at-j*q+Q*_+tt*J-Y*H+Z*U;return ot?(ot=1/ot,this.setValues((w*at-C*q+A*_)*ot,(m*q-v*at-S*_)*ot,(B*Z-G*Y+z*tt)*ot,(O*Y-b*Z-I*tt)*ot,(C*J-M*at-A*H)*ot,(d*at-m*J+S*H)*ot,(G*Q-D*Z-z*j)*ot,(P*Z-O*Q+I*j)*ot,(M*q-w*J+A*U)*ot,(v*J-d*q-S*U)*ot,(D*Y-B*Q+z*X)*ot,(b*Q-P*Y-I*X)*ot,(w*H-M*_-C*U)*ot,(d*_-v*H+m*U)*ot,(B*j-D*tt-G*X)*ot,(P*tt-b*j+O*X)*ot)):this},adjoint:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15];return this.setValues(w*(O*z-I*G)-b*(C*z-A*G)+B*(C*I-A*O),-(v*(O*z-I*G)-b*(m*z-S*G)+B*(m*I-S*O)),v*(C*z-A*G)-w*(m*z-S*G)+B*(m*A-S*C),-(v*(C*I-A*O)-w*(m*I-S*O)+b*(m*A-S*C)),-(M*(O*z-I*G)-P*(C*z-A*G)+D*(C*I-A*O)),d*(O*z-I*G)-P*(m*z-S*G)+D*(m*I-S*O),-(d*(C*z-A*G)-M*(m*z-S*G)+D*(m*A-S*C)),d*(C*I-A*O)-M*(m*I-S*O)+P*(m*A-S*C),M*(b*z-I*B)-P*(w*z-A*B)+D*(w*I-A*b),-(d*(b*z-I*B)-P*(v*z-S*B)+D*(v*I-S*b)),d*(w*z-A*B)-M*(v*z-S*B)+D*(v*A-S*w),-(d*(w*I-A*b)-M*(v*I-S*b)+P*(v*A-S*w)),-(M*(b*G-O*B)-P*(w*G-C*B)+D*(w*O-C*b)),d*(b*G-O*B)-P*(v*G-m*B)+D*(v*O-m*b),-(d*(w*G-C*B)-M*(v*G-m*B)+D*(v*C-m*w)),d*(w*O-C*b)-M*(v*O-m*b)+P*(v*C-m*w))},determinant:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],X=d*w-v*M,j=d*C-m*M,Q=d*A-S*M,tt=v*C-m*w,Y=v*A-S*w,Z=m*A-S*C,U=P*B-b*D,H=P*G-O*D,J=P*z-I*D,_=b*G-O*B,q=b*z-I*B,at=O*z-I*G;return X*at-j*q+Q*_+tt*J-Y*H+Z*U},multiply:function(c){var d=this.val,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5],A=d[6],P=d[7],b=d[8],O=d[9],I=d[10],D=d[11],B=d[12],G=d[13],z=d[14],X=d[15],j=c.val,Q=j[0],tt=j[1],Y=j[2],Z=j[3];return d[0]=Q*v+tt*w+Y*b+Z*B,d[1]=Q*m+tt*C+Y*O+Z*G,d[2]=Q*S+tt*A+Y*I+Z*z,d[3]=Q*M+tt*P+Y*D+Z*X,Q=j[4],tt=j[5],Y=j[6],Z=j[7],d[4]=Q*v+tt*w+Y*b+Z*B,d[5]=Q*m+tt*C+Y*O+Z*G,d[6]=Q*S+tt*A+Y*I+Z*z,d[7]=Q*M+tt*P+Y*D+Z*X,Q=j[8],tt=j[9],Y=j[10],Z=j[11],d[8]=Q*v+tt*w+Y*b+Z*B,d[9]=Q*m+tt*C+Y*O+Z*G,d[10]=Q*S+tt*A+Y*I+Z*z,d[11]=Q*M+tt*P+Y*D+Z*X,Q=j[12],tt=j[13],Y=j[14],Z=j[15],d[12]=Q*v+tt*w+Y*b+Z*B,d[13]=Q*m+tt*C+Y*O+Z*G,d[14]=Q*S+tt*A+Y*I+Z*z,d[15]=Q*M+tt*P+Y*D+Z*X,this},multiplyLocal:function(c){var d=this.val,v=c.val;return this.setValues(d[0]*v[0]+d[1]*v[4]+d[2]*v[8]+d[3]*v[12],d[0]*v[1]+d[1]*v[5]+d[2]*v[9]+d[3]*v[13],d[0]*v[2]+d[1]*v[6]+d[2]*v[10]+d[3]*v[14],d[0]*v[3]+d[1]*v[7]+d[2]*v[11]+d[3]*v[15],d[4]*v[0]+d[5]*v[4]+d[6]*v[8]+d[7]*v[12],d[4]*v[1]+d[5]*v[5]+d[6]*v[9]+d[7]*v[13],d[4]*v[2]+d[5]*v[6]+d[6]*v[10]+d[7]*v[14],d[4]*v[3]+d[5]*v[7]+d[6]*v[11]+d[7]*v[15],d[8]*v[0]+d[9]*v[4]+d[10]*v[8]+d[11]*v[12],d[8]*v[1]+d[9]*v[5]+d[10]*v[9]+d[11]*v[13],d[8]*v[2]+d[9]*v[6]+d[10]*v[10]+d[11]*v[14],d[8]*v[3]+d[9]*v[7]+d[10]*v[11]+d[11]*v[15],d[12]*v[0]+d[13]*v[4]+d[14]*v[8]+d[15]*v[12],d[12]*v[1]+d[13]*v[5]+d[14]*v[9]+d[15]*v[13],d[12]*v[2]+d[13]*v[6]+d[14]*v[10]+d[15]*v[14],d[12]*v[3]+d[13]*v[7]+d[14]*v[11]+d[15]*v[15])},premultiply:function(c){return this.multiplyMatrices(c,this)},multiplyMatrices:function(c,d){var v=c.val,m=d.val,S=v[0],M=v[4],w=v[8],C=v[12],A=v[1],P=v[5],b=v[9],O=v[13],I=v[2],D=v[6],B=v[10],G=v[14],z=v[3],X=v[7],j=v[11],Q=v[15],tt=m[0],Y=m[4],Z=m[8],U=m[12],H=m[1],J=m[5],_=m[9],q=m[13],at=m[2],ot=m[6],rt=m[10],gt=m[14],yt=m[3],Et=m[7],At=m[11],Pt=m[15];return this.setValues(S*tt+M*H+w*at+C*yt,A*tt+P*H+b*at+O*yt,I*tt+D*H+B*at+G*yt,z*tt+X*H+j*at+Q*yt,S*Y+M*J+w*ot+C*Et,A*Y+P*J+b*ot+O*Et,I*Y+D*J+B*ot+G*Et,z*Y+X*J+j*ot+Q*Et,S*Z+M*_+w*rt+C*At,A*Z+P*_+b*rt+O*At,I*Z+D*_+B*rt+G*At,z*Z+X*_+j*rt+Q*At,S*U+M*q+w*gt+C*Pt,A*U+P*q+b*gt+O*Pt,I*U+D*q+B*gt+G*Pt,z*U+X*q+j*gt+Q*Pt)},translate:function(c){return this.translateXYZ(c.x,c.y,c.z)},translateXYZ:function(c,d,v){var m=this.val;return m[12]=m[0]*c+m[4]*d+m[8]*v+m[12],m[13]=m[1]*c+m[5]*d+m[9]*v+m[13],m[14]=m[2]*c+m[6]*d+m[10]*v+m[14],m[15]=m[3]*c+m[7]*d+m[11]*v+m[15],this},scale:function(c){return this.scaleXYZ(c.x,c.y,c.z)},scaleXYZ:function(c,d,v){var m=this.val;return m[0]=m[0]*c,m[1]=m[1]*c,m[2]=m[2]*c,m[3]=m[3]*c,m[4]=m[4]*d,m[5]=m[5]*d,m[6]=m[6]*d,m[7]=m[7]*d,m[8]=m[8]*v,m[9]=m[9]*v,m[10]=m[10]*v,m[11]=m[11]*v,this},makeRotationAxis:function(c,d){var v=Math.cos(d),m=Math.sin(d),S=1-v,M=c.x,w=c.y,C=c.z,A=S*M,P=S*w;return this.setValues(A*M+v,A*w-m*C,A*C+m*w,0,A*w+m*C,P*w+v,P*C-m*M,0,A*C-m*w,P*C+m*M,S*C*C+v,0,0,0,0,1)},rotate:function(c,d){var v=this.val,m=d.x,S=d.y,M=d.z,w=Math.sqrt(m*m+S*S+M*M);if(Math.abs(w){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.min(e+r,p)};s.exports=y},50040:s=>{/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.length;if(r===0)return 0;e.sort(function(h,a){return h-a});var p=Math.floor(r/2);return r%2===0?(e[p]+e[p-1])/2:e[p]};s.exports=y},37204:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.max(e-r,p)};s.exports=y},65201:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=r+1);var a=(e-r)/(p-r);return a>1?h!==void 0?(a=(h-e)/(h-p),a<0&&(a=0)):a=1:a<0&&(a=0),a};s.exports=y},15746:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94434),h=e(29747),a=e(25836),l=1e-6,n=new Int8Array([1,2,0]),u=new Float32Array([0,0,0]),f=new a(1,0,0),o=new a(0,1,0),c=new a,d=new p,v=new r({initialize:function(S,M,w,C){this.onChangeCallback=h,this.set(S,M,w,C)},x:{get:function(){return this._x},set:function(m){this._x=m,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(m){this._y=m,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(m){this._z=m,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(m){this._w=m,this.onChangeCallback(this)}},copy:function(m){return this.set(m)},set:function(m,S,M,w,C){return C===void 0&&(C=!0),typeof m=="object"?(this._x=m.x||0,this._y=m.y||0,this._z=m.z||0,this._w=m.w||0):(this._x=m||0,this._y=S||0,this._z=M||0,this._w=w||0),C&&this.onChangeCallback(this),this},add:function(m){return this._x+=m.x,this._y+=m.y,this._z+=m.z,this._w+=m.w,this.onChangeCallback(this),this},subtract:function(m){return this._x-=m.x,this._y-=m.y,this._z-=m.z,this._w-=m.w,this.onChangeCallback(this),this},scale:function(m){return this._x*=m,this._y*=m,this._z*=m,this._w*=m,this.onChangeCallback(this),this},length:function(){var m=this.x,S=this.y,M=this.z,w=this.w;return Math.sqrt(m*m+S*S+M*M+w*w)},lengthSq:function(){var m=this.x,S=this.y,M=this.z,w=this.w;return m*m+S*S+M*M+w*w},normalize:function(){var m=this.x,S=this.y,M=this.z,w=this.w,C=m*m+S*S+M*M+w*w;return C>0&&(C=1/Math.sqrt(C),this._x=m*C,this._y=S*C,this._z=M*C,this._w=w*C),this.onChangeCallback(this),this},dot:function(m){return this.x*m.x+this.y*m.y+this.z*m.z+this.w*m.w},lerp:function(m,S){S===void 0&&(S=0);var M=this.x,w=this.y,C=this.z,A=this.w;return this.set(M+S*(m.x-M),w+S*(m.y-w),C+S*(m.z-C),A+S*(m.w-A))},rotationTo:function(m,S){var M=m.x*S.x+m.y*S.y+m.z*S.z;return M<-.999999?(c.copy(f).cross(m).length().999999?this.set(0,0,0,1):(c.copy(m).cross(S),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+M,this.normalize())},setAxes:function(m,S,M){var w=d.val;return w[0]=S.x,w[3]=S.y,w[6]=S.z,w[1]=M.x,w[4]=M.y,w[7]=M.z,w[2]=-m.x,w[5]=-m.y,w[8]=-m.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(m,S){S=S*.5;var M=Math.sin(S);return this.set(M*m.x,M*m.y,M*m.z,Math.cos(S))},multiply:function(m){var S=this.x,M=this.y,w=this.z,C=this.w,A=m.x,P=m.y,b=m.z,O=m.w;return this.set(S*O+C*A+M*b-w*P,M*O+C*P+w*A-S*b,w*O+C*b+S*P-M*A,C*O-S*A-M*P-w*b)},slerp:function(m,S){var M=this.x,w=this.y,C=this.z,A=this.w,P=m.x,b=m.y,O=m.z,I=m.w,D=M*P+w*b+C*O+A*I;D<0&&(D=-D,P=-P,b=-b,O=-O,I=-I);var B=1-S,G=S;if(1-D>l){var z=Math.acos(D),X=Math.sin(z);B=Math.sin((1-S)*z)/X,G=Math.sin(S*z)/X}return this.set(B*M+G*P,B*w+G*b,B*C+G*O,B*A+G*I)},invert:function(){var m=this.x,S=this.y,M=this.z,w=this.w,C=m*m+S*S+M*M+w*w,A=C?1/C:0;return this.set(-m*A,-S*A,-M*A,w*A)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P+C*A,M*P+w*A,w*P-M*A,C*P-S*A)},rotateY:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P-w*A,M*P+C*A,w*P+S*A,C*P-M*A)},rotateZ:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P+M*A,M*P-S*A,w*P+C*A,C*P-w*A)},calculateW:function(){var m=this.x,S=this.y,M=this.z;return this.w=-Math.sqrt(1-m*m-S*S-M*M),this},setFromEuler:function(m,S){var M=m.x/2,w=m.y/2,C=m.z/2,A=Math.cos(M),P=Math.cos(w),b=Math.cos(C),O=Math.sin(M),I=Math.sin(w),D=Math.sin(C);switch(m.order){case"XYZ":{this.set(O*P*b+A*I*D,A*I*b-O*P*D,A*P*D+O*I*b,A*P*b-O*I*D,S);break}case"YXZ":{this.set(O*P*b+A*I*D,A*I*b-O*P*D,A*P*D-O*I*b,A*P*b+O*I*D,S);break}case"ZXY":{this.set(O*P*b-A*I*D,A*I*b+O*P*D,A*P*D+O*I*b,A*P*b-O*I*D,S);break}case"ZYX":{this.set(O*P*b-A*I*D,A*I*b+O*P*D,A*P*D-O*I*b,A*P*b+O*I*D,S);break}case"YZX":{this.set(O*P*b+A*I*D,A*I*b+O*P*D,A*P*D-O*I*b,A*P*b-O*I*D,S);break}case"XZY":{this.set(O*P*b-A*I*D,A*I*b-O*P*D,A*P*D+O*I*b,A*P*b+O*I*D,S);break}}return this},setFromRotationMatrix:function(m){var S=m.val,M=S[0],w=S[4],C=S[8],A=S[1],P=S[5],b=S[9],O=S[2],I=S[6],D=S[10],B=M+P+D,G;return B>0?(G=.5/Math.sqrt(B+1),this.set((I-b)*G,(C-O)*G,(A-w)*G,.25/G)):M>P&&M>D?(G=2*Math.sqrt(1+M-P-D),this.set(.25*G,(w+A)/G,(C+O)/G,(I-b)/G)):P>D?(G=2*Math.sqrt(1+P-M-D),this.set((w+A)/G,.25*G,(b+I)/G,(C-O)/G)):(G=2*Math.sqrt(1+D-M-P),this.set((C+O)/G,(b+I)/G,.25*G,(A-w)/G)),this},fromMat3:function(m){var S=m.val,M=S[0]+S[4]+S[8],w;if(M>0)w=Math.sqrt(M+1),this.w=.5*w,w=.5/w,this._x=(S[7]-S[5])*w,this._y=(S[2]-S[6])*w,this._z=(S[3]-S[1])*w;else{var C=0;S[4]>S[0]&&(C=1),S[8]>S[C*3+C]&&(C=2);var A=n[C],P=n[A];w=Math.sqrt(S[C*3+C]-S[A*3+A]-S[P*3+P]+1),u[C]=.5*w,w=.5/w,u[A]=(S[A*3+C]+S[C*3+A])*w,u[P]=(S[P*3+C]+S[C*3+P])*w,this._x=u[0],this._y=u[1],this._z=u[2],this._w=(S[P*3+A]-S[A*3+P])*w}return this.onChangeCallback(this),this}});s.exports=v},43396:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h*r.RAD_TO_DEG};s.exports=p},74362:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI;return e.x=Math.cos(p)*r,e.y=Math.sin(p)*r,e};s.exports=y},60706:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI,h=Math.random()*2-1,a=Math.sqrt(1-h*h)*r;return e.x=Math.cos(p)*a,e.y=Math.sin(p)*a,e.z=h*r,e};s.exports=y},67421:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1),e.x=(Math.random()*2-1)*r,e.y=(Math.random()*2-1)*r,e.z=(Math.random()*2-1)*r,e.w=(Math.random()*2-1)*r,e};s.exports=y},36305:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x,h=e.y;return e.x=p*Math.cos(r)-h*Math.sin(r),e.y=p*Math.sin(r)+h*Math.cos(r),e};s.exports=y},11520:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x-r,u=e.y-p;return e.x=n*a-u*l+r,e.y=n*l+u*a+p,e};s.exports=y},1163:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){var l=h+Math.atan2(e.y-p,e.x-r);return e.x=r+a*Math.cos(l),e.y=p+a*Math.sin(l),e};s.exports=y},70336:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return e.x=r+a*Math.cos(h),e.y=p+a*Math.sin(h),e};s.exports=y},72678:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=e(37867),h=e(15746),a=new p,l=new h,n=new r,u=function(f,o,c){return l.setAxisAngle(o,c),a.fromRotationTranslation(l,n.set(0,0,0)),f.transformMat4(a)};s.exports=u},2284:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>0?Math.ceil(e):Math.floor(e)};s.exports=y},41013:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.round(e*h)/h};s.exports=y},16922:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=1),p===void 0&&(p=1),h===void 0&&(h=1),h*=Math.PI/e;for(var a=[],l=[],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e<=r?0:e>=p?1:(e=(e-r)/(p-r),e*e*(3-2*e))};s.exports=y},54261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e=Math.max(0,Math.min(1,(e-r)/(p-r))),e*e*e*(e*(e*6-15)+10)};s.exports=y},44408:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n){n===void 0&&(n=new r);var u=0,f=0,o=a*l;return h>0&&h<=o&&(h>a-1?(f=Math.floor(h/a),u=h-f*a):u=h),n.set(u,f)};s.exports=p},85955:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f,o,c){c===void 0&&(c=new r);var d=Math.sin(u),v=Math.cos(u),m=v*f,S=d*f,M=-d*o,w=v*o,C=1/(m*w+M*-S);return c.x=w*C*h+-M*C*a+(n*M-l*w)*C,c.y=m*C*a+-S*C*h+(-n*m+l*S)*C,c};s.exports=p},26099:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(43855),h=new r({initialize:function(l,n){this.x=0,this.y=0,typeof l=="object"?(this.x=l.x||0,this.y=l.y||0):(n===void 0&&(n=l),this.x=l||0,this.y=n||0)},clone:function(){return new h(this.x,this.y)},copy:function(a){return this.x=a.x||0,this.y=a.y||0,this},setFromObject:function(a){return this.x=a.x||0,this.y=a.y||0,this},set:function(a,l){return l===void 0&&(l=a),this.x=a,this.y=l,this},setTo:function(a,l){return this.set(a,l)},setToPolar:function(a,l){return l==null&&(l=1),this.x=Math.cos(a)*l,this.y=Math.sin(a)*l,this},equals:function(a){return this.x===a.x&&this.y===a.y},fuzzyEquals:function(a,l){return p(this.x,a.x,l)&&p(this.y,a.y,l)},angle:function(){var a=Math.atan2(this.y,this.x);return a<0&&(a+=2*Math.PI),a},setAngle:function(a){return this.setToPolar(a,this.length())},add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},scale:function(a){return isFinite(a)?(this.x*=a,this.y*=a):(this.x=0,this.y=0),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(a){var l=a.x-this.x,n=a.y-this.y;return Math.sqrt(l*l+n*n)},distanceSq:function(a){var l=a.x-this.x,n=a.y-this.y;return l*l+n*n},length:function(){var a=this.x,l=this.y;return Math.sqrt(a*a+l*l)},setLength:function(a){return this.normalize().scale(a)},lengthSq:function(){var a=this.x,l=this.y;return a*a+l*l},normalize:function(){var a=this.x,l=this.y,n=a*a+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=a*n,this.y=l*n),this},normalizeRightHand:function(){var a=this.x;return this.x=this.y*-1,this.y=a,this},normalizeLeftHand:function(){var a=this.x;return this.x=this.y,this.y=a*-1,this},dot:function(a){return this.x*a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lerp:function(a,l){l===void 0&&(l=0);var n=this.x,u=this.y;return this.x=n+l*(a.x-n),this.y=u+l*(a.y-u),this},transformMat3:function(a){var l=this.x,n=this.y,u=a.val;return this.x=u[0]*l+u[3]*n+u[6],this.y=u[1]*l+u[4]*n+u[7],this},transformMat4:function(a){var l=this.x,n=this.y,u=a.val;return this.x=u[0]*l+u[4]*n+u[12],this.y=u[1]*l+u[5]*n+u[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(a){var l=this.length();return l&&l>a&&this.scale(a/l),this},reflect:function(a){return a=a.clone().normalize(),this.subtract(a.scale(2*this.dot(a)))},mirror:function(a){return this.reflect(a).negate()},rotate:function(a){var l=Math.cos(a),n=Math.sin(a);return this.set(l*this.x-n*this.y,n*this.x+l*this.y)},project:function(a){var l=this.dot(a)/a.dot(a);return this.copy(a).scale(l)}});h.ZERO=new h,h.RIGHT=new h(1,0),h.LEFT=new h(-1,0),h.UP=new h(0,-1),h.DOWN=new h(0,1),h.ONE=new h(1,1),s.exports=h},25836:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.x=0,this.y=0,this.z=0,typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0):(this.x=a||0,this.y=l||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(h){return this.x=Math.min(this.x,h.x),this.y=Math.min(this.y,h.y),this.z=Math.min(this.z,h.z),this},max:function(h){return this.x=Math.max(this.x,h.x),this.y=Math.max(this.y,h.y),this.z=Math.max(this.z,h.z),this},clone:function(){return new p(this.x,this.y,this.z)},addVectors:function(h,a){return this.x=h.x+a.x,this.y=h.y+a.y,this.z=h.z+a.z,this},crossVectors:function(h,a){var l=h.x,n=h.y,u=h.z,f=a.x,o=a.y,c=a.z;return this.x=n*c-u*o,this.y=u*f-l*c,this.z=l*o-n*f,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this},set:function(h,a,l){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0):(this.x=h||0,this.y=a||0,this.z=l||0),this},setFromMatrixPosition:function(h){return this.fromArray(h.val,12)},setFromMatrixColumn:function(h,a){return this.fromArray(h.val,a*4)},fromArray:function(h,a){return a===void 0&&(a=0),this.x=h[a],this.y=h[a+1],this.z=h[a+2],this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this},addScalar:function(h){return this.x+=h,this.y+=h,this.z+=h,this},addScale:function(h,a){return this.x+=h.x*a,this.y+=h.y*a,this.z+=h.z*a||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this},scale:function(h){return isFinite(h)?(this.x*=h,this.y*=h,this.z*=h):(this.x=0,this.y=0,this.z=0),this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return Math.sqrt(a*a+l*l+n*n)},distanceSq:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return a*a+l*l+n*n},length:function(){var h=this.x,a=this.y,l=this.z;return Math.sqrt(h*h+a*a+l*l)},lengthSq:function(){var h=this.x,a=this.y,l=this.z;return h*h+a*a+l*l},normalize:function(){var h=this.x,a=this.y,l=this.z,n=h*h+a*a+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=h*n,this.y=a*n,this.z=l*n),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z},cross:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z;return this.x=l*o-n*f,this.y=n*u-a*o,this.z=a*f-l*u,this},lerp:function(h,a){a===void 0&&(a=0);var l=this.x,n=this.y,u=this.z;return this.x=l+a*(h.x-l),this.y=n+a*(h.y-n),this.z=u+a*(h.z-u),this},applyMatrix3:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*a+u[3]*l+u[6]*n,this.y=u[1]*a+u[4]*l+u[7]*n,this.z=u[2]*a+u[5]*l+u[8]*n,this},applyMatrix4:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=1/(u[3]*a+u[7]*l+u[11]*n+u[15]);return this.x=(u[0]*a+u[4]*l+u[8]*n+u[12])*f,this.y=(u[1]*a+u[5]*l+u[9]*n+u[13])*f,this.z=(u[2]*a+u[6]*l+u[10]*n+u[14])*f,this},transformMat3:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=a*u[0]+l*u[3]+n*u[6],this.y=a*u[1]+l*u[4]+n*u[7],this.z=a*u[2]+l*u[5]+n*u[8],this},transformMat4:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*a+u[4]*l+u[8]*n+u[12],this.y=u[1]*a+u[5]*l+u[9]*n+u[13],this.z=u[2]*a+u[6]*l+u[10]*n+u[14],this},transformCoordinates:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=a*u[0]+l*u[4]+n*u[8]+u[12],o=a*u[1]+l*u[5]+n*u[9]+u[13],c=a*u[2]+l*u[6]+n*u[10]+u[14],d=a*u[3]+l*u[7]+n*u[11]+u[15];return this.x=f/d,this.y=o/d,this.z=c/d,this},transformQuat:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z,c=h.w,d=c*a+f*n-o*l,v=c*l+o*a-u*n,m=c*n+u*l-f*a,S=-u*a-f*l-o*n;return this.x=d*c+S*-u+v*-o-m*-f,this.y=v*c+S*-f+m*-u-d*-o,this.z=m*c+S*-o+d*-f-v*-u,this},project:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=u[0],o=u[1],c=u[2],d=u[3],v=u[4],m=u[5],S=u[6],M=u[7],w=u[8],C=u[9],A=u[10],P=u[11],b=u[12],O=u[13],I=u[14],D=u[15],B=1/(a*d+l*M+n*P+D);return this.x=(a*f+l*v+n*w+b)*B,this.y=(a*o+l*m+n*C+O)*B,this.z=(a*c+l*S+n*A+I)*B,this},projectViewMatrix:function(h,a){return this.applyMatrix4(h).applyMatrix4(a)},unprojectViewMatrix:function(h,a){return this.applyMatrix4(h).applyMatrix4(a)},unproject:function(h,a){var l=h.x,n=h.y,u=h.z,f=h.w,o=this.x-l,c=f-this.y-1-n,d=this.z;return this.x=2*o/u-1,this.y=2*c/f-1,this.z=2*d-1,this.project(a)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});p.ZERO=new p,p.RIGHT=new p(1,0,0),p.LEFT=new p(-1,0,0),p.UP=new p(0,-1,0),p.DOWN=new p(0,1,0),p.FORWARD=new p(0,0,1),p.BACK=new p(0,0,-1),p.ONE=new p(1,1,1),s.exports=p},61369:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){this.x=0,this.y=0,this.z=0,this.w=0,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=l||0,this.z=n||0,this.w=u||0)},clone:function(){return new p(this.x,this.y,this.z,this.w)},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this.w=h.w||0,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z&&this.w===h.w},set:function(h,a,l,n){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0,this.w=h.w||0):(this.x=h||0,this.y=a||0,this.z=l||0,this.w=n||0),this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this.w+=h.w||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this.w-=h.w||0,this},scale:function(h){return this.x*=h,this.y*=h,this.z*=h,this.w*=h,this},length:function(){var h=this.x,a=this.y,l=this.z,n=this.w;return Math.sqrt(h*h+a*a+l*l+n*n)},lengthSq:function(){var h=this.x,a=this.y,l=this.z,n=this.w;return h*h+a*a+l*l+n*n},normalize:function(){var h=this.x,a=this.y,l=this.z,n=this.w,u=h*h+a*a+l*l+n*n;return u>0&&(u=1/Math.sqrt(u),this.x=h*u,this.y=a*u,this.z=l*u,this.w=n*u),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z+this.w*h.w},lerp:function(h,a){a===void 0&&(a=0);var l=this.x,n=this.y,u=this.z,f=this.w;return this.x=l+a*(h.x-l),this.y=n+a*(h.y-n),this.z=u+a*(h.z-u),this.w=f+a*(h.w-f),this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this.w*=h.w||1,this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this.w/=h.w||1,this},distance:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return Math.sqrt(a*a+l*l+n*n+u*u)},distanceSq:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return a*a+l*l+n*n+u*u},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(h){var a=this.x,l=this.y,n=this.z,u=this.w,f=h.val;return this.x=f[0]*a+f[4]*l+f[8]*n+f[12]*u,this.y=f[1]*a+f[5]*l+f[9]*n+f[13]*u,this.z=f[2]*a+f[6]*l+f[10]*n+f[14]*u,this.w=f[3]*a+f[7]*l+f[11]*n+f[15]*u,this},transformQuat:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z,c=h.w,d=c*a+f*n-o*l,v=c*l+o*a-u*n,m=c*n+u*l-f*a,S=-u*a-f*l-o*n;return this.x=d*c+S*-u+v*-o-m*-f,this.y=v*c+S*-f+m*-u-d*-o,this.z=m*c+S*-o+d*-f-v*-u,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});p.prototype.sub=p.prototype.subtract,p.prototype.mul=p.prototype.multiply,p.prototype.div=p.prototype.divide,p.prototype.dist=p.prototype.distance,p.prototype.distSq=p.prototype.distanceSq,p.prototype.len=p.prototype.length,p.prototype.lenSq=p.prototype.lengthSq,s.exports=p},60417:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.abs(e-r)<=p};s.exports=y},15994:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p-r;return r+((e-r)%h+h)%h};s.exports=y},31040:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.atan2(h-r,p-e)};s.exports=y},55495:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.atan2(r.y-e.y,r.x-e.x)};s.exports=y},128:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.atan2(r.x-e.x,r.y-e.y)};s.exports=y},41273:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.atan2(p-e,h-r)};s.exports=y},1432:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h>Math.PI&&(h-=r.PI2),Math.abs(((h+r.TAU)%r.PI2-r.PI2)%r.PI2)};s.exports=p},12407:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e=e%(2*Math.PI),e>=0?e:e+2*Math.PI};s.exports=y},53993:(s,y,e)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99472),p=function(){return r(-Math.PI,Math.PI)};s.exports=p},86564:(s,y,e)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99472),p=function(){return r(-180,180)};s.exports=p},90154:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(12407),p=function(h){return r(h+Math.PI)};s.exports=p},48736:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h,a,l){return l===void 0&&(l=.05),h===a||(Math.abs(a-h)<=l||Math.abs(a-h)>=r.PI2-l?h=a:(Math.abs(a-h)>Math.PI&&(ah?h+=l:a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=r-e;if(p===0)return 0;var h=Math.floor((p- -180)/360);return p-h*360};s.exports=y},86554:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h){return r(h,-Math.PI,Math.PI)};s.exports=p},30954:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h){return r(h,-180,180)};s.exports=p},25588:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Between:e(31040),BetweenPoints:e(55495),BetweenPointsY:e(128),BetweenY:e(41273),CounterClockwise:e(1432),Normalize:e(12407),Random:e(53993),RandomDegrees:e(86564),Reverse:e(90154),RotateTo:e(48736),ShortestBetween:e(61430),Wrap:e(86554),WrapDegrees:e(30954)}},36383:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},20339:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e-p,l=r-h;return Math.sqrt(a*a+l*l)};s.exports=y},52816:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x-r.x,h=e.y-r.y;return Math.sqrt(p*p+h*h)};s.exports=y},64559:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x-r.x,h=e.y-r.y;return p*p+h*h};s.exports=y},82340:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.max(Math.abs(e-p),Math.abs(r-h))};s.exports=y},14390:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return a===void 0&&(a=2),Math.sqrt(Math.pow(p-e,a)+Math.pow(h-r,a))};s.exports=y},2243:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.abs(e-p)+Math.abs(r-h)};s.exports=y},89774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e-p,l=r-h;return a*a+l*l};s.exports=y},50994:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Between:e(20339),BetweenPoints:e(52816),BetweenPointsSquared:e(64559),Chebyshev:e(82340),Power:e(14390),Snake:e(2243),Squared:e(89774)}},62640:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54178),p=e(41521),h=e(79980),a=e(85433),l=e(99140),n=e(48857),u=e(81596),f=e(59133),o=e(98516),c=e(35248),d=e(82500),v=e(49752);s.exports={Power0:u,Power1:f.Out,Power2:a.Out,Power3:o.Out,Power4:c.Out,Linear:u,Quad:f.Out,Cubic:a.Out,Quart:o.Out,Quint:c.Out,Sine:d.Out,Expo:n.Out,Circ:h.Out,Elastic:l.Out,Back:r.Out,Bounce:p.Out,Stepped:v,"Quad.easeIn":f.In,"Cubic.easeIn":a.In,"Quart.easeIn":o.In,"Quint.easeIn":c.In,"Sine.easeIn":d.In,"Expo.easeIn":n.In,"Circ.easeIn":h.In,"Elastic.easeIn":l.In,"Back.easeIn":r.In,"Bounce.easeIn":p.In,"Quad.easeOut":f.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":o.Out,"Quint.easeOut":c.Out,"Sine.easeOut":d.Out,"Expo.easeOut":n.Out,"Circ.easeOut":h.Out,"Elastic.easeOut":l.Out,"Back.easeOut":r.Out,"Bounce.easeOut":p.Out,"Quad.easeInOut":f.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":o.InOut,"Quint.easeInOut":c.InOut,"Sine.easeInOut":d.InOut,"Expo.easeInOut":n.InOut,"Circ.easeInOut":h.InOut,"Elastic.easeInOut":l.InOut,"Back.easeInOut":r.InOut,"Bounce.easeInOut":p.InOut}},1639:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1.70158),e*e*((r+1)*e-r)};s.exports=y},50099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1.70158);var p=r*1.525;return(e*=2)<1?.5*(e*e*((p+1)*e-p)):.5*((e-=2)*e*((p+1)*e+p)+2)};s.exports=y},41286:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1.70158),--e*e*((r+1)*e+r)+1};s.exports=y},54178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(1639),Out:e(41286),InOut:e(50099)}},59590:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e=1-e,e<.36363636363636365?1-7.5625*e*e:e<.7272727272727273?1-(7.5625*(e-=.5454545454545454)*e+.75):e<.9090909090909091?1-(7.5625*(e-=.8181818181818182)*e+.9375):1-(7.5625*(e-=.9545454545454546)*e+.984375)};s.exports=y},41788:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=!1;return e<.5?(e=1-e*2,r=!0):e=e*2-1,e<.36363636363636365?e=7.5625*e*e:e<.7272727272727273?e=7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?e=7.5625*(e-=.8181818181818182)*e+.9375:e=7.5625*(e-=.9545454545454546)*e+.984375,r?(1-e)*.5:e*.5+.5};s.exports=y},69905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375};s.exports=y},41521:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(59590),Out:e(69905),InOut:e(41788)}},91861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1-Math.sqrt(1-e*e)};s.exports=y},4177:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)};s.exports=y},57512:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt(1- --e*e)};s.exports=y},79980:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(91861),Out:e(57512),InOut:e(4177)}},51150:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e};s.exports=y},82820:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)};s.exports=y},35033:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return--e*e*e+1};s.exports=y},85433:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(51150),Out:e(35033),InOut:e(82820)}},69965:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p))};s.exports=y},50665:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p)*.5+1};s.exports=y},7744:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-h)*(2*Math.PI)/p)+1};s.exports=y},99140:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(69965),Out:e(7744),InOut:e(50665)}},24590:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.pow(2,10*(e-1))-.001};s.exports=y},87844:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))};s.exports=y},89433:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1-Math.pow(2,-10*e)};s.exports=y},48857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(24590),Out:e(89433),InOut:e(87844)}},48820:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Back:e(54178),Bounce:e(41521),Circular:e(79980),Cubic:e(85433),Elastic:e(99140),Expo:e(48857),Linear:e(81596),Quadratic:e(59133),Quartic:e(98516),Quintic:e(35248),Sine:e(82500),Stepped:e(49752)}},7147:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e};s.exports=y},81596:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=e(7147)},34826:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e};s.exports=y},20544:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)};s.exports=y},92029:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*(2-e)};s.exports=y},59133:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(34826),Out:e(92029),InOut:e(20544)}},64413:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e*e};s.exports=y},78137:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)};s.exports=y},45840:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1- --e*e*e*e};s.exports=y},98516:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(64413),Out:e(45840),InOut:e(78137)}},87745:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e*e*e};s.exports=y},16509:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)};s.exports=y},17868:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return--e*e*e*e*e+1};s.exports=y},35248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(87745),Out:e(17868),InOut:e(16509)}},80461:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:1-Math.cos(e*Math.PI/2)};s.exports=y},34025:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:.5*(1-Math.cos(Math.PI*e))};s.exports=y},52768:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:Math.sin(e*Math.PI/2)};s.exports=y},82500:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(80461),Out:e(52768),InOut:e(34025)}},72251:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1),e<=0?0:e>=1?1:((r*e|0)+1)*(1/r)};s.exports=y},49752:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=e(72251)},75698:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1e-4),Math.ceil(e-r)};s.exports=y},43855:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),Math.abs(e-r){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1e-4),Math.floor(e+r)};s.exports=y},5470:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),e>r-p};s.exports=y},94977:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Ceil:e(75698),Equal:e(43855),Floor:e(25777),GreaterThan:e(5470),LessThan:e(94977)}},75508:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(79291),h={Angle:e(25588),Distance:e(50994),Easing:e(48820),Fuzzy:e(48379),Interpolation:e(38289),Pow2:e(49001),Snap:e(73697),RandomDataGenerator:e(28453),Average:e(53307),Bernstein:e(85710),Between:e(30976),CatmullRom:e(87842),CeilTo:e(26302),Clamp:e(45319),DegToRad:e(39506),Difference:e(61241),Euler:e(38857),Factorial:e(6411),FloatBetween:e(99472),FloorTo:e(77623),FromPercent:e(62945),GetSpeed:e(38265),IsEven:e(78702),IsEvenStrict:e(94883),Linear:e(28915),LinearXY:e(94908),MaxAdd:e(86883),Median:e(50040),MinSub:e(37204),Percent:e(65201),RadToDeg:e(43396),RandomXY:e(74362),RandomXYZ:e(60706),RandomXYZW:e(67421),Rotate:e(36305),RotateAround:e(11520),RotateAroundDistance:e(1163),RotateTo:e(70336),RoundAwayFromZero:e(2284),RoundTo:e(41013),SinCosTableGenerator:e(16922),SmootherStep:e(54261),SmoothStep:e(7602),ToXY:e(44408),TransformXY:e(85955),Within:e(60417),Wrap:e(15994),Vector2:e(26099),Vector3:e(25836),Vector4:e(61369),Matrix3:e(94434),Matrix4:e(37867),Quaternion:e(15746),RotateVec3:e(72678)};h=p(!1,h,r),s.exports=h},89318:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85710),p=function(h,a){for(var l=0,n=h.length-1,u=0;u<=n;u++)l+=Math.pow(1-a,n-u)*Math.pow(a,u)*h[u]*r(n,u);return l};s.exports=p},77259:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87842),p=function(h,a){var l=h.length-1,n=l*a,u=Math.floor(n);return h[0]===h[l]?(a<0&&(u=Math.floor(n=l*(1+a))),r(n-u,h[(u-1+l)%l],h[u],h[(u+1)%l],h[(u+2)%l])):a<0?h[0]-(r(-n,h[0],h[0],h[1],h[1])-h[0]):a>1?h[l]-(r(n-l,h[l],h[l],h[l-1],h[l-1])-h[l]):r(n-u,h[u?u-1:0],h[u],h[l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(a,l){var n=1-a;return n*n*n*l}function e(a,l){var n=1-a;return 3*n*n*a*l}function r(a,l){return 3*(1-a)*a*a*l}function p(a,l){return a*a*a*l}var h=function(a,l,n,u,f){return y(a,l)+e(a,n)+r(a,u)+p(a,f)};s.exports=h},28392:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28915),p=function(h,a){var l=h.length-1,n=l*a,u=Math.floor(n);return a<0?r(h[0],h[1],n):a>1?r(h[l],h[l-1],l-n):r(h[u],h[u+1>l?l:u+1],n-u)};s.exports=p},32112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(h,a){var l=1-h;return l*l*a}function e(h,a){return 2*(1-h)*h*a}function r(h,a){return h*h*a}var p=function(h,a,l,n){return y(h,a)+e(h,l)+r(h,n)};s.exports=p},47235:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7602),p=function(h,a,l){return a+(l-a)*r(h,0,1)};s.exports=p},50178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54261),p=function(h,a,l){return a+(l-a)*r(h,0,1)};s.exports=p},38289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Bezier:e(89318),CatmullRom:e(77259),CubicBezier:e(36316),Linear:e(28392),QuadraticBezier:e(32112),SmoothStep:e(47235),SmootherStep:e(50178)}},98439:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=Math.log(e)/.6931471805599453;return 1<{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e>0&&(e&e-1)===0&&r>0&&(r&r-1)===0};s.exports=y},81230:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>0&&(e&e-1)===0};s.exports=y},49001:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GetNext:e(98439),IsSize:e(50030),IsValue:e(81230)}},28453:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){a===void 0&&(a=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],a&&this.init(a)},rnd:function(){var h=2091639*this.s0+this.c*23283064365386963e-26;return this.c=h|0,this.s0=this.s1,this.s1=this.s2,this.s2=h-this.c,this.s2},hash:function(h){var a,l=this.n;h=h.toString();for(var n=0;n>>0,a-=l,a*=l,l=a>>>0,a-=l,l+=a*4294967296;return this.n=l,(l>>>0)*23283064365386963e-26},init:function(h){typeof h=="string"?this.state(h):this.sow(h)},sow:function(h){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,!!h)for(var a=0;a0;l--){var n=Math.floor(this.frac()*(l+1)),u=h[n];h[n]=h[l],h[l]=u}return h}});s.exports=p},63448:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.ceil(e/r),h?(p+e)/r:p+e)};s.exports=y},56583:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.floor(e/r),h?(p+e)/r:p+e)};s.exports=y},77720:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.round(e/r),h?(p+e)/r:p+e)};s.exports=y},73697:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Ceil:e(63448),Floor:e(56583),To:e(77720)}},85454:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */e(63595);var r=e(8054),p=e(79291),h={Actions:e(61061),Animations:e(60421),BlendModes:e(10312),Cache:e(83388),Cameras:e(26638),Core:e(42857),Class:e(83419),Create:e(15822),Curves:e(25410),Data:e(44965),Display:e(27460),DOM:e(84902),Events:e(93055),FX:e(66064),Game:e(50127),GameObjects:e(77856),Geom:e(55738),Input:e(14350),Loader:e(57777),Math:e(75508),Physics:e(44563),Plugins:e(18922),Renderer:e(36909),Scale:e(93364),ScaleModes:e(29795),Scene:e(97482),Scenes:e(62194),Structs:e(41392),Textures:e(27458),Tilemaps:e(62501),Time:e(90291),Tweens:e(43066),Utils:e(91799)};h.Sound=e(23717),h=p(!1,h,r),s.exports=h,e.g.Phaser=h},71289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92209),h=e(88571),a=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,o,c){h.call(this,n,u,f,o,c),this.body=null}});s.exports=a},86689:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39506),h=e(20339),a=e(89774),l=e(66022),n=e(95540),u=e(46975),f=e(72441),o=e(47956),c=e(37277),d=e(44594),v=e(26099),m=e(82248),S=new r({initialize:function(w){this.scene=w,this.systems=w.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,w.sys.events.once(d.BOOT,this.boot,this),w.sys.events.on(d.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new l(this.world),this.systems.events.once(d.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new l(this.world));var M=this.systems.events;n(this.config,"customUpdate",!1)||M.on(d.UPDATE,this.world.update,this.world),M.on(d.POST_UPDATE,this.world.postUpdate,this.world),M.once(d.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(d.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(d.UPDATE,this.world.update,this.world)},getConfig:function(){var M=this.systems.game.config.physics,w=this.systems.settings.physics,C=u(n(w,"arcade",{}),n(M,"arcade",{}));return C},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(M,w,C,A,P){return C===void 0&&(C=null),A===void 0&&(A=null),P===void 0&&(P=C),this.world.collideObjects(M,w,C,A,P,!0)},collide:function(M,w,C,A,P){return C===void 0&&(C=null),A===void 0&&(A=null),P===void 0&&(P=C),this.world.collideObjects(M,w,C,A,P,!1)},collideTiles:function(M,w,C,A,P){return this.world.collideTiles(M,w,C,A,P)},overlapTiles:function(M,w,C,A,P){return this.world.overlapTiles(M,w,C,A,P)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(M,w,C,A,P,b){A===void 0&&(A=60);var O=Math.atan2(C-M.y,w-M.x);return M.body.acceleration.setToPolar(O,A),P!==void 0&&b!==void 0&&M.body.maxVelocity.set(P,b),O},accelerateToObject:function(M,w,C,A,P){return this.accelerateTo(M,w.x,w.y,C,A,P)},closest:function(M,w){w||(w=this.world.bodies.entries);for(var C=Number.MAX_VALUE,A=null,P=M.x,b=M.y,O=w.length,I=0;IC&&(A=D,C=G)}}return A},moveTo:function(M,w,C,A,P){A===void 0&&(A=60),P===void 0&&(P=0);var b=Math.atan2(C-M.y,w-M.x);return P>0&&(A=h(M.x,M.y,w,C)/(P/1e3)),M.body.velocity.setToPolar(b,A),b},moveToObject:function(M,w,C,A){return this.moveTo(M,w.x,w.y,C,A)},velocityFromAngle:function(M,w,C){return w===void 0&&(w=60),C===void 0&&(C=new v),C.setToPolar(p(M),w)},velocityFromRotation:function(M,w,C){return w===void 0&&(w=60),C===void 0&&(C=new v),C.setToPolar(M,w)},overlapRect:function(M,w,C,A,P,b){return o(this.world,M,w,C,A,P,b)},overlapCirc:function(M,w,C,A,P){return f(this.world,M,w,C,A,P)},shutdown:function(){if(this.world){var M=this.systems.events;M.off(d.UPDATE,this.world.update,this.world),M.off(d.POST_UPDATE,this.world.postUpdate,this.world),M.off(d.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(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",S,"arcadePhysics"),s.exports=S},13759:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92209),h=e(68287),a=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,o,c){h.call(this,n,u,f,o,c),this.body=null}});s.exports=a},37742:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(78389),h=e(37747),a=e(63012),l=e(43396),n=e(87841),u=e(37303),f=e(95829),o=e(26099),c=new r({Mixins:[p],initialize:function(v,m){var S=64,M=64,w={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},C=m!==void 0;C&&m.displayWidth&&(S=m.displayWidth,M=m.displayHeight),C||(m=w),this.world=v,this.gameObject=C?m:void 0,this.isBody=!0,this.transform={x:m.x,y:m.y,rotation:m.angle,scaleX:m.scaleX,scaleY:m.scaleY,displayOriginX:m.displayOriginX,displayOriginY:m.displayOriginY},this.debugShowBody=v.defaults.debugShowBody,this.debugShowVelocity=v.defaults.debugShowVelocity,this.debugBodyColor=v.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new o,this.position=new o(m.x-m.scaleX*m.displayOriginX,m.y-m.scaleY*m.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=m.angle,this.preRotation=m.angle,this.width=S,this.height=M,this.sourceWidth=S,this.sourceHeight=M,m.frame&&(this.sourceWidth=m.frame.realWidth,this.sourceHeight=m.frame.realHeight),this.halfWidth=Math.abs(S/2),this.halfHeight=Math.abs(M/2),this.center=new o(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new o,this.newVelocity=new o,this.deltaMax=new o,this.acceleration=new o,this.allowDrag=!0,this.drag=new o,this.allowGravity=!0,this.gravity=new o,this.bounce=new o,this.worldBounce=null,this.customBoundsRectangle=v.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new o(1e4,1e4),this.maxSpeed=-1,this.friction=new o(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=h.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new o(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=f(!1),this.touching=f(!0),this.wasTouching=f(!0),this.blocked=f(!0),this.syncBounds=!1,this.physicsType=h.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=m.scaleX,this._sy=m.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new n,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var d=this.gameObject,v=this.transform;if(d.parentContainer){var m=d.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);v.x=m.tx,v.y=m.ty,v.rotation=l(m.rotation),v.scaleX=m.scaleX,v.scaleY=m.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY}else v.x=d.x,v.y=d.y,v.rotation=d.angle,v.scaleX=d.scaleX,v.scaleY=d.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY;var S=!1;if(this.syncBounds){var M=d.getBounds(this._bounds);this.width=M.width,this.height=M.height,S=!0}else{var w=Math.abs(v.scaleX),C=Math.abs(v.scaleY);(this._sx!==w||this._sy!==C)&&(this.width=this.sourceWidth*w,this.height=this.sourceHeight*C,this._sx=w,this._sy=C,S=!0)}S&&(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 d=this.transform;this.position.x=d.x+d.scaleX*(this.offset.x-d.displayOriginX),this.position.y=d.y+d.scaleY*(this.offset.y-d.displayOriginY),this.updateCenter()},resetFlags:function(d){d===void 0&&(d=!1);var v=this.wasTouching,m=this.touching,S=this.blocked;d?f(!0,v):(v.none=m.none,v.up=m.up,v.down=m.down,v.left=m.left,v.right=m.right),f(!0,m),f(!0,S),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(d,v){if(d&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var m=this.position;this.prev.x=m.x,this.prev.y=m.y,this.prevFrame.x=m.x,this.prevFrame.y=m.y}d&&this.update(v)},update:function(d){var v=this.prev,m=this.position,S=this.velocity;if(v.set(m.x,m.y),!this.moves){this._dx=m.x-v.x,this._dy=m.y-v.y;return}if(this.directControl){var M=this.autoFrame;S.set((m.x-M.x)/d,(m.y-M.y)/d),this.world.updateMotion(this,d),this._dx=m.x-M.x,this._dy=m.y-M.y}else this.world.updateMotion(this,d),this.newVelocity.set(S.x*d,S.y*d),m.add(this.newVelocity),this._dx=m.x-v.x,this._dy=m.y-v.y;var w=S.x,C=S.y;if(this.updateCenter(),this.angle=Math.atan2(C,w),this.speed=Math.sqrt(w*w+C*C),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var A=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,A.up,A.down,A.left,A.right)}},postUpdate:function(){var d=this.position,v=d.x-this.prevFrame.x,m=d.y-this.prevFrame.y,S=this.gameObject;if(this.moves){var M=this.deltaMax.x,w=this.deltaMax.y;M!==0&&v!==0&&(v<0&&v<-M?v=-M:v>0&&v>M&&(v=M)),w!==0&&m!==0&&(m<0&&m<-w?m=-w:m>0&&m>w&&(m=w)),S&&(S.x+=v,S.y+=m)}v<0?this.facing=h.FACING_LEFT:v>0&&(this.facing=h.FACING_RIGHT),m<0?this.facing=h.FACING_UP:m>0&&(this.facing=h.FACING_DOWN),this.allowRotation&&S&&(S.angle+=this.deltaZ()),this._tx=v,this._ty=m,this.autoFrame.set(d.x,d.y)},setBoundsRectangle:function(d){return this.customBoundsRectangle=d||this.world.bounds,this},checkWorldBounds:function(){var d=this.position,v=this.velocity,m=this.blocked,S=this.customBoundsRectangle,M=this.world.checkCollision,w=this.worldBounce?-this.worldBounce.x:-this.bounce.x,C=this.worldBounce?-this.worldBounce.y:-this.bounce.y,A=!1;return d.xS.right&&M.right&&(d.x=S.right-this.width,v.x*=w,m.right=!0,A=!0),d.yS.bottom&&M.down&&(d.y=S.bottom-this.height,v.y*=C,m.down=!0,A=!0),A&&(this.blocked.none=!1,this.updateCenter()),A},setOffset:function(d,v){return v===void 0&&(v=d),this.offset.set(d,v),this},setGameObject:function(d,v){return v===void 0&&(v=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=d,d.body&&(d.body=this),this.setSize(),this.world.add(this),this.enable=v,this},setSize:function(d,v,m){m===void 0&&(m=!0);var S=this.gameObject;if(S&&(!d&&S.frame&&(d=S.frame.realWidth),!v&&S.frame&&(v=S.frame.realHeight)),this.sourceWidth=d,this.sourceHeight=v,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(),m&&S&&S.getCenter){var M=(S.width-d)/2,w=(S.height-v)/2;this.offset.set(M,w)}return this.isCircle=!1,this.radius=0,this},setCircle:function(d,v,m){return v===void 0&&(v=this.offset.x),m===void 0&&(m=this.offset.y),d>0?(this.isCircle=!0,this.radius=d,this.sourceWidth=d*2,this.sourceHeight=d*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(v,m),this.updateCenter()):this.isCircle=!1,this},reset:function(d,v){this.stop();var m=this.gameObject;m&&(m.setPosition(d,v),this.rotation=m.angle,this.preRotation=m.angle);var S=this.position;m&&m.getTopLeft?m.getTopLeft(S):S.set(d,v),this.prev.copy(S),this.prevFrame.copy(S),this.autoFrame.copy(S),m&&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(d){return d.x=this.x,d.y=this.y,d.right=this.right,d.bottom=this.bottom,d},hitTest:function(d,v){if(!this.isCircle)return u(this,d,v);if(this.radius>0&&d>=this.left&&d<=this.right&&v>=this.top&&v<=this.bottom){var m=(this.center.x-d)*(this.center.x-d),S=(this.center.y-v)*(this.center.y-v);return m+S<=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(d){var v=this.position,m=v.x+this.halfWidth,S=v.y+this.halfHeight;this.debugShowBody&&(d.lineStyle(d.defaultStrokeWidth,this.debugBodyColor),this.isCircle?d.strokeCircle(m,S,this.width/2):(this.checkCollision.up&&d.lineBetween(v.x,v.y,v.x+this.width,v.y),this.checkCollision.right&&d.lineBetween(v.x+this.width,v.y,v.x+this.width,v.y+this.height),this.checkCollision.down&&d.lineBetween(v.x,v.y+this.height,v.x+this.width,v.y+this.height),this.checkCollision.left&&d.lineBetween(v.x,v.y,v.x,v.y+this.height))),this.debugShowVelocity&&(d.lineStyle(d.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),d.lineBetween(m,S,m+this.velocity.x/2,S+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(d){return d===void 0&&(d=!0),this.directControl=d,this},setCollideWorldBounds:function(d,v,m,S){d===void 0&&(d=!0),this.collideWorldBounds=d;var M=v!==void 0,w=m!==void 0;return(M||w)&&(this.worldBounce||(this.worldBounce=new o),M&&(this.worldBounce.x=v),w&&(this.worldBounce.y=m)),S!==void 0&&(this.onWorldBounds=S),this},setVelocity:function(d,v){return this.velocity.set(d,v),d=this.velocity.x,v=this.velocity.y,this.speed=Math.sqrt(d*d+v*v),this},setVelocityX:function(d){return this.setVelocity(d,this.velocity.y)},setVelocityY:function(d){return this.setVelocity(this.velocity.x,d)},setMaxVelocity:function(d,v){return this.maxVelocity.set(d,v),this},setMaxVelocityX:function(d){return this.maxVelocity.x=d,this},setMaxVelocityY:function(d){return this.maxVelocity.y=d,this},setMaxSpeed:function(d){return this.maxSpeed=d,this},setSlideFactor:function(d,v){return this.slideFactor.set(d,v),this},setBounce:function(d,v){return this.bounce.set(d,v),this},setBounceX:function(d){return this.bounce.x=d,this},setBounceY:function(d){return this.bounce.y=d,this},setAcceleration:function(d,v){return this.acceleration.set(d,v),this},setAccelerationX:function(d){return this.acceleration.x=d,this},setAccelerationY:function(d){return this.acceleration.y=d,this},setAllowDrag:function(d){return d===void 0&&(d=!0),this.allowDrag=d,this},setAllowGravity:function(d){return d===void 0&&(d=!0),this.allowGravity=d,this},setAllowRotation:function(d){return d===void 0&&(d=!0),this.allowRotation=d,this},setDrag:function(d,v){return this.drag.set(d,v),this},setDamping:function(d){return this.useDamping=d,this},setDragX:function(d){return this.drag.x=d,this},setDragY:function(d){return this.drag.y=d,this},setGravity:function(d,v){return this.gravity.set(d,v),this},setGravityX:function(d){return this.gravity.x=d,this},setGravityY:function(d){return this.gravity.y=d,this},setFriction:function(d,v){return this.friction.set(d,v),this},setFrictionX:function(d){return this.friction.x=d,this},setFrictionY:function(d){return this.friction.y=d,this},setAngularVelocity:function(d){return this.angularVelocity=d,this},setAngularAcceleration:function(d){return this.angularAcceleration=d,this},setAngularDrag:function(d){return this.angularDrag=d,this},setMass:function(d){return this.mass=d,this},setImmovable:function(d){return d===void 0&&(d=!0),this.immovable=d,this},setEnable:function(d){return d===void 0&&(d=!0),this.enable=d,this},processX:function(d,v,m,S){this.x+=d,this.updateCenter(),v!==null&&(this.velocity.x=v*this.slideFactor.x);var M=this.blocked;m&&(M.left=!0,M.none=!1),S&&(M.right=!0,M.none=!1)},processY:function(d,v,m,S){this.y+=d,this.updateCenter(),v!==null&&(this.velocity.y=v*this.slideFactor.y);var M=this.blocked;m&&(M.up=!0,M.none=!1),S&&(M.down=!0,M.none=!1)},x:{get:function(){return this.position.x},set:function(d){this.position.x=d}},y:{get:function(){return this.position.y},set:function(d){this.position.y=d}},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}}});s.exports=c},79342:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o,c){this.world=a,this.name="",this.active=!0,this.overlapOnly=l,this.object1=n,this.object2=u,this.collideCallback=f,this.processCallback=o,this.callbackContext=c},setName:function(h){return this.name=h,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}});s.exports=p},66022:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71289),p=e(13759),h=e(37742),a=e(83419),l=e(37747),n=e(60758),u=e(72624),f=e(71464),o=new a({initialize:function(d){this.world=d,this.scene=d.scene,this.sys=d.scene.sys},collider:function(c,d,v,m,S){return this.world.addCollider(c,d,v,m,S)},overlap:function(c,d,v,m,S){return this.world.addOverlap(c,d,v,m,S)},existing:function(c,d){var v=d?l.STATIC_BODY:l.DYNAMIC_BODY;return this.world.enableBody(c,v),c},staticImage:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},image:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticSprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},sprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticGroup:function(c,d){return this.sys.updateList.add(new f(this.world,this.world.scene,c,d))},group:function(c,d){return this.sys.updateList.add(new n(this.world,this.world.scene,c,d))},body:function(c,d,v,m){var S=new h(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.DYNAMIC_BODY),S},staticBody:function(c,d,v,m){var S=new u(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.STATIC_BODY),S},destroy:function(){this.world=null,this.scene=null,this.sys=null}});s.exports=o},79599:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=0;if(!Array.isArray(e))r=e;else for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=function(h,a,l,n){var u=0,f=h.deltaAbsX()+a.deltaAbsX()+n;return h._dx===0&&a._dx===0?(h.embedded=!0,a.embedded=!0):h._dx>a._dx?(u=h.right-a.x,u>f&&!l||h.checkCollision.right===!1||a.checkCollision.left===!1?u=0:(h.touching.none=!1,h.touching.right=!0,a.touching.none=!1,a.touching.left=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.right=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.left=!0))):h._dxf&&!l||h.checkCollision.left===!1||a.checkCollision.right===!1?u=0:(h.touching.none=!1,h.touching.left=!0,a.touching.none=!1,a.touching.right=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.left=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.right=!0))),h.overlapX=u,a.overlapX=u,u};s.exports=p},45170:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=function(h,a,l,n){var u=0,f=h.deltaAbsY()+a.deltaAbsY()+n;return h._dy===0&&a._dy===0?(h.embedded=!0,a.embedded=!0):h._dy>a._dy?(u=h.bottom-a.y,u>f&&!l||h.checkCollision.down===!1||a.checkCollision.up===!1?u=0:(h.touching.none=!1,h.touching.down=!0,a.touching.none=!1,a.touching.up=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.down=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.up=!0))):h._dyf&&!l||h.checkCollision.up===!1||a.checkCollision.down===!1?u=0:(h.touching.none=!1,h.touching.up=!0,a.touching.none=!1,a.touching.down=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.up=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.down=!0))),h.overlapY=u,a.overlapY=u,u};s.exports=p},60758:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13759),p=e(83419),h=e(78389),a=e(37747),l=e(95540),n=e(26479),u=e(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){if(!v&&!m)m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else if(u(v))m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(v)&&u(v[0])){var S=this;v.forEach(function(M){M.internalCreateCallback=S.createCallbackHandler,M.internalRemoveCallback=S.removeCallbackHandler,M.classType=l(M,"classType",r)}),m=null}else m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=c,m&&(m.classType=l(m,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:l(m,"collideWorldBounds",!1),setBoundsRectangle:l(m,"customBoundsRectangle",null),setAccelerationX:l(m,"accelerationX",0),setAccelerationY:l(m,"accelerationY",0),setAllowDrag:l(m,"allowDrag",!0),setAllowGravity:l(m,"allowGravity",!0),setAllowRotation:l(m,"allowRotation",!0),setDamping:l(m,"useDamping",!1),setBounceX:l(m,"bounceX",0),setBounceY:l(m,"bounceY",0),setDragX:l(m,"dragX",0),setDragY:l(m,"dragY",0),setEnable:l(m,"enable",!0),setGravityX:l(m,"gravityX",0),setGravityY:l(m,"gravityY",0),setFrictionX:l(m,"frictionX",0),setFrictionY:l(m,"frictionY",0),setMaxSpeed:l(m,"maxSpeed",-1),setMaxVelocityX:l(m,"maxVelocityX",1e4),setMaxVelocityY:l(m,"maxVelocityY",1e4),setVelocityX:l(m,"velocityX",0),setVelocityY:l(m,"velocityY",0),setAngularVelocity:l(m,"angularVelocity",0),setAngularAcceleration:l(m,"angularAcceleration",0),setAngularDrag:l(m,"angularDrag",0),setMass:l(m,"mass",1),setImmovable:l(m,"immovable",!1)},n.call(this,d,v,m),this.type="PhysicsGroup"},createCallbackHandler:function(o){o.body||this.world.enableBody(o,a.DYNAMIC_BODY);var c=o.body;for(var d in this.defaults)c[d](this.defaults[d])},removeCallbackHandler:function(o){o.body&&this.world.disableBody(o)},setVelocity:function(o,c,d){d===void 0&&(d=0);for(var v=this.getChildren(),m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y,e,r,p,h,a,l,n,u,f,o,c,d,v,m,S,M,w=function(I,D,B){y=I,e=D;var G=y.velocity.x,z=e.velocity.x;return r=y.pushable,u=y._dx<0,f=y._dx>0,o=y._dx===0,m=Math.abs(y.right-e.x)<=Math.abs(e.right-y.x),l=z-G*y.bounce.x,p=e.pushable,c=e._dx<0,d=e._dx>0,v=e._dx===0,S=!m,n=G-z*e.bounce.x,M=Math.abs(B),C()},C=function(){return f&&m&&e.blocked.right?(y.processX(-M,l,!1,!0),1):u&&S&&e.blocked.left?(y.processX(M,l,!0),1):d&&S&&y.blocked.right?(e.processX(-M,n,!1,!0),2):c&&m&&y.blocked.left?(e.processX(M,n,!0),2):0},A=function(){var I=y.velocity.x,D=e.velocity.x,B=Math.sqrt(D*D*e.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/e.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.x,a=z+G*e.bounce.x,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processX(M,h),e.processX(-M,a)):(y.processX(-M,h),e.processX(M,a));else if(r&&!p)I===0||I===3?y.processX(M,l,!0):y.processX(-M,l,!1,!0);else if(!r&&p)I===0||I===3?e.processX(-M,n,!1,!0):e.processX(M,n,!0);else{var D=M*.5;I===0?v?(y.processX(M,0,!0),e.processX(0,null,!1,!0)):d?(y.processX(D,0,!0),e.processX(-D,0,!1,!0)):(y.processX(D,e.velocity.x,!0),e.processX(-D,null,!1,!0)):I===1?o?(y.processX(0,null,!1,!0),e.processX(M,0,!0)):f?(y.processX(-D,0,!1,!0),e.processX(D,0,!0)):(y.processX(-D,null,!1,!0),e.processX(D,y.velocity.x,!0)):I===2?v?(y.processX(-M,0,!1,!0),e.processX(0,null,!0)):c?(y.processX(-D,0,!1,!0),e.processX(D,0,!0)):(y.processX(-D,e.velocity.x,!1,!0),e.processX(D,null,!0)):I===3&&(o?(y.processX(0,null,!0),e.processX(-M,0,!1,!0)):u?(y.processX(D,0,!0),e.processX(-D,0,!1,!0)):(y.processX(D,e.velocity.y,!0),e.processX(-D,null,!1,!0)))}return!0},b=function(I){I===1?e.velocity.x=0:m?e.processX(M,n,!0):e.processX(-M,n,!1,!0),y.moves&&(e.y+=(y.y-y.prev.y)*y.friction.y,e._dy=e.y-e.prev.y)},O=function(I){I===2?y.velocity.x=0:S?y.processX(M,l,!0):y.processX(-M,l,!1,!0),e.moves&&(y.y+=(e.y-e.prev.y)*e.friction.y,y._dy=y.y-y.prev.y)};s.exports={BlockCheck:C,Check:A,Set:w,Run:P,RunImmovableBody1:b,RunImmovableBody2:O}},47962:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y,e,r,p,h,a,l,n,u,f,o,c,d,v,m,S,M,w=function(I,D,B){y=I,e=D;var G=y.velocity.y,z=e.velocity.y;return r=y.pushable,u=y._dy<0,f=y._dy>0,o=y._dy===0,m=Math.abs(y.bottom-e.y)<=Math.abs(e.bottom-y.y),l=z-G*y.bounce.y,p=e.pushable,c=e._dy<0,d=e._dy>0,v=e._dy===0,S=!m,n=G-z*e.bounce.y,M=Math.abs(B),C()},C=function(){return f&&m&&e.blocked.down?(y.processY(-M,l,!1,!0),1):u&&S&&e.blocked.up?(y.processY(M,l,!0),1):d&&S&&y.blocked.down?(e.processY(-M,n,!1,!0),2):c&&m&&y.blocked.up?(e.processY(M,n,!0),2):0},A=function(){var I=y.velocity.y,D=e.velocity.y,B=Math.sqrt(D*D*e.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/e.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.y,a=z+G*e.bounce.y,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processY(M,h),e.processY(-M,a)):(y.processY(-M,h),e.processY(M,a));else if(r&&!p)I===0||I===3?y.processY(M,l,!0):y.processY(-M,l,!1,!0);else if(!r&&p)I===0||I===3?e.processY(-M,n,!1,!0):e.processY(M,n,!0);else{var D=M*.5;I===0?v?(y.processY(M,0,!0),e.processY(0,null,!1,!0)):d?(y.processY(D,0,!0),e.processY(-D,0,!1,!0)):(y.processY(D,e.velocity.y,!0),e.processY(-D,null,!1,!0)):I===1?o?(y.processY(0,null,!1,!0),e.processY(M,0,!0)):f?(y.processY(-D,0,!1,!0),e.processY(D,0,!0)):(y.processY(-D,null,!1,!0),e.processY(D,y.velocity.y,!0)):I===2?v?(y.processY(-M,0,!1,!0),e.processY(0,null,!0)):c?(y.processY(-D,0,!1,!0),e.processY(D,0,!0)):(y.processY(-D,e.velocity.y,!1,!0),e.processY(D,null,!0)):I===3&&(o?(y.processY(0,null,!0),e.processY(-M,0,!1,!0)):u?(y.processY(D,0,!0),e.processY(-D,0,!1,!0)):(y.processY(D,e.velocity.y,!0),e.processY(-D,null,!1,!0)))}return!0},b=function(I){I===1?e.velocity.y=0:m?e.processY(M,n,!0):e.processY(-M,n,!1,!0),y.moves&&(e.x+=(y.x-y.prev.x)*y.friction.x,e._dx=e.x-e.prev.x)},O=function(I){I===2?y.velocity.y=0:S?y.processY(M,l,!0):y.processY(-M,l,!1,!0),e.moves&&(y.x+=(e.x-e.prev.x)*e.friction.x,y._dx=y.x-y.prev.x)};s.exports={BlockCheck:C,Check:A,Set:w,Run:P,RunImmovableBody1:b,RunImmovableBody2:O}},14087:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64897),p=e(3017),h=function(a,l,n,u,f){f===void 0&&(f=r(a,l,n,u));var o=a.immovable,c=l.immovable;if(n||f===0||o&&c||a.customSeparateX||l.customSeparateX)return f!==0||a.embedded&&l.embedded;var d=p.Set(a,l,f);return!o&&!c?d>0?!0:p.Check():(o?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};s.exports=h},89936:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45170),p=e(47962),h=function(a,l,n,u,f){f===void 0&&(f=r(a,l,n,u));var o=a.immovable,c=l.immovable;if(n||f===0||o&&c||a.customSeparateY||l.customSeparateY)return f!==0||a.embedded&&l.embedded;var d=p.Set(a,l,f);return!o&&!c?d>0?!0:p.Check():(o?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};s.exports=h},95829:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r={}),r.none=e,r.up=!1,r.down=!1,r.left=!1,r.right=!1,e||(r.up=!0,r.down=!0,r.left=!0,r.right=!0),r};s.exports=y},72624:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=e(83419),h=e(78389),a=e(37747),l=e(37303),n=e(95829),u=e(26099),f=new p({Mixins:[h],initialize:function(c,d){var v=64,m=64,S={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},M=d!==void 0;M&&d.displayWidth&&(v=d.displayWidth,m=d.displayHeight),M||(d=S),this.world=c,this.gameObject=M?d:void 0,this.isBody=!0,this.debugShowBody=c.defaults.debugShowStaticBody,this.debugBodyColor=c.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new u,this.position=new u(d.x-v*d.originX,d.y-m*d.originY),this.width=v,this.height=m,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new u(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=u.ZERO,this.allowGravity=!1,this.gravity=u.ZERO,this.bounce=u.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=n(!1),this.touching=n(!0),this.wasTouching=n(!0),this.blocked=n(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(o,c){return o&&o!==this.gameObject&&(this.gameObject.body=null,o.body=this,this.gameObject=o),c&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var o=this.gameObject;return o.getTopLeft(this.position),this.width=o.displayWidth,this.height=o.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(o,c){return c===void 0&&(c=o),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(o,c),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(o,c,d){d===void 0&&(d=!0);var v=this.gameObject;if(v&&v.frame&&(o||(o=v.frame.realWidth),c||(c=v.frame.realHeight)),this.world.staticTree.remove(this),this.width=o,this.height=c,this.halfWidth=Math.floor(o/2),this.halfHeight=Math.floor(c/2),d&&v&&v.getCenter){var m=v.displayWidth/2,S=v.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(m-this.halfWidth,S-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(o,c,d){return c===void 0&&(c=this.offset.x),d===void 0&&(d=this.offset.y),o>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=o,this.width=o*2,this.height=o*2,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(c,d),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(o,c){var d=this.gameObject;o===void 0&&(o=d.x),c===void 0&&(c=d.y),this.world.staticTree.remove(this),d.setPosition(o,c),d.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(o){return o.x=this.x,o.y=this.y,o.right=this.right,o.bottom=this.bottom,o},hitTest:function(o,c){return this.isCircle?r(this,o,c):l(this,o,c)},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(o){var c=this.position,d=c.x+this.halfWidth,v=c.y+this.halfHeight;this.debugShowBody&&(o.lineStyle(o.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?o.strokeCircle(d,v,this.width/2):o.strokeRect(c.x,c.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(o){return o<=0&&(o=.1),this.mass=o,this},x:{get:function(){return this.position.x},set:function(o){this.world.staticTree.remove(this),this.position.x=o,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(o){this.world.staticTree.remove(this),this.position.y=o,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}}});s.exports=f},71464:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13759),p=e(83419),h=e(78389),a=e(37747),l=e(95540),n=e(26479),u=e(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){!v&&!m?m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r}:u(v)?(m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler,m.createMultipleCallback=this.createMultipleCallbackHandler,m.classType=l(m,"classType",r)):Array.isArray(v)&&u(v[0])?(m=v,v=null,m.forEach(function(S){S.internalCreateCallback=this.createCallbackHandler,S.internalRemoveCallback=this.removeCallbackHandler,S.createMultipleCallback=this.createMultipleCallbackHandler,S.classType=l(S,"classType",r)})):m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler},this.world=c,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,n.call(this,d,v,m),this.type="StaticPhysicsGroup"},createCallbackHandler:function(o){o.body||this.world.enableBody(o,a.STATIC_BODY)},removeCallbackHandler:function(o){o.body&&this.world.disableBody(o)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var o=this.children.entries,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55495),p=e(37742),h=e(45319),a=e(83419),l=e(79342),n=e(37747),u=e(20339),f=e(52816),o=e(50792),c=e(63012),d=e(43855),v=e(5470),m=e(94977),S=e(64897),M=e(45170),w=e(96523),C=e(35154),A=e(36383),P=e(25774),b=e(96602),O=e(87841),I=e(59542),D=e(40012),B=e(14087),G=e(89936),z=e(35072),X=e(72624),j=e(2483),Q=e(61340),tt=e(26099),Y=e(15994),Z=new a({Extends:o,initialize:function(H,J){o.call(this),this.scene=H,this.bodies=new z,this.staticBodies=new z,this.pendingDestroy=new z,this.colliders=new P,this.gravity=new tt(C(J,"gravity.x",0),C(J,"gravity.y",0)),this.bounds=new O(C(J,"x",0),C(J,"y",0),C(J,"width",H.sys.scale.width),C(J,"height",H.sys.scale.height)),this.checkCollision={up:C(J,"checkCollision.up",!0),down:C(J,"checkCollision.down",!0),left:C(J,"checkCollision.left",!0),right:C(J,"checkCollision.right",!0)},this.fps=C(J,"fps",60),this.fixedStep=C(J,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=C(J,"timeScale",1),this.OVERLAP_BIAS=C(J,"overlapBias",4),this.TILE_BIAS=C(J,"tileBias",16),this.forceX=C(J,"forceX",!1),this.isPaused=C(J,"isPaused",!1),this._total=0,this.drawDebug=C(J,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:C(J,"debugShowBody",!0),debugShowStaticBody:C(J,"debugShowStaticBody",!0),debugShowVelocity:C(J,"debugShowVelocity",!0),bodyDebugColor:C(J,"debugBodyColor",16711935),staticBodyDebugColor:C(J,"debugStaticBodyColor",255),velocityDebugColor:C(J,"debugVelocityColor",65280)},this.maxEntries=C(J,"maxEntries",16),this.useTree=C(J,"useTree",!0),this.tree=new I(this.maxEntries),this.staticTree=new I(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new Q,this._tempMatrix2=new Q,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(U,H){H===void 0&&(H=n.DYNAMIC_BODY),Array.isArray(U)||(U=[U]);for(var J=0;J=q;for(this.fixedStep||(_=H*.001,rt=!0,this._elapsed=0),J=0;J=q;)this._elapsed-=q,this.step(_)}},step:function(U){var H,J,_=this.bodies.entries,q=_.length;for(H=0;H0){var gt=this.tree,yt=this.staticTree;for(J=rt.entries,_=J.length,U=0;U<_;U++)H=J[U],H.physicsType===n.DYNAMIC_BODY?(gt.remove(H),q.delete(H)):H.physicsType===n.STATIC_BODY&&(yt.remove(H),at.delete(H)),H.world=void 0,H.gameObject=void 0;rt.clear()}},updateMotion:function(U,H){U.allowRotation&&this.computeAngularVelocity(U,H),this.computeVelocity(U,H)},computeAngularVelocity:function(U,H){var J=U.angularVelocity,_=U.angularAcceleration,q=U.angularDrag,at=U.maxAngular;_?J+=_*H:U.allowDrag&&q&&(q*=H,v(J-q,0,.1)?J-=q:m(J+q,0,.1)?J+=q:J=0),J=h(J,-at,at);var ot=J-U.angularVelocity;U.angularVelocity+=ot,U.rotation+=U.angularVelocity*H},computeVelocity:function(U,H){var J=U.velocity.x,_=U.acceleration.x,q=U.drag.x,at=U.maxVelocity.x,ot=U.velocity.y,rt=U.acceleration.y,gt=U.drag.y,yt=U.maxVelocity.y,Et=U.speed,At=U.maxSpeed,Pt=U.allowDrag,Vt=U.useDamping;U.allowGravity&&(J+=(this.gravity.x+U.gravity.x)*H,ot+=(this.gravity.y+U.gravity.y)*H),_?J+=_*H:Pt&&q&&(Vt?(q=Math.pow(q,H),J*=q,Et=Math.sqrt(J*J+ot*ot),d(Et,0,.001)&&(J=0)):(q*=H,v(J-q,0,.01)?J-=q:m(J+q,0,.01)?J+=q:J=0)),rt?ot+=rt*H:Pt&>&&(Vt?(gt=Math.pow(gt,H),ot*=gt,Et=Math.sqrt(J*J+ot*ot),d(Et,0,.001)&&(ot=0)):(gt*=H,v(ot-gt,0,.01)?ot-=gt:m(ot+gt,0,.01)?ot+=gt:ot=0)),J=h(J,-at,at),ot=h(ot,-yt,yt),U.velocity.set(J,ot),At>-1&&U.velocity.length()>At&&(U.velocity.normalize().scale(At),Et=At),U.speed=Et},separate:function(U,H,J,_,q){var at,ot,rt=!1,gt=!0;if(!U.enable||!H.enable||U.checkCollision.none||H.checkCollision.none||!this.intersects(U,H)||J&&J.call(_,U.gameObject,H.gameObject)===!1)return rt;if(U.isCircle||H.isCircle){var yt=this.separateCircle(U,H,q);yt.result?(rt=!0,gt=!1):(at=yt.x,ot=yt.y,gt=!0)}if(gt){var Et=!1,At=!1,Pt=this.OVERLAP_BIAS;q?(Et=B(U,H,q,Pt,at),At=G(U,H,q,Pt,ot)):this.forceX||Math.abs(this.gravity.y+U.gravity.y)Ht&&(At=u(Vt,dt,Ht,Dt)-ut):dt>Bt&&(VtHt&&(At=u(Vt,dt,Ht,Bt)-ut)),At*=-1}else At=U.halfWidth+H.halfWidth-f(at,ot);U.overlapR=At,H.overlapR=At;var re=r(at,ot),le=(At+A.EPSILON)*Math.cos(re),ge=(At+A.EPSILON)*Math.sin(re),xe={overlap:At,result:!1,x:le,y:ge};if(J&&(!Pt||Pt&&At!==0))return xe.result=!0,xe;if(!Pt&&At===0||rt&>||U.customSeparateX||H.customSeparateX)return xe.x=void 0,xe.y=void 0,xe;var Pe=!U.pushable&&!H.pushable;if(Pt){var te=at.x-ot.x,Ge=at.y-ot.y,Oe=Math.sqrt(Math.pow(te,2)+Math.pow(Ge,2)),Be=(ot.x-at.x)/Oe||0,Le=(ot.y-at.y)/Oe||0,ne=2*(yt.x*Be+yt.y*Le-Et.x*Be-Et.y*Le)/(U.mass+H.mass);(rt||gt)&&(ne*=2),rt||(yt.x=yt.x-ne/U.mass*Be,yt.y=yt.y-ne/U.mass*Le,yt.multiply(U.bounce)),gt||(Et.x=Et.x+ne/H.mass*Be,Et.y=Et.y+ne/H.mass*Le,Et.multiply(H.bounce)),!rt&&!gt&&(le*=.5,ge*=.5),rt||(U.x-=le,U.y-=ge,U.updateCenter()),gt||(H.x+=le,H.y+=ge,H.updateCenter()),xe.result=!0}else!rt||U.pushable||Pe?(U.x-=le,U.y-=ge,U.updateCenter()):(!gt||H.pushable||Pe)&&(H.x+=le,H.y+=ge,H.updateCenter()),xe.x=void 0,xe.y=void 0;return xe},intersects:function(U,H){return U===H?!1:!U.isCircle&&!H.isCircle?!(U.right<=H.left||U.bottom<=H.top||U.left>=H.right||U.top>=H.bottom):U.isCircle?H.isCircle?f(U.center,H.center)<=U.halfWidth+H.halfWidth:this.circleBodyIntersects(U,H):this.circleBodyIntersects(H,U)},circleBodyIntersects:function(U,H){var J=h(U.center.x,H.left,H.right),_=h(U.center.y,H.top,H.bottom),q=(U.center.x-J)*(U.center.x-J),at=(U.center.y-_)*(U.center.y-_);return q+at<=U.halfWidth*U.halfWidth},overlap:function(U,H,J,_,q){return J===void 0&&(J=null),_===void 0&&(_=null),q===void 0&&(q=J),this.collideObjects(U,H,J,_,q,!0)},collide:function(U,H,J,_,q){return J===void 0&&(J=null),_===void 0&&(_=null),q===void 0&&(q=J),this.collideObjects(U,H,J,_,q,!1)},collideObjects:function(U,H,J,_,q,at){var ot,rt;U.isParent&&(U.physicsType===void 0||H===void 0||U===H)&&(U=U.children.entries),H&&H.isParent&&H.physicsType===void 0&&(H=H.children.entries);var gt=Array.isArray(U),yt=Array.isArray(H);if(this._total=0,!gt&&!yt)this.collideHandler(U,H,J,_,q,at);else if(!gt&&yt)for(ot=0;ot0},collideHandler:function(U,H,J,_,q,at){if(H===void 0&&U.isParent)return this.collideGroupVsGroup(U,U,J,_,q,at);if(!U||!H)return!1;if(U.body||U.isBody){if(H.body||H.isBody)return this.collideSpriteVsSprite(U,H,J,_,q,at);if(H.isParent)return this.collideSpriteVsGroup(U,H,J,_,q,at);if(H.isTilemap)return this.collideSpriteVsTilemapLayer(U,H,J,_,q,at)}else if(U.isParent){if(H.body||H.isBody)return this.collideSpriteVsGroup(H,U,J,_,q,at);if(H.isParent)return this.collideGroupVsGroup(U,H,J,_,q,at);if(H.isTilemap)return this.collideGroupVsTilemapLayer(U,H,J,_,q,at)}else if(U.isTilemap){if(H.body||H.isBody)return this.collideSpriteVsTilemapLayer(H,U,J,_,q,at);if(H.isParent)return this.collideGroupVsTilemapLayer(H,U,J,_,q,at)}},canCollide:function(U,H){return U&&H&&(U.collisionMask&H.collisionCategory)!==0&&(H.collisionMask&U.collisionCategory)!==0},collideSpriteVsSprite:function(U,H,J,_,q,at){var ot=U.isBody?U:U.body,rt=H.isBody?H:H.body;return this.canCollide(ot,rt)?(this.separate(ot,rt,_,q,at)&&(J&&J.call(q,U,H),this._total++),!0):!1},collideSpriteVsGroup:function(U,H,J,_,q,at){var ot=U.isBody?U:U.body;if(!(H.length===0||!ot||!ot.enable||ot.checkCollision.none||!this.canCollide(ot,H))){var rt,gt,yt;if(this.useTree||H.physicsType===n.STATIC_BODY){var Et=this.treeMinMax;Et.minX=ot.left,Et.minY=ot.top,Et.maxX=ot.right,Et.maxY=ot.bottom;var At=H.physicsType===n.DYNAMIC_BODY?this.tree.search(Et):this.staticTree.search(Et);for(gt=At.length,rt=0;rt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setAcceleration:function(e,r){return this.body.acceleration.set(e,r),this},setAccelerationX:function(e){return this.body.acceleration.x=e,this},setAccelerationY:function(e){return this.body.acceleration.y=e,this}};s.exports=y},59023:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setAngularVelocity:function(e){return this.body.angularVelocity=e,this},setAngularAcceleration:function(e){return this.body.angularAcceleration=e,this},setAngularDrag:function(e){return this.body.angularDrag=e,this}};s.exports=y},62069:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setBounce:function(e,r){return this.body.bounce.set(e,r),this},setBounceX:function(e){return this.body.bounce.x=e,this},setBounceY:function(e){return this.body.bounce.y=e,this},setCollideWorldBounds:function(e,r,p,h){return this.body.setCollideWorldBounds(e,r,p,h),this}};s.exports=y},78389:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79599),p={setCollisionCategory:function(h){var a=this.body?this.body:this;return a.collisionCategory=h,this},willCollideWith:function(h){var a=this.body?this.body:this;return(a.collisionMask&h)!==0},addCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=a.collisionMask|h,this},removeCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=a.collisionMask&~h,this},setCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=r(h),this},resetCollisionCategory:function(){var h=this.body?this.body:this;return h.collisionCategory=1,h.collisionMask=1,this}};s.exports=p},87118:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDebug:function(e,r,p){return this.debugShowBody=e,this.debugShowVelocity=r,this.debugBodyColor=p,this},setDebugBodyColor:function(e){return this.body.debugBodyColor=e,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(e){this.body.debugShowBody=e}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(e){this.body.debugShowVelocity=e}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(e){this.body.debugBodyColor=e}}};s.exports=y},52819:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDrag:function(e,r){return this.body.drag.set(e,r),this},setDragX:function(e){return this.body.drag.x=e,this},setDragY:function(e){return this.body.drag.y=e,this},setDamping:function(e){return this.body.useDamping=e,this}};s.exports=y},4074:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDirectControl:function(e){return this.body.setDirectControl(e),this},enableBody:function(e,r,p,h,a){return e&&this.body.reset(r,p),h&&(this.body.gameObject.active=!0),a&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!1),this.body.stop(),this.body.enable=!1,e&&(this.body.gameObject.active=!1),r&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};s.exports=y},40831:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setFriction:function(e,r){return this.body.friction.set(e,r),this},setFrictionX:function(e){return this.body.friction.x=e,this},setFrictionY:function(e){return this.body.friction.y=e,this}};s.exports=y},26775:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setGravity:function(e,r){return this.body.gravity.set(e,r),this},setGravityX:function(e){return this.body.gravity.x=e,this},setGravityY:function(e){return this.body.gravity.y=e,this}};s.exports=y},9437:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setImmovable:function(e){return e===void 0&&(e=!0),this.body.immovable=e,this}};s.exports=y},30621:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setMass:function(e){return this.body.mass=e,this}};s.exports=y},72441:(s,y,e)=>{var r=e(47956),p=e(96503),h=e(2044),a=e(81491),l=function(n,u,f,o,c,d){var v=r(n,u-o,f-o,2*o,2*o,c,d);if(v.length===0)return v;for(var m=new p(u,f,o),S=new p,M=[],w=0;w{var y=function(e,r,p,h,a,l,n){l===void 0&&(l=!0),n===void 0&&(n=!1);var u=[],f=[],o=e.treeMinMax;if(o.minX=r,o.minY=p,o.maxX=r+h,o.maxY=p+a,n&&(f=e.staticTree.search(o)),l&&e.useTree)u=e.tree.search(o);else if(l){var c=e.bodies,d={position:{x:r,y:p},left:r,top:p,right:r+h,bottom:p+a,isCircle:!1},v=e.intersects;c.iterate(function(m){v(m,d)&&u.push(m)})}return f.concat(u)};s.exports=y},62121:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setPushable:function(e){return e===void 0&&(e=!0),this.body.pushable=e,this}};s.exports=y},29384:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setOffset:function(e,r){return this.body.setOffset(e,r),this},setSize:function(e,r,p){return this.body.setSize(e,r,p),this},setBodySize:function(e,r,p){return this.body.setSize(e,r,p),this},setCircle:function(e,r,p){return this.body.setCircle(e,r,p),this}};s.exports=y},15098:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setVelocity:function(e,r){return this.body.setVelocity(e,r),this},setVelocityX:function(e){return this.body.setVelocityX(e),this},setVelocityY:function(e){return this.body.setVelocityY(e),this},setMaxVelocity:function(e,r){return this.body.maxVelocity.set(e,r),this}};s.exports=y},92209:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Acceleration:e(1093),Angular:e(59023),Bounce:e(62069),Collision:e(78389),Debug:e(87118),Drag:e(52819),Enable:e(4074),Friction:e(40831),Gravity:e(26775),Immovable:e(9437),Mass:e(30621),OverlapCirc:e(72441),OverlapRect:e(47956),Pushable:e(62121),Size:e(29384),Velocity:e(15098)}},37747:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},20009:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collide"},36768:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="overlap"},60473:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},89954:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},61804:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="tilecollide"},7161:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="tileoverlap"},34689:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="worldbounds"},16006:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="worldstep"},63012:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COLLIDE:e(20009),OVERLAP:e(36768),PAUSE:e(60473),RESUME:e(89954),TILE_COLLIDE:e(61804),TILE_OVERLAP:e(7161),WORLD_BOUNDS:e(34689),WORLD_STEP:e(16006)}},27064:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=e(79291),h={ArcadePhysics:e(86689),Body:e(37742),Collider:e(79342),Components:e(92209),Events:e(63012),Factory:e(66022),GetCollidesWith:e(79599),GetOverlapX:e(64897),GetOverlapY:e(45170),SeparateX:e(14087),SeparateY:e(89936),Group:e(60758),Image:e(71289),Sprite:e(13759),StaticBody:e(72624),StaticGroup:e(71464),Tilemap:e(55173),World:e(82248)};h=p(!1,h,r),s.exports=h},96602:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.collisionCallback?!e.collisionCallback.call(e.collisionCallbackContext,r,e):e.layer.callbacks[e.index]?!e.layer.callbacks[e.index].callback.call(e.layer.callbacks[e.index].callbackContext,r,e):!0};s.exports=y},36294:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r<0?(e.blocked.none=!1,e.blocked.left=!0):r>0&&(e.blocked.none=!1,e.blocked.right=!0),e.position.x-=r,e.updateCenter(),e.bounce.x===0?e.velocity.x=0:e.velocity.x=-e.velocity.x*e.bounce.x};s.exports=y},67013:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r<0?(e.blocked.none=!1,e.blocked.up=!0):r>0&&(e.blocked.none=!1,e.blocked.down=!0),e.position.y-=r,e.updateCenter(),e.bounce.y===0?e.velocity.y=0:e.velocity.y=-e.velocity.y*e.bounce.y};s.exports=y},40012:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21329),p=e(53442),h=e(2483),a=function(l,n,u,f,o,c,d){var v=f.left,m=f.top,S=f.right,M=f.bottom,w=u.faceLeft||u.faceRight,C=u.faceTop||u.faceBottom;if(d||(w=!0,C=!0),!w&&!C)return!1;var A=0,P=0,b=0,O=1;if(n.deltaAbsX()>n.deltaAbsY()?b=-1:n.deltaAbsX(){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36294),p=function(h,a,l,n,u,f){var o=0,c=a.faceLeft,d=a.faceRight,v=a.collideLeft,m=a.collideRight;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaX()<0&&m&&h.checkCollision.left?d&&h.x0&&v&&h.checkCollision.right&&c&&h.right>l&&(o=h.right-l,o>u&&(o=0)),o!==0&&(h.customSeparateX?h.overlapX=o:r(h,o)),o};s.exports=p},53442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(67013),p=function(h,a,l,n,u,f){var o=0,c=a.faceTop,d=a.faceBottom,v=a.collideUp,m=a.collideDown;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaY()<0&&m&&h.checkCollision.up?d&&h.y0&&v&&h.checkCollision.down&&c&&h.bottom>l&&(o=h.bottom-l,o>u&&(o=0)),o!==0&&(h.customSeparateY?h.overlapY=o:r(h,o)),o};s.exports=p},2483:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return!(r.right<=e.left||r.bottom<=e.top||r.position.x>=e.right||r.position.y>=e.bottom)};s.exports=y},55173:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={ProcessTileCallbacks:e(96602),ProcessTileSeparationX:e(36294),ProcessTileSeparationY:e(67013),SeparateTile:e(40012),TileCheckX:e(21329),TileCheckY:e(53442),TileIntersectsBody:e(2483)};s.exports=r},44563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Arcade:e(27064),Matter:e(3875)}},68174:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(){this.boundsCenter=new p,this.centerDiff=new p},parseBody:function(a){if(a=a.hasOwnProperty("body")?a.body:a,!a.hasOwnProperty("bounds")||!a.hasOwnProperty("centerOfMass"))return!1;var l=this.boundsCenter,n=this.centerDiff,u=a.bounds.max.x-a.bounds.min.x,f=a.bounds.max.y-a.bounds.min.y,o=u*a.centerOfMass.x,c=f*a.centerOfMass.y;return l.set(u/2,f/2),n.set(o-l.x,c-l.y),!0},getTopLeft:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+u.y+f.y)}return!1},getTopCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n+u.y+f.y)}return!1},getTopRight:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+u.y+f.y)}return!1},getLeftCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+f.y)}return!1},getCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.centerDiff;return new p(l+u.x,n+u.y)}return!1},getRightCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+f.y)}return!1},getBottomLeft:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n-(u.y-f.y))}return!1},getBottomCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n-(u.y-f.y))}return!1},getBottomRight:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n-(u.y-f.y))}return!1}});s.exports=h},19933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6790);r.Body=e(22562),r.Composite=e(69351),r.World=e(4372),r.Collision=e(52284),r.Detector=e(81388),r.Pairs=e(99561),r.Pair=e(4506),r.Query=e(73296),r.Resolver=e(66272),r.Constraint=e(48140),r.Common=e(53402),r.Engine=e(48413),r.Events=e(35810),r.Sleeping=e(53614),r.Plugin=e(73832),r.Bodies=e(66280),r.Composites=e(74116),r.Axes=e(66615),r.Bounds=e(15647),r.Svg=e(74058),r.Vector=e(31725),r.Vertices=e(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,s.exports=r},28137:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(83419),h=e(74116),a=e(48140),l=e(74058),n=e(75803),u=e(23181),f=e(34803),o=e(73834),c=e(19496),d=e(85791),v=e(98713),m=e(41598),S=new p({initialize:function(w){this.world=w,this.scene=w.scene,this.sys=w.scene.sys},rectangle:function(M,w,C,A,P){var b=r.rectangle(M,w,C,A,P);return this.world.add(b),b},trapezoid:function(M,w,C,A,P,b){var O=r.trapezoid(M,w,C,A,P,b);return this.world.add(O),O},circle:function(M,w,C,A,P){var b=r.circle(M,w,C,A,P);return this.world.add(b),b},polygon:function(M,w,C,A,P){var b=r.polygon(M,w,C,A,P);return this.world.add(b),b},fromVertices:function(M,w,C,A,P,b,O){typeof C=="string"&&(C=m.fromPath(C));var I=r.fromVertices(M,w,C,A,P,b,O);return this.world.add(I),I},fromPhysicsEditor:function(M,w,C,A,P){P===void 0&&(P=!0);var b=c.parseBody(M,w,C,A);return P&&!this.world.has(b)&&this.world.add(b),b},fromSVG:function(M,w,C,A,P,b){A===void 0&&(A=1),P===void 0&&(P={}),b===void 0&&(b=!0);for(var O=C.getElementsByTagName("path"),I=[],D=0;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31884),p=e(95540),h=e(26099);function a(n){return!!n.get&&typeof n.get=="function"||!!n.set&&typeof n.set=="function"}var l=function(n,u,f,o){f===void 0&&(f={}),o===void 0&&(o=!0);var c=u.x,d=u.y;u.body={temp:!0,position:{x:c,y:d}};var v=[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity];if(v.forEach(function(S){for(var M in S)a(S[M])?Object.defineProperty(u,M,{get:S[M].get,set:S[M].set}):Object.defineProperty(u,M,{value:S[M]})}),u.world=n,u._tempVec2=new h(c,d),f.hasOwnProperty("type")&&f.type==="body")u.setExistingBody(f,o);else{var m=p(f,"shape",null);m||(m="rectangle"),f.addToWorld=o,u.setBody(m,f)}return u};s.exports=l},23181:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31884),h=e(95643),a=e(95540),l=e(88571),n=e(72699),u=e(26099),f=new r({Extends:l,Mixins:[p.Bounce,p.Collision,p.Force,p.Friction,p.Gravity,p.Mass,p.Sensor,p.SetBody,p.Sleep,p.Static,p.Transform,p.Velocity,n],initialize:function(c,d,v,m,S,M){h.call(this,c.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(m,S),this.setSizeToFrame(),this.setOrigin(),this.world=c,this._tempVec2=new u(d,v);var w=a(M,"shape",null);w?this.setBody(w,M):this.setRectangle(this.width,this.height,M),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=f},42045:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=e(66615),h=e(66280),a=e(22562),l=e(68174),n=e(15647),u=e(83419),f=e(52284),o=e(53402),c=e(69351),d=e(74116),v=e(48140),m=e(81388),S=e(20339),M=e(28137),w=e(95540),C=e(35154),A=e(18210),P=e(40178),b=e(6790),O=e(74507),I=e(46975),D=e(4506),B=e(99561),G=e(73832),z=e(37277),X=e(73296),j=e(66272),Q=e(44594),tt=e(74058),Y=e(31725),Z=e(41598),U=e(68243);o.setDecomp(e(55973));var H=new u({initialize:function(_){this.scene=_,this.systems=_.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=a,this.composite=c,this.collision=f,this.detector=m,this.pair=D,this.pairs=B,this.query=X,this.resolver=j,this.constraint=v,this.bodies=h,this.composites=d,this.axes=p,this.bounds=n,this.svg=tt,this.vector=Y,this.vertices=Z,this.verts=Z,this._tempVec2=Y.create(),C(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),C(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),C(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),j._restingThresh=C(this.config,"restingThresh",4),j._restingThreshTangent=C(this.config,"restingThreshTangent",6),j._positionDampen=C(this.config,"positionDampen",.9),j._positionWarming=C(this.config,"positionWarming",.8),j._frictionNormalMultiplier=C(this.config,"frictionNormalMultiplier",5),_.sys.events.once(Q.BOOT,this.boot,this),_.sys.events.on(Q.START,this.start,this)},boot:function(){this.world=new U(this.scene,this.config),this.add=new M(this.world),this.bodyBounds=new l,this.systems.events.once(Q.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new U(this.scene,this.config),this.add=new M(this.world));var J=this.systems.events;J.on(Q.UPDATE,this.world.update,this.world),J.on(Q.POST_UPDATE,this.world.postUpdate,this.world),J.once(Q.SHUTDOWN,this.shutdown,this)},getConfig:function(){var J=this.systems.game.config.physics,_=this.systems.settings.physics,q=I(w(_,"matter",{}),w(J,"matter",{}));return q},enableAttractorPlugin:function(){return G.register(A),G.use(b,A),this},enableWrapPlugin:function(){return G.register(O),G.use(b,O),this},enableCollisionEventsPlugin:function(){return G.register(P),G.use(b,P),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(J,_){this.world.step(J,_)},containsPoint:function(J,_,q){J=this.getMatterBodies(J);var at=Y.create(_,q),ot=X.point(J,at);return ot.length>0},intersectPoint:function(J,_,q){q=this.getMatterBodies(q);var at=Y.create(J,_),ot=[],rt=X.point(q,at);return rt.forEach(function(gt){ot.indexOf(gt)===-1&&ot.push(gt)}),ot},intersectRect:function(J,_,q,at,ot,rt){ot===void 0&&(ot=!1),rt=this.getMatterBodies(rt);var gt={min:{x:J,y:_},max:{x:J+q,y:_+at}},yt=[],Et=X.region(rt,gt,ot);return Et.forEach(function(At){yt.indexOf(At)===-1&&yt.push(At)}),yt},intersectRay:function(J,_,q,at,ot,rt){ot===void 0&&(ot=1),rt=this.getMatterBodies(rt);for(var gt=[],yt=X.ray(rt,Y.create(J,_),Y.create(q,at),ot),Et=0;Et{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31884),a=e(95643),l=e(95540),n=e(72699),u=e(68287),f=e(26099),o=new p({Extends:u,Mixins:[h.Bounce,h.Collision,h.Force,h.Friction,h.Gravity,h.Mass,h.Sensor,h.SetBody,h.Sleep,h.Static,h.Transform,h.Velocity,n],initialize:function(d,v,m,S,M,w){a.call(this,d.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(S,M),this.setSizeToFrame(),this.setOrigin(),this.world=d,this._tempVec2=new f(v,m);var C=l(w,"shape",null);C?this.setBody(C,w):this.setRectangle(this.width,this.height,w),this.setPosition(v,m),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=o},73834:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(83419),a=e(31884),l=e(62644),n=e(50792),u=e(95540),f=e(97022),o=e(41598),c=new h({Extends:n,Mixins:[a.Bounce,a.Collision,a.Friction,a.Gravity,a.Mass,a.Sensor,a.Sleep,a.Static],initialize:function(v,m,S){n.call(this),this.tile=m,this.world=v,m.physics.matterBody&&m.physics.matterBody.destroy(),m.physics.matterBody=this;var M=u(S,"body",null),w=u(S,"addToWorld",!0);if(M)this.setBody(M,w);else{var C=m.getCollisionGroup(),A=u(C,"objects",[]);A.length>0?this.setFromTileCollision(S):this.setFromTileRectangle(S)}if(m.flipX||m.flipY){var P={x:m.getCenterX(),y:m.getCenterY()},b=m.flipX?-1:1,O=m.flipY?-1:1;p.scale(M,b,O,P)}},setFromTileRectangle:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);var v=this.tile.getBounds(),m=v.x+v.width/2,S=v.y+v.height/2,M=r.rectangle(m,S,v.width,v.height,d);return this.setBody(M,d.addToWorld),this},setFromTileCollision:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);for(var v=this.tile.tilemapLayer.scaleX,m=this.tile.tilemapLayer.scaleY,S=this.tile.getLeft(),M=this.tile.getTop(),w=this.tile.getCollisionGroup(),C=u(w,"objects",[]),A=[],P=0;P1){var tt=l(d);tt.parts=A,this.setBody(p.create(tt),tt.addToWorld)}return this},setBody:function(d,v){return v===void 0&&(v=!0),this.body&&this.removeBody(),this.body=d,this.body.gameObject=this,v&&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()}});s.exports=c},19496:(s,y,e)=>{/** + * @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 r=e(66280),p=e(22562),h=e(53402),a=e(95540),l=e(41598),n={parseBody:function(u,f,o,c){c===void 0&&(c={});for(var d=a(o,"fixtures",[]),v=[],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h={parseBody:function(a,l,n,u){u===void 0&&(u={});var f,o=n.vertices;if(o.length===1)u.vertices=o[0],f=p.create(u),r.flagCoincidentParts(f.parts);else{for(var c=[],d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15647),p=e(83419),h=e(69351),a=e(48140),l=e(81388),n=e(1121),u=e(8214),f=e(46975),o=e(53614),c=e(26099),d=e(41598),v=new p({initialize:function(S,M,w){w===void 0&&(w={});var C={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=S,this.world=M,this.camera=null,this.pointer=null,this.active=!0,this.position=new c,this.body=null,this.part=null,this.constraint=a.create(f(w,C)),this.world.on(n.BEFORE_UPDATE,this.update,this),S.sys.input.on(u.POINTER_DOWN,this.onDown,this),S.sys.input.on(u.POINTER_UP,this.onUp,this)},onDown:function(m){this.pointer||(this.pointer=m,this.camera=m.camera)},onUp:function(m){m===this.pointer&&(this.pointer=null)},getBody:function(m){var S=this.position,M=this.constraint;this.camera.getWorldPoint(m.x,m.y,S);for(var w=h.allBodies(this.world.localWorld),C=0;C1?1:0,A=C;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(83419),a=e(53402),l=e(69351),n=e(48413),u=e(50792),f=e(1121),o=e(95540),c=e(35154),d=e(22562),v=e(35810),m=e(73834),S=e(4372),M=e(31725),w=new h({Extends:u,initialize:function(A,P){u.call(this),this.scene=A,this.engine=n.create(P),this.localWorld=this.engine.world;var b=c(P,"gravity",null);b?this.setGravity(b.x,b.y,b.scale):b===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=c(P,"enabled",!0),this.getDelta=c(P,"getDelta",this.update60Hz);var O=o(P,"runner",{}),I=o(O,"fps",!1),D=o(O,"fps",60),B=o(O,"delta",1e3/D),G=o(O,"deltaMin",1e3/D),z=o(O,"deltaMax",1e3/(D*.5));I||(D=1e3/B),this.runner={fps:D,deltaSampleSize:o(O,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:o(O,"isFixed",!1),delta:B,deltaMin:G,deltaMax:z},this.autoUpdate=c(P,"autoUpdate",!0);var X=c(P,"debug",!1);if(this.drawDebug=typeof X=="object"?!0:X,this.debugGraphic,this.debugConfig={showAxes:o(X,"showAxes",!1),showAngleIndicator:o(X,"showAngleIndicator",!1),angleColor:o(X,"angleColor",15208787),showBroadphase:o(X,"showBroadphase",!1),broadphaseColor:o(X,"broadphaseColor",16757760),showBounds:o(X,"showBounds",!1),boundsColor:o(X,"boundsColor",16777215),showVelocity:o(X,"showVelocity",!1),velocityColor:o(X,"velocityColor",44783),showCollisions:o(X,"showCollisions",!1),collisionColor:o(X,"collisionColor",16094476),showSeparations:o(X,"showSeparations",!1),separationColor:o(X,"separationColor",16753920),showBody:o(X,"showBody",!0),showStaticBody:o(X,"showStaticBody",!0),showInternalEdges:o(X,"showInternalEdges",!1),renderFill:o(X,"renderFill",!1),renderLine:o(X,"renderLine",!0),fillColor:o(X,"fillColor",1075465),fillOpacity:o(X,"fillOpacity",1),lineColor:o(X,"lineColor",2678297),lineOpacity:o(X,"lineOpacity",1),lineThickness:o(X,"lineThickness",1),staticFillColor:o(X,"staticFillColor",857979),staticLineColor:o(X,"staticLineColor",1255396),showSleeping:o(X,"showSleeping",!1),staticBodySleepOpacity:o(X,"staticBodySleepOpacity",.7),sleepFillColor:o(X,"sleepFillColor",4605510),sleepLineColor:o(X,"sleepLineColor",10066585),showSensors:o(X,"showSensors",!0),sensorFillColor:o(X,"sensorFillColor",857979),sensorLineColor:o(X,"sensorLineColor",1255396),showPositions:o(X,"showPositions",!0),positionSize:o(X,"positionSize",4),positionColor:o(X,"positionColor",14697178),showJoint:o(X,"showJoint",!0),jointColor:o(X,"jointColor",14737474),jointLineOpacity:o(X,"jointLineOpacity",1),jointLineThickness:o(X,"jointLineThickness",2),pinSize:o(X,"pinSize",4),pinColor:o(X,"pinColor",4382944),springColor:o(X,"springColor",14697184),anchorColor:o(X,"anchorColor",15724527),anchorSize:o(X,"anchorSize",4),showConvexHulls:o(X,"showConvexHulls",!1),hullColor:o(X,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),o(P,"setBounds",!1)){var j=P.setBounds;if(typeof j=="boolean")this.setBounds();else{var Q=o(j,"x",0),tt=o(j,"y",0),Y=o(j,"width",A.sys.scale.width),Z=o(j,"height",A.sys.scale.height),U=o(j,"thickness",64),H=o(j,"left",!0),J=o(j,"right",!0),_=o(j,"top",!0),q=o(j,"bottom",!0);this.setBounds(Q,tt,Y,Z,U,H,J,_,q)}}},setCompositeRenderStyle:function(C){var A=C.bodies,P=C.constraints,b=C.composites,O,I,D;for(O=0;O0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_START,b,I,D)}),v.on(A,"collisionActive",function(b){var O=b.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_ACTIVE,b,I,D)}),v.on(A,"collisionEnd",function(b){var O=b.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_END,b,I,D)})},setBounds:function(C,A,P,b,O,I,D,B,G){return C===void 0&&(C=0),A===void 0&&(A=0),P===void 0&&(P=this.scene.sys.scale.width),b===void 0&&(b=this.scene.sys.scale.height),O===void 0&&(O=64),I===void 0&&(I=!0),D===void 0&&(D=!0),B===void 0&&(B=!0),G===void 0&&(G=!0),this.updateWall(I,"left",C-O,A-O,O,b+O*2),this.updateWall(D,"right",C+P,A-O,O,b+O*2),this.updateWall(B,"top",C,A-O,P,O),this.updateWall(G,"bottom",C,A+b,P,O),this},updateWall:function(C,A,P,b,O,I){var D=this.walls[A];C?(D&&S.remove(this.localWorld,D),P+=O/2,b+=I/2,this.walls[A]=this.create(P,b,O,I,{isStatic:!0,friction:0,frictionStatic:0})):(D&&S.remove(this.localWorld,D),this.walls[A]=null)},createDebugGraphic:function(){var C=this.scene.sys.add.graphics({x:0,y:0});return C.setDepth(Number.MAX_VALUE),this.debugGraphic=C,this.drawDebug=!0,C},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(C,A,P){return C===void 0&&(C=0),A===void 0&&(A=1),P===void 0&&(P=.001),this.localWorld.gravity.x=C,this.localWorld.gravity.y=A,this.localWorld.gravity.scale=P,this},create:function(C,A,P,b,O){var I=r.rectangle(C,A,P,b,O);return S.add(this.localWorld,I),I},add:function(C){return S.add(this.localWorld,C),this},remove:function(C,A){Array.isArray(C)||(C=[C]);for(var P=0;Pb.deltaMax?b.deltaMax:A,b.delta=A),b.timeScalePrev=O.timeScale,b.frameCounter+=1,C-b.counterTimestamp>=1e3&&(b.fps=b.frameCounter*((C-b.counterTimestamp)/1e3),b.counterTimestamp=C,b.frameCounter=0),n.update(P,A)}},step:function(C){n.update(this.engine,C)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(C){var A=C.hasOwnProperty("body")?C.body:C;return l.get(this.localWorld,A.id,A.type)!==null},getAllBodies:function(){return l.allBodies(this.localWorld)},getAllConstraints:function(){return l.allConstraints(this.localWorld)},getAllComposites:function(){return l.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var C=this.debugConfig,A=this.engine,P=this.debugGraphic,b=l.allBodies(this.localWorld);this.debugGraphic.clear(),C.showBroadphase&&A.broadphase.controller&&this.renderGrid(A.broadphase,P,C.broadphaseColor,.5),C.showBounds&&this.renderBodyBounds(b,P,C.boundsColor,.5),(C.showBody||C.showStaticBody)&&this.renderBodies(b),C.showJoint&&this.renderJoints(),(C.showAxes||C.showAngleIndicator)&&this.renderBodyAxes(b,P,C.showAxes,C.angleColor,.5),C.showVelocity&&this.renderBodyVelocity(b,P,C.velocityColor,1,2),C.showSeparations&&this.renderSeparations(A.pairs.list,P,C.separationColor),C.showCollisions&&this.renderCollisions(A.pairs.list,P,C.collisionColor)}},renderGrid:function(C,A,P,b){A.lineStyle(1,P,b);for(var O=a.keys(C.buckets),I=0;I0){var X=z[0].vertex.x,j=z[0].vertex.y;z.length===2&&(X=(z[0].vertex.x+z[1].vertex.x)/2,j=(z[0].vertex.y+z[1].vertex.y)/2),G.bodyB===G.supports[0].body||G.bodyA.isStatic?A.lineBetween(X-G.normal.x*8,j-G.normal.y*8,X,j):A.lineBetween(X+G.normal.x*8,j+G.normal.y*8,X,j)}}return this},renderBodyBounds:function(C,A,P,b){A.lineStyle(1,P,b);for(var O=0;O1?1:0;G1?1:0;z1?1:0;z1&&this.renderConvexHull(Z,A,tt,J)}}},renderBody:function(C,A,P,b,O,I,D,B){b===void 0&&(b=null),O===void 0&&(O=null),I===void 0&&(I=1),D===void 0&&(D=null),B===void 0&&(B=null);for(var G=this.debugConfig,z=G.sensorFillColor,X=G.sensorLineColor,j=C.parts,Q=j.length,tt=Q>1?1:0;tt1){var D=C.vertices;A.lineStyle(b,P),A.beginPath(),A.moveTo(D[0].x,D[0].y);for(var B=1;B0&&(A.fillStyle(D),A.fillCircle(j.x,j.y,B),A.fillCircle(Q.x,Q.y,B)),this},resetCollisionIDs:function(){return p._nextCollidingGroupId=1,p._nextNonCollidingGroupId=-1,p._nextCategory=1,this},shutdown:function(){v.off(this.engine),this.removeAllListeners(),S.clear(this.localWorld,!1),n.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});s.exports=w},70410:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setBounce:function(e){return this.body.restitution=e,this}};s.exports=y},66968:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setCollisionCategory:function(e){return this.body.collisionFilter.category=e,this},setCollisionGroup:function(e){return this.body.collisionFilter.group=e,this},setCollidesWith:function(e){var r=0;if(!Array.isArray(e))r=e;else for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={applyForce:function(h){return this._tempVec2.set(this.body.position.x,this.body.position.y),r.applyForce(this.body,this._tempVec2,h),this},applyForceFrom:function(h,a){return r.applyForce(this.body,h,a),this},thrust:function(h){var a=this.body.angle;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(h){var a=this.body.angle-Math.PI/2;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(h){var a=this.body.angle+Math.PI/2;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(h){var a=this.body.angle-Math.PI;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};s.exports=p},5436:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setFriction:function(e,r,p){return this.body.friction=e,r!==void 0&&(this.body.frictionAir=r),p!==void 0&&(this.body.frictionStatic=p),this},setFrictionAir:function(e){return this.body.frictionAir=e,this},setFrictionStatic:function(e){return this.body.frictionStatic=e,this}};s.exports=y},39858:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setIgnoreGravity:function(e){return this.body.ignoreGravity=e,this}};s.exports=y},37302:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p=e(26099),h={setMass:function(a){return r.setMass(this.body,a),this},setDensity:function(a){return r.setDensity(this.body,a),this},centerOfMass:{get:function(){return new p(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};s.exports=h},39132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setSensor:function(e){return this.body.isSensor=e,this},isSensor:function(){return this.body.isSensor}};s.exports=y},57772:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(43855),a=e(95540),l=e(19496),n=e(85791),u=e(41598),f={setRectangle:function(o,c,d){return this.setBody({type:"rectangle",width:o,height:c},d)},setCircle:function(o,c){return this.setBody({type:"circle",radius:o},c)},setPolygon:function(o,c,d){return this.setBody({type:"polygon",sides:c,radius:o},d)},setTrapezoid:function(o,c,d,v){return this.setBody({type:"trapezoid",width:o,height:c,slope:d},v)},setExistingBody:function(o,c){c===void 0&&(c=!0),this.body&&this.world.remove(this.body,!0),this.body=o;for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1121),p=e(53614),h=e(35810),a={setToSleep:function(){return p.set(this.body,!0),this},setAwake:function(){return p.set(this.body,!1),this},setSleepThreshold:function(l){return l===void 0&&(l=60),this.body.sleepThreshold=l,this},setSleepEvents:function(l,n){return this.setSleepStartEvent(l),this.setSleepEndEvent(n),this},setSleepStartEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepStart",function(u){n.emit(r.SLEEP_START,u,this)})}else h.off(this.body,"sleepStart");return this},setSleepEndEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepEnd",function(u){n.emit(r.SLEEP_END,u,this)})}else h.off(this.body,"sleepEnd");return this}};s.exports=a},90556:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={setStatic:function(h){return r.setStatic(this.body,h),this},isStatic:function(){return this.body.isStatic}};s.exports=p},85436:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p=e(36383),h=e(86554),a=e(30954),l=4,n={x:{get:function(){return this.body.position.x},set:function(u){this._tempVec2.set(u,this.y),r.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(u){this._tempVec2.set(this.x,u),r.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(u){var f=1/this._scaleX,o=1/this._scaleY;this._scaleX=u,this._scaleX===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,o),r.scale(this.body,u,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(u){var f=1/this._scaleX,o=1/this._scaleY;this._scaleY=u,this._scaleY===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,o),r.scale(this.body,this._scaleX,u)}},angle:{get:function(){return a(this.body.angle*p.RAD_TO_DEG)},set:function(u){this.rotation=a(u)*p.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(u){this._rotation=h(u),r.setAngle(this.body,this._rotation)}},setPosition:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this._tempVec2.set(u,f),r.setPosition(this.body,this._tempVec2),this},setRotation:function(u){return u===void 0&&(u=0),this._rotation=h(u),r.setAngle(this.body,u),this},setFixedRotation:function(){return r.setInertia(this.body,1/0),this},setAngle:function(u){return u===void 0&&(u=0),this.angle=u,r.setAngle(this.body,this.rotation),this},setScale:function(u,f,o){u===void 0&&(u=1),f===void 0&&(f=u);var c=1/this._scaleX,d=1/this._scaleY;return this._scaleX=u,this._scaleY=f,r.scale(this.body,c,d,o),r.scale(this.body,u,f,o),this}};s.exports=n},42081:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={setVelocityX:function(h){return this._tempVec2.set(h,this.body.velocity.y),r.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(h){return this._tempVec2.set(this.body.velocity.x,h),r.setVelocity(this.body,this._tempVec2),this},setVelocity:function(h,a){return this._tempVec2.set(h,a),r.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return r.getVelocity(this.body)},setAngularVelocity:function(h){return r.setAngularVelocity(this.body,h),this},getAngularVelocity:function(){return r.getAngularVelocity(this.body)},setAngularSpeed:function(h){return r.setAngularSpeed(this.body,h),this},getAngularSpeed:function(){return r.getAngularSpeed(this.body)}};s.exports=p},31884:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Bounce:e(70410),Collision:e(66968),Force:e(51607),Friction:e(5436),Gravity:e(39858),Mass:e(37302),Sensor:e(39132),SetBody:e(57772),Sleep:e(38083),Static:e(90556),Transform:e(85436),Velocity:e(42081)}},85608:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afteradd"},1213:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afterremove"},25968:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afterupdate"},67205:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeadd"},39438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeremove"},44823:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeupdate"},92593:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionactive"},60128:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionend"},76861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionstart"},92362:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},76408:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},93971:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},5656:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},47861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},79099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleepend"},35906:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleepstart"},1121:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AFTER_ADD:e(85608),AFTER_REMOVE:e(1213),AFTER_UPDATE:e(25968),BEFORE_ADD:e(67205),BEFORE_REMOVE:e(39438),BEFORE_UPDATE:e(44823),COLLISION_ACTIVE:e(92593),COLLISION_END:e(60128),COLLISION_START:e(76861),DRAG_END:e(92362),DRAG:e(76408),DRAG_START:e(93971),PAUSE:e(5656),RESUME:e(47861),SLEEP_END:e(79099),SLEEP_START:e(35906)}},3875:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BodyBounds:e(68174),Components:e(31884),Events:e(1121),Factory:e(28137),MatterGameObject:e(75803),Image:e(23181),Matter:e(19933),MatterPhysics:e(42045),PolyDecomp:e(55973),Sprite:e(34803),TileBody:e(73834),PhysicsEditorParser:e(19496),PhysicsJSONParser:e(85791),PointerConstraint:e(98713),World:e(68243)}},22562:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(31725),a=e(53614),l=e(53402),n=e(15647),u=e(66615);(function(){r._timeCorrection=!0,r._inertiaScale=4,r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,r._baseDelta=16.666666666666668,r.create=function(o){var c={id:l.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:{}};!o.hasOwnProperty("position")&&o.hasOwnProperty("vertices")?o.position=p.centre(o.vertices):o.hasOwnProperty("vertices")||(c.vertices=p.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var d=l.extend(c,o);return f(d,o),d.setOnCollideWith=function(v,m){return m?this.onCollideWith[v.id]=m:delete this.onCollideWith[v.id],this},d},r.nextGroup=function(o){return o?r._nextNonCollidingGroupId--:r._nextCollidingGroupId++},r.nextCategory=function(){return r._nextCategory=r._nextCategory<<1,r._nextCategory};var f=function(o,c){if(c=c||{},r.set(o,{bounds:o.bounds||n.create(o.vertices),positionPrev:o.positionPrev||h.clone(o.position),anglePrev:o.anglePrev||o.angle,vertices:o.vertices,parts:o.parts||[o],isStatic:o.isStatic,isSleeping:o.isSleeping,parent:o.parent||o}),p.rotate(o.vertices,o.angle,o.position),u.rotate(o.axes,o.angle),n.update(o.bounds,o.vertices,o.velocity),r.set(o,{axes:c.axes||o.axes,area:c.area||o.area,mass:c.mass||o.mass,inertia:c.inertia||o.inertia}),o.parts.length===1){var d=o.bounds,v=o.centerOfMass,m=o.centerOffset,S=d.max.x-d.min.x,M=d.max.y-d.min.y;v.x=-(d.min.x-o.position.x)/S,v.y=-(d.min.y-o.position.y)/M,m.x=S*v.x,m.y=M*v.y}};r.set=function(o,c,d){var v;typeof c=="string"&&(v=c,c={},c[v]=d);for(v in c)if(Object.prototype.hasOwnProperty.call(c,v))switch(d=c[v],v){case"isStatic":r.setStatic(o,d);break;case"isSleeping":a.set(o,d);break;case"mass":r.setMass(o,d);break;case"density":r.setDensity(o,d);break;case"inertia":r.setInertia(o,d);break;case"vertices":r.setVertices(o,d);break;case"position":r.setPosition(o,d);break;case"angle":r.setAngle(o,d);break;case"velocity":r.setVelocity(o,d);break;case"angularVelocity":r.setAngularVelocity(o,d);break;case"speed":r.setSpeed(o,d);break;case"angularSpeed":r.setAngularSpeed(o,d);break;case"parts":r.setParts(o,d);break;case"centre":r.setCentre(o,d);break;default:o[v]=d}},r.setStatic=function(o,c){for(var d=0;d0&&h.rotateAbout(S.position,v,o.position,S.position)}},r.setVelocity=function(o,c){var d=o.deltaTime/r._baseDelta;o.positionPrev.x=o.position.x-c.x*d,o.positionPrev.y=o.position.y-c.y*d,o.velocity.x=(o.position.x-o.positionPrev.x)/d,o.velocity.y=(o.position.y-o.positionPrev.y)/d,o.speed=h.magnitude(o.velocity)},r.getVelocity=function(o){var c=r._baseDelta/o.deltaTime;return{x:(o.position.x-o.positionPrev.x)*c,y:(o.position.y-o.positionPrev.y)*c}},r.getSpeed=function(o){return h.magnitude(r.getVelocity(o))},r.setSpeed=function(o,c){r.setVelocity(o,h.mult(h.normalise(r.getVelocity(o)),c))},r.setAngularVelocity=function(o,c){var d=o.deltaTime/r._baseDelta;o.anglePrev=o.angle-c*d,o.angularVelocity=(o.angle-o.anglePrev)/d,o.angularSpeed=Math.abs(o.angularVelocity)},r.getAngularVelocity=function(o){return(o.angle-o.anglePrev)*r._baseDelta/o.deltaTime},r.getAngularSpeed=function(o){return Math.abs(r.getAngularVelocity(o))},r.setAngularSpeed=function(o,c){r.setAngularVelocity(o,l.sign(r.getAngularVelocity(o))*c)},r.translate=function(o,c,d){r.setPosition(o,h.add(o.position,c),d)},r.rotate=function(o,c,d,v){if(!d)r.setAngle(o,o.angle+c,v);else{var m=Math.cos(c),S=Math.sin(c),M=o.position.x-d.x,w=o.position.y-d.y;r.setPosition(o,{x:d.x+(M*m-w*S),y:d.y+(M*S+w*m)},v),r.setAngle(o,o.angle+c,v)}},r.scale=function(o,c,d,v){var m=0,S=0;v=v||o.position;for(var M=o.inertia===1/0,w=0;w0&&(m+=C.area,S+=C.inertia),C.position.x=v.x+(C.position.x-v.x)*c,C.position.y=v.y+(C.position.y-v.y)*d,n.update(C.bounds,C.vertices,o.velocity)}o.parts.length>1&&(o.area=m,o.isStatic||(r.setMass(o,o.density*m),r.setInertia(o,S))),o.circleRadius&&(c===d?o.circleRadius*=c:o.circleRadius=null),M&&r.setInertia(o,1/0)},r.update=function(o,c){c=(typeof c<"u"?c:16.666666666666668)*o.timeScale;var d=c*c,v=r._timeCorrection?c/(o.deltaTime||c):1,m=1-o.frictionAir*(c/l._baseDelta),S=(o.position.x-o.positionPrev.x)*v,M=(o.position.y-o.positionPrev.y)*v;o.velocity.x=S*m+o.force.x/o.mass*d,o.velocity.y=M*m+o.force.y/o.mass*d,o.positionPrev.x=o.position.x,o.positionPrev.y=o.position.y,o.position.x+=o.velocity.x,o.position.y+=o.velocity.y,o.deltaTime=c,o.angularVelocity=(o.angle-o.anglePrev)*m*v+o.torque/o.inertia*d,o.anglePrev=o.angle,o.angle+=o.angularVelocity,o.speed=h.magnitude(o.velocity),o.angularSpeed=Math.abs(o.angularVelocity);for(var w=0;w0&&(C.position.x+=o.velocity.x,C.position.y+=o.velocity.y),o.angularVelocity!==0&&(p.rotate(C.vertices,o.angularVelocity,o.position),u.rotate(C.axes,o.angularVelocity),w>0&&h.rotateAbout(C.position,o.angularVelocity,o.position,C.position)),n.update(C.bounds,C.vertices,o.velocity)}},r.updateVelocities=function(o){var c=r._baseDelta/o.deltaTime,d=o.velocity;d.x=(o.position.x-o.positionPrev.x)*c,d.y=(o.position.y-o.positionPrev.y)*c,o.speed=Math.sqrt(d.x*d.x+d.y*d.y),o.angularVelocity=(o.angle-o.anglePrev)*c,o.angularSpeed=Math.abs(o.angularVelocity)},r.applyForce=function(o,c,d){var v={x:c.x-o.position.x,y:c.y-o.position.y};o.force.x+=d.x,o.force.y+=d.y,o.torque+=v.x*d.y-v.y*d.x},r._totalProperties=function(o){for(var c={mass:0,area:0,inertia:0,centre:{x:0,y:0}},d=o.parts.length===1?0:1;d{var r={};s.exports=r;var p=e(35810),h=e(53402),a=e(15647),l=e(22562);(function(){r.create=function(n){return h.extend({id:h.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},n)},r.setModified=function(n,u,f,o){if(p.trigger(n,"compositeModified",n),n.isModified=u,u&&n.cache&&(n.cache.allBodies=null,n.cache.allConstraints=null,n.cache.allComposites=null),f&&n.parent&&r.setModified(n.parent,u,f,o),o)for(var c=0;c{var r={};s.exports=r;var p=e(69351);(function(){r.create=p.create,r.add=p.add,r.remove=p.remove,r.clear=p.clear,r.addComposite=p.addComposite,r.addBody=p.addBody,r.addConstraint=p.addConstraint})()},52284:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(4506);(function(){var a=[],l={overlap:0,axis:null},n={overlap:0,axis:null};r.create=function(u,f){return{pair:null,collided:!1,bodyA:u,bodyB:f,parentA:u.parent,parentB:f.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},r.collides=function(u,f,o){if(r._overlapAxes(l,u.vertices,f.vertices,u.axes),l.overlap<=0||(r._overlapAxes(n,f.vertices,u.vertices,f.axes),n.overlap<=0))return null;var c=o&&o.table[h.id(u,f)],d;c?d=c.collision:(d=r.create(u,f),d.collided=!0,d.bodyA=u.idY?Y=D:DZ?Z=D:Dd?d=m:m{var y={};s.exports=y,function(){y.create=function(e){return{vertex:e,normalImpulse:0,tangentImpulse:0}}}()},81388:(s,y,e)=>{var r={};s.exports=r;var p=e(53402),h=e(52284);(function(){r.create=function(a){var l={bodies:[],pairs:null};return p.extend(l,a)},r.setBodies=function(a,l){a.bodies=l.slice(0)},r.clear=function(a){a.bodies=[]},r.collisions=function(a){var l=[],n=a.pairs,u=a.bodies,f=u.length,o=r.canCollide,c=h.collides,d,v;for(u.sort(r._compareBoundsX),d=0;dM)break;if(!(wI.max.y)&&!(A&&(O.isStatic||O.isSleeping))&&o(m.collisionFilter,O.collisionFilter)){var D=O.parts.length;if(b&&D===1){var B=c(m,O,n);B&&l.push(B)}else for(var G=P>1?1:0,z=D>1?1:0,X=G;XI.max.x||S.max.xI.max.y)){var B=c(j,tt,n);B&&l.push(B)}}}}}return l},r.canCollide=function(a,l){return a.group===l.group&&a.group!==0?a.group>0:(a.mask&l.category)!==0&&(l.mask&a.category)!==0},r._compareBoundsX=function(a,l){return a.bounds.min.x-l.bounds.min.x}})()},4506:(s,y,e)=>{var r={};s.exports=r;var p=e(43424);(function(){r.create=function(h,a){var l=h.bodyA,n=h.bodyB,u={id:r.id(l,n),bodyA:l,bodyB:n,collision:h,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:l.isSensor||n.isSensor,timeCreated:a,timeUpdated:a,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(u,h,a),u},r.update=function(h,a,l){var n=h.contacts,u=a.supports,f=h.activeContacts,o=a.parentA,c=a.parentB,d=o.vertices.length;h.isActive=!0,h.timeUpdated=l,h.collision=a,h.separation=a.depth,h.inverseMass=o.inverseMass+c.inverseMass,h.friction=o.frictionc.frictionStatic?o.frictionStatic:c.frictionStatic,h.restitution=o.restitution>c.restitution?o.restitution:c.restitution,h.slop=o.slop>c.slop?o.slop:c.slop,a.pair=h,f.length=0;for(var v=0;v{var r={};s.exports=r;var p=e(4506),h=e(53402);(function(){r.create=function(a){return h.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},a)},r.update=function(a,l,n){var u=a.list,f=u.length,o=a.table,c=l.length,d=a.collisionStart,v=a.collisionEnd,m=a.collisionActive,S,M,w,C;for(d.length=0,v.length=0,m.length=0,C=0;C{var r={};s.exports=r;var p=e(31725),h=e(52284),a=e(15647),l=e(66280),n=e(41598);(function(){r.collides=function(u,f){for(var o=[],c=f.length,d=u.bounds,v=h.collides,m=a.overlaps,S=0;S{var r={};s.exports=r;var p=e(41598),h=e(53402),a=e(15647);(function(){r._restingThresh=2,r._restingThreshTangent=Math.sqrt(6),r._positionDampen=.9,r._positionWarming=.8,r._frictionNormalMultiplier=5,r._frictionMaxStatic=Number.MAX_VALUE,r.preSolvePosition=function(l){var n,u,f,o=l.length;for(n=0;nDt?(w=dt>0?dt:-dt,M=P.friction*(dt>0?1:-1)*o,M<-w?M=-w:M>w&&(M=w)):(M=dt,w=m);var Ht=_*z-q*G,Bt=at*z-ot*G,re=Y/(Z+O.inverseInertia*Ht*Ht+I.inverseInertia*Bt*Bt),le=(1+P.restitution)*Vt*re;if(M*=re,Vt0&&(H.normalImpulse=0),le=H.normalImpulse-ge}if(dt<-d||dt>d)H.tangentImpulse=0;else{var xe=H.tangentImpulse;H.tangentImpulse+=M,H.tangentImpulse<-w&&(H.tangentImpulse=-w),H.tangentImpulse>w&&(H.tangentImpulse=w),M=H.tangentImpulse-xe}var Pe=G*le+X*M,te=z*le+j*M;O.isStatic||O.isSleeping||(O.positionPrev.x+=Pe*O.inverseMass,O.positionPrev.y+=te*O.inverseMass,O.anglePrev+=(_*te-q*Pe)*O.inverseInertia),I.isStatic||I.isSleeping||(I.positionPrev.x-=Pe*I.inverseMass,I.positionPrev.y-=te*I.inverseMass,I.anglePrev-=(at*te-ot*Pe)*I.inverseInertia)}}}}})()},48140:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(31725),a=e(53614),l=e(15647),n=e(66615),u=e(53402);(function(){r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(f){var o=f;o.bodyA&&!o.pointA&&(o.pointA={x:0,y:0}),o.bodyB&&!o.pointB&&(o.pointB={x:0,y:0});var c=o.bodyA?h.add(o.bodyA.position,o.pointA):o.pointA,d=o.bodyB?h.add(o.bodyB.position,o.pointB):o.pointB,v=h.magnitude(h.sub(c,d));o.length=typeof o.length<"u"?o.length:v,o.id=o.id||u.nextId(),o.label=o.label||"Constraint",o.type="constraint",o.stiffness=o.stiffness||(o.length>0?1:.7),o.damping=o.damping||0,o.angularStiffness=o.angularStiffness||0,o.angleA=o.bodyA?o.bodyA.angle:o.angleA,o.angleB=o.bodyB?o.bodyB.angle:o.angleB,o.plugin={};var m={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return o.length===0&&o.stiffness>.1?(m.type="pin",m.anchors=!1):o.stiffness<.9&&(m.type="spring"),o.render=u.extend(m,o.render),o},r.preSolveAll=function(f){for(var o=0;o=1||f.length===0,b=P?f.stiffness*o:f.stiffness*o*o,O=f.damping*o,I=h.mult(w,A*b),D=(c?c.inverseMass:0)+(d?d.inverseMass:0),B=(c?c.inverseInertia:0)+(d?d.inverseInertia:0),G=D+B,z,X,j,Q,tt;if(O>0){var Y=h.create();j=h.div(w,C),tt=h.sub(d&&h.sub(d.position,d.positionPrev)||Y,c&&h.sub(c.position,c.positionPrev)||Y),Q=h.dot(j,tt)}c&&!c.isStatic&&(X=c.inverseMass/D,c.constraintImpulse.x-=I.x*X,c.constraintImpulse.y-=I.y*X,c.position.x-=I.x*X,c.position.y-=I.y*X,O>0&&(c.positionPrev.x-=O*j.x*Q*X,c.positionPrev.y-=O*j.y*Q*X),z=h.cross(v,I)/G*r._torqueDampen*c.inverseInertia*(1-f.angularStiffness),c.constraintImpulse.angle-=z,c.angle-=z),d&&!d.isStatic&&(X=d.inverseMass/D,d.constraintImpulse.x+=I.x*X,d.constraintImpulse.y+=I.y*X,d.position.x+=I.x*X,d.position.y+=I.y*X,O>0&&(d.positionPrev.x+=O*j.x*Q*X,d.positionPrev.y+=O*j.y*Q*X),z=h.cross(m,I)/G*r._torqueDampen*d.inverseInertia*(1-f.angularStiffness),d.constraintImpulse.angle+=z,d.angle+=z)}}},r.postSolveAll=function(f){for(var o=0;o0&&(m.position.x+=d.x,m.position.y+=d.y),d.angle!==0&&(p.rotate(m.vertices,d.angle,c.position),n.rotate(m.axes,d.angle),v>0&&h.rotateAbout(m.position,d.angle,c.position,m.position)),l.update(m.bounds,m.vertices,c.velocity)}d.angle*=r._warming,d.x*=r._warming,d.y*=r._warming}}},r.pointAWorld=function(f){return{x:(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),y:(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0)}},r.pointBWorld=function(f){return{x:(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),y:(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0)}},r.currentLength=function(f){var o=(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),c=(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0),d=(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),v=(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0),m=o-d,S=c-v;return Math.sqrt(m*m+S*S)}})()},53402:(s,y,e)=>{var r={};s.exports=r,function(){r._baseDelta=16.666666666666668,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(h,a){var l,n;typeof a=="boolean"?(l=2,n=a):(l=1,n=!0);for(var u=l;u0;a--){var l=Math.floor(r.random()*(a+1)),n=h[a];h[a]=h[l],h[l]=n}return h},r.choose=function(h){return h[Math.floor(r.random()*h.length)]},r.isElement=function(h){return typeof HTMLElement<"u"?h instanceof HTMLElement:!!(h&&h.nodeType&&h.nodeName)},r.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"},r.isFunction=function(h){return typeof h=="function"},r.isPlainObject=function(h){return typeof h=="object"&&h.constructor===Object},r.isString=function(h){return toString.call(h)==="[object String]"},r.clamp=function(h,a,l){return hl?l:h},r.sign=function(h){return h<0?-1:1},r.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-r._nowStartTime},r.random=function(h,a){return h=typeof h<"u"?h:0,a=typeof a<"u"?a:1,h+p()*(a-h)};var p=function(){return r._seed=(r._seed*9301+49297)%233280,r._seed/233280};r.colorToNumber=function(h){return h=h.replace("#",""),h.length==3&&(h=h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2)),parseInt(h,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var h=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[h]||(r.warn(h),r._warnedOnce[h]=!0)},r.deprecated=function(h,a,l){h[a]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",l)},h[a])},r.nextId=function(){return r._nextId++},r.indexOf=function(h,a){if(h.indexOf)return h.indexOf(a);for(var l=0;l{var r={};s.exports=r;var p=e(53614),h=e(66272),a=e(81388),l=e(99561),n=e(35810),u=e(69351),f=e(48140),o=e(53402),c=e(22562);(function(){r.create=function(d){d=d||{};var v={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}},m=o.extend(v,d);return m.world=d.world||u.create({label:"World"}),m.pairs=d.pairs||l.create(),m.detector=d.detector||a.create(),m.grid={buckets:[]},m.world.gravity=m.gravity,m.broadphase=m.grid,m.metrics={},m},r.update=function(d,v){var m=o.now(),S=d.world,M=d.detector,w=d.pairs,C=d.timing,A=C.timestamp,P;v=typeof v<"u"?v:o._baseDelta,v*=C.timeScale,C.timestamp+=v,C.lastDelta=v;var b={timestamp:C.timestamp,delta:v};n.trigger(d,"beforeUpdate",b);var O=u.allBodies(S),I=u.allConstraints(S);for(S.isModified&&(a.setBodies(M,O),u.setModified(S,!1,!1,!0)),d.enableSleeping&&p.update(O,v),r._bodiesApplyGravity(O,d.gravity),v>0&&r._bodiesUpdate(O,v),n.trigger(d,"beforeSolve",b),f.preSolveAll(O),P=0;P0&&n.trigger(d,"collisionStart",{pairs:w.collisionStart,timestamp:C.timestamp,delta:v});var B=o.clamp(20/d.positionIterations,0,1);for(h.preSolvePosition(w.list),P=0;P0&&n.trigger(d,"collisionActive",{pairs:w.collisionActive,timestamp:C.timestamp,delta:v}),w.collisionEnd.length>0&&n.trigger(d,"collisionEnd",{pairs:w.collisionEnd,timestamp:C.timestamp,delta:v}),r._bodiesClearForces(O),n.trigger(d,"afterUpdate",b),d.timing.lastElapsed=o.now()-m,d},r.merge=function(d,v){if(o.extend(d,v),v.world){d.world=v.world,r.clear(d);for(var m=u.allBodies(d.world),S=0;S{var r={};s.exports=r;var p=e(53402);(function(){r.on=function(h,a,l){for(var n=a.split(" "),u,f=0;f0){l||(l={}),n=a.split(" ");for(var d=0;d{var r={};s.exports=r;var p=e(73832),h=e(53402);(function(){r.name="matter-js",r.version="0.19.0",r.uses=[],r.used=[],r.use=function(){p.use(r,Array.prototype.slice.call(arguments))},r.before=function(a,l){return a=a.replace(/^Matter./,""),h.chainPathBefore(r,a,l)},r.after=function(a,l){return a=a.replace(/^Matter./,""),h.chainPathAfter(r,a,l)}})()},73832:(s,y,e)=>{var r={};s.exports=r;var p=e(53402);(function(){r._registry={},r.register=function(h){if(r.isPlugin(h)||p.warn("Plugin.register:",r.toString(h),"does not implement all required fields."),h.name in r._registry){var a=r._registry[h.name],l=r.versionParse(h.version).number,n=r.versionParse(a.version).number;l>n?(p.warn("Plugin.register:",r.toString(a),"was upgraded to",r.toString(h)),r._registry[h.name]=h):l-1},r.isFor=function(h,a){var l=h.for&&r.dependencyParse(h.for);return!h.for||a.name===l.name&&r.versionSatisfies(a.version,l.range)},r.use=function(h,a){if(h.uses=(h.uses||[]).concat(a||[]),h.uses.length===0){p.warn("Plugin.use:",r.toString(h),"does not specify any dependencies to install.");return}for(var l=r.dependencies(h),n=p.topologicalSort(l),u=[],f=0;f0&&!o.silent&&p.info(u.join(" "))},r.dependencies=function(h,a){var l=r.dependencyParse(h),n=l.name;if(a=a||{},!(n in a)){h=r.resolve(h)||h,a[n]=p.map(h.uses||[],function(f){r.isPlugin(f)&&r.register(f);var o=r.dependencyParse(f),c=r.resolve(f);return c&&!r.versionSatisfies(c.version,o.range)?(p.warn("Plugin.dependencies:",r.toString(c),"does not satisfy",r.toString(o),"used by",r.toString(l)+"."),c._warned=!0,h._warned=!0):c||(p.warn("Plugin.dependencies:",r.toString(f),"used by",r.toString(l),"could not be resolved."),h._warned=!0),o.name});for(var u=0;u=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;a.test(h)||p.warn("Plugin.versionParse:",h,"is not a valid version or range.");var l=a.exec(h),n=Number(l[4]),u=Number(l[5]),f=Number(l[6]);return{isRange:!!(l[1]||l[2]),version:l[3],range:h,operator:l[1]||l[2]||"",major:n,minor:u,patch:f,parts:[n,u,f],prerelease:l[7],number:n*1e8+u*1e4+f}},r.versionSatisfies=function(h,a){a=a||"*";var l=r.versionParse(a),n=r.versionParse(h);if(l.isRange){if(l.operator==="*"||h==="*")return!0;if(l.operator===">")return n.number>l.number;if(l.operator===">=")return n.number>=l.number;if(l.operator==="~")return n.major===l.major&&n.minor===l.minor&&n.patch>=l.patch;if(l.operator==="^")return l.major>0?n.major===l.major&&n.number>=l.number:l.minor>0?n.minor===l.minor&&n.patch>=l.patch:n.patch===l.patch}return h===a||h==="*"}})()},53614:(s,y,e)=>{var r={};s.exports=r;var p=e(22562),h=e(35810),a=e(53402);(function(){r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(l,n){for(var u=n/a._baseDelta,f=r._motionSleepThreshold,o=0;o0&&c.motion=c.sleepThreshold/u&&r.set(c,!0)):c.sleepCounter>0&&(c.sleepCounter-=1)}},r.afterCollisions=function(l){for(var n=r._motionSleepThreshold,u=0;un&&r.set(v,!1)}}}},r.set=function(l,n){var u=l.isSleeping;n?(l.isSleeping=!0,l.sleepCounter=l.sleepThreshold,l.positionImpulse.x=0,l.positionImpulse.y=0,l.positionPrev.x=l.position.x,l.positionPrev.y=l.position.y,l.anglePrev=l.angle,l.speed=0,l.angularSpeed=0,l.motion=0,u||h.trigger(l,"sleepStart")):(l.isSleeping=!1,l.sleepCounter=0,u&&h.trigger(l,"sleepEnd"))}})()},66280:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(53402),a=e(22562),l=e(15647),n=e(31725);(function(){r.rectangle=function(u,f,o,c,d){d=d||{};var v={label:"Rectangle Body",position:{x:u,y:f},vertices:p.fromPath("L 0 0 L "+o+" 0 L "+o+" "+c+" L 0 "+c)};if(d.chamfer){var m=d.chamfer;v.vertices=p.chamfer(v.vertices,m.radius,m.quality,m.qualityMin,m.qualityMax),delete d.chamfer}return a.create(h.extend({},v,d))},r.trapezoid=function(u,f,o,c,d,v){v=v||{},d*=.5;var m=(1-d*2)*o,S=o*d,M=S+m,w=M+S,C;d<.5?C="L 0 0 L "+S+" "+-c+" L "+M+" "+-c+" L "+w+" 0":C="L 0 0 L "+M+" "+-c+" L "+w+" 0";var A={label:"Trapezoid Body",position:{x:u,y:f},vertices:p.fromPath(C)};if(v.chamfer){var P=v.chamfer;A.vertices=p.chamfer(A.vertices,P.radius,P.quality,P.qualityMin,P.qualityMax),delete v.chamfer}return a.create(h.extend({},A,v))},r.circle=function(u,f,o,c,d){c=c||{};var v={label:"Circle Body",circleRadius:o};d=d||25;var m=Math.ceil(Math.max(10,Math.min(d,o)));return m%2===1&&(m+=1),r.polygon(u,f,m,o,h.extend({},v,c))},r.polygon=function(u,f,o,c,d){if(d=d||{},o<3)return r.circle(u,f,c,d);for(var v=2*Math.PI/o,m="",S=v*.5,M=0;M0&&p.area(tt)1?(C=a.create(h.extend({parts:A.slice(0)},c)),a.setPosition(C,{x:u,y:f}),C):A[0]},r.flagCoincidentParts=function(u,f){f===void 0&&(f=5);for(var o=0;o{var r={};s.exports=r;var p=e(69351),h=e(48140),a=e(53402),l=e(22562),n=e(66280);(function(){r.stack=function(u,f,o,c,d,v,m){for(var S=p.create({label:"Stack"}),M=u,w=f,C,A=0,P=0;Pb&&(b=D),l.translate(I,{x:B*.5,y:D*.5}),M=I.bounds.max.x+d,p.addBody(S,I),C=I,A+=1}else M+=d}w+=b+v,M=u}return S},r.chain=function(u,f,o,c,d,v){for(var m=u.bodies,S=1;S0)for(S=0;S0&&(C=v[S-1+(m-1)*f],p.addConstraint(u,h.create(a.extend({bodyA:C,bodyB:w},d)))),c&&Sb)){C=b-C;var I=C,D=o-1-C;if(!(wD)){P===1&&l.translate(A,{x:(w+(o%2===1?1:-1))*O,y:0});var B=A?w*O:0;return m(u+B+w*d,M,w,C,A,P)}}})},r.newtonsCradle=function(u,f,o,c,d){for(var v=p.create({label:"Newtons Cradle"}),m=0;m{var r={};s.exports=r;var p=e(31725),h=e(53402);(function(){r.fromVertices=function(a){for(var l={},n=0;n{var y={};s.exports=y,function(){y.create=function(e){var r={min:{x:0,y:0},max:{x:0,y:0}};return e&&y.update(r,e),r},y.update=function(e,r,p){e.min.x=1/0,e.max.x=-1/0,e.min.y=1/0,e.max.y=-1/0;for(var h=0;he.max.x&&(e.max.x=a.x),a.xe.max.y&&(e.max.y=a.y),a.y0?e.max.x+=p.x:e.min.x+=p.x,p.y>0?e.max.y+=p.y:e.min.y+=p.y)},y.contains=function(e,r){return r.x>=e.min.x&&r.x<=e.max.x&&r.y>=e.min.y&&r.y<=e.max.y},y.overlaps=function(e,r){return e.min.x<=r.max.x&&e.max.x>=r.min.x&&e.max.y>=r.min.y&&e.min.y<=r.max.y},y.translate=function(e,r){e.min.x+=r.x,e.max.x+=r.x,e.min.y+=r.y,e.max.y+=r.y},y.shift=function(e,r){var p=e.max.x-e.min.x,h=e.max.y-e.min.y;e.min.x=r.x,e.max.x=r.x+p,e.min.y=r.y,e.max.y=r.y+h}}()},74058:(s,y,e)=>{var r={};s.exports=r,e(15647);var p=e(53402);(function(){r.pathToVertices=function(h,a){typeof window<"u"&&!("SVGPathSeg"in window)&&p.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var l,n,u,f,o,c,d,v,m,S,M=[],w,C,A=0,P=0,b=0;a=a||15;var O=function(D,B,G){var z=G%2===1&&G>1;if(!m||D!=m.x||B!=m.y){m&&z?(w=m.x,C=m.y):(w=0,C=0);var X={x:w+D,y:C+B};(z||!m)&&(m=X),M.push(X),P=w+D,b=C+B}},I=function(D){var B=D.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":P=D.x,b=D.y;break;case"H":P=D.x;break;case"V":b=D.y;break}O(P,b,D.pathSegType)}};for(r._svgPathToAbsolute(h),u=h.getTotalLength(),c=[],l=0;l{var y={};s.exports=y,function(){y.create=function(e,r){return{x:e||0,y:r||0}},y.clone=function(e){return{x:e.x,y:e.y}},y.magnitude=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},y.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},y.rotate=function(e,r,p){var h=Math.cos(r),a=Math.sin(r);p||(p={});var l=e.x*h-e.y*a;return p.y=e.x*a+e.y*h,p.x=l,p},y.rotateAbout=function(e,r,p,h){var a=Math.cos(r),l=Math.sin(r);h||(h={});var n=p.x+((e.x-p.x)*a-(e.y-p.y)*l);return h.y=p.y+((e.x-p.x)*l+(e.y-p.y)*a),h.x=n,h},y.normalise=function(e){var r=y.magnitude(e);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},y.dot=function(e,r){return e.x*r.x+e.y*r.y},y.cross=function(e,r){return e.x*r.y-e.y*r.x},y.cross3=function(e,r,p){return(r.x-e.x)*(p.y-e.y)-(r.y-e.y)*(p.x-e.x)},y.add=function(e,r,p){return p||(p={}),p.x=e.x+r.x,p.y=e.y+r.y,p},y.sub=function(e,r,p){return p||(p={}),p.x=e.x-r.x,p.y=e.y-r.y,p},y.mult=function(e,r){return{x:e.x*r,y:e.y*r}},y.div=function(e,r){return{x:e.x/r,y:e.y/r}},y.perp=function(e,r){return r=r===!0?-1:1,{x:r*-e.y,y:r*e.x}},y.neg=function(e){return{x:-e.x,y:-e.y}},y.angle=function(e,r){return Math.atan2(r.y-e.y,r.x-e.x)},y._temp=[y.create(),y.create(),y.create(),y.create(),y.create(),y.create()]}()},41598:(s,y,e)=>{var r={};s.exports=r;var p=e(31725),h=e(53402);(function(){r.create=function(a,l){for(var n=[],u=0;u0)return!1;o=c}return!0},r.scale=function(a,l,n,u){if(l===1&&n===1)return a;u=u||r.centre(a);for(var f,o,c=0;c=0?c-1:a.length-1],v=a[c],m=a[(c+1)%a.length],S=l[c0&&(l|=2),l===3)return!1;return l!==0?!0:null},r.hull=function(a){var l=[],n=[],u,f;for(a=a.slice(0),a.sort(function(o,c){var d=o.x-c.x;return d!==0?d:o.y-c.y}),f=0;f=2&&p.cross3(n[n.length-2],n[n.length-1],u)<=0;)n.pop();n.push(u)}for(f=a.length-1;f>=0;f-=1){for(u=a[f];l.length>=2&&p.cross3(l[l.length-2],l[l.length-1],u)<=0;)l.pop();l.push(u)}return l.pop(),n.pop(),l.concat(n)}})()},18210:(s,y,e)=>{var r=e(19933),p={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Body.create",function(){p.Body.init(this)}),h.before("Engine.update",function(a){p.Engine.update(a)})},Body:{init:function(h){h.plugin.attractors=h.plugin.attractors||[]}},Engine:{update:function(h){for(var a=r.Composite.allBodies(h.world),l=0;l0)for(var f=0;f{/** + * @author @dxu https://github.com/dxu/matter-collision-events + * @author Richard Davey + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.19.0",silent:!0,install:function(e){e.after("Engine.create",function(){e.Events.on(this,"collisionStart",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collide",h,a,p),a.gameObject&&a.gameObject.emit("collide",a,h,p),e.Events.trigger(h,"onCollide",{pair:p}),e.Events.trigger(a,"onCollide",{pair:p}),h.onCollideCallback&&h.onCollideCallback(p),a.onCollideCallback&&a.onCollideCallback(p),h.onCollideWith[a.id]&&h.onCollideWith[a.id](a,p),a.onCollideWith[h.id]&&a.onCollideWith[h.id](h,p)})}),e.Events.on(this,"collisionActive",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collideActive",h,a,p),a.gameObject&&a.gameObject.emit("collideActive",a,h,p),e.Events.trigger(h,"onCollideActive",{pair:p}),e.Events.trigger(a,"onCollideActive",{pair:p}),h.onCollideActiveCallback&&h.onCollideActiveCallback(p),a.onCollideActiveCallback&&a.onCollideActiveCallback(p)})}),e.Events.on(this,"collisionEnd",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collideEnd",h,a,p),a.gameObject&&a.gameObject.emit("collideEnd",a,h,p),e.Events.trigger(h,"onCollideEnd",{pair:p}),e.Events.trigger(a,"onCollideEnd",{pair:p}),h.onCollideEndCallback&&h.onCollideEndCallback(p),a.onCollideEndCallback&&a.onCollideEndCallback(p)})})})}};s.exports=y},74507:(s,y,e)=>{var r=e(19933),p={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Engine.update",function(){p.Engine.update(this)})},Engine:{update:function(h){for(var a=h.world,l=r.Composite.allBodies(a),n=r.Composite.allComposites(a),u=0;ua.max.x?l=a.min.x-h.max.x:h.max.xa.max.y?n=a.min.y-h.max.y:h.max.y{/** + * @author Stefan Hedman (http://steffe.se) + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={decomp:I,quickDecomp:z,isSimple:B,removeCollinearPoints:X,removeDuplicatePoints:j,makeCCW:m};function y(Y,Z,U){U=U||0;var H=[0,0],J,_,q,at,ot,rt,gt;return J=Y[1][1]-Y[0][1],_=Y[0][0]-Y[1][0],q=J*Y[0][0]+_*Y[0][1],at=Z[1][1]-Z[0][1],ot=Z[0][0]-Z[1][0],rt=at*Z[0][0]+ot*Z[0][1],gt=J*ot-at*_,Q(gt,0,U)||(H[0]=(ot*q-_*rt)/gt,H[1]=(J*rt-at*q)/gt),H}function e(Y,Z,U,H){var J=Z[0]-Y[0],_=Z[1]-Y[1],q=H[0]-U[0],at=H[1]-U[1];if(q*_-at*J===0)return!1;var ot=(J*(U[1]-Y[1])+_*(Y[0]-U[0]))/(q*_-at*J),rt=(q*(Y[1]-U[1])+at*(U[0]-Y[0]))/(at*J-q*_);return ot>=0&&ot<=1&&rt>=0&&rt<=1}function r(Y,Z,U){return(Z[0]-Y[0])*(U[1]-Y[1])-(U[0]-Y[0])*(Z[1]-Y[1])}function p(Y,Z,U){return r(Y,Z,U)>0}function h(Y,Z,U){return r(Y,Z,U)>=0}function a(Y,Z,U){return r(Y,Z,U)<0}function l(Y,Z,U){return r(Y,Z,U)<=0}var n=[],u=[];function f(Y,Z,U,H){if(H){var J=n,_=u;J[0]=Z[0]-Y[0],J[1]=Z[1]-Y[1],_[0]=U[0]-Z[0],_[1]=U[1]-Z[1];var q=J[0]*_[0]+J[1]*_[1],at=Math.sqrt(J[0]*J[0]+J[1]*J[1]),ot=Math.sqrt(_[0]*_[0]+_[1]*_[1]),rt=Math.acos(q/(at*ot));return rtU[Z][0])&&(Z=H);return p(c(Y,Z-1),c(Y,Z),c(Y,Z+1))?!1:(S(Y),!0)}function S(Y){for(var Z=[],U=Y.length,H=0;H!==U;H++)Z.push(Y.pop());for(var H=0;H!==U;H++)Y[H]=Z[H]}function M(Y,Z){return a(c(Y,Z-1),c(Y,Z),c(Y,Z+1))}var w=[],C=[];function A(Y,Z,U){var H,J,_=w,q=C;if(h(c(Y,Z+1),c(Y,Z),c(Y,U))&&l(c(Y,Z-1),c(Y,Z),c(Y,U)))return!1;J=o(c(Y,Z),c(Y,U));for(var at=0;at!==Y.length;++at)if(!((at+1)%Y.length===Z||at===Z)&&h(c(Y,Z),c(Y,U),c(Y,at+1))&&l(c(Y,Z),c(Y,U),c(Y,at))&&(_[0]=c(Y,Z),_[1]=c(Y,U),q[0]=c(Y,at),q[1]=c(Y,at+1),H=y(_,q),o(c(Y,Z),H)0?D(Y,Z):[Y]}function D(Y,Z){if(Z.length===0)return[Y];if(Z instanceof Array&&Z.length&&Z[0]instanceof Array&&Z[0].length===2&&Z[0][0]instanceof Array){for(var U=[Y],H=0;H_)return console.warn("quickDecomp: max level ("+_+") reached."),Z;for(var Bt=0;BtPt&&(Pt+=Y.length),At=Number.MAX_VALUE,Pt3&&H>=0;--H)f(c(Y,H-1),c(Y,H),c(Y,H+1),Z)&&(Y.splice(H%Y.length,1),U++);return U}function j(Y,Z){for(var U=Y.length-1;U>=1;--U)for(var H=Y[U],J=U-1;J>=0;--J)if(tt(H,Y[J],Z)){Y.splice(U,1);continue}}function Q(Y,Z,U){return U=U||0,Math.abs(Y-Z)<=U}function tt(Y,Z,U){return Q(Y[0],Z[0],U)&&Q(Y[1],Z[1],U)}},52018:(s,y,e)=>{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var r=e(83419),p=new r({initialize:function(a){this.pluginManager=a,this.game=a.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});s.exports=p},42363:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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"]};s.exports=y},37277:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={},e={},r={};r.register=function(p,h,a,l){l===void 0&&(l=!1),y[p]={plugin:h,mapping:a,custom:l}},r.registerCustom=function(p,h,a,l){e[p]={plugin:h,mapping:a,data:l}},r.hasCore=function(p){return y.hasOwnProperty(p)},r.hasCustom=function(p){return e.hasOwnProperty(p)},r.getCore=function(p){return y[p]},r.getCustom=function(p){return e[p]},r.getCustomClass=function(p){return e.hasOwnProperty(p)?e[p].plugin:null},r.remove=function(p){y.hasOwnProperty(p)&&delete y[p]},r.removeCustom=function(p){e.hasOwnProperty(p)&&delete e[p]},r.destroyCorePlugins=function(){for(var p in y)y.hasOwnProperty(p)&&delete y[p]},r.destroyCustomPlugins=function(){for(var p in e)e.hasOwnProperty(p)&&delete e[p]},s.exports=r},77332:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8443),h=e(50792),a=e(74099),l=e(44603),n=e(39429),u=e(95540),f=e(37277),o=e(72905),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],v.isBooted?this.boot():v.events.once(p.BOOT,this.boot,this)},boot:function(){var d,v,m,S,M,w,C,A=this.game.config,P=A.installGlobalPlugins;for(P=P.concat(this._pendingGlobal),d=0;d{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var r=e(52018),p=e(83419),h=e(44594),a=new p({Extends:r,initialize:function(n,u,f){r.call(this,u),this.scene=n,this.systems=n.sys,this.pluginKey=f,n.sys.events.once(h.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});s.exports=a},18922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BasePlugin:e(52018),DefaultPlugins:e(42363),PluginCache:e(37277),PluginManager:e(77332),ScenePlugin:e(45145)}},63595:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(s){const y=performance.now(),e=this.getVideoPlaybackQuality(),r=this.mozPresentedFrames||this.mozPaintedFrames||e.totalVideoFrames-e.droppedVideoFrames,p=(h,a)=>{const l=this.getVideoPlaybackQuality(),n=this.mozPresentedFrames||this.mozPaintedFrames||l.totalVideoFrames-l.droppedVideoFrames;if(n>r){const u=this.mozFrameDelay||l.totalFrameDelay-e.totalFrameDelay||0,f=a-h;s(a,{presentationTime:a+u*1e3,expectedDisplayTime:a+f,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+f/1e3,presentedFrames:n,processingDuration:u}),delete this._rvfcpolyfillmap[y]}else this._rvfcpolyfillmap[y]=requestAnimationFrame(u=>p(a,u))};return this._rvfcpolyfillmap[y]=requestAnimationFrame(h=>p(y,h)),y},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(s){cancelAnimationFrame(this._rvfcpolyfillmap[s]),delete this._rvfcpolyfillmap[s]})},10312:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={DEFAULT:0,LINEAR:0,NEAREST:1};s.exports=y},68627:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19715),p=e(32880),h=e(83419),a=e(8054),l=e(50792),n=e(92503),u=e(56373),f=e(97480),o=e(69442),c=e(61340),d=new h({Extends:l,initialize:function(m){l.call(this);var S=m.config;this.config={clearBeforeRender:S.clearBeforeRender,backgroundColor:S.backgroundColor,antialias:S.antialias,roundPixels:S.roundPixels},this.game=m,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=m.canvas;var M={alpha:m.config.transparent,desynchronized:m.config.desynchronized,willReadFrequently:!1};this.gameContext=S.context?S.context:this.gameCanvas.getContext("2d",M),this.currentContext=this.gameContext,this.antialias=m.config.antialias,this.blendModes=u(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(o.READY,this.boot,this)},boot:function(){var v=this.game,m=v.scale.baseSize;this.width=m.width,this.height=m.height,this.isBooted=!0,v.scale.on(f.RESIZE,this.onResize,this),this.resize(m.width,m.height)},onResize:function(v,m){(m.width!==this.width||m.height!==this.height)&&this.resize(m.width,m.height)},resize:function(v,m){this.width=v,this.height=m,this.emit(n.RESIZE,v,m)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(v){return this.currentContext.globalCompositeOperation=v,this},setContext:function(v){return this.currentContext=v||this.gameContext,this},setAlpha:function(v){return this.currentContext.globalAlpha=v,this},preRender:function(){var v=this.gameContext,m=this.config,S=this.width,M=this.height;v.globalAlpha=1,v.globalCompositeOperation="source-over",v.setTransform(1,0,0,1,0,0),m.clearBeforeRender&&(v.clearRect(0,0,S,M),m.transparent||(v.fillStyle=m.backgroundColor.rgba,v.fillRect(0,0,S,M))),v.save(),this.drawCount=0,this.emit(n.PRE_RENDER)},render:function(v,m,S){var M=m.length;this.emit(n.RENDER,v,S);var w=S.x,C=S.y,A=S.width,P=S.height,b=S.renderToTexture?S.context:v.sys.context;b.save(),this.game.scene.customViewports&&(b.beginPath(),b.rect(w,C,A,P),b.clip()),S.emit(r.PRE_RENDER,S),this.currentContext=b;var O=S.mask;O&&O.preRenderCanvas(this,null,S._maskCamera),S.transparent||(b.fillStyle=S.backgroundColor.rgba,b.fillRect(w,C,A,P)),b.globalAlpha=S.alpha,b.globalCompositeOperation="source-over",this.drawCount+=M,S.renderToTexture&&S.emit(r.PRE_RENDER,S),S.matrix.copyToContext(b);for(var I=0;I=0?Q=-(Q+D):Q<0&&(Q=Math.abs(Q)-D)),v.flipY&&(tt>=0?tt=-(tt+B):tt<0&&(tt=Math.abs(tt)-B))}var Z=1,U=1;v.flipX&&(G||(Q+=-m.realWidth+X*2),Z=-1),v.flipY&&(G||(tt+=-m.realHeight+j*2),U=-1);var H=v.x,J=v.y;P.applyITRS(H,J,v.rotation,v.scaleX*Z,v.scaleY*U),A.copyFrom(S.matrix),M?(A.multiplyWithOffset(M,-S.scrollX*v.scrollFactorX,-S.scrollY*v.scrollFactorY),P.e=H,P.f=J):(P.e-=S.scrollX*v.scrollFactorX,P.f-=S.scrollY*v.scrollFactorY),A.multiply(P),S.roundPixels&&(A.e=Math.round(A.e),A.f=Math.round(A.f)),C.save(),A.setToContext(C),C.globalCompositeOperation=this.blendModes[v.blendMode],C.globalAlpha=w,C.imageSmoothingEnabled=!m.source.scaleMode,v.mask&&v.mask.preRenderCanvas(this,v,S),D>0&&B>0&&(S.roundPixels?C.drawImage(m.source.image,O,I,D,B,Math.round(Q),Math.round(tt),Math.round(D/z),Math.round(B/z)):C.drawImage(m.source.image,O,I,D,B,Q,tt,D/z,B/z)),v.mask&&v.mask.postRenderCanvas(this,v,S),C.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});s.exports=d},55830:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CanvasRenderer:e(68627),GetBlendModes:e(56373),SetTransform:e(20926)}},56373:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(89289),h=function(){var a=[],l=p.supportNewBlendModes,n="source-over";return a[r.NORMAL]=n,a[r.ADD]="lighter",a[r.MULTIPLY]=l?"multiply":n,a[r.SCREEN]=l?"screen":n,a[r.OVERLAY]=l?"overlay":n,a[r.DARKEN]=l?"darken":n,a[r.LIGHTEN]=l?"lighten":n,a[r.COLOR_DODGE]=l?"color-dodge":n,a[r.COLOR_BURN]=l?"color-burn":n,a[r.HARD_LIGHT]=l?"hard-light":n,a[r.SOFT_LIGHT]=l?"soft-light":n,a[r.DIFFERENCE]=l?"difference":n,a[r.EXCLUSION]=l?"exclusion":n,a[r.HUE]=l?"hue":n,a[r.SATURATION]=l?"saturation":n,a[r.COLOR]=l?"color":n,a[r.LUMINOSITY]=l?"luminosity":n,a[r.ERASE]="destination-out",a[r.SOURCE_IN]="source-in",a[r.SOURCE_OUT]="source-out",a[r.SOURCE_ATOP]="source-atop",a[r.DESTINATION_OVER]="destination-over",a[r.DESTINATION_IN]="destination-in",a[r.DESTINATION_OUT]="destination-out",a[r.DESTINATION_ATOP]="destination-atop",a[r.LIGHTER]="lighter",a[r.COPY]="copy",a[r.XOR]="xor",a};s.exports=h},20926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n,u){var f=n.alpha*l.alpha;if(f<=0)return!1;var o=r(l,n,u).calc;return a.globalCompositeOperation=h.blendModes[l.blendMode],a.globalAlpha=f,a.save(),o.setToContext(a),a.imageSmoothingEnabled=l.frame?!l.frame.source.scaleMode:h.antialias,!0};s.exports=p},63899:s=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="losewebgl"},6119:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},48070:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},15640:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="render"},8912:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resize"},87124:s=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="restorewebgl"},92503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={LOSE_WEBGL:e(63899),POST_RENDER:e(6119),PRE_RENDER:e(48070),RENDER:e(15640),RESIZE:e(8912),RESTORE_WEBGL:e(87124)}},36909:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(92503),Snapshot:e(89966)},s.exports.Canvas=e(55830),s.exports.WebGL=e(4159)},32880:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(40987),h=e(95540),a=function(l,n){var u=h(n,"callback"),f=h(n,"type","image/png"),o=h(n,"encoder",.92),c=Math.abs(Math.round(h(n,"x",0))),d=Math.abs(Math.round(h(n,"y",0))),v=Math.floor(h(n,"width",l.width)),m=Math.floor(h(n,"height",l.height)),S=h(n,"getPixel",!1);if(S){var M=l.getContext("2d",{willReadFrequently:!1}),w=M.getImageData(c,d,1,1),C=w.data;u.call(null,new p(C[0],C[1],C[2],C[3]))}else if(c!==0||d!==0||v!==l.width||m!==l.height){var A=r.createWebGL(this,v,m),P=A.getContext("2d",{willReadFrequently:!0});v>0&&m>0&&P.drawImage(l,c,d,v,m,0,0,v,m);var b=new Image;b.onerror=function(){u.call(null),r.remove(A)},b.onload=function(){u.call(null,b),r.remove(A)},b.src=A.toDataURL(f,o)}else{var O=new Image;O.onerror=function(){u.call(null)},O.onload=function(){u.call(null,O)},O.src=l.toDataURL(f,o)}};s.exports=a},88815:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(40987),h=e(95540),a=function(l,n){var u=l,f=h(n,"callback"),o=h(n,"type","image/png"),c=h(n,"encoder",.92),d=Math.abs(Math.round(h(n,"x",0))),v=Math.abs(Math.round(h(n,"y",0))),m=h(n,"getPixel",!1),S=h(n,"isFramebuffer",!1),M=S?h(n,"bufferWidth",1):u.drawingBufferWidth,w=S?h(n,"bufferHeight",1):u.drawingBufferHeight;if(m){var C=new Uint8Array(4),A=S?v:w-v;u.readPixels(d,A,1,1,u.RGBA,u.UNSIGNED_BYTE,C),f.call(null,new p(C[0],C[1],C[2],C[3]))}else{var P=Math.floor(h(n,"width",M)),b=Math.floor(h(n,"height",w)),O=P*b*4,I=new Uint8Array(O);u.readPixels(d,w-v-b,P,b,u.RGBA,u.UNSIGNED_BYTE,I);for(var D=r.createWebGL(this,P,b),B=D.getContext("2d",{willReadFrequently:!0}),G=B.getImageData(0,0,P,b),z=G.data,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Canvas:e(32880),WebGL:e(88815)}},7530:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36060),h=e(90330),a=e(82264),l=e(95540),n=e(32302),u=e(63448),f=e(31302),o=e(58918),c=e(14811),d=e(92651),v=e(96569),m=e(56527),S=e(57516),M=e(43439),w=e(81041),C=e(12385),A=e(7589),P=e(95428),b=e(72905),O=new r({initialize:function(D){this.game=D.game,this.renderer=D,this.classes=new h([[p.UTILITY_PIPELINE,A],[p.MULTI_PIPELINE,S],[p.BITMAPMASK_PIPELINE,f],[p.SINGLE_PIPELINE,C],[p.ROPE_PIPELINE,w],[p.LIGHT_PIPELINE,v],[p.POINTLIGHT_PIPELINE,M],[p.MOBILE_PIPELINE,m]]),this.postPipelineClasses=new h,this.pipelines=new h,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(I,D,B){var G=this.renderer,z=this.renderTargets;this.frameInc=Math.floor(l(I,"frameInc",32));var X=G.width,j=G.height,Q=this.game.config.disablePreFX,tt=this.game.config.disablePostFX;if(tt||this.postPipelineClasses.setAll([[String(c.BARREL),o.Barrel],[String(c.BLOOM),o.Bloom],[String(c.BLUR),o.Blur],[String(c.BOKEH),o.Bokeh],[String(c.CIRCLE),o.Circle],[String(c.COLOR_MATRIX),o.ColorMatrix],[String(c.DISPLACEMENT),o.Displacement],[String(c.GLOW),o.Glow],[String(c.GRADIENT),o.Gradient],[String(c.PIXELATE),o.Pixelate],[String(c.SHADOW),o.Shadow],[String(c.SHINE),o.Shine],[String(c.VIGNETTE),o.Vignette],[String(c.WIPE),o.Wipe]]),!Q){this.classes.set(p.FX_PIPELINE,d);for(var Y=Math.min(X,j),Z=Math.ceil(Y/this.frameInc),U=1;U=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatch:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;B=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatchCamera:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;Bthis.maxDimension)return this.targetIndex=D.length-B,D[this.targetIndex];var G=(u(I,this.frameInc,0,!0)-1)*B;return this.targetIndex=G,D[G]},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}});s.exports=O},32302:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92503),h=new r({initialize:function(l,n,u,f,o,c,d,v,m){f===void 0&&(f=1),o===void 0&&(o=0),c===void 0&&(c=!0),d===void 0&&(d=!1),v===void 0&&(v=!0),m===void 0&&(m=!0),this.renderer=l,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=f,this.minFilter=o,this.autoClear=c,this.autoResize=!0,this.hasDepthBuffer=v,this.forceClamp=m,this.resize(n,u),d?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(a){return a&&!this.autoResize?(this.renderer.on(p.RESIZE,this.resize,this),this.autoResize=!0):!a&&this.autoResize&&(this.renderer.off(p.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(a,l){if(a=Math.round(a*this.scale),l=Math.round(l*this.scale),a<=0&&(a=1),l<=0&&(l=1),this.autoResize&&(a!==this.width||l!==this.height)){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),this.texture=n.createTextureFromSource(null,a,l,this.minFilter,this.forceClamp),this.framebuffer=n.createFramebuffer(a,l,this.texture,this.hasDepthBuffer),this.width=a,this.height=l}return this},willResize:function(a,l){return a=Math.round(a*this.scale),l=Math.round(l*this.scale),a<=0&&(a=1),l<=0&&(l=1),a!==this.width||l!==this.height},bind:function(a,l,n){a===void 0&&(a=!1);var u=this.renderer;if(a&&u.flush(),l&&n&&this.resize(l,n),u.pushFramebuffer(this.framebuffer,!1,!1),a&&this.adjustViewport(),this.autoClear){var f=this.renderer.gl;f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT)}u.clearStencilMask()},adjustViewport:function(){var a=this.renderer.gl;a.viewport(0,0,this.width,this.height),a.disable(a.SCISSOR_TEST)},clear:function(){var a=this.renderer,l=a.gl;a.pushFramebuffer(this.framebuffer),l.disable(l.SCISSOR_TEST),l.clearColor(0,0,0,0),l.clear(l.COLOR_BUFFER_BIT),a.popFramebuffer(),a.resetScissor()},unbind:function(a){a===void 0&&(a=!1);var l=this.renderer;return a&&l.flush(),l.popFramebuffer()},destroy:function(){var a=this.renderer;a.off(p.RESIZE,this.resize,this),a.deleteFramebuffer(this.framebuffer),a.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});s.exports=h},70554:s=>{/** + * @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} + */s.exports={getTintFromFloats:function(y,e,r,p){var h=(y*255|0)&255,a=(e*255|0)&255,l=(r*255|0)&255,n=(p*255|0)&255;return(n<<24|h<<16|a<<8|l)>>>0},getTintAppendFloatAlpha:function(y,e){var r=(e*255|0)&255;return(r<<24|y)>>>0},getTintAppendFloatAlphaAndSwap:function(y,e){var r=(y>>16|0)&255,p=(y>>8|0)&255,h=(y|0)&255,a=(e*255|0)&255;return(a<<24|h<<16|p<<8|r)>>>0},getFloatsFromUintRGB:function(y){var e=(y>>16|0)&255,r=(y>>8|0)&255,p=(y|0)&255;return[e/255,r/255,p/255]},checkShaderMax:function(y,e){var r=Math.min(16,y.getParameter(y.MAX_TEXTURE_IMAGE_UNITS));return!e||e===-1?r:Math.min(r,e)},parseFragmentShaderMaxTextures:function(y,e){if(!y)return"";for(var r="",p=0;p0&&(r+=` + else `),p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(62644),h=e(50792),a=e(77085),l=e(95540),n=e(37867),u=e(92503),f=e(32302),o=e(70554),c=e(38683),d=new r({Extends:h,initialize:function(m){h.call(this);var S=m.game,M=S.renderer,w=M.gl;this.name=l(m,"name","WebGLPipeline"),this.game=S,this.renderer=M,this.manager,this.gl=w,this.view=S.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=l(m,"topology",w.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=l(m,"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=m,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=l(m,"resizeUniform","")},boot:function(){var v,m=this.gl,S=this.config,M=this.renderer;this.isPostFX||(this.projectionMatrix=new n().identity());var w=this.renderTargets,C=l(S,"renderTarget",!1);typeof C=="boolean"&&C&&(C=1);var A=M.width,P=M.height;if(typeof C=="number")for(v=0;vX&&(X=z[v].vertexSize);var j=l(S,"batchSize",M.config.batchSize);this.vertexCapacity=j*6;var Q=new ArrayBuffer(this.vertexCapacity*X);this.vertexData=Q,this.bytes=new Uint8Array(Q),this.vertexViewF32=new Float32Array(Q),this.vertexViewU32=new Uint32Array(Q);var tt=l(S,"vertices",null);for(tt?(this.vertexViewF32.set(tt),this.vertexBuffer=M.createVertexBuffer(Q,m.STATIC_DRAW)):this.vertexBuffer=M.createVertexBuffer(Q.byteLength,m.DYNAMIC_DRAW),this.setVertexBuffer(),v=z.length-1;v>=0;v--)z[v].rebind();this.hasBooted=!0,M.on(u.RESIZE,this.resize,this),M.on(u.PRE_RENDER,this.onPreRender,this),M.on(u.RENDER,this.onRender,this),M.on(u.POST_RENDER,this.onPostRender,this),this.emit(a.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(v,m,S){var M=this.renderer;if(v!==this.currentShader||M.currentProgram!==this.currentShader.program){this.flush();var w=this.setVertexBuffer(S);w&&!m&&(m=!0),v.bind(m,!1),this.currentShader=v}return this},getShaderByName:function(v){for(var m=this.shaders,S=0;S-1&&(z=Y.substring(20))}X&&j&&B.push(new c(this,z,X,j,p(Q)))}this.shaders=B}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(v){return this.currentBatch={start:this.vertexCount,count:0,texture:[v],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=v,this.batch.push(this.currentBatch),0},addTextureToBatch:function(v){var m=this.currentBatch;m&&(m.texture.push(v),m.unit++,m.maxUnit++)},pushBatch:function(v){if(!this.currentBatch||this.forceZero&&v!==this.currentTexture)return this.createBatch(v);if(v===this.currentTexture)return this.currentUnit;var m=this.currentBatch,S=m.texture.indexOf(v);return S===-1?m.texture.length===this.renderer.maxTextures?this.createBatch(v):(m.unit++,m.maxUnit++,m.texture.push(v),this.currentUnit=m.unit,this.currentTexture=v,m.unit):(this.currentUnit=S,this.currentTexture=v,S)},setGameObject:function(v,m){return m===void 0&&(m=v.frame),this.pushBatch(m.source.glTexture)},shouldFlush:function(v){return v===void 0&&(v=0),this.vertexCount+v>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(v,m){(v!==this.width||m!==this.height)&&this.flush(),this.width=v,this.height=m;for(var S=this.renderTargets,M=0;M=0;S--){var M=m[S].rebind();(!v||M===v)&&(this.currentShader=M)}return this.activeTextures.length=0,this.emit(a.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var v=this.shaders,m=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,m&&this.setVertexBuffer();for(var S=0;S0){this.emit(a.BEFORE_FLUSH,this,v),this.onBeforeFlush(v);var m=this.gl,S=this.vertexCount,M=this.currentShader.vertexSize,w=this.topology;if(this.active){this.setVertexBuffer(),S===this.vertexCapacity?m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.DYNAMIC_DRAW):m.bufferSubData(m.ARRAY_BUFFER,0,this.bytes.subarray(0,S*M));var C,A,P,b=this.batch,O=this.activeTextures;if(this.forceZero)for(O[0]||m.activeTexture(m.TEXTURE0),C=0;C{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95428),p=e(72905),h=e(19715),a=e(83419),l=e(8054),n=e(50792),u=e(92503),f=e(50030),o=e(37867),c=e(29747),d=e(7530),v=e(32302),m=e(97480),S=e(69442),M=e(70554),w=e(88815),C=e(26128),A=e(1482),P=e(82751),b=e(84387),O=e(93567),I=e(57183),D=new a({Extends:n,initialize:function(G){n.call(this);var z=G.config,X={alpha:z.transparent,desynchronized:z.desynchronized,depth:!0,antialias:z.antialiasGL,premultipliedAlpha:z.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:z.failIfMajorPerformanceCaveat,powerPreference:z.powerPreference,preserveDrawingBuffer:z.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:z.clearBeforeRender,antialias:z.antialias,backgroundColor:z.backgroundColor,contextCreation:X,roundPixels:z.roundPixels,maxTextures:z.maxTextures,maxTextureSize:z.maxTextureSize,batchSize:z.batchSize,maxLights:z.maxLights,mipmapFilter:z.mipmapFilter},this.game=G,this.type=l.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=G.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=c,this.contextRestoredHandler=c,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(B){var G,z=this.game,X=this.canvas,j=B.backgroundColor;if(z.config.context?G=z.config.context:G=X.getContext("webgl",B.contextCreation)||X.getContext("experimental-webgl",B.contextCreation),!G||G.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=G;var Q=this,tt=function(){var U=G.getSupportedExtensions();Q.supportedExtensions=U;var H="ANGLE_instanced_arrays";Q.instancedArraysExtension=U.indexOf(H)>-1?G.getExtension(H):null;var J="OES_vertex_array_object";Q.vaoExtension=U.indexOf(J)>-1?G.getExtension(J):null};tt(),this.contextLostHandler=function(U){Q.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),Q.emit(u.LOSE_WEBGL,Q),U.preventDefault()},X.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(U){if(G.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}Q.currentProgram=null,Q.currentFramebuffer=null,Q.setBlendMode(l.BlendModes.NORMAL),G.disable(G.BLEND),G.disable(G.DEPTH_TEST),G.enable(G.CULL_FACE),Q.compression=Q.getCompressedTextures();var H=function(J){J.createResource()};r(Q.glTextureWrappers,H),r(Q.glBufferWrappers,H),r(Q.glFramebufferWrappers,H),r(Q.glProgramWrappers,H),r(Q.glAttribLocationWrappers,H),r(Q.glUniformLocationWrappers,H),Q.createTemporaryTextures(),Q.pipelines.restoreContext(),Q.resize(Q.game.scale.baseSize.width,Q.game.scale.baseSize.height),tt(),Q.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),Q.emit(u.RESTORE_WEBGL,Q),U.preventDefault()},X.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),z.context=G;for(var Y=0;Y<=27;Y++)this.blendModes.push({func:[G.ONE,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_ADD});this.blendModes[1].func=[G.ONE,G.DST_ALPHA],this.blendModes[2].func=[G.DST_COLOR,G.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[G.ONE,G.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[G.ZERO,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_REVERSE_SUBTRACT},this.glFormats=[G.BYTE,G.SHORT,G.UNSIGNED_BYTE,G.UNSIGNED_SHORT,G.FLOAT],this.glFuncMap={mat2:{func:G.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:G.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:G.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:G.uniform1f,length:1},"1fv":{func:G.uniform1fv,length:1},"1i":{func:G.uniform1i,length:1},"1iv":{func:G.uniform1iv,length:1},"2f":{func:G.uniform2f,length:2},"2fv":{func:G.uniform2fv,length:1},"2i":{func:G.uniform2i,length:2},"2iv":{func:G.uniform2iv,length:1},"3f":{func:G.uniform3f,length:3},"3fv":{func:G.uniform3fv,length:1},"3i":{func:G.uniform3i,length:3},"3iv":{func:G.uniform3iv,length:1},"4f":{func:G.uniform4f,length:4},"4fv":{func:G.uniform4fv,length:1},"4i":{func:G.uniform4i,length:4},"4iv":{func:G.uniform4iv,length:1}},(!B.maxTextures||B.maxTextures===-1)&&(B.maxTextures=G.getParameter(G.MAX_TEXTURE_IMAGE_UNITS)),B.maxTextureSize||(B.maxTextureSize=G.getParameter(G.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),G.disable(G.DEPTH_TEST),G.disable(G.CULL_FACE),G.enable(G.BLEND),G.clearColor(j.redGL,j.greenGL,j.blueGL,j.alphaGL);var Z=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return Z.indexOf(B.mipmapFilter)!==-1&&(this.mipmapFilter=G[B.mipmapFilter]),this.maxTextures=M.checkShaderMax(G,B.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new d(this),this.setBlendMode(l.BlendModes.NORMAL),this.projectionMatrix=new o().identity(),z.textures.once(S.READY,this.boot,this),this},boot:function(){var B=this.game,G=this.pipelines,z=B.scale.baseSize,X=z.width,j=z.height;this.width=X,this.height=j,this.isBooted=!0,this.renderTarget=new v(this,X,j,1,0,!0,!0),this.maskTarget=new v(this,X,j,1,0,!0,!0),this.maskSource=new v(this,X,j,1,0,!0,!0);var Q=B.config;G.boot(Q.pipeline,Q.defaultPipeline,Q.autoMobilePipeline),this.blankTexture=B.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=B.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=B.textures.getFrame("__WHITE").glTexture;var tt=this.gl;tt.bindFramebuffer(tt.FRAMEBUFFER,null),tt.enable(tt.SCISSOR_TEST),B.scale.on(m.RESIZE,this.onResize,this),this.resize(X,j)},createTemporaryTextures:function(){for(var B=this.gl,G=0;G0&&X>0;if(tt&&Y){var Z=tt[0],U=tt[1],H=tt[2],J=tt[3];Y=Z!==B||U!==G||H!==z||J!==X}Y&&(this.flush(),Q.scissor(B,j-G-X,z,X))},resetScissor:function(){var B=this.gl;B.enable(B.SCISSOR_TEST);var G=this.currentScissor;if(G){var z=G[0],X=G[1],j=G[2],Q=G[3];j>0&&Q>0&&B.scissor(z,this.drawingBufferHeight-X-Q,j,Q)}},popScissor:function(){var B=this.scissorStack;B.pop();var G=B[B.length-1];G&&this.setScissor(G[0],G[1],G[2],G[3]),this.currentScissor=G},hasActiveStencilMask:function(){var B=this.currentMask.mask,G=this.currentCameraMask.mask;return B&&B.isStencil||G&&G.isStencil},resetViewport:function(){var B=this.gl;B.viewport(0,0,this.width,this.height),this.drawingBufferHeight=B.drawingBufferHeight},setBlendMode:function(B,G){G===void 0&&(G=!1);var z=this.gl,X=this.blendModes[B];return G||B!==l.BlendModes.SKIP_CHECK&&this.currentBlendMode!==B?(this.flush(),z.enable(z.BLEND),z.blendEquation(X.equation),X.func.length>2?z.blendFuncSeparate(X.func[0],X.func[1],X.func[2],X.func[3]):z.blendFunc(X.func[0],X.func[1]),this.currentBlendMode=B,!0):!1},addBlendMode:function(B,G){var z=this.blendModes.push({func:B,equation:G});return z-1},updateBlendMode:function(B,G,z){return this.blendModes[B]&&(this.blendModes[B].func=G,z&&(this.blendModes[B].equation=z)),this},removeBlendMode:function(B){return B>17&&this.blendModes[B]&&this.blendModes.splice(B,1),this},pushFramebuffer:function(B,G,z,X,j){return B===this.currentFramebuffer?this:(this.fboStack.push(B),this.setFramebuffer(B,G,z,X,j))},setFramebuffer:function(B,G,z,X,j){if(G===void 0&&(G=!1),z===void 0&&(z=!0),X===void 0&&(X=null),j===void 0&&(j=!1),B===this.currentFramebuffer)return this;var Q=this.gl,tt=this.width,Y=this.height;return B&&B.renderTexture&&z?(tt=B.renderTexture.width,Y=B.renderTexture.height):this.flush(),B?Q.bindFramebuffer(Q.FRAMEBUFFER,B.webGLFramebuffer):Q.bindFramebuffer(Q.FRAMEBUFFER,null),z&&Q.viewport(0,0,tt,Y),X&&Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,X.webGLTexture,0),j&&(Q.clearColor(0,0,0,0),Q.clear(Q.COLOR_BUFFER_BIT)),G&&(B?(this.drawingBufferHeight=Y,this.pushScissor(0,0,tt,Y)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=B,this},popFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack;z.pop();var X=z[z.length-1];return X||(X=null),this.setFramebuffer(X,B,G),X},restoreFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack,X=z[z.length-1];X||(X=null),this.currentFramebuffer=null,this.setFramebuffer(X,B,G)},setProgram:function(B){return B!==this.currentProgram?(this.flush(),this.gl.useProgram(B.webGLProgram),this.currentProgram=B,!0):!1},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(B,G,z,X,j){j===void 0&&(j=!1);var Q=this.gl,tt=Q.NEAREST,Y=Q.NEAREST,Z=Q.CLAMP_TO_EDGE,U=null;G=B?B.width:G,z=B?B.height:z;var H=f(G,z);if(H&&!j&&(Z=Q.REPEAT),X===l.ScaleModes.LINEAR&&this.config.antialias){var J=B&&B.compressed,_=!J&&H||J&&B.mipmaps.length>1;tt=this.mipmapFilter&&_?this.mipmapFilter:Q.LINEAR,Y=Q.LINEAR}return!B&&typeof G=="number"&&typeof z=="number"?U=this.createTexture2D(0,tt,Y,Z,Z,Q.RGBA,null,G,z):U=this.createTexture2D(0,tt,Y,Z,Z,Q.RGBA,B),U},createTexture2D:function(B,G,z,X,j,Q,tt,Y,Z,U,H,J){typeof Y!="number"&&(Y=tt?tt.width:1),typeof Z!="number"&&(Z=tt?tt.height:1);var _=new P(this.gl,B,G,z,X,j,Q,tt,Y,Z,U,H,J);return this.glTextureWrappers.push(_),_},createFramebuffer:function(B,G,z,X){this.currentFramebuffer=null;var j=new b(this.gl,B,G,z,X);return this.glFramebufferWrappers.push(j),j},beginBitmapMask:function(B,G){var z=this.gl;z&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==B&&(this.currentMask.mask=B,this.currentMask.camera=G))},drawBitmapMask:function(B,G,z){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),B.renderWebGL(this,B,G),this.maskSource.unbind(!0),this.maskTarget.unbind();var X=this.gl,j=this.getCurrentStencilMask();j?(X.enable(X.STENCIL_TEST),j.mask.applyStencil(this,j.camera,!0)):this.currentMask.mask=null,this.pipelines.set(z),X.activeTexture(X.TEXTURE0),X.bindTexture(X.TEXTURE_2D,this.maskTarget.texture.webGLTexture),X.activeTexture(X.TEXTURE1),X.bindTexture(X.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(B,G){var z=new A(this.gl,B,G);return this.glProgramWrappers.push(z),z},createVertexBuffer:function(B,G){var z=this.gl,X=new C(z,B,z.ARRAY_BUFFER,G);return this.glBufferWrappers.push(X),X},createAttribLocation:function(B,G){var z=new O(this.gl,B,G);return this.glAttribLocationWrappers.push(z),z},createUniformLocation:function(B,G){var z=new I(this.gl,B,G);return this.glUniformLocationWrappers.push(z),z},createIndexBuffer:function(B,G){var z=this.gl,X=new C(z,B,z.ELEMENT_ARRAY_BUFFER,G);return this.glBufferWrappers.push(X),X},deleteTexture:function(B){if(B)return p(this.glTextureWrappers,B),B.destroy(),this},deleteFramebuffer:function(B){return B?(p(this.fboStack,B),p(this.glFramebufferWrappers,B),B.destroy(),this):this},deleteProgram:function(B){return B&&(p(this.glProgramWrappers,B),B.destroy()),this},deleteAttribLocation:function(B){return B&&(p(this.glAttribLocationWrappers,B),B.destroy()),this},deleteUniformLocation:function(B){return B&&(p(this.glUniformLocationWrappers,B),B.destroy()),this},deleteBuffer:function(B){return B?(p(this.glBufferWrappers,B),B.destroy(),this):this},preRenderCamera:function(B){var G=B.x,z=B.y,X=B.width,j=B.height,Q=B.backgroundColor;if(B.emit(h.PRE_RENDER,B),this.pipelines.preBatchCamera(B),this.pushScissor(G,z,X,j),B.mask&&(this.currentCameraMask.mask=B.mask,this.currentCameraMask.camera=B._maskCamera,B.mask.preRenderWebGL(this,B,B._maskCamera)),Q.alphaGL>0){var tt=this.pipelines.setMulti();tt.drawFillRect(G,z,X,j,M.getTintFromFloats(Q.blueGL,Q.greenGL,Q.redGL,1),Q.alphaGL)}},getCurrentStencilMask:function(){var B=null,G=this.maskStack,z=this.currentCameraMask;return G.length>0?B=G[G.length-1]:z.mask&&z.mask.isStencil&&(B=z),B},postRenderCamera:function(B){var G=B.flashEffect,z=B.fadeEffect;if(G.isRunning||z.isRunning||z.isComplete){var X=this.pipelines.setMulti();G.postRenderWebGL(X,M.getTintFromFloats),z.postRenderWebGL(X,M.getTintFromFloats)}B.dirty=!1,this.popScissor(),B.mask&&(this.currentCameraMask.mask=null,B.mask.postRenderWebGL(this,B._maskCamera)),this.pipelines.postBatchCamera(B),B.emit(h.POST_RENDER,B)},preRender:function(){if(!this.contextLost){var B=this.gl;if(B.bindFramebuffer(B.FRAMEBUFFER,null),this.config.clearBeforeRender){var G=this.config.backgroundColor;B.clearColor(G.redGL,G.greenGL,G.blueGL,G.alphaGL),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT|B.STENCIL_BUFFER_BIT)}B.enable(B.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&B.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(u.PRE_RENDER)}},render:function(B,G,z){if(!this.contextLost){var X=G.length;if(this.emit(u.RENDER,B,z),this.preRenderCamera(z),X===0){this.setBlendMode(l.BlendModes.NORMAL),this.postRenderCamera(z);return}this.currentType="";for(var j=this.currentMask,Q=0;Q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95428),h=e(95540),a=e(14500),l=new r({initialize:function(u,f,o,c,d){this.pipeline=u,this.name=f,this.renderer=u.renderer,this.gl=this.renderer.gl,this.fragSrc=c,this.vertSrc=o,this.program=this.renderer.createProgram(o,c),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(d),this.createUniforms()},createAttributes:function(n){var u=0,f=0,o=[];this.vertexComponentCount=0;for(var c=0;c=0?(u.enableVertexAttribArray(b.webGLAttribLocation),u.vertexAttribPointer(b.webGLAttribLocation,S,M,P,o,w),m.enabled=!0,m.location=b):b.webGLAttribLocation!==-1&&u.disableVertexAttribArray(b.webGLAttribLocation)}else C?u.vertexAttribPointer(A.webGLAttribLocation,S,M,P,o,w):!C&&A!==-1&&A.webGLAttribLocation>-1&&(u.disableVertexAttribArray(A.webGLAttribLocation),m.location=-1)}return this},createUniforms:function(){var n=this.gl,u=this.program,f=this.uniforms,o,c,d,v=n.getProgramParameter(u.webGLProgram,n.ACTIVE_UNIFORMS);for(o=0;o0&&(c=c.substr(0,S),f.hasOwnProperty(c)||(d=this.renderer.createUniformLocation(u,c),d!==null&&(f[c]={name:c,location:d,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var n=this.gl;this.renderer.setProgram(this.program);for(var u in this.uniforms){var f=this.uniforms[u];f.setter&&f.setter.call(n,f.location.webGLUniformLocation,f.value1,f.value2,f.value3,f.value4)}},hasUniform:function(n){return this.uniforms.hasOwnProperty(n)},resetUniform:function(n){var u=this.uniforms[n];return u&&(u.value1=null,u.value2=null,u.value3=null,u.value4=null),this},setUniform1:function(n,u,f,o){var c=this.uniforms[u];return c?((o||c.value1!==f)&&(c.setter||(c.setter=n),c.value1=f,this.renderer.setProgram(this.program),n.call(this.gl,c.location.webGLUniformLocation,f),this.pipeline.currentShader=this),this):this},setUniform2:function(n,u,f,o,c){var d=this.uniforms[u];return d?((c||d.value1!==f||d.value2!==o)&&(d.setter||(d.setter=n),d.value1=f,d.value2=o,this.renderer.setProgram(this.program),n.call(this.gl,d.location.webGLUniformLocation,f,o),this.pipeline.currentShader=this),this):this},setUniform3:function(n,u,f,o,c,d){var v=this.uniforms[u];return v?((d||v.value1!==f||v.value2!==o||v.value3!==c)&&(v.setter||(v.setter=n),v.value1=f,v.value2=o,v.value3=c,this.renderer.setProgram(this.program),n.call(this.gl,v.location.webGLUniformLocation,f,o,c),this.pipeline.currentShader=this),this):this},setUniform4:function(n,u,f,o,c,d,v){var m=this.uniforms[u];return m?((v||m.value1!==f||m.value2!==o||m.value3!==c||m.value4!==d)&&(m.setter||(m.setter=n),m.value1=f,m.value2=o,m.value3=c,m.value4=d,this.renderer.setProgram(this.program),n.call(this.gl,m.location.webGLUniformLocation,f,o,c,d),this.pipeline.currentShader=this),this):this},setBoolean:function(n,u){return this.setUniform1(this.gl.uniform1i,n,Number(u))},set1f:function(n,u){return this.setUniform1(this.gl.uniform1f,n,u)},set2f:function(n,u,f){return this.setUniform2(this.gl.uniform2f,n,u,f)},set3f:function(n,u,f,o){return this.setUniform3(this.gl.uniform3f,n,u,f,o)},set4f:function(n,u,f,o,c){return this.setUniform4(this.gl.uniform4f,n,u,f,o,c)},set1fv:function(n,u){return this.setUniform1(this.gl.uniform1fv,n,u,!0)},set2fv:function(n,u){return this.setUniform1(this.gl.uniform2fv,n,u,!0)},set3fv:function(n,u){return this.setUniform1(this.gl.uniform3fv,n,u,!0)},set4fv:function(n,u){return this.setUniform1(this.gl.uniform4fv,n,u,!0)},set1iv:function(n,u){return this.setUniform1(this.gl.uniform1iv,n,u,!0)},set2iv:function(n,u){return this.setUniform1(this.gl.uniform2iv,n,u,!0)},set3iv:function(n,u){return this.setUniform1(this.gl.uniform3iv,n,u,!0)},set4iv:function(n,u){return this.setUniform1(this.gl.uniform4iv,n,u,!0)},set1i:function(n,u){return this.setUniform1(this.gl.uniform1i,n,u)},set2i:function(n,u,f){return this.setUniform2(this.gl.uniform2i,n,u,f)},set3i:function(n,u,f,o){return this.setUniform3(this.gl.uniform3i,n,u,f,o)},set4i:function(n,u,f,o,c){return this.setUniform4(this.gl.uniform4i,n,u,f,o,c)},setMatrix2fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix2fv,n,u,f,!0)},setMatrix3fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix3fv,n,u,f,!0)},setMatrix4fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix4fv,n,u,f,!0)},createProgram:function(n,u){return n===void 0&&(n=this.vertSrc),u===void 0&&(u=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=n,this.fragSrc=u,this.program=this.renderer.createProgram(n,u),this.createUniforms(),this.rebind()},destroy:function(){var n=this.renderer;p(this.uniforms,function(u){n.deleteUniformLocation(u.location)}),this.uniforms=null,p(this.attributes,function(u){n.deleteAttribLocation(u.location)}),this.attributes=null,n.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});s.exports=l},14500:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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}};s.exports=y},4159:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14500),p=e(79291),h={PipelineManager:e(7530),Pipelines:e(96615),RenderTarget:e(32302),Utils:e(70554),WebGLPipeline:e(29100),WebGLRenderer:e(74797),WebGLShader:e(38683),Wrappers:e(9503)};h=p(!1,h,r),s.exports=h},31302:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(78908),a=e(85191),l=e(14500),n=e(29100),u=new r({Extends:n,initialize:function(o){o.fragShader=p(o,"fragShader",h),o.vertShader=p(o,"vertShader",a),o.batchSize=p(o,"batchSize",1),o.vertices=p(o,"vertices",[-1,1,-1,-7,7,1]),o.attributes=p(o,"attributes",[{name:"inPosition",size:2,type:l.FLOAT}]),n.call(this,o)},boot:function(){n.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(f,o){n.prototype.resize.call(this,f,o),this.set2f("uResolution",f,o)},beginMask:function(f,o,c){this.renderer.beginBitmapMask(f,c)},endMask:function(f,o,c){var d=this.gl,v=this.renderer,m=f.bitmapMask;m&&d&&(v.drawBitmapMask(m,o,this),c&&this.set2f("uResolution",c.width,c.height),this.set1i("uInvertMaskAlpha",f.invertAlpha),d.drawArrays(this.topology,0,3),c&&this.set2f("uResolution",this.width,this.height),d.bindTexture(d.TEXTURE_2D,null))}});s.exports=u},92651:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(58918),h=e(14811),a=e(95540),l=e(43558),n=e(89350),u=e(70554),f=new r({Extends:l,initialize:function(c){c.shaders=[u.setGlowQuality(n.FXGlowFrag,c.game),n.FXShadowFrag,n.FXPixelateFrag,n.FXVignetteFrag,n.FXShineFrag,n.FXBlurLowFrag,n.FXBlurMedFrag,n.FXBlurHighFrag,n.FXGradientFrag,n.FXBloomFrag,n.ColorMatrixFrag,n.FXCircleFrag,n.FXBarrelFrag,n.FXDisplacementFrag,n.FXWipeFrag,n.FXBokehFrag],l.call(this,c);var d=this.game;this.glow=new p.Glow(d),this.shadow=new p.Shadow(d),this.pixelate=new p.Pixelate(d),this.vignette=new p.Vignette(d),this.shine=new p.Shine(d),this.gradient=new p.Gradient(d),this.circle=new p.Circle(d),this.barrel=new p.Barrel(d),this.wipe=new p.Wipe(d),this.bokeh=new p.Bokeh(d);var v=[];v[h.GLOW]=this.onGlow,v[h.SHADOW]=this.onShadow,v[h.PIXELATE]=this.onPixelate,v[h.VIGNETTE]=this.onVignette,v[h.SHINE]=this.onShine,v[h.BLUR]=this.onBlur,v[h.GRADIENT]=this.onGradient,v[h.BLOOM]=this.onBloom,v[h.COLOR_MATRIX]=this.onColorMatrix,v[h.CIRCLE]=this.onCircle,v[h.BARREL]=this.onBarrel,v[h.DISPLACEMENT]=this.onDisplacement,v[h.WIPE]=this.onWipe,v[h.BOKEH]=this.onBokeh,this.fxHandlers=v,this.source,this.target,this.swap},onDraw:function(o,c,d){this.source=o,this.target=c,this.swap=d;var v=o.width,m=o.height,S=this.tempSprite,M=this.fxHandlers;if(S&&S.preFX)for(var w=S.preFX.list,C=0;C{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(31063),a=e(57516),l=e(61340),n=e(26099),u=e(29100),f=new r({Extends:a,initialize:function(c){var d=p(c,"fragShader",h);c.fragShader=d.replace("%LIGHT_COUNT%",c.game.renderer.config.maxLights),a.call(this,c),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new n,this._tempMatrix=new l,this._tempMatrix2=new l},boot:function(){u.prototype.boot.call(this)},onRender:function(o,c){var d=o.sys.lights;if(this.lightsActive=!1,!(!d||!d.active)){var v=d.getLights(c),m=v.length;this.lightsActive=!0;var S,M=this.renderer,w=M.height,C=c.matrix,A=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",c.x,c.y,c.rotation,c.zoom),this.set3f("uAmbientLightColor",d.ambientColor.r,d.ambientColor.g,d.ambientColor.b),this.set1i("uLightCount",m),S=0;S0&&this.flush();var c=this.inverseRotationMatrix;if(o){var d=-o,v=Math.cos(d),m=Math.sin(d);c[1]=m,c[3]=-m,c[0]=c[4]=v}else c[0]=c[4]=1,c[1]=c[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,c),this.currentNormalMapRotation=o}},setTexture2D:function(o,c){var d=this.renderer;o===void 0&&(o=d.whiteTexture);var v=this.getNormalMap(c);this.isNewNormalMap(o,v)&&(this.flush(),this.createBatch(o),this.addTextureToBatch(v),this.currentNormalMap=v);var m=0;if(c&&c.parentContainer){var S=c.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);m=S.rotationNormalized}else c&&(m=c.rotation);return this.setNormalMapRotation(m),0},setGameObject:function(o,c){c===void 0&&(c=o.frame);var d=c.glTexture,v=this.getNormalMap(o);if(this.isNewNormalMap(d,v)&&(this.flush(),this.createBatch(d),this.addTextureToBatch(v),this.currentNormalMap=v),o.parentContainer){var m=o.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(m.rotationNormalized)}else this.setNormalMapRotation(o.rotation);return 0},isNewNormalMap:function(o,c){return this.currentTexture!==o||this.currentNormalMap!==c},getNormalMap:function(o){var c;if(o)o.displayTexture?c=o.displayTexture.dataSource[o.displayFrame.sourceIndex]:o.texture?c=o.texture.dataSource[o.frame.sourceIndex]:o.tileset&&(Array.isArray(o.tileset)?c=o.tileset[0].image.dataSource[0]:c=o.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return c?c.glTexture:this.renderer.normalTexture},batchSprite:function(o,c,d){this.lightsActive&&a.prototype.batchSprite.call(this,o,c,d)},batchTexture:function(o,c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,j,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt){this.lightsActive&&a.prototype.batchTexture.call(this,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,j,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt)},batchTextureFrame:function(o,c,d,v,m,S,M){this.lightsActive&&a.prototype.batchTextureFrame.call(this,o,c,d,v,m,S,M)}});s.exports=f},56527:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=e(45561),l=e(60722),n=e(14500),u=e(29100),f=new r({Extends:h,initialize:function(c){c.fragShader=p(c,"fragShader",a),c.vertShader=p(c,"vertShader",l),c.attributes=p(c,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:n.UNSIGNED_BYTE,normalized:!0}]),c.forceZero=!0,c.resizeUniform="uResolution",h.call(this,c)},boot:function(){u.prototype.boot.call(this);var o=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",o.width,o.height),this.set1i("uRoundPixels",o.config.roundPixels)}});s.exports=f},57516:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94811),h=e(95540),a=e(98840),l=e(44667),n=e(61340),u=e(70554),f=e(14500),o=e(29100),c=new r({Extends:o,initialize:function(v){var m=v.game.renderer,S=h(v,"fragShader",a);v.fragShader=u.parseFragmentShaderMaxTextures(S,m.maxTextures),v.vertShader=h(v,"vertShader",l),v.attributes=h(v,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]),v.resizeUniform="uResolution",o.call(this,v),this._tempMatrix1=new n,this._tempMatrix2=new n,this._tempMatrix3=new n,this.calcMatrix=new n,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(){o.prototype.boot.call(this);var d=this.renderer;this.set1iv("uMainSampler",d.textureIndexes),this.set2f("uResolution",d.width,d.height),this.set1i("uRoundPixels",d.config.roundPixels)},batchSprite:function(d,v,m){this.manager.set(this,d);var S=this._tempMatrix1,M=this._tempMatrix2,w=this._tempMatrix3,C=d.frame,A=C.glTexture,P=C.u0,b=C.v0,O=C.u1,I=C.v1,D=C.x,B=C.y,G=C.cutWidth,z=C.cutHeight,X=C.customPivot,j=d.displayOriginX,Q=d.displayOriginY,tt=-j+D,Y=-Q+B;if(d.isCropped){var Z=d._crop;(Z.flipX!==d.flipX||Z.flipY!==d.flipY)&&C.updateCropUVs(Z,d.flipX,d.flipY),P=Z.u0,b=Z.v0,O=Z.u1,I=Z.v1,G=Z.width,z=Z.height,D=Z.x,B=Z.y,tt=-j+D,Y=-Q+B}var U=1,H=1;d.flipX&&(X||(tt+=-C.realWidth+j*2),U=-1),d.flipY&&(X||(Y+=-C.realHeight+Q*2),H=-1);var J=d.x,_=d.y;M.applyITRS(J,_,d.rotation,d.scaleX*U,d.scaleY*H),S.copyFrom(v.matrix),m?(S.multiplyWithOffset(m,-v.scrollX*d.scrollFactorX,-v.scrollY*d.scrollFactorY),M.e=J,M.f=_):(M.e-=v.scrollX*d.scrollFactorX,M.f-=v.scrollY*d.scrollFactorY),S.multiply(M,w);var q=w.setQuad(tt,Y,tt+G,Y+z),at=u.getTintAppendFloatAlpha,ot=v.alpha,rt=at(d.tintTopLeft,ot*d._alphaTL),gt=at(d.tintTopRight,ot*d._alphaTR),yt=at(d.tintBottomLeft,ot*d._alphaBL),Et=at(d.tintBottomRight,ot*d._alphaBR);this.shouldFlush(6)&&this.flush();var At=this.setGameObject(d,C);this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",v.roundPixels),this.batchQuad(d,q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],P,b,O,I,rt,gt,yt,Et,d.tintFill,A,At),this.manager.postBatch(d)},batchTexture:function(d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,j,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt,gt,yt,Et){Et===void 0&&(Et=!1),this.manager.set(this,d);var At=this._tempMatrix1,Pt=this._tempMatrix2,Vt=this._tempMatrix3,dt=j/m+q,ut=Q/S+at,Rt=(j+tt)/m+q,Dt=(Q+Y)/S+at,Ht=C,Bt=A,re=-z,le=-X;if(d.isCropped){var ge=d._crop,xe=ge.width,Pe=ge.height;Ht=xe,Bt=Pe,C=xe,A=Pe,j=ge.x,Q=ge.y;var te=j,Ge=Q;I&&(te=tt-ge.x-xe),D&&(Ge=Y-ge.y-Pe),dt=te/m+q,ut=Ge/S+at,Rt=(te+xe)/m+q,Dt=(Ge+Pe)/S+at,re=-z+j,le=-X+Q}D=D^(!gt&&v.isRenderTexture?1:0),I&&(Ht*=-1,re+=C),D&&(Bt*=-1,le+=A),Pt.applyITRS(M,w,O,P,b),At.copyFrom(ot.matrix),rt?(At.multiplyWithOffset(rt,-ot.scrollX*B,-ot.scrollY*G),Pt.e=M,Pt.f=w):(Pt.e-=ot.scrollX*B,Pt.f-=ot.scrollY*G),At.multiply(Pt,Vt);var Oe=Vt.setQuad(re,le,re+Ht,le+Bt);yt==null&&(yt=this.setTexture2D(v)),d&&!Et&&this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",ot.roundPixels),this.batchQuad(d,Oe[0],Oe[1],Oe[2],Oe[3],Oe[4],Oe[5],Oe[6],Oe[7],dt,ut,Rt,Dt,Z,U,H,J,_,v,yt),d&&!Et&&this.manager.postBatch(d)},batchTextureFrame:function(d,v,m,S,M,w,C){this.manager.set(this);var A=this._tempMatrix1.copyFrom(w),P=this._tempMatrix2;C?A.multiply(C,P):P=A;var b=P.setQuad(v,m,v+d.width,m+d.height),O=this.setTexture2D(d.source.glTexture);S=u.getTintAppendFloatAlpha(S,M),this.batchQuad(null,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],d.u0,d.v0,d.u1,d.v1,S,S,S,S,0,d.glTexture,O)},batchFillRect:function(d,v,m,S,M,w){this.renderer.pipelines.set(this);var C=this.calcMatrix;w&&w.multiply(M,C);var A=C.setQuad(d,v,d+m,v+S),P=this.fillTint;this.batchQuad(null,A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],0,0,1,1,P.TL,P.TR,P.BL,P.BR,2)},batchFillTriangle:function(d,v,m,S,M,w,C,A){this.renderer.pipelines.set(this);var P=this.calcMatrix;A&&A.multiply(C,P);var b=P.getX(d,v),O=P.getY(d,v),I=P.getX(m,S),D=P.getY(m,S),B=P.getX(M,w),G=P.getY(M,w),z=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,b,O,I,D,B,G,0,0,1,1,z.TL,z.TR,z.BL,2)},batchStrokeTriangle:function(d,v,m,S,M,w,C,A,P){var b=this.tempTriangle;b[0].x=d,b[0].y=v,b[0].width=C,b[1].x=m,b[1].y=S,b[1].width=C,b[2].x=M,b[2].y=w,b[2].width=C,b[3].x=d,b[3].y=v,b[3].width=C,this.batchStrokePath(b,C,!1,A,P)},batchFillPath:function(d,v,m){this.renderer.pipelines.set(this);var S=this.calcMatrix;m&&m.multiply(v,S);for(var M=d.length,w=this.polygonCache,C,A,P=this.fillTint.TL,b=this.fillTint.TR,O=this.fillTint.BL,I=0;I0&&Ht[4]?this.batchQuad(null,At,Pt,rt,gt,Ht[0],Ht[1],Ht[2],Ht[3],0,0,1,1,dt,ut,Rt,Dt,2):(Bt[0]=At,Bt[1]=Pt,Bt[2]=rt,Bt[3]=gt,Bt[4]=1),P&&Bt[4]?this.batchQuad(null,at,ot,yt,Et,Bt[0],Bt[1],Bt[2],Bt[3],0,0,1,1,dt,ut,Rt,Dt,2):(Ht[0]=at,Ht[1]=ot,Ht[2]=yt,Ht[3]=Et,Ht[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,o.prototype.destroy.call(this),this}});s.exports=c},43439:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(4127),a=e(89924),l=e(29100),n=new r({Extends:l,initialize:function(f){f.vertShader=p(f,"vertShader",a),f.fragShader=p(f,"fragShader",h),f.attributes=p(f,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),l.call(this,f)},onRender:function(u,f){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",f.zoom)},batchPointLight:function(u,f,o,c,d,v,m,S,M,w,C,A){var P=u.color,b=u.intensity,O=u.radius,I=u.attenuation,D=P.r*b,B=P.g*b,G=P.b*b,z=f.alpha*u.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(o,c,C,A,O,I,D,B,G,z),this.batchLightVert(d,v,C,A,O,I,D,B,G,z),this.batchLightVert(m,S,C,A,O,I,D,B,G,z),this.batchLightVert(o,c,C,A,O,I,D,B,G,z),this.batchLightVert(m,S,C,A,O,I,D,B,G,z),this.batchLightVert(M,w,C,A,O,I,D,B,G,z),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(u,f,o,c,d,v,m,S,M,w){var C=this.vertexViewF32,A=this.vertexCount*this.currentShader.vertexComponentCount-1;C[++A]=u,C[++A]=f,C[++A]=o,C[++A]=c,C[++A]=d,C[++A]=v,C[++A]=m,C[++A]=S,C[++A]=M,C[++A]=w,this.vertexCount++}});s.exports=n},84057:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89422),h=e(95540),a=e(27681),l=e(49627),n=e(29100),u=new r({Extends:n,initialize:function(o){o.renderTarget=h(o,"renderTarget",1),o.fragShader=h(o,"fragShader",a),o.vertShader=h(o,"vertShader",l),o.attributes=h(o,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),o.batchSize=1,o.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],n.call(this,o),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new p,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){n.prototype.boot.call(this);var f=this.manager.UTILITY_PIPELINE;this.fullFrame1=f.fullFrame1,this.fullFrame2=f.fullFrame2,this.halfFrame1=f.halfFrame1,this.halfFrame2=f.halfFrame2;var o=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",o.width,o.height),this.set1i("uRoundPixels",o.config.roundPixels);for(var c=this.renderTargets,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(67502),h=e(83419),a=e(96293),l=e(95540),n=e(57516),u=e(27681),f=e(87841),o=e(32302),c=e(45561),d=e(60722),v=e(29100),m=new h({Extends:n,initialize:function(M){var w=l(M,"fragShader",u),C=l(M,"vertShader",d),A=l(M,"drawShader",u),P=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:w,vertShader:C},{name:"DrawGame",fragShader:A,vertShader:d},{name:"ColorMatrix",fragShader:a}],b=l(M,"shaders",[]);M.shaders=P.concat(b),M.vertShader||(M.vertShader=C),M.batchSize=1,n.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 f,this.targetBounds=new f,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var S=this.shaders,M=this.renderer;this.drawSpriteShader=S[0],this.copyShader=S[1],this.gameShader=S[2],this.colorMatrixShader=S[3],this.fsTarget=new o(M,M.width,M.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var w=new ArrayBuffer(168);this.quadVertexData=w,this.quadVertexViewF32=new Float32Array(w),this.quadVertexBuffer=M.createVertexBuffer(w,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(S,M){var w=this.quadVertexViewF32;w[1]=M,w[22]=M,w[14]=S,w[28]=S,w[35]=S,w[36]=M},batchQuad:function(S,M,w,C,A,P,b,O,I,D,B,G,z,X,j,Q,tt,Y,Z){var U=Math.min(M,C,P,O),H=Math.min(w,A,b,I),J=Math.max(M,C,P,O),_=Math.max(w,A,b,I),q=J-U,at=_-H,ot=this.spriteBounds.setTo(U,H,q,at),rt=S?S.preFX.padding:0,gt=q+rt*2,yt=at+rt*2,Et=Math.abs(Math.max(gt,yt)),At=this.manager.getRenderTarget(Et),Pt=this.targetBounds.setTo(0,0,At.width,At.height);p(Pt,ot.centerX,ot.centerY),this.tempSprite=S;var Vt=this.gl,dt=this.renderer;dt.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",dt.width,dt.height),this.set1i("uRoundPixels",dt.config.roundPixels),this.flipProjectionMatrix(!0),S&&(this.onDrawSprite(S,At),S.preFX.onFX(this));var ut=this.fsTarget;return this.flush(),Vt.viewport(0,0,dt.width,dt.height),Vt.bindFramebuffer(Vt.FRAMEBUFFER,ut.framebuffer.webGLFramebuffer),Vt.framebufferTexture2D(Vt.FRAMEBUFFER,Vt.COLOR_ATTACHMENT0,Vt.TEXTURE_2D,ut.texture.webGLTexture,0),Vt.clearColor(0,0,0,0),Vt.clear(Vt.COLOR_BUFFER_BIT),this.setTexture2D(Z),this.batchVert(M,w,D,B,0,Y,X),this.batchVert(C,A,D,z,0,Y,Q),this.batchVert(P,b,G,z,0,Y,tt),this.batchVert(M,w,D,B,0,Y,X),this.batchVert(P,b,G,z,0,Y,tt),this.batchVert(O,I,G,B,0,Y,j),this.flush(),this.flipProjectionMatrix(!1),Vt.activeTexture(Vt.TEXTURE0),Vt.bindTexture(Vt.TEXTURE_2D,At.texture.webGLTexture),Vt.copyTexSubImage2D(Vt.TEXTURE_2D,0,0,0,Pt.x,Pt.y,Pt.width,Pt.height),Vt.bindFramebuffer(Vt.FRAMEBUFFER,null),Vt.bindTexture(Vt.TEXTURE_2D,null),this.onBatch(S),this.currentShader=this.copyShader,this.onDraw(At,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(S,M,w,C,A,P,b){w===void 0&&(w=!0),C===void 0&&(C=!0),A===void 0&&(A=!1),b===void 0&&(b=this.copyShader);var O=this.gl,I=this.tempSprite;P&&(b=this.colorMatrixShader),this.currentShader=b;var D=this.setVertexBuffer(this.quadVertexBuffer);b.bind(D,!1);var B=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",B.width,B.height),this.set1i("uRoundPixels",B.config.roundPixels),I.preFX.onFXCopy(this),this.onCopySprite(S,M,I),P&&(this.set1fv("uColorMatrix",P.getData()),this.set1f("uAlpha",P.alpha)),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,S.texture.webGLTexture),S.height>M.height)O.viewport(0,0,S.width,S.height),this.setTargetUVs(S,M);else{var G=M.height-S.height;O.viewport(0,G,S.width,S.height),this.resetUVs()}if(O.bindFramebuffer(O.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,M.texture.webGLTexture,0),w&&(O.clearColor(0,0,0,+!C),O.clear(O.COLOR_BUFFER_BIT)),A){var z=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}O.bufferData(O.ARRAY_BUFFER,this.quadVertexData,O.STATIC_DRAW),O.drawArrays(O.TRIANGLES,0,6),A&&this.renderer.setBlendMode(z),O.bindFramebuffer(O.FRAMEBUFFER,null)},copy:function(S,M){var w=this.gl;this.set1i("uMainSampler",0),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,S.texture.webGLTexture),w.viewport(0,0,S.width,S.height),this.setUVs(0,0,0,1,1,1,1,0),w.bindFramebuffer(w.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,M.texture.webGLTexture,0),w.clearColor(0,0,0,0),w.clear(w.COLOR_BUFFER_BIT),w.bufferData(w.ARRAY_BUFFER,this.quadVertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),w.bindFramebuffer(w.FRAMEBUFFER,null)},blendFrames:function(S,M,w,C,A){this.manager.blendFrames(S,M,w,C,A)},blendFramesAdditive:function(S,M,w,C,A){this.manager.blendFramesAdditive(S,M,w,C,A)},drawToGame:function(S){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(S)},copyToGame:function(S){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(S)},bindAndDraw:function(S){var M=this.gl,w=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(S.texture);var C=this._tempMatrix1.loadIdentity(),A=this.targetBounds.x,P=this.targetBounds.y,b=A+S.width,O=P+S.height,I=C.getX(A,P),D=C.getX(A,O),B=C.getX(b,O),G=C.getX(b,P),z=C.getY(A,P),X=C.getY(A,O),j=C.getY(b,O),Q=C.getY(b,P),tt=16777215;this.batchVert(I,z,0,0,0,0,tt),this.batchVert(D,X,0,1,0,0,tt),this.batchVert(B,j,1,1,0,0,tt),this.batchVert(I,z,0,0,0,0,tt),this.batchVert(B,j,1,1,0,0,tt),this.batchVert(G,Q,1,0,0,0,tt),w.restoreFramebuffer(!1,!0),w.currentFramebuffer||M.viewport(0,0,w.width,w.height),w.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(S){this.drawToGame(S)},setUVs:function(S,M,w,C,A,P,b,O){var I=this.quadVertexViewF32;I[2]=S,I[3]=M,I[9]=w,I[10]=C,I[16]=A,I[17]=P,I[23]=S,I[24]=M,I[30]=A,I[31]=P,I[37]=b,I[38]=O},setTargetUVs:function(S,M){var w=M.height/S.height;w>.5?w=.5-(w-.5):w=.5+(.5-w),this.setUVs(0,w,0,1+w,1,1+w,1,w)},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,n.prototype.destroy.call(this),this}});s.exports=m},81041:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=new r({Extends:h,initialize:function(n){n.topology=5,n.batchSize=p(n,"batchSize",256),h.call(this,n)}});s.exports=a},12385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=e(45561),l=e(60722),n=e(29100),u=new r({Extends:h,initialize:function(o){o.fragShader=p(o,"fragShader",a),o.vertShader=p(o,"vertShader",l),o.forceZero=!0,h.call(this,o)},boot:function(){n.prototype.boot.call(this);var f=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)}});s.exports=u},7589:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35407),p=e(10312),h=e(83419),a=e(89422),l=e(96293),n=e(36682),u=e(95540),f=e(48247),o=e(49627),c=e(29100),d=new h({Extends:c,initialize:function(m){m.renderTarget=u(m,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),m.vertShader=u(m,"vertShader",o),m.shaders=u(m,"shaders",[{name:"Copy",fragShader:n},{name:"AddBlend",fragShader:r},{name:"LinearBlend",fragShader:f},{name:"ColorMatrix",fragShader:l}]),m.attributes=u(m,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),m.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],m.batchSize=1,c.call(this,m),this.colorMatrix=new a,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){c.prototype.boot.call(this);var v=this.shaders,m=this.renderTargets;this.copyShader=v[0],this.addShader=v[1],this.linearShader=v[2],this.colorMatrixShader=v[3],this.fullFrame1=m[0],this.fullFrame2=m[1],this.halfFrame1=m[2],this.halfFrame2=m[3]},copyFrame:function(v,m,S,M,w){S===void 0&&(S=1),M===void 0&&(M=!0),w===void 0&&(w=!0);var C=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,v.texture.webGLTexture),m?(C.viewport(0,0,m.width,m.height),C.bindFramebuffer(C.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,m.texture.webGLTexture,0)):C.viewport(0,0,v.width,v.height),M&&(w?C.clearColor(0,0,0,0):C.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT)),C.bufferData(C.ARRAY_BUFFER,this.vertexData,C.STATIC_DRAW),C.drawArrays(C.TRIANGLES,0,6),C.bindFramebuffer(C.FRAMEBUFFER,null),C.bindTexture(C.TEXTURE_2D,null)},blitFrame:function(v,m,S,M,w,C,A){S===void 0&&(S=1),M===void 0&&(M=!0),w===void 0&&(w=!0),C===void 0&&(C=!1),A===void 0&&(A=!1);var P=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),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 b=m.height-v.height;P.viewport(0,b,v.width,v.height)}if(P.bindFramebuffer(P.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,m.texture.webGLTexture,0),M&&(w?P.clearColor(0,0,0,0):P.clearColor(0,0,0,1),P.clear(P.COLOR_BUFFER_BIT)),C){var O=this.renderer.currentBlendMode;this.renderer.setBlendMode(p.ERASE)}A&&this.flipY(),P.bufferData(P.ARRAY_BUFFER,this.vertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),C&&this.renderer.setBlendMode(O),P.bindFramebuffer(P.FRAMEBUFFER,null),P.bindTexture(P.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(v,m,S,M,w,C,A,P){A===void 0&&(A=!0),P===void 0&&(P=!0);var b=this.gl;b.bindFramebuffer(b.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,v.texture.webGLTexture,0),A&&(P?b.clearColor(0,0,0,0):b.clearColor(0,0,0,1),b.clear(b.COLOR_BUFFER_BIT)),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,m.texture.webGLTexture),b.copyTexSubImage2D(b.TEXTURE_2D,0,0,0,S,M,w,C),b.bindFramebuffer(b.FRAMEBUFFER,null),b.bindTexture(b.TEXTURE_2D,null)},copyToGame:function(v){var m=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,v.texture.webGLTexture),m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.STATIC_DRAW),m.drawArrays(m.TRIANGLES,0,6)},drawFrame:function(v,m,S,M){S===void 0&&(S=!0),M===void 0&&(M=this.colorMatrix);var w=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",M.getData()),this.set1f("uAlpha",M.alpha),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,v.texture.webGLTexture),m?(w.viewport(0,0,m.width,m.height),w.bindFramebuffer(w.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,m.texture.webGLTexture,0)):w.viewport(0,0,v.width,v.height),S?w.clearColor(0,0,0,0):w.clearColor(0,0,0,1),w.clear(w.COLOR_BUFFER_BIT),w.bufferData(w.ARRAY_BUFFER,this.vertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),w.bindFramebuffer(w.FRAMEBUFFER,null),w.bindTexture(w.TEXTURE_2D,null)},blendFrames:function(v,m,S,M,w,C){M===void 0&&(M=1),w===void 0&&(w=!0),C===void 0&&(C=this.linearShader);var A=this.gl;this.setShader(C),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",M),A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,v.texture.webGLTexture),A.activeTexture(A.TEXTURE1),A.bindTexture(A.TEXTURE_2D,m.texture.webGLTexture),S?(A.bindFramebuffer(A.FRAMEBUFFER,S.framebuffer.webGLFramebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,S.texture.webGLTexture,0),A.viewport(0,0,S.width,S.height)):A.viewport(0,0,v.width,v.height),w?A.clearColor(0,0,0,0):A.clearColor(0,0,0,1),A.clear(A.COLOR_BUFFER_BIT),A.bufferData(A.ARRAY_BUFFER,this.vertexData,A.STATIC_DRAW),A.drawArrays(A.TRIANGLES,0,6),A.bindFramebuffer(A.FRAMEBUFFER,null),A.bindTexture(A.TEXTURE_2D,null)},blendFramesAdditive:function(v,m,S,M,w){this.blendFrames(v,m,S,M,w,this.addShader)},clearFrame:function(v,m){m===void 0&&(m=!0);var S=this.gl;S.viewport(0,0,v.width,v.height),S.bindFramebuffer(S.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),m?S.clearColor(0,0,0,0):S.clearColor(0,0,0,1),S.clear(S.COLOR_BUFFER_BIT);var M=this.renderer.currentFramebuffer;S.bindFramebuffer(S.FRAMEBUFFER,M.webGLFramebuffer)},setUVs:function(v,m,S,M,w,C,A,P){var b=this.vertexViewF32;b[2]=v,b[3]=m,b[6]=S,b[7]=M,b[10]=w,b[11]=C,b[14]=v,b[15]=m,b[18]=w,b[19]=C,b[22]=A,b[23]=P},setTargetUVs:function(v,m){var S=m.height/v.height;S>.5?S=.5-(S-.5):S=.5+(.5-S),this.setUVs(0,S,0,1+S,1,1+S,1,S)},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)}});s.exports=d},36060:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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"};s.exports=y},84817:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineafterflush"},36712:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinebeforeflush"},40285:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinebind"},65918:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineboot"},92852:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinedestroy"},56072:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinerebind"},57566:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineresize"},77085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AFTER_FLUSH:e(84817),BEFORE_FLUSH:e(36712),BIND:e(40285),BOOT:e(65918),DESTROY:e(92852),REBIND:e(56072),RESIZE:e(57566)}},54812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(99155),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n){l=this.getController(l),this.set1f("amount",l.amount,n)}});s.exports=a},67329:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(24400),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(l){l=this.getController(l),this.set1f("strength",l.blurStrength),this.set3fv("color",l.glcolor)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1,f=this.fullFrame2;this.copyFrame(l,f);for(var o=2/l.width*n.offsetX,c=2/l.height*n.offsetY,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(41514),h=e(51078),a=e(94328),l=e(84057),n=new r({Extends:l,initialize:function(f){l.call(this,{game:f,shaders:[{name:"Gaussian5",fragShader:p},{name:"Gaussian9",fragShader:h},{name:"Gaussian13",fragShader:a}]}),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(u){var f=this.getController(),o=this.gl,c=this.fullFrame1,d=o.getParameter(o.FRAMEBUFFER_BINDING);this.bind(this.shaders[f.quality]),o.activeTexture(o.TEXTURE0),o.viewport(0,0,u.width,u.height),this.set1i("uMainSampler",0),this.set2f("resolution",u.width,u.height),this.set1f("strength",f.strength),this.set3fv("color",f.glcolor);for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(90610),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("amount",l.amount,n),this.set1f("contrast",l.contrast,n),this.set1f("strength",l.strength,n),this.set2f("blur",l.blurX,l.blurY,n),this.setBoolean("isTiltShift",l.isTiltShift,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},89428:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91899),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("scale",l.scale,n),this.set1f("feather",l.feather,n),this.set1f("thickness",l.thickness,n),this.set3fv("color",l.glcolor,n),this.set4fv("backgroundColor",l.glcolor2,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},88904:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(84057),h=new r({Extends:p,initialize:function(l){p.call(this,{game:l})},onDraw:function(a){var l=this.fullFrame1;this.controller?this.manager.drawFrame(a,l,!0,this.controller):this.drawFrame(a,l),this.copyToGame(l)}});s.exports=h},63563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(47838),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(l){var n=this.game.textures.getFrame(l);n&&(this.glTexture=n.glTexture)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",n.x,n.y),this.bindTexture(n.glTexture,1),this.copySprite(l,u),this.copyToGame(u)}});s.exports=a},94045:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(98656),a=e(84057),l=e(70554),n=new r({Extends:a,initialize:function(f,o){var c=p(o,"quality",.1),d=p(o,"distance",10);a.call(this,{game:f,fragShader:l.setGlowQuality(h,f,c,d)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(u,f,o,c){u=this.getController(u),this.set1f("outerStrength",u.outerStrength,f),this.set1f("innerStrength",u.innerStrength,f),this.set4fv("glowColor",u.glcolor,f),this.setBoolean("knockout",u.knockout,f),o&&c&&this.set2f("resolution",o,c,f)},onDraw:function(u){this.set2f("resolution",u.width,u.height),this.bindAndDraw(u)}});s.exports=n},74088:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(70463),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),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(l,n){l=this.getController(l),this.set1f("alpha",l.alpha,n),this.set1i("size",l.size,n),this.set3fv("color1",l.glcolor1,n),this.set3fv("color2",l.glcolor2,n),this.set2f("positionFrom",l.fromX,l.fromY,n),this.set2f("positionTo",l.toX,l.toY,n)}});s.exports=a},99636:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50831),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("amount",l.amount,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},34700:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92595),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),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(l,n){l=this.getController(l);var u=l.samples;this.set1i("samples",u,n),this.set1f("intensity",l.intensity,n),this.set1f("decay",l.decay,n),this.set1f("power",l.power/u,n),this.set2f("lightPosition",l.x,l.y,n),this.set4fv("color",l.glcolor,n)}});s.exports=a},91157:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72464),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(l,n,u,f){l=this.getController(l),this.setTime("time",n),this.set1f("speed",l.speed,n),this.set1f("lineWidth",l.lineWidth,n),this.set1f("gradient",l.gradient,n),this.setBoolean("reveal",l.reveal,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},27797:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39249),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(l,n){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("strength",l.strength,n),this.set2f("position",l.x,l.y,n)}});s.exports=a},67603:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(2878),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(l,n){l=this.getController(l);var u=l.progress,f=l.wipeWidth,o=l.direction,c=l.axis;this.set4f("config",u,f,o,c,n),this.setBoolean("reveal",l.reveal,n)}});s.exports=a},58918:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Barrel:e(54812),Bloom:e(67329),Blur:e(8861),Bokeh:e(51051),Circle:e(89428),ColorMatrix:e(88904),Displacement:e(63563),Glow:e(94045),Gradient:e(74088),Pixelate:e(99636),Shadow:e(34700),Shine:e(91157),Vignette:e(27797),Wipe:e(67603)};s.exports=r},96615:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36060),p=e(79291),h={FX:e(58918),BitmapMaskPipeline:e(31302),Events:e(77085),FXPipeline:e(92651),LightPipeline:e(96569),MobilePipeline:e(56527),MultiPipeline:e(57516),PointLightPipeline:e(43439),PostFXPipeline:e(84057),PreFXPipeline:e(43558),RopePipeline:e(81041),SinglePipeline:e(12385),UtilityPipeline:e(7589)};h=p(!1,h,r),s.exports=h},35407:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:s=>{s.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:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AddBlendFrag:e(35407),BitmapMaskFrag:e(78908),BitmapMaskVert:e(85191),ColorMatrixFrag:e(96293),CopyFrag:e(36682),FXBarrelFrag:e(99155),FXBloomFrag:e(24400),FXBlurHighFrag:e(94328),FXBlurLowFrag:e(41514),FXBlurMedFrag:e(51078),FXBokehFrag:e(90610),FXCircleFrag:e(91899),FXDisplacementFrag:e(47838),FXGlowFrag:e(98656),FXGradientFrag:e(70463),FXPixelateFrag:e(50831),FXShadowFrag:e(92595),FXShineFrag:e(72464),FXVignetteFrag:e(39249),FXWipeFrag:e(2878),LightFrag:e(31063),LinearBlendFrag:e(48247),MeshFrag:e(41214),MeshVert:e(39653),MobileFrag:e(62143),MobileVert:e(47940),MultiFrag:e(98840),MultiVert:e(44667),PointLightFrag:e(4127),PointLightVert:e(89924),PostFXFrag:e(27681),QuadVert:e(49627),SingleFrag:e(45561),SingleVert:e(60722)}},93567:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLAttribLocation=-1,this.gl=a,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLAttribLocation=-1;return}var h=this.gl;h.isContextLost()||(this.webGLAttribLocation=h.getAttribLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});s.exports=p},26128:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){this.webGLBuffer=null,this.gl=a,this.initialDataOrSize=l,this.bufferType=n,this.bufferUsage=u,this.createResource()},createResource:function(){if(this.initialDataOrSize!==null){var h=this.gl;if(!h.isContextLost()){var a=this.bufferType,l=h.createBuffer();this.webGLBuffer=l,h.bindBuffer(a,this.webGLBuffer),h.bufferData(a,this.initialDataOrSize,this.bufferUsage),h.bindBuffer(a,null)}}},destroy:function(){var h=this.gl;h.isContextLost()||h.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});s.exports=p},84387:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},h=new r({initialize:function(l,n,u,f,o){this.webGLFramebuffer=null,this.gl=l,this.width=n,this.height=u,this.renderTexture=f,this.addDepthStencilBuffer=!!o,this.createResource()},createResource:function(){var a=this.gl;if(!a.isContextLost()){var l=this.renderTexture,n=0,u=a.createFramebuffer();if(this.webGLFramebuffer=u,a.bindFramebuffer(a.FRAMEBUFFER,u),l.isRenderTexture=!0,l.isAlphaPremultiplied=!1,a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,l.webGLTexture,0),n=a.checkFramebufferStatus(a.FRAMEBUFFER),n!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(p[n]||n));if(this.addDepthStencilBuffer){var f=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,f),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,this.width,this.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,f)}a.bindFramebuffer(a.FRAMEBUFFER,null)}},destroy:function(){if(this.webGLFramebuffer!==null){var a=this.gl;if(!a.isContextLost()){a.bindFramebuffer(a.FRAMEBUFFER,this.webGLFramebuffer);var l=a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);l!==null&&(a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0),a.deleteTexture(l));var n=a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);n!==null&&a.deleteRenderbuffer(n),a.bindFramebuffer(a.FRAMEBUFFER,null),a.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});s.exports=h},1482:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLProgram=null,this.gl=a,this.vertexSource=l,this.fragmentSource=n,this.createResource()},createResource:function(){var h=this.gl;if(!h.isContextLost()){var a=h.createProgram(),l=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(l,this.vertexSource),h.shaderSource(n,this.fragmentSource),h.compileShader(l),h.compileShader(n);var u=`Shader failed: +`;if(!h.getShaderParameter(l,h.COMPILE_STATUS))throw new Error("Vertex "+u+h.getShaderInfoLog(l));if(!h.getShaderParameter(n,h.COMPILE_STATUS))throw new Error("Fragment "+u+h.getShaderInfoLog(n));if(h.attachShader(a,l),h.attachShader(a,n),h.linkProgram(a),!h.getProgramParameter(a,h.LINK_STATUS))throw new Error("Link "+u+h.getProgramInfoLog(a));h.useProgram(a),this.webGLProgram=a}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});s.exports=p},82751:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50030),h=new r({initialize:function(l,n,u,f,o,c,d,v,m,S,M,w,C){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=l,this.mipLevel=n,this.minFilter=u,this.magFilter=f,this.wrapT=o,this.wrapS=c,this.format=d,this.pixels=v,this.width=m,this.height=S,this.pma=M??!0,this.forceSize=!!w,this.flipY=!!C,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var a=this.gl;if(!a.isContextLost()){if(this.pixels instanceof h){this.webGLTexture=this.pixels.webGLTexture;return}var l=a.createTexture();l.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=l,this._processTexture()}},update:function(a,l,n,u,f,o,c,d,v){if(!(l===0||n===0)){this.pixels=a,this.width=l,this.height=n,this.flipY=u,this.wrapS=f,this.wrapT=o,this.minFilter=c,this.magFilter=d,this.format=v;var m=this.gl;m.isContextLost()||this._processTexture()}},_processTexture:function(){var a=this.gl;a.activeTexture(a.TEXTURE0);var l=a.getParameter(a.TEXTURE_BINDING_2D);a.bindTexture(a.TEXTURE_2D,this.webGLTexture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.minFilter),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,this.magFilter),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,this.wrapS),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,this.wrapT),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,this.flipY);var n=this.pixels,u=this.mipLevel,f=this.width,o=this.height,c=this.format,d=!1;if(n==null)a.texImage2D(a.TEXTURE_2D,u,c,f,o,0,c,a.UNSIGNED_BYTE,null),d=p(f,o);else if(n.compressed){f=n.width,o=n.height,d=n.generateMipmap;for(var v=0;v{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLUniformLocation=null,this.gl=a,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLUniformLocation=null;return}var h=this.gl;h.isContextLost()||(this.webGLUniformLocation=h.getUniformLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});s.exports=p},9503:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={WebGLAttribLocationWrapper:e(93567),WebGLBufferWrapper:e(26128),WebGLProgramWrapper:e(1482),WebGLTextureWrapper:e(82751),WebGLFramebufferWrapper:e(84387),WebGLUniformLocationWrapper:e(57183)};s.exports=r},76531:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13560),p=e(83419),h=e(50792),a=e(97480),l=e(8443),n=e(57811),u=e(74403),f=e(45818),o=e(29747),c=e(87841),d=e(86555),v=e(56583),m=e(26099),S=e(38058),M=new p({Extends:h,initialize:function(C){h.call(this),this.game=C,this.canvas,this.canvasBounds=new c,this.parent=null,this.parentIsWindow=!1,this.parentSize=new d,this.gameSize=new d,this.baseSize=new d,this.displaySize=new d,this.scaleMode=r.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=r.CENTER.NO_CENTER,this.orientation=r.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:o,windowResize:o,fullScreenChange:o,fullScreenError:o}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(l.BOOT,this.boot,this)},boot:function(){var w=this.game;this.canvas=w.canvas,this.fullscreen=w.device.fullscreen,this.scaleMode!==r.SCALE_MODE.RESIZE&&this.scaleMode!==r.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===r.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()),w.events.on(l.PRE_STEP,this.step,this),w.events.once(l.READY,this.refresh,this),w.events.once(l.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(w){this.getParent(w),this.getParentBounds();var C=w.width,A=w.height,P=w.scaleMode,b=w.zoom,O=w.autoRound;if(typeof C=="string")if(C.substr(-1)!=="%")C=parseInt(C,10);else{var I=this.parentSize.width;I===0&&(I=window.innerWidth);var D=parseInt(C,10)/100;C=Math.floor(I*D)}if(typeof A=="string")if(A.substr(-1)!=="%")A=parseInt(A,10);else{var B=this.parentSize.height;B===0&&(B=window.innerHeight);var G=parseInt(A,10)/100;A=Math.floor(B*G)}this.scaleMode=P,this.autoRound=O,this.autoCenter=w.autoCenter,this.resizeInterval=w.resizeInterval,O&&(C=Math.floor(C),A=Math.floor(A)),this.gameSize.setSize(C,A),b===r.ZOOM.MAX_ZOOM&&(b=this.getMaxZoom()),this.zoom=b,b!==1&&(this._resetZoom=!0),this.baseSize.setSize(C,A),O&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),w.minWidth>0&&this.displaySize.setMin(w.minWidth*b,w.minHeight*b),w.maxWidth>0&&this.displaySize.setMax(w.maxWidth*b,w.maxHeight*b),this.displaySize.setSize(C,A),(w.snapWidth>0||w.snapHeight>0)&&this.displaySize.setSnap(w.snapWidth,w.snapHeight),this.orientation=f(C,A)},getParent:function(w){var C=w.parent;if(C!==null){if(this.parent=u(C),this.parentIsWindow=this.parent===document.body,w.expandParent&&w.scaleMode!==r.SCALE_MODE.NONE){var A=this.parent.getBoundingClientRect();(this.parentIsWindow||A.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",A=this.parent.getBoundingClientRect(),!this.parentIsWindow&&A.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}w.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(w.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var w=this.parentSize,C=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(C.height=n(!0));var A=C.width,P=C.height;if(w.width!==A||w.height!==P)return w.setSize(A,P),!0;if(this.canvas){var b=this.canvasBounds,O=this.canvas.getBoundingClientRect();if(O.x!==b.x||O.y!==b.y)return!0}return!1},lockOrientation:function(w){var C=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return C?C.call(screen,w):!1},setParentSize:function(w,C){return this.parentSize.setSize(w,C),this.refresh()},setGameSize:function(w,C){var A=this.autoRound;A&&(w=Math.floor(w),C=Math.floor(C));var P=this.width,b=this.height;return this.gameSize.resize(w,C),this.baseSize.resize(w,C),A&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(w/C),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(P,b)},resize:function(w,C){var A=this.zoom,P=this.autoRound;P&&(w=Math.floor(w),C=Math.floor(C));var b=this.width,O=this.height;this.gameSize.resize(w,C),this.baseSize.resize(w,C),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(w*A,C*A),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var I=this.canvas.style,D=w*A,B=C*A;return P&&(D=Math.floor(D),B=Math.floor(B)),(D!==w||B!==C)&&(I.width=D+"px",I.height=B+"px"),this.refresh(b,O)},setZoom:function(w){return this.zoom=w,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(w,C){return w===void 0&&(w=0),C===void 0&&(C=w),this.displaySize.setSnap(w,C),this.refresh()},refresh:function(w,C){w===void 0&&(w=this.width),C===void 0&&(C=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var A=this.game.domContainer;if(A){this.baseSize.setCSS(A);var P=this.canvas.style,b=A.style;b.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",b.marginLeft=P.marginLeft,b.marginTop=P.marginTop}return this.emit(a.RESIZE,this.gameSize,this.baseSize,this.displaySize,w,C),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var w=f(this.width,this.height);w!==this.orientation&&(this.orientation=w,this.emit(a.ORIENTATION_CHANGE,w))}},updateScale:function(){var w=this.canvas.style,C=this.gameSize.width,A=this.gameSize.height,P,b,O=this.zoom,I=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(C*O,A*O),P=this.displaySize.width,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),this._resetZoom&&(w.width=P+"px",w.height=b+"px",this._resetZoom=!1);else if(this.scaleMode===r.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),P=this.displaySize.width,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),this.canvas.width=P,this.canvas.height=b;else if(this.scaleMode===r.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),P=this.displaySize.width,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),w.width=P+"px",w.height=b+"px";var D=this.parentSize.width/this.gameSize.width,B=this.parentSize.height/this.gameSize.height;D=0?0:-(b.x*O.x),D=b.y>=0?0:-(b.y*O.y),B;P.width>=b.width?B=A.width:B=A.width-(b.width-P.width)*O.x;var G;return P.height>=b.height?G=A.height:G=A.height-(b.height-P.height)*O.y,C.setTo(I,D,B,G),w&&(C.width/=w.zoomX,C.height/=w.zoomY,C.centerX=w.centerX+w.scrollX,C.centerY=w.centerY+w.scrollY),C},step:function(w,C){this.parent&&(this._lastCheck+=C,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var w=this.domlisteners;window.removeEventListener("orientationchange",w.orientationChange,!1),window.removeEventListener("resize",w.windowResize,!1);var C=["webkit","moz",""];C.forEach(function(A){document.removeEventListener(A+"fullscreenchange",w.fullScreenChange,!1),document.removeEventListener(A+"fullscreenerror",w.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",w.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",w.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===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});s.exports=M},64743:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={CENTER:e(64743),ORIENTATION:e(39218),SCALE_MODE:e(81050),ZOOM:e(80805)};s.exports=r},56139:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="enterfullscreen"},2336:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fullscreenfailed"},47412:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fullscreenunsupported"},51452:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="leavefullscreen"},20666:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="orientationchange"},47945:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resize"},97480:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ENTER_FULLSCREEN:e(56139),FULLSCREEN_FAILED:e(2336),FULLSCREEN_UNSUPPORTED:e(47412),LEAVE_FULLSCREEN:e(51452),ORIENTATION_CHANGE:e(20666),RESIZE:e(47945)}},93364:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(13560),h={Center:e(64743),Events:e(97480),Orientation:e(39218),ScaleManager:e(76531),ScaleModes:e(81050),Zoom:e(80805)};h=r(!1,h,p.CENTER),h=r(!1,h,p.ORIENTATION),h=r(!1,h,p.SCALE_MODE),h=r(!1,h,p.ZOOM),s.exports=h},27397:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(35355),h=function(a){var l=a.game.config.defaultPhysicsSystem,n=r(a.settings,"physics",!1);if(!(!l&&!n)){var u=[];if(l&&u.push(p(l+"Physics")),n)for(var f in n)f=p(f.concat("Physics")),u.indexOf(f)===-1&&u.push(f);return u}};s.exports=h},52106:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h){var a=h.plugins.getDefaultScenePlugins(),l=r(h.settings,"plugins",!1);return Array.isArray(l)?l:a||[]};s.exports=p},87033:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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"};s.exports=y},97482:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(2368),h=new r({initialize:function(l){this.sys=new p(this,l),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(){}});s.exports=h},60903:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89993),h=e(44594),a=e(8443),l=e(35154),n=e(54899),u=e(29747),f=e(97482),o=e(2368),c=new r({initialize:function(v,m){if(this.game=v,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,m){Array.isArray(m)||(m=[m]);for(var S=0;S-1&&(delete this.keys[S],this.scenes.splice(m,1),this._start.indexOf(S)>-1&&(m=this._start.indexOf(S),this._start.splice(m,1)),v.sys.destroy())}return this},bootScene:function(d){var v=d.sys,m=v.settings;v.sceneUpdate=u,d.init&&(d.init.call(d,m.data),m.status=p.INIT,m.isTransition&&v.events.emit(h.TRANSITION_INIT,m.transitionFrom,m.transitionDuration));var S;v.load&&(S=v.load,S.reset()),S&&d.preload?(d.preload.call(d),m.status=p.LOADING,S.once(n.COMPLETE,this.loadComplete,this),S.start()):this.create(d)},loadComplete:function(d){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(d.scene)},payloadComplete:function(d){this.bootScene(d.scene)},update:function(d,v){this.processQueue(),this.isProcessing=!0;for(var m=this.scenes.length-1;m>=0;m--){var S=this.scenes[m].sys;S.settings.status>p.START&&S.settings.status<=p.RUNNING&&S.step(d,v),S.scenePlugin&&S.scenePlugin._target&&S.scenePlugin.step(d,v)}},render:function(d){for(var v=0;v=p.LOADING&&m.settings.status=p.START&&M<=p.CREATING)return this;if(M>=p.RUNNING&&M<=p.SLEEPING)S.shutdown(),S.sceneUpdate=u,S.start(v);else{S.sceneUpdate=u,S.start(v);var w;if(S.load&&(w=S.load),w&&S.settings.hasOwnProperty("pack")&&(w.reset(),w.addPack({payload:S.settings.pack})))return S.settings.status=p.LOADING,w.once(n.COMPLETE,this.payloadComplete,this),w.start(),this}return this.bootScene(m),this},stop:function(d,v){var m=this.getScene(d);if(m&&!m.sys.isTransitioning()&&m.sys.settings.status!==p.SHUTDOWN){var S=m.sys.load;S&&(S.off(n.COMPLETE,this.loadComplete,this),S.off(n.COMPLETE,this.payloadComplete,this)),m.sys.shutdown(v)}return this},switch:function(d,v){var m=this.getScene(d),S=this.getScene(v);return m&&S&&m!==S&&(this.sleep(d),this.isSleeping(v)?this.wake(v):this.start(v)),this},getAt:function(d){return this.scenes[d]},getIndex:function(d){var v=this.getScene(d);return this.scenes.indexOf(v)},bringToTop:function(d){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v!==-1&&v0){var m=this.getScene(d);this.scenes.splice(v,1),this.scenes.unshift(m)}}return this},moveDown:function(d){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v>0){var m=v-1,S=this.getScene(d),M=this.getAt(m);this.scenes[v]=M,this.scenes[m]=S}}return this},moveUp:function(d){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:d,keyB:null});else{var v=this.getIndex(d);if(vm),0,M)}}return this},moveBelow:function(d,v){if(d===v)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:d,keyB:v});else{var m=this.getIndex(d),S=this.getIndex(v);if(m!==-1&&S!==-1&&S>m){var M=this.getAt(S);this.scenes.splice(S,1),m===0?this.scenes.unshift(M):this.scenes.splice(m-(S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(44594),a=e(95540),l=e(37277),n=new p({initialize:function(f){this.scene=f,this.systems=f.sys,this.settings=f.sys.settings,this.key=f.sys.settings.key,this.manager=f.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,f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.pluginStart,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(h.SHUTDOWN,this.shutdown,this)},start:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",u,f),this},restart:function(u){var f=this.key;return this.manager.queueOp("stop",f),this.manager.queueOp("start",f,u),this},transition:function(u){u===void 0&&(u={});var f=a(u,"target",!1),o=this.manager.getScene(f);if(!f||!this.checkValidTransition(o))return!1;var c=a(u,"duration",1e3);this._elapsed=0,this._target=o,this._duration=c,this._willSleep=a(u,"sleep",!1),this._willRemove=a(u,"remove",!1);var d=a(u,"onUpdate",null);d&&(this._onUpdate=d,this._onUpdateScope=a(u,"onUpdateScope",this.scene));var v=a(u,"allowInput",!1);this.settings.transitionAllowInput=v;var m=o.sys.settings;m.isTransition=!0,m.transitionFrom=this.scene,m.transitionDuration=c,m.transitionAllowInput=v,a(u,"moveAbove",!1)?this.manager.moveAbove(this.key,f):a(u,"moveBelow",!1)&&this.manager.moveBelow(this.key,f),o.sys.isSleeping()?o.sys.wake(a(u,"data")):this.manager.start(f,a(u,"data"));var S=a(u,"onStart",null),M=a(u,"onStartScope",this.scene);return S&&S.call(M,this.scene,o,c),this.systems.events.emit(h.TRANSITION_OUT,o,c),!0},checkValidTransition:function(u){return!(!u||u.sys.isActive()||u.sys.isTransitioning()||u===this.scene||this.systems.isTransitioning())},step:function(u,f){this._elapsed+=f,this.transitionProgress=r(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var u=this._target.sys,f=this._target.sys.settings;u.events.emit(h.TRANSITION_COMPLETE,this.scene),f.isTransition=!1,f.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(u,f,o,c){return this.manager.add(u,f,o,c)},launch:function(u,f){return u&&u!==this.key&&this.manager.queueOp("start",u,f),this},run:function(u,f){return u&&u!==this.key&&this.manager.queueOp("run",u,f),this},pause:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("pause",u,f),this},resume:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("resume",u,f),this},sleep:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("sleep",u,f),this},wake:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("wake",u,f),this},switch:function(u){return u!==this.key&&this.manager.queueOp("switch",this.key,u),this},stop:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",u,f),this},setActive:function(u,f,o){f===void 0&&(f=this.key);var c=this.manager.getScene(f);return c&&c.sys.setActive(u,o),this},setVisible:function(u,f){f===void 0&&(f=this.key);var o=this.manager.getScene(f);return o&&o.sys.setVisible(u),this},isSleeping:function(u){return u===void 0&&(u=this.key),this.manager.isSleeping(u)},isActive:function(u){return u===void 0&&(u=this.key),this.manager.isActive(u)},isPaused:function(u){return u===void 0&&(u=this.key),this.manager.isPaused(u)},isVisible:function(u){return u===void 0&&(u=this.key),this.manager.isVisible(u)},swapPosition:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.swapPosition(u,f),this},moveAbove:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveAbove(u,f),this},moveBelow:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveBelow(u,f),this},remove:function(u){return u===void 0&&(u=this.key),this.manager.remove(u),this},moveUp:function(u){return u===void 0&&(u=this.key),this.manager.moveUp(u),this},moveDown:function(u){return u===void 0&&(u=this.key),this.manager.moveDown(u),this},bringToTop:function(u){return u===void 0&&(u=this.key),this.manager.bringToTop(u),this},sendToBack:function(u){return u===void 0&&(u=this.key),this.manager.sendToBack(u),this},get:function(u){return this.manager.getScene(u)},getStatus:function(u){var f=this.manager.getScene(u);if(f)return f.sys.getStatus()},getIndex:function(u){return u===void 0&&(u=this.key),this.manager.getIndex(u)},shutdown:function(){var u=this.systems.events;u.off(h.SHUTDOWN,this.shutdown,this),u.off(h.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});l.register("ScenePlugin",n,"scenePlugin"),s.exports=n},55681:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89993),p=e(35154),h=e(46975),a=e(87033),l={create:function(n){return typeof n=="string"?n={key:n}:n===void 0&&(n={}),{status:r.PENDING,key:p(n,"key",""),active:p(n,"active",!1),visible:p(n,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:p(n,"pack",!1),cameras:p(n,"cameras",null),map:p(n,"map",h(a,p(n,"mapAdd",{}))),physics:p(n,"physics",{}),loader:p(n,"loader",{}),plugins:p(n,"plugins",!1),input:p(n,"input",{})}}};s.exports=l},2368:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89993),h=e(42363),a=e(44594),l=e(27397),n=e(52106),u=e(29747),f=e(55681),o=new r({initialize:function(d,v){this.scene=d,this.game,this.renderer,this.config=v,this.settings=f.create(v),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=u},init:function(c){this.settings.status=p.INIT,this.sceneUpdate=u,this.game=c,this.renderer=c.renderer,this.canvas=c.canvas,this.context=c.context;var d=c.plugins;this.plugins=d,d.addToScene(this,h.Global,[h.CoreScene,n(this),l(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(c,d){var v=this.events;v.emit(a.PRE_UPDATE,c,d),v.emit(a.UPDATE,c,d),this.sceneUpdate.call(this.scene,c,d),v.emit(a.POST_UPDATE,c,d)},render:function(c){var d=this.displayList;d.depthSort(),this.events.emit(a.PRE_RENDER,c),this.cameras.render(c,d),this.events.emit(a.RENDER,c)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot pause non-running Scene",d.key):this.settings.active&&(d.status=p.PAUSED,d.active=!1,this.events.emit(a.PAUSE,this,c)),this},resume:function(c){var d=this.events,v=this.settings;return this.settings.active||(v.status=p.RUNNING,v.active=!0,d.emit(a.RESUME,this,c)),this},sleep:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot sleep non-running Scene",d.key):(d.status=p.SLEEPING,d.active=!1,d.visible=!1,this.events.emit(a.SLEEP,this,c)),this},wake:function(c){var d=this.events,v=this.settings;return v.status=p.RUNNING,v.active=!0,v.visible=!0,d.emit(a.WAKE,this,c),v.isTransition&&d.emit(a.TRANSITION_WAKE,v.transitionFrom,v.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var c=this.settings.status;return c>p.PENDING&&c<=p.RUNNING},isSleeping:function(){return this.settings.status===p.SLEEPING},isActive:function(){return this.settings.status===p.RUNNING},isPaused:function(){return this.settings.status===p.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(c){return this.settings.visible=c,this},setActive:function(c,d){return c?this.resume(d):this.pause(d)},start:function(c){var d=this.events,v=this.settings;c&&(v.data=c),v.status=p.START,v.active=!0,v.visible=!0,d.emit(a.START,this),d.emit(a.READY,this,c)},shutdown:function(c){var d=this.events,v=this.settings;d.off(a.TRANSITION_INIT),d.off(a.TRANSITION_START),d.off(a.TRANSITION_COMPLETE),d.off(a.TRANSITION_OUT),v.status=p.SHUTDOWN,v.active=!1,v.visible=!1,d.emit(a.SHUTDOWN,this,c)},destroy:function(){var c=this.events,d=this.settings;d.status=p.DESTROYED,d.active=!1,d.visible=!1,c.emit(a.DESTROY,this),c.removeAllListeners();for(var v=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9};s.exports=y},69830:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addedtoscene"},7919:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},46763:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="create"},11763:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},71555:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},36735:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postupdate"},3809:s=>{/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},90716:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="preupdate"},58262:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},91633:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedfromscene"},10319:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="render"},87132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},81961:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="shutdown"},90194:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleep"},6265:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},33178:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitioncomplete"},43063:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitioninit"},11259:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionout"},61611:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionstart"},45209:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionwake"},22966:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},21747:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wake"},44594:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADDED_TO_SCENE:e(69830),BOOT:e(7919),CREATE:e(46763),DESTROY:e(11763),PAUSE:e(71555),POST_UPDATE:e(36735),PRE_RENDER:e(3809),PRE_UPDATE:e(90716),READY:e(58262),REMOVED_FROM_SCENE:e(91633),RENDER:e(10319),RESUME:e(87132),SHUTDOWN:e(81961),SLEEP:e(90194),START:e(6265),TRANSITION_COMPLETE:e(33178),TRANSITION_INIT:e(43063),TRANSITION_OUT:e(11259),TRANSITION_START:e(61611),TRANSITION_WAKE:e(45209),UPDATE:e(22966),WAKE:e(21747)}},62194:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89993),p=e(79291),h={Events:e(44594),GetPhysicsPlugins:e(27397),GetScenePlugins:e(52106),SceneManager:e(60903),ScenePlugin:e(52209),Settings:e(55681),Systems:e(2368)};h=p(!1,h,r),s.exports=h},30341:(s,y,e)=>{/** + * @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 r=e(83419),p=e(50792),h=e(14463),a=e(79291),l=e(29747),n=new r({Extends:p,initialize:function(f,o,c){p.call(this),this.manager=f,this.key=o,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=a(this.config,c),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(console.error("addMarker "+u.name+" already exists in Sound"),!1):(u=a(!0,{name:"",start:0,duration:this.totalDuration-(u.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},u),this.markers[u.name]=u,!0)},updateMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(this.markers[u.name]=a(!0,this.markers[u.name],u),!0):(console.warn("Audio Marker: "+u.name+" missing in Sound: "+this.key),!1)},removeMarker:function(u){var f=this.markers[u];return f?(this.markers[u]=null,f):null},play:function(u,f){if(u===void 0&&(u=""),typeof u=="object"&&(f=u,u=""),typeof u!="string")return!1;if(!u)this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;else{if(!this.markers[u])return console.warn("Marker: "+u+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[u],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}return this.resetConfig(),this.currentConfig=a(this.currentConfig,f),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:l,calculateRate:function(){var u=1.0005777895065548,f=this.currentConfig.detune+this.manager.detune,o=Math.pow(u,f);this.totalRate=this.currentConfig.rate*this.manager.rate*o},destroy:function(){this.pendingRemove||(this.stop(),this.emit(h.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});s.exports=n},85034:(s,y,e)=>{/** + * @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 r=e(83419),p=e(41786),h=e(50792),a=e(14463),l=e(8443),n=e(46710),u=e(58731),f=e(29747),o=e(26099),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.jsonCache=v.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 o,v.events.on(l.BLUR,this.onGameBlur,this),v.events.on(l.FOCUS,this.onGameFocus,this),v.events.on(l.PRE_STEP,this.update,this),v.events.once(l.DESTROY,this.destroy,this)},add:f,addAudioSprite:function(d,v){v===void 0&&(v={});var m=this.add(d,v);m.spritemap=this.jsonCache.get(d).spritemap;for(var S in m.spritemap)if(m.spritemap.hasOwnProperty(S)){var M=p(v),w=m.spritemap[S];M.loop=w.hasOwnProperty("loop")?w.loop:!1,m.addMarker({name:S,start:w.start,duration:w.end-w.start,config:M})}return m},get:function(d){return u(this.sounds,"key",d)},getAll:function(d){return d?n(this.sounds,"key",d):n(this.sounds)},getAllPlaying:function(){return n(this.sounds,"isPlaying",!0)},play:function(d,v){var m=this.add(d);return m.once(a.COMPLETE,m.destroy,m),v?v.name?(m.addMarker(v),m.play(v.name)):m.play(v):m.play()},playAudioSprite:function(d,v,m){var S=this.addAudioSprite(d);return S.once(a.COMPLETE,S.destroy,S),S.play(v,m)},remove:function(d){var v=this.sounds.indexOf(d);return v!==-1?(d.destroy(),this.sounds.splice(v,1),!0):!1},removeAll:function(){this.sounds.forEach(function(d){d.destroy()}),this.sounds.length=0},removeByKey:function(d){for(var v=0,m=this.sounds.length-1;m>=0;m--){var S=this.sounds[m];S.key===d&&(S.destroy(),this.sounds.splice(m,1),v++)}return v},pauseAll:function(){this.forEachActiveSound(function(d){d.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(d){d.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:f,stopAll:function(){this.forEachActiveSound(function(d){d.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(d){var v=0;return this.getAll(d).forEach(function(m){m.stop()&&v++}),v},unlock:f,onBlur:f,onFocus:f,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(d,v){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var m=this.sounds.length-1;m>=0;m--)this.sounds[m].pendingRemove&&this.sounds.splice(m,1);this.sounds.forEach(function(S){S.update(d,v)})},destroy:function(){this.game.events.off(l.BLUR,this.onGameBlur,this),this.game.events.off(l.FOCUS,this.onGameFocus,this),this.game.events.off(l.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(d,v){var m=this;this.sounds.forEach(function(S,M){S&&!S.pendingRemove&&d.call(v||m,S,M,m.sounds)})},setRate:function(d){return this.rate=d,this},rate:{get:function(){return this._rate},set:function(d){this._rate=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(a.GLOBAL_RATE,this,d)}},setDetune:function(d){return this.detune=d,this},detune:{get:function(){return this._detune},set:function(d){this._detune=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,d)}}});s.exports=c},14747:(s,y,e)=>{/** + * @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 r=e(33684),p=e(25960),h=e(57490),a={create:function(l){var n=l.config.audio,u=l.device.audio;return n.noAudio||!u.webAudio&&!u.audioData?new p(l):u.webAudio&&!n.disableWebAudio?new h(l):new r(l)}};s.exports=a},19723:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},98882:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="decodedall"},57506:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="decoded"},73146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},11305:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="detune"},40577:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="detune"},30333:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="mute"},20394:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="rate"},21802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="volume"},1299:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="looped"},99190:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},97125:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="mute"},89259:s=>{/** + * @author pi-kei + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pan"},79986:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pauseall"},17586:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},19618:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="play"},42306:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="rate"},10387:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resumeall"},48959:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},9960:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seek"},19180:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stopall"},98328:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},50401:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unlocked"},52498:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="volume"},14463:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(19723),DECODED:e(57506),DECODED_ALL:e(98882),DESTROY:e(73146),DETUNE:e(11305),GLOBAL_DETUNE:e(40577),GLOBAL_MUTE:e(30333),GLOBAL_RATE:e(20394),GLOBAL_VOLUME:e(21802),LOOP:e(99190),LOOPED:e(1299),MUTE:e(97125),PAN:e(89259),PAUSE_ALL:e(79986),PAUSE:e(17586),PLAY:e(19618),RATE:e(42306),RESUME_ALL:e(10387),RESUME:e(48959),SEEK:e(9960),STOP_ALL:e(19180),STOP:e(98328),UNLOCKED:e(50401),VOLUME:e(52498)}},64895:(s,y,e)=>{/** + * @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 r=e(30341),p=e(83419),h=e(14463),a=e(45319),l=new p({Extends:r,initialize:function(u,f,o){if(o===void 0&&(o={}),this.tags=u.game.cache.audio.get(f),!this.tags)throw new Error('No cached audio asset with key "'+f);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,u,f,o)},play:function(n,u){return this.manager.isLocked(this,"play",[n,u])||!r.prototype.play.call(this,n,u)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.PLAY,this),!0)},pause:function(){return this.manager.isLocked(this,"pause")||this.startTime>0||!r.prototype.pause.call(this)?!1:(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(h.PAUSE,this),!0)},resume:function(){return this.manager.isLocked(this,"resume")||this.startTime>0||!r.prototype.resume.call(this)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.RESUME,this),!0)},stop:function(){return this.manager.isLocked(this,"stop")||!r.prototype.stop.call(this)?!1:(this.stopAndReleaseAudioTag(),this.emit(h.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var n=this.currentConfig.seek,u=this.currentConfig.delay,f=(this.currentMarker?this.currentMarker.start:0)+n;return this.previousTime=f,this.audio.currentTime=f,this.applyConfig(),u===0?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+u*1e3,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var n=0;n0){this.startTime=f-this.manager.loopEndOffset?(this.audio.currentTime=u+Math.max(0,o-f),o=this.audio.currentTime):o=f){this.reset(),this.stopAndReleaseAudioTag(),this.emit(h.COMPLETE,this);return}this.previousTime=o}},destroy:function(){r.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=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(n){this.currentConfig.mute=n,!this.manager.isLocked(this,"mute",n)&&(this.updateMute(),this.emit(h.MUTE,this,n))}},setMute:function(n){return this.mute=n,this},volume:{get:function(){return this.currentConfig.volume},set:function(n){this.currentConfig.volume=n,!this.manager.isLocked(this,"volume",n)&&(this.updateVolume(),this.emit(h.VOLUME,this,n))}},setVolume:function(n){return this.volume=n,this},rate:{get:function(){return this.currentConfig.rate},set:function(n){this.currentConfig.rate=n,!this.manager.isLocked(this,h.RATE,n)&&(this.calculateRate(),this.emit(h.RATE,this,n))}},setRate:function(n){return this.rate=n,this},detune:{get:function(){return this.currentConfig.detune},set:function(n){this.currentConfig.detune=n,!this.manager.isLocked(this,h.DETUNE,n)&&(this.calculateRate(),this.emit(h.DETUNE,this,n))}},setDetune:function(n){return this.detune=n,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(n){this.manager.isLocked(this,"seek",n)||this.startTime>0||(this.isPlaying||this.isPaused)&&(n=Math.min(Math.max(0,n),this.duration),this.isPlaying?(this.previousTime=n,this.audio.currentTime=n):this.isPaused&&(this.currentConfig.seek=n),this.emit(h.SEEK,this,n))}},setSeek:function(n){return this.seek=n,this},loop:{get:function(){return this.currentConfig.loop},set:function(n){this.currentConfig.loop=n,!this.manager.isLocked(this,"loop",n)&&(this.audio&&(this.audio.loop=n),this.emit(h.LOOP,this,n))}},setLoop:function(n){return this.loop=n,this},pan:{get:function(){return this.currentConfig.pan},set:function(n){this.currentConfig.pan=n,this.emit(h.PAN,this,n)}},setPan:function(n){return this.pan=n,this}});s.exports=l},33684:(s,y,e)=>{/** + * @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 r=e(85034),p=e(83419),h=e(14463),a=e(64895),l=new p({Extends:r,initialize:function(u){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,r.call(this,u)},add:function(n,u){var f=new a(this,n,u);return this.sounds.push(f),f},unlock:function(){this.locked=!1;var n=this;if(this.game.cache.audio.entries.each(function(c,d){for(var v=0;v{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={SoundManagerCreator:e(14747),Events:e(14463),BaseSound:e(30341),BaseSoundManager:e(85034),WebAudioSound:e(71741),WebAudioSoundManager:e(57490),HTML5AudioSound:e(64895),HTML5AudioSoundManager:e(33684),NoAudioSound:e(4603),NoAudioSoundManager:e(25960)}},4603:(s,y,e)=>{/** + * @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 r=e(30341),p=e(83419),h=e(50792),a=e(79291),l=e(29747),n=function(){return!1},u=function(){return null},f=function(){return this},o=new p({Extends:h,initialize:function(d,v,m){m===void 0&&(m={}),h.call(this),this.manager=d,this.key=v,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},m),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:n,updateMarker:n,removeMarker:u,play:n,pause:n,resume:n,stop:n,setMute:f,setVolume:f,setRate:f,setDetune:f,setSeek:f,setLoop:f,setPan:f,applyConfig:u,resetConfig:u,update:l,calculateRate:u,destroy:function(){r.prototype.destroy.call(this)}});s.exports=o},25960:(s,y,e)=>{/** + * @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 r=e(85034),p=e(83419),h=e(50792),a=e(4603),l=e(29747),n=new p({Extends:h,initialize:function(f){h.call(this),this.game=f,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(u,f){var o=new a(this,u,f);return this.sounds.push(o),o},addAudioSprite:function(u,f){var o=this.add(u,f);return o.spritemap={},o},get:function(u){return r.prototype.get.call(this,u)},getAll:function(u){return r.prototype.getAll.call(this,u)},play:function(u,f){return!1},playAudioSprite:function(u,f,o){return!1},remove:function(u){return r.prototype.remove.call(this,u)},removeAll:function(){return r.prototype.removeAll.call(this)},removeByKey:function(u){return r.prototype.removeByKey.call(this,u)},stopByKey:function(u){return r.prototype.stopByKey.call(this,u)},onBlur:l,onFocus:l,onGameBlur:l,onGameFocus:l,pauseAll:l,resumeAll:l,stopAll:l,update:l,setRate:l,setDetune:l,setMute:l,setVolume:l,unlock:l,forEachActiveSound:function(u,f){r.prototype.forEachActiveSound.call(this,u,f)},destroy:function(){r.prototype.destroy.call(this)}});s.exports=n},71741:(s,y,e)=>{/** + * @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 r=e(30341),p=e(83419),h=e(14463),a=e(95540),l=new p({Extends:r,initialize:function(u,f,o){if(o===void 0&&(o={}),this.audioBuffer=u.game.cache.audio.get(f),!this.audioBuffer)throw new Error('Audio key "'+f+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=u.context.createGain(),this.volumeNode=u.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),u.context.createPanner&&(this.spatialNode=u.context.createPanner(),this.volumeNode.connect(this.spatialNode)),u.context.createStereoPanner?(this.pannerNode=u.context.createStereoPanner(),u.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(u.destination)):u.context.createPanner?this.spatialNode.connect(u.destination):this.volumeNode.connect(u.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,r.call(this,u,f,o)},play:function(n,u){return r.prototype.play.call(this,n,u)?(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(h.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 r=e(53134),p=e(85034),h=e(83419),a=e(14463),l=e(8443),n=e(71741),u=e(95540),f=new h({Extends:p,initialize:function(c){this.context=this.createAudioContext(c),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),p.call(this,c),this.locked&&c.isBooted?this.unlock():c.events.once(l.BOOT,this.unlock,this)},createAudioContext:function(o){var c=o.config.audio;if(c.context)return c.context.resume(),c.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(o){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=o,this.masterMuteNode=o.createGain(),this.masterVolumeNode=o.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(o.destination),this.destination=this.masterMuteNode,this},add:function(o,c){var d=new n(this,o,c);return this.sounds.push(d),d},decodeAudio:function(o,c){var d;Array.isArray(o)?d=o:d=[{key:o,data:c}];for(var v=this.game.cache.audio,m=d.length,S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37105),p=e(83419),h=e(29747),a=e(19186),l=new p({initialize:function(u){this.parent=u,this.list=[],this.position=0,this.addCallback=h,this.removeCallback=h,this._sortKey=""},add:function(n,u){return u?r.Add(this.list,n):r.Add(this.list,n,0,this.addCallback,this)},addAt:function(n,u,f){return f?r.AddAt(this.list,n,u):r.AddAt(this.list,n,u,0,this.addCallback,this)},getAt:function(n){return this.list[n]},getIndex:function(n){return this.list.indexOf(n)},sort:function(n,u){return n?(u===void 0&&(u=function(f,o){return f[n]-o[n]}),a(this.list,u),this):this},getByName:function(n){return r.GetFirst(this.list,"name",n)},getRandom:function(n,u){return r.GetRandom(this.list,n,u)},getFirst:function(n,u,f,o){return r.GetFirst(this.list,n,u,f,o)},getAll:function(n,u,f,o){return r.GetAll(this.list,n,u,f,o)},count:function(n,u){return r.CountAllMatching(this.list,n,u)},swap:function(n,u){r.Swap(this.list,n,u)},moveTo:function(n,u){return r.MoveTo(this.list,n,u)},moveAbove:function(n,u){return r.MoveAbove(this.list,n,u)},moveBelow:function(n,u){return r.MoveBelow(this.list,n,u)},remove:function(n,u){return u?r.Remove(this.list,n):r.Remove(this.list,n,this.removeCallback,this)},removeAt:function(n,u){return u?r.RemoveAt(this.list,n):r.RemoveAt(this.list,n,this.removeCallback,this)},removeBetween:function(n,u,f){return f?r.RemoveBetween(this.list,n,u):r.RemoveBetween(this.list,n,u,this.removeCallback,this)},removeAll:function(n){for(var u=this.list.length;u--;)this.remove(this.list[u],n);return this},bringToTop:function(n){return r.BringToTop(this.list,n)},sendToBack:function(n){return r.SendToBack(this.list,n)},moveUp:function(n){return r.MoveUp(this.list,n),n},moveDown:function(n){return r.MoveDown(this.list,n),n},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(n,u){return r.Replace(this.list,n,u)},exists:function(n){return this.list.indexOf(n)>-1},setAll:function(n,u,f,o){return r.SetAll(this.list,n,u,f,o),this},each:function(n,u){for(var f=[null],o=2;o0?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}}});s.exports=l},90330:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){this.entries={},this.size=0,this.setAll(a)},setAll:function(h){if(Array.isArray(h))for(var a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(82348),a=new r({Extends:p,initialize:function(){p.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(l){return this._active.indexOf(l)>-1},isPending:function(l){return this._toProcess>0&&this._pending.indexOf(l)>-1},isDestroying:function(l){return this._destroy.indexOf(l)>-1},add:function(l){return this.checkQueue&&this.isActive(l)&&!this.isDestroying(l)||this.isPending(l)||(this._pending.push(l),this._toProcess++),l},remove:function(l){if(this.isPending(l)){var n=this._pending,u=n.indexOf(l);u!==-1&&n.splice(u,1)}else this.isActive(l)&&(this._destroy.push(l),this._toProcess++);return l},removeAll:function(){for(var l=this._active,n=this._destroy,u=l.length;u--;)n.push(l[u]),this._toProcess++;return this},update:function(){if(this._toProcess===0)return this._active;var l=this._destroy,n=this._active,u,f;for(u=0;u{/** + * @author Vladimir Agafonkin + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43886);function p(C){if(!(this instanceof p))return new p(C);this._maxEntries=Math.max(4,C||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}p.prototype={all:function(){return this._all(this.data,[])},search:function(C){var A=this.data,P=[],b=this.toBBox;if(!S(C,A))return P;for(var O=[],I,D,B,G;A;){for(I=0,D=A.children.length;I=0&&I[A].children.length>this._maxEntries;)this._split(I,A),A--;this._adjustParentBBoxes(O,I,A)},_split:function(C,A){var P=C[A],b=P.children.length,O=this._minEntries;this._chooseSplitAxis(P,O,b);var I=this._chooseSplitIndex(P,O,b),D=M(P.children.splice(I,P.children.length-I));D.height=P.height,D.leaf=P.leaf,a(P,this.toBBox),a(D,this.toBBox),A?C[A-1].children.push(D):this._splitRoot(P,D)},_splitRoot:function(C,A){this.data=M([C,A]),this.data.height=C.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(C,A,P){var b,O,I,D,B,G,z,X;for(G=z=1/0,b=A;b<=P-A;b++)O=l(C,0,b,this.toBBox),I=l(C,b,P,this.toBBox),D=v(O,I),B=o(O)+o(I),D=A;G--)z=C.children[G],n(D,C.leaf?O(z):z),B+=c(D);return B},_adjustParentBBoxes:function(C,A,P){for(var b=P;b>=0;b--)n(A[b],C)},_condense:function(C){for(var A=C.length-1,P;A>=0;A--)C[A].children.length===0?A>0?(P=C[A-1].children,P.splice(P.indexOf(C[A]),1)):this.clear():a(C[A],this.toBBox)},compareMinX:function(C,A){return C.left-A.left},compareMinY:function(C,A){return C.top-A.top},toBBox:function(C){return{minX:C.left,minY:C.top,maxX:C.right,maxY:C.bottom}}};function h(C,A,P){if(!P)return A.indexOf(C);for(var b=0;b=C.minX&&A.maxY>=C.minY}function M(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function w(C,A,P,b,O){for(var I=[A,P],D;I.length;)P=I.pop(),A=I.pop(),!(P-A<=b)&&(D=A+Math.ceil((P-A)/b/2)*b,r(C,D,A,P,O),I.push(A,D,D,P))}s.exports=p},35072:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){if(this.entries=[],Array.isArray(a))for(var l=0;l-1&&this.entries.splice(a,1),this},dump:function(){console.group("Set");for(var h=0;h-1},union:function(h){var a=new p;return h.entries.forEach(function(l){a.set(l)}),this.entries.forEach(function(l){a.set(l)}),a},intersect:function(h){var a=new p;return this.entries.forEach(function(l){h.contains(l)&&a.set(l)}),a},difference:function(h){var a=new p;return this.entries.forEach(function(l){h.contains(l)||a.set(l)}),a},size:{get:function(){return this.entries.length},set:function(h){return h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(56583),a=e(26099),l=new p({initialize:function(u,f,o,c){u===void 0&&(u=0),f===void 0&&(f=u),o===void 0&&(o=0),c===void 0&&(c=null),this._width=u,this._height=f,this._parent=c,this.aspectMode=o,this.aspectRatio=f===0?1:u/f,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(n){return n===void 0&&(n=0),this.aspectMode=n,this.setSize(this._width,this._height)},setSnap:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.snapTo.set(n,u),this.setSize(this._width,this._height)},setParent:function(n){return this._parent=n,this.setSize(this._width,this._height)},setMin:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.minWidth=r(n,0,this.maxWidth),this.minHeight=r(u,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(n,u){return n===void 0&&(n=Number.MAX_VALUE),u===void 0&&(u=n),this.maxWidth=r(n,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(u,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(n,u){switch(n===void 0&&(n=0),u===void 0&&(u=n),this.aspectMode){case l.NONE:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height;break;case l.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case l.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(h(u,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case l.FIT:this.constrain(n,u,!0);break;case l.ENVELOP:this.constrain(n,u,!1);break}return this},setAspectRatio:function(n){return this.aspectRatio=n,this.setSize(this._width,this._height)},resize:function(n,u){return this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height,this},getNewWidth:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minWidth,this.maxWidth),u&&this._parent&&n>this._parent.width&&(n=Math.max(this.minWidth,this._parent.width)),n},getNewHeight:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minHeight,this.maxHeight),u&&this._parent&&n>this._parent.height&&(n=Math.max(this.minHeight,this._parent.height)),n},constrain:function(n,u,f){n===void 0&&(n=0),u===void 0&&(u=n),f===void 0&&(f=!0),n=this.getNewWidth(n),u=this.getNewHeight(u);var o=this.snapTo,c=u===0?1:n/u;return f&&this.aspectRatio>c||!f&&this.aspectRatio0&&(u=h(u,o.y),n=u*this.aspectRatio)):(f&&this.aspectRatioc)&&(u=h(u,o.y),n=u*this.aspectRatio,o.x>0&&(n=h(n,o.x),u=n*(1/this.aspectRatio))),this._width=n,this._height=u,this},fitTo:function(n,u){return this.constrain(n,u,!0)},envelop:function(n,u){return this.constrain(n,u,!1)},setWidth:function(n){return this.setSize(n,this._height)},setHeight:function(n){return this.setSize(this._width,n)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(n){n&&n.style&&(n.style.width=this._width+"px",n.style.height=this._height+"px")},copy:function(n){return n.setAspectMode(this.aspectMode),n.aspectRatio=this.aspectRatio,n.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(n){this.setSize(n,this._height)}},height:{get:function(){return this._height},set:function(n){this.setSize(this._width,n)}}});l.NONE=0,l.WIDTH_CONTROLS_HEIGHT=1,l.HEIGHT_CONTROLS_WIDTH=2,l.FIT=3,l.ENVELOP=4,s.exports=l},15238:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},56187:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},82348:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={PROCESS_QUEUE_ADD:e(15238),PROCESS_QUEUE_REMOVE:e(56187)}},41392:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(82348),List:e(73162),Map:e(90330),ProcessQueue:e(25774),RTree:e(59542),Set:e(35072),Size:e(86555)}},57382:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(40987),a=e(8054),l=e(50030),n=e(79237),u=new r({Extends:n,initialize:function(o,c,d,v,m){n.call(this,o,c,d,v,m),this.add("__BASE",0,0,0,v,m),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=v,this.height=m,this.imageData=this.context.getImageData(0,0,v,m),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===a.WEBGL&&this.refresh(),this},draw:function(f,o,c,d){return d===void 0&&(d=!0),this.context.drawImage(c,f,o),d&&this.update(),this},drawFrame:function(f,o,c,d,v){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=!0);var m=this.manager.getFrame(f,o);if(m){var S=m.canvasData,M=m.cutWidth,w=m.cutHeight,C=m.source.resolution;this.context.drawImage(m.source.image,S.x,S.y,M,w,c,d,M/C,w/C),v&&this.update()}return this},setPixel:function(f,o,c,d,v,m){m===void 0&&(m=255),f=Math.abs(Math.floor(f)),o=Math.abs(Math.floor(o));var S=this.getIndex(f,o);if(S>-1){var M=this.context.getImageData(f,o,1,1);M.data[0]=c,M.data[1]=d,M.data[2]=v,M.data[3]=m,this.context.putImageData(M,f,o)}return this},putData:function(f,o,c,d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=f.width),S===void 0&&(S=f.height),this.context.putImageData(f,o,c,d,v,m,S),this},getData:function(f,o,c,d){f=p(Math.floor(f),0,this.width-1),o=p(Math.floor(o),0,this.height-1),c=p(c,1,this.width-f),d=p(d,1,this.height-o);var v=this.context.getImageData(f,o,c,d);return v},getPixel:function(f,o,c){c||(c=new h);var d=this.getIndex(f,o);if(d>-1){var v=this.data,m=v[d+0],S=v[d+1],M=v[d+2],w=v[d+3];c.setTo(m,S,M,w)}return c},getPixels:function(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=this.width),d===void 0&&(d=c),f=Math.abs(Math.round(f)),o=Math.abs(Math.round(o));for(var v=p(f,0,this.width),m=p(f+c,0,this.width),S=p(o,0,this.height),M=p(o+d,0,this.height),w=new h,C=[],A=S;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(71911),h=e(27919),a=e(83419),l=e(8054),n=e(4327),u=e(95540),f=e(36060),o=e(32302),c=e(79237),d=e(70554),v=new a({Extends:c,initialize:function(S,M,w,C){w===void 0&&(w=256),C===void 0&&(C=256),this.type="DynamicTexture";var A=S.game.renderer,P=A&&A.type===l.CANVAS,b=P?h.create2D(this,w,C):[this];c.call(this,S,M,b,w,C),this.add("__BASE",0,0,0,w,C),this.renderer=A,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=P?b:null,this.context=P?b.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new p(0,0,w,C).setScene(S.game.scene.systemScene,!1),this.renderTarget=P?null:new o(A,w,C,1,0,!1,!0,!0,!1),this.pipeline=P?null:A.pipelines.get(f.SINGLE_PIPELINE),this.setSize(w,C)},setSize:function(m,S){S===void 0&&(S=m);var M=this.get(),w=M.source;if(m!==this.width||S!==this.height){this.canvas&&(this.canvas.width=m,this.canvas.height=S);var C=this.renderTarget;C&&(C.willResize(m,S)&&C.resize(m,S),C.texture!==w.glTexture&&this.renderer.deleteTexture(w.glTexture),this.setFromRenderTarget()),this.camera.setSize(m,S),w.width=m,w.height=S,M.setSize(m,S),this.width=m,this.height=S}else{var A=this.getSourceImage();M.cutX+m>A.width&&(m=A.width-M.cutX),M.cutY+S>A.height&&(S=A.height-M.cutY),M.setSize(m,S,M.cutX,M.cutY)}return this},setFromRenderTarget:function(){var m=this.get(),S=m.source,M=this.renderTarget;return S.isRenderTexture=!0,S.isGLTexture=!0,S.glTexture=M.texture,this},setIsSpriteTexture:function(m){return this.isSpriteTexture=m,this},fill:function(m,S,M,w,C,A){var P=this.camera,b=this.renderer;S===void 0&&(S=1),M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=this.width),A===void 0&&(A=this.height);var O=m>>16&255,I=m>>8&255,D=m&255,B=this.renderTarget;if(P.preRender(),B){B.bind(!0);var G=this.pipeline.manager.set(this.pipeline),z=b.width/B.width,X=b.height/B.height,j=B.height-(w+A);G.drawFillRect(M*z,j*X,C*z,A*X,d.getTintFromFloats(D/255,I/255,O/255,1),S),B.unbind(!0)}else{var Q=this.context;b.setContext(Q),Q.globalCompositeOperation="source-over",Q.fillStyle="rgba("+O+","+I+","+D+","+S+")",Q.fillRect(M,w,C,A),b.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var m=this.context,S=this.renderTarget;S?S.clear():m&&(m.save(),m.setTransform(1,0,0,1,0,0),m.clearRect(0,0,this.width,this.height),m.restore()),this.dirty=!1}return this},stamp:function(m,S,M,w,C){M===void 0&&(M=0),w===void 0&&(w=0);var A=u(C,"alpha",1),P=u(C,"tint",16777215),b=u(C,"angle",0),O=u(C,"rotation",0),I=u(C,"scale",1),D=u(C,"scaleX",I),B=u(C,"scaleY",I),G=u(C,"originX",.5),z=u(C,"originY",.5),X=u(C,"blendMode",0),j=u(C,"erase",!1),Q=u(C,"skipBatch",!1),tt=this.manager.resetStamp(A,P);return tt.setAngle(0),b!==0?tt.setAngle(b):O!==0&&tt.setRotation(O),tt.setScale(D,B),tt.setTexture(m,S),tt.setOrigin(G,z),tt.setBlendMode(X),j&&(this._eraseMode=!0),Q?this.batchGameObject(tt,M,w):this.draw(tt,M,w),j&&(this._eraseMode=!1),this},erase:function(m,S,M){return this._eraseMode=!0,this.draw(m,S,M),this._eraseMode=!1,this},draw:function(m,S,M,w,C){return this.beginDraw(),this.batchDraw(m,S,M,w,C),this.endDraw(),this},drawFrame:function(m,S,M,w,C,A){return this.beginDraw(),this.batchDrawFrame(m,S,M,w,C,A),this.endDraw(),this},repeat:function(m,S,M,w,C,A,P,b,O){if(M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=this.width),A===void 0&&(A=this.height),P===void 0&&(P=1),b===void 0&&(b=16777215),O===void 0&&(O=!1),m instanceof n?S=m:S=this.manager.getFrame(m,S),!S)return this;var I=this.manager.resetStamp(P,b);I.setFrame(S),I.setOrigin(0);var D=S.width,B=S.height;C=Math.floor(C),A=Math.floor(A);var G=Math.ceil(C/D),z=Math.ceil(A/B),X=G*D-C,j=z*B-A;X>0&&(X=D-X),j>0&&(j=B-j),M<0&&(G+=Math.ceil(Math.abs(M)/D)),w<0&&(z+=Math.ceil(Math.abs(w)/B));var Q=M,tt=w,Y=!1,Z=this.manager.stampCrop.setTo(0,0,D,B);O||this.beginDraw();for(var U=0;U0&&H===G-1&&(Y=!0,Z.width=X),j>0&&U===z-1&&(Y=!0,Z.height=j),Y&&I.setCrop(Z),this.batchGameObject(I,Q,tt),I.isCropped=!1,Z.setTo(0,0,D,B),Q+=D}Q=M,tt+=B}return O||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var m=this.camera,S=this.renderer,M=this.renderTarget;m.preRender(),M?S.beginCapture(M.width,M.height):S.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(m,S,M,w,C){return Array.isArray(m)||(m=[m]),this.batchList(m,S,M,w,C),this},batchDrawFrame:function(m,S,M,w,C,A){M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=1),A===void 0&&(A=16777215);var P=this.manager.getFrame(m,S);return P&&(this.renderTarget?this.pipeline.batchTextureFrame(P,M,w,A,C,this.camera.matrix,null):this.batchTextureFrame(P,M,w,C,A)),this},endDraw:function(m){if(m===void 0&&(m=this._eraseMode),this.isDrawing){var S=this.renderer,M=this.renderTarget;if(M){var w=S.endCapture(),C=S.pipelines.setUtility();C.blitFrame(w,M,1,!1,!1,m,this.isSpriteTexture),S.resetScissor(),S.resetViewport()}else S.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(m,S,M,w,C){var A=m.length;if(A!==0)for(var P=0;P0&&O.height>0&&b.drawImage(I,O.x,O.y,O.width,O.height,S,M,O.width,O.height),b.restore()}},snapshotArea:function(m,S,M,w,C,A,P){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,C,!1,m,S,M,w,A,P):this.renderer.snapshotCanvas(this.canvas,C,!1,m,S,M,w,A,P),this},snapshot:function(m,S,M){return this.snapshotArea(0,0,this.width,this.height,m,S,M)},snapshotPixel:function(m,S,M){return this.snapshotArea(m,S,1,1,M,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(m,S,M,w){var C=this.manager.resetStamp();C.setTexture(this),C.setOrigin(0),C.renderWebGL(m,C,M,w)},renderCanvas:function(){},destroy:function(){var m=this.manager.stamp;m&&m.texture===this&&this.manager.resetStamp(),c.prototype.destroy.call(this),h.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});s.exports=v},4327:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(79291),a=new r({initialize:function(n,u,f,o,c,d,v){this.texture=n,this.name=u,this.source=n.source[f],this.sourceIndex=f,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(d,v,o,c)},setSize:function(l,n,u,f){u===void 0&&(u=0),f===void 0&&(f=0),this.cutX=u,this.cutY=f,this.cutWidth=l,this.cutHeight=n,this.width=l,this.height=n,this.halfWidth=Math.floor(l*.5),this.halfHeight=Math.floor(n*.5),this.centerX=Math.floor(l/2),this.centerY=Math.floor(n/2);var o=this.data,c=o.cut;c.x=u,c.y=f,c.w=l,c.h=n,c.r=u+l,c.b=f+n,o.sourceSize.w=l,o.sourceSize.h=n,o.spriteSourceSize.w=l,o.spriteSourceSize.h=n,o.radius=.5*Math.sqrt(l*l+n*n);var d=o.drawImage;return d.x=u,d.y=f,d.width=l,d.height=n,this.updateUVs()},setTrim:function(l,n,u,f,o,c){var d=this.data,v=d.spriteSourceSize;return d.trim=!0,d.sourceSize.w=l,d.sourceSize.h=n,v.x=u,v.y=f,v.w=o,v.h=c,v.r=u+o,v.b=f+c,this.x=u,this.y=f,this.width=o,this.height=c,this.halfWidth=o*.5,this.halfHeight=c*.5,this.centerX=Math.floor(o/2),this.centerY=Math.floor(c/2),this.updateUVs()},setScale9:function(l,n,u,f){var o=this.data;return o.scale9=!0,o.is3Slice=n===0&&f===this.height,o.scale9Borders.x=l,o.scale9Borders.y=n,o.scale9Borders.w=u,o.scale9Borders.h=f,this},setCropUVs:function(l,n,u,f,o,c,d){var v=this.cutX,m=this.cutY,S=this.cutWidth,M=this.cutHeight,w=this.realWidth,C=this.realHeight;n=p(n,0,w),u=p(u,0,C),f=p(f,0,w-n),o=p(o,0,C-u);var A=v+n,P=m+u,b=f,O=o,I=this.data;if(I.trim){var D=I.spriteSourceSize;f=p(f,0,S-n),o=p(o,0,M-u);var B=n+f,G=u+o,z=!(D.rB||D.y>G);if(z){var X=Math.max(D.x,n),j=Math.max(D.y,u),Q=Math.min(D.r,B)-X,tt=Math.min(D.b,G)-j;b=Q,O=tt,c?A=v+(S-(X-D.x)-Q):A=v+(X-D.x),d?P=m+(M-(j-D.y)-tt):P=m+(j-D.y),n=X,u=j,f=Q,o=tt}else A=0,P=0,b=0,O=0}else c&&(A=v+(S-n-f)),d&&(P=m+(M-u-o));var Y=this.source.width,Z=this.source.height;return l.u0=Math.max(0,A/Y),l.v0=Math.max(0,P/Z),l.u1=Math.min(1,(A+b)/Y),l.v1=Math.min(1,(P+O)/Z),l.x=n,l.y=u,l.cx=A,l.cy=P,l.cw=b,l.ch=O,l.width=f,l.height=o,l.flipX=c,l.flipY=d,l},updateCropUVs:function(l,n,u){return this.setCropUVs(l,l.x,l.y,l.width,l.height,n,u)},setUVs:function(l,n,u,f,o,c){var d=this.data.drawImage;return d.width=l,d.height=n,this.u0=u,this.v0=f,this.u1=o,this.v1=c,this},updateUVs:function(){var l=this.cutX,n=this.cutY,u=this.cutWidth,f=this.cutHeight,o=this.data.drawImage;o.width=u,o.height=f;var c=this.source.width,d=this.source.height;return this.u0=l/c,this.v0=n/d,this.u1=(l+u)/c,this.v1=(n+f)/d,this},updateUVsInverted:function(){var l=this.source.width,n=this.source.height;return this.u0=(this.cutX+this.cutHeight)/l,this.v0=this.cutY/n,this.u1=this.cutX/l,this.v1=(this.cutY+this.cutWidth)/n,this},clone:function(){var l=new a(this.texture,this.name,this.sourceIndex);return l.cutX=this.cutX,l.cutY=this.cutY,l.cutWidth=this.cutWidth,l.cutHeight=this.cutHeight,l.x=this.x,l.y=this.y,l.width=this.width,l.height=this.height,l.halfWidth=this.halfWidth,l.halfHeight=this.halfHeight,l.centerX=this.centerX,l.centerY=this.centerY,l.rotated=this.rotated,l.data=h(!0,l.data,this.data),l.updateUVs(),l},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}}});s.exports=a},79237:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(4327),h=e(11876),a='Texture "%s" has no frame "%s"',l=new r({initialize:function(u,f,o,c,d){Array.isArray(o)||(o=[o]),this.manager=u,this.key=f,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var v=0;vc&&(c=m.cutX+m.cutWidth),m.cutY+m.cutHeight>d&&(d=m.cutY+m.cutHeight)}return{x:f,y:o,width:c-f,height:d-o}},getFrameNames:function(n){n===void 0&&(n=!1);var u=Object.keys(this.frames);if(!n){var f=u.indexOf("__BASE");f!==-1&&u.splice(f,1)}return u},getSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n];return u?u.source.image:(console.warn(a,this.key,n),this.frames.__BASE.source.image)},getDataSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n],f;return u?f=u.sourceIndex:(console.warn(a,this.key,n),f=this.frames.__BASE.sourceIndex),this.dataSource[f].image},setDataSource:function(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(57382),h=e(83419),a=e(40987),l=e(8054),n=e(81320),u=e(50792),f=e(69442),o=e(4327),c=e(8443),d=e(99584),v=e(35154),m=e(88571),S=e(41212),M=e(61309),w=e(87841),C=e(79237),A=new h({Extends:u,initialize:function(b){u.call(this),this.game=b,this.name="TextureManager",this.list={},this._tempCanvas=r.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new w,this.silentWarnings=!1,b.events.once(c.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(f.LOAD,this.updatePending,this),this.on(f.ERROR,this.updatePending,this);var P=this.game.config;this.addBase64("__DEFAULT",P.defaultImage),this.addBase64("__MISSING",P.missingImage),this.addBase64("__WHITE",P.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(c.DESTROY,this.destroy,this),this.game.events.once(c.SYSTEM_READY,function(b){this.stamp=new m(b).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(f.LOAD),this.off(f.ERROR),this.emit(f.READY))},checkKey:function(P){return this.exists(P)?(this.silentWarnings||console.error("Texture key already in use: "+P),!1):!0},remove:function(P){if(typeof P=="string")if(this.exists(P))P=this.get(P);else return this.silentWarnings||console.warn("No texture found matching key: "+P),this;var b=P.key;return this.list.hasOwnProperty(b)&&(P.destroy(),this.emit(f.REMOVE,b),this.emit(f.REMOVE_KEY+b)),this},removeKey:function(P){return this.list.hasOwnProperty(P)&&delete this.list[P],this},addBase64:function(P,b){if(this.checkKey(P)){var O=this,I=new Image;I.onerror=function(){O.emit(f.ERROR,P)},I.onload=function(){var D=O.create(P,I);M.Image(D,0),O.emit(f.ADD,P,D),O.emit(f.ADD_KEY+P,D),O.emit(f.LOAD,P,D)},I.src=b}return this},getBase64:function(P,b,O,I){O===void 0&&(O="image/png"),I===void 0&&(I=.92);var D="",B=this.getFrame(P,b);if(B&&(B.source.isRenderTexture||B.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(B){var G=B.canvasData,z=r.create2D(this,G.width,G.height),X=z.getContext("2d",{willReadFrequently:!0});G.width>0&&G.height>0&&X.drawImage(B.source.image,G.x,G.y,G.width,G.height,0,0,G.width,G.height),D=z.toDataURL(O,I),r.remove(z)}return D},addImage:function(P,b,O){var I=null;return this.checkKey(P)&&(I=this.create(P,b),M.Image(I,0),O&&I.setDataSource(O),this.emit(f.ADD,P,I),this.emit(f.ADD_KEY+P,I)),I},addGLTexture:function(P,b){var O=null;if(this.checkKey(P)){var I=b.width,D=b.height;O=this.create(P,b,I,D),O.add("__BASE",0,0,0,I,D),this.emit(f.ADD,P,O),this.emit(f.ADD_KEY+P,O)}return O},addCompressedTexture:function(P,b,O){var I=null;if(this.checkKey(P)){if(I=this.create(P,b),I.add("__BASE",0,0,0,b.width,b.height),O){var D=function(G,z,X){Array.isArray(X.textures)||Array.isArray(X.frames)?M.JSONArray(G,z,X):M.JSONHash(G,z,X)};if(Array.isArray(O))for(var B=0;B=B.x&&P=B.y&&b=B.x&&P=B.y&&b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(83419),h=e(50030),a=e(29795),l=e(82751),n=new p({initialize:function(f,o,c,d,v){v===void 0&&(v=!1);var m=f.manager.game;this.renderer=m.renderer,this.texture=f,this.source=o,this.image=o.compressed?null:o,this.compressionAlgorithm=o.compressed?o.format:null,this.resolution=1,this.width=c||o.naturalWidth||o.videoWidth||o.width||0,this.height=d||o.naturalHeight||o.videoHeight||o.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=o instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&o instanceof HTMLVideoElement,this.isRenderTexture=o.type==="RenderTexture"||o.type==="DynamicTexture",this.isGLTexture=o instanceof l,this.isPowerOf2=h(this.width,this.height),this.glTexture=null,this.flipY=v,this.init(m)},init:function(u){var f=this.renderer;if(f){var o=this.source;if(f.gl){var c=this.image,d=this.flipY,v=this.width,m=this.height,S=this.scaleMode;this.isCanvas?this.glTexture=f.createCanvasTexture(c,!1,d):this.isVideo?this.glTexture=f.createVideoTexture(c,!1,d):this.isRenderTexture?this.glTexture=f.createTextureFromSource(null,v,m,S):this.isGLTexture?this.glTexture=o:this.compressionAlgorithm?this.glTexture=f.createTextureFromSource(o,void 0,void 0,S):o instanceof Uint8Array?this.glTexture=f.createUint8ArrayTexture(o,v,m,S):this.glTexture=f.createTextureFromSource(c,v,m,S)}else this.isRenderTexture&&(this.image=o.canvas)}u.config.antialias||this.setFilter(1)},setFilter:function(u){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,u),this.scaleMode=u},setFlipY:function(u){return u===void 0&&(u=!0),u===this.flipY?this:(this.flipY=u,this.update(),this)},update:function(){var u=this.renderer,f=this.image,o=this.flipY,c=u.gl;c&&this.isCanvas?u.updateCanvasTexture(f,this.glTexture,o):c&&this.isVideo&&u.updateVideoTexture(f,this.glTexture,o)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&r.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});s.exports=n},19673:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={LINEAR:0,NEAREST:1};s.exports=y},44538:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addtexture"},63486:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addtexture-"},94851:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="onerror"},29099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="onload"},8678:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},86415:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removetexture"},30879:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removetexture-"},69442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(44538),ADD_KEY:e(63486),ERROR:e(94851),LOAD:e(29099),READY:e(8678),REMOVE:e(86415),REMOVE_KEY:e(30879)}},27458:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(19673),h={CanvasTexture:e(57382),DynamicTexture:e(81320),Events:e(69442),FilterMode:p,Frame:e(4327),Parsers:e(61309),Texture:e(79237),TextureManager:e(17130),TextureSource:e(11876)};h=r(!1,h,p),s.exports=h},89905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(!p.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var h=e.source[r];e.add("__BASE",r,0,0,h.width,h.height);for(var a=p.getElementsByTagName("SubTexture"),l,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.source[r];return e.add("__BASE",r,0,0,p.width,p.height),e};s.exports=y},4832:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.source[r];return e.add("__BASE",r,0,0,p.width,p.height),e};s.exports=y},78566:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a,l){if(!l.frames&&!l.textures){console.warn("Invalid Texture Atlas JSON Array");return}var n=h.source[a];h.add("__BASE",a,0,0,n.width,n.height);for(var u=Array.isArray(l.textures)?l.textures[a].frames:l.frames,f,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a,l){if(!l.frames){console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object");return}var n=h.source[a];h.add("__BASE",a,0,0,n.width,n.height);var u=l.frames,f;for(var o in u)if(u.hasOwnProperty(o)){var c=u[o];if(f=h.add(o,a,c.frame.x,c.frame.y,c.frame.w,c.frame.h),!f){console.warn("Invalid atlas json, frame already exists: "+o);continue}c.trimmed&&f.setTrim(c.sourceSize.w,c.sourceSize.h,c.spriteSourceSize.x,c.spriteSourceSize.y,c.spriteSourceSize.w,c.spriteSourceSize.h),c.rotated&&(f.rotated=!0,f.updateUVsInverted());var d=c.anchor||c.pivot;d&&(f.customPivot=!0,f.pivotX=d.x,f.pivotY=d.y),c.scale9Borders&&f.setScale9(c.scale9Borders.x,c.scale9Borders.y,c.scale9Borders.w,c.scale9Borders.h),f.customData=r(c)}for(var v in l)v!=="frames"&&(Array.isArray(l[v])?h.customData[v]=l[v].slice(0):h.customData[v]=l[v]);return h};s.exports=p},31403:s=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=[171,75,84,88,32,49,49,187,13,10,26,10],p,h=new Uint8Array(e,0,12);for(p=0;p>1),w=Math.max(1,w>>1),S+=C}return{mipmaps:m,width:o,height:c,internalFormat:f,compressed:!0,generateMipmap:!1}};s.exports=y},82038:s=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(b,O,I,D,B,G,z){return z===void 0&&(z=16),Math.floor((b+I)/B)*Math.floor((O+D)/G)*z}function e(b,O){return b=Math.max(b,16),O=Math.max(O,8),b*O/4}function r(b,O){return b=Math.max(b,8),O=Math.max(O,8),b*O/2}function p(b,O){return Math.ceil(b/4)*Math.ceil(O/4)*16}function h(b,O){return y(b,O,3,3,4,4,8)}function a(b,O){return y(b,O,3,3,4,4)}function l(b,O){return y(b,O,4,3,5,4)}function n(b,O){return y(b,O,4,4,5,5)}function u(b,O){return y(b,O,5,4,6,5)}function f(b,O){return y(b,O,5,5,6,6)}function o(b,O){return y(b,O,7,4,8,5)}function c(b,O){return y(b,O,7,5,8,6)}function d(b,O){return y(b,O,7,7,8,8)}function v(b,O){return y(b,O,9,4,10,5)}function m(b,O){return y(b,O,9,5,10,6)}function S(b,O){return y(b,O,9,7,10,8)}function M(b,O){return y(b,O,9,9,10,10)}function w(b,O){return y(b,O,11,9,12,10)}function C(b,O){return y(b,O,11,11,12,12)}var A={0:{sizeFunc:e,glFormat:[35841]},1:{sizeFunc:e,glFormat:[35843]},2:{sizeFunc:r,glFormat:[35840]},3:{sizeFunc:r,glFormat:[35842]},6:{sizeFunc:h,glFormat:[36196]},7:{sizeFunc:h,glFormat:[33776,35916]},8:{sizeFunc:a,glFormat:[33777,35917]},9:{sizeFunc:a,glFormat:[33778,35918]},11:{sizeFunc:a,glFormat:[33779,35919]},14:{sizeFunc:p,glFormat:[36494,36495]},15:{sizeFunc:p,glFormat:[36492,36493]},22:{sizeFunc:h,glFormat:[37492,37493]},23:{sizeFunc:a,glFormat:[37496,37497]},24:{sizeFunc:h,glFormat:[37494,37495]},25:{sizeFunc:h,glFormat:[37488]},26:{sizeFunc:a,glFormat:[37490]},27:{sizeFunc:a,glFormat:[37808,37840]},28:{sizeFunc:l,glFormat:[37809,37841]},29:{sizeFunc:n,glFormat:[37810,37842]},30:{sizeFunc:u,glFormat:[37811,37843]},31:{sizeFunc:f,glFormat:[37812,37844]},32:{sizeFunc:o,glFormat:[37813,37845]},33:{sizeFunc:c,glFormat:[37814,37846]},34:{sizeFunc:d,glFormat:[37815,37847]},35:{sizeFunc:v,glFormat:[37816,37848]},36:{sizeFunc:m,glFormat:[37817,37849]},37:{sizeFunc:S,glFormat:[37818,37850]},38:{sizeFunc:M,glFormat:[37819,37851]},39:{sizeFunc:w,glFormat:[37820,37852]},40:{sizeFunc:C,glFormat:[37821,37853]}},P=function(b){for(var O=new Uint32Array(b,0,13),I=O[0],D=I===55727696,B=D?O[2]:O[3],G=O[4],z=A[B].glFormat[G],X=A[B].sizeFunc,j=O[11],Q=O[7],tt=O[6],Y=52+O[12],Z=new Uint8Array(b,Y),U=new Array(j),H=0,J=Q,_=tt,q=0;q>1),_=Math.max(1,_>>1),H+=at}return{mipmaps:U,width:Q,height:tt,internalFormat:z,compressed:!0,generateMipmap:!1}};s.exports=P},75549:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l,n,u,f,o){var c=r(o,"frameWidth",null),d=r(o,"frameHeight",c);if(c===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var v=h.source[a];h.add("__BASE",a,0,0,v.width,v.height);var m=r(o,"startFrame",0),S=r(o,"endFrame",-1),M=r(o,"margin",0),w=r(o,"spacing",0),C=Math.floor((u-M+w)/(c+w)),A=Math.floor((f-M+w)/(d+w)),P=C*A;P===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",h.key),(m>P||m<-P)&&(m=0),m<0&&(m=P+m),(S===-1||S>P||Su&&(I=z-u),X>f&&(D=X-f),G>=m&&G<=S&&(h.add(B,a,l+b,n+O,c-I,d-D),B++),b+=c+w,b+c>u&&(b=M,O+=d+w)}return h};s.exports=p},47534:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l){var n=r(l,"frameWidth",null),u=r(l,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var f=h.source[0];h.add("__BASE",0,0,0,f.width,f.height),r(l,"startFrame",0),r(l,"endFrame",-1);for(var o=r(l,"margin",0),c=r(l,"spacing",0),d=a.cutX,v=a.cutY,m=a.cutWidth,S=a.cutHeight,M=a.realWidth,w=a.realHeight,C=Math.floor((M-o+c)/(n+c)),A=Math.floor((w-o+c)/(u+c)),P=a.x,b=n-P,O=n-(M-m-P),I=a.y,D=u-I,B=u-(w-S-I),G,z=o,X=o,j=0,Q=0,tt=0;tt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=0,e=function(p,h,a,l){var n=y-l.y-l.height;p.add(a,h,l.x,n,l.width,l.height)},r=function(p,h,a){var l=p.source[h];p.add("__BASE",h,0,0,l.width,l.height),y=l.height;for(var n=a.split(` +`),u=/^[ ]*(- )*(\w+)+[: ]+(.*)/,f="",o="",c={x:0,y:0,width:0,height:0},d=0;d{/** + * @author Ben Richards + * @copyright 2024 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(50030),p=function(f){for(var o=f.mipmaps,c=1;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AtlasXML:e(89905),Canvas:e(72893),Image:e(4832),JSONArray:e(78566),JSONHash:e(39711),KTXParser:e(31403),PVRParser:e(82038),SpriteSheet:e(75549),SpriteSheetFromAtlas:e(47534),UnityYAML:e(86147)}},80341:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o,c){(n===void 0||n<=0)&&(n=32),(u===void 0||u<=0)&&(u=32),f===void 0&&(f=0),o===void 0&&(o=0),this.name=a,this.firstgid=l|0,this.imageWidth=n|0,this.imageHeight=u|0,this.imageMargin=f|0,this.imageSpacing=o|0,this.properties=c||{},this.images=[],this.total=0},containsImageIndex:function(h){return h>=this.firstgid&&h{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){if(this.gids=[],a!==void 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 r=e(80341),p=e(87010),h=e(46177),a=e(49075),l=function(n,u,f,o,c,d,v,m){f===void 0&&(f=32),o===void 0&&(o=32),c===void 0&&(c=10),d===void 0&&(d=10),m===void 0&&(m=!1);var S=null;if(Array.isArray(v)){var M=u!==void 0?u:"map";S=h(M,r.ARRAY_2D,v,f,o,m)}else if(u!==void 0){var w=n.cache.tilemap.get(u);w?S=h(u,w.format,w.data,f,o,m):console.warn("No map data found for key "+u)}return S===null&&(S=new p({tileWidth:f,tileHeight:o,width:c,height:d})),new a(n,S)};s.exports=l},23029:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(91907),a=e(62644),l=e(93232),n=new r({Mixins:[p.AlphaSingle,p.Flip,p.Visible],initialize:function(f,o,c,d,v,m,S,M){this.layer=f,this.index=o,this.x=c,this.y=d,this.width=v,this.height=m,this.right,this.bottom,this.baseWidth=S!==void 0?S:v,this.baseHeight=M!==void 0?M:m,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(u,f){return!(uthis.right||f>this.bottom)},copy:function(u){return this.index=u.index,this.alpha=u.alpha,this.properties=a(u.properties),this.visible=u.visible,this.setFlip(u.flipX,u.flipY),this.tint=u.tint,this.rotation=u.rotation,this.collideUp=u.collideUp,this.collideDown=u.collideDown,this.collideLeft=u.collideLeft,this.collideRight=u.collideRight,this.collisionCallback=u.collisionCallback,this.collisionCallbackContext=u.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(u){var f=this.tilemapLayer;if(f){var o=f.tileToWorldXY(this.x,this.y,void 0,u);return o.x}return this.x*this.baseWidth},getRight:function(u){var f=this.tilemapLayer;return f?this.getLeft(u)+this.width*f.scaleX:this.getLeft(u)+this.width},getTop:function(u){var f=this.tilemapLayer;if(f){var o=f.tileToWorldXY(this.x,this.y,void 0,u);return o.y}return this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(u){var f=this.tilemapLayer;return f?this.getTop(u)+this.height*f.scaleY:this.getTop(u)+this.height},getBounds:function(u,f){return f===void 0&&(f=new l),f.x=this.getLeft(u),f.y=this.getTop(u),f.width=this.getRight(u)-f.x,f.height=this.getBottom(u)-f.y,f},getCenterX:function(u){return(this.getLeft(u)+this.getRight(u))/2},getCenterY:function(u){return(this.getTop(u)+this.getBottom(u))/2},intersects:function(u,f,o,c){return!(o<=this.pixelX||c<=this.pixelY||u>=this.right||f>=this.bottom)},isInteresting:function(u,f){return u&&f?this.canCollide||this.hasInterestingFace:u?this.collides:f?this.hasInterestingFace:!1},resetCollision:function(u){if(u===void 0&&(u=!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,u){var f=this.tilemapLayer;f&&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(u,f,o,c,d){if(f===void 0&&(f=u),o===void 0&&(o=u),c===void 0&&(c=u),d===void 0&&(d=!0),this.collideLeft=u,this.collideRight=f,this.collideUp=o,this.collideDown=c,this.faceLeft=u,this.faceRight=f,this.faceTop=o,this.faceBottom=c,d){var v=this.tilemapLayer;v&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},setCollisionCallback:function(u,f){return u===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=u,this.collisionCallbackContext=f),this},setSize:function(u,f,o,c){return u!==void 0&&(this.width=u),f!==void 0&&(this.height=f),o!==void 0&&(this.baseWidth=o),c!==void 0&&(this.baseHeight=c),this.updatePixelXY(),this},updatePixelXY:function(){var u=this.layer.orientation;if(u===h.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(u===h.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(u===h.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(u===h.HEXAGONAL){var f=this.layer.staggerAxis,o=this.layer.staggerIndex,c=this.layer.hexSideLength,d,v;f==="y"?(v=(this.baseHeight-c)/2+c,o==="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*v):f==="x"&&(d=(this.baseWidth-c)/2+c,this.pixelX=this.x*d,o==="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 u=this.layer.tilemapLayer;if(u){var f=u.gidMap[this.index];if(f)return f}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var u=this.tilemapLayer;return u?u.tilemap:null}}});s.exports=n},49075:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84101),p=e(83419),h=e(39506),a=e(80341),l=e(95540),n=e(14977),u=e(27462),f=e(91907),o=e(36305),c=e(19133),d=e(68287),v=e(23029),m=e(81086),S=e(20442),M=e(33629),w=new p({initialize:function(A,P){this.scene=A,this.tileWidth=P.tileWidth,this.tileHeight=P.tileHeight,this.width=P.width,this.height=P.height,this.orientation=P.orientation,this.renderOrder=P.renderOrder,this.format=P.format,this.version=P.version,this.properties=P.properties,this.widthInPixels=P.widthInPixels,this.heightInPixels=P.heightInPixels,this.imageCollections=P.imageCollections,this.images=P.images,this.layers=P.layers,this.tiles=P.tiles,this.tilesets=P.tilesets,this.objects=P.objects,this.currentLayerIndex=0,this.hexSideLength=P.hexSideLength;var b=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(b),WorldToTileX:m.GetWorldToTileXFunction(b),WorldToTileY:m.GetWorldToTileYFunction(b),TileToWorldXY:m.GetTileToWorldXYFunction(b),TileToWorldX:m.GetTileToWorldXFunction(b),TileToWorldY:m.GetTileToWorldYFunction(b),GetTileCorners:m.GetTileCornersFunction(b)}},setRenderOrder:function(C){var A=["right-down","left-down","right-up","left-up"];return typeof C=="number"&&(C=A[C]),A.indexOf(C)>-1&&(this.renderOrder=C),this},addTilesetImage:function(C,A,P,b,O,I,D,B){if(C===void 0)return null;A==null&&(A=C);var G=this.scene.sys.textures;if(!G.exists(A))return console.warn('Texture key "%s" not found',A),null;var z=G.get(A),X=this.getTilesetIndex(C);if(X===null&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',C,this.tilesets),null;var j=this.tilesets[X];return j?(j.setTileSize(P,b),j.setSpacing(O,I),j.setImage(z),j):(P===void 0&&(P=this.tileWidth),b===void 0&&(b=this.tileHeight),O===void 0&&(O=0),I===void 0&&(I=0),D===void 0&&(D=0),B===void 0&&(B={x:0,y:0}),j=new M(C,D,P,b,O,I,void 0,void 0,B),j.setImage(z),this.tilesets.push(j),this.tiles=r(this),j)},copy:function(C,A,P,b,O,I,D,B){return B=this.getLayer(B),B!==null?(m.Copy(C,A,P,b,O,I,D,B),this):null},createBlankLayer:function(C,A,P,b,O,I,D,B){P===void 0&&(P=0),b===void 0&&(b=0),O===void 0&&(O=this.width),I===void 0&&(I=this.height),D===void 0&&(D=this.tileWidth),B===void 0&&(B=this.tileHeight);var G=this.getLayerIndex(C);if(G!==null)return console.warn("Invalid Tilemap Layer ID: "+C),null;for(var z=new n({name:C,tileWidth:D,tileHeight:B,width:O,height:I,orientation:this.orientation}),X,j=0;j-1&&this.putTileAt(A,I.x,I.y,P,I.tilemapLayer)}return b},removeTileAt:function(C,A,P,b,O){return P===void 0&&(P=!0),b===void 0&&(b=!0),O=this.getLayer(O),O===null?null:m.RemoveTileAt(C,A,P,b,O)},removeTileAtWorldXY:function(C,A,P,b,O,I){return P===void 0&&(P=!0),b===void 0&&(b=!0),I=this.getLayer(I),I===null?null:m.RemoveTileAtWorldXY(C,A,P,b,O,I)},renderDebug:function(C,A,P){return P=this.getLayer(P),P===null?null:(this.orientation===f.ORTHOGONAL&&m.RenderDebug(C,A,P),this)},renderDebugFull:function(C,A){for(var P=this.layers,b=0;b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(31989);r.register("tilemap",function(h){var a=h!==void 0?h:{};return p(this.scene,a.key,a.tileWidth,a.tileHeight,a.width,a.height,a.data,a.insertNull)})},46029:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(31989);r.register("tilemap",function(h,a,l,n,u,f,o){return h===null&&(h=void 0),a===null&&(a=void 0),l===null&&(l=void 0),n===null&&(n=void 0),u===null&&(u=void 0),p(this.scene,h,a,l,n,u,f,o)})},20442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(78389),h=e(31401),a=e(95643),l=e(81086),n=e(19218),u=e(26099),f=new r({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.Transform,h.Visible,h.ScrollFactor,p,n],initialize:function(c,d,v,m,S,M){a.call(this,c,"TilemapLayer"),this.isTilemap=!0,this.tilemap=d,this.layerIndex=v,this.layer=d.layers[v],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=l.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new u,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(m),this.setAlpha(this.layer.alpha),this.setPosition(S,M),this.setOrigin(0,0),this.setSize(d.tileWidth*this.layer.width,d.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(o){var c=[],d=[],v=this.tilemap;Array.isArray(o)||(o=[o]);for(var m=0;m=0&&o<4&&(this._renderOrder=o),this},calculateFacesAt:function(o,c){return l.CalculateFacesAt(o,c,this.layer),this},calculateFacesWithin:function(o,c,d,v){return l.CalculateFacesWithin(o,c,d,v,this.layer),this},createFromTiles:function(o,c,d,v,m){return l.CreateFromTiles(o,c,d,v,m,this.layer)},cull:function(o){return this.cullCallback(this.layer,o,this.culledTiles,this._renderOrder)},copy:function(o,c,d,v,m,S,M){return l.Copy(o,c,d,v,m,S,M,this.layer),this},fill:function(o,c,d,v,m,S){return l.Fill(o,c,d,v,m,S,this.layer),this},filterTiles:function(o,c,d,v,m,S,M){return l.FilterTiles(o,c,d,v,m,S,M,this.layer)},findByIndex:function(o,c,d){return l.FindByIndex(o,c,d,this.layer)},findTile:function(o,c,d,v,m,S,M){return l.FindTile(o,c,d,v,m,S,M,this.layer)},forEachTile:function(o,c,d,v,m,S,M){return l.ForEachTile(o,c,d,v,m,S,M,this.layer),this},setTint:function(o,c,d,v,m,S){o===void 0&&(o=16777215);var M=function(w){w.tint=o,w.tintFill=!1};return this.forEachTile(M,this,c,d,v,m,S)},setTintFill:function(o,c,d,v,m,S){o===void 0&&(o=16777215);var M=function(w){w.tint=o,w.tintFill=!0};return this.forEachTile(M,this,c,d,v,m,S)},getTileAt:function(o,c,d){return l.GetTileAt(o,c,d,this.layer)},getTileAtWorldXY:function(o,c,d,v){return l.GetTileAtWorldXY(o,c,d,v,this.layer)},getIsoTileAtWorldXY:function(o,c,d,v,m){d===void 0&&(d=!0);var S=this.tempVec;return l.IsometricWorldToTileXY(o,c,!0,S,m,this.layer,d),this.getTileAt(S.x,S.y,v)},getTilesWithin:function(o,c,d,v,m){return l.GetTilesWithin(o,c,d,v,m,this.layer)},getTilesWithinShape:function(o,c,d){return l.GetTilesWithinShape(o,c,d,this.layer)},getTilesWithinWorldXY:function(o,c,d,v,m,S){return l.GetTilesWithinWorldXY(o,c,d,v,m,S,this.layer)},hasTileAt:function(o,c){return l.HasTileAt(o,c,this.layer)},hasTileAtWorldXY:function(o,c,d){return l.HasTileAtWorldXY(o,c,d,this.layer)},putTileAt:function(o,c,d,v){return l.PutTileAt(o,c,d,v,this.layer)},putTileAtWorldXY:function(o,c,d,v,m){return l.PutTileAtWorldXY(o,c,d,v,m,this.layer)},putTilesAt:function(o,c,d,v){return l.PutTilesAt(o,c,d,v,this.layer),this},randomize:function(o,c,d,v,m){return l.Randomize(o,c,d,v,m,this.layer),this},removeTileAt:function(o,c,d,v){return l.RemoveTileAt(o,c,d,v,this.layer)},removeTileAtWorldXY:function(o,c,d,v,m){return l.RemoveTileAtWorldXY(o,c,d,v,m,this.layer)},renderDebug:function(o,c){return l.RenderDebug(o,c,this.layer),this},replaceByIndex:function(o,c,d,v,m,S){return l.ReplaceByIndex(o,c,d,v,m,S,this.layer),this},setSkipCull:function(o){return o===void 0&&(o=!0),this.skipCull=o,this},setCullPadding:function(o,c){return o===void 0&&(o=1),c===void 0&&(c=1),this.cullPaddingX=o,this.cullPaddingY=c,this},setCollision:function(o,c,d,v){return l.SetCollision(o,c,d,this.layer,v),this},setCollisionBetween:function(o,c,d,v){return l.SetCollisionBetween(o,c,d,v,this.layer),this},setCollisionByProperty:function(o,c,d){return l.SetCollisionByProperty(o,c,d,this.layer),this},setCollisionByExclusion:function(o,c,d){return l.SetCollisionByExclusion(o,c,d,this.layer),this},setCollisionFromCollisionGroup:function(o,c){return l.SetCollisionFromCollisionGroup(o,c,this.layer),this},setTileIndexCallback:function(o,c,d){return l.SetTileIndexCallback(o,c,d,this.layer),this},setTileLocationCallback:function(o,c,d,v,m,S){return l.SetTileLocationCallback(o,c,d,v,m,S,this.layer),this},shuffle:function(o,c,d,v){return l.Shuffle(o,c,d,v,this.layer),this},swapByIndex:function(o,c,d,v,m,S){return l.SwapByIndex(o,c,d,v,m,S,this.layer),this},tileToWorldX:function(o,c){return this.tilemap.tileToWorldX(o,c,this)},tileToWorldY:function(o,c){return this.tilemap.tileToWorldY(o,c,this)},tileToWorldXY:function(o,c,d,v){return this.tilemap.tileToWorldXY(o,c,d,v,this)},getTileCorners:function(o,c,d){return this.tilemap.getTileCorners(o,c,d,this)},weightedRandomize:function(o,c,d,v,m){return l.WeightedRandomize(c,d,v,m,o,this.layer),this},worldToTileX:function(o,c,d){return this.tilemap.worldToTileX(o,c,d,this)},worldToTileY:function(o,c,d){return this.tilemap.worldToTileY(o,c,d,this)},worldToTileXY:function(o,c,d,v,m){return this.tilemap.worldToTileXY(o,c,d,v,m,this)},destroy:function(o){o===void 0&&(o=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),o&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});s.exports=f},16153:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=new r,h=new r,a=new r,l=function(n,u,f,o){var c=u.cull(f),d=c.length,v=f.alpha*u.alpha;if(!(d===0||v<=0)){var m=p,S=h,M=a;S.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),m.copyFrom(f.matrix);var w=n.currentContext,C=u.gidMap;w.save(),o?(m.multiplyWithOffset(o,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),S.e=u.x,S.f=u.y,m.multiply(S,M),M.copyToContext(w)):(S.e-=f.scrollX*u.scrollFactorX,S.f-=f.scrollY*u.scrollFactorY,S.copyToContext(w)),(!n.antialias||u.scaleX>1||u.scaleY>1)&&(w.imageSmoothingEnabled=!1);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99558),h=e(16153),s.exports={renderWebGL:p,renderCanvas:h}},99558:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l){var n=a.cull(l),u=n.length,f=l.alpha*a.alpha;if(!(u===0||f<=0)){var o=a.gidMap,c=h.pipelines.set(a.pipeline,a),d=r.getTintAppendFloatAlpha,v=a.scrollFactorX,m=a.scrollFactorY,S=a.x,M=a.y,w=a.scaleX,C=a.scaleY;h.pipelines.preBatch(a);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l,n,u,f,o,c,d,v,m){(u===void 0||u<=0)&&(u=32),(f===void 0||f<=0)&&(f=32),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d={}),v===void 0&&(v={}),this.name=l,this.firstgid=n,this.tileWidth=u,this.tileHeight=f,this.tileMargin=o,this.tileSpacing=c,this.tileProperties=d,this.tileData=v,this.tileOffset=new p,m!==void 0&&this.tileOffset.set(m.x,m.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(a){return this.containsTileIndex(a)?this.tileProperties[a-this.firstgid]:null},getTileData:function(a){return this.containsTileIndex(a)?this.tileData[a-this.firstgid]:null},getTileCollisionGroup:function(a){var l=this.getTileData(a);return l&&l.objectgroup?l.objectgroup:null},containsTileIndex:function(a){return a>=this.firstgid&&an.width||l.height>n.height?this.updateTileData(l.width,l.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(a,l){return a!==void 0&&(this.tileWidth=a),l!==void 0&&(this.tileHeight=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(a,l){return a!==void 0&&(this.tileMargin=a),l!==void 0&&(this.tileSpacing=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=0);var f=(l-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),o=(a-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(f%1!==0||o%1!==0)&&console.warn("Image tile area not tile size multiple in: "+this.name),f=Math.floor(f),o=Math.floor(o),this.rows=f,this.columns=o,this.total=f*o,this.texCoordinates.length=0;for(var c=this.tileMargin+n,d=this.tileMargin+u,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=function(h,a,l){var n=r(h,a,!0,l),u=r(h,a-1,!0,l),f=r(h,a+1,!0,l),o=r(h-1,a,!0,l),c=r(h+1,a,!0,l),d=n&&n.collides;return d&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),u&&u.collides&&(d&&(n.faceTop=!1),u.faceBottom=!d),f&&f.collides&&(d&&(n.faceBottom=!1),f.faceTop=!d),o&&o.collides&&(d&&(n.faceLeft=!1),o.faceRight=!d),c&&c.collides&&(d&&(n.faceRight=!1),c.faceLeft=!d),n&&!n.collides&&n.resetFaces(),n};s.exports=p},42573:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=e(7386),h=function(a,l,n,u,f){for(var o=null,c=null,d=null,v=null,m=p(a,l,n,u,null,f),S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=new r,h=function(a,l,n,u){var f=n.tilemapLayer,o=f.cullPaddingX,c=f.cullPaddingY,d=f.tilemap.tileToWorldXY(a,l,p,u,f);return d.x>u.worldView.x+f.scaleX*n.tileWidth*(-o-.5)&&d.xu.worldView.y+f.scaleY*n.tileHeight*(-c-1)&&d.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42573),p=e(7386),h=e(62991),a=e(23029),l=function(n,u,f,o,c,d,v,m){v===void 0&&(v=!0);var S=p(n,u,f,o,null,m),M=[];S.forEach(function(I){var D=new a(I.layer,I.index,I.x,I.y,I.width,I.height,I.baseWidth,I.baseHeight);D.copy(I),M.push(D)});for(var w=c-n,C=d-u,A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p=e(7386),h=e(27987),a=function(l,n,u,f,o,c){u||(u={}),Array.isArray(l)||(l=[l]);var d=c.tilemapLayer;f||(f=d.scene),o||(o=f.cameras.main);var v=c.width,m=c.height,S=p(0,0,v,m,null,c),M=[],w,C=function(O,I,D){for(var B=0;B{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(63448),h=e(56583),a=new r,l=function(n,u){var f=n.tilemapLayer.tilemap,o=n.tilemapLayer,c=Math.floor(f.tileWidth*o.scaleX),d=Math.floor(f.tileHeight*o.scaleY),v=h(u.worldView.x-o.x,c,0,!0)-o.cullPaddingX,m=p(u.worldView.right-o.x,c,0,!0)+o.cullPaddingX,S=h(u.worldView.y-o.y,d,0,!0)-o.cullPaddingY,M=p(u.worldView.bottom-o.y,d,0,!0)+o.cullPaddingY;return a.setTo(v,S,m-v,M-S)};s.exports=l},30003:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19545),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return(f.skipCull||f.scrollFactorX!==1||f.scrollFactorY!==1)&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},35137:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(42573),h=e(20576),a=function(l,n,u,f,o,c,d){for(var v=d.collideIndexes.indexOf(l)!==-1,m=r(n,u,f,o,null,d),S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);return d.filter(h,a)};s.exports=p},52692:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=0),p===void 0&&(p=!1);var a=0,l,n,u;if(p){for(n=h.height-1;n>=0;n--)for(l=h.width-1;l>=0;l--)if(u=h.data[n][l],u&&u.index===e){if(a===r)return u;a+=1}}else for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);return d.find(h,a)||null};s.exports=p},97560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);d.forEach(h,a)};s.exports=p},43305:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(30003),h=e(9474),a=e(14018),l=e(29747),n=e(54503),u=function(f){return f===r.ORTHOGONAL?p:f===r.HEXAGONAL?h:f===r.STAGGERED?n:f===r.ISOMETRIC?a:l};s.exports=u},7423:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62991),p=function(h,a,l,n){if(l===void 0&&(l=!1),r(h,a,n)){var u=n.data[a][h]||null;return u?u.index===-1?l?u:null:u:null}else return null};s.exports=p},60540:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=e(26099),h=new p,a=function(l,n,u,f,o){return o.tilemapLayer.worldToTileXY(l,n,!0,h,f),r(h.x,h.y,u,o)};s.exports=a},55826:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n){var u=n.baseTileWidth,f=n.baseTileHeight,o=n.tilemapLayer,c=0,d=0;o&&(l||(l=o.scene.cameras.main),c=o.x+l.scrollX*(1-o.scrollFactorX),d=o.y+l.scrollY*(1-o.scrollFactorY),u*=o.scaleX,f*=o.scaleY);var v=c+h*u,m=d+a*f;return[new r(v,m),new r(v+u,m),new r(v+u,m+f),new r(v,m+f)]};s.exports=p},11758:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(27229),h=e(29747),a=e(55826),l=function(n){return n===r.ORTHOGONAL?a:n===r.ISOMETRIC?h:n===r.HEXAGONAL?p:(n===r.STAGGERED,h)};s.exports=l},39167:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(29747),h=e(97281),a=function(l){return l===r.ORTHOGONAL?h:p};s.exports=a},62e3:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(19951),h=e(14127),a=e(29747),l=e(97202),n=e(70326),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:a};s.exports=u},5984:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(29747),h=e(28054),a=e(29650),l=function(n){return n===r.ORTHOGONAL?a:n===r.STAGGERED?h:p};s.exports=l},7386:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l,n,u,f){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=f.width),n===void 0&&(n=f.height),u||(u={});var o=r(u,"isNotEmpty",!1),c=r(u,"isColliding",!1),d=r(u,"hasInterestingFace",!1);h<0&&(l+=h,h=0),a<0&&(n+=a,a=0),h+l>f.width&&(l=Math.max(f.width-h,0)),a+n>f.height&&(n=Math.max(f.height-a,0));for(var v=[],m=a;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55738),p=e(7386),h=e(91865),a=e(29747),l=e(26099),n=function(d,v){return h.RectangleToTriangle(v,d)},u=new l,f=new l,o=new l,c=function(d,v,m,S){if(d===void 0)return[];var M=a;d instanceof r.Circle?M=h.CircleToRectangle:d instanceof r.Rectangle?M=h.RectangleToRectangle:d instanceof r.Triangle?M=n:d instanceof r.Line&&(M=h.LineToRectangle),S.tilemapLayer.worldToTileXY(d.left,d.top,!0,f,m);var w=f.x,C=f.y;S.tilemapLayer.worldToTileXY(d.right,d.bottom,!1,o,m);var A=Math.ceil(o.x),P=Math.ceil(o.y),b=Math.max(A-w,1),O=Math.max(P-C,1),I=p(w,C,b,O,v,S),D=S.tileWidth,B=S.tileHeight;S.tilemapLayer&&(D*=S.tilemapLayer.scaleX,B*=S.tilemapLayer.scaleY);for(var G=[],z=new r.Rectangle(0,0,D,B),X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(26099),h=new p,a=new p,l=function(n,u,f,o,c,d,v){var m=v.tilemapLayer.tilemap._convert.WorldToTileXY;m(n,u,!0,h,d,v);var S=h.x,M=h.y;m(n+f,u+o,!1,a,d,v);var w=Math.ceil(a.x),C=Math.ceil(a.y);return r(S,M,w-S,C-M,c,v)};s.exports=l},96113:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(20242),h=e(10095),a=function(l){return l===r.ORTHOGONAL?h:p};s.exports=a},16926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(86625),h=e(96897),a=e(29747),l=e(15108),n=e(85896),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:a};s.exports=u},55762:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(20242),h=e(51900),a=e(63288),l=function(n){return n===r.ORTHOGONAL?a:n===r.STAGGERED?h:p};s.exports=l},45091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62991),p=function(h,a,l){if(r(h,a,l)){var n=l.data[a][h];return n!==null&&n.index>-1}else return!1};s.exports=p},24152:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45091),p=e(26099),h=new p,a=function(l,n,u,f){f.tilemapLayer.worldToTileXY(l,n,!0,h,u);var o=h.x,c=h.y;return r(o,c,f)};s.exports=a},90454:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63448),p=e(56583),h=function(a,l){var n=a.tilemapLayer.tilemap,u=a.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),o=Math.floor(n.tileHeight*u.scaleY),c=a.hexSideLength,d,v,m,S;if(a.staggerAxis==="y"){var M=(o-c)/2+c;d=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,M,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,M,0,!0)+u.cullPaddingY}else{var w=(f-c)/2+c;d=p(l.worldView.x-u.x,w,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,w,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,o,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,o,0,!0)+u.cullPaddingY}return{left:d,right:v,top:m,bottom:S}};s.exports=h},9474:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90454),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},27229:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19951),p=e(26099),h=new p,a=function(l,n,u,f){var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(o*=d.scaleX,c*=d.scaleY);var v=r(l,n,h,u,f),m=[],S=.5773502691896257,M,w;f.staggerAxis==="y"?(M=S*o,w=c/2):(M=o/2,w=S*c);for(var C=0;C<6;C++){var A=2*Math.PI*(.5-C)/6;m.push(new p(v.x+M*Math.cos(A),v.y+w*Math.sin(A)))}return m};s.exports=a},19951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),v=c.y+n.scrollY*(1-c.scrollFactorY),f*=c.scaleX,o*=c.scaleY);var m=f/2,S=o/2,M,w;return u.staggerAxis==="y"?(M=d+f*h+f,w=v+1.5*a*S+S,a%2===0&&(this.staggerIndex==="odd"?M-=m:M+=m)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(M=d+1.5*h*m+m,w=v+o*h+o,h%2===0&&(this.staggerIndex==="odd"?w-=S:w+=S)),l.set(M,w)};s.exports=p},86625:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),o*=d.scaleX,c*=d.scaleY);var v=.5773502691896257,m=-.3333333333333333,S=0,M=.6666666666666666,w=o/2,C=c/2,A,P,b,O,I;f.staggerAxis==="y"?(A=(h-w)/(v*o),P=(a-C)/C,b=v*A+m*P,O=S*A+M*P):(A=(h-w)/w,P=(a-C)/(v*c),b=m*A+v*P,O=M*A+S*P),I=-b-O;var D=Math.round(b),B=Math.round(O),G=Math.round(I),z=Math.abs(D-b),X=Math.abs(B-O),j=Math.abs(G-I);z>X&&z>j?D=-B-G:X>j&&(B=-D-G);var Q,tt=B;return f.staggerIndex==="odd"?Q=tt%2===0?B/2+D:B/2+D-.5:Q=tt%2===0?B/2+D:B/2+D+.5,n.set(Q,tt)};s.exports=p},62991:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e>=0&&e=0&&r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33528),p=function(h,a,l,n){l===void 0&&(l=[]),n===void 0&&(n=0),l.length=0;var u=h.tilemapLayer,f=h.data,o=h.width,c=h.height,d=u.skipCull,v=0,m=o,S=0,M=c,w,C,A;if(n===0)for(C=S;C=v;w--)A=f[C][w],!(!A||A.index===-1||!A.visible||A.alpha===0)&&(!d&&!r(w,C,h,a)||l.push(A));else if(n===2)for(C=M;C>=S;C--)for(w=v;w=S;C--)for(w=m;w>=v;w--)A=f[C][w],!(!A||A.index===-1||!A.visible||A.alpha===0)&&(!d&&!r(w,C,h,a)||l.push(A));return u.tilesDrawn=l.length,u.tilesTotal=o*c,l};s.exports=p},14127:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),o*=c.scaleY);var m=d+(h-a)*(f/2),S=v+(h+a)*(o/2);return l.set(m,S)};s.exports=p},96897:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f,o){n||(n=new r);var c=f.baseTileWidth,d=f.baseTileHeight,v=f.tilemapLayer;v&&(u||(u=v.scene.cameras.main),a=a-(v.y+u.scrollY*(1-v.scrollFactorY)),d*=v.scaleY,h=h-(v.x+u.scrollX*(1-v.scrollFactorX)),c*=v.scaleX);var m=c/2,S=d/2;h=h-m,o||(a=a-d);var M=.5*(h/m+a/S),w=.5*(-h/m+a/S);return l&&(M=Math.floor(M),w=Math.floor(w)),n.set(M,w)};s.exports=p},71558:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23029),p=e(62991),h=e(72023),a=e(20576),l=function(n,u,f,o,c){if(o===void 0&&(o=!0),!p(u,f,c))return null;var d,v=c.data[f][u],m=v&&v.collides;n instanceof r?(c.data[f][u]===null&&(c.data[f][u]=new r(c,n.index,u,f,c.tileWidth,c.tileHeight)),c.data[f][u].copy(n)):(d=n,c.data[f][u]===null?c.data[f][u]=new r(c,d,u,f,c.tileWidth,c.tileHeight):c.data[f][u].index=d);var S=c.data[f][u],M=c.collideIndexes.indexOf(S.index)!==-1;if(d=n instanceof r?n.index:n,d===-1)S.width=c.tileWidth,S.height=c.tileHeight;else{var w=c.tilemapLayer.tilemap,C=w.tiles,A=C[d][2],P=w.tilesets[A];S.width=P.tileWidth,S.height=P.tileHeight}return a(S,M),o&&m!==S.collides&&h(u,f,c),S};s.exports=l},26303:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71558),p=e(26099),h=new p,a=function(l,n,u,f,o,c){return c.tilemapLayer.worldToTileXY(n,u,!0,h,o,c),r(l,h.x,h.y,f,c)};s.exports=a},14051:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42573),p=e(71558),h=function(a,l,n,u,f){if(u===void 0&&(u=!0),!Array.isArray(a))return null;Array.isArray(a[0])||(a=[a]);for(var o=a.length,c=a[0].length,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(26546),h=function(a,l,n,u,f,o){var c,d=r(a,l,n,u,{},o);if(!f)for(f=[],c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23029),p=e(62991),h=e(72023),a=function(l,n,u,f,o){if(u===void 0&&(u=!0),f===void 0&&(f=!0),!p(l,n,o))return null;var c=o.data[n][l];if(c)o.data[n][l]=u?null:new r(o,-1,l,n,o.tileWidth,o.tileHeight);else return null;return f&&c&&c.collides&&h(l,n,o),c};s.exports=a},94178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63557),p=e(26099),h=new p,a=function(l,n,u,f,o,c){return c.tilemapLayer.worldToTileXY(l,n,!0,h,o,c),r(h.x,h.y,u,f,c)};s.exports=a},15533:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(3956),h=new p(105,210,231,150),a=new p(243,134,48,200),l=new p(40,39,37,150),n=function(u,f,o){f===void 0&&(f={});var c=f.tileColor!==void 0?f.tileColor:h,d=f.collidingTileColor!==void 0?f.collidingTileColor:a,v=f.faceColor!==void 0?f.faceColor:l,m=r(0,0,o.width,o.height,null,o);u.translateCanvas(o.tilemapLayer.x,o.tilemapLayer.y),u.scaleCanvas(o.tilemapLayer.scaleX,o.tilemapLayer.scaleY);for(var S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(l,n,u,f,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e.data,l=e.width,n=e.height,u=e.tilemapLayer,f=Math.max(0,r.left),o=Math.min(l,r.right),c=Math.max(0,r.top),d=Math.min(n,r.bottom),v,m,S;if(p===0)for(m=c;m=f;v--)S=a[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);else if(p===2)for(m=d;m>=c;m--)for(v=f;a[m]&&v=c;m--)for(v=o;a[m]&&v>=f;v--)S=a[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);return u.tilesDrawn=h.length,u.tilesTotal=l*n,h};s.exports=y},57068:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f,o){n===void 0&&(n=!0),u===void 0&&(u=!0),o===void 0&&(o=!0),Array.isArray(l)||(l=[l]);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f,o,c){if(u===void 0&&(u=!0),f===void 0&&(f=!0),c===void 0&&(c=!0),!(l>n)){for(var d=l;d<=n;d++)h(d,u,o);if(c)for(var v=0;v=l&&S.index<=n&&r(S,u)}f&&p(0,0,o.width,o.height,o)}};s.exports=a},75661:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0),Array.isArray(l)||(l=[l]);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(97022),a=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=function(a,l,n){a===void 0&&(a=!0),l===void 0&&(l=!0);for(var u=0;u0&&r(o,a)}}l&&p(0,0,n.width,n.height,n)};s.exports=h},9589:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.collideIndexes.indexOf(e);r&&h===-1?p.collideIndexes.push(e):!r&&h!==-1&&p.collideIndexes.splice(h,1)};s.exports=y},20576:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)};s.exports=y},79583:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(typeof e=="number")h.callbacks[e]=r!==null?{callback:r,callbackContext:p}:void 0;else for(var a=0,l=e.length;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(h,a,l,n,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(33680),h=function(a,l,n,u,f){var o=r(a,l,n,u,null,f),c=o.map(function(v){return v.index});p(c);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63448),p=e(56583),h=function(a,l){var n=a.tilemapLayer.tilemap,u=a.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),o=Math.floor(n.tileHeight*u.scaleY),c=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,d=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,v=p(l.worldView.y-u.y,o/2,0,!0)-u.cullPaddingY,m=r(l.worldView.bottom-u.y,o/2,0,!0)+u.cullPaddingY;return{left:c,right:d,top:v,bottom:m}};s.exports=h},54503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61325),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},97202:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),o*=c.scaleY);var m=d+h*f+a%2*(f/2),S=v+a*(o/2);return l.set(m,S)};s.exports=p},28054:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileHeight,a=p.tilemapLayer,l=0;return a&&(r===void 0&&(r=a.scene.cameras.main),l=a.y+r.scrollY*(1-a.scrollFactorY),h*=a.scaleY),l+e*(h/2)+h};s.exports=y},15108:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),c*=d.scaleY,h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),o*=d.scaleX);var v=l?Math.floor(a/(c/2)):a/(c/2),m=l?Math.floor((h+v%2*.5*o)/o):(h+v%2*.5*o)/o;return n.set(m,v)};s.exports=p},51900:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=h.baseTileHeight,l=h.tilemapLayer;return l&&(p||(p=l.scene.cameras.main),e=e-(l.y+p.scrollY*(1-l.scrollFactorY)),a*=l.scaleY),r?Math.floor(e/(a/2)):e/(a/2)};s.exports=y},86560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(l,n,u,f,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileWidth,a=p.tilemapLayer,l=0;return a&&(r||(r=a.scene.cameras.main),l=a.x+r.scrollX*(1-a.scrollFactorX),h*=a.scaleX),l+e*h};s.exports=y},70326:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97281),p=e(29650),h=e(26099),a=function(l,n,u,f,o){return u||(u=new h(0,0)),u.x=r(l,f,o),u.y=p(n,f,o),u};s.exports=a},29650:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileHeight,a=p.tilemapLayer,l=0;return a&&(r||(r=a.scene.cameras.main),l=a.y+r.scrollY*(1-a.scrollFactorY),h*=a.scaleY),l+e*h};s.exports=y},77366:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(75508),h=function(a,l,n,u,f,o){if(f){var c,d=r(a,l,n,u,null,o),v=0;for(c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85896),p=e(26099),h=new p,a=function(l,n,u,f){return r(l,0,n,h,u,f),h.x};s.exports=a},85896:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){l===void 0&&(l=!0),n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),o*=d.scaleX,c*=d.scaleY);var v=h/o,m=a/c;return l&&(v=Math.floor(v),m=Math.floor(m)),n.set(v,m)};s.exports=p},63288:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85896),p=e(26099),h=new p,a=function(l,n,u,f){return r(0,l,n,h,u,f),h.y};s.exports=a},81086:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CalculateFacesAt:e(72023),CalculateFacesWithin:e(42573),CheckIsoBounds:e(33528),Copy:e(1785),CreateFromTiles:e(78419),CullBounds:e(19545),CullTiles:e(30003),Fill:e(35137),FilterTiles:e(40253),FindByIndex:e(52692),FindTile:e(66151),ForEachTile:e(97560),GetCullTilesFunction:e(43305),GetTileAt:e(7423),GetTileAtWorldXY:e(60540),GetTileCorners:e(55826),GetTileCornersFunction:e(11758),GetTilesWithin:e(7386),GetTilesWithinShape:e(91141),GetTilesWithinWorldXY:e(96523),GetTileToWorldXFunction:e(39167),GetTileToWorldXYFunction:e(62e3),GetTileToWorldYFunction:e(5984),GetWorldToTileXFunction:e(96113),GetWorldToTileXYFunction:e(16926),GetWorldToTileYFunction:e(55762),HasTileAt:e(45091),HasTileAtWorldXY:e(24152),HexagonalCullBounds:e(90454),HexagonalCullTiles:e(9474),HexagonalGetTileCorners:e(27229),HexagonalTileToWorldXY:e(19951),HexagonalWorldToTileXY:e(86625),IsInLayerBounds:e(62991),IsometricCullTiles:e(14018),IsometricTileToWorldXY:e(14127),IsometricWorldToTileXY:e(96897),PutTileAt:e(71558),PutTileAtWorldXY:e(26303),PutTilesAt:e(14051),Randomize:e(77389),RemoveTileAt:e(63557),RemoveTileAtWorldXY:e(94178),RenderDebug:e(15533),ReplaceByIndex:e(27987),RunCull:e(32483),SetCollision:e(57068),SetCollisionBetween:e(37266),SetCollisionByExclusion:e(75661),SetCollisionByProperty:e(64740),SetCollisionFromCollisionGroup:e(63307),SetLayerCollisionIndex:e(9589),SetTileCollision:e(20576),SetTileIndexCallback:e(79583),SetTileLocationCallback:e(93254),Shuffle:e(32903),StaggeredCullBounds:e(61325),StaggeredCullTiles:e(54503),StaggeredTileToWorldXY:e(97202),StaggeredTileToWorldY:e(28054),StaggeredWorldToTileXY:e(15108),StaggeredWorldToTileY:e(51900),SwapByIndex:e(86560),TileToWorldX:e(97281),TileToWorldXY:e(70326),TileToWorldY:e(29650),WeightedRandomize:e(77366),WorldToTileX:e(10095),WorldToTileXY:e(85896),WorldToTileY:e(63288)}},91907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={ORIENTATION:e(91907)};s.exports=r},62501:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(21829),h={Components:e(81086),Parsers:e(57442),Formats:e(80341),ImageCollection:e(16536),ParseToTilemap:e(31989),Tile:e(23029),Tilemap:e(49075),TilemapCreator:e(45939),TilemapFactory:e(46029),Tileset:e(33629),TilemapLayer:e(20442),Orientation:e(91907),LayerData:e(14977),MapData:e(87010),ObjectLayer:e(48700)};h=r(!1,h,p.ORIENTATION),s.exports=h},14977:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91907),h=e(95540),a=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","layer"),this.id=h(n,"id",0),this.x=h(n,"x",0),this.y=h(n,"y",0),this.width=h(n,"width",0),this.height=h(n,"height",0),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.baseTileWidth=h(n,"baseTileWidth",this.tileWidth),this.baseTileHeight=h(n,"baseTileHeight",this.tileHeight),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.widthInPixels=h(n,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.baseTileHeight),this.alpha=h(n,"alpha",1),this.visible=h(n,"visible",!0),this.properties=h(n,"properties",[]),this.indexes=h(n,"indexes",[]),this.collideIndexes=h(n,"collideIndexes",[]),this.callbacks=h(n,"callbacks",[]),this.bodies=h(n,"bodies",[]),this.data=h(n,"data",[]),this.tilemapLayer=h(n,"tilemapLayer",null),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});s.exports=a},87010:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91907),h=e(95540),a=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","map"),this.width=h(n,"width",0),this.height=h(n,"height",0),this.infinite=h(n,"infinite",!1),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.widthInPixels=h(n,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.tileHeight),this.format=h(n,"format",null),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.renderOrder=h(n,"renderOrder","right-down"),this.version=h(n,"version","1"),this.properties=h(n,"properties",{}),this.layers=h(n,"layers",[]),this.images=h(n,"images",[]),this.objects=h(n,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=h(n,"collision",{}),this.tilesets=h(n,"tilesets",[]),this.imageCollections=h(n,"imageCollections",[]),this.tiles=h(n,"tiles",[]),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});s.exports=a},48700:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=new r({initialize:function(l){l===void 0&&(l={}),this.name=p(l,"name","object layer"),this.id=p(l,"id",0),this.opacity=p(l,"opacity",1),this.properties=p(l,"properties",{}),this.propertyTypes=p(l,"propertytypes",{}),this.type=p(l,"type","objectgroup"),this.visible=p(l,"visible",!0),this.objects=p(l,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});s.exports=h},6641:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=function(h){return h=h.toLowerCase(),h==="isometric"?r.ISOMETRIC:h==="staggered"?r.STAGGERED:h==="hexagonal"?r.HEXAGONAL:r.ORTHOGONAL};s.exports=p},46177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(2342),h=e(82593),a=e(46594),l=e(87021),n=function(u,f,o,c,d,v){var m;switch(f){case r.ARRAY_2D:m=p(u,o,c,d,v);break;case r.CSV:m=h(u,o,c,d,v);break;case r.TILED_JSON:m=a(u,o,v);break;case r.WELTMEISTER:m=l(u,o,v);break;default:console.warn("Unrecognized tilemap data format: "+f),m=null}return m};s.exports=n},2342:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(14977),h=e(87010),a=e(23029),l=function(n,u,f,o,c){for(var d=new p({tileWidth:f,tileHeight:o}),v=new h({name:n,tileWidth:f,tileHeight:o,format:r.ARRAY_2D,layers:[d]}),m=[],S=u.length,M=0,w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(2342),h=function(a,l,n,u,f){var o=l.trim().split(` +`).map(function(d){return d.split(",")}),c=p(a,o,n,u,f);return c.format=r.CSV,c};s.exports=h},6656:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14977),p=e(23029),h=function(a,l){for(var n=[],u=0;u-1?M=new p(o,S,m,v,f.tilesize,f.tilesize):M=l?null:new p(o,-1,m,v,f.tilesize,f.tilesize),c.push(M)}d.push(c),c=[]}o.data=d,n.push(o)}return n};s.exports=h},96483:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=function(h){for(var a=[],l=[],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(87010),h=e(6656),a=e(96483),l=function(n,u,f){if(u.layer.length===0)return console.warn("No layers found in the Weltmeister map: "+n),null;for(var o=0,c=0,d=0;do&&(o=u.layer[d].width),u.layer[d].height>c&&(c=u.layer[d].height);var v=new p({width:o,height:c,name:n,tileWidth:u.layer[0].tilesize,tileHeight:u.layer[0].tilesize,format:r.WELTMEISTER});return v.layers=h(u,f),v.tilesets=a(u),v};s.exports=l},52833:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ParseTileLayers:e(6656),ParseTilesets:e(96483),ParseWeltmeister:e(87021)}},57442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={FromOrientationString:e(6641),Parse:e(46177),Parse2DArray:e(2342),ParseCSV:e(82593),Impact:e(52833),Tiled:e(96761)}},51233:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=function(h){for(var a,l,n,u,f,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=window.atob(e),p=r.length,h=new Array(p/4),a=0;a>>0;return h};s.exports=y},84101:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=function(h){var a,l,n=[];for(a=0;a{/** + * @author Seth Berrier + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l){if(!a)return{i:0,layers:h.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=a.x+r(a,"startx",0)*h.tilewidth+r(a,"offsetx",0),u=a.y+r(a,"starty",0)*h.tileheight+r(a,"offsety",0);return{i:0,layers:a.layers,name:l.name+a.name+"/",opacity:l.opacity*a.opacity,visible:l.visible&&a.visible,x:l.x+n,y:l.y+u}};s.exports=p},29920:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=2147483648,e=1073741824,r=536870912,p=function(h){var a=!!(h&y),l=!!(h&e),n=!!(h&r);h=h&~(y|e|r);var u=0,f=!1;return a&&l&&n?(u=Math.PI/2,f=!0):a&&l&&!n?(u=Math.PI,f=!1):a&&!l&&n?(u=Math.PI/2,f=!1):a&&!l&&!n?(u=0,f=!0):!a&&l&&n?(u=3*Math.PI/2,f=!1):!a&&l&&!n?(u=Math.PI,f=!0):!a&&!l&&n?(u=3*Math.PI/2,f=!0):!a&&!l&&!n&&(u=0,f=!1),{gid:h,flippedHorizontal:a,flippedVertical:l,flippedAntiDiagonal:n,rotation:u,flipped:f}};s.exports=p},12635:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(79677),h=function(a){for(var l=[],n=[],u=p(a);u.i0;){if(u.i>=u.layers.length){if(n.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}u=n.pop();continue}var f=u.layers[u.i];if(u.i++,f.type!=="imagelayer"){if(f.type==="group"){var o=p(a,f,u);n.push(u),u=o}continue}var c=r(f,"offsetx",0)+r(f,"startx",0),d=r(f,"offsety",0)+r(f,"starty",0);l.push({name:u.name+f.name,image:f.image,x:u.x+c+f.x,y:u.y+d+f.y,alpha:u.opacity*f.opacity,visible:u.visible&&f.visible,properties:r(f,"properties",{})})}return l};s.exports=h},46594:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(51233),p=e(84101),h=e(91907),a=e(62644),l=e(80341),n=e(6641),u=e(87010),f=e(12635),o=e(22611),c=e(28200),d=e(24619),v=function(m,S,M){var w=a(S),C=new u({width:w.width,height:w.height,name:m,tileWidth:w.tilewidth,tileHeight:w.tileheight,orientation:n(w.orientation),format:l.TILED_JSON,version:w.version,properties:w.properties,renderOrder:w.renderorder,infinite:w.infinite});C.orientation===h.HEXAGONAL&&(C.hexSideLength=w.hexsidelength,C.staggerAxis=w.staggeraxis,C.staggerIndex=w.staggerindex),C.layers=c(w,M),C.images=f(w);var A=d(w);return C.tilesets=A.tilesets,C.imageCollections=A.imageCollections,C.objects=o(w),C.tiles=p(C),r(C),C};s.exports=v},52205:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(18254),p=e(29920),h=function(n){return{x:n.x,y:n.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"],l=function(n,u,f){u===void 0&&(u=0),f===void 0&&(f=0);var o=r(n,a);if(o.x+=u,o.y+=f,n.gid){var c=p(n.gid);o.gid=c.gid,o.flippedHorizontal=c.flippedHorizontal,o.flippedVertical=c.flippedVertical,o.flippedAntiDiagonal=c.flippedAntiDiagonal}else n.polyline?o.polyline=n.polyline.map(h):n.polygon?o.polygon=n.polygon.map(h):n.ellipse?o.ellipse=n.ellipse:n.text?o.text=n.text:n.point?o.point=!0:o.rectangle=!0;return o};s.exports=l},22611:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(52205),h=e(48700),a=e(79677),l=function(n){for(var u=[],f=[],o=a(n);o.i0;){if(o.i>=o.layers.length){if(f.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=f.pop();continue}var c=o.layers[o.i];if(o.i++,c.opacity*=o.opacity,c.visible=o.visible&&c.visible,c.type!=="objectgroup"){if(c.type==="group"){var d=a(n,c,o);f.push(o),o=d}continue}c.name=o.name+c.name;for(var v=o.x+r(c,"startx",0)+r(c,"offsetx",0),m=o.y+r(c,"starty",0)+r(c,"offsety",0),S=[],M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41868),p=e(91907),h=e(79677),a=e(6641),l=e(95540),n=e(14977),u=e(29920),f=e(23029),o=function(c,d){for(var v=l(c,"infinite",!1),m=[],S=[],M=h(c);M.i0;){if(M.i>=M.layers.length){if(S.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}M=S.pop();continue}var w=M.layers[M.i];if(M.i++,w.type!=="tilelayer"){if(w.type==="group"){var C=h(c,w,M);S.push(M),M=C}continue}if(w.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+w.name+"'");continue}else if(w.encoding&&w.encoding==="base64"){if(w.chunks)for(var A=0;A0?(O=new f(P,b.gid,J,_,c.tilewidth,c.tileheight),O.rotation=b.rotation,O.flipX=b.flipped,D[_][J]=O):(I=d?null:new f(P,-1,J,_,c.tilewidth,c.tileheight),D[_][J]=I),B++,B===Q.width&&(Z++,B=0)}}else{P=new n({name:M.name+w.name,id:w.id,x:M.x+l(w,"offsetx",0)+w.x,y:M.y+l(w,"offsety",0)+w.y,width:w.width,height:w.height,tileWidth:c.tilewidth,tileHeight:c.tileheight,alpha:M.opacity*w.opacity,visible:M.visible&&w.visible,properties:l(w,"properties",[]),orientation:a(c.orientation)}),P.orientation===p.HEXAGONAL&&(P.hexSideLength=c.hexsidelength,P.staggerAxis=c.staggeraxis,P.staggerIndex=c.staggerindex);for(var q=[],at=0,ot=w.data.length;at0?(O=new f(P,b.gid,B,D.length,c.tilewidth,c.tileheight),O.rotation=b.rotation,O.flipX=b.flipped,q.push(O)):(I=d?null:new f(P,-1,B,D.length,c.tilewidth,c.tileheight),q.push(I)),B++,B===w.width&&(D.push(q),B=0,q=[])}P.data=D,m.push(P)}return m};s.exports=o},24619:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=e(16536),h=e(52205),a=e(57880),l=function(n){for(var u=[],f=[],o=null,c,d=0;d1){var S=void 0,M=void 0;if(Array.isArray(v.tiles)){S=S||{},M=M||{};for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p0){var l={},n={},u,f,o;if(Array.isArray(h.edgecolors))for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AssignTileProperties:e(51233),Base64Decode:e(41868),BuildTilesetIndex:e(84101),CreateGroupLayer:e(79677),ParseGID:e(29920),ParseImageLayers:e(12635),ParseJSONTiled:e(46594),ParseObject:e(52205),ParseObjectLayers:e(22611),ParseTileLayers:e(28200),ParseTilesets:e(24619)}},33385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=e(94880),l=e(72905),n=new r({initialize:function(f){this.scene=f,this.systems=f.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var u=this.systems.events;u.on(h.PRE_UPDATE,this.preUpdate,this),u.on(h.UPDATE,this.update,this),u.once(h.SHUTDOWN,this.shutdown,this)},addEvent:function(u){var f;return u instanceof a?(f=u,this.removeEvent(f),f.elapsed=f.startAt,f.hasDispatched=!1,f.repeatCount=f.repeat===-1||f.loop?999999999999:f.repeat):f=new a(u),this._pendingInsertion.push(f),f},delayedCall:function(u,f,o,c){return this.addEvent({delay:u,callback:f,args:o,callbackScope:c})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(u){Array.isArray(u)||(u=[u]);for(var f=0;f-1&&this._active.splice(d,1),c.destroy()}for(o=0;o=c.delay)){var d=c.elapsed-c.delay;if(c.elapsed=c.delay,!c.hasDispatched&&c.callback&&(c.hasDispatched=!0,c.callback.apply(c.callbackScope,c.args)),c.repeatCount>0){if(c.repeatCount--,d>=c.delay)for(;d>=c.delay&&c.repeatCount>0;)c.callback&&c.callback.apply(c.callbackScope,c.args),d-=c.delay,c.repeatCount--;c.elapsed=d,c.hasDispatched=!1}else c.hasDispatched&&this._pendingRemoval.push(c)}}}},shutdown:function(){var u;for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(39429),a=e(95540),l=e(44594),n=e(89809),u=new r({Extends:p,initialize:function(o,c){p.call(this),this.scene=o,this.systems=o.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var d=this.systems.events;d.on(l.PRE_UPDATE,this.preUpdate,this),d.on(l.UPDATE,this.update,this),d.once(l.SHUTDOWN,this.destroy,this),c&&this.add(c)},preUpdate:function(f,o){this.paused||(this.elapsed+=o)},update:function(){if(!(this.paused||this.complete)){var f,o=this.events,c=!1,d=this.systems,v;for(f=0;f=o.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(n.COMPLETE,this)}},play:function(f){return f===void 0&&(f=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,f&&this.reset(),this},pause:function(){return this.paused=!0,this},repeat:function(f){return(f===void 0||f===!0)&&(f=-1),f===!1&&(f=0),this.loop=f,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(f){f===void 0&&(f=!1),this.elapsed=0,f||(this.iteration=0);for(var o=0;o0&&(c=o[o.length-1].time);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=new r({initialize:function(l){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(l)},reset:function(a){if(this.delay=p(a,"delay",0),this.repeat=p(a,"repeat",0),this.loop=p(a,"loop",!1),this.callback=p(a,"callback",void 0),this.callbackScope=p(a,"callbackScope",this),this.args=p(a,"args",[]),this.timeScale=p(a,"timeScale",1),this.startAt=p(a,"startAt",0),this.paused=p(a,"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 a=this.delay+this.delay*this.repeat,l=this.elapsed+this.delay*(this.repeat-this.repeatCount);return l/a}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(a){a===void 0&&(a=!1),this.elapsed=this.delay,this.hasDispatched=!a,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});s.exports=h},35945:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},89809:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(35945)}},90291:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Clock:e(33385),Events:e(89809),Timeline:e(96120),TimerEvent:e(94880)}},40382:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(83419),h=e(43491),a=e(88032),l=e(37277),n=e(44594),u=e(93109),f=e(86081),o=e(8357),c=e(43960),d=e(26012),v=new p({initialize:function(S){this.scene=S,this.events=S.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(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.events.once(n.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(n.UPDATE,this.update,this),this.events.once(n.SHUTDOWN,this.shutdown,this)},create:function(m){Array.isArray(m)||(m=[m]);for(var S=[],M=0;M-1},existing:function(m){return this.has(m)||this.tweens.push(m.reset()),this},addCounter:function(m){var S=a(this,m);return this.tweens.push(S.reset()),S},stagger:function(m,S){return u(m,S)},setLagSmooth:function(m,S){return m===void 0&&(m=1/1e-8),S===void 0&&(S=0),this.maxLag=m,this.lagSkip=Math.min(S,this.maxLag),this},setFps:function(m){return m===void 0&&(m=240),this.gap=1e3/m,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(m){var S=Date.now()-this.prevTime;S>this.maxLag&&(this.startTime+=S-this.lagSkip),this.prevTime+=S;var M=this.prevTime-this.startTime,w=M-this.nextTime,C=M-this.time*1e3;return w>0||m?(M/=1e3,this.time=M,this.nextTime+=w+(w>=this.gap?4:this.gap-w)):C=0,C},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(m){m===void 0&&(m=!1);var S=this.getDelta(m);if(!(S<=0)){this.processing=!0;var M,w,C=[],A=this.tweens;for(M=0;M0){for(M=0;M-1&&(w.isPendingRemove()||w.isDestroyed())&&(A.splice(b,1),w.destroy())}C.length=0}this.processing=!1}},remove:function(m){return this.processing?m.setPendingRemoveState():(r(this.tweens,m),m.setRemovedState()),this},reset:function(m){return this.existing(m),m.seek(),m.setActiveState(),this},makeActive:function(m){return this.existing(m),m.setActiveState(),this},each:function(m,S){var M,w=[null];for(M=1;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e&&e.hasOwnProperty(r)?e[r]:p};s.exports=y},6113:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62640),p=e(35355),h=function(a,l){var n=r.Power0;if(typeof a=="string")if(r.hasOwnProperty(a))n=r[a];else{var u="";if(a.indexOf(".")){u=a.substring(a.indexOf(".")+1);var f=u.toLowerCase();f==="in"?u="easeIn":f==="out"?u="easeOut":f==="inout"&&(u="easeInOut")}a=p(a.substring(0,a.indexOf(".")+1)+u),r.hasOwnProperty(a)&&(n=r[a])}else typeof a=="function"&&(n=a);if(!l)return n;var o=l.slice(0);return o.unshift(0),function(c){return o[0]=c,n.apply(this,o)}};s.exports=h},91389:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89318),p=e(77259),h=e(28392),a={bezier:r,catmull:p,catmullrom:p,linear:h},l=function(n){if(n===null)return null;var u=a.linear;return typeof n=="string"?a.hasOwnProperty(n)&&(u=a[n]):typeof n=="function"&&(u=n),u};s.exports=l},55292:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h;if(e.hasOwnProperty(r)){var a=typeof e[r];a==="function"?h=function(l,n,u,f,o,c){return e[r](l,n,u,f,o,c)}:h=function(){return e[r]}}else typeof p=="function"?h=p:h=function(){return p};return h};s.exports=y},82985:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81076),p=function(h){var a,l=[];if(h.hasOwnProperty("props"))for(a in h.props)a.substring(0,1)!=="_"&&l.push({key:a,value:h.props[a]});else for(a in h)r.indexOf(a)===-1&&a.substring(0,1)!=="_"&&l.push({key:a,value:h[a]});return l};s.exports=p},62329:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=function(h){var a=r(h,"targets",null);return a===null||(typeof a=="function"&&(a=a.call()),Array.isArray(a)||(a=[a])),a};s.exports=p},17777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(99472);function h(f){return!!f.getActive&&typeof f.getActive=="function"}function a(f){return!!f.getStart&&typeof f.getStart=="function"}function l(f){return!!f.getEnd&&typeof f.getEnd=="function"}function n(f){return a(f)||l(f)||h(f)}var u=function(f,o){var c,d=function(Q,tt,Y){return Y},v=function(Q,tt,Y){return Y},m=null,S=typeof o;if(S==="number")d=function(){return o};else if(Array.isArray(o))v=function(){return o[0]},d=function(){return o[o.length-1]};else if(S==="string"){var M=o.toLowerCase(),w=M.substring(0,6)==="random",C=M.substring(0,3)==="int";if(w||C){var A=M.indexOf("("),P=M.indexOf(")"),b=M.indexOf(",");if(A&&P&&b){var O=parseFloat(M.substring(A+1,b)),I=parseFloat(M.substring(b+1,P));w?d=function(){return p(O,I)}:d=function(){return r(O,I)}}else throw new Error("invalid random() format")}else{M=M[0];var D=parseFloat(o.substr(2));switch(M){case"+":d=function(Q,tt,Y){return Y+D};break;case"-":d=function(Q,tt,Y){return Y-D};break;case"*":d=function(Q,tt,Y){return Y*D};break;case"/":d=function(Q,tt,Y){return Y/D};break;default:d=function(){return parseFloat(o)}}}}else if(S==="function")d=o;else if(S==="object")if(n(o))h(o)&&(m=o.getActive),l(o)&&(d=o.getEnd),a(o)&&(v=o.getStart);else if(o.hasOwnProperty("value"))c=u(f,o.value);else{var B=o.hasOwnProperty("to"),G=o.hasOwnProperty("from"),z=o.hasOwnProperty("start");if(B&&(G||z)){if(c=u(f,o.to),z){var X=u(f,o.start);c.getActive=X.getEnd}if(G){var j=u(f,o.from);c.getStart=j.getEnd}}}return c||(c={getActive:m,getEnd:d,getStart:v}),c};s.exports=u},88032:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(69902),h=e(23568),a=e(57355),l=e(6113),n=e(55292),u=e(35154),f=e(17777),o=e(269),c=e(86081),d=function(v,m,S){if(m instanceof c)return m.parent=v,m;S===void 0?S=p:S=o(p,S);var M=u(m,"from",0),w=u(m,"to",1),C=[{value:M}],A=u(m,"delay",S.delay),P=u(m,"easeParams",S.easeParams),b=u(m,"ease",S.ease),O=f("value",w),I=new c(v,C),D=I.add(0,"value",O.getEnd,O.getStart,O.getActive,l(u(m,"ease",b),u(m,"easeParams",P)),n(m,"delay",A),u(m,"duration",S.duration),a(m,"yoyo",S.yoyo),u(m,"hold",S.hold),u(m,"repeat",S.repeat),u(m,"repeatDelay",S.repeatDelay),!1,!1);D.start=M,D.current=M,I.completeDelay=h(m,"completeDelay",0),I.loop=Math.round(h(m,"loop",0)),I.loopDelay=Math.round(h(m,"loopDelay",0)),I.paused=a(m,"paused",!1),I.persist=a(m,"persist",!1),I.callbackScope=u(m,"callbackScope",I);for(var B=r.TYPES,G=0;G{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6113),p=e(35154),h=e(36383),a=function(l,n){n===void 0&&(n={});var u,f=p(n,"start",0),o=p(n,"ease",null),c=p(n,"grid",null),d=p(n,"from",0),v=d==="first",m=d==="center",S=d==="last",M=typeof d=="number",w=Array.isArray(l),C=parseFloat(w?l[0]:l),A=w?parseFloat(l[1]):0,P=Math.max(C,A);if(w&&(f+=C),c){var b=c[0],O=c[1],I=0,D=0,B=0,G=0,z=[];S?(I=b-1,D=O-1):M?(I=d%b,D=Math.floor(d/b)):m&&(I=(b-1)/2,D=(O-1)/2);for(var X=h.MIN_SAFE_INTEGER,j=0;jX&&(X=tt),z[j][Q]=tt}}}var Y=o?r(o):null;return c?u=function(Z,U,H,J){var _=0,q=J%b,at=Math.floor(J/b);q>=0&&q=0&&at{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(69902),h=e(23568),a=e(57355),l=e(6113),n=e(91389),u=e(55292),f=e(82985),o=e(62329),c=e(35154),d=e(17777),v=e(269),m=e(86081),S=function(M,w,C){if(w instanceof m)return w.parent=M,w;C===void 0?C=p:C=v(p,C);var A=o(w);!A&&C.targets&&(A=C.targets);for(var P=f(w),b=c(w,"delay",C.delay),O=c(w,"duration",C.duration),I=c(w,"easeParams",C.easeParams),D=c(w,"ease",C.ease),B=c(w,"hold",C.hold),G=c(w,"repeat",C.repeat),z=c(w,"repeatDelay",C.repeatDelay),X=a(w,"yoyo",C.yoyo),j=a(w,"flipX",C.flipX),Q=a(w,"flipY",C.flipY),tt=c(w,"interpolation",C.interpolation),Y=function(yt,Et,At,Pt){if(At==="texture"){var Vt=Pt,dt=void 0;Array.isArray(Pt)?(Vt=Pt[0],dt=Pt[1]):Pt.hasOwnProperty("value")?(Vt=Pt.value,Array.isArray(Pt.value)?(Vt=Pt.value[0],dt=Pt.value[1]):typeof Pt.value=="string"&&(Vt=Pt.value)):typeof Pt=="string"&&(Vt=Pt),yt.addFrame(Et,Vt,dt,u(Pt,"delay",b),c(Pt,"duration",O),c(Pt,"hold",B),c(Pt,"repeat",G),c(Pt,"repeatDelay",z),a(Pt,"flipX",j),a(Pt,"flipY",Q))}else{var ut=d(At,Pt),Rt=n(c(Pt,"interpolation",tt));yt.add(Et,At,ut.getEnd,ut.getStart,ut.getActive,l(c(Pt,"ease",D),c(Pt,"easeParams",I)),u(Pt,"delay",b),c(Pt,"duration",O),a(Pt,"yoyo",X),c(Pt,"hold",B),c(Pt,"repeat",G),c(Pt,"repeatDelay",z),a(Pt,"flipX",j),a(Pt,"flipY",Q),Rt,Rt?Pt:null)}},Z=new m(M,A),U=0;U{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(23568),h=e(57355),a=e(62329),l=e(35154),n=e(8357),u=e(43960),f=function(o,c){if(c instanceof u)return c.parent=o,c;var d=new u(o);d.startDelay=l(c,"delay",0),d.completeDelay=p(c,"completeDelay",0),d.loop=Math.round(p(c,"loop",l(c,"repeat",0))),d.loopDelay=Math.round(p(c,"loopDelay",l(c,"repeatDelay",0))),d.paused=h(c,"paused",!1),d.persist=h(c,"persist",!1),d.callbackScope=l(c,"callbackScope",d);var v,m=r.TYPES;for(v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GetBoolean:e(57355),GetEaseFunction:e(6113),GetInterpolationFunction:e(91389),GetNewValue:e(55292),GetProps:e(82985),GetTargets:e(62329),GetValueOp:e(17777),NumberTweenBuilder:e(88032),StaggerBuilder:e(93109),TweenBuilder:e(8357)}},73685:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="active"},98540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},67233:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},2859:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},98336:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="repeat"},25764:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},32193:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},84371:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},70766:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},55659:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="yoyo"},842:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={TWEEN_ACTIVE:e(73685),TWEEN_COMPLETE:e(98540),TWEEN_LOOP:e(67233),TWEEN_PAUSE:e(2859),TWEEN_RESUME:e(25764),TWEEN_REPEAT:e(98336),TWEEN_START:e(32193),TWEEN_STOP:e(84371),TWEEN_UPDATE:e(70766),TWEEN_YOYO:e(55659)}},43066:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={States:e(86353),Builders:e(30231),Events:e(842),TweenManager:e(40382),Tween:e(86081),TweenData:e(48177),TweenFrameData:e(42220),BaseTween:e(70402),TweenChain:e(43960)};s.exports=r},70402:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(842),a=e(86353),l=new r({Extends:p,initialize:function(u){p.call(this),this.parent=u,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=a.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(n){return this.timeScale=n,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(h.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(h.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(h.TWEEN_COMPLETE,"onComplete")},complete:function(n){return n===void 0&&(n=0),n?(this.setCompleteDelayState(),this.countdown=n):this.onCompleteHandler(),this},completeAfterLoop:function(n){return n===void 0&&(n=0),this.loopCounter>n&&(this.loopCounter=n),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(h.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(n){this.countdown-=n,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(h.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(n){return this.countdown-=n,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(h.TWEEN_START,"onStart"),n=0),n},updateCompleteDelay:function(n){this.countdown-=n,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(n,u,f){return f===void 0&&(f=[]),this.callbacks.hasOwnProperty(n)&&(this.callbacks[n]={func:u,params:f}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(n){n.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});l.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],s.exports=l},95042:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(842),h=e(86353),a=new r({initialize:function(n,u,f,o,c,d,v,m,S,M){this.tween=n,this.targetIndex=u,this.duration=o,this.totalDuration=0,this.delay=0,this.getDelay=f,this.yoyo=c,this.hold=d,this.repeat=v,this.repeatDelay=m,this.repeatCounter=0,this.flipX=S,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(l){l===void 0&&(l=this.current),this.tween.targets[this.targetIndex][this.key]=l},setCreatedState:function(){this.state=h.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=h.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=h.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=h.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=h.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=h.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=h.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=h.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===h.CREATED},isDelayed:function(){return this.state===h.DELAY},isPendingRender:function(){return this.state===h.PENDING_RENDER},isPlayingForward:function(){return this.state===h.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===h.PLAYING_BACKWARD},isHolding:function(){return this.state===h.HOLD_DELAY},isRepeating:function(){return this.state===h.REPEAT_DELAY},isComplete:function(){return this.state===h.COMPLETE},setStateFromEnd:function(l){this.yoyo?this.onRepeat(l,!0,!0):this.repeatCounter>0?this.onRepeat(l,!0,!1):this.setCompleteState()},setStateFromStart:function(l){this.repeatCounter>0?this.onRepeat(l,!1):this.setCompleteState()},reset:function(){var l=this.tween,n=l.totalTargets,u=this.targetIndex,f=l.targets[u],o=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(f,o,0,u,n,l),this.repeatCounter=this.repeat===-1?h.MAX:this.repeat,this.setPendingRenderState();var c=this.duration+this.hold;this.yoyo&&(c+=this.duration);var d=c+this.repeatDelay;this.totalDuration=this.delay+c,this.repeat===-1?(this.totalDuration+=d*h.MAX,l.isInfinite=!0):this.repeat>0&&(this.totalDuration+=d*this.repeat),this.totalDuration>l.duration&&(l.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(l,n,u){var f=this.tween,o=f.totalTargets,c=this.targetIndex,d=f.targets[c],v=this.key,m=v!=="texture";if(this.elapsed=l,this.progress=l/this.duration,this.flipX&&d.toggleFlipX(),this.flipY&&d.toggleFlipY(),m&&(n||u)&&(this.start=this.getStartValue(d,v,this.start,c,o,f)),u){this.setPlayingBackwardState(),this.dispatchEvent(p.TWEEN_YOYO,"onYoyo");return}this.repeatCounter--,m&&(this.end=this.getEndValue(d,v,this.start,c,o,f)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-l,m&&(this.current=this.start,d[v]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(p.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});s.exports=a},69902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},81076:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.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:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(83419),h=e(842),a=e(44603),l=e(39429),n=e(36383),u=e(86353),f=e(48177),o=e(42220),c=new p({Extends:r,initialize:function(v,m){r.call(this,v),this.targets=m,this.totalTargets=m.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(d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z){var X=new f(this,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z);return this.totalData=this.data.push(X),X},addFrame:function(d,v,m,S,M,w,C,A,P,b){var O=new o(this,d,v,m,S,M,w,C,A,P,b);return this.totalData=this.data.push(O),O},getValue:function(d){d===void 0&&(d=0);var v=null;return this.data&&(v=this.data[d].current),v},hasTarget:function(d){return this.targets&&this.targets.indexOf(d)!==-1},updateTo:function(d,v,m){if(m===void 0&&(m=!1),d!=="texture")for(var S=0;S0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(h.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,r.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(d,v,m){if(d===void 0&&(d=0),v===void 0&&(v=16.6),m===void 0&&(m=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;m||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive");var S=this.paused;if(this.paused=!1,d>0){for(var M=Math.floor(d/v),w=d-M*v,C=0;C0&&this.update(w)}return this.paused=S,this.isSeeking=!1,this},initTweenData:function(d){d===void 0&&(d=!1),this.duration=0,this.startDelay=n.MAX_SAFE_INTEGER;for(var v=this.data,m=0;m0?this.totalDuration=S+M+(S+C)*w:this.totalDuration=S+M},reset:function(d){return d===void 0&&(d=!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=u.MAX),d||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")),this},update:function(d){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(d*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(d),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(d),!1;this.hasStarted||(this.startDelay-=d,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(h.TWEEN_START,"onStart"),d=0));var v=!1;if(this.isActive())for(var m=this.data,S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(70402),h=e(83419),a=e(842),l=e(44603),n=e(39429),u=e(86353),f=new h({Extends:p,initialize:function(c){p.call(this,c),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?u.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive"),this},add:function(o){var c=this.parent.create(o);Array.isArray(c)||(c=[c]);for(var d=this.data,v=0;v0)this.loopCounter--,this.resetTweens(),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},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 o=this.data,c=this.totalData,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95042),p=e(45319),h=e(83419),a=e(842),l=new h({Extends:r,initialize:function(u,f,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D){r.call(this,u,f,S,M,w,C,A,P,b,O),this.key=o,this.getActiveValue=v,this.getEndValue=c,this.getStartValue=d,this.ease=m,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=I,this.interpolationData=D},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex],f=this.key;n&&(u[f]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(u[f]=this.getActiveValue(u,f,0))},update:function(n){var u=this.tween,f=u.totalTargets,o=this.targetIndex,c=u.targets[o],d=this.key;if(!c)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(c,d,c[d],o,f,u),this.end=this.getEndValue(c,d,this.start,o,f,u),this.current=this.start,c[d]=this.start,this.setPlayingForwardState(),!0;var v=this.isPlayingForward(),m=this.isPlayingBackward();if(v||m){var S=this.elapsed,M=this.duration,w=0,C=!1;S+=n,S>=M?(w=S-M,S=M,C=!0):S<0&&(S=0);var A=p(S/M,0,1);if(this.elapsed=S,this.progress=A,this.previous=this.current,C)v?(this.current=this.end,c[d]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(w)):(this.current=this.start,c[d]=this.start,this.setStateFromStart(w));else{v||(A=1-A);var P=this.ease(A);this.interpolation?this.current=this.interpolation(this.interpolationData,P):this.current=this.start+(this.end-this.start)*P,c[d]=this.current}this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var o=f.targets[this.targetIndex],c=this.key,d=this.current,v=this.previous;f.emit(n,f,c,o,d,v);var m=f.callbacks[u];m&&m.func.apply(f.callbackScope,[f,o,c,d,v].concat(m.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});s.exports=l},42220:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95042),p=e(45319),h=e(83419),a=e(842),l=new h({Extends:r,initialize:function(u,f,o,c,d,v,m,S,M,w,C){r.call(this,u,f,d,v,!1,m,S,M,w,C),this.key="texture",this.startTexture=null,this.endTexture=o,this.startFrame=null,this.endFrame=c,this.yoyo=S!==0},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=u.texture.key,this.startFrame=u.frame.name),n&&u.setTexture(this.startTexture,this.startFrame)},update:function(n){var u=this.tween,f=this.targetIndex,o=u.targets[f];if(!o)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&o.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),d=this.isPlayingBackward();if(c||d){var v=this.elapsed,m=this.duration,S=0,M=!1;v+=n,v>=m?(S=v-m,v=m,M=!0):v<0&&(v=0);var w=p(v/m,0,1);this.elapsed=v,this.progress=w,M&&(c?(o.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(S)):(o.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(S))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var o=f.targets[this.targetIndex],c=this.key;f.emit(n,f,c,o);var d=f.callbacks[u];d&&d.func.apply(f.callbackScope,[f,o,c].concat(d.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});s.exports=l},86353:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={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};s.exports=y},83419:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(l){return!!l.get&&typeof l.get=="function"||!!l.set&&typeof l.set=="function"}function e(l,n,u){var f=u?l[n]:Object.getOwnPropertyDescriptor(l,n);return!u&&f.value&&typeof f.value=="object"&&(f=f.value),f&&y(f)?(typeof f.enumerable>"u"&&(f.enumerable=!0),typeof f.configurable>"u"&&(f.configurable=!0),f):!1}function r(l,n){var u=Object.getOwnPropertyDescriptor(l,n);return u?(u.value&&typeof u.value=="object"&&(u=u.value),u.configurable===!1):!1}function p(l,n,u,f){for(var o in n)if(n.hasOwnProperty(o)){var c=e(n,o,u);if(c!==!1){var d=f||l;if(r(d.prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(l.prototype,o,c)}else l.prototype[o]=n[o]}}function h(l,n){if(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},20242:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){return null};s.exports=y},71146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){if(a===void 0&&(a=e),p>0){var l=p-e.length;if(l<=0)return null}if(!Array.isArray(r))return e.indexOf(r)===-1?(e.push(r),h&&h.call(a,r),r):null;for(var n=r.length-1;n>=0;)e.indexOf(r[n])!==-1&&r.splice(n,1),n--;if(n=r.length,n===0)return null;p>0&&n>l&&(r.splice(l),n=l);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){if(p===void 0&&(p=0),l===void 0&&(l=e),h>0){var n=h-e.length;if(n<=0)return null}if(!Array.isArray(r))return e.indexOf(r)===-1?(e.splice(p,0,r),a&&a.call(l,r),r):null;for(var u=r.length-1;u>=0;)e.indexOf(r[u])!==-1&&r.pop(),u--;if(u=r.length,u===0)return null;h>0&&u>n&&(r.splice(n),u=n);for(var f=u-1;f>=0;f--){var o=r[f];e.splice(p,0,o),a&&a.call(l,o)}return r};s.exports=y},66905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);return p!==-1&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=0;if(r(h,n,u))for(var o=n;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h,a=[null];for(h=3;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u)){var f,o=[null];for(f=5;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r.length){if(r.length===1)return r[0]}else return NaN;var h=1,a,l;if(p){if(er.length&&(h=r.length),p?(a=r[h-1][p],l=r[h][p],l-e<=e-a?r[h]:r[h-1]):(a=r[h-1],l=r[h],l-e<=e-a?l:a)};s.exports=y},43491:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=[]);for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=[];if(r(h,n,u))for(var o=n;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=e.length);var h=r+Math.floor(Math.random()*p);return e[h]===void 0?null:e[h]};s.exports=y},85835:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return h>a||(e.splice(h,1),a===e.length-1?e.push(r):e.splice(a,0,r)),e};s.exports=y},83371:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);if(p>0){var h=e[p-1],a=e.indexOf(h);e[p]=h,e[a]=r}return e};s.exports=y},69693:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.indexOf(r);if(h===-1||p<0||p>=e.length)throw new Error("Supplied index out of bounds");return h!==p&&(e.splice(h,1),e.splice(p,0,r)),r};s.exports=y},40853:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);if(p!==-1&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=[],l,n=!1;if((p||h)&&(n=!0,p||(p=""),h||(h="")),r=r;l--)n?a.push(p+l.toString()+h):a.push(l);else for(l=e;l<=r;l++)n?a.push(p+l.toString()+h):a.push(l);return a};s.exports=y},593:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2284),p=function(h,a,l){h===void 0&&(h=0),a===void 0&&(a=null),l===void 0&&(l=1),a===null&&(a=h,h=0);for(var n=[],u=Math.max(r((a-h)/(l||1)),0),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(p,h,a){var l=p[h];p[h]=p[a],p[a]=l}function e(p,h){return ph?1:0}var r=function(p,h,a,l,n){for(a===void 0&&(a=0),l===void 0&&(l=p.length-1),n===void 0&&(n=e);l>a;){if(l-a>600){var u=l-a+1,f=h-a+1,o=Math.log(u),c=.5*Math.exp(2*o/3),d=.5*Math.sqrt(o*c*(u-c)/u)*(f-u/2<0?-1:1),v=Math.max(a,Math.floor(h-f*c/u+d)),m=Math.min(l,Math.floor(h+(u-f)*c/u+d));r(p,h,v,m,n)}var S=p[h],M=a,w=l;for(y(p,a,h),n(p[l],S)>0&&y(p,a,l);M0;)w--}n(p[a],S)===0?y(p,a,w):(w++,y(p,w,l)),w<=h&&(a=w+1),h<=w&&(l=w-1)}};s.exports=r},88492:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=e(33680),h=function(l,n,u){for(var f=[],o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l,n){n===void 0&&(n=h);var u;if(!Array.isArray(a))return u=h.indexOf(a),u!==-1?(r(h,u),l&&l.call(n,a),a):null;for(var f=a.length-1,o=[];f>=0;){var c=a[f];u=h.indexOf(c),u!==-1&&(r(h,u),o.push(c),l&&l.call(n,c)),f--}return o};s.exports=p},60248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l,n){if(n===void 0&&(n=h),a<0||a>h.length-1)throw new Error("Index out of bounds");var u=r(h,a);return l&&l.call(n,u),u};s.exports=p},81409:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(a===void 0&&(a=0),l===void 0&&(l=h.length),u===void 0&&(u=h),r(h,a,l)){var f=l-a,o=h.splice(a,f);if(n)for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l){a===void 0&&(a=0),l===void 0&&(l=h.length);var n=a+Math.floor(Math.random()*l);return r(h,n)};s.exports=p},42169:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.indexOf(r),a=e.indexOf(p);return h!==-1&&a===-1?(e[h]=p,!0):!1};s.exports=y},86003:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e.length;if(r<0||r>a||r>=p||p>a){if(h)throw new Error("Range Error: Values outside acceptable range");return!1}else return!0};s.exports=y},89545:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);return p!==-1&&p>0&&(e.splice(p,1),e.unshift(r)),r};s.exports=y},17810:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=e.length-1;r>0;r--){var p=Math.floor(Math.random()*(r+1)),h=e[r];e[r]=e[p],e[p]=h}return e};s.exports=y},90126:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=/\D/g;return e.sort(function(p,h){return parseInt(p.replace(r,""),10)-parseInt(h.replace(r,""),10)}),e};s.exports=y},19133:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){if(!(r>=e.length)){for(var p=e.length-1,h=e[r],a=r;a{/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82264);function p(n,u){return String(n).localeCompare(u)}function h(n,u){var f=n.length;if(f<=1)return n;for(var o=new Array(f),c=1;cc&&(S=c),M>c&&(M=c),w=m,C=S;;)if(w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return e[h]=p,e[a]=r,e};s.exports=y},37105:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Matrix:e(54915),Add:e(71146),AddAt:e(51067),BringToTop:e(66905),CountAllMatching:e(21612),Each:e(95428),EachInRange:e(36914),FindClosestInSorted:e(81957),Flatten:e(43491),GetAll:e(46710),GetFirst:e(58731),GetRandom:e(26546),MoveDown:e(70864),MoveTo:e(69693),MoveUp:e(40853),MoveAbove:e(85835),MoveBelow:e(83371),NumberArray:e(20283),NumberArrayStep:e(593),QuickSelect:e(43886),Range:e(88492),Remove:e(72905),RemoveAt:e(60248),RemoveBetween:e(81409),RemoveRandomElement:e(31856),Replace:e(42169),RotateLeft:e(86003),RotateRight:e(49498),SafeRange:e(82011),SendToBack:e(89545),SetAll:e(17810),Shuffle:e(33680),SortByDigits:e(90126),SpliceOne:e(19133),StableSort:e(19186),Swap:e(25630)}},86922:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var r=e[0].length,p=1;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41836),p=e(86922),h=function(a){var l="";if(!p(a))return 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 y=function(e){return e.reverse()};s.exports=y},21224:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h){return r(h,180)};s.exports=p},44657:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h,a){a===void 0&&(a=1);for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(86922),p=e(2429),h=function(a,l){if(l===void 0&&(l=90),!r(a))return null;if(typeof l!="string"&&(l=(l%360+360)%360),l===90||l===-270||l==="rotateLeft")a=p(a),a.reverse();else if(l===-90||l===270||l==="rotateRight")a.reverse(),a=p(a);else if(Math.abs(l)===180||l==="rotate180"){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h,a){a===void 0&&(a=1);for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(86003),p=e(49498),h=function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),n!==0&&(n<0?r(a,Math.abs(n)):p(a,n)),l!==0)for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=e.length,p=e[0].length,h=new Array(p),a=0;a-1;l--)h[a][l]=e[l][a]}return h};s.exports=y},54915:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CheckMatrix:e(86922),MatrixToString:e(63362),ReverseColumns:e(92598),ReverseRows:e(21224),Rotate180:e(98717),RotateLeft:e(44657),RotateMatrix:e(37829),RotateRight:e(92632),Translate:e(69512),TransposeMatrix:e(2429)}},71334:s=>{/** + * @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 y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=function(r,p){for(var h=new Uint8Array(r),a=h.length,l=p?"data:"+p+";base64,":"",n=0;n>2],l+=y[(h[n]&3)<<4|h[n+1]>>4],l+=y[(h[n+1]&15)<<2|h[n+2]>>6],l+=y[h[n+2]&63];return a%3===2?l=l.substring(0,l.length-1)+"=":a%3===1&&(l=l.substring(0,l.length-2)+"=="),l};s.exports=e},53134:s=>{/** + * @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 y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),r=0;r>4,v[n++]=(f&15)<<4|o>>2,v[n++]=(o&3)<<6|c&63;return d};s.exports=p},65839:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ArrayBufferToBase64:e(71334),Base64ToArrayBuffer:e(53134)}},91799:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Array:e(37105),Base64:e(65839),Objects:e(1183),String:e(31749),NOOP:e(29747),NULL:e(20242)}},41786:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={};for(var p in e)Array.isArray(e[p])?r[p]=e[p].slice(0):r[p]=e[p];return r};s.exports=y},62644:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r,p,h;if(typeof e!="object"||e===null)return e;r=Array.isArray(e)?[]:{};for(h in e)p=e[h],r[h]=y(p);return r};s.exports=y},79291:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41212),p=function(){var h,a,l,n,u,f,o=arguments[0]||{},c=1,d=arguments.length,v=!1;for(typeof o=="boolean"&&(v=o,o=arguments[1]||{},c=2),d===c&&(o=this,--c);c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(75508),p=e(35154),h=function(a,l,n){var u=p(a,l,null);if(u===null)return n;if(Array.isArray(u))return r.RND.pick(u);if(typeof u=="object"){if(u.hasOwnProperty("randInt"))return r.RND.integerInRange(u.randInt[0],u.randInt[1]);if(u.hasOwnProperty("randFloat"))return r.RND.realInRange(u.randFloat[0],u.randFloat[1])}else if(typeof u=="function")return u(l);return u};s.exports=h},95540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=typeof e;return!e||h==="number"||h==="string"?p:e.hasOwnProperty(r)&&e[r]!==void 0?e[r]:p};s.exports=y},82840:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=e(45319),h=function(a,l,n,u,f){f===void 0&&(f=n);var o=r(a,l,f);return p(o,n,u)};s.exports=h},35154:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(!e&&!h||typeof e=="number")return p;if(e&&e.hasOwnProperty(r))return e[r];if(h&&h.hasOwnProperty(r))return h[r];if(r.indexOf(".")!==-1){for(var a=r.split("."),l=e,n=h,u=p,f=p,o=!0,c=!0,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.hasOwnProperty(r)};s.exports=y},41212:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!e||typeof e!="object"||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}return!0};s.exports=y},46975:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a){var l=r(h);for(var n in a)l.hasOwnProperty(n)||(l[n]=a[n]);return l};s.exports=p},269:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a){var l=r(h);for(var n in a)l.hasOwnProperty(n)&&(l[n]=a[n]);return l};s.exports=p},18254:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97022),p=function(h,a){for(var l={},n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(!e||typeof e=="number")return!1;if(e.hasOwnProperty(r))return e[r]=p,!0;if(r.indexOf(".")!==-1){for(var h=r.split("."),a=e,l=e,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Clone:e(41786),DeepCopy:e(62644),Extend:e(79291),GetAdvancedValue:e(23568),GetFastValue:e(95540),GetMinMaxValue:e(82840),GetValue:e(35154),HasAll:e(69036),HasAny:e(1985),HasValue:e(97022),IsPlainObject:e(41212),Merge:e(46975),MergeRight:e(269),Pick:e(18254),SetValue:e(61622)}},27902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.replace(/%([0-9]+)/g,function(p,h){return r[Number(h)-1]})};s.exports=y},41836:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=0),p===void 0&&(p=" "),h===void 0&&(h=3),e=e.toString();var a=0;if(r+1>=e.length)switch(h){case 1:e=new Array(r+1-e.length).join(p)+e;break;case 3:var l=Math.ceil((a=r-e.length)/2),n=a-l;e=new Array(n+1).join(p)+e+new Array(l+1).join(p);break;default:e=e+new Array(r+1-e.length).join(p);break}return e};s.exports=y},33628:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===0?e.slice(1):e.slice(0,r-1)+e.slice(r)};s.exports=y},27671:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.split("").reverse().join("")};s.exports=y},45650:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=Math.random()*16|0,p=e==="x"?r:r&3|8;return p.toString(16)})};s.exports=y},35355:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e&&e[0].toUpperCase()+e.slice(1)};s.exports=y},31749:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Format:e(27902),Pad:e(41836),RemoveAt:e(33628),Reverse:e(27671),UppercaseFirst:e(35355),UUID:e(45650)}}},x={};function T(s){var y=x[s];if(y!==void 0)return y.exports;var e=x[s]={exports:{}};return i[s](e,e.exports,T),e.exports}T.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var E=T(85454);return E})())})(WM);var Qm=WM.exports;const Uf=kd(Qm);var IF=Object.create,Yx=Object.defineProperty,NF=Object.defineProperties,BF=Object.getOwnPropertyDescriptor,UF=Object.getOwnPropertyDescriptors,zF=Object.getOwnPropertyNames,qS=Object.getOwnPropertySymbols,GF=Object.getPrototypeOf,XM=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,tT=(g,t,i)=>t in g?Yx(g,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[t]=i,Pn=(g,t)=>{for(var i in t||(t={}))XM.call(t,i)&&tT(g,i,t[i]);if(qS)for(var i of qS(t))VF.call(t,i)&&tT(g,i,t[i]);return g},mh=(g,t)=>NF(g,UF(t)),ai=(g,t)=>()=>(t||g((t={exports:{}}).exports,t),t.exports),HF=(g,t,i,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let T of zF(t))!XM.call(g,T)&&T!==i&&Yx(g,T,{get:()=>t[T],enumerable:!(x=BF(t,T))||x.enumerable});return g},YM=(g,t,i)=>(i=g!=null?IF(GF(g)):{},HF(t||!g||!g.__esModule?Yx(i,"default",{value:g,enumerable:!0}):i,g)),_m=ai(g=>{var t=function(E,s){return Es?1:0},i=function(E,s){return Es?-1:0};function x(E){return function(s,y){return E(y,s)}}function T(E){return E===2?function(s,y){return s[0]y[0]?1:s[1]y[1]?1:0}:function(s,y){for(var e=0;ey[e])return 1;e++}return 0}}g.DEFAULT_COMPARATOR=t,g.DEFAULT_REVERSE_COMPARATOR=i,g.reverseComparator=x,g.createTupleComparator=T}),WF=ai(g=>{g.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",g.SYMBOL_SUPPORT=typeof Symbol<"u"}),Gn=ai((g,t)=>{var i=WF(),x=i.ARRAY_BUFFER_SUPPORT,T=i.SYMBOL_SUPPORT;t.exports=function(E,s){var y,e,r,p,h;if(!E)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(E)||x&&ArrayBuffer.isView(E)||typeof E=="string"||E.toString()==="[object Arguments]"){for(r=0,p=E.length;r{var i=_m(),x=Gn(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function s(u){if(this.clear(),this.comparator=u||T,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}s.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function y(u){return{item:u,degree:0}}function e(u,f){u.root?(f.right=u.root.right,f.left=u.root,u.root.right.left=f,u.root.right=f):u.root=f}s.prototype.push=function(u){var f=y(u);return f.left=f,f.right=f,e(this,f),(!this.min||this.comparator(f.item,this.min.item)<=0)&&(this.min=f),++this.size},s.prototype.peek=function(){return this.min?this.min.item:void 0};function r(u){for(var f=[],o=u,c=!1;!(o===u&&c);)o===u&&(c=!0),f.push(o),o=o.right;return f}function p(u,f){u.root===f&&(u.root=f.right),f.left.right=f.right,f.right.left=f.left}function h(u,f){u.child?(f.right=u.child.right,f.left=u.child,u.child.right.left=f,u.child.right=f):u.child=f}function a(u,f,o){p(u,f),f.left=f,f.right=f,h(o,f),o.degree++,f.parent=o}function l(u){var f=new Array(u.size),o=r(u.root),c,d,v,m,S,M;for(c=0,d=o.length;c0&&(M=v,v=m,m=M),a(u,m,v),f[S]=null,S++;f[S]=v}for(c=0;c{var t=Math.pow(2,8)-1,i=Math.pow(2,16)-1,x=Math.pow(2,32)-1,T=Math.pow(2,7)-1,E=Math.pow(2,15)-1,s=Math.pow(2,31)-1;g.getPointerArray=function(e){var r=e-1;if(r<=t)return Uint8Array;if(r<=i)return Uint16Array;if(r<=x)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},g.getSignedPointerArray=function(e){var r=e-1;return r<=T?Int8Array:r<=E?Int16Array:r<=s?Int32Array:Float64Array},g.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var y={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};g.getMinimalRepresentation=function(e,r){var p=null,h=0,a,l,n,u,f;for(u=0,f=e.length;uh&&(h=a,p=l);return p},g.isTypedArray=function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)},g.concat=function(){var e=0,r,p,h;for(r=0,h=arguments.length;r{var t=Gn(),i=Ns();function x(y){return Array.isArray(y)||i.isTypedArray(y)}function T(y){if(typeof y.length=="number")return y.length;if(typeof y.size=="number")return y.size}function E(y){var e=T(y),r=typeof e=="number"?new Array(e):[],p=0;return t(y,function(h){r[p++]=h}),r}function s(y){var e=T(y),r=typeof e=="number"?i.getPointerArray(e):Array,p=typeof e=="number"?new Array(e):[],h=typeof e=="number"?new r(e):[],a=0;return t(y,function(l){p[a]=l,h[a]=a++}),[p,h]}g.isArrayLike=x,g.guessLength=T,g.toArray=E,g.toArrayWithIndices=s}),jx=ai((g,t)=>{var i=Gn(),x=_m(),T=aa(),E=x.DEFAULT_COMPARATOR,s=x.reverseComparator;function y(d,v,m,S){for(var M=v[S],w,C;S>m;){if(w=S-1>>1,C=v[w],d(M,C)<0){v[S]=C,S=w;continue}break}v[S]=M}function e(d,v,m){for(var S=v.length,M=m,w=v[m],C=2*m+1,A;C=0&&(C=A),v[m]=v[C],m=C,C=2*m+1;v[m]=w,y(d,v,M,m)}function r(d,v,m){v.push(m),y(d,v,0,v.length-1)}function p(d,v){var m=v.pop();if(v.length!==0){var S=v[0];return v[0]=m,e(d,v,0),S}return m}function h(d,v,m){if(v.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var S=v[0];return v[0]=m,e(d,v,0),S}function a(d,v,m){var S;return v.length!==0&&d(v[0],m)<0&&(S=v[0],v[0]=m,m=S,e(d,v,0)),m}function l(d,v){for(var m=v.length,S=m>>1,M=S;--M>=0;)e(d,v,M)}function n(d,v){for(var m=v.length,S=0,M=new Array(m);S=m.length)return m.slice().sort(d);for(P=m.slice(0,v),l(S,P),M=v,w=m.length;M0&&h(S,P,m[M]);return P.sort(d)}var b=T.guessLength(m);return b!==null&&b0&&h(S,P,O)),M++}),P.length>M&&(P.length=M),P.sort(d)}function f(d,v,m){arguments.length===2&&(m=v,v=d,d=E);var S=s(d),M,w,C,A=-1/0,P;if(v===1){if(T.isArrayLike(m)){for(M=0,w=m.length;M0)&&(A=C);return P=new m.constructor(1),P[0]=A,P}return i(m,function(O){(A===-1/0||d(O,A)>0)&&(A=O)}),[A]}if(T.isArrayLike(m)){if(v>=m.length)return m.slice().sort(S);for(P=m.slice(0,v),l(d,P),M=v,w=m.length;M0&&h(d,P,m[M]);return P.sort(S)}var b=T.guessLength(m);return b!==null&&b0&&h(d,P,O)),M++}),P.length>M&&(P.length=M),P.sort(S)}function o(d){if(this.clear(),this.comparator=d||E,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}o.prototype.clear=function(){this.items=[],this.size=0},o.prototype.push=function(d){return r(this.comparator,this.items,d),++this.size},o.prototype.peek=function(){return this.items[0]},o.prototype.pop=function(){return this.size!==0&&this.size--,p(this.comparator,this.items)},o.prototype.replace=function(d){return h(this.comparator,this.items,d)},o.prototype.pushpop=function(d){return a(this.comparator,this.items,d)},o.prototype.consume=function(){return this.size=0,n(this.comparator,this.items)},o.prototype.toArray=function(){return n(this.comparator,this.items.slice())},o.prototype.inspect=function(){var d=this.toArray();return Object.defineProperty(d,"constructor",{value:o,enumerable:!1}),d},typeof Symbol<"u"&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect);function c(d){if(this.clear(),this.comparator=d||E,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=s(this.comparator)}c.prototype=o.prototype,o.from=function(d,v){var m=new o(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},c.from=function(d,v){var m=new c(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},o.siftUp=e,o.siftDown=y,o.push=r,o.pop=p,o.replace=h,o.pushpop=a,o.heapify=l,o.consume=n,o.nsmallest=u,o.nlargest=f,o.MinHeap=o,o.MaxHeap=c,t.exports=o}),XF=ai((g,t)=>{var i="";function x(r,p,h){for(var a=p.length,l=[],n=a,u=-1,f,o=0,c;n--;)u=Math.max(r[p[n]+h],u);for(c=u>>24&&32||u>>16&&24||u>>8&&16||8;o>o&15].push(p[n]);for(f=0;f<16;f++)for(u=l[f].length;u--;)p[++n]=l[f][u]}}function T(r,p,h,a){return r[h]-r[a]||(h%3===2?r[h+1]-r[a+1]||p[h+2]-p[a+2]:p[h+1]-p[a+1])}function E(r,p){var h=[],a=[],l=2*p/3|0,n=p-l,u=l+1>>1,f=l,o=0,c,d=[],v=[];if(p===1)return[0];for(;f--;)h[f]=(f*3>>1)+1;for(f=3;f--;)x(r,h,f);for(o=a[(h[0]/3|0)+(h[0]%3===1?0:u)]=1,f=1;fthis.firstLength&&n>this.firstLength)){for(p=Math.min(this.length-l,this.length-n),a=0;ar.length&&(r=this.text.slice(l,l+p))}return r},e.prototype.toString=function(){return this.array.join(",")},e.prototype.toJSON=function(){return this.array},e.prototype.inspect=function(){for(var r=new Array(this.length),p=0;p{var i=Gn();function x(r){this.size=0,this.items=new Map,this.inverse=r}function T(){this.size=0,this.items=new Map,this.inverse=new x(this)}function E(){this.size=0,this.items.clear(),this.inverse.items.clear()}T.prototype.clear=E,x.prototype.clear=E;function s(r,p){if(this.items.has(r)){var h=this.items.get(r);if(h===p)return this;this.inverse.items.delete(h)}if(this.inverse.items.has(p)){var a=this.inverse.items.get(p);if(a===r)return this;this.items.delete(a)}return this.items.set(r,p),this.inverse.items.set(p,r),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}T.prototype.set=s,x.prototype.set=s;function y(r){if(this.items.has(r)){var p=this.items.get(r);return this.items.delete(r),this.inverse.items.delete(p),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}T.prototype.delete=y,x.prototype.delete=y;var e=["has","get","forEach","keys","values","entries"];e.forEach(function(r){T.prototype[r]=x.prototype[r]=function(){return Map.prototype[r].apply(this.items,arguments)}}),typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries,x.prototype[Symbol.iterator]=x.prototype.entries),T.prototype.inspect=function(){var r={left:this.items,right:this.inverse.items};return Object.defineProperty(r,"constructor",{value:T,enumerable:!1}),r},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),x.prototype.inspect=function(){var r={left:this.inverse.items,right:this.items};return Object.defineProperty(r,"constructor",{value:x,enumerable:!1}),r},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),T.from=function(r){var p=new T;return i(r,function(h,a){p.set(a,h)}),p},t.exports=T}),Hr=ai((g,t)=>{function i(x){if(typeof x!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=x}typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var x=arguments,T=x.length,E=0;return new i(function(){return E>=T?{done:!0}:{done:!1,value:x[E++]}})},i.empty=function(){var x=new i(function(){return{done:!0}});return x},i.fromSequence=function(x){var T=0,E=x.length;return new i(function(){return T>=E?{done:!0}:{done:!1,value:x[T++]}})},i.is=function(x){return x instanceof i?!0:typeof x=="object"&&x!==null&&typeof x.next=="function"},t.exports=i}),kM=ai(g=>{function t(s){return s|=s>>1,s|=s>>2,s|=s>>4,s|=s>>8,s|=s>>16,s&~(s>>1)}g.msb32=t;function i(s){return s|=s>>1,s|=s>>2,s|=s>>4,s&~(s>>1)}g.msb8=i,g.test=function(s,y){return s>>y&1},g.criticalBit8=function(s,y){return i(s^y)},g.criticalBit8Mask=function(s,y){return~i(s^y)>>>0&255},g.testCriticalBit8=function(s,y){return 1+(s|y)>>8},g.criticalBit32Mask=function(s,y){return~t(s^y)>>>0&4294967295},g.popcount=function(s){return s-=s>>1&1431655765,s=(s&858993459)+(s>>2&858993459),s=s+(s>>4)&252645135,s+=s>>8,s+=s>>16,s&127};var x=new Uint8Array(Math.pow(2,8));for(T=0,E=x.length;T>8&255]+x[s>>16&255]+x[s>>24&255]}}),kF=ai((g,t)=>{var i=Hr(),x=kM();function T(E){this.length=E,this.clear()}T.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},T.prototype.set=function(E,s){var y=E>>5,e=E&31,r=this.array[y],p;return s===0||s===!1?p=this.array[y]&=~(1<>>0,p>r?this.size++:p>5,y=E&31,e=this.array[s],r;return r=this.array[s]&=~(1<>5,y=E&31,e=this.array[s],r=this.array[s]^=1<>>0,r>e?this.size++:r>5,y=E&31;return this.array[s]>>y&1},T.prototype.test=function(E){return!!this.get(E)},T.prototype.rank=function(E){if(this.size===0)return 0;for(var s=E>>5,y=E&31,e=0,r=0;r=this.length)return-1;for(var s,y=32,e=0,r=0,p=0,h=this.array.length;p>a&1,r===E)return e}},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.length,e,r,p=32,h=0,a=this.array.length;h>l&1,E.call(s,r,h*32+l)}},T.prototype.values=function(){var E=this.length,s=!1,y,e,r=this.array,p=r.length,h=0,a=-1,l=32;return new i(function n(){if(!s){if(h>=p)return{done:!0};h===p-1&&(l=E%32||32),y=r[h++],s=!0,a=-1}return a++,a>=l?(s=!1,n()):(e=y>>a&1,{value:e})})},T.prototype.entries=function(){var E=this.length,s=!1,y,e,r=this.array,p,h=r.length,a=0,l=-1,n=32;return new i(function u(){if(!s){if(a>=h)return{done:!0};a===h-1&&(n=E%32||32),y=r[a++],s=!0,l=-1}return l++,p=~-a*32+l,l>=n?(s=!1,u()):(e=y>>l&1,{value:[p,e]})})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=new Uint8Array(this.length);return this.forEach(function(s,y){E[y]=s}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return Array.from(this.array)},t.exports=T}),jF=ai((g,t)=>{var i=Hr(),x=kM(),T=function(y){return Math.max(1,Math.ceil(y*1.5))};function E(y){return new Uint32Array(Math.ceil(y/32))}function s(y){var e=y||0,r=T;typeof y=="object"&&(e=y.initialLength||y.initialCapacity||0,r=y.policy||r),this.size=0,this.length=e,this.capacity=Math.ceil(this.length/32)*32,this.policy=r,this.array=E(this.capacity)}s.prototype.set=function(y,e){if(this.length>5,p=y&31,h=this.array[r],a;return e===0||e===!1?a=this.array[r]&=~(1<>>0,a>h?this.size++:a>5,r=y&31,p=this.array[e],h;return h=this.array[e]&=~(1<>5,r=y&31,p=this.array[e],h=this.array[e]^=1<>>0,h>p?this.size++:hthis.array.length?(this.array=new Uint32Array(p),this.array.set(r,0)):this.array=r.slice(0,p),this.capacity=y,this)},s.prototype.grow=function(y){var e;if(typeof y=="number"){if(this.capacity>=y)return this;for(e=this.capacity;e>5,p=e&31;return this.array[r]|=1<>5,r=y&31;return this.array[e]>>r&1}},s.prototype.get=function(y){if(!(this.length>5,r=y&31;return this.array[e]>>r&1}},s.prototype.test=function(y){return this.length>5,r=y&31,p=0,h=0;h=this.length)return-1;for(var e,r=32,p=0,h=0,a=0,l=this.array.length;a>n&1,h===y)return p}},s.prototype.forEach=function(y,e){e=arguments.length>1?e:this;for(var r=this.length,p,h,a=32,l=0,n=this.array.length;l>u&1,y.call(e,h,l*32+u)}},s.prototype.values=function(){var y=this.length,e=!1,r,p,h=this.array,a=h.length,l=0,n=-1,u=32;return new i(function f(){if(!e){if(l>=a)return{done:!0};l===a-1&&(u=y%32||32),r=h[l++],e=!0,n=-1}return n++,n>=u?(e=!1,f()):(p=r>>n&1,{value:p})})},s.prototype.entries=function(){var y=this.length,e=!1,r,p,h=this.array,a,l=h.length,n=0,u=-1,f=32;return new i(function o(){if(!e){if(n>=l)return{done:!0};n===l-1&&(f=y%32||32),r=h[n++],e=!0,u=-1}return u++,a=~-n*32+u,u>=f?(e=!1,o()):(p=r>>u&1,{value:[a,p]})})},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.inspect=function(){var y=new Uint8Array(this.length);return this.forEach(function(e,r){y[r]=e}),Object.defineProperty(y,"constructor",{value:s,enumerable:!1}),y},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},t.exports=s}),KF=ai((g,t)=>{function i(E,s){return(E&65535)*s+(((E>>>16)*s&65535)<<16)&4294967295}function x(E,s){return(E&65535)+(s>>>16)+(((E>>>16)+s&65535)<<16)&4294967295}function T(E,s){return E<>>32-s}t.exports=function(E,s){var y=3432918353,e=461845907,r=15,p=13,h=5,a=1801774676,l=E,n,u,f;for(u=0,f=s.length-4;u<=f;u+=4)n=s[u]|s[u+1]<<8|s[u+2]<<16|s[u+3]<<24,n=i(n,y),n=T(n,r),n=i(n,e),l^=n,l=T(l,p),l=i(l,h),l=x(l,a);switch(n=0,s.length&3){case 3:n^=s[u+2]<<16;case 2:n^=s[u+1]<<8;case 1:n^=s[u],n=i(n,y),n=T(n,r),n=i(n,e),l^=n}return l^=s.length,l^=l>>>16,l=i(l,2246822507),l^=l>>>13,l=i(l,3266489909),l^=l>>>16,l>>>0}}),ZF=ai((g,t)=>{var i=KF(),x=Gn(),T=Math.LN2*Math.LN2,E={errorRate:.005};function s(r){var p=new Uint16Array(r.length),h,a;for(h=0,a=r.length;h>3]|=n}return this},e.prototype.test=function(r){for(var p=s(r),h=0,a=this.hashFunctions;h>3]&1<<(7&l)))return!1}return!0},e.prototype.toJSON=function(){return this.data},e.from=function(r,p){if(!p&&(p=r.length||r.size,typeof p!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var h=new e(p);return x(r,function(a){h.add(a)}),h},t.exports=e}),JF=ai((g,t)=>{var i=Gn();function x(T){if(typeof T!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=T,this.clear()}x.prototype.add=function(T){if(!this.root)return this.root={item:T,children:{}},this.size++,this;for(var E=this.root,s;s=this.distance(T,E.item),!!E.children[s];)E=E.children[s];return E.children[s]={item:T,children:{}},this.size++,this},x.prototype.search=function(T,E){if(!this.root)return[];for(var s=[],y=[this.root],e,r,p,h,a;y.length;)for(e=y.pop(),p=this.distance(E,e.item),p<=T&&s.push({item:e.item,distance:p}),h=p-T,a=p+T+1;h{var i=aa(),x=Hr();function T(E,s){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof s!="number"||s<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=E,this.capacity=s,this.items=new E(this.capacity),this.clear()}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var s=this.start+this.size;return s>=this.capacity&&(s-=this.capacity),this.items[s]=E,++this.size},T.prototype.unshift=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var s=this.start-1;return this.start===0&&(s=this.capacity-1),this.items[s]=E,this.start=s,++this.size},T.prototype.pop=function(){if(this.size!==0){this.size--;var E=this.start+this.size;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.shift=function(){if(this.size!==0){var E=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[E]}},T.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},T.prototype.peekLast=function(){if(this.size!==0){var E=this.start+this.size-1;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.get=function(E){if(!(this.size===0||E>=this.capacity))return E=this.start+E,E>=this.capacity&&(E-=this.capacity),this.items[E]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.capacity,e=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[e];return e++,r++,e===s&&(e=0),{value:p,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.capacity,y=this.size,e=this.start,r=0;return new x(function(){if(r>=y)return{done:!0};var p=E[e];return e++,e===s&&(e=0),{value:[r++,p],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){if(arguments.length<3&&(y=i.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var e=new T(s,y);if(i.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=aa(),x=jM();function T(s,y){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof y!="number"||y<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=s,this.capacity=y,this.items=new s(this.capacity),this.clear()}function E(s){T.prototype[s]=x.prototype[s]}Object.keys(x.prototype).forEach(E),typeof Symbol<"u"&&Object.getOwnPropertySymbols(x.prototype).forEach(E),T.prototype.push=function(s){var y=this.start+this.size;return y>=this.capacity&&(y-=this.capacity),this.items[y]=s,this.size===this.capacity?(y++,y>=this.capacity?this.start=0:this.start=y,this.size):++this.size},T.prototype.unshift=function(s){var y=this.start-1;return this.start===0&&(y=this.capacity-1),this.items[y]=s,this.size===this.capacity?(this.start=y,this.size):(this.start=y,++this.size)},T.from=function(s,y,e){if(arguments.length<3&&(e=i.guessLength(s),typeof e!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var r=new T(y,e);if(i.isArrayLike(s)){var p,h;for(p=0,h=s.length;p{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=x,this.size=0}i.prototype.clear=function(){this.items.clear(),this.size=0},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x,this.size),this.items.set(x,T),this.size++),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this.size=this.items.size,this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){var T=this.items.delete(x);return this.size=this.items.size,T},i.prototype.forEach=function(x,T){T=arguments.length>1?T:this,this.items.forEach(x,T)},i.prototype.entries=function(){return this.items.entries()},i.prototype.keys=function(){return this.items.keys()},i.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),i.autoIncrement=function(){var x=0;return function(){return x++}},t.exports=i}),_F=ai((g,t)=>{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=x}i.prototype.clear=function(){this.items=new WeakMap},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x),this.items.set(x,T)),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){return this.items.delete(x)},i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),t.exports=i}),qF=ai((g,t)=>{var i=Ns();function x(T){var E=i.getPointerArray(T),s=i.getPointerArray(Math.log2(T));this.size=T,this.dimension=T,this.parents=new E(T),this.ranks=new s(T);for(var y=0;yr?this.parents[y]=s:(this.parents[y]=s,this.ranks[s]++),this},x.prototype.connected=function(T,E){var s=this.find(T);return s===this.find(E)},x.prototype.mapping=function(){for(var T=i.getPointerArray(this.dimension),E={},s=new T(this.size),y=0,e,r=0,p=this.parents.length;r"u"?(s[r]=y,E[e]=y++):s[r]=E[e];return s},x.prototype.compile=function(){for(var T={},E=new Array(this.dimension),s=0,y,e=0,r=this.parents.length;e"u"?(E[s]=[e],T[y]=s++):E[T[y]].push(e);return E},x.prototype.inspect=function(){var T=this.compile();return Object.defineProperty(T,"constructor",{value:x,enumerable:!1}),T},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),t.exports=x}),Kx=ai((g,t)=>{var i=_m(),x=jx(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function s(r,p,h,a){for(var l=h,n=a,u=p[a],f=2*a+1,o;f=0&&(f=o),p[a]=p[f],a=f,f=2*a+1;p[a]=u,x.siftDown(r,p,n,a)}function y(r,p,h,a){for(var l=a,n=l,u=new r(a),f,o;n>0;)f=h[--n],n!==0&&(o=h[0],h[0]=f,s(p,h,--a,0),f=o),u[n]=f;return u}function e(r,p,h){if(arguments.length===2&&(h=p,p=null),this.ArrayClass=r,this.capacity=h,this.items=new r(h),this.clear(),this.comparator=p||T,typeof h!="number"&&h<=0)throw new Error("mnemonist/FixedReverseHeap.constructor: capacity should be a number > 0.");if(typeof this.comparator!="function")throw new Error("mnemonist/FixedReverseHeap.constructor: given comparator should be a function.");this.comparator=E(this.comparator)}e.prototype.clear=function(){this.size=0},e.prototype.push=function(r){return this.size0&&x.replace(this.comparator,this.items,r),this.size},e.prototype.peek=function(){return this.items[0]},e.prototype.consume=function(){var r=y(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,r},e.prototype.toArray=function(){return y(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},e.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:e,enumerable:!1}),r},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),t.exports=e}),t4=ai((g,t)=>{var i=Gn(),x=function(E){return E};function T(E){if(this.items=new Map,this.clear(),Array.isArray(E)?(this.writeHashFunction=E[0],this.readHashFunction=E[1]):(this.writeHashFunction=E,this.readHashFunction=E),this.writeHashFunction||(this.writeHashFunction=x),this.readHashFunction||(this.readHashFunction=x),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.")}T.prototype.clear=function(){this.items.clear(),this.size=0},T.prototype.add=function(E){var s=this.writeHashFunction(E);return this.items.set(s,E),this.size=this.items.size,this},T.prototype.set=function(E,s){return E=this.writeHashFunction(E),this.items.set(E,s),this.size=this.items.size,this},T.prototype.get=function(E){return E=this.readHashFunction(E),this.items.get(E)},T.prototype.has=function(E){return E=this.readHashFunction(E),this.items.has(E)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this,this.items.forEach(function(y){E.call(s,y,y)})},T.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=Array.from(this.items.values());return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){var e=new T(s);return i(E,function(r,p){y?e.set(p,r):e.add(r)}),e},t.exports=T}),KM=ai((g,t)=>{var i=Hr(),x=Gn();function T(E){this.Container=E||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:T,enumerable:!1})}T.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},T.prototype.set=function(E,s){var y=this.items.get(E),e;return y||(this.dimension++,y=new this.Container,this.items.set(E,y)),this.Container===Set?(e=y.size,y.add(s),e"u"?0:this.Container===Set?s.size:s.length},T.prototype.count=T.prototype.multiplicity,T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;var y;function e(r){E.call(s,r,y)}this.items.forEach(function(r,p){y=p,r.forEach(e)})},T.prototype.forEachAssociation=function(E,s){s=arguments.length>1?s:this,this.items.forEach(E,s)},T.prototype.keys=function(){return this.items.keys()},T.prototype.values=function(){var E=this.items.values(),s=!1,y,e,r,p;return this.Container===Set?new i(function h(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,y=e.value.values()}return e=y.next(),e.done?(s=!1,h()):{done:!1,value:e.value}}):new i(function h(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,y=e.value,r=0,p=y.length}return r>=p?(s=!1,h()):{done:!1,value:y[r++]}})},T.prototype.entries=function(){var E=this.items.entries(),s=!1,y,e,r,p,h;return this.Container===Set?new i(function a(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,r=e.value[0],y=e.value[1].values()}return e=y.next(),e.done?(s=!1,a()):{done:!1,value:[r,e.value]}}):new i(function a(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,r=e.value[0],y=e.value[1],p=0,h=y.length}return p>=h?(s=!1,a()):{done:!1,value:[r,y[p++]]}})},T.prototype.containers=function(){return this.items.values()},T.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries),T.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return this.items},T.from=function(E,s){var y=new T(s);return x(E,function(e,r){y.set(r,e)}),y},t.exports=T}),e4=ai((g,t)=>{var i=KM(),x=Gn(),T=function(s){return s};function E(s,y){if(this.items=new i(y),this.clear(),Array.isArray(s)?(this.writeHashFunction=s[0],this.readHashFunction=s[1]):(this.writeHashFunction=s,this.readHashFunction=s),this.writeHashFunction||(this.writeHashFunction=T),this.readHashFunction||(this.readHashFunction=T),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.")}E.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},E.prototype.add=function(s){var y=this.writeHashFunction(s);return this.items.set(y,s),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.set=function(s,y){return s=this.writeHashFunction(s),this.items.set(s,y),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.get=function(s){return s=this.readHashFunction(s),this.items.get(s)},E.prototype.has=function(s){return s=this.readHashFunction(s),this.items.has(s)},E.prototype.forEach=function(s,y){y=arguments.length>1?y:this,this.items.forEach(function(e){s.call(y,e,e)})},E.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.values),E.prototype.inspect=function(){var s=Array.from(this);return Object.defineProperty(s,"constructor",{value:E,enumerable:!1}),s},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.from=function(s,y,e,r){arguments.length===3&&typeof e=="boolean"&&(r=e,e=Array);var p=new E(y,e);return x(s,function(h,a){r?p.set(a,h):p.add(h)}),p},t.exports=E}),i4=ai((g,t)=>{var i=1024;function x(E){return(E&E-1)===0}function T(E,s){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var y=s||0,e=i,r=0;if(typeof s=="object"&&(y=s.initialCapacity||0,r=s.initialLength||0,e=s.blockSize||i),!e||!x(e))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var p=Math.max(r,y),h=Math.ceil(p/e);this.ArrayClass=E,this.length=r,this.capacity=h*e,this.blockSize=e,this.offsetMask=e-1,this.blockMask=Math.log2(e),this.blocks=new Array(h);for(var a=0;a>this.blockMask,e=E&this.offsetMask;return this.blocks[y][e]=s,this},T.prototype.get=function(E){if(!(this.length>this.blockMask,y=E&this.offsetMask;return this.blocks[s][y]}},T.prototype.grow=function(E){if(typeof E!="number"&&(E=this.capacity+this.blockSize),this.capacity>=E)return this;for(;this.capacity>this.blockMask,e=s&this.offsetMask;return this.blocks[y][e]=E,++this.length},T.prototype.pop=function(){if(this.length!==0){var E=this.blocks[this.blocks.length-1],s=--this.length&this.offsetMask;return E[s]}},T.prototype.inspect=function(){for(var E=new this.ArrayClass(this.length),s,y=0,e=this.length;y>this.blockMask,E[y]=this.blocks[s][y&this.offsetMask];return E.type=this.ArrayClass.name,E.items=this.length,E.capacity=this.capacity,E.blockSize=this.blockSize,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),t.exports=T}),ZM=ai((g,t)=>{var i=Hr(),x=aa();function T(E,s){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof s!="number"||s<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=s,this.ArrayClass=E,this.items=new this.ArrayClass(this.capacity),this.clear()}T.prototype.clear=function(){this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=E,this.size},T.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0,e=this.items.length;y=s)return{done:!0};var e=E[s-y-1];return y++,{value:e,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.size,y=0;return new i(function(){if(y>=s)return{done:!0};var e=E[s-y-1];return{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){if(arguments.length<3&&(y=x.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var e=new T(s,y);if(x.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=aa(),x=Ns(),T=ZM();function E(y,e,r,p,h,a,l,n){var u=l+(n-l)/2|0,f=~-u,o=-~u,c=r[u];p[a]=c+1;var d=e?e(y[c]):y[c][1],v=a*2+1,m=a*2+2,S=-1/0,M=-1/0;l<=f&&(S=E(y,e,r,p,h,v,l,f)),o<=n&&(M=E(y,e,r,p,h,m,o,n));var w=Math.max(d,S,M),C=c;return w===S?C=h[p[v]-1]:w===M&&(C=h[p[m]-1]),h[c]=C,w}function s(y,e){this.size=y.length,this.intervals=y;var r=null,p=null;Array.isArray(e)&&(r=e[0],p=e[1]);var h=y.length,a=x.getPointerArray(h+1),l=new a(h),n;for(n=1;nv?1:0});var u=Math.ceil(Math.log2(h+1)),f=Math.pow(2,u)-1,o=new a(f),c=new a(h);E(y,p,l,o,c,0,0,h-1),l=null,this.height=u,this.tree=o,this.augmentations=c,this.startGetter=r,this.endGetter=p,this.stack=new T(a,this.height)}s.prototype.intervalsContainingPoint=function(y){var e=[],r=this.stack;r.clear(),r.push(0);for(var p=this.tree.length,h,a,l,n,u,f,o,c,d;r.size;)h=r.pop(),a=this.tree[h]-1,l=this.intervals[a],n=this.intervals[this.augmentations[a]],o=this.endGetter?this.endGetter(n):n[1],!(y>o)&&(c=h*2+1,c=u&&y<=f&&e.push(l),!(yd)&&(v=l*2+1,v=o&&e<=c&&p.push(u),!(r{g.search=function(t,i,x,T){var E=0;x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length,T--;for(var s;x<=T;)if(E=x+T>>>1,s=t[E],s>i)T=~-E;else if(s>>1,y=t(i[T],x),y>0)s=~-T;else if(y<0)E=-~T;else return T;return-1},g.lowerBound=function(t,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length;x>>1,i<=t[E]?T=E:x=-~E;return x},g.lowerBoundWithComparator=function(t,i,x){for(var T=0,E=0,s=i.length;E>>1,t(x,i[T])<=0?s=T:E=-~T;return E},g.lowerBoundIndices=function(t,i,x,T,E){var s=0;for(T=typeof T<"u"?T:0,E=typeof E<"u"?E:t.length;T>>1,x<=t[i[s]]?E=s:T=-~s;return T},g.upperBound=function(t,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length;x>>1,i>=t[E]?x=-~E:T=E;return x},g.upperBoundWithComparator=function(t,i,x){for(var T=0,E=0,s=i.length;E>>1,t(x,i[T])>=0?E=-~T:s=T;return E}}),r4=ai(g=>{var t=Ns(),i=aa().isArrayLike,x=JM(),T=kx();function E(r,p){if(r.length===0)return p.slice();if(p.length===0)return r.slice();var h;r[0]>p[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(a<=l)return t.isTypedArray(r)?t.concat(r,p):r.concat(p);var n=new r.constructor(r.length+p.length),u,f,o;for(u=0,f=r.length;up[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(ap[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(av?o=x.lowerBound(p,d,o+1):(n.push(d),u++,o++);return n};function y(r){var p=0,h=-1/0,a,l,n,u=[];for(l=0,n=r.length;lh&&(h=a));if(u.length===0)return new r[0].constructor(0);if(u.length===1)return u[0].slice();if(u.length===2)return E(u[0],u[1]);r=u;var f=new r[0].constructor(p),o=t.getPointerArray(h),c=new o(r.length),d=new T(function(S,M){return S=r[S][c[S]],M=r[M][c[M]],SM?1:0});for(l=0;lp&&(p=h));if(n.length===0)return new r[0].constructor(0);if(n.length===1)return n[0].slice();if(n.length===2)return s(n[0],n[1]);r=n;var u=new r[0].constructor,f=t.getPointerArray(p),o=new f(r.length),c=new T(function(m,S){return m=r[m][o[m]],S=r[S][o[S]],mS?1:0});for(a=0;ap&&(p=a),lh)return[];if(p===h)return[p];var o,c,d=r[0],v,m,S,M,w,C,A=p;for(u=1;uC?m=x.lowerBound(c,w,m+1):(d.push(w),v++,m++);if(d.length===0)return d;A=d[0]}return d},g.merge=function(){if(arguments.length===2){if(i(arguments[0]))return E(arguments[0],arguments[1])}else if(i(arguments[0]))return y(arguments);return null},g.unionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return s(arguments[0],arguments[1])}else if(i(arguments[0]))return e(arguments);return null},g.intersectionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return g.intersectionUniqueArrays(arguments[0],arguments[1])}else if(i(arguments[0]))return g.kWayIntersectionUniqueArrays(arguments);return null}}),s4=ai((g,t)=>{var i=Hr(),x=Gn(),T=r4();function E(y){return y}function s(y){if(this.clear(),Array.isArray(y)?(this.documentTokenizer=y[0],this.queryTokenizer=y[1]):(this.documentTokenizer=y,this.queryTokenizer=y),this.documentTokenizer||(this.documentTokenizer=E),this.queryTokenizer||(this.queryTokenizer=E),typeof this.documentTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: document tokenizer is not a function.");if(typeof this.queryTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: query tokenizer is not a function.")}s.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},s.prototype.add=function(y){this.size++;var e=this.items.length;this.items.push(y);var r=this.documentTokenizer(y);if(!Array.isArray(r))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var p=new Set,h,a,l=0,n=r.length;l"u"||r.length===0)return[];if(e.length>1)for(h=1,a=e.length;h"u"||p.length===0)return[];r=T.intersectionUniqueArrays(r,p)}var l=new Array(r.length);for(h=0,a=l.length;h1?e:this;for(var r=0,p=this.documents.length;r=e)return{done:!0};var p=y[r++];return{value:p,done:!1}})},s.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.documents),s.prototype.inspect=function(){var y=this.items.slice();return Object.defineProperty(y,"constructor",{value:s,enumerable:!1}),y},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(y,e){var r=new s(e);return x(y,function(p){r.add(p)}),r},t.exports=s}),$M=ai(g=>{var t=new Float64Array(64),i=new Float64Array(64);function x(E,s,y){var e,r,p,h,a;for(t[0]=s,i[0]=y,r=0;r>=0;)if(p=t[r],h=i[r]-1,p=e&&pi[r-1]-t[r-1]&&(a=t[r],t[r]=t[r-1],t[r-1]=a,a=i[r],i[r]=i[r-1],i[r-1]=a)}else r--;return E}g.inplaceQuickSort=x;function T(E,s,y,e){var r,p,h,a,l,n;for(t[0]=y,i[0]=e,p=0;p>=0;)if(h=t[p],a=i[p]-1,h=r&&hi[p-1]-t[p-1]&&(n=t[p],t[p]=t[p-1],t[p-1]=n,n=i[p],i[p]=i[p-1],i[p-1]=n)}else p--;return s}g.inplaceQuickSortIndices=T}),a4=ai((g,t)=>{var i=aa(),x=Ns(),T=_m().createTupleComparator,E=Kx(),s=$M().inplaceQuickSortIndices;function y(l,n,u,f){var o,c=0,d;for(o=0;o>>1),P=u[A],d[D]=P,w>-1&&(C===0?v[w]=D+1:m[w]=D+1),I=(I+1)%l,A!==b&&A!==O-1&&S.push([I,A+1,O,D,1]),A!==b&&S.push([I,b,A,D,0]),D++;return{axes:n,labels:f,pivots:d,lefts:v,rights:m}}function p(l,n){this.dimensions=l,this.visited=0,this.axes=n.axes,this.labels=n.labels,this.pivots=n.pivots,this.lefts=n.lefts,this.rights=n.rights,this.size=this.labels.length}p.prototype.nearestNeighbor=function(l){var n=1/0,u=null,f=this.dimensions,o=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(M,w){m++;var C=d[w],A=v[w],P=c[w],b=y(f,o,P,l);if(!(b0?C!==0&&S(M,C-1):A!==0&&S(M,A-1),O*O0?A!==0&&S(M,A-1):C!==0&&S(M,C-1))}}return S(0,0),this.visited=m,this.labels[u]};var h=T(3),a=T(2);p.prototype.kNearestNeighbors=function(l,n){if(l<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(l=Math.min(l,this.size),l===1)return[this.nearestNeighbor(n)];var u=new E(Array,h,l),f=this.dimensions,o=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(C,A){var P=d[A],b=v[A],O=c[A],I=y(f,o,O,n);u.push([I,m++,O]);var D=n[C],B=o[C][O],G=D-B;C=(C+1)%f,D{var i=Hr(),x=Gn();function T(){this.clear()}T.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},T.prototype.first=function(){return this.head?this.head.item:void 0},T.prototype.peek=T.prototype.first,T.prototype.last=function(){return this.tail?this.tail.item:void 0},T.prototype.push=function(E){var s={item:E,next:null};return this.head?(this.tail.next=s,this.tail=s):(this.head=s,this.tail=s),this.size++,this.size},T.prototype.unshift=function(E){var s={item:E,next:null};return this.head?(this.head.next||(this.tail=this.head),s.next=this.head,this.head=s):(this.head=s,this.tail=s),this.size++,this.size},T.prototype.shift=function(){if(this.size){var E=this.head;return this.head=E.next,this.size--,E.item}},T.prototype.forEach=function(E,s){if(this.size){s=arguments.length>1?s:this;for(var y=this.head,e=0;y;)E.call(s,y.item,e,this),y=y.next,e++}},T.prototype.toArray=function(){if(!this.size)return[];for(var E=new Array(this.size),s=0,y=this.size,e=this.head;s{var i=Hr(),x=Gn(),T=Ns(),E=aa();function s(y,e,r){if(arguments.length<2&&(r=y,y=null,e=null),this.capacity=r,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof e=="function"?new e(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items={}}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(y){var e=this.head;if(this.head===y)return this;var r=this.backward[y],p=this.forward[y];return this.tail===y?this.tail=r:this.backward[p]=r,this.forward[r]=p,this.backward[e]=y,this.head=y,this.forward[y]=e,this},s.prototype.set=function(y,e){var r=this.items[y];if(typeof r<"u"){this.splayOnTop(r),this.V[r]=e;return}this.size1?e:this;for(var r=0,p=this.size,h=this.head,a=this.K,l=this.V,n=this.forward;r=e)return{done:!0};var a=p[r];return y++,y=e)return{done:!0};var a=p[r];return y++,y=e)return{done:!0};var l=p[r],n=h[r];return y++,y{var i=Zx(),x=Gn(),T=Ns(),E=aa();function s(e,r,p){arguments.length<2?i.call(this,e):i.call(this,e,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)s.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),s.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},s.prototype.set=function(e,r){var p=this.items[e];if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],delete this.items[this.K[p]]),this.items[e]=p,this.K[p]=e,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},s.prototype.setpop=function(e,r){var p=null,h=null,a=this.items[e];return typeof a<"u"?(this.splayOnTop(a),p=this.V[a],this.V[a]=r,{evicted:!1,key:e,value:p}):(this.size0?a=this.deleted[--this.deletedSize]:a=this.size,this.size++):(a=this.tail,this.tail=this.backward[a],p=this.V[a],h=this.K[a],delete this.items[h]),this.items[e]=a,this.K[a]=e,this.V[a]=r,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a,h?{evicted:!0,key:h,value:p}:null)},s.prototype.delete=function(e){var r=this.items[e];if(typeof r>"u")return!1;if(delete this.items[e],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},s.prototype.remove=function(e,r=void 0){var p=this.items[e];if(typeof p>"u")return r;var h=this.V[p];if(delete this.items[e],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var a=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=a),this.forward[a]=l,this.backward[l]=a,this.size--,this.deleted[this.deletedSize++]=p,h},s.from=function(e,r,p,h){if(arguments.length<2){if(h=E.guessLength(e),typeof h!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var a=new s(r,p,h);return x(e,function(l,n){a.set(n,l)}),a},t.exports=s}),QM=ai((g,t)=>{var i=Zx(),x=Gn(),T=Ns(),E=aa();function s(y,e,r){if(arguments.length<2&&(r=y,y=null,e=null),this.capacity=r,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof e=="function"?new e(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items=new Map}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},s.prototype.set=function(y,e){var r=this.items.get(y);if(typeof r<"u"){this.splayOnTop(r),this.V[r]=e;return}this.size{var i=QM(),x=Gn(),T=Ns(),E=aa();function s(e,r,p){arguments.length<2?i.call(this,e):i.call(this,e,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)s.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),s.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},s.prototype.set=function(e,r){var p=this.items.get(e);if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],this.items.delete(this.K[p])),this.items.set(e,p),this.K[p]=e,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},s.prototype.setpop=function(e,r){var p=null,h=null,a=this.items.get(e);return typeof a<"u"?(this.splayOnTop(a),p=this.V[a],this.V[a]=r,{evicted:!1,key:e,value:p}):(this.size0?a=this.deleted[--this.deletedSize]:a=this.size,this.size++):(a=this.tail,this.tail=this.backward[a],p=this.V[a],h=this.K[a],this.items.delete(h)),this.items.set(e,a),this.K[a]=e,this.V[a]=r,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a,h?{evicted:!0,key:h,value:p}:null)},s.prototype.delete=function(e){var r=this.items.get(e);if(typeof r>"u")return!1;if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},s.prototype.remove=function(e,r=void 0){var p=this.items.get(e);if(typeof p>"u")return r;var h=this.V[p];if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var a=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=a),this.forward[a]=l,this.backward[l]=a,this.size--,this.deleted[this.deletedSize++]=p,h},s.from=function(e,r,p,h){if(arguments.length<2){if(h=E.guessLength(e),typeof h!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var a=new s(r,p,h);return x(e,function(l,n){a.set(n,l)}),a},t.exports=s}),u4=ai((g,t)=>{var i=Hr(),x=Gn(),T=Kx(),E=function(y,e){return y[1]>e[1]?-1:y[1]"u"?0:e},s.prototype.get=s.prototype.multiplicity,s.prototype.count=s.prototype.multiplicity,s.prototype.frequency=function(y){if(this.size===0)return 0;var e=this.multiplicity(y);return e/this.size},s.prototype.top=function(y){if(typeof y!="number"||y<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var e=new T(Array,E,y),r=this.items.entries(),p;p=r.next(),!p.done;)e.push(p.value);return e.consume()},s.prototype.forEach=function(y,e){e=arguments.length>1?e:this;var r;this.items.forEach(function(p,h){for(r=0;r1?e:this,this.items.forEach(y,e)},s.prototype.keys=function(){return this.items.keys()},s.prototype.values=function(){var y=this.items.entries(),e=!1,r,p,h,a;return new i(function l(){if(!e){if(r=y.next(),r.done)return{done:!0};e=!0,p=r.value[0],h=r.value[1],a=0}return a>=h?(e=!1,l()):(a++,{done:!1,value:p})})},s.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.prototype.toJSON=function(){return this.items},s.from=function(y){var e=new s;return x(y,function(r){e.add(r)}),e},s.isSubset=function(y,e){var r=y.multiplicities(),p,h,a;if(y===e)return!0;if(y.dimension>e.dimension)return!1;for(;p=r.next(),!p.done;)if(h=p.value[0],a=p.value[1],e.multiplicity(h){var i=Hr(),x=Gn();function T(l,n,u){return((Math.pow(l,2)-Math.pow(Math.abs(n-u),2))/2|0)+l+1}function E(l,n){for(var u=0,f=0,o=n+1;fn.length?-1:l.lengthn?1:0}function y(l,n){var u=l+1,f=n/u|0,o=f+1,c,d,v=n-f*u,m=u-v,S=new Array(l+1);for(c=0;c 0");this.levenshtein=l,this.k=n,this.clear()}a.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},a.prototype.add=function(l){var n=l.length,u=this.size;this.strings.push(l),this.size++;var f=e(this.k,l),o=this.invertedIndices[n];typeof o>"u"&&(o={},this.invertedIndices[n]=o);var c,d,v,m,S;for(m=0,S=f.length;m"u"?(d=[u],o[v]=d):d.push(u);return this},a.prototype.search=function(l){var n=l.length,u=this.k,f=new Set,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D;for(w=Math.max(0,n-u),C=n+u+1;w1?n:this;for(var u=0,f=this.strings.length;u=n)return{done:!0};var f=l[u];return u++,{value:f,done:!1}})},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.inspect=function(){var l=this.strings.slice();return Object.defineProperty(l,"constructor",{value:a,enumerable:!1}),l},typeof Symbol<"u"&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(l,n,u){var f=new a(n,u);return x(l,function(o){f.add(o)}),f},a.countKeys=E,a.comparator=s,a.partition=y,a.segments=e,a.segmentPos=r,a.multiMatchAwareInterval=p,a.multiMatchAwareSubstrings=h,t.exports=a}),c4=ai((g,t)=>{var i=Hr(),x=Gn();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},T.prototype.enqueue=function(E){return this.items.push(E),++this.size},T.prototype.dequeue=function(){if(this.size){var E=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,E}},T.prototype.peek=function(){if(this.size)return this.items[this.offset]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.offset,e=0,r=this.items.length;y=E.length)return{done:!0};var y=E[s];return s++,{value:y,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.offset,y=0;return new i(function(){if(s>=E.length)return{done:!0};var e=E[s];return s++,{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var s=new T;return x(E,function(y){s.enqueue(y)}),s},T.of=function(){return T.from(arguments)},t.exports=T}),d4=ai((g,t)=>{var i=Hr(),x=Gn();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.size=0},T.prototype.push=function(E){return this.items.push(E),++this.size},T.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0,e=this.items.length;y=s)return{done:!0};var e=E[s-y-1];return y++,{value:e,done:!1}})},T.prototype.entries=function(){var E=this.items,s=E.length,y=0;return new i(function(){if(y>=s)return{done:!0};var e=E[s-y-1];return{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var s=new T;return x(E,function(y){s.push(y)}),s},T.of=function(){return T.from(arguments)},t.exports=T}),p4=ai(g=>{g.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var t=new Set,i=1/0,x=null,T,E,s=arguments.length;for(E=0;Ei.size)return!1;for(;T=x.next(),!T.done;)if(!i.has(T.value))return!1;return!0},g.isSuperset=function(t,i){return g.isSubset(i,t)},g.add=function(t,i){for(var x=i.values(),T;T=x.next(),!T.done;)t.add(T.value)},g.subtract=function(t,i){for(var x=i.values(),T;T=x.next(),!T.done;)t.delete(T.value)},g.intersect=function(t,i){for(var x=t.values(),T;T=x.next(),!T.done;)i.has(T.value)||t.delete(T.value)},g.disjunct=function(t,i){for(var x=t.values(),T,E=[];T=x.next(),!T.done;)i.has(T.value)&&E.push(T.value);for(x=i.values();T=x.next(),!T.done;)t.has(T.value)||t.add(T.value);for(var s=0,y=E.length;si.size&&(x=t,t=i,i=x),t.size===0)return 0;if(t===i)return t.size;for(var T=t.values(),E,s=0;E=T.next(),!E.done;)i.has(E.value)&&s++;return s},g.unionSize=function(t,i){var x=g.intersectionSize(t,i);return t.size+i.size-x},g.jaccard=function(t,i){var x=g.intersectionSize(t,i);if(x===0)return 0;var T=t.size+i.size-x;return x/T},g.overlap=function(t,i){var x=g.intersectionSize(t,i);return x===0?0:x/Math.min(t.size,i.size)}}),v4=ai((g,t)=>{var i=Hr(),x=Ns().getPointerArray;function T(E){var s=x(E);this.start=0,this.size=0,this.capacity=E,this.dense=new s(E),this.sparse=new s(E)}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.has=function(E){if(this.size===0)return!1;var s=this.sparse[E],y=s=this.start&&s=this.start&&s1?s:this;for(var y=this.capacity,e=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[e];return e++,r++,e===s&&(e=0),{value:p,done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=[];return this.forEach(function(s){E.push(s)}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E.capacity=this.capacity,E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),t.exports=T}),m4=ai((g,t)=>{var i=Hr(),x=Ns().getPointerArray;function T(E,s){arguments.length<2&&(s=E,E=Array);var y=x(s);this.size=0,this.length=s,this.dense=new y(s),this.sparse=new y(s),this.vals=new E(s)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var s=this.sparse[E];return s=this.size||this.dense[s]!==E?!1:(s=this.dense[this.size-1],this.dense[this.sparse[E]]=s,this.sparse[s]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0;y{var i=Hr(),x=Ns().getPointerArray;function T(E){var s=x(E);this.size=0,this.length=E,this.dense=new s(E),this.sparse=new s(E)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var s=this.sparse[E];return s=this.size||this.dense[s]!==E?!1:(s=this.dense[this.size-1],this.dense[this.sparse[E]]=s,this.sparse[s]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y,e=0;e{var i=Gn(),x=2,T=2,E=new Set([0,1,2]),s={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function y(n){var u=new Set;return typeof n=="number"&&u.add(n),{suggestions:u,count:0}}function e(n,u,f){return{term:n||"",distance:u||0,count:f||0}}function r(n,u,f,o){o=o||new Set,u++;var c,d=n.length,v;if(d>1)for(v=0;v0&&n[v].length-d.length>o.length-d.length&&(f.suggestions=new Set,f.count=0),(u===2||!f.suggestions.size||n[v].length-d.length>=o.length-d.length)&&f.suggestions.add(c)}function h(n,u){var f=n.length,o=u.length,c=[[]],d=f+o,v=new Map,m,S,M;for(c[0][0]=d,m=0;m<=f;m++)c[m+1]||(c[m+1]=[]),c[m+1][1]=m,c[m+1][0]=d;for(M=0;M<=o;M++)c[1][M+1]=M,c[0][M+1]=d;var w=n+u,C;for(m=0,S=w.length;mc)return[];for(var m=[d],S=new Set,M=new Set,w=[],C,A;m.length>0&&(C=m.shift(),!(f<2&&w.length>0&&v-C.length>w[0].distance));){if(A=n[C],A!==void 0){if(typeof A=="number"&&(A=y(A)),A.count>0&&!M.has(C)){M.add(C);var P=e(C,v-C.length,A.count);if(w.push(P),f<2&&v-C.length===0)break}A.suggestions.forEach(D=>{var B=u[D];if(!M.has(B)){M.add(B);var G=0;if(d!==B)if(B.length===C.length)G=v-C.length;else if(v===C.length)G=B.length-C.length;else{for(var z=0,X=0,j=B.length;z0||X>0?G=h(B.substr(z,j-z-X),d.substr(z,v-z-X)):G=h(B,d)}if(f<2&&w.length>0&&w[0].distance>G&&(w=[]),!(f<2&&w.length>0&&G>w[0].distance)&&G<=o){var Q=n[B];Q!==void 0&&w.push(e(B,G,Q.count))}}})}if(v-C.length0&&v-C.length>=w[0].distance)continue;for(var b=0,O=C.length;bthis.maxLength&&(this.maxLength=n.length)),u.count===1){var f=this.words.length;this.words.push(n);var o=r(n,0,this.maxDistance);o.forEach(c=>{var d=this.dictionary[c];d!==void 0?(typeof d=="number"&&(d=y(d),this.dictionary[c]=d),d.suggestions.has(f)||p(this.words,this.verbosity,d,n,f,c)):this.dictionary[c]=f})}return this.size++,this},l.prototype.search=function(n){return a(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,n)},l.prototype.inspect=function(){var n=[];n.size=this.size,n.maxDistance=this.maxDistance,n.verbosity=this.verbosity,n.behavior=s[this.verbosity];for(var u in this.dictionary)typeof this.dictionary[u]=="object"&&this.dictionary[u].count&&n.push([u,this.dictionary[u].count]);return Object.defineProperty(n,"constructor",{value:l,enumerable:!1}),n},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(n,u){var f=new l(u);return i(n,function(o){f.add(o)}),f},t.exports=l}),_M=ai((g,t)=>{var i=Gn(),x=Hr(),T="\0";function E(s){this.mode=s===Array?"array":"string",this.clear()}E.prototype.clear=function(){this.root={},this.size=0},E.prototype.set=function(s,y){for(var e=this.root,r,p=0,h=s.length;p"u")return;if(T in y)return y[T]},E.prototype.delete=function(s){var y=this.root,e=null,r=null,p,h,a,l;for(a=0,l=s.length;a"u")return!1;e!==null?Object.keys(y).length>1&&(e=null,r=null):Object.keys(y).length<2&&(e=p,r=h)}return T in y?(this.size--,e?delete e[r]:delete y[T],!0):!1},E.prototype.has=function(s){for(var y=this.root,e,r=0,p=s.length;r"u")return!1;return T in y},E.prototype.find=function(s){var y=typeof s=="string",e=this.root,r=[],p,h,a;for(h=0,a=s.length;h"u")return r;for(var l=[e],n=[s],u;l.length;){s=n.pop(),e=l.pop();for(u in e){if(u===T){r.push([s,e[T]]);continue}l.push(e[u]),n.push(y?s+u:s.concat(u))}}return r},E.prototype.values=function(s){var y=this.root,e=[],r,p,h;if(s){for(p=0,h=s.length;p"u")return x.empty()}return e.push(y),new x(function(){for(var a,l=!1,n;e.length;){a=e.pop();for(n in a){if(n===T){l=!0;continue}e.push(a[n])}if(l)return{done:!1,value:a[T]}}return{done:!0}})},E.prototype.prefixes=function(s){var y=this.root,e=[],r=[],p,h,a,l=this.mode==="string";if(s){for(h=0,a=s.length;h"u")return x.empty()}else s=l?"":[];return e.push(y),r.push(s),new x(function(){for(var n,u,f=!1,o;e.length;){n=e.pop(),u=r.pop();for(o in n){if(o===T){f=!0;continue}e.push(n[o]),r.push(l?u+o:u.concat(o))}if(f)return{done:!1,value:u}}return{done:!0}})},E.prototype.keys=E.prototype.prefixes,E.prototype.entries=function(s){var y=this.root,e=[],r=[],p,h,a,l=this.mode==="string";if(s){for(h=0,a=s.length;h"u")return x.empty()}else s=l?"":[];return e.push(y),r.push(s),new x(function(){for(var n,u,f=!1,o;e.length;){n=e.pop(),u=r.pop();for(o in n){if(o===T){f=!0;continue}e.push(n[o]),r.push(l?u+o:u.concat(o))}if(f)return{done:!1,value:[u,n[T]]}}return{done:!0}})},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.entries),E.prototype.inspect=function(){for(var s=new Array(this.size),y=this.entries(),e,r=0;e=y.next(),!e.done;)s[r++]=e.value;return Object.defineProperty(s,"constructor",{value:E,enumerable:!1}),s},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(s){var y=new E;return i(s,function(e,r){y.set(r,e)}),y},E.SENTINEL=T,t.exports=E}),x4=ai((g,t)=>{var i=Gn(),x=_M(),T="\0";function E(y){this.mode=y===Array?"array":"string",this.clear()}for(s in x.prototype)E.prototype[s]=x.prototype[s];var s;delete E.prototype.set,delete E.prototype.get,delete E.prototype.values,delete E.prototype.entries,E.prototype.add=function(y){for(var e=this.root,r,p=0,h=y.length;p"u")return p;for(var n=[r],u=[y],f;n.length;){y=u.pop(),r=n.pop();for(f in r){if(f===T){p.push(y);continue}n.push(r[f]),u.push(e?y+f:y.concat(f))}}return p},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.keys),E.prototype.inspect=function(){for(var y=new Set,e=this.keys(),r;r=e.next(),!r.done;)y.add(r.value);return Object.defineProperty(y,"constructor",{value:E,enumerable:!1}),y},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(y){var e=new E;return i(y,function(r){e.add(r)}),e},E.SENTINEL=T,t.exports=E}),S4=ai((g,t)=>{var i=Hr(),x=Gn(),T=aa(),E=Ns(),s=function(p){return Math.max(1,Math.ceil(p*1.5))},y=function(p){var h=E.getPointerArray(p);return new h(p)};function e(p,h){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var a=h||0,l=s,n=0,u=!1;typeof h=="object"&&(a=h.initialCapacity||0,n=h.initialLength||0,l=h.policy||l,u=h.factory===!0),this.factory=u?p:null,this.ArrayClass=p,this.length=n,this.capacity=Math.max(n,a),this.policy=l,this.array=new p(this.capacity)}e.prototype.set=function(p,h){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(p):this.array=this.factory(p),E.isTypedArray(this.array))this.array.set(h,0);else for(var a=0,l=this.length;a=p)return this;for(h=this.capacity;h=h)return{done:!0};var l=p[a];return a++,{value:l,done:!1}})},e.prototype.entries=function(){var p=this.array,h=this.length,a=0;return new i(function(){if(a>=h)return{done:!0};var l=p[a];return{value:[a++,l],done:!1}})},typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=e.prototype.values),e.prototype.inspect=function(){var p=this.array.slice(0,this.length);return p.type=this.array.constructor.name,p.items=this.length,p.capacity=this.capacity,Object.defineProperty(p,"constructor",{value:e,enumerable:!1}),p},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),e.from=function(p,h,a){if(arguments.length<3&&(a=T.guessLength(p),typeof a!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var l=new e(h,a);return x(p,function(n){l.push(n)}),l};function r(p){var h=function(l){e.call(this,p,l)};for(var a in e.prototype)e.prototype.hasOwnProperty(a)&&(h.prototype[a]=e.prototype[a]);return h.from=function(l,n){return e.from(l,p,n)},typeof Symbol<"u"&&(h.prototype[Symbol.iterator]=h.prototype.values),h}e.Int8Vector=r(Int8Array),e.Uint8Vector=r(Uint8Array),e.Uint8ClampedVector=r(Uint8ClampedArray),e.Int16Vector=r(Int16Array),e.Uint16Vector=r(Uint16Array),e.Int32Vector=r(Int32Array),e.Uint32Vector=r(Uint32Array),e.Float32Vector=r(Float32Array),e.Float64Vector=r(Float64Array),e.PointerVector=r(y),t.exports=e}),T4=ai((g,t)=>{var i=aa(),x=Ns(),T=$M().inplaceQuickSortIndices,E=JM().lowerBoundIndices,s=jx(),y=x.getPointerArray;function e(h,a){return h.distancea.distance?-1:0}function r(h,a,l){for(var n=l.length,u=y(n),f=0,o=new u(n),c=new u(n),d=new u(n),v=new Float64Array(n),m=[0,0,n],S=new Float64Array(n),M,w,C,A,P,b,O,I,D;m.length;)if(P=m.pop(),A=m.pop(),M=m.pop(),w=l[P-1],P--,D=P-A,o[M]=w,D!==0){if(D===1){O=h(a[w],a[l[A]]),v[M]=O,f++,d[M]=f,o[f]=l[A];continue}for(I=A;I0&&(f++,d[M]=f,m.push(f,b,P)),b-A>0&&(f++,c[M]=f,m.push(f,A,b))}return{nodes:o,lefts:c,rights:d,mus:v}}function p(h,a){if(typeof h!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!a)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=h,this.heap=new s(e),this.D=0;var l=i.toArrayWithIndices(a);this.items=l[0];var n=l[1];this.size=n.length;var u=r(h,this.items,n);this.nodes=u.nodes,this.lefts=u.lefts,this.rights=u.rights,this.mus=u.mus}p.prototype.nearestNeighbors=function(h,a){var l=this.heap,n=[0],u=1/0,f,o,c,d,v,m,S;for(this.D=0;n.length;)f=n.pop(),o=this.nodes[f],c=this.items[o],S=this.distance(c,a),this.D++,Sh&&l.pop(),l.size>=h&&(u=l.peek().distance)),d=this.lefts[f],v=this.rights[f],!(!d&&!v)&&(m=this.mus[f],S=m-u&&n.push(v)):(v&&S>=m-u&&n.push(v),d&&S=0;w--)M[w]=l.pop();return M},p.prototype.neighbors=function(h,a){var l=[],n=[0],u,f,o,c,d,v,m;for(this.D=0;n.length;)u=n.pop(),f=this.nodes[u],o=this.items[f],m=this.distance(o,a),this.D++,m<=h&&l.push({distance:m,item:o}),c=this.lefts[u],d=this.rights[u],!(!c&&!d)&&(v=this.mus[u],m=v-h&&n.push(d)):(d&&m>=v-h&&n.push(d),c&&m{var i=jx(),x=kx(),T=XF();t.exports={BiMap:YF(),BitSet:kF(),BitVector:jF(),BloomFilter:ZF(),BKTree:JF(),CircularBuffer:$F(),DefaultMap:QF(),DefaultWeakMap:_F(),FixedDeque:jM(),StaticDisjointSet:qF(),FibonacciHeap:x,MinFibonacciHeap:x.MinFibonacciHeap,MaxFibonacciHeap:x.MaxFibonacciHeap,FixedReverseHeap:Kx(),FuzzyMap:t4(),FuzzyMultiMap:e4(),HashedArrayTree:i4(),Heap:i,MinHeap:i.MinHeap,MaxHeap:i.MaxHeap,StaticIntervalTree:n4(),InvertedIndex:s4(),KDTree:a4(),LinkedList:o4(),LRUCache:Zx(),LRUCacheWithDelete:l4(),LRUMap:QM(),LRUMapWithDelete:h4(),MultiMap:KM(),MultiSet:u4(),PassjoinIndex:f4(),Queue:c4(),FixedStack:ZM(),Stack:d4(),SuffixArray:T,GeneralizedSuffixArray:T.GeneralizedSuffixArray,Set:p4(),SparseQueueSet:v4(),SparseMap:m4(),SparseSet:g4(),SymSpell:y4(),Trie:x4(),TrieMap:_M(),Vector:S4(),VPTree:T4()}}),_t=class cr{static get ZERO(){return new cr(0,0)}static get ONE(){return new cr(1,1)}static get UP(){return new cr(0,-1)}static get DOWN(){return new cr(0,1)}static get LEFT(){return new cr(-1,0)}static get RIGHT(){return new cr(1,0)}static get UP_LEFT(){return new cr(-1,-1)}static get UP_RIGHT(){return new cr(1,-1)}static get DOWN_RIGHT(){return new cr(1,1)}static get DOWN_LEFT(){return new cr(-1,1)}constructor(t,i){typeof t=="number"?(this.x=t,this.y=i||0):(this.x=t.x,this.y=t.y)}clone(){return new cr(this.x,this.y)}add(t){return new cr(this.x+t.x,this.y+t.y)}multiply(t){return new cr(this.x*t.x,this.y*t.y)}divide(t){return new cr(this.x/t.x,this.y/t.y)}subtract(t){return new cr(this.x-t.x,this.y-t.y)}equals(t){return this.x===t.x&&this.y===t.y}abs(){return new cr(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(t){return new cr(this.x%t.x,this.y%t.y)}scalarModulo(t){return new cr(this.x%t,this.y%t)}scalarMult(t){return new cr(this.x*t,this.y*t)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},Ri=class{static equal(g,t){return g.position.x===t.position.x&&g.position.y===t.position.y&&g.layer===t.layer}static copyOver(g,t){t.position.x=g.position.x,t.position.y=g.position.y,t.layer=g.layer}static clone(g){return{position:g.position.clone(),layer:g.layer}}static toString(g){return`${g.position.toString()}#${g.layer}`}static toInternal(g){return{position:new _t(g.position.x,g.position.y),layer:g.charLayer}}static fromInternal(g){return{position:g.position.toPosition(),charLayer:g.layer}}},M4=(g=>(g.NONE="none",g.LEFT="left",g.UP_LEFT="up-left",g.UP="up",g.UP_RIGHT="up-right",g.RIGHT="right",g.DOWN_RIGHT="down-right",g.DOWN="down",g.DOWN_LEFT="down-left",g))(M4||{}),C4={up:"down",down:"up",left:"right",right:"left",none:"none","up-left":"down-right","up-right":"down-left","down-right":"up-left","down-left":"up-right"},w4={up:_t.UP,down:_t.DOWN,left:_t.LEFT,right:_t.RIGHT,none:_t.ZERO,"up-left":_t.UP_LEFT,"up-right":_t.UP_RIGHT,"down-right":_t.DOWN_RIGHT,"down-left":_t.DOWN_LEFT},gm={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},qM=["up","up-right","right","down-right","down","down-left","left","up-left"],A4=["down-left","down-right","up-right","up-left"];function Jx(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function hd(g){return A4.includes(g)}function P4(g,t=1){return g==="none"?"none":qM[(gm[g]+8-Math.abs(t)%8)%8]}function tC(g,t=1){return g==="none"?"none":qM[(gm[g]+t)%8]}function Au(g){return w4[g]}function R4(g){return C4[g]}function Ca(g,t){if(g.x===t.x){if(g.y>t.y)return"up";if(g.yt.x)return"left";if(g.xt.x){if(g.yt.y)return"up-left"}else if(g.xt.y)return"up-right"}return"none"}var b4=(g=>(g[g.FOUR=4]="FOUR",g[g.EIGHT=8]="EIGHT",g))(b4||{});function zf(g){return typeof g=="string"&&Jx().includes(g)}var Ay=function(g,t){return Ay=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,x){i.__proto__=x}||function(i,x){for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(i[T]=x[T])},Ay(g,t)};function Zd(g,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ay(g,t);function i(){this.constructor=g}g.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function L4(g,t,i,x){function T(E){return E instanceof i?E:new i(function(s){s(E)})}return new(i||(i=Promise))(function(E,s){function y(p){try{r(x.next(p))}catch(h){s(h)}}function e(p){try{r(x.throw(p))}catch(h){s(h)}}function r(p){p.done?E(p.value):T(p.value).then(y,e)}r((x=x.apply(g,t||[])).next())})}function eC(g,t){var i={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},x,T,E,s;return s={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function y(r){return function(p){return e([r,p])}}function e(r){if(x)throw new TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(i=0)),i;)try{if(x=1,T&&(E=r[0]&2?T.return:r[0]?T.throw||((E=T.return)&&E.call(T),0):T.next)&&!(E=E.call(T,r[1])).done)return E;switch(T=0,E&&(r=[r[0]&2,E.value]),r[0]){case 0:case 1:E=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,T=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(E=i.trys,!(E=E.length>0&&E[E.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!E||r[1]>E[0]&&r[1]=g.length&&(g=void 0),{value:g&&g[x++],done:!g}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function yd(g,t){var i=typeof Symbol=="function"&&g[Symbol.iterator];if(!i)return g;var x=i.call(g),T,E=[],s;try{for(;(t===void 0||t-- >0)&&!(T=x.next()).done;)E.push(T.value)}catch(y){s={error:y}}finally{try{T&&!T.done&&(i=x.return)&&i.call(x)}finally{if(s)throw s.error}}return E}function xd(g,t,i){if(i||arguments.length===2)for(var x=0,T=t.length,E;x1||y(a,l)})})}function y(a,l){try{e(x[a](l))}catch(n){h(E[0][3],n)}}function e(a){a.value instanceof jf?Promise.resolve(a.value.v).then(r,p):h(E[0][2],a)}function r(a){y("next",a)}function p(a){y("throw",a)}function h(a,l){a(l),E.shift(),E.length&&y(E[0][0],E[0][1])}}function O4(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=g[Symbol.asyncIterator],i;return t?t.call(g):(g=typeof Qf=="function"?Qf(g):g[Symbol.iterator](),i={},x("next"),x("throw"),x("return"),i[Symbol.asyncIterator]=function(){return this},i);function x(E){i[E]=g[E]&&function(s){return new Promise(function(y,e){s=g[E](s),T(y,e,s.done,s.value)})}}function T(E,s,y,e){Promise.resolve(e).then(function(r){E({value:r,done:y})},s)}}function gr(g){return typeof g=="function"}function iC(g){var t=function(x){Error.call(x),x.stack=new Error().stack},i=g(t);return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}var v0=iC(function(g){return function(t){g(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(i,x){return x+1+") "+i.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=t}});function Py(g,t){if(g){var i=g.indexOf(t);0<=i&&g.splice(i,1)}}var qm=function(){function g(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return g.prototype.unsubscribe=function(){var t,i,x,T,E;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var y=Qf(s),e=y.next();!e.done;e=y.next()){var r=e.value;r.remove(this)}}catch(u){t={error:u}}finally{try{e&&!e.done&&(i=y.return)&&i.call(y)}finally{if(t)throw t.error}}else s.remove(this);var p=this.initialTeardown;if(gr(p))try{p()}catch(u){E=u instanceof v0?u.errors:[u]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var a=Qf(h),l=a.next();!l.done;l=a.next()){var n=l.value;try{eT(n)}catch(u){E=E??[],u instanceof v0?E=xd(xd([],yd(E)),yd(u.errors)):E.push(u)}}}catch(u){x={error:u}}finally{try{l&&!l.done&&(T=a.return)&&T.call(a)}finally{if(x)throw x.error}}}if(E)throw new v0(E)}},g.prototype.add=function(t){var i;if(t&&t!==this)if(this.closed)eT(t);else{if(t instanceof g){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(i=this._finalizers)!==null&&i!==void 0?i:[]).push(t)}},g.prototype._hasParent=function(t){var i=this._parentage;return i===t||Array.isArray(i)&&i.includes(t)},g.prototype._addParent=function(t){var i=this._parentage;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t},g.prototype._removeParent=function(t){var i=this._parentage;i===t?this._parentage=null:Array.isArray(i)&&Py(i,t)},g.prototype.remove=function(t){var i=this._finalizers;i&&Py(i,t),t instanceof g&&t._removeParent(this)},g.EMPTY=function(){var t=new g;return t.closed=!0,t}(),g}(),nC=qm.EMPTY;function rC(g){return g instanceof qm||g&&"closed"in g&&gr(g.remove)&&gr(g.add)&&gr(g.unsubscribe)}function eT(g){gr(g)?g():g.unsubscribe()}var sC={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},D4={setTimeout:function(g,t){for(var i=[],x=2;x0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(i){return this._throwIfClosed(),g.prototype._trySubscribe.call(this,i)},t.prototype._subscribe=function(i){return this._throwIfClosed(),this._checkFinalizedStatuses(i),this._innerSubscribe(i)},t.prototype._innerSubscribe=function(i){var x=this,T=this,E=T.hasError,s=T.isStopped,y=T.observers;return E||s?nC:(this.currentObservers=null,y.push(i),new qm(function(){x.currentObservers=null,Py(y,i)}))},t.prototype._checkFinalizedStatuses=function(i){var x=this,T=x.hasError,E=x.thrownError,s=x.isStopped;T?i.error(E):s&&i.complete()},t.prototype.asObservable=function(){var i=new Aa;return i.source=this,i},t.create=function(i,x){return new nT(i,x)},t}(Aa),nT=function(g){Zd(t,g);function t(i,x){var T=g.call(this)||this;return T.destination=i,T.source=x,T}return t.prototype.next=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.next)===null||T===void 0||T.call(x,i)},t.prototype.error=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.error)===null||T===void 0||T.call(x,i)},t.prototype.complete=function(){var i,x;(x=(i=this.destination)===null||i===void 0?void 0:i.complete)===null||x===void 0||x.call(i)},t.prototype._subscribe=function(i){var x,T;return(T=(x=this.source)===null||x===void 0?void 0:x.subscribe(i))!==null&&T!==void 0?T:nC},t}(Nn),hC=new Aa(function(g){return g.complete()});function Y4(g){return g&&gr(g.schedule)}function uC(g){return g[g.length-1]}function fC(g){return Y4(uC(g))?g.pop():void 0}function cC(g,t){return typeof uC(g)=="number"?g.pop():t}var dC=function(g){return g&&typeof g.length=="number"&&typeof g!="function"};function pC(g){return gr(g?.then)}function vC(g){return gr(g[Qx])}function mC(g){return Symbol.asyncIterator&&gr(g?.[Symbol.asyncIterator])}function gC(g){return new TypeError("You provided "+(g!==null&&typeof g=="object"?"an invalid object":"'"+g+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function k4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var yC=k4();function xC(g){return gr(g?.[yC])}function SC(g){return F4(this,arguments,function(){var t,i,x,T;return eC(this,function(E){switch(E.label){case 0:t=g.getReader(),E.label=1;case 1:E.trys.push([1,,9,10]),E.label=2;case 2:return[4,jf(t.read())];case 3:return i=E.sent(),x=i.value,T=i.done,T?[4,jf(void 0)]:[3,5];case 4:return[2,E.sent()];case 5:return[4,jf(x)];case 6:return[4,E.sent()];case 7:return E.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function TC(g){return gr(g?.getReader)}function Du(g){if(g instanceof Aa)return g;if(g!=null){if(vC(g))return j4(g);if(dC(g))return K4(g);if(pC(g))return Z4(g);if(mC(g))return EC(g);if(xC(g))return J4(g);if(TC(g))return $4(g)}throw gC(g)}function j4(g){return new Aa(function(t){var i=g[Qx]();if(gr(i.subscribe))return i.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function K4(g){return new Aa(function(t){for(var i=0;i{let T=this.tilePosInDirection(new _t(i,x),g);return this.tilemap.hasBlockingTile(T,t,R4(g),this.ignoreMissingTiles)})}isCharBlocking(g,t){return this.someCharTile((i,x)=>{let T=this.tilePosInDirection(new _t(i,x),g);return this.tilemap.hasBlockingChar(T,t,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(g){this.isMoving()||g!="none"&&this.changeFacingDirection(g)}changeFacingDirection(g){this.facingDirection!==g&&(this.facingDirection=g,this.directionChanged$.next(g))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(Au(this.facingDirection))}addCollisionGroup(g){this.collisionGroups.add(g)}setCollisionGroups(g){this.collisionGroups=new Set(g)}setIgnoreCollisionGroups(g){this.ignoreCollisionGroups=new Set(g)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(g){return this.collisionGroups.has(g)}removeCollisionGroup(g){this.collisionGroups.delete(g)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(g){for(let t of g)this.labels.add(t)}getLabels(){return[...this.labels.values()]}hasLabel(g){return this.labels.has(g)}clearLabels(){this.labels.clear()}removeLabels(g){for(let t of g)this.labels.delete(t)}getNumberOfDirections(){return this.numberOfDirections}movementStarted(){return this.movementStarted$}movementStopped(){return this.movementStopped$}directionChanged(){return this.directionChanged$}tilePositionSet(){return this.tilePositionSet$}positionChangeStarted(){return this.positionChangeStarted$}positionChangeFinished(){return this.positionChangeFinished$}autoMovementSet(){return this.autoMovementSet$}depthChanged(){return this.depthChanged$}getMovementProgress(){return this.movementProgress}setMovementProgress(g){let t=Math.max(0,Math.min(lu,g));this.movementProgress=t}hasWalkedHalfATile(){return this.movementProgress>lu/2}willCrossTileBorderThisUpdate(g){return this.movementProgress+this.maxProgressForDelta(g)>=lu}updateCharacterPosition(g){let t=this.willCrossTileBorderThisUpdate(g),i=1-(t?lu-this.movementProgress:this.maxProgressForDelta(g))/this.maxProgressForDelta(g);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(g),lu),t&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),i>0&&this.updateCharacterPosition(g*i)):this.stopMoving())}maxProgressForDelta(g){let t=g/1e3;return Math.floor(t*this.speed*lu)}get tilePos(){return Ri.clone(this._tilePos)}set tilePos(g){Ri.copyOver(g,this._tilePos)}startMoving(g){g!=="none"&&(g!=this.movementDirection&&this.movementStarted$.next(g),this.movementDirection=g,this.facingDirection=g,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(g,t){return g.add(Au(this.tilemap.toMapDirection(t)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let g=this.tilePos,t=this.getNextTilePos(),i=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(i),this.fire(this.positionChangeFinished$,g,t)}fire(g,{position:t,layer:i},{position:x,layer:T}){g.next({exitTile:t,enterTile:x,exitLayer:i,enterLayer:T})}someCharTile(g){let t=this.getNextTilePos().position;for(let i=t.x;ithis.isLayerAlwaysOnTop(T));this.tilemap.layers.filter(T=>!this.isLayerAlwaysOnTop(T)).forEach(T=>{this.hasLayerProp(T,hu.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(T,i),t.push(T.tilemapLayer)):this.setDepth(T,++i)}),this.charLayerDepths.set(void 0,i),x.forEach((T,E)=>{T.tilemapLayer.setDepth(E+1+i)}),t.forEach(T=>T.destroy())}setDepth(t,i){t.tilemapLayer.setDepth(i),this.isCharLayer(t)&&this.charLayerDepths.set(this.getLayerProp(t,hu.CHAR_LAYER_PROP_NAME),i)}createHeightShiftLayers(t,i){let x=this.getLayerProp(t,hu.HEIGHT_SHIFT_PROP_NAME);isNaN(x)&&(x=0);let T=1;for(let E=0;ET.name==i);return x?.value}hasLayerProp(t,i){return this.getLayerProp(t,i)!=null}copyLayer(t,i){let x=`${t.name}#${i}`,T=this.tilemap.createBlankLayer(x,t.tilemapLayer.tileset);if(T){if(T.name=x,this.isIsometric())for(let E=i;E>=0;E--){let s=i-E;T.putTileAt(t.data[E][s],s,E)}else for(let E=0;Ey===this.charData.id)).subscribe(({direction:y})=>{var e;(e=this.animation)==null||e.setStandingFrame(y)}),this.sprite&&(this.sprite.setOrigin(0,0),this.resetAnimation(this.sprite),this.updateOverlaySprite(),this.updateGridChar())}destroy(){this.destroy$.next(),this.destroy$.complete(),this.newSpriteSet$.complete()}setSprite(g){g?(this.sprite&&(g.x=this.sprite.x,g.y=this.sprite.y),this.sprite=g,this.newSpriteSet$.next(),this.layerOverlaySprite=this.layerOverlaySprite?this.scene.add.sprite(0,0,this.sprite.texture):void 0,this.updateOverlaySprite(),this.resetAnimation(this.sprite),this.updateDepth()):(this.layerOverlaySprite=void 0,this.sprite=void 0)}getSprite(){return this.sprite}getLayerOverlaySprite(){return this.layerOverlaySprite}setContainer(g){var t;this.container=g,this.cachedContainerHeight=(t=g?.getBounds().height)!=null?t:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(g){this.customOffset.x=g}getOffsetY(){return this.customOffset.y}setOffsetY(g){this.customOffset.y=g}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(g){var t;this.geHeadless.isMoving(this.charData.id)||g!="none"&&(this.geHeadless.turnTowards(this.charData.id,g),(t=this.animation)==null||t.setStandingFrame(g))}getAnimation(){return this.animation}setAnimation(g){this.animation=g}update(g){this.updateGridChar()}getEngineOffset(){var g,t,i,x;if(!this.sprite)return _t.ZERO;let T=this.tilemap.getTileWidth()/2-Math.floor(((t=(g=this.sprite)==null?void 0:g.displayWidth)!=null?t:0)/2),E=-((x=(i=this.sprite)==null?void 0:i.displayHeight)!=null?x:0)+this.tilemap.getTileHeight();return new _t(T,E)}updatePixelPos(){let g=new _t(this.geHeadless.getPosition(this.charData.id)),t=this.geHeadless.getMovementProgress(this.charData.id)/1e3,i=this.tilemap.tilePosToPixelPos(g).add(this.getEngineOffset()).add(this.customOffset).add(Au(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(t))),x=this.getGameObj();x&&(x.x=Math.floor(i.x),x.y=Math.floor(i.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var g;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let t=this.geHeadless.getMovementProgress(this.charData.id)>lu/2;(g=this.getAnimation())==null||g.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),t,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(g){let t=new rT(this.walkingAnimationMapping,g.texture.source[0].width/g.width/rT.FRAMES_CHAR_ROW);this.setAnimation(t),t.frameChange().pipe(Ea(this.newSpriteSet$)).subscribe(i=>{g?.setFrame(i)}),t.setIsEnabled(this.walkingAnimationMapping!==void 0),t.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let g=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-g),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let g=new _t(this.geHeadless.getPosition(this.charData.id)),t=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:g,layer:t}):this.sprite&&this.setSpriteDepth(this.sprite,{position:g,layer:t});let i=this.getLayerOverlaySprite();if(i){let x=new _t(mh(Pn({},g),{y:g.y-1}));this.setSpriteDepth(i,{position:x,layer:t})}}setSpriteDepth(g,t){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthSprite(g))}setContainerDepth(g,t){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthContainer(g))}getPaddedPixelDepthContainer(g){return Fy.shiftPad(g.y+this.cachedContainerHeight,Dy.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(g){return Fy.shiftPad(g.y+g.displayHeight,Dy.Z_INDEX_PADDING)}getTransitionLayer(g){if(g.layer)return this.geHeadless.getTransition(g.position,g.layer)||g.layer}},cO=(g=>(g.DONT_BLOCK="DONT_BLOCK",g.BLOCK_TWO_TILES="BLOCK_TWO_TILES",g.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",g.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",g))(cO||{}),bC=(g=>(g.STOP="STOP",g.CLOSEST_REACHABLE="CLOSEST_REACHABLE",g.RETRY="RETRY",g.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",g))(bC||{}),dO=class{distance(g,t){return no.manhattanDistance(g,t)}direction(g,t){if(no.equal(g,t))return"none";let i=g.clone().subtract(t);return Math.abs(i.x)>Math.abs(i.y)?i.x>0?"left":"right":i.y>0?"up":"down"}neighbors(g){return[new _t(g.x,g.y+1),new _t(g.x+1,g.y),new _t(g.x-1,g.y),new _t(g.x,g.y-1)]}getDirections(){return["up","right","down","left"]}},pO=class{distance(g,t){return no.chebyshevDistance(g,t)}neighbors(g){let t=[new _t(g.x,g.y+1),new _t(g.x+1,g.y),new _t(g.x-1,g.y),new _t(g.x,g.y-1)],i=[new _t(g.x+1,g.y+1),new _t(g.x+1,g.y-1),new _t(g.x-1,g.y+1),new _t(g.x-1,g.y-1)];return[...t,...i]}direction(g,t){return t.x>g.x?t.y>g.y?"down-right":t.yg.y?"down-left":t.yg.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},Sd=class{static create(g){switch(g){case 4:return new dO;case 8:return new pO}}},sT=class{constructor(g,t,i){this.backoffMs=g,this.maxRetries=t,this.onFinished=i,this.retries=0,this.elapsed=0}retry(g,t){this.shouldRetry()?(this.elapsed+=g,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,t())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(g.WAIT="WAIT",g.RETRY="RETRY",g.STOP="STOP",g))(LC||{}),tg=class{constructor(g,{shortestPathAlgorithm:t="BFS",pathWidth:i=1,pathHeight:x=1,numberOfDirections:T=4,isPositionAllowed:E=(u,f)=>!0,collisionGroups:s=[],ignoredChars:y=[],ignoreTiles:e=!1,ignoreMapBounds:r=!1,ignoreBlockedTarget:p=!1,maxPathLength:h=1/0,ignoreLayers:a=!1,considerCosts:l=!1,calculateClosestToTarget:n=!0}={}){this.gridTilemap=g,this.options={shortestPathAlgorithm:t,pathWidth:i,pathHeight:x,numberOfDirections:T,isPositionAllowed:E,collisionGroups:s,ignoredChars:y,ignoreTiles:e,ignoreMapBounds:r,ignoreBlockedTarget:p,maxPathLength:h,ignoreLayers:a,considerCosts:l,calculateClosestToTarget:n},this.ignoredCharsSet=new Set(y)}findShortestPath(g,t){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(g.layer),t.layer=g.layer);let i=this.findShortestPathImpl(g,t);return this.gridTilemap.unfixCacheLayers(),i}getNeighbors(g,t){var i;return Sd.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position).map(x=>{let T=g.layer;return this.options.ignoreLayers||(T=this.gridTilemap.getTransition(x,g.layer)),{position:x,layer:T||g.layer}}).filter(x=>!this.isBlocking(g,x)||this.options.ignoreBlockedTarget&&Ri.equal(x,t))}getTransition(g,t){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(g,t)}getCosts(g,t){if(!this.options.considerCosts)return 1;let i=Ca(t.position,g);return this.gridTilemap.getTileCosts(t,i)}isBlocking(g,t){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(t.position))||!this.options.isPositionAllowed(t.position,t.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(g,t,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(g,t,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(g,t){return(this.options.numberOfDirections===4?no.manhattanDistance:no.chebyshevDistance)(g,t)}getTilePosInDir(g,t){return this.options.ignoreLayers?{position:g.position.add(Au(this.gridTilemap.toMapDirection(t))),layer:g.layer}:this.gridTilemap.getTilePosInDirection(g,t)}getReverseNeighbors(g,t){var i;let x=Sd.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position),T;if(!this.options.ignoreLayers){let E=this.gridTilemap.getReverseTransitions(g.position,g.layer);T=E?[...E]:void 0}return x.map(E=>T?T.map(s=>({position:E,layer:s||g.layer})):[{position:E,layer:g.layer}]).flat().filter(E=>!this.isBlocking(E,g)||this.options.ignoreBlockedTarget&&Ri.equal(g,t))}hasBlockingCharFrom(g,t,i,x,T,E,s){if(i===1&&x===1)return s.hasBlockingChar(t.position,t.layer,T,E);let y=r=>s.hasBlockingChar(r,t.layer,T,E),e=Ca(g.position,t.position);return this.isBlockingMultiTile(g,e,i,x,y)}hasBlockingTileFrom(g,t,i,x,T,E){if(i===1&&x===1)return E.hasBlockingTile(t.position,t.layer,Ca(t.position,g.position),T);let s=Ca(g.position,t.position),y=e=>E.hasBlockingTile(e,t.layer,s,T);return this.isBlockingMultiTile(g,s,i,x,y)}isBlockingMultiTile(g,t,i,x,T){let E={src:new _t(g.position.x+i,g.position.y),dest:new _t(g.position.x+i,g.position.y+x-1)},s={src:new _t(g.position.x-1,g.position.y),dest:new _t(g.position.x-1,g.position.y+x-1)},y={src:new _t(g.position.x,g.position.y-1),dest:new _t(g.position.x+i-1,g.position.y-1)},e={src:new _t(g.position.x,g.position.y+x),dest:new _t(g.position.x+i-1,g.position.y+x)};switch(t){case"right":return this.checkLine(E,T);case"left":return this.checkLine(s,T);case"up":return this.checkLine(y,T);case"down":return this.checkLine(e,T);case"up-left":return this.checkLine({src:y.src,dest:new _t(y.dest.x-1,y.dest.y)},T)||this.checkLine({src:new _t(s.src.x,s.src.y-1),dest:new _t(s.dest.x,s.dest.y-1)},T);case"up-right":return this.checkLine({src:new _t(y.src.x+1,y.src.y),dest:y.dest},T)||this.checkLine({src:new _t(E.src.x,E.src.y-1),dest:new _t(E.dest.x,E.dest.y-1)},T);case"down-left":return this.checkLine({src:new _t(s.src.x,s.src.y+1),dest:new _t(s.dest.x,s.dest.y+1)},T)||this.checkLine({src:e.src,dest:new _t(e.dest.x-1,e.dest.y)},T);case"down-right":return this.checkLine({src:new _t(e.src.x+1,e.src.y),dest:e.dest},T)||this.checkLine({src:new _t(E.src.x,E.src.y+1),dest:new _t(E.dest.x,E.dest.y+1)},T)}return!1}checkLine(g,t){for(let i=g.src.x;i<=g.dest.x;i++)for(let x=g.src.y;x<=g.dest.y;x++)if(t(new _t(i,x)))return!0;return!1}},vO=YM(kx(),1),mO=class extends tg{findShortestPathImpl(g,t){let i=this.shortestPathBfs(g,t);return{path:this.returnPath(i.previous,g,t),closestToTarget:i.closestToTarget,steps:i.steps,maxPathLengthReached:i.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(g,t){let i=new Map,x=new Map,T=new Map,E=new vO.MinFibonacciHeap((r,p)=>Yc(T,r)-Yc(T,p)),s=g,y=this.distance(g.position,t.position),e=0;for(E.push(g),x.set(Ri.toString(g),0),T.set(Ri.toString(g),this.distance(g.position,t.position));E.size>0;){let r=E.pop();if(!r)break;e++;let p=this.distance(r.position,t.position);if(pthis.options.maxPathLength)return{previous:new Map,closestToTarget:s,steps:e,maxPathLengthReached:!0};for(let h of this.getNeighbors(r,t)){let a=Yc(x,r)+this.getCosts(r.position,h),l=Ri.toString(h);(!x.has(l)||a0;){let e=T.dequeue();if(y++,!e)break;let{node:r,dist:p}=e;if(p>this.options.maxPathLength)return{previous:new Map,closestToTarget:E,steps:y,maxPathLengthReached:!0};let h=this.distance(r.position,t.position);if(hthis.lastDist)}step(g,t,i){var x;this.lastDist=i;for(let T of g){let E=Ri.toString(T);if(!this.visited.has(E)){this.previous.set(E,t),this.queue.enqueue({node:T,dist:i+1}),this.visited.set(E,i+1);let s=(x=this.otherBfs)==null?void 0:x.visited.get(E);s!==void 0&&s0,T.queue.size()>0);){let e=x.queue.dequeue();if(!e)break;let{node:r,dist:p}=e;if(p+1+(((i=T.queue.peek())==null?void 0:i.dist)||0)>this.options.maxPathLength)return{previous:x.previous,previous2:T.previous,closestToTarget:this.maybeClosestToTarget(s),steps:E,maxPathLengthReached:!0};let h=this.distance(r.position,t.position);if(hkc(this.f,T)-kc(this.f,E)),this.openSet.push(g);let x=Ri.toString(g);for(this.g.set(x,0),this.f.set(x,this.distance(g.position,t.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let T=this.openSet.pop();if(!T)break;if(this.steps++,Ri.equal(T,t))return{previous:i,closestToTarget:t,steps:this.steps,maxPathLengthReached:!1};if(kc(this.g,T)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(T,t);for(let E of this.getNeighborsInternal(T,i.get(Ri.toString(T)),t)){let s=Ri.toString(E.p),y=kc(this.g,T)+E.dist;(!this.g.has(s)||y({p:E,dist:1}));let x=this.prune(t,g).filter(E=>!this.isBlockingIgnoreTarget(g,E,i)).map(E=>{let s=this.getTransition(E.position,g.layer);return{position:E.position,layer:s||g.layer}}),T=[];for(let E of x)if(this.isHorizontal(g.position,E.position))T.push({p:E,dist:1});else{let s=this.jump(g,E,i,1,Ca(g.position,E.position));s&&T.push(s)}return T}isBlockingIgnoreTarget(g,t,i){return this.isBlocking(g,t)&&!(this.options.ignoreBlockedTarget&&Ri.equal(t,i))}jump(g,t,i,x,T){if(!this.isBlockingIgnoreTarget(g,t,i))return Ri.equal(t,i)?{p:t,dist:x}:x>=this.maxJumpSize?{p:t,dist:x}:this.getTransition(t.position,g.layer)!==void 0?{p:t,dist:x}:this.hasForced(g,t)?{p:t,dist:x}:(this.updateClosestToTarget(t,i),this.jump(t,this.getTilePosInDir(t,T),i,x+1,T))}isHorizontal(g,t){return g.y===t.y}getForced(g,t,i,x,T,E){let s=[],y=g;return(this.blockOrTrans(y,i)||this.blockOrTrans(i,x))&&this.addIfNotBlocked(s,t,x),(this.blockOrTrans(y,T)||this.blockOrTrans(T,E))&&this.addIfNotBlocked(s,t,E),s}hasForced(g,t){let{topLeft:i,downLeft:x,top:T,bottom:E}=this.normalizedPositions(g,t);return!!((this.blockOrTrans(g,x)||this.blockOrTrans(x,E))&&!this.blockOrTrans(t,E)||(this.blockOrTrans(g,i)||this.blockOrTrans(i,T))&&!this.blockOrTrans(t,T))}prune(g,t){let{right:i,top:x,bottom:T,downLeft:E,topLeft:s}=this.normalizedPositions(g,t);return this.isHorizontal(g.position,t.position)?[i,x,T]:[i,...this.getForced(g,t,E,T,s,x)]}normalizedPositions(g,t){return g.position.xt.position.x?{topLeft:{position:new _t(t.position.x+1,t.position.y+1),layer:t.layer},downLeft:{position:new _t(t.position.x+1,t.position.y-1),layer:t.layer},top:{position:new _t(t.position.x,t.position.y+1),layer:t.layer},bottom:{position:new _t(t.position.x,t.position.y-1),layer:t.layer},right:{position:new _t(t.position.x-1,t.position.y),layer:t.layer}}:g.position.y1?this.fillPath(T,E,x):x.push(E),T=E}return x.reverse()}fillPath(g,t,i){let x=g;do{let T=Ca(x.position,t.position);x=this.getTilePosInDir(x,T),i.push(x)}while(!no.equal(x.position,t.position))}};function kc(g,t){var i;return(i=g.get(Ri.toString(t)))!=null?i:Number.MAX_VALUE}var yO=class{constructor(g,t,i,x={}){this.character=g,this.gridTilemap=t,this.charToFollow=i;let T={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:x.considerCosts||!1,facingDirection:"none"};this.options=Pn(Pn({},T),x),this.options.considerCosts&&this.options.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.options.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.options.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.character=g,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(Ea(this.character.autoMovementSet().pipe(gh(E=>E!==this),rc(1)))).subscribe(({enterTile:E,enterLayer:s})=>{this.updateTarget(E,s)})}update(g){var t;(t=this.targetMovement)==null||t.update(g)}getInfo(){return{type:"Follow",config:{charToFollow:this.charToFollow.getId(),distance:this.options.distance,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,facingDirection:this.options.facingDirection,shortestPathAlgorithm:this.options.shortestPathAlgorithm}}}getFacingPos(){let g=gm[this.options.facingDirection]+gm[this.charToFollow.getFacingDirection()],t=tC("up",g),i={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return t==="right"?i.x+=this.charToFollow.getTileWidth()-1:t==="down"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-left"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-right"?(i.y+=this.charToFollow.getTileWidth()-1,i.x+=this.charToFollow.getTileWidth()-1):t==="up-right"&&(i.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new _t(i),layer:this.charToFollow.getTilePos().layer},t).position}updateTarget(g,t){let i=this.options.facingDirection!=="none"&&this.options.distance===0;i&&(g=this.getFacingPos()),this.targetMovement=new UC(this.character,this.gridTilemap,{position:new _t(g),layer:t},{distance:i?0:this.options.distance+1,config:{algorithm:this.options.shortestPathAlgorithm,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,considerCosts:this.options.considerCosts,ignoredChars:[this.charToFollow.getId()]}})}},uT=class{static getRandomInt(g){return Math.floor(Math.random()*Math.floor(g))}},xO=class{constructor(g,t=0,i=-1){this.character=g,this.delay=t,this.radius=i,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=g.getNextTilePos().position.y,this.initialCol=g.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(Ea(this.character.autoMovementSet().pipe(gh(x=>x!==this),rc(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=Sd.create(g.getNumberOfDirections())}update(g){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=g,this.delayLeft<=0){this.delayLeft=this.delay;let t=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(t),this.currentMovementDirection=t,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(g)).filter(g=>this.isWithinRadius(g))}isWithinRadius(g){return this.radius==-1?!0:this.getDist(g)<=this.radius}getDist(g){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(Au(g)),new _t(this.initialCol,this.initialRow))}getFreeRandomDirection(){let g=this.getFreeDirections();return g.length==0?"none":g[uT.getRandomInt(g.length)]}randomizeStepSize(){this.stepSize=uT.getRandomInt(this.radius)+1}};function SO(g,t){return g.filter(i=>{var x,T,E,s,y,e;return(x=t.labels)!=null&&x.withAllLabels?(T=t.labels)==null?void 0:T.withAllLabels.every(r=>i.hasLabel(r)):(E=t.labels)!=null&&E.withOneOfLabels?(s=t.labels)==null?void 0:s.withOneOfLabels.some(r=>i.hasLabel(r)):(y=t.labels)!=null&&y.withNoneLabels?!((e=t.labels)!=null&&e.withNoneLabels.some(r=>i.hasLabel(r))):!0})}var DC="2.44.6",TO=class{constructor(g,t){this.collistionStrategy=g,this.collisionGroupRelation=t,this.tilePosToCharacters=new EO,this.charRemoved$=new Nn}isCharBlockingAt(g,t,i,x=new Set,T=new Set){if(i.length===0)return!1;let E=this.tilePosToCharacters.get(g,t);return!!(E&&E.size>0&&[...E].filter(s=>!x.has(s.getId())).filter(s=>!this.doIntersect(s.getCollisionGroups(),T)).some(s=>i.some(y=>s.getCollisionGroups().some(e=>this.collidesWith(y,e)))))}doIntersect(g,t){for(let i of g)if(t.has(i))return!0;return!1}collidesWith(g,t){return this.collisionGroupRelation?(this.collisionGroupRelation.get(g)||new Set).has(t):g===t}getCharactersAt(g,t){return this.tilePosToCharacters.get(g,t)||new Set}addCharacter(g){this.addTilePositions(g.getTilePos(),g),this.addTilePositions(g.getNextTilePos(),g),this.addPositionChangeSub(g),this.addPositionChangeFinishedSub(g),this.addTilePosSetSub(g)}removeCharacter(g){let t=g.getId();this.charRemoved$.next(t),this.deleteTilePositions(g.getTilePos(),g),this.deleteTilePositions(g.getNextTilePos(),g)}add(g,t,i){let x=this.tilePosToCharacters.get(g,t);x||this.tilePosToCharacters.set(g,t,new Set([i])),x?.add(i)}addTilePosSetSub(g){g.tilePositionSet().pipe(Ea(this.charRemoved(g.getId()))).subscribe(t=>{this.deleteTilePositions(g.getNextTilePos(),g),this.addTilePositions(t,g)})}charRemoved(g){var t;return(t=this.charRemoved$)==null?void 0:t.pipe(rc(1),gh(i=>i==g))}addPositionChangeSub(g){g.positionChangeStarted().pipe(Ea(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(t.exit,g),this.addTilePositions(t.enter,g)})}addPositionChangeFinishedSub(g){g.positionChangeFinished().pipe(Ea(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.deleteTilePositions(t.exit,g),this.addTilePositions(t.enter,g)})}addTilePositions(g,t){this.forEachCharTile(g,t,(i,x)=>{this.add(new _t(i,x),g.layer,t)})}deleteTilePositions(g,t){this.forEachCharTile(g,t,(i,x)=>{var T;(T=this.tilePosToCharacters.get(new _t(i,x),g.layer))==null||T.delete(t)})}forEachCharTile(g,t,i){let x=g.position;for(let T=x.x;T({enter:{position:new _t(g.enterTile),layer:g.enterLayer},exit:{position:new _t(g.exitTile),layer:g.exitLayer}})))}posToString(g,t){return`${g.x}#${g.y}#${t}`}},EO=class{constructor(){this.memo=new Map}set(g,t,i){let x=this.memo.get(g.x);x||(x=new Map,this.memo.set(g.x,x));let T=x.get(g.y);T||(T=new Map,x.set(g.y,T)),T.set(t,i)}get(g,t){let i=this.memo.get(g.x);if(!i)return;let x=i.get(g.y);if(x)return x.get(t)}},_x=class{constructor(g,t,i,x){this.x=g,this.y=t,this.width=i,this.height=x}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(g){return g.x>=this.x&&g.x=this.y&&g.yi.isCharLayer());for(let i of[...t,void 0]){let x=this.tileCollisionCache.get(i?.getName());if(x===void 0){x=new Array(this.tilemap.getWidth());for(let T=0;T>t&1)==1}var cT="ge_cost",IC=class NC{constructor(t,i,x,T=void 0,E=!1){this.tilemap=t,this.collisionTilePropertyName=i,this.useTileCollisionCache=E,this.characters=new Map,this.transitions=new Map,this.reverseTransitions=new Map,this.collidesPropNames=new Map,this.tileCostPropNames=new Map,this.collisionRelevantLayersFrameCache=new Map,this.charBlockCache=new TO(x,T);for(let s of Jx())this.collidesPropNames.set(s,NC.ONE_WAY_COLLIDE_PROP_PREFIX+s),this.tileCostPropNames.set(s,`${cT}_${s}`);this.useTileCollisionCache&&(this.tileCollisionCache=new CO(t,this),this.tileCollisionCache.rebuild())}fixCacheLayer(t){var i;(i=this.tileCollisionCache)==null||i.fixLayer(t)}unfixCacheLayers(){var t;(t=this.tileCollisionCache)==null||t.unfixLayers()}addCharacter(t){this.characters.set(t.getId(),t);let i=t.getNextTilePos().layer;i===void 0?t.setTilePosition(mh(Pn({},t.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(i)||console.warn(`Char layer '${i}' of character '${t.getId()}' is unknown.`),this.charBlockCache.addCharacter(t)}removeCharacter(t){let i=this.characters.get(t);i&&(this.charBlockCache.removeCharacter(i),this.characters.delete(t))}getCharacters(){return[...this.characters.values()]}getCharactersAt(t,i){return this.charBlockCache.getCharactersAt(t,i)}rebuildTileCollisionCache(t){var i;(i=this.tileCollisionCache)==null||i.rebuild(t)}hasBlockingTileUncached(t,i,x,T){if(!T&&this.hasNoTileUncached(t,i))return!0;let E=this.getCollisionRelevantLayers(i);for(let s of E)if(this.isLayerBlockingAt(s.getName(),t,x))return!0;return!1}hasBlockingTile(t,i,x,T){var E;let s=(E=this.tileCollisionCache)==null?void 0:E.isBlockingFrom(t.x,t.y,i,x,T);return s!==void 0?s:this.hasBlockingTileUncached(t,i,x,T)}getTransition(t,i){let x=this.transitions.get(t.toString());if(x)return x.get(i)}getReverseTransitions(t,i){let x=this.reverseTransitions.get(t.toString());if(x)return x.get(i)}setTransition(t,i,x){var T,E,s,y,e;this.transitions.has(t.toString())||this.transitions.set(t.toString(),new Map),this.reverseTransitions.has(t.toString())||this.reverseTransitions.set(t.toString(),new Map),(T=this.transitions.get(t.toString()))==null||T.set(i,x),(E=this.reverseTransitions.get(t.toString()))!=null&&E.has(x)||(s=this.reverseTransitions.get(t.toString()))==null||s.set(x,new Set),(e=(y=this.reverseTransitions.get(t.toString()))==null?void 0:y.get(x))==null||e.add(i)}getTransitions(){return new Map([...this.transitions].map(([t,i])=>[t,new Map(i)]))}getTileCosts(t,i){let x=this.getCollisionRelevantLayers(t.layer),T=1;for(let E of x)T=Math.max(T,this.getTileCostsForLayer(mh(Pn({},t),{layer:E.getName()}),i));return T}getTileCostsForLayer(t,i){let x=this.tilemap.getTileAt(t.position.x,t.position.y,t.layer);return i&&x?.getProperty(this.tileCostPropNames.get(i)||"")||x?.getProperty(cT)||1}hasNoTileUncached(t,i){return!this.getCollisionRelevantLayers(i).some(x=>this.tilemap.hasTileAt(t.x,t.y,x.getName()))}hasNoTile(t,i){var x;let T=(x=this.tileCollisionCache)==null?void 0:x.hasTileAt(t.x,t.y,i);return T!==void 0?T:this.hasNoTileUncached(t,i)}hasBlockingChar(t,i,x,T=new Set,E=new Set){return this.charBlockCache.isCharBlockingAt(t,i,x,T,E)}isInRange(t){return new _x(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(t)}toMapDirection(t){return this.isIsometric()?P4(t):t}fromMapDirection(t){return this.isIsometric()?tC(t):t}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(t,i){let x=t.position.add(Au(this.toMapDirection(i))),T=this.getTransition(x,t.layer)||t.layer;return{position:x,layer:T}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(t,i,x){let T=this.tilemap.getTileAt(i.x,i.y,t);return T?!!(T.getProperty(this.collisionTilePropertyName)||x&&T.getProperty(this.collidesPropNames.get(x)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((t,i)=>({layer:t,index:i})).filter(({layer:t})=>t.isCharLayer()).map(({index:t})=>t)}findPrevAndCharLayer(t){let i=this.getCharLayerIndexes(),x=this.tilemap.getLayers(),T=i.findIndex(E=>x[E].getProperty(em)==t);return T==0?{prevIndex:-1,charLayerIndex:i[T]}:{prevIndex:i[T-1],charLayerIndex:i[T]}}getCollisionRelevantLayers(t){if(!t)return this.tilemap.getLayers();let i=this.collisionRelevantLayersFrameCache.get(t);if(i)return i;let{prevIndex:x,charLayerIndex:T}=this.findPrevAndCharLayer(t),E=this.tilemap.getLayers().slice(x+1,T+1);return this.collisionRelevantLayersFrameCache.set(t,E),E}getLowestCharLayer(){for(let t of this.tilemap.getLayers())if(t.isCharLayer())return t.getProperty(em)}getCharLayerNames(){return this.tilemap.getLayers().filter(t=>t.isCharLayer()).map(t=>t.getProperty(em)).filter(AO)}};IC.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var wO=IC;function AO(g){return g!=null}var PO=(g=>(g.REMOVED="REMOVED",g.ADDED="ADDED",g))(PO||{}),RO=(g=>(g.WAIT="WAIT",g.SKIP="SKIP",g.STOP="STOP",g))(RO||{}),bO=class{constructor(g,t){this.character=g,this.tilemap=t,this.queue=new ym,this.finished$=new Nn,this.pathBlockedWaitElapsed=0,this.distanceUtils=Sd.create(g.getNumberOfDirections()),this.character.autoMovementSet().pipe(gh(i=>i!==this),rc(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(g){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(g))&&this.queue.size()>0&&this.moveCharOnPath(g)}getInfo(){return{type:"Queue"}}enqueue(g,t={}){var i,x,T;let E={pathBlockedStrategy:(i=t.pathBlockedStrategy)!=null?i:"STOP",pathBlockedWaitTimeoutMs:t?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(x=t.ignoreInvalidPositions)!=null?x:!1,skipInvalidPositions:(T=t.skipInvalidPositions)!=null?T:!1};for(let s of g){let y={command:s,config:E};if(zf(s)){this.queue.enqueue(y);continue}let e=this.queue.peekEnd(),r=e?.command;if(r||(r=this.character.getNextTilePos()),zf(r)){this.queue.enqueue(y);continue}let p=this.distanceUtils.distance(r.position,s.position)===1;(!t.ignoreInvalidPositions||p)&&this.queue.enqueue(y)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(g){let t=this.queue.peek();if(!t)return;let i=t.command,x=t.config;if(zf(i)&&(i=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),i)),x.skipInvalidPositions){if(i=this.getNextValidPosition(),!i){this.finishInvalidNextPos(i);return}}else if(!this.isNeighborPos(i)){this.finishInvalidNextPos(i);return}if(this.character.isBlockingDirection(Ca(this.character.getNextTilePos().position,i.position))){if(x.pathBlockedStrategy==="STOP")this.finishPathBlocked(i);else if(x.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(g);return}else x.pathBlockedStrategy==="WAIT"&&x.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=g,this.pathBlockedWaitElapsed>=x.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(i,x.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,i.position)),this.isLastMovement()&&this.finish("SUCCESS","",i)}getNextValidPosition(){for(var g;this.queue.size()>0;){let t=(g=this.queue.peek())==null?void 0:g.command;if(zf(t)&&(t=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),t)),t&&this.isNeighborPos(t))return t;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(g){let t=this.distanceUtils.distance(this.character.getNextTilePos().position,g.position)===1,i=this.tilemap.getTransition(g.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==g.layer)return t&&i===g.layer;let x=i!==void 0&&i!==g.layer;return t&&!x}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(g){g?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(g)} is not reachable from ${this.posToStr(this.character.getNextTilePos())}.`):this.finish("INVALID_NEXT_POS",`No enqueued position is reachable from ${this.posToStr(this.character.getNextTilePos())}.`)}finishPathBlocked(g){this.finish("PATH_BLOCKED",`Position ${this.posToStr(g)} is blocked.`)}finishBlockedWaitTimeout(g,t){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(g)} is blocked and the wait timeout of ${t} ms has been exceeded.`)}finish(g,t="",i=this.character.getNextTilePos()){this.queue=new ym,this.finished$.next({position:i.position,result:g,description:t,layer:i.layer})}getDir(g,t){return this.tilemap.fromMapDirection(Ca(g,t))}posToStr(g){return`(${g.position.x}, ${g.position.y}, ${g.layer})`}},LO=class{constructor(g=!0){this.isCreatedInternal=!1,g&&console.log(`Using GridEngine v${DC}`)}getCharLayer(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().layer}getTransition(g,t){var i;return this.initGuard(),(i=this.gridTilemap)==null?void 0:i.getTransition(new _t(g),t)}setTransition(g,t,i){var x;return this.initGuard(),(x=this.gridTilemap)==null?void 0:x.setTransition(new _t(g),t,i)}create(g,t){this.isCreatedInternal=!0,this.gridCharacters=new Map;let i=this.setConfigDefaults(t);this.config=i,this.movementStopped$=new Nn,this.movementStarted$=new Nn,this.directionChanged$=new Nn,this.positionChangeStarted$=new Nn,this.positionChangeFinished$=new Nn,this.queueMovementFinished$=new Nn,this.charRemoved$=new Nn,this.charAdded$=new Nn,this.gridTilemap=new wO(g,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(g){return g?new Map(Object.entries(g).map(([t,i])=>[t,new Set(i)])):void 0}getPosition(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().position}move(g,t){this.moveChar(g,t)}moveRandomly(g,t=0,i=-1){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);let E=new xO(T,t,i);T.setMovement(E)}getMovement(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getMovement();return x?x.getInfo():{type:"None"}}moveTo(g,t,i){var x;let T=this.assembleMoveToConfig(i);this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let s=new UC(E,this.gridTilemap,{position:new _t(t),layer:i?.targetLayer||E.getNextTilePos().layer},{distance:0,config:T});return E.setMovement(s),s.finishedObs().pipe(ud(y=>({charId:g,position:y.position,result:y.result,description:y.description,layer:y.layer})))}stopMovement(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);i.setMovement(void 0)}setSpeed(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setSpeed(t)}getSpeed(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getSpeed()}collidesWithTiles(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.collidesWithTiles()}update(g,t){var i;if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(t);(i=this.gridTilemap)==null||i.invalidateFrameCache()}addCharacter(g){var t,i,x,T,E;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let s={speed:g.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:g.charLayer,facingDirection:g.facingDirection,labels:g.labels,numberOfDirections:(t=g.numberOfDirections)!=null?t:this.config.numberOfDirections,tileWidth:g.tileWidth,tileHeight:g.tileHeight};typeof g.collides=="boolean"?g.collides===!1&&(s.collidesWithTiles=!1,s.collisionGroups=[]):g.collides!==void 0&&(g.collides.collidesWithTiles===!1&&(s.collidesWithTiles=!1),g.collides.collisionGroups&&(s.collisionGroups=g.collides.collisionGroups),g.collides.ignoreCollisionGroups&&(s.ignoreCollisionGroups=g.collides.ignoreCollisionGroups),s.ignoreMissingTiles=(x=(i=g.collides)==null?void 0:i.ignoreMissingTiles)!=null?x:!1);let y=new uO(g.id,s);g.startPosition&&y.setTilePosition({position:new _t(g.startPosition),layer:y.getTilePos().layer}),(T=this.gridCharacters)==null||T.set(g.id,y),this.gridTilemap.addCharacter(y);let e=y.getId();y.movementStopped().pipe(Ea(this.charRemoved(e))).subscribe(r=>{var p;(p=this.movementStopped$)==null||p.next({charId:e,direction:r})}),y.movementStarted().pipe(Ea(this.charRemoved(e))).subscribe(r=>{var p;(p=this.movementStarted$)==null||p.next({charId:e,direction:r})}),y.directionChanged().pipe(Ea(this.charRemoved(e))).subscribe(r=>{var p;(p=this.directionChanged$)==null||p.next({charId:e,direction:r})}),y.positionChangeStarted().pipe(Ea(this.charRemoved(e))).subscribe(r=>{var p;(p=this.positionChangeStarted$)==null||p.next(Pn({charId:e},r))}),y.positionChangeFinished().pipe(Ea(this.charRemoved(e))).subscribe(r=>{var p;(p=this.positionChangeFinished$)==null||p.next(Pn({charId:e},r))}),(E=this.charAdded$)==null||E.next(e)}hasCharacter(g){var t;return this.initGuard(),!!((t=this.gridCharacters)!=null&&t.has(g))}removeCharacter(g){var t,i,x,T;if(this.initGuard(),!((t=this.gridCharacters)!=null&&t.get(g)))throw this.createCharUnknownErr(g);(i=this.gridTilemap)==null||i.removeCharacter(g),(x=this.gridCharacters)==null||x.delete(g),(T=this.charRemoved$)==null||T.next(g)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let g of this.gridCharacters.keys())this.removeCharacter(g)}getAllCharacters(g){if(this.initGuard(),!this.gridCharacters)return[];let t=[...this.gridCharacters.values()];return(g?SO(t,g):t).map(i=>i.getId())}getLabels(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getLabels()}addLabels(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.addLabels(t)}removeLabels(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.removeLabels(t)}clearLabels(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);i.clearLabels()}follow(g,t,i,x){var T,E,s,y,e,r;let p;i===void 0?p={distance:0,closestPointIfBlocked:!1}:typeof i=="number"?(p={distance:i,closestPointIfBlocked:!1},x&&(p.closestPointIfBlocked=!0)):p=i,this.initGuard();let h=(T=this.gridCharacters)==null?void 0:T.get(g),a=(E=this.gridCharacters)==null?void 0:E.get(t);if(!h)throw this.createCharUnknownErr(g);if(!a)throw this.createCharUnknownErr(t);if(!this.gridTilemap)throw this.createUninitializedErr();let l=new yO(h,this.gridTilemap,a,{distance:(s=p.distance)!=null?s:0,noPathFoundStrategy:p.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(y=p.maxPathLength)!=null?y:1/0,shortestPathAlgorithm:(e=p.algorithm)!=null?e:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!p.ignoreLayers,facingDirection:(r=p.facingDirection)!=null?r:"none"});h.setMovement(l)}isMoving(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.isMoving()}getFacingDirection(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getFacingDirection()}getFacingPosition(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getFacingPosition();return{x:x.x,y:x.y}}turnTowards(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);return x.turnTowards(t)}getCharactersAt(g,t){if(this.initGuard(),!this.gridTilemap)return[];let i=this.gridTilemap.getCharactersAt(new _t(g),t);return Array.from(i).map(x=>x.getId())}setPosition(g,t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);i||T.setTilePosition({position:new _t(t),layer:T.getTilePos().layer}),T.setTilePosition({position:new _t(t),layer:i})}isBlocked(g,t,i=["geDefault"]){var x,T;this.initGuard();let E=new _t(g);return!!((x=this.gridTilemap)!=null&&x.hasBlockingTile(E,t)||(T=this.gridTilemap)!=null&&T.hasBlockingChar(E,t,i))}isTileBlocked(g,t){var i;return this.initGuard(),!!((i=this.gridTilemap)!=null&&i.hasBlockingTile(new _t(g),t))}getCollisionGroups(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getCollisionGroups()||[]}setCollisionGroups(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setCollisionGroups(t)}getIgnoreCollisionGroups(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setIgnoreCollisionGroups(t)}getTilePosInDirection(g,t,i){if(!this.gridTilemap)throw this.createUninitializedErr();let x=this.gridTilemap.getTilePosInDirection({position:new _t(g),layer:t},i);return{position:x.position.toPosition(),charLayer:x.layer}}findShortestPath(g,t,i={}){if(!this.gridTilemap)throw this.createUninitializedErr();let x=i.shortestPathAlgorithm||"BFS";i.considerCosts&&x!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${x}'. It can only be used with A* algorithm.`);let T=i.pathWidth!==void 0&&i.pathWidth!==1,E=i.pathHeight!==void 0&&i.pathHeight!==1;(T||E)&&x==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let s=new BC(this.gridTilemap).findShortestPath(Ri.toInternal(g),Ri.toInternal(t),mh(Pn({},i),{shortestPathAlgorithm:x}));return{path:s.path.map(Ri.fromInternal),closestToTarget:s.closestToTarget?Ri.fromInternal(s.closestToTarget):void 0,reachedMaxPathLength:!1,steps:s.steps}}steppedOn(g,t,i){return this.positionChangeFinished().pipe(gh(x=>g.includes(x.charId)&&t.some(T=>T.x===x.enterTile.x&&T.y===x.enterTile.y)&&(i===void 0||i.includes(x.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(ud(g=>({charId:g,action:"ADDED"})),hO(this.charRemoved$.pipe(ud(g=>({charId:g,action:"REMOVED"})))))}movementStarted(){if(!this.movementStarted$)throw this.createUninitializedErr();return this.movementStarted$}movementStopped(){if(!this.movementStopped$)throw this.createUninitializedErr();return this.movementStopped$}directionChanged(){if(!this.directionChanged$)throw this.createUninitializedErr();return this.directionChanged$}positionChangeStarted(){if(!this.positionChangeStarted$)throw this.createUninitializedErr();return this.positionChangeStarted$}positionChangeFinished(){if(!this.positionChangeFinished$)throw this.createUninitializedErr();return this.positionChangeFinished$}getMovementProgress(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getMovementProgress()}rebuildTileCollisionCache(g,t,i,x){var T;(T=this.gridTilemap)==null||T.rebuildTileCollisionCache(new _x(g,t,i,x))}addQueueMovements(g,t,i){var x,T;this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let s;((T=E?.getMovement())==null?void 0:T.getInfo().type)==="Queue"?s=E.getMovement():(s=new bO(E,this.gridTilemap),E.setMovement(s),s.finished().pipe(Ea(sO(this.charRemoved(g),E.autoMovementSet()))).subscribe(y=>{var e;(e=this.queueMovementFinished$)==null||e.next(Pn({charId:g},y))})),s.enqueue(t.map(y=>zf(y)?y:{position:new _t(y.position),layer:y.charLayer}),i)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(g){var t,i;this.initGuard();let x=(t=this.gridCharacters)==null?void 0:t.get(g);if(!x)throw this.createCharUnknownErr(g);return((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"?x.getMovement().peekAll().map(T=>({command:zf(T.command)?T.command:Ri.fromInternal(T.command),config:T.config})):[]}clearEnqueuedMovements(g){var t,i;this.initGuard();let x=(t=this.gridCharacters)==null?void 0:t.get(g);if(!x)throw this.createCharUnknownErr(g);((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"&&x.getMovement().clear()}getTileCost(g,t,i){var x,T;return this.initGuard(),(T=(x=this.gridTilemap)==null?void 0:x.getTileCosts({position:new _t(g),layer:t},i))!=null?T:1}getState(){let g=[];if(this.gridCharacters)for(let[t,i]of this.gridCharacters.entries())g.push({id:t,position:Ri.fromInternal(i.getTilePos()),facingDirection:i.getFacingDirection(),speed:i.getSpeed(),labels:i.getLabels(),movementProgress:i.getMovementProgress(),collisionConfig:{collisionGroups:i.getCollisionGroups(),ignoreCollisionGroups:i.getIgnoreCollisionGroups(),collidesWithTiles:i.collidesWithTiles(),ignoreMissingTiles:i.getIgnoreMissingTiles()}});return{characters:g}}setState(g){if(this.gridCharacters)for(let t of g.characters){let i=this.gridCharacters.get(t.id);if(i){let x=i.getTilePos();Ri.equal(x,Ri.toInternal(t.position))||i.setTilePosition(Ri.toInternal(t.position)),i.setSpeed(t.speed),i.turnTowards(t.facingDirection),t.collisionConfig.collisionGroups&&i.setCollisionGroups(t.collisionConfig.collisionGroups),t.collisionConfig.collidesWithTiles!==void 0&&i.setCollidesWithTiles(t.collisionConfig.collidesWithTiles),t.collisionConfig.ignoreMissingTiles!==void 0&&i.setIgnoreMissingTiles(t.collisionConfig.ignoreMissingTiles),i.setMovementProgress(t.movementProgress),i.clearLabels(),i.addLabels(t.labels)}}}charRemoved(g){var t;if(!this.charRemoved$)throw this.createUninitializedErr();return(t=this.charRemoved$)==null?void 0:t.pipe(rc(1),gh(i=>i==g))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var g;(g=this.config)==null||g.characters.forEach(t=>this.addCharacter(t))}moveChar(g,t){var i,x,T;this.initGuard();let E=(i=this.gridCharacters)==null?void 0:i.get(g);if(!E)throw this.createCharUnknownErr(g);if(E.getNumberOfDirections()===4){if(!((x=this.gridTilemap)!=null&&x.isIsometric())&&hd(t)){console.warn(`GridEngine: Character '${g}' can't be moved '${t}' in 4 direction mode.`);return}else if((T=this.gridTilemap)!=null&&T.isIsometric()&&!hd(t)){console.warn(`GridEngine: Character '${g}' can't be moved '${t}' in 4 direction isometric mode.`);return}}E.move(t)}createCharUnknownErr(g){return new Error(`Character unknown: ${g}`)}assembleMoveToConfig(g={}){let t=mh(Pn({},g),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return g!=null&&g.noPathFoundStrategy&&(Object.values(bC).includes(g.noPathFoundStrategy)?t.noPathFoundStrategy=g.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${g.noPathFoundStrategy}'. Falling back to 'STOP'`)),g!=null&&g.pathBlockedStrategy&&(Object.values(LC).includes(g.pathBlockedStrategy)?t.pathBlockedStrategy=g.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${g.pathBlockedStrategy}'. Falling back to 'WAIT'`)),t}setConfigDefaults(g){return Pn({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},g)}},FO=class extends OC{constructor(g,t={}){super(g,t),this.jumpCache=new dT}findShortestPathImpl(g,t){return this.jumpCache=new dT,super.findShortestPathImpl(g,t)}getNeighborsInternal(g,t,i){if(!t||g.layer!==t.layer)return this.getNeighbors(g,i).map(E=>({p:E,dist:1}));let x=this.prune(t,g).map(E=>{let s=this.getTransition(E.position,g.layer);return{position:E.position,layer:s||g.layer}}),T=[];for(let E of x){let s=this.jump(g,E,i,1,Ca(g.position,E.position));s&&(s.dist=this.distance(g.position,s.p.position),T.push(s))}return T}getForced(g,t){let i=[],{topLeft:x,downLeft:T,top:E,bottom:s,topRight:y,downRight:e}=this.normalizedPositions(g,t),r=Ca(g.position,t.position);return hd(r)?(this.blockOrTrans(g,x)&&(this.addIfNotBlocked(i,t,E),this.addIfNotBlocked(i,t,y),this.blockOrTrans(T,x)&&this.addIfNotBlocked(i,t,x)),this.blockOrTrans(g,T)&&(this.addIfNotBlocked(i,t,s),this.addIfNotBlocked(i,t,e),this.blockOrTrans(x,T)&&this.addIfNotBlocked(i,t,T)),this.blockOrTrans(x,E)&&this.addIfNotBlocked(i,t,E),this.blockOrTrans(T,s)&&this.addIfNotBlocked(i,t,s),this.blockOrTrans(x,y)&&this.addIfNotBlocked(i,t,y),this.blockOrTrans(T,e)&&this.addIfNotBlocked(i,t,e)):((this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&this.addIfNotBlocked(i,t,y),(this.blockOrTrans(g,s)||this.blockOrTrans(s,e))&&this.addIfNotBlocked(i,t,e),this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(this.addIfNotBlocked(i,t,E),this.addIfNotBlocked(i,t,x)),this.blockOrTrans(g,T)&&this.blockOrTrans(g,s)&&(this.addIfNotBlocked(i,t,s),this.addIfNotBlocked(i,t,T)),this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&this.addIfNotBlocked(i,t,E),this.blockOrTrans(T,s)&&this.blockOrTrans(g,s)&&this.addIfNotBlocked(i,t,s)),i}hasForced(g,t){let{topLeft:i,downLeft:x,top:T,bottom:E,topRight:s,downRight:y}=this.normalizedPositions(g,t),e=Ca(g.position,t.position);if(hd(e)){if(this.blockOrTrans(g,i)&&(!this.blockOrTrans(t,T)||!this.blockOrTrans(t,s)||this.blockOrTrans(x,i)&&!this.blockOrTrans(t,i))||this.blockOrTrans(g,x)&&(!this.blockOrTrans(t,E)||!this.blockOrTrans(t,y)||this.blockOrTrans(i,x)&&!this.blockOrTrans(t,x))||this.blockOrTrans(i,T)&&!this.blockOrTrans(t,T)||this.blockOrTrans(x,E)&&!this.blockOrTrans(t,E)||this.blockOrTrans(i,s)&&!this.blockOrTrans(t,s)||this.blockOrTrans(x,y)&&!this.blockOrTrans(t,y))return!0}else if((this.blockOrTrans(g,T)||this.blockOrTrans(T,s))&&!this.blockOrTrans(t,s)||(this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&!this.blockOrTrans(t,y)||this.blockOrTrans(g,i)&&this.blockOrTrans(g,T)&&(!this.blockOrTrans(t,T)||!this.blockOrTrans(t,i))||this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(!this.blockOrTrans(t,E)||!this.blockOrTrans(t,x))||this.blockOrTrans(i,T)&&this.blockOrTrans(g,T)&&!this.blockOrTrans(t,T)||this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&!this.blockOrTrans(t,E))return!0;return!1}prune(g,t){let{top:i,right:x,topRight:T,downRight:E,bottom:s}=this.normalizedPositions(g,t),y=this.getForced(g,t),e=Ca(g.position,t.position);return hd(e)?[i,x,T,E,s,...y]:[x,...y]}jump(g,t,i,x,T){let E=this.jumpCache.get(g,t);if(E!==null)return E;if(this.isBlocking(g,t)&&!(Ri.equal(t,i)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(g,t,void 0);return}if(Ri.equal(t,i))return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(x>=this.maxJumpSize)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.getTransition(t.position,g.layer)!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.hasForced(g,t))return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.updateClosestToTarget(t,i),T==="up-left"){if(this.jump(t,this.getTilePosInDir(t,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="down-left"){if(this.jump(t,this.getTilePosInDir(t,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="up-right"){if(this.jump(t,this.getTilePosInDir(t,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="down-right"){if(this.jump(t,this.getTilePosInDir(t,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}let s=this.jump(t,this.getTilePosInDir(t,T),i,x+1,T);return this.jumpCache.set(g,t,s),s}normalizedPositions(g,t){return g.position.xt.position.x&&g.position.y===t.position.y?{topLeft:{position:new _t(t.position.x+1,t.position.y+1),layer:t.layer},downLeft:{position:new _t(t.position.x+1,t.position.y-1),layer:t.layer},top:{position:new _t(t.position.x,t.position.y+1),layer:t.layer},bottom:{position:new _t(t.position.x,t.position.y-1),layer:t.layer},right:{position:new _t(t.position.x-1,t.position.y),layer:t.layer},topRight:{position:new _t(t.position.x-1,t.position.y+1),layer:t.layer},downRight:{position:new _t(t.position.x-1,t.position.y-1),layer:t.layer}}:g.position.yt.position.y&&g.position.x===t.position.x?{topLeft:{position:new _t(t.position.x-1,t.position.y+1),layer:t.layer},downLeft:{position:new _t(t.position.x+1,t.position.y+1),layer:t.layer},top:{position:new _t(t.position.x-1,t.position.y),layer:t.layer},bottom:{position:new _t(t.position.x+1,t.position.y),layer:t.layer},right:{position:new _t(t.position.x,t.position.y-1),layer:t.layer},topRight:{position:new _t(t.position.x-1,t.position.y-1),layer:t.layer},downRight:{position:new _t(t.position.x+1,t.position.y-1),layer:t.layer}}:g.position.yt.position.x?{topLeft:{position:new _t(t.position.x+1,t.position.y),layer:t.layer},downLeft:{position:new _t(t.position.x,t.position.y-1),layer:t.layer},top:{position:new _t(t.position.x+1,t.position.y+1),layer:t.layer},bottom:{position:new _t(t.position.x-1,t.position.y-1),layer:t.layer},right:{position:new _t(t.position.x-1,t.position.y+1),layer:t.layer},topRight:{position:new _t(t.position.x,t.position.y+1),layer:t.layer},downRight:{position:new _t(t.position.x-1,t.position.y),layer:t.layer}}:g.position.y>t.position.y&&g.position.x(g.SUCCESS="SUCCESS",g.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED="PATH_BLOCKED",g.NO_PATH_FOUND="NO_PATH_FOUND",g.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",g.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",g.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",g))(DO||{}),UC=class{constructor(g,t,i,{config:x,ignoreBlockedTarget:T=!1,distance:E=0}={}){this.character=g,this.tilemap=t,this.targetPos=i,this.shortestPath=[],this.distOffset=0,this.posOnPath=0,this.stopped=!1,this.pathBlockedWaitElapsed=0,this.isPositionAllowed=()=>!0,this.shortestPathAlgorithm="BIDIRECTIONAL_SEARCH",this.maxPathLength=1/0,this.considerCosts=!1,this.ignoredChars=[],this.isBlocking=(e,r)=>e?new FC(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:e,layer:r}):!0;var s,y;this.shortestPathAlgorithm=(s=x?.algorithm)!=null?s:this.shortestPathAlgorithm,this.ignoreBlockedTarget=T,this.distance=E,this.noPathFoundStrategy=x?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=x?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new sT(x?.noPathFoundRetryBackoffMs||200,x?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new sT(x?.pathBlockedRetryBackoffMs||200,x?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),x!=null&&x.isPositionAllowedFn&&(this.isPositionAllowed=x.isPositionAllowedFn),x!=null&&x.maxPathLength&&(this.maxPathLength=x.maxPathLength),this.alternativeTargets=x?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=x?.noPathFoundAlternativeTargetsFallbackStrategy,x!=null&&x.considerCosts&&this.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.considerCosts=x?.considerCosts||!1,this.ignoreLayers=!!(x!=null&&x.ignoreLayers),this.distanceUtils=Sd.create(g.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=x?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(y=x?.ignoredChars)!=null?y:[],this.finished$=new Nn,this.setCharacter(g)}setPathBlockedStrategy(g){this.pathBlockedStrategy=g}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(g){this.character=g,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(gh(t=>t!==this),rc(1)).subscribe(()=>{this.stop("MOVEMENT_TERMINATED")})}getPathfindingOptions(){return{shortestPathAlgorithm:this.shortestPathAlgorithm,pathWidth:this.character.getTileWidth(),pathHeight:this.character.getTileHeight(),numberOfDirections:this.character.getNumberOfDirections(),isPositionAllowed:this.isPositionAllowed,collisionGroups:this.character.getCollisionGroups(),ignoredChars:[this.character.getId(),...this.ignoredChars],ignoreTiles:!this.character.collidesWithTiles(),ignoreMapBounds:this.character.getIgnoreMissingTiles(),ignoreBlockedTarget:this.ignoreBlockedTarget,maxPathLength:this.maxPathLength,ignoreLayers:this.ignoreLayers,considerCosts:this.considerCosts,calculateClosestToTarget:!0}}update(g){var t,i,x,T;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(g,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((t=this.nextTileOnPath())==null?void 0:t.position,(i=this.character)==null?void 0:i.getNextTilePos().layer)?this.applyPathBlockedStrategy(g):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((x=this.nextTileOnPath())==null?void 0:x.position,(T=this.character)==null?void 0:T.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(g=>Ri.fromInternal(g))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:Ri.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(g){switch(g){case"SUCCESS":return"Successfully arrived.";case"MOVEMENT_TERMINATED":return"Movement of character has been replaced before destination was reached.";case"PATH_BLOCKED":return"PathBlockedStrategy STOP: Path blocked.";case"NO_PATH_FOUND_MAX_RETRIES_EXCEEDED":return`NoPathFoundStrategy RETRY: Maximum retries of ${this.noPathFoundRetryable.getMaxRetries()} exceeded.`;case"NO_PATH_FOUND":return"NoPathFoundStrategy STOP: No path found.";case"PATH_BLOCKED_MAX_RETRIES_EXCEEDED":return`PathBlockedStrategy RETRY: Maximum retries of ${this.pathBlockedRetryable.getMaxRetries()} exceeded.`;case"PATH_BLOCKED_WAIT_TIMEOUT":return`PathBlockedStrategy WAIT: Wait timeout of ${this.pathBlockedWaitTimeoutMs}ms exceeded.`}}applyPathBlockedStrategy(g){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(g,()=>{let t=this.getShortestPath();t.path.length>0&&this.calcShortestPath(t)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=g,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let g=this.nextTileOnPath();if(!g)return;let t=this.getDir(this.character.getNextTilePos().position,g.position);this.character.move(t)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(g){this.finished$.next({position:this.character.getTilePos().position,result:g,description:this.resultToReason(g),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let g=this.shortestPath[this.posOnPath+1],t=this.getDir(this.character.getNextTilePos().position,g.position);this.character.turnTowards(t)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let g=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:E,distOffset:s}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:i,distOffset:0}}pathToAlternativeTarget(g,t){let i=t.findShortestPath(this.character.getNextTilePos(),g,this.getPathfindingOptions()).path,x=this.distanceUtils.distance(g.position,this.targetPos.position);return{path:i,distOffset:x}}getDir(g,t){return this.tilemap.fromMapDirection(this.distanceUtils.direction(g,t))}},IO=Object.create,zC=Object.defineProperty,NO=Object.getOwnPropertyDescriptor,BO=Object.getOwnPropertyNames,UO=Object.getPrototypeOf,zO=Object.prototype.hasOwnProperty,GO=(g,t)=>()=>(t||g((t={exports:{}}).exports,t),t.exports),VO=(g,t,i,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let T of BO(t))!zO.call(g,T)&&T!==i&&zC(g,T,{get:()=>t[T],enumerable:!(x=NO(t,T))||x.enumerable});return g},qx=(g,t,i)=>(i=g!=null?IO(UO(g)):{},VO(t||!g||!g.__esModule?zC(i,"default",{value:g,enumerable:!0}):i,g)),t1=GO((g,t)=>{(function(){var i,x="4.17.21",T=200,E="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",y="Invalid `variable` option passed into `_.template`",e="__lodash_hash_undefined__",r=500,p="__lodash_placeholder__",h=1,a=2,l=4,n=1,u=2,f=1,o=2,c=4,d=8,v=16,m=32,S=64,M=128,w=256,C=512,A=30,P="...",b=800,O=16,I=1,D=2,B=3,G=1/0,z=9007199254740991,X=17976931348623157e292,j=NaN,Q=4294967295,tt=Q-1,Y=Q>>>1,Z=[["ary",M],["bind",f],["bindKey",o],["curry",d],["curryRight",v],["flip",C],["partial",m],["partialRight",S],["rearg",w]],U="[object Arguments]",H="[object Array]",J="[object AsyncFunction]",_="[object Boolean]",q="[object Date]",at="[object DOMException]",ot="[object Error]",rt="[object Function]",gt="[object GeneratorFunction]",yt="[object Map]",Et="[object Number]",At="[object Null]",Pt="[object Object]",Vt="[object Promise]",dt="[object Proxy]",ut="[object RegExp]",Rt="[object Set]",Dt="[object String]",Ht="[object Symbol]",Bt="[object Undefined]",re="[object WeakMap]",le="[object WeakSet]",ge="[object ArrayBuffer]",xe="[object DataView]",Pe="[object Float32Array]",te="[object Float64Array]",Ge="[object Int8Array]",Oe="[object Int16Array]",Be="[object Int32Array]",Le="[object Uint8Array]",ne="[object Uint8ClampedArray]",je="[object Uint16Array]",si="[object Uint32Array]",Mi=/\b__p \+= '';/g,he=/\b(__p \+=) '' \+/g,Ti=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,Ce=/[&<>"']/g,we=RegExp(bt.source),Ve=RegExp(Ce.source),Je=/<%-([\s\S]+?)%>/g,Gi=/<%([\s\S]+?)%>/g,Ii=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jn=/^\w*$/,Vi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pi=/[\\^$.*+?()[\]{}|]/g,Xi=RegExp(pi.source),Ra=/^\s+/,oa=/\s/,Us=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_r=/\{\n\/\* \[wrapped with (.+)\] \*/,lo=/,? & /,qr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zs=/[()=,{}\[\]\/\s]/,Ss=/\\(\\)?/g,ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ll=/\w*$/,Tt=/^[-+]0x[0-9a-f]+$/i,Zt=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ee=/^(?:0|[1-9]\d*)$/,Te=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ue=/($^)/,We=/['\n\r\u2028\u2029\\]/g,$e="\\ud800-\\udfff",ti="\\u0300-\\u036f",ni="\\ufe20-\\ufe2f",oi="\\u20d0-\\u20ff",$i=ti+ni+oi,un="\\u2700-\\u27bf",ji="a-z\\xdf-\\xf6\\xf8-\\xff",yn="\\xac\\xb1\\xd7\\xf7",ei="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Se="\\u2000-\\u206f",Br=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gi="A-Z\\xc0-\\xd6\\xd8-\\xde",fn="\\ufe0e\\ufe0f",Ni=yn+ei+Se+Br,Vn="['’]",vn="["+$e+"]",Ki="["+Ni+"]",pr="["+$i+"]",Gs="\\d+",En="["+un+"]",la="["+ji+"]",$n="[^"+$e+Ni+Gs+un+ji+gi+"]",ba="\\ud83c[\\udffb-\\udfff]",Vs="(?:"+pr+"|"+ba+")",uo="[^"+$e+"]",La="(?:\\ud83c[\\udde6-\\uddff]){2}",fo="[\\ud800-\\udbff][\\udc00-\\udfff]",yi="["+gi+"]",Fa="\\u200d",Gu="(?:"+la+"|"+$n+")",cc="(?:"+yi+"|"+$n+")",sr="(?:"+Vn+"(?:d|ll|m|re|s|t|ve))?",Hs="(?:"+Vn+"(?:D|LL|M|RE|S|T|VE))?",Ws=Vs+"?",Xs="["+fn+"]?",Fl="(?:"+Fa+"(?:"+[uo,La,fo].join("|")+")"+Xs+Ws+")*",Bi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ur=Xs+Ws+Fl,co="(?:"+[En,La,fo].join("|")+")"+Ur,Yo="(?:"+[uo+pr+"?",pr,La,fo,vn].join("|")+")",wh=RegExp(Vn,"g"),rn=RegExp(pr,"g"),ko=RegExp(ba+"(?="+ba+")|"+Yo+Ur,"g"),Ts=RegExp([yi+"?"+la+"+"+sr+"(?="+[Ki,yi,"$"].join("|")+")",cc+"+"+Hs+"(?="+[Ki,yi+Gu,"$"].join("|")+")",yi+"?"+Gu+"+"+sr,yi+"+"+Hs,Rn,Bi,Gs,co].join("|"),"g"),jo=RegExp("["+Fa+$e+$i+fn+"]"),Vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,po=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sr=-1,Zi={};Zi[Pe]=Zi[te]=Zi[Ge]=Zi[Oe]=Zi[Be]=Zi[Le]=Zi[ne]=Zi[je]=Zi[si]=!0,Zi[U]=Zi[H]=Zi[ge]=Zi[_]=Zi[xe]=Zi[q]=Zi[ot]=Zi[rt]=Zi[yt]=Zi[Et]=Zi[Pt]=Zi[ut]=Zi[Rt]=Zi[Dt]=Zi[re]=!1;var Ji={};Ji[U]=Ji[H]=Ji[ge]=Ji[xe]=Ji[_]=Ji[q]=Ji[Pe]=Ji[te]=Ji[Ge]=Ji[Oe]=Ji[Be]=Ji[yt]=Ji[Et]=Ji[Pt]=Ji[ut]=Ji[Rt]=Ji[Dt]=Ji[Ht]=Ji[Le]=Ji[ne]=Ji[je]=Ji[si]=!0,Ji[ot]=Ji[rt]=Ji[re]=!1;var Es={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zr={"&":"&","<":"<",">":">",'"':""","'":"'"},Ol={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ah={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ko=parseFloat,Dl=parseInt,Gr=typeof global=="object"&&global&&global.Object===Object&&global,dc=typeof self=="object"&&self&&self.Object===Object&&self,xn=Gr||dc||Function("return this")(),Ph=typeof g=="object"&&g&&!g.nodeType&&g,bn=Ph&&typeof t=="object"&&t&&!t.nodeType&&t,Oa=bn&&bn.exports===Ph,Da=Oa&&Gr.process,Mn=function(){try{var ct=bn&&bn.require&&bn.require("util").types;return ct||Da&&Da.binding&&Da.binding("util")}catch{}}(),Ia=Mn&&Mn.isArrayBuffer,Na=Mn&&Mn.isDate,Il=Mn&&Mn.isMap,Nl=Mn&&Mn.isRegExp,Ba=Mn&&Mn.isSet,Ys=Mn&&Mn.isTypedArray;function Qi(ct,St,vt){switch(vt.length){case 0:return ct.call(St);case 1:return ct.call(St,vt[0]);case 2:return ct.call(St,vt[0],vt[1]);case 3:return ct.call(St,vt[0],vt[1],vt[2])}return ct.apply(St,vt)}function Xr(ct,St,vt,Ft){for(var Lt=-1,Ut=ct==null?0:ct.length;++Lt-1}function ha(ct,St,vt){for(var Ft=-1,Lt=ct==null?0:ct.length;++Ft-1;);return vt}function mo(ct,St){for(var vt=ct.length;vt--&&es(St,ct[vt],0)>-1;);return vt}function ns(ct,St){for(var vt=ct.length,Ft=0;vt--;)ct[vt]===St&&++Ft;return Ft}var Hu=or(Es),Qo=or(zr);function rs(ct){return"\\"+Ah[ct]}function dn(ct,St){return ct==null?i:ct[St]}function ws(ct){return jo.test(ct)}function hr(ct){return Vu.test(ct)}function go(ct){for(var St,vt=[];!(St=ct.next()).done;)vt.push(St.value);return vt}function Va(ct){var St=-1,vt=Array(ct.size);return ct.forEach(function(Ft,Lt){vt[++St]=[Lt,Ft]}),vt}function Ha(ct,St){return function(vt){return ct(St(vt))}}function _n(ct,St){for(var vt=-1,Ft=ct.length,Lt=0,Ut=[];++vt-1}function Xu(R,N){var k=this.__data__,nt=Mo(k,R);return nt<0?(++this.size,k.push([R,N])):k[nt][1]=N,this}js.prototype.clear=wp,js.prototype.delete=yc,js.prototype.get=Ap,js.prototype.has=Pp,js.prototype.set=Xu;function As(R){var N=-1,k=R==null?0:R.length;for(this.clear();++N=N?R:N)),R}function as(R,N,k,nt,ft,xt){var Ot,Gt=N&h,jt=N&a,fe=N&l;if(k&&(Ot=ft?k(R,nt,ft,xt):k(R)),Ot!==i)return Ot;if(!In(R))return R;var ce=Ei(R);if(ce){if(Ot=aP(R),!Gt)return br(R,Ot)}else{var ye=kr(R),Ie=ye==rt||ye==gt;if(_l(R))return zc(R,Gt);if(ye==Pt||ye==U||Ie&&!ft){if(Ot=jt||Ie?{}:_1(R),!Gt)return jt?Xp(R,Dp(Ot,R)):Yg(R,Cc(Ot,R))}else{if(!Ji[ye])return ft?R:{};Ot=oP(R,ye,Gt)}}xt||(xt=new tr);var Ke=xt.get(R);if(Ke)return Ke;xt.set(R,Ot),PS(R)?R.forEach(function(ui){Ot.add(as(ui,N,k,ui,R,xt))}):wS(R)&&R.forEach(function(ui,Ui){Ot.set(Ui,as(ui,N,k,Ui,R,xt))});var hi=fe?jt?zi:kn:jt?Fs:Fr,Oi=ce?i:hi(R);return Sn(Oi||R,function(ui,Ui){Oi&&(Ui=ui,ui=R[Ui]),Ks(Ot,Ui,as(ui,N,k,Ui,R,xt))}),Ot}function wc(R){var N=Fr(R);return function(k){return Ku(k,R,N)}}function Ku(R,N,k){var nt=k.length;if(R==null)return!nt;for(R=It(R);nt--;){var ft=k[nt],xt=N[ft],Ot=R[ft];if(Ot===i&&!(ft in R)||!xt(Ot))return!1}return!0}function Ac(R,N,k){if(typeof R!="function")throw new Qt(s);return Wc(function(){R.apply(i,k)},N)}function il(R,N,k,nt){var ft=-1,xt=Tr,Ot=!0,Gt=R.length,jt=[],fe=N.length;if(!Gt)return jt;k&&(N=_i(N,lr(k))),nt?(xt=ha,Ot=!1):N.length>=T&&(xt=Wn,Ot=!1,N=new Eo(N));t:for(;++ftft?0:ft+k),nt=nt===i||nt>ft?ft:bi(nt),nt<0&&(nt+=ft),nt=k>nt?0:bS(nt);k0&&k(Gt)?N>1?ur(Gt,N-1,k,nt,ft):Yr(ft,Gt):nt||(ft[ft.length]=Gt)}return ft}var Xl=af(),Gh=af(!0);function os(R,N){return R&&Xl(R,N,Fr)}function Yl(R,N){return R&&Gh(R,N,Fr)}function nl(R,N){return Cn(N,function(k){return ll(R[k])})}function Js(R,N){N=bo(N,R);for(var k=0,nt=N.length;R!=null&&kN}function Bp(R,N){return R!=null&&me.call(R,N)}function Rc(R,N){return R!=null&&N in It(R)}function Wg(R,N,k){return R>=Mr(N,k)&&R=120&&ce.length>=120)?new Eo(Ot&&ce):i}ce=R[0];var ye=-1,Ie=Gt[0];t:for(;++ye-1;)Gt!==R&&So.call(Gt,jt,1),So.call(R,jt,1);return R}function Ar(R,N){for(var k=R?N.length:0,nt=k-1;k--;){var ft=N[k];if(k==nt||ft!==xt){var xt=ft;ol(ft)?So.call(R,ft,1):Nc(R,ft)}}return R}function ma(R,N){return R+Oh(mc()*(N-R+1))}function Ps(R,N,k,nt){for(var ft=-1,xt=qn(Fh((N-R)/(k||1)),0),Ot=vt(xt);xt--;)Ot[nt?xt:++ft]=R,R+=k;return Ot}function Ql(R,N){var k="";if(!R||N<1||N>z)return k;do N%2&&(k+=R),N=Oh(N/2),N&&(R+=R);while(N);return k}function ii(R,N){return Qg(eS(R,N,Os),R+"")}function Up(R){return Uh(uf(R))}function Oc(R,N){var k=uf(R);return jp(k,Co(N,0,k.length))}function sl(R,N,k,nt){if(!In(R))return R;N=bo(N,R);for(var ft=-1,xt=N.length,Ot=xt-1,Gt=R;Gt!=null&&++ftft?0:ft+N),k=k>ft?ft:k,k<0&&(k+=ft),ft=N>k?0:k-N>>>0,N>>>=0;for(var xt=vt(ft);++nt>>1,Ot=R[xt];Ot!==null&&!Qs(Ot)&&(k?Ot<=N:Ot=T){var fe=N?null:Lr(R);if(fe)return Wa(fe);Ot=!1,ft=Wn,jt=new Eo}else jt=N?[]:Gt;t:for(;++nt=nt?R:hs(R,N,k)}var Hp=Lh||function(R){return xn.clearTimeout(R)};function zc(R,N){if(N)return R.slice();var k=R.length,nt=yo?yo(k):new R.constructor(k);return R.copy(nt),nt}function rf(R){var N=new R.constructor(R.byteLength);return new wn(N).set(new wn(R)),N}function Xg(R,N){var k=N?rf(R.buffer):R.buffer;return new R.constructor(k,R.byteOffset,R.byteLength)}function Rs(R){var N=new R.constructor(R.source,Ll.exec(R));return N.lastIndex=R.lastIndex,N}function Gc(R){return Ya?It(Ya.call(R)):{}}function Wp(R,N){var k=N?rf(R.buffer):R.buffer;return new R.constructor(k,R.byteOffset,R.length)}function Ka(R,N){if(R!==N){var k=R!==i,nt=R===null,ft=R===R,xt=Qs(R),Ot=N!==i,Gt=N===null,jt=N===N,fe=Qs(N);if(!Gt&&!fe&&!xt&&R>N||xt&&Ot&&jt&&!Gt&&!fe||nt&&Ot&&jt||!k&&jt||!ft)return 1;if(!nt&&!xt&&!fe&&R=Gt)return jt;var fe=k[nt];return jt*(fe=="desc"?-1:1)}}return R.index-N.index}function Fo(R,N,k,nt){for(var ft=-1,xt=R.length,Ot=k.length,Gt=-1,jt=N.length,fe=qn(xt-Ot,0),ce=vt(jt+fe),ye=!nt;++Gt1?k[ft-1]:i,Ot=ft>2?k[2]:i;for(xt=R.length>3&&typeof xt=="function"?(ft--,xt):i,Ot&&fs(k[0],k[1],Ot)&&(xt=ft<3?i:xt,ft=1),N=It(N);++nt-1?ft[xt?N[Ot]:Ot]:i}}function it(R){return Ai(function(N){var k=N.length,nt=k,ft=Cr.prototype.thru;for(R&&N.reverse();nt--;){var xt=N[nt];if(typeof xt!="function")throw new Qt(s);if(ft&&!Ot&&of(xt)=="wrapper")var Ot=new Cr([],!0)}for(nt=Ot?nt:k;++nt1&&Hi.reverse(),ce&&jtGt))return!1;var fe=xt.get(R),ce=xt.get(N);if(fe&&ce)return fe==N&&ce==R;var ye=-1,Ie=!0,Ke=k&u?new Eo:i;for(xt.set(R,N),xt.set(N,R);++ye1?"& ":"")+N[nt],N=N.join(k>2?", ":" "),R.replace(Us,`{ +/* [wrapped with `+N+`] */ +`)}function hP(R){return Ei(R)||$h(R)||!!(pc&&R&&R[pc])}function ol(R,N){var k=typeof R;return N=N??z,!!N&&(k=="number"||k!="symbol"&&ee.test(R))&&R>-1&&R%1==0&&R0){if(++N>=b)return arguments[0]}else N=0;return R.apply(i,arguments)}}function jp(R,N){var k=-1,nt=R.length,ft=nt-1;for(N=N===i?nt:N;++k1?R[N-1]:i;return k=typeof k=="function"?(R.pop(),k):i,dS(R,k)});function pS(R){var N=mt(R);return N.__chain__=!0,N}function SR(R,N){return N(R),R}function Kp(R,N){return N(R)}var TR=Ai(function(R){var N=R.length,k=N?R[0]:0,nt=this.__wrapped__,ft=function(xt){return ju(xt,R)};return N>1||this.__actions__.length||!(nt instanceof ri)||!ol(k)?this.thru(ft):(nt=nt.slice(k,+k+(N?1:0)),nt.__actions__.push({func:Kp,args:[ft],thisArg:i}),new Cr(nt,this.__chain__).thru(function(xt){return N&&!xt.length&&xt.push(i),xt}))});function ER(){return pS(this)}function MR(){return new Cr(this.value(),this.__chain__)}function CR(){this.__values__===i&&(this.__values__=RS(this.value()));var R=this.__index__>=this.__values__.length,N=R?i:this.__values__[this.__index__++];return{done:R,value:N}}function wR(){return this}function AR(R){for(var N,k=this;k instanceof Bh;){var nt=oS(k);nt.__index__=0,nt.__values__=i,N?ft.__wrapped__=nt:N=nt;var ft=nt;k=k.__wrapped__}return ft.__wrapped__=R,N}function PR(){var R=this.__wrapped__;if(R instanceof ri){var N=R;return this.__actions__.length&&(N=new ri(this)),N=N.reverse(),N.__actions__.push({func:Kp,args:[_g],thisArg:i}),new Cr(N,this.__chain__)}return this.thru(_g)}function RR(){return Po(this.__wrapped__,this.__actions__)}var bR=Kh(function(R,N,k){me.call(R,k)?++R[k]:va(R,k,1)});function LR(R,N,k){var nt=Ei(R)?Ua:Hg;return k&&fs(R,N,k)&&(N=i),nt(R,li(N,3))}function FR(R,N){var k=Ei(R)?Cn:Pc;return k(R,li(N,3))}var OR=$(lS),DR=$(hS);function IR(R,N){return ur(Zp(R,N),1)}function NR(R,N){return ur(Zp(R,N),G)}function BR(R,N,k){return k=k===i?1:bi(k),ur(Zp(R,N),k)}function vS(R,N){var k=Ei(R)?Sn:Zs;return k(R,li(N,3))}function mS(R,N){var k=Ei(R)?Hn:Ip;return k(R,li(N,3))}var UR=Kh(function(R,N,k){me.call(R,k)?R[k].push(N):va(R,k,[N])});function zR(R,N,k,nt){R=Ls(R)?R:uf(R),k=k&&!nt?bi(k):0;var ft=R.length;return k<0&&(k=qn(ft+k,0)),qp(R)?k<=ft&&R.indexOf(N,k)>-1:!!ft&&es(R,N,k)>-1}var GR=ii(function(R,N,k){var nt=-1,ft=typeof N=="function",xt=Ls(R)?vt(R.length):[];return Zs(R,function(Ot){xt[++nt]=ft?Qi(N,Ot,k):pn(Ot,N,k)}),xt}),VR=Kh(function(R,N,k){va(R,k,N)});function Zp(R,N){var k=Ei(R)?_i:rl;return k(R,li(N,3))}function HR(R,N,k,nt){return R==null?[]:(Ei(N)||(N=N==null?[]:[N]),k=nt?i:k,Ei(k)||(k=k==null?[]:[k]),Xh(R,N,k))}var WR=Kh(function(R,N,k){R[k?0:1].push(N)},function(){return[[],[]]});function XR(R,N,k){var nt=Ei(R)?za:ca,ft=arguments.length<3;return nt(R,li(N,4),k,ft,Zs)}function YR(R,N,k){var nt=Ei(R)?Bl:ca,ft=arguments.length<3;return nt(R,li(N,4),k,ft,Ip)}function kR(R,N){var k=Ei(R)?Cn:Pc;return k(R,Qp(li(N,3)))}function jR(R){var N=Ei(R)?Uh:Up;return N(R)}function KR(R,N,k){(k?fs(R,N,k):N===i)?N=1:N=bi(N);var nt=Ei(R)?Tc:Oc;return nt(R,N)}function ZR(R){var N=Ei(R)?Op:Gp;return N(R)}function JR(R){if(R==null)return 0;if(Ls(R))return qp(R)?V(R):R.length;var N=kr(R);return N==yt||N==Rt?R.size:wr(R).length}function $R(R,N,k){var nt=Ei(R)?ts:Dc;return k&&fs(R,N,k)&&(N=i),nt(R,li(N,3))}var QR=ii(function(R,N){if(R==null)return[];var k=N.length;return k>1&&fs(R,N[0],N[1])?N=[]:k>2&&fs(N[0],N[1],N[2])&&(N=[N[0]]),Xh(R,ur(N,1),[])}),Jp=hp||function(){return xn.Date.now()};function _R(R,N){if(typeof N!="function")throw new Qt(s);return R=bi(R),function(){if(--R<1)return N.apply(this,arguments)}}function gS(R,N,k){return N=k?i:N,N=R&&N==null?R.length:N,$t(R,M,i,i,i,i,N)}function yS(R,N){var k;if(typeof N!="function")throw new Qt(s);return R=bi(R),function(){return--R>0&&(k=N.apply(this,arguments)),R<=1&&(N=i),k}}var t0=ii(function(R,N,k){var nt=f;if(k.length){var ft=_n(k,lf(t0));nt|=m}return $t(R,nt,N,k,ft)}),xS=ii(function(R,N,k){var nt=f|o;if(k.length){var ft=_n(k,lf(xS));nt|=m}return $t(N,nt,R,k,ft)});function SS(R,N,k){N=k?i:N;var nt=$t(R,d,i,i,i,i,i,N);return nt.placeholder=SS.placeholder,nt}function TS(R,N,k){N=k?i:N;var nt=$t(R,v,i,i,i,i,i,N);return nt.placeholder=TS.placeholder,nt}function ES(R,N,k){var nt,ft,xt,Ot,Gt,jt,fe=0,ce=!1,ye=!1,Ie=!0;if(typeof R!="function")throw new Qt(s);N=Sa(N)||0,In(k)&&(ce=!!k.leading,ye="maxWait"in k,xt=ye?qn(Sa(k.maxWait)||0,N):xt,Ie="trailing"in k?!!k.trailing:Ie);function Ke(ir){var Ja=nt,ul=ft;return nt=ft=i,fe=ir,Ot=R.apply(ul,Ja),Ot}function hi(ir){return fe=ir,Gt=Wc(Ui,N),ce?Ke(ir):Ot}function Oi(ir){var Ja=ir-jt,ul=ir-fe,HS=N-Ja;return ye?Mr(HS,xt-ul):HS}function ui(ir){var Ja=ir-jt,ul=ir-fe;return jt===i||Ja>=N||Ja<0||ye&&ul>=xt}function Ui(){var ir=Jp();if(ui(ir))return Hi(ir);Gt=Wc(Ui,Oi(ir))}function Hi(ir){return Gt=i,Ie&&nt?Ke(ir):(nt=ft=i,Ot)}function _s(){Gt!==i&&Hp(Gt),fe=0,nt=jt=ft=Gt=i}function cs(){return Gt===i?Ot:Hi(Jp())}function qs(){var ir=Jp(),Ja=ui(ir);if(nt=arguments,ft=this,jt=ir,Ja){if(Gt===i)return hi(jt);if(ye)return Hp(Gt),Gt=Wc(Ui,N),Ke(jt)}return Gt===i&&(Gt=Wc(Ui,N)),Ot}return qs.cancel=_s,qs.flush=cs,qs}var qR=ii(function(R,N){return Ac(R,1,N)}),t3=ii(function(R,N,k){return Ac(R,Sa(N)||0,k)});function e3(R){return $t(R,C)}function $p(R,N){if(typeof R!="function"||N!=null&&typeof N!="function")throw new Qt(s);var k=function(){var nt=arguments,ft=N?N.apply(this,nt):nt[0],xt=k.cache;if(xt.has(ft))return xt.get(ft);var Ot=R.apply(this,nt);return k.cache=xt.set(ft,Ot)||xt,Ot};return k.cache=new($p.Cache||As),k}$p.Cache=As;function Qp(R){if(typeof R!="function")throw new Qt(s);return function(){var N=arguments;switch(N.length){case 0:return!R.call(this);case 1:return!R.call(this,N[0]);case 2:return!R.call(this,N[0],N[1]);case 3:return!R.call(this,N[0],N[1],N[2])}return!R.apply(this,N)}}function i3(R){return yS(2,R)}var n3=Vp(function(R,N){N=N.length==1&&Ei(N[0])?_i(N[0],lr(li())):_i(ur(N,1),lr(li()));var k=N.length;return ii(function(nt){for(var ft=-1,xt=Mr(nt.length,k);++ft=N}),$h=Ci(function(){return arguments}())?Ci:function(R){return jn(R)&&me.call(R,"callee")&&!xo.call(R,"callee")},Ei=vt.isArray,y3=Ia?lr(Ia):Xn;function Ls(R){return R!=null&&_p(R.length)&&!ll(R)}function er(R){return jn(R)&&Ls(R)}function x3(R){return R===!0||R===!1||jn(R)&&vr(R)==_}var _l=fp||c0,S3=Na?lr(Na):Yn;function T3(R){return jn(R)&&R.nodeType===1&&!Xc(R)}function E3(R){if(R==null)return!0;if(Ls(R)&&(Ei(R)||typeof R=="string"||typeof R.splice=="function"||_l(R)||hf(R)||$h(R)))return!R.length;var N=kr(R);if(N==yt||N==Rt)return!R.size;if(Hc(R))return!wr(R).length;for(var k in R)if(me.call(R,k))return!1;return!0}function M3(R,N){return On(R,N)}function C3(R,N,k){k=typeof k=="function"?k:i;var nt=k?k(R,N):i;return nt===i?On(R,N,i,k):!!nt}function i0(R){if(!jn(R))return!1;var N=vr(R);return N==ot||N==at||typeof R.message=="string"&&typeof R.name=="string"&&!Xc(R)}function w3(R){return typeof R=="number"&&vc(R)}function ll(R){if(!In(R))return!1;var N=vr(R);return N==rt||N==gt||N==J||N==dt}function CS(R){return typeof R=="number"&&R==bi(R)}function _p(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=z}function In(R){var N=typeof R;return R!=null&&(N=="object"||N=="function")}function jn(R){return R!=null&&typeof R=="object"}var wS=Il?lr(Il):jl;function A3(R,N){return R===N||Dn(R,N,jg(N))}function P3(R,N,k){return k=typeof k=="function"?k:i,Dn(R,N,jg(N),k)}function R3(R){return AS(R)&&R!=+R}function b3(R){if(cP(R))throw new Lt(E);return Kl(R)}function L3(R){return R===null}function F3(R){return R==null}function AS(R){return typeof R=="number"||jn(R)&&vr(R)==Et}function Xc(R){if(!jn(R)||vr(R)!=Pt)return!1;var N=Ln(R);if(N===null)return!0;var k=me.call(N,"constructor")&&N.constructor;return typeof k=="function"&&k instanceof k&&Ae.call(k)==fi}var n0=Nl?lr(Nl):Zl;function O3(R){return CS(R)&&R>=-z&&R<=z}var PS=Ba?lr(Ba):Ju;function qp(R){return typeof R=="string"||!Ei(R)&&jn(R)&&vr(R)==Dt}function Qs(R){return typeof R=="symbol"||jn(R)&&vr(R)==Ht}var hf=Ys?lr(Ys):Lc;function D3(R){return R===i}function I3(R){return jn(R)&&kr(R)==re}function N3(R){return jn(R)&&vr(R)==le}var B3=Qe(Hh),U3=Qe(function(R,N){return R<=N});function RS(R){if(!R)return[];if(Ls(R))return qp(R)?K(R):br(R);if(To&&R[To])return go(R[To]());var N=kr(R),k=N==yt?Va:N==Rt?Wa:uf;return k(R)}function hl(R){if(!R)return R===0?R:0;if(R=Sa(R),R===G||R===-G){var N=R<0?-1:1;return N*X}return R===R?R:0}function bi(R){var N=hl(R),k=N%1;return N===N?k?N-k:N:0}function bS(R){return R?Co(bi(R),0,Q):0}function Sa(R){if(typeof R=="number")return R;if(Qs(R))return j;if(In(R)){var N=typeof R.valueOf=="function"?R.valueOf():R;R=In(N)?N+"":N}if(typeof R!="string")return R===0?R:+R;R=zl(R);var k=Zt.test(R);return k||ie.test(R)?Dl(R.slice(2),k?2:8):Tt.test(R)?j:+R}function LS(R){return bs(R,Fs(R))}function z3(R){return R?Co(bi(R),-z,z):R===0?R:0}function en(R){return R==null?"":Pr(R)}var G3=al(function(R,N){if(Hc(N)||Ls(N)){bs(N,Fr(N),R);return}for(var k in N)me.call(N,k)&&Ks(R,k,N[k])}),FS=al(function(R,N){bs(N,Fs(N),R)}),tv=al(function(R,N,k,nt){bs(N,Fs(N),R,nt)}),V3=al(function(R,N,k,nt){bs(N,Fr(N),R,nt)}),H3=Ai(ju);function W3(R,N){var k=ka(R);return N==null?k:Cc(k,N)}var X3=ii(function(R,N){R=It(R);var k=-1,nt=N.length,ft=nt>2?N[2]:i;for(ft&&fs(N[0],N[1],ft)&&(nt=1);++k1),xt}),bs(R,zi(R),k),nt&&(k=as(k,h|a|l,Ne));for(var ft=N.length;ft--;)Nc(k,N[ft]);return k});function ob(R,N){return DS(R,Qp(li(N)))}var lb=Ai(function(R,N){return R==null?{}:Yh(R,N)});function DS(R,N){if(R==null)return{};var k=_i(zi(R),function(nt){return[nt]});return N=li(N),_u(R,k,function(nt,ft){return N(nt,ft[0])})}function hb(R,N,k){N=bo(N,R);var nt=-1,ft=N.length;for(ft||(ft=1,R=i);++ntN){var nt=R;R=N,N=nt}if(k||R%1||N%1){var ft=mc();return Mr(R+ft*(N-R+Ko("1e-"+((ft+"").length-1))),N)}return ma(R,N)}var Sb=L(function(R,N,k){return N=N.toLowerCase(),R+(k?BS(N):N)});function BS(R){return a0(en(R).toLowerCase())}function US(R){return R=en(R),R&&R.replace(Te,Hu).replace(rn,"")}function Tb(R,N,k){R=en(R),N=Pr(N);var nt=R.length;k=k===i?nt:Co(bi(k),0,nt);var ft=k;return k-=N.length,k>=0&&R.slice(k,ft)==N}function Eb(R){return R=en(R),R&&Ve.test(R)?R.replace(Ce,Qo):R}function Mb(R){return R=en(R),R&&Xi.test(R)?R.replace(pi,"\\$&"):R}var Cb=L(function(R,N,k){return R+(k?"-":"")+N.toLowerCase()}),wb=L(function(R,N,k){return R+(k?" ":"")+N.toLowerCase()}),Ab=Yp("toLowerCase");function Pb(R,N,k){R=en(R),N=bi(N);var nt=N?V(R):0;if(!N||nt>=N)return R;var ft=(N-nt)/2;return Ee(Oh(ft),k)+R+Ee(Fh(ft),k)}function Rb(R,N,k){R=en(R),N=bi(N);var nt=N?V(R):0;return N&&nt>>0,k?(R=en(R),R&&(typeof N=="string"||N!=null&&!n0(N))&&(N=Pr(N),!N&&ws(R))?Lo(K(R),0,k):R.split(N,k)):[]}var Nb=L(function(R,N,k){return R+(k?" ":"")+a0(N)});function Bb(R,N,k){return R=en(R),k=k==null?0:Co(bi(k),0,R.length),N=Pr(N),R.slice(k,k+N.length)==N}function Ub(R,N,k){var nt=mt.templateSettings;k&&fs(R,N,k)&&(N=i),R=en(R),N=tv({},N,nt,kt);var ft=tv({},N.imports,nt.imports,kt),xt=Fr(ft),Ot=Qn(ft,xt),Gt,jt,fe=0,ce=N.interpolate||Ue,ye="__p += '",Ie=Kt((N.escape||Ue).source+"|"+ce.source+"|"+(ce===Ii?ho:Ue).source+"|"+(N.evaluate||Ue).source+"|$","g"),Ke="//# sourceURL="+(me.call(N,"sourceURL")?(N.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sr+"]")+` +`;R.replace(Ie,function(ui,Ui,Hi,_s,cs,qs){return Hi||(Hi=_s),ye+=R.slice(fe,qs).replace(We,rs),Ui&&(Gt=!0,ye+=`' + +__e(`+Ui+`) + +'`),cs&&(jt=!0,ye+=`'; +`+cs+`; +__p += '`),Hi&&(ye+=`' + +((__t = (`+Hi+`)) == null ? '' : __t) + +'`),fe=qs+ui.length,ui}),ye+=`'; +`;var hi=me.call(N,"variable")&&N.variable;if(!hi)ye=`with (obj) { +`+ye+` +} +`;else if(zs.test(hi))throw new Lt(y);ye=(jt?ye.replace(Mi,""):ye).replace(he,"$1").replace(Ti,"$1;"),ye="function("+(hi||"obj")+`) { +`+(hi?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Gt?", __e = _.escape":"")+(jt?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ye+`return __p +}`;var Oi=GS(function(){return Ut(xt,Ke+"return "+ye).apply(i,Ot)});if(Oi.source=ye,i0(Oi))throw Oi;return Oi}function zb(R){return en(R).toLowerCase()}function Gb(R){return en(R).toUpperCase()}function Vb(R,N,k){if(R=en(R),R&&(k||N===i))return zl(R);if(!R||!(N=Pr(N)))return R;var nt=K(R),ft=K(N),xt=qi(nt,ft),Ot=mo(nt,ft)+1;return Lo(nt,xt,Ot).join("")}function Hb(R,N,k){if(R=en(R),R&&(k||N===i))return R.slice(0,et(R)+1);if(!R||!(N=Pr(N)))return R;var nt=K(R),ft=mo(nt,K(N))+1;return Lo(nt,0,ft).join("")}function Wb(R,N,k){if(R=en(R),R&&(k||N===i))return R.replace(Ra,"");if(!R||!(N=Pr(N)))return R;var nt=K(R),ft=qi(nt,K(N));return Lo(nt,ft).join("")}function Xb(R,N){var k=A,nt=P;if(In(N)){var ft="separator"in N?N.separator:ft;k="length"in N?bi(N.length):k,nt="omission"in N?Pr(N.omission):nt}R=en(R);var xt=R.length;if(ws(R)){var Ot=K(R);xt=Ot.length}if(k>=xt)return R;var Gt=k-V(nt);if(Gt<1)return nt;var jt=Ot?Lo(Ot,0,Gt).join(""):R.slice(0,Gt);if(ft===i)return jt+nt;if(Ot&&(Gt+=jt.length-Gt),n0(ft)){if(R.slice(Gt).search(ft)){var fe,ce=jt;for(ft.global||(ft=Kt(ft.source,en(Ll.exec(ft))+"g")),ft.lastIndex=0;fe=ft.exec(ce);)var ye=fe.index;jt=jt.slice(0,ye===i?Gt:ye)}}else if(R.indexOf(Pr(ft),Gt)!=Gt){var Ie=jt.lastIndexOf(ft);Ie>-1&&(jt=jt.slice(0,Ie))}return jt+nt}function Yb(R){return R=en(R),R&&we.test(R)?R.replace(bt,st):R}var kb=L(function(R,N,k){return R+(k?" ":"")+N.toUpperCase()}),a0=Yp("toUpperCase");function zS(R,N,k){return R=en(R),N=k?i:N,N===i?hr(R)?Mt(R):Zo(R):R.match(N)||[]}var GS=ii(function(R,N){try{return Qi(R,i,N)}catch(k){return i0(k)?k:new Lt(k)}}),jb=Ai(function(R,N){return Sn(N,function(k){k=Oo(k),va(R,k,t0(R[k],R))}),R});function Kb(R){var N=R==null?0:R.length,k=li();return R=N?_i(R,function(nt){if(typeof nt[1]!="function")throw new Qt(s);return[k(nt[0]),nt[1]]}):[],ii(function(nt){for(var ft=-1;++ftz)return[];var k=Q,nt=Mr(R,Q);N=li(N),R-=Q;for(var ft=Cs(nt,N);++k0||N<0)?new ri(k):(R<0?k=k.takeRight(-R):R&&(k=k.drop(R)),N!==i&&(N=bi(N),k=N<0?k.dropRight(-N):k.take(N-R)),k)},ri.prototype.takeRightWhile=function(R){return this.reverse().takeWhile(R).reverse()},ri.prototype.toArray=function(){return this.take(Q)},os(ri.prototype,function(R,N){var k=/^(?:filter|find|map|reject)|While$/.test(N),nt=/^(?:head|last)$/.test(N),ft=mt[nt?"take"+(N=="last"?"Right":""):N],xt=nt||/^find/.test(N);ft&&(mt.prototype[N]=function(){var Ot=this.__wrapped__,Gt=nt?[1]:arguments,jt=Ot instanceof ri,fe=Gt[0],ce=jt||Ei(Ot),ye=function(Ui){var Hi=ft.apply(mt,Yr([Ui],Gt));return nt&&Ie?Hi[0]:Hi};ce&&k&&typeof fe=="function"&&fe.length!=1&&(jt=ce=!1);var Ie=this.__chain__,Ke=!!this.__actions__.length,hi=xt&&!Ie,Oi=jt&&!Ke;if(!xt&&ce){Ot=Oi?Ot:new ri(this);var ui=R.apply(Ot,Gt);return ui.__actions__.push({func:Kp,args:[ye],thisArg:i}),new Cr(ui,Ie)}return hi&&Oi?R.apply(this,Gt):(ui=this.thru(ye),hi?nt?ui.value()[0]:ui.value():ui)})}),Sn(["pop","push","shift","sort","splice","unshift"],function(R){var N=ae[R],k=/^(?:push|sort|unshift)$/.test(R)?"tap":"thru",nt=/^(?:pop|shift)$/.test(R);mt.prototype[R]=function(){var ft=arguments;if(nt&&!this.__chain__){var xt=this.value();return N.apply(Ei(xt)?xt:[],ft)}return this[k](function(Ot){return N.apply(Ei(Ot)?Ot:[],ft)})}}),os(ri.prototype,function(R,N){var k=mt[N];if(k){var nt=k.name+"";me.call(tl,nt)||(tl[nt]=[]),tl[nt].push({name:N,func:k})}}),tl[lt(i,o).name]=[{name:"wrapper",func:i}],ri.prototype.clone=Bg,ri.prototype.reverse=Ug,ri.prototype.value=ss,mt.prototype.at=TR,mt.prototype.chain=ER,mt.prototype.commit=MR,mt.prototype.next=CR,mt.prototype.plant=AR,mt.prototype.reverse=PR,mt.prototype.toJSON=mt.prototype.valueOf=mt.prototype.value=RR,mt.prototype.first=mt.prototype.head,To&&(mt.prototype[To]=wR),mt},zt=Nt();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(xn._=zt,define(function(){return zt})):bn?((bn.exports=zt)._=zt,Ph._=zt):xn._=zt}).call(g)}),GC=class extends Set{constructor(g,t=!1){super(g),this.valuesAsFlags=t}};function fd(g){if(g instanceof Map)return Object.fromEntries([...g.entries()].map(([t,i])=>[t,fd(i)]));if(g instanceof Set)return Array.from(g.values()).map(fd);if(g instanceof GC)return{values:[...g.values()],valuesAsFlags:g.valuesAsFlags};if(typeof g=="object"){let t={};return Object.entries(g).forEach(([i,x])=>{t[i]=fd(x)}),t}else return g}qx(t1(),1);var HO=qx(t1(),1);function uu(g,t){if(typeof g!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(g)}`);if(typeof t!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(t)}`);let i=(0,HO.cloneDeep)(g);for(let[x,T]of Object.entries(t))typeof T!="object"||T instanceof Set||i[x]===void 0?i[x]=T:i[x]=uu(i[x],T);return i}function VC(g,t){if(!(g===void 0||typeof g!="object"))for(let i of Object.keys(g)){if(i===t)return g[i];let x=g[i];if(typeof x=="object"){let T=VC(x,t);if(T!==void 0)return T}}}var x0="@composite:",WO="@inherit:",XO=class{constructor(g,t,i){this.tiledClassToMembersMap=g,this.enumNameToValuesMap=t,this.parserOptions=i,this.memoiser=new Map}flattenMembers(g,t){return this.memoiser.has(g)?{[g]:this.memoiser.get(g)}:(this.memoiser.set(g,t.reduce((i,x)=>Pn(Pn({},i),this.flattenMemberProperty(x)),{})),{[g]:this.memoiser.get(g)})}flattenMemberProperty(g){var t;let i=(t=g.propertyType)!=null?t:g.propertytype;if(g.type==="class"){if(!this.memoiser.has(i)){let E=this.tiledClassToMembersMap.get(i).reduce((s,y)=>uu(this.flattenMemberProperty(y),s),{});this.memoiser.set(i,E)}let x=this.memoiser.get(i),T=uu(x,this.flattenValue(g.value,x));return this.checkIfShouldFlatten(g.name)?T:{[g.name.replace(x0,"")]:T}}else return this.enumNameToValuesMap.has(i)?this.enumNameToValuesMap.get(i).valuesAsFlags?{[g.name]:new Set(g.value.split(",").filter(x=>x!==""))}:{[g.name]:g.value}:{[g.name]:g.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(g,t){return Object.entries(g).reduce((i,[x,T])=>{if(typeof T!="object")return VC(t,x)instanceof Set?uu({[x]:new Set(T.split(",").filter(E=>E!==""))},i):uu({[x]:T},i);if(this.checkIfShouldFlatten(x))return uu(this.flattenValue(T,t),i);{let E=x.replace(x0,"");return uu({[E]:this.flattenValue(T,t)},i)}},{})}checkIfShouldFlatten(g){var t;return((t=this.parserOptions)==null?void 0:t.defaultComposite)===!0?g.startsWith(WO):!g.startsWith(x0)}},pT=qx(t1(),1),YO=class{constructor(g){this.flattener=g}flattenPropertiesOnObject(g){var t,i,x,T;return mh(Pn(Pn({},this.flattener.memoisedFlattenedProperties.get((t=g.class)!=null?t:g.type)),(i=g.properties)==null?void 0:i.reduce((E,s)=>Pn(Pn({},E),this.flattener.flattenMemberProperty(s)),{})),{name:g.name,id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null,x:g.x,y:g.y})}flattenPropertiesOnTile(g){var t,i,x,T;return mh(Pn(Pn({},this.flattener.memoisedFlattenedProperties.get((t=g.class)!=null?t:g.type)),(i=g.properties)==null?void 0:i.reduce((E,s)=>Pn(Pn({},E),this.flattener.flattenMemberProperty(s)),{})),{id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([g,t])=>[g,(0,pT.cloneDeep)(t)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([g,t])=>[g,(0,pT.cloneDeep)(t)]))}toJSON(){return JSON.stringify({customTypes:fd(this.getCustomTypesMap()),enums:fd(this.getEnumsMap())},null,4)}};function kO(g,t){let i=new Map(g.propertyTypes.filter(E=>E.type==="enum").map(E=>[E.name,new GC(E.values,E.valuesAsFlags)])),x=new Map(g.propertyTypes.filter(E=>E.type==="class").map(E=>[E.name,E.members])),T=new XO(x,i,t);return x.forEach((E,s)=>{T.flattenMembers(s,E)}),new YO(T)}var jO={parse:kO},HC=class{constructor(g,t){this.phaserTile=g,this.tiledProject=t}getProperty(g){var t,i;let x={};if(this.tiledProject){let T=jO.parse(this.tiledProject),E=this.getType();if(E){let s=(t=T.getCustomTypesMap())==null?void 0:t.get(E);if(s)for(let[y,e]of Object.entries(s))x[y]=e}}return(i=this.phaserTile.properties[g])!=null?i:x[g]}hasProperty(g){return this.getProperty(g)!=null}getType(){var g,t;return(t=(g=this.phaserTile.tileset)==null?void 0:g.tileData[this.phaserTile.index-1])==null?void 0:t.type}},KO=class{constructor(g,t){this.phaserTilemapLayer=g,this.tiledProject=t}getName(){return this.phaserTilemapLayer.layer.name}getProperty(g){let t=this.phaserTilemapLayer.layer.properties,i=t?.find(x=>x.name==g);return i?.value}hasProperty(g){return this.getProperty(g)!=null}isCharLayer(){return this.hasProperty(em)}getData(){return this.phaserTilemapLayer.layer.data.map(g=>g.map(t=>new HC(t,this.tiledProject)))}},ZO=class{constructor(g,t){this.phaserTilemap=g,this.tiledProject=t;for(let i of this.phaserTilemap.layers)if(i.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${i.name}' has no 'tilemapLayer'. This can happen if you call 'createLayer' with the wrong layer ID.`)}getTileWidth(){return this.phaserTilemap.tileWidth}getTileHeight(){return this.phaserTilemap.tileHeight}getWidth(){return this.phaserTilemap.width}getHeight(){return this.phaserTilemap.height}getOrientation(){return this.phaserTilemap.orientation==Phaser.Tilemaps.Orientation.ISOMETRIC.toString()?"isometric":"orthogonal"}getLayers(){return this.phaserTilemap.layers.map(g=>new KO(g.tilemapLayer,this.tiledProject))}hasTileAt(g,t,i){return!!this.phaserTilemap.hasTileAt(g,t,i)}getTileAt(g,t,i){let x=this.phaserTilemap.getTileAt(g,t,!1,i);if(x)return new HC(x,this.tiledProject)}},WC=class Iy{constructor(t){this.scene=t,this.geHeadless=new LO(!1),this.isCreatedInternal=!1,Iy.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${DC}`),Iy.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(t){return this.geHeadless.getCharLayer(t)}getTransition(t,i){return this.geHeadless.getTransition(t,i)}setTransition(t,i,x){this.geHeadless.setTransition(t,i,x)}create(t,i){this.geHeadless.create(new ZO(t,i.tiledProject),i),this.isCreatedInternal=!0,this.gridCharacters=new Map;let x=this.setConfigDefaults(i);this.config=x,this.gridTilemap=new Dy(t),this.addCharacters()}getPosition(t){return this.geHeadless.getPosition(t)}move(t,i){this.geHeadless.move(t,i)}moveRandomly(t,i=0,x=-1){this.geHeadless.moveRandomly(t,i,x)}getMovement(t){return this.geHeadless.getMovement(t)}moveTo(t,i,x){return this.geHeadless.moveTo(t,i,x)}stopMovement(t){this.geHeadless.stopMovement(t)}setSpeed(t,i){this.geHeadless.setSpeed(t,i)}getSpeed(t){return this.geHeadless.getSpeed(t)}setContainer(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setContainer(i)}getContainer(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getContainer()}getOffsetX(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getOffsetX()}setOffsetX(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setOffsetX(i)}getOffsetY(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getOffsetY()}setOffsetY(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setOffsetY(i)}collidesWithTiles(t){return this.geHeadless.collidesWithTiles(t)}getWalkingAnimationMapping(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);let T=x.getAnimation();return T?.getWalkingAnimationMapping()}hasLayerOverlay(){var t;return this.initGuard(),!!((t=this.config)!=null&&t.layerOverlay)}setWalkingAnimationMapping(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);let E=T.getAnimation();E?.setWalkingAnimationMapping(i)}update(t,i){if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(i);this.geHeadless.update(t,i)}addCharacter(t){this.geHeadless.addCharacter(t),this.addCharacterInternal(t)}hasCharacter(t){return this.geHeadless.hasCharacter(t)}removeCharacter(t){var i,x;this.initGuard();let T=(i=this.gridCharacters)==null?void 0:i.get(t);if(!T)throw this.createCharUnknownErr(t);T.destroy(),(x=this.gridCharacters)==null||x.delete(t),this.geHeadless.removeCharacter(t)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let t of this.gridCharacters.keys())this.removeCharacter(t);this.geHeadless.removeAllCharacters()}}getAllCharacters(t){return this.geHeadless.getAllCharacters(t)}getLabels(t){return this.geHeadless.getLabels(t)}addLabels(t,i){this.geHeadless.addLabels(t,i)}removeLabels(t,i){this.geHeadless.removeLabels(t,i)}clearLabels(t){this.geHeadless.clearLabels(t)}follow(t,i,x,T){let E;x===void 0?E={distance:0,closestPointIfBlocked:!1}:typeof x=="number"?(E={distance:x,closestPointIfBlocked:!1},T&&(E.closestPointIfBlocked=!0)):E=x,this.geHeadless.follow(t,i,E)}isMoving(t){return this.geHeadless.isMoving(t)}getFacingDirection(t){return this.geHeadless.getFacingDirection(t)}getFacingPosition(t){return this.geHeadless.getFacingPosition(t)}turnTowards(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.turnTowards(i),this.geHeadless.turnTowards(t,i)}getCharactersAt(t,i){return this.geHeadless.getCharactersAt(t,i)}setPosition(t,i,x){this.geHeadless.setPosition(t,i,x)}getSprite(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getSprite()}setSprite(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);i.setOrigin(0,0),T.setSprite(i)}isBlocked(t,i,x=["geDefault"]){return this.geHeadless.isBlocked(t,i,x)}isTileBlocked(t,i){return this.geHeadless.isTileBlocked(t,i)}getCollisionGroups(t){return this.geHeadless.getCollisionGroups(t)}setCollisionGroups(t,i){this.geHeadless.setCollisionGroups(t,i)}getIgnoreCollisionGroups(t){return this.geHeadless.getIgnoreCollisionGroups(t)}setIgnoreCollisionGroups(t,i){this.geHeadless.setIgnoreCollisionGroups(t,i)}getTilePosInDirection(t,i,x){return this.geHeadless.getTilePosInDirection(t,i,x)}findShortestPath(t,i,x={}){return this.geHeadless.findShortestPath(t,i,x)}steppedOn(t,i,x){return this.geHeadless.steppedOn(t,i,x)}characterShifted(){return this.geHeadless.characterShifted()}movementStarted(){return this.geHeadless.movementStarted()}movementStopped(){return this.geHeadless.movementStopped()}directionChanged(){return this.geHeadless.directionChanged()}positionChangeStarted(){return this.geHeadless.positionChangeStarted()}positionChangeFinished(){return this.geHeadless.positionChangeFinished()}getMovementProgress(t){return this.geHeadless.getMovementProgress(t)}rebuildTileCollisionCache(t,i,x,T){this.geHeadless.rebuildTileCollisionCache(t,i,x,T)}addQueueMovements(t,i,x){this.geHeadless.addQueueMovements(t,i,x)}getEnqueuedMovements(t){return this.geHeadless.getEnqueuedMovements(t)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(t){return this.geHeadless.clearEnqueuedMovements(t)}getState(){return{characters:this.geHeadless.getState().characters.map(t=>mh(Pn({},t),{offsetX:this.getOffsetX(t.id),offsetY:this.getOffsetY(t.id)}))}}setState(t){if(this.geHeadless.setState(t),this.gridCharacters)for(let i of t.characters){let x=this.gridCharacters.get(i.id);x&&(x.setOffsetX(i.offsetX),x.setOffsetY(i.offsetY))}}getTileCost(t,i,x){return this.initGuard(),this.geHeadless.getTileCost(t,i,x)}setConfigDefaults(t){return Pn({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1},t)}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var t;(t=this.config)==null||t.characters.forEach(i=>this.addCharacterInternal(i))}createCharUnknownErr(t){return new Error(`Character unknown: ${t}`)}addCharacterInternal(t){var i;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let x=new fO(t,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(i=this.gridCharacters)==null||i.set(t.id,x)}};WC.welcomeMessagePrinted=!1;var JO=WC,$O=JO;/*! Bundled license information: + +tiled-property-flattener/dist/tiled_property_flattener.min.js: + (*! Bundled license information: + + lodash/lodash.js: + (** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + *) +*/function vT(g){return g.type==="ROLL_DICE"}class vu{constructor(t,i=4){this.bounds=t,this.capacity=i,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:t,yMin:i,xMax:x,yMax:T}=this.bounds,E=(x-t)/2,s=(T-i)/2,y=t,e=i;this.northeast=new vu({xMin:y+E,xMax:y+2*E,yMin:i,yMax:e+s},this.capacity),this.northwest=new vu({xMin:t,xMax:y+E,yMin:i,yMax:e+s},this.capacity),this.southeast=new vu({xMin:y+E,xMax:y+2*E,yMin:e+s,yMax:e+2*s},this.capacity),this.southwest=new vu({xMin:t,xMax:y+E,yMin:e+s,yMax:e+2*s},this.capacity),this.divided=!0}insert(t){return this.contains(t.bounds)?this.points.length=i&&t.xMax<=T&&t.yMin>=x&&t.yMax<=E}generateCacheKey(t){const{xMin:i,xMax:x,yMin:T,yMax:E}=t;return`${i},${x},${T},${E}`}queryRange(t,i=[]){if(!this.intersects(t))return i;for(const x of this.points)this.isWithinBounds(x.bounds,t)&&i.push(x);return this.divided&&(this.northwest?.queryRange(t,i),this.northeast?.queryRange(t,i),this.southwest?.queryRange(t,i),this.southeast?.queryRange(t,i)),i}query(t,i=[]){const x=`${t.x},${t.y}`,T=this.cache.get(x);if(T)return T;if(!this.intersects({xMin:t.x,xMax:t.x,yMin:t.y,yMax:t.y}))return i;for(const E of this.points)this.isWithinRange(t,E.bounds)&&i.push(E);return this.divided&&(this.northwest?.query(t,i),this.northeast?.query(t,i),this.southwest?.query(t,i),this.southeast?.query(t,i)),this.cache.set(x,i),i}intersects(t){const{xMin:i,yMin:x,xMax:T,yMax:E}=this.bounds;return!(t.xMin>T||t.xMaxE||t.yMax=i.xMin&&t.xMin<=i.xMax&&t.yMax>=i.yMin&&t.yMin<=i.yMax}isWithinRange(t,i){return t.x>=i.xMin&&t.x<=i.xMax&&t.y>=i.yMin&&t.y<=i.yMax}}function QO(g,t,i){let x=new Set([...t,void 0]);return g.listen((T,E)=>{x.has(E)&&i(T,E)})}function XC(g,t){return function(){return g.apply(t,arguments)}}const{toString:_O}=Object.prototype,{getPrototypeOf:e1}=Object,eg=(g=>t=>{const i=_O.call(t);return g[i]||(g[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Wo=g=>(g=g.toLowerCase(),t=>eg(t)===g),ig=g=>t=>typeof t===g,{isArray:sc}=Array,Td=ig("undefined");function qO(g){return g!==null&&!Td(g)&&g.constructor!==null&&!Td(g.constructor)&&wa(g.constructor.isBuffer)&&g.constructor.isBuffer(g)}const YC=Wo("ArrayBuffer");function tD(g){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(g):t=g&&g.buffer&&YC(g.buffer),t}const eD=ig("string"),wa=ig("function"),kC=ig("number"),ng=g=>g!==null&&typeof g=="object",iD=g=>g===!0||g===!1,im=g=>{if(eg(g)!=="object")return!1;const t=e1(g);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in g)&&!(Symbol.iterator in g)},nD=Wo("Date"),rD=Wo("File"),sD=Wo("Blob"),aD=Wo("FileList"),oD=g=>ng(g)&&wa(g.pipe),lD=g=>{let t;return g&&(typeof FormData=="function"&&g instanceof FormData||wa(g.append)&&((t=eg(g))==="formdata"||t==="object"&&wa(g.toString)&&g.toString()==="[object FormData]"))},hD=Wo("URLSearchParams"),uD=g=>g.trim?g.trim():g.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Jd(g,t,{allOwnKeys:i=!1}={}){if(g===null||typeof g>"u")return;let x,T;if(typeof g!="object"&&(g=[g]),sc(g))for(x=0,T=g.length;x0;)if(T=i[x],t===T.toLowerCase())return T;return null}const KC=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ZC=g=>!Td(g)&&g!==KC;function Ny(){const{caseless:g}=ZC(this)&&this||{},t={},i=(x,T)=>{const E=g&&jC(t,T)||T;im(t[E])&&im(x)?t[E]=Ny(t[E],x):im(x)?t[E]=Ny({},x):sc(x)?t[E]=x.slice():t[E]=x};for(let x=0,T=arguments.length;x(Jd(t,(T,E)=>{i&&wa(T)?g[E]=XC(T,i):g[E]=T},{allOwnKeys:x}),g),cD=g=>(g.charCodeAt(0)===65279&&(g=g.slice(1)),g),dD=(g,t,i,x)=>{g.prototype=Object.create(t.prototype,x),g.prototype.constructor=g,Object.defineProperty(g,"super",{value:t.prototype}),i&&Object.assign(g.prototype,i)},pD=(g,t,i,x)=>{let T,E,s;const y={};if(t=t||{},g==null)return t;do{for(T=Object.getOwnPropertyNames(g),E=T.length;E-- >0;)s=T[E],(!x||x(s,g,t))&&!y[s]&&(t[s]=g[s],y[s]=!0);g=i!==!1&&e1(g)}while(g&&(!i||i(g,t))&&g!==Object.prototype);return t},vD=(g,t,i)=>{g=String(g),(i===void 0||i>g.length)&&(i=g.length),i-=t.length;const x=g.indexOf(t,i);return x!==-1&&x===i},mD=g=>{if(!g)return null;if(sc(g))return g;let t=g.length;if(!kC(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=g[t];return i},gD=(g=>t=>g&&t instanceof g)(typeof Uint8Array<"u"&&e1(Uint8Array)),yD=(g,t)=>{const x=(g&&g[Symbol.iterator]).call(g);let T;for(;(T=x.next())&&!T.done;){const E=T.value;t.call(g,E[0],E[1])}},xD=(g,t)=>{let i;const x=[];for(;(i=g.exec(t))!==null;)x.push(i);return x},SD=Wo("HTMLFormElement"),TD=g=>g.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,x,T){return x.toUpperCase()+T}),mT=(({hasOwnProperty:g})=>(t,i)=>g.call(t,i))(Object.prototype),ED=Wo("RegExp"),JC=(g,t)=>{const i=Object.getOwnPropertyDescriptors(g),x={};Jd(i,(T,E)=>{let s;(s=t(T,E,g))!==!1&&(x[E]=s||T)}),Object.defineProperties(g,x)},MD=g=>{JC(g,(t,i)=>{if(wa(g)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const x=g[i];if(wa(x)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},CD=(g,t)=>{const i={},x=T=>{T.forEach(E=>{i[E]=!0})};return sc(g)?x(g):x(String(g).split(t)),i},wD=()=>{},AD=(g,t)=>(g=+g,Number.isFinite(g)?g:t),S0="abcdefghijklmnopqrstuvwxyz",gT="0123456789",$C={DIGIT:gT,ALPHA:S0,ALPHA_DIGIT:S0+S0.toUpperCase()+gT},PD=(g=16,t=$C.ALPHA_DIGIT)=>{let i="";const{length:x}=t;for(;g--;)i+=t[Math.random()*x|0];return i};function RD(g){return!!(g&&wa(g.append)&&g[Symbol.toStringTag]==="FormData"&&g[Symbol.iterator])}const bD=g=>{const t=new Array(10),i=(x,T)=>{if(ng(x)){if(t.indexOf(x)>=0)return;if(!("toJSON"in x)){t[T]=x;const E=sc(x)?[]:{};return Jd(x,(s,y)=>{const e=i(s,T+1);!Td(e)&&(E[y]=e)}),t[T]=void 0,E}}return x};return i(g,0)},LD=Wo("AsyncFunction"),FD=g=>g&&(ng(g)||wa(g))&&wa(g.then)&&wa(g.catch),de={isArray:sc,isArrayBuffer:YC,isBuffer:qO,isFormData:lD,isArrayBufferView:tD,isString:eD,isNumber:kC,isBoolean:iD,isObject:ng,isPlainObject:im,isUndefined:Td,isDate:nD,isFile:rD,isBlob:sD,isRegExp:ED,isFunction:wa,isStream:oD,isURLSearchParams:hD,isTypedArray:gD,isFileList:aD,forEach:Jd,merge:Ny,extend:fD,trim:uD,stripBOM:cD,inherits:dD,toFlatObject:pD,kindOf:eg,kindOfTest:Wo,endsWith:vD,toArray:mD,forEachEntry:yD,matchAll:xD,isHTMLForm:SD,hasOwnProperty:mT,hasOwnProp:mT,reduceDescriptors:JC,freezeMethods:MD,toObjectSet:CD,toCamelCase:TD,noop:wD,toFiniteNumber:AD,findKey:jC,global:KC,isContextDefined:ZC,ALPHABET:$C,generateString:PD,isSpecCompliantForm:RD,toJSONObject:bD,isAsyncFn:LD,isThenable:FD};function Wi(g,t,i,x,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=g,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),x&&(this.request=x),T&&(this.response=T)}de.inherits(Wi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const QC=Wi.prototype,_C={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(g=>{_C[g]={value:g}});Object.defineProperties(Wi,_C);Object.defineProperty(QC,"isAxiosError",{value:!0});Wi.from=(g,t,i,x,T,E)=>{const s=Object.create(QC);return de.toFlatObject(g,s,function(e){return e!==Error.prototype},y=>y!=="isAxiosError"),Wi.call(s,g.message,t,i,x,T),s.cause=g,s.name=g.name,E&&Object.assign(s,E),s};const OD=null;function By(g){return de.isPlainObject(g)||de.isArray(g)}function qC(g){return de.endsWith(g,"[]")?g.slice(0,-2):g}function yT(g,t,i){return g?g.concat(t).map(function(T,E){return T=qC(T),!i&&E?"["+T+"]":T}).join(i?".":""):t}function DD(g){return de.isArray(g)&&!g.some(By)}const ID=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function rg(g,t,i){if(!de.isObject(g))throw new TypeError("target must be an object");t=t||new FormData,i=de.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,f){return!de.isUndefined(f[u])});const x=i.metaTokens,T=i.visitor||p,E=i.dots,s=i.indexes,e=(i.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(T))throw new TypeError("visitor must be a function");function r(n){if(n===null)return"";if(de.isDate(n))return n.toISOString();if(!e&&de.isBlob(n))throw new Wi("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(n)||de.isTypedArray(n)?e&&typeof Blob=="function"?new Blob([n]):Buffer.from(n):n}function p(n,u,f){let o=n;if(n&&!f&&typeof n=="object"){if(de.endsWith(u,"{}"))u=x?u:u.slice(0,-2),n=JSON.stringify(n);else if(de.isArray(n)&&DD(n)||(de.isFileList(n)||de.endsWith(u,"[]"))&&(o=de.toArray(n)))return u=qC(u),o.forEach(function(d,v){!(de.isUndefined(d)||d===null)&&t.append(s===!0?yT([u],v,E):s===null?u:u+"[]",r(d))}),!1}return By(n)?!0:(t.append(yT(f,u,E),r(n)),!1)}const h=[],a=Object.assign(ID,{defaultVisitor:p,convertValue:r,isVisitable:By});function l(n,u){if(!de.isUndefined(n)){if(h.indexOf(n)!==-1)throw Error("Circular reference detected in "+u.join("."));h.push(n),de.forEach(n,function(o,c){(!(de.isUndefined(o)||o===null)&&T.call(t,o,de.isString(c)?c.trim():c,u,a))===!0&&l(o,u?u.concat(c):[c])}),h.pop()}}if(!de.isObject(g))throw new TypeError("data must be an object");return l(g),t}function xT(g){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(g).replace(/[!'()~]|%20|%00/g,function(x){return t[x]})}function i1(g,t){this._pairs=[],g&&rg(g,this,t)}const tw=i1.prototype;tw.append=function(t,i){this._pairs.push([t,i])};tw.toString=function(t){const i=t?function(x){return t.call(this,x,xT)}:xT;return this._pairs.map(function(T){return i(T[0])+"="+i(T[1])},"").join("&")};function ND(g){return encodeURIComponent(g).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ew(g,t,i){if(!t)return g;const x=i&&i.encode||ND,T=i&&i.serialize;let E;if(T?E=T(t,i):E=de.isURLSearchParams(t)?t.toString():new i1(t,i).toString(x),E){const s=g.indexOf("#");s!==-1&&(g=g.slice(0,s)),g+=(g.indexOf("?")===-1?"?":"&")+E}return g}class ST{constructor(){this.handlers=[]}use(t,i,x){return this.handlers.push({fulfilled:t,rejected:i,synchronous:x?x.synchronous:!1,runWhen:x?x.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(x){x!==null&&t(x)})}}const iw={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},BD=typeof URLSearchParams<"u"?URLSearchParams:i1,UD=typeof FormData<"u"?FormData:null,zD=typeof Blob<"u"?Blob:null,GD={isBrowser:!0,classes:{URLSearchParams:BD,FormData:UD,Blob:zD},protocols:["http","https","file","blob","url","data"]},nw=typeof window<"u"&&typeof document<"u",VD=(g=>nw&&["ReactNative","NativeScript","NS"].indexOf(g)<0)(typeof navigator<"u"&&navigator.product),HD=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",WD=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nw,hasStandardBrowserEnv:VD,hasStandardBrowserWebWorkerEnv:HD},Symbol.toStringTag,{value:"Module"})),No={...WD,...GD};function XD(g,t){return rg(g,new No.classes.URLSearchParams,Object.assign({visitor:function(i,x,T,E){return No.isNode&&de.isBuffer(i)?(this.append(x,i.toString("base64")),!1):E.defaultVisitor.apply(this,arguments)}},t))}function YD(g){return de.matchAll(/\w+|\[(\w*)]/g,g).map(t=>t[0]==="[]"?"":t[1]||t[0])}function kD(g){const t={},i=Object.keys(g);let x;const T=i.length;let E;for(x=0;x=i.length;return s=!s&&de.isArray(T)?T.length:s,e?(de.hasOwnProp(T,s)?T[s]=[T[s],x]:T[s]=x,!y):((!T[s]||!de.isObject(T[s]))&&(T[s]=[]),t(i,x,T[s],E)&&de.isArray(T[s])&&(T[s]=kD(T[s])),!y)}if(de.isFormData(g)&&de.isFunction(g.entries)){const i={};return de.forEachEntry(g,(x,T)=>{t(YD(x),T,i,0)}),i}return null}function jD(g,t,i){if(de.isString(g))try{return(t||JSON.parse)(g),de.trim(g)}catch(x){if(x.name!=="SyntaxError")throw x}return(i||JSON.stringify)(g)}const n1={transitional:iw,adapter:["xhr","http"],transformRequest:[function(t,i){const x=i.getContentType()||"",T=x.indexOf("application/json")>-1,E=de.isObject(t);if(E&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return T?JSON.stringify(rw(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let y;if(E){if(x.indexOf("application/x-www-form-urlencoded")>-1)return XD(t,this.formSerializer).toString();if((y=de.isFileList(t))||x.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return rg(y?{"files[]":t}:t,e&&new e,this.formSerializer)}}return E||T?(i.setContentType("application/json",!1),jD(t)):t}],transformResponse:[function(t){const i=this.transitional||n1.transitional,x=i&&i.forcedJSONParsing,T=this.responseType==="json";if(t&&de.isString(t)&&(x&&!this.responseType||T)){const s=!(i&&i.silentJSONParsing)&&T;try{return JSON.parse(t)}catch(y){if(s)throw y.name==="SyntaxError"?Wi.from(y,Wi.ERR_BAD_RESPONSE,this,null,this.response):y}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:No.classes.FormData,Blob:No.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],g=>{n1.headers[g]={}});const r1=n1,KD=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ZD=g=>{const t={};let i,x,T;return g&&g.split(` +`).forEach(function(s){T=s.indexOf(":"),i=s.substring(0,T).trim().toLowerCase(),x=s.substring(T+1).trim(),!(!i||t[i]&&KD[i])&&(i==="set-cookie"?t[i]?t[i].push(x):t[i]=[x]:t[i]=t[i]?t[i]+", "+x:x)}),t},TT=Symbol("internals");function jc(g){return g&&String(g).trim().toLowerCase()}function nm(g){return g===!1||g==null?g:de.isArray(g)?g.map(nm):String(g)}function JD(g){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let x;for(;x=i.exec(g);)t[x[1]]=x[2];return t}const $D=g=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(g.trim());function T0(g,t,i,x,T){if(de.isFunction(x))return x.call(this,t,i);if(T&&(t=i),!!de.isString(t)){if(de.isString(x))return t.indexOf(x)!==-1;if(de.isRegExp(x))return x.test(t)}}function QD(g){return g.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,x)=>i.toUpperCase()+x)}function _D(g,t){const i=de.toCamelCase(" "+t);["get","set","has"].forEach(x=>{Object.defineProperty(g,x+i,{value:function(T,E,s){return this[x].call(this,t,T,E,s)},configurable:!0})})}class sg{constructor(t){t&&this.set(t)}set(t,i,x){const T=this;function E(y,e,r){const p=jc(e);if(!p)throw new Error("header name must be a non-empty string");const h=de.findKey(T,p);(!h||T[h]===void 0||r===!0||r===void 0&&T[h]!==!1)&&(T[h||e]=nm(y))}const s=(y,e)=>de.forEach(y,(r,p)=>E(r,p,e));return de.isPlainObject(t)||t instanceof this.constructor?s(t,i):de.isString(t)&&(t=t.trim())&&!$D(t)?s(ZD(t),i):t!=null&&E(i,t,x),this}get(t,i){if(t=jc(t),t){const x=de.findKey(this,t);if(x){const T=this[x];if(!i)return T;if(i===!0)return JD(T);if(de.isFunction(i))return i.call(this,T,x);if(de.isRegExp(i))return i.exec(T);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=jc(t),t){const x=de.findKey(this,t);return!!(x&&this[x]!==void 0&&(!i||T0(this,this[x],x,i)))}return!1}delete(t,i){const x=this;let T=!1;function E(s){if(s=jc(s),s){const y=de.findKey(x,s);y&&(!i||T0(x,x[y],y,i))&&(delete x[y],T=!0)}}return de.isArray(t)?t.forEach(E):E(t),T}clear(t){const i=Object.keys(this);let x=i.length,T=!1;for(;x--;){const E=i[x];(!t||T0(this,this[E],E,t,!0))&&(delete this[E],T=!0)}return T}normalize(t){const i=this,x={};return de.forEach(this,(T,E)=>{const s=de.findKey(x,E);if(s){i[s]=nm(T),delete i[E];return}const y=t?QD(E):String(E).trim();y!==E&&delete i[E],i[y]=nm(T),x[y]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return de.forEach(this,(x,T)=>{x!=null&&x!==!1&&(i[T]=t&&de.isArray(x)?x.join(", "):x)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const x=new this(t);return i.forEach(T=>x.set(T)),x}static accessor(t){const x=(this[TT]=this[TT]={accessors:{}}).accessors,T=this.prototype;function E(s){const y=jc(s);x[y]||(_D(T,s),x[y]=!0)}return de.isArray(t)?t.forEach(E):E(t),this}}sg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(sg.prototype,({value:g},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>g,set(x){this[i]=x}}});de.freezeMethods(sg);const Cl=sg;function E0(g,t){const i=this||r1,x=t||i,T=Cl.from(x.headers);let E=x.data;return de.forEach(g,function(y){E=y.call(i,E,T.normalize(),t?t.status:void 0)}),T.normalize(),E}function sw(g){return!!(g&&g.__CANCEL__)}function $d(g,t,i){Wi.call(this,g??"canceled",Wi.ERR_CANCELED,t,i),this.name="CanceledError"}de.inherits($d,Wi,{__CANCEL__:!0});function qD(g,t,i){const x=i.config.validateStatus;!i.status||!x||x(i.status)?g(i):t(new Wi("Request failed with status code "+i.status,[Wi.ERR_BAD_REQUEST,Wi.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}const tI=No.hasStandardBrowserEnv?{write(g,t,i,x,T,E){const s=[g+"="+encodeURIComponent(t)];de.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),de.isString(x)&&s.push("path="+x),de.isString(T)&&s.push("domain="+T),E===!0&&s.push("secure"),document.cookie=s.join("; ")},read(g){const t=document.cookie.match(new RegExp("(^|;\\s*)("+g+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(g){this.write(g,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function eI(g){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(g)}function iI(g,t){return t?g.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):g}function aw(g,t){return g&&!eI(t)?iI(g,t):t}const nI=No.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let x;function T(E){let s=E;return t&&(i.setAttribute("href",s),s=i.href),i.setAttribute("href",s),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return x=T(window.location.href),function(s){const y=de.isString(s)?T(s):s;return y.protocol===x.protocol&&y.host===x.host}}():function(){return function(){return!0}}();function rI(g){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g);return t&&t[1]||""}function sI(g,t){g=g||10;const i=new Array(g),x=new Array(g);let T=0,E=0,s;return t=t!==void 0?t:1e3,function(e){const r=Date.now(),p=x[E];s||(s=r),i[T]=e,x[T]=r;let h=E,a=0;for(;h!==T;)a+=i[h++],h=h%g;if(T=(T+1)%g,T===E&&(E=(E+1)%g),r-s{const E=T.loaded,s=T.lengthComputable?T.total:void 0,y=E-i,e=x(y),r=E<=s;i=E;const p={loaded:E,total:s,progress:s?E/s:void 0,bytes:y,rate:e||void 0,estimated:e&&s&&r?(s-E)/e:void 0,event:T};p[t?"download":"upload"]=!0,g(p)}}const aI=typeof XMLHttpRequest<"u",oI=aI&&function(g){return new Promise(function(i,x){let T=g.data;const E=Cl.from(g.headers).normalize();let{responseType:s,withXSRFToken:y}=g,e;function r(){g.cancelToken&&g.cancelToken.unsubscribe(e),g.signal&&g.signal.removeEventListener("abort",e)}let p;if(de.isFormData(T)){if(No.hasStandardBrowserEnv||No.hasStandardBrowserWebWorkerEnv)E.setContentType(!1);else if((p=E.getContentType())!==!1){const[u,...f]=p?p.split(";").map(o=>o.trim()).filter(Boolean):[];E.setContentType([u||"multipart/form-data",...f].join("; "))}}let h=new XMLHttpRequest;if(g.auth){const u=g.auth.username||"",f=g.auth.password?unescape(encodeURIComponent(g.auth.password)):"";E.set("Authorization","Basic "+btoa(u+":"+f))}const a=aw(g.baseURL,g.url);h.open(g.method.toUpperCase(),ew(a,g.params,g.paramsSerializer),!0),h.timeout=g.timeout;function l(){if(!h)return;const u=Cl.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),o={data:!s||s==="text"||s==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:u,config:g,request:h};qD(function(d){i(d),r()},function(d){x(d),r()},o),h=null}if("onloadend"in h?h.onloadend=l:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(l)},h.onabort=function(){h&&(x(new Wi("Request aborted",Wi.ECONNABORTED,g,h)),h=null)},h.onerror=function(){x(new Wi("Network Error",Wi.ERR_NETWORK,g,h)),h=null},h.ontimeout=function(){let f=g.timeout?"timeout of "+g.timeout+"ms exceeded":"timeout exceeded";const o=g.transitional||iw;g.timeoutErrorMessage&&(f=g.timeoutErrorMessage),x(new Wi(f,o.clarifyTimeoutError?Wi.ETIMEDOUT:Wi.ECONNABORTED,g,h)),h=null},No.hasStandardBrowserEnv&&(y&&de.isFunction(y)&&(y=y(g)),y||y!==!1&&nI(a))){const u=g.xsrfHeaderName&&g.xsrfCookieName&&tI.read(g.xsrfCookieName);u&&E.set(g.xsrfHeaderName,u)}T===void 0&&E.setContentType(null),"setRequestHeader"in h&&de.forEach(E.toJSON(),function(f,o){h.setRequestHeader(o,f)}),de.isUndefined(g.withCredentials)||(h.withCredentials=!!g.withCredentials),s&&s!=="json"&&(h.responseType=g.responseType),typeof g.onDownloadProgress=="function"&&h.addEventListener("progress",ET(g.onDownloadProgress,!0)),typeof g.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",ET(g.onUploadProgress)),(g.cancelToken||g.signal)&&(e=u=>{h&&(x(!u||u.type?new $d(null,g,h):u),h.abort(),h=null)},g.cancelToken&&g.cancelToken.subscribe(e),g.signal&&(g.signal.aborted?e():g.signal.addEventListener("abort",e)));const n=rI(a);if(n&&No.protocols.indexOf(n)===-1){x(new Wi("Unsupported protocol "+n+":",Wi.ERR_BAD_REQUEST,g));return}h.send(T||null)})},Uy={http:OD,xhr:oI};de.forEach(Uy,(g,t)=>{if(g){try{Object.defineProperty(g,"name",{value:t})}catch{}Object.defineProperty(g,"adapterName",{value:t})}});const MT=g=>`- ${g}`,lI=g=>de.isFunction(g)||g===null||g===!1,ow={getAdapter:g=>{g=de.isArray(g)?g:[g];const{length:t}=g;let i,x;const T={};for(let E=0;E`adapter ${y} `+(e===!1?"is not supported by the environment":"is not available in the build"));let s=t?E.length>1?`since : +`+E.map(MT).join(` +`):" "+MT(E[0]):"as no adapter specified";throw new Wi("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return x},adapters:Uy};function M0(g){if(g.cancelToken&&g.cancelToken.throwIfRequested(),g.signal&&g.signal.aborted)throw new $d(null,g)}function CT(g){return M0(g),g.headers=Cl.from(g.headers),g.data=E0.call(g,g.transformRequest),["post","put","patch"].indexOf(g.method)!==-1&&g.headers.setContentType("application/x-www-form-urlencoded",!1),ow.getAdapter(g.adapter||r1.adapter)(g).then(function(x){return M0(g),x.data=E0.call(g,g.transformResponse,x),x.headers=Cl.from(x.headers),x},function(x){return sw(x)||(M0(g),x&&x.response&&(x.response.data=E0.call(g,g.transformResponse,x.response),x.response.headers=Cl.from(x.response.headers))),Promise.reject(x)})}const wT=g=>g instanceof Cl?g.toJSON():g;function _f(g,t){t=t||{};const i={};function x(r,p,h){return de.isPlainObject(r)&&de.isPlainObject(p)?de.merge.call({caseless:h},r,p):de.isPlainObject(p)?de.merge({},p):de.isArray(p)?p.slice():p}function T(r,p,h){if(de.isUndefined(p)){if(!de.isUndefined(r))return x(void 0,r,h)}else return x(r,p,h)}function E(r,p){if(!de.isUndefined(p))return x(void 0,p)}function s(r,p){if(de.isUndefined(p)){if(!de.isUndefined(r))return x(void 0,r)}else return x(void 0,p)}function y(r,p,h){if(h in t)return x(r,p);if(h in g)return x(void 0,r)}const e={url:E,method:E,data:E,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:y,headers:(r,p)=>T(wT(r),wT(p),!0)};return de.forEach(Object.keys(Object.assign({},g,t)),function(p){const h=e[p]||T,a=h(g[p],t[p],p);de.isUndefined(a)&&h!==y||(i[p]=a)}),i}const lw="1.6.7",s1={};["object","boolean","number","function","string","symbol"].forEach((g,t)=>{s1[g]=function(x){return typeof x===g||"a"+(t<1?"n ":" ")+g}});const AT={};s1.transitional=function(t,i,x){function T(E,s){return"[Axios v"+lw+"] Transitional option '"+E+"'"+s+(x?". "+x:"")}return(E,s,y)=>{if(t===!1)throw new Wi(T(s," has been removed"+(i?" in "+i:"")),Wi.ERR_DEPRECATED);return i&&!AT[s]&&(AT[s]=!0,console.warn(T(s," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(E,s,y):!0}};function hI(g,t,i){if(typeof g!="object")throw new Wi("options must be an object",Wi.ERR_BAD_OPTION_VALUE);const x=Object.keys(g);let T=x.length;for(;T-- >0;){const E=x[T],s=t[E];if(s){const y=g[E],e=y===void 0||s(y,E,g);if(e!==!0)throw new Wi("option "+E+" must be "+e,Wi.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Wi("Unknown option "+E,Wi.ERR_BAD_OPTION)}}const zy={assertOptions:hI,validators:s1},ql=zy.validators;class xm{constructor(t){this.defaults=t,this.interceptors={request:new ST,response:new ST}}async request(t,i){try{return await this._request(t,i)}catch(x){if(x instanceof Error){let T;Error.captureStackTrace?Error.captureStackTrace(T={}):T=new Error;const E=T.stack?T.stack.replace(/^.+\n/,""):"";x.stack?E&&!String(x.stack).endsWith(E.replace(/^.+\n.+\n/,""))&&(x.stack+=` +`+E):x.stack=E}throw x}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=_f(this.defaults,i);const{transitional:x,paramsSerializer:T,headers:E}=i;x!==void 0&&zy.assertOptions(x,{silentJSONParsing:ql.transitional(ql.boolean),forcedJSONParsing:ql.transitional(ql.boolean),clarifyTimeoutError:ql.transitional(ql.boolean)},!1),T!=null&&(de.isFunction(T)?i.paramsSerializer={serialize:T}:zy.assertOptions(T,{encode:ql.function,serialize:ql.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let s=E&&de.merge(E.common,E[i.method]);E&&de.forEach(["delete","get","head","post","put","patch","common"],n=>{delete E[n]}),i.headers=Cl.concat(s,E);const y=[];let e=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(i)===!1||(e=e&&u.synchronous,y.unshift(u.fulfilled,u.rejected))});const r=[];this.interceptors.response.forEach(function(u){r.push(u.fulfilled,u.rejected)});let p,h=0,a;if(!e){const n=[CT.bind(this),void 0];for(n.unshift.apply(n,y),n.push.apply(n,r),a=n.length,p=Promise.resolve(i);h{if(!x._listeners)return;let E=x._listeners.length;for(;E-- >0;)x._listeners[E](T);x._listeners=null}),this.promise.then=T=>{let E;const s=new Promise(y=>{x.subscribe(y),E=y}).then(T);return s.cancel=function(){x.unsubscribe(E)},s},t(function(E,s,y){x.reason||(x.reason=new $d(E,s,y),i(x.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new a1(function(T){t=T}),cancel:t}}}const uI=a1;function fI(g){return function(i){return g.apply(null,i)}}function cI(g){return de.isObject(g)&&g.isAxiosError===!0}const Gy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Gy).forEach(([g,t])=>{Gy[t]=g});const dI=Gy;function hw(g){const t=new rm(g),i=XC(rm.prototype.request,t);return de.extend(i,rm.prototype,t,{allOwnKeys:!0}),de.extend(i,t,null,{allOwnKeys:!0}),i.create=function(T){return hw(_f(g,T))},i}const gn=hw(r1);gn.Axios=rm;gn.CanceledError=$d;gn.CancelToken=uI;gn.isCancel=sw;gn.VERSION=lw;gn.toFormData=rg;gn.AxiosError=Wi;gn.Cancel=gn.CanceledError;gn.all=function(t){return Promise.all(t)};gn.spread=fI;gn.isAxiosError=cI;gn.mergeConfig=_f;gn.AxiosHeaders=Cl;gn.formToJSON=g=>rw(de.isHTMLForm(g)?new FormData(g):g);gn.getAdapter=ow.getAdapter;gn.HttpStatusCode=dI;gn.default=gn;const Gf="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function pI(g,t,i){for(;g.length=0;x--){const T=g%Gf.length;i=Gf.charAt(T)+i,g=Math.floor(g/Gf.length)}return pI(i,t,Gf[0])}function o1(){const g=Date.now(),t=gI(g,10),i=mI(16);return t+i}const yI={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},xI={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},uw={},SI={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},TI={username:"Guest",health:"100",mana:"100",energy:"100",maxHealth:"100",maxMana:"100",maxEnergy:"100",armour:"0",agility:"0",strength:"0",intelligence:"0",experience:"0",reputation:"0",faith:"0"},EI={stats:TI,inventory:xI,state:SI},MI={tooltipItem:{id:null,position:{x:0,y:0}},submenuItem:{id:null,position:{x:0,y:0}},tooltipNPC:{id:null,position:{x:0,y:0}},isStatsMenuCollapsed:!1,isSettingsMenuCollapsed:!1,debugMode:!1},CI={gamemode:"Idle",action:{type:"ROLL_DICE",diceValues:[],isRolling:!1},textures:{side1:"",side2:"",side3:"",side4:"",side5:"",side6:""}},wI=g=>{Ir(async()=>{Jr.set({...Jr.get(),[g.id]:g})})},AI=g=>{Ir(async()=>{const t=Jr.get(),{[g]:i,...x}=t;Jr.set(x)})};function Iu(g,t){return FL(g,t,{encode(i){return JSON.stringify(i)},decode(i){try{return JSON.parse(i)}catch{return t}}})}const Tn=Iu("playerData",EI),PI=Iu("quest",yI),Jr=Iu("items",uw),Qh=Iu("notifications",[]),fw=Iu("itemDB",uw),Sm=Iu("settings",MI),Ed=Iu("minigameState",CI),gl=g=>Sm.get()[g],uh=(g,t)=>{Ir(async()=>{const i=Sm.get();Sm.set({...i,[g]:t})})},RI=()=>{Ir(async()=>{try{const t=(await gn.get("https://kbve.com/api/itemdb.json")).data,i={};Object.keys(t.key).forEach(x=>{const T=t.key[x];i[T.id]=T,i[T.name]=T}),fw.set(i)}catch(g){console.error("Failed to reload item database:",g)}})},bI=g=>fw.get()[g],LI=g=>{Ir(async()=>{const t=Tn.get();t.inventory.backpack.push(g),Tn.set({...t})})},Tl=g=>{const i=Jr.get()[g];if(i)return i;console.warn(`Item with ID ${g} not found.`)},FI=g=>{Ir(async()=>{const t=o1(),i={...g,id:t};wI(i),LI(i.id),Si.emit("notification",{title:"Success",message:`You got a ${i.name}, verified by E Corp ID ${i.id}`,notificationType:Ru.success})})},OI=(g,t)=>{Ir(async()=>{const i=Tn.get(),x=Jr.get()[t];if(x){const T=i.inventory.equipment[g];if(T){const E=Jr.get()[T];E.equipped=!1,Jr.set({...Jr.get(),[E.id]:E})}x.equipped=!0,Jr.set({...Jr.get(),[x.id]:x}),i.inventory.equipment[g]=t,Tn.set({...i})}})},DI=g=>{Ir(async()=>{const t=Tn.get(),i=t.inventory.equipment[g];if(i){const x=Jr.get()[i];x&&(x.equipped=!1,Jr.set({...Jr.get(),[x.id]:x}),t.inventory.equipment[g]=null,Tn.set({...t}))}})},PT=g=>{Ir(async()=>{const t=Tn.get(),i=Jr.get()[g];i&&!i.equipped?(t.inventory.backpack=t.inventory.backpack.filter(x=>x!==g),Tn.set({...t}),AI(g)):Si.emit("notification",{title:"Warning",message:"Cannot remove item that is currently equipped.",notificationType:Ru.warning})})},cw=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.health,10),x=Math.max(i-g,0);t.stats={...t.stats,health:x.toString()},Tn.set({...t})})},II=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.health,10),x=parseInt(t.stats.maxHealth,10),T=Math.min(i+g,x);t.stats={...t.stats,health:T.toString()},Tn.set({...t})})},NI=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.mana,10),x=Math.max(i-g,0);t.stats={...t.stats,mana:x.toString()},Tn.set({...t})})},BI=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.mana,10),x=parseInt(t.stats.maxMana,10),T=Math.min(i+g,x);t.stats={...t.stats,mana:T.toString()},Tn.set({...t})})},UI=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.energy,10),x=Math.max(i-g,0);t.stats={...t.stats,energy:x.toString()},Tn.set({...t})})},zI=g=>{Ir(async()=>{const t=Tn.get(),i=parseInt(t.stats.energy,10),x=parseInt(t.stats.maxEnergy,10),T=Math.min(i+g,x);t.stats={...t.stats,energy:T.toString()},Tn.set({...t})})},GI=g=>{if(g.health!==void 0){const t=parseInt(g.health,10);t>0?II(t):cw(Math.abs(t))}if(g.mana!==void 0){const t=parseInt(g.mana,10);t>0?BI(t):NI(Math.abs(t))}if(g.energy!==void 0){const t=parseInt(g.energy,10);t>0?zI(t):UI(Math.abs(t))}},VI=async g=>{const t=o1();Ir(async()=>{const i=Tn.get();i.state.activeBoosts[t]={...g,expiry:Date.now()+g.duration*1e3},Tn.set({...i})})},HI=g=>{Ir(async()=>{const t=Tn.get(),i=g.bonuses,x={health:i?.health!==void 0?i.health.toString():void 0,mana:i?.mana!==void 0?i.mana.toString():void 0,energy:i?.energy!==void 0?i.energy.toString():void 0};GI(x),g.boost&&VI(g.boost),g.action&&console.log(`Action: ${g.action}`),Tn.set({...t})})},WI=g=>{const t=Tl(g);if(!t)return[];const i=["view","discard"];return t.consumable&&i.push("consume"),t.equipped?i.push("unequip"):t.consumable||i.push("equip"),i},Ru={caution:{type:"caution",color:"bg-yellow-200 border-yellow-300 text-yellow-700",imgUrl:"/assets/icons/notification.svg"},warning:{type:"warning",color:"bg-orange-200 border-orange-300 text-orange-700",imgUrl:"/assets/icons/notification.svg"},danger:{type:"danger",color:"bg-red-200 border-red-300 text-red-700",imgUrl:"/assets/icons/notification.svg"},success:{type:"success",color:"bg-green-200 border-green-300 text-green-700",imgUrl:"/assets/icons/notification.svg"},info:{type:"info",color:"bg-blue-200 border-blue-300 text-blue-700",imgUrl:"/assets/icons/notification.svg"}};function Qd(g){try{Ir(async()=>{const t=Ed.get();Ed.set({...t,...g})})}catch(t){console.error("Error updating minigame state:",t)}}function XI(g){Qd({gamemode:g})}function YI(g){Qd({action:g})}function kI(g){Qd({textures:g})}function dw(g){const t=Ed.get();t.gamemode==="Dice"&&t.action.type==="ROLL_DICE"&&Qd({action:{...t.action,diceValues:g}})}function RT(g){const t=Ed.get();t.gamemode==="Dice"&&t.action.type==="ROLL_DICE"&&Qd({action:{...t.action,isRolling:g}})}const jI=()=>{uh("debugMode",!0)},KI=()=>{uh("debugMode",!1)},ag=()=>gl("debugMode"),Tm=g=>typeof g=="string"?g:JSON.stringify(g,null,2),ZI=g=>{ag()&&console.log(`[DEBUG] ${Tm(g)}`)},JI=g=>{ag()&&console.warn(`[DEBUG] ${Tm(g)}`)},$I=(g,t)=>{ag()&&(t instanceof Error?console.error(`[DEBUG] ${Tm(g)} - Error: ${t.message} +${t.stack}`):console.error(`[DEBUG] ${Tm(g)}`))},qe={enable:jI,disable:KI,isEnabled:ag,log:ZI,warn:JI,error:$I};class QI{constructor(){this.events={},this.lastEmitted=new Map}on(t,i){this.events[t]||(this.events[t]=[]),this.events[t]?.push(i)}off(t,i){this.events[t]&&(this.events[t]=this.events[t]?.filter(x=>x!==i))}emit(t,i,x=0,T){const E=Date.now(),s=this.lastEmitted.get(t)||0;if(E-s>=x){if(!this.events[t])return;this.events[t]?.forEach(y=>y(i)),T&&qe.isEnabled()&&qe.log(`Event: ${String(t)} - Message: ${T}`),qe.isEnabled()&&qe.log(`Event Data: ${String(t)} - Data: ${i?JSON.stringify(i):"No data"}`),this.lastEmitted.set(t,E)}}}const Si=new QI,_I=({styleClass:g,size:t=32,color:i="#000",onClick:x,...T})=>Yt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:t,height:t,className:g,onClick:x,...T,children:Yt.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11.493 8.757L8.039 5.304 5.374 7.969l3.454 3.453-2.59 2.59 7.797.004-.017-7.784-2.525 2.525zm11.679 2.665l3.454-3.453-2.665-2.665-3.454 3.453-2.525-2.525-.017 7.784 7.797-.004-2.59-2.59zM8.828 20.578l-3.454 3.453 2.665 2.665 3.454-3.453 2.526 2.525.017-7.784-7.797.004 2.589 2.59zm16.934-2.59l-7.797-.004.017 7.784 2.525-2.525 3.454 3.453 2.665-2.665-3.454-3.453 2.59-2.59z"})}),qI=({styleClass:g,size:t=24,color:i="#000",onClick:x,...T})=>Yt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:t,height:t,className:g,onClick:x,...T,children:Yt.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8.5V4m0 0h4.5M4 4l5.5 5.5m10.5-1V4m0 0h-4.5M20 4l-5.5 5.5M4 15.5V20m0 0h4.5M4 20l5.5-5.5m10.5 1V20m0 0h-4.5m4.5 0l-5.5-5.5"})});/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const og="161",t5={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e5={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},pw=0,Vy=1,vw=2,i5=3,mw=0,lg=1,cd=2,qa=3,Al=0,gs=1,Io=2,wl=0,Su=1,Hy=2,Wy=3,Xy=4,gw=5,hh=100,yw=101,xw=102,Yy=103,ky=104,Sw=200,Tw=201,Ew=202,Mw=203,Em=204,Mm=205,Cw=206,ww=207,Aw=208,Pw=209,Rw=210,bw=211,Lw=212,Fw=213,Ow=214,Dw=0,Iw=1,Nw=2,Md=3,Bw=4,Uw=5,zw=6,Gw=7,_d=0,Vw=1,Hw=2,zo=0,Ww=1,Xw=2,Yw=3,l1=4,kw=5,jw=6,jy="attached",Kw="detached",hg=300,Pl=301,yh=302,Cd=303,wd=304,ac=306,Ad=1e3,$r=1001,Pd=1002,rr=1003,Cm=1004,n5=1004,du=1005,r5=1005,Bn=1006,dd=1007,s5=1007,Bo=1008,a5=1008,Go=1009,Zw=1010,Jw=1011,ug=1012,h1=1013,El=1014,Ma=1015,qf=1016,u1=1017,f1=1018,dh=1020,$w=1021,vs=1023,Qw=1024,_w=1025,ph=1026,bu=1027,qw=1028,c1=1029,t2=1030,d1=1031,p1=1033,sm=33776,am=33777,om=33778,lm=33779,Ky=35840,Zy=35841,Jy=35842,$y=35843,v1=36196,Qy=37492,_y=37496,qy=37808,tx=37809,ex=37810,ix=37811,nx=37812,rx=37813,sx=37814,ax=37815,ox=37816,lx=37817,hx=37818,ux=37819,fx=37820,cx=37821,hm=36492,dx=36494,px=36495,e2=36283,vx=36284,mx=36285,gx=36286,i2=2200,n2=2201,r2=2202,Rd=2300,bd=2301,um=2302,mu=2400,gu=2401,Ld=2402,fg=2500,m1=2501,o5=0,l5=1,h5=2,g1=3e3,vh=3001,s2=3200,a2=3201,Th=0,o2=1,ia="",mr="srgb",Ho="srgb-linear",cg="display-p3",qd="display-p3-linear",Fd="linear",mn="srgb",Od="rec709",Dd="p3",u5=0,fu=7680,f5=7681,c5=7682,d5=7683,p5=34055,v5=34056,m5=5386,g5=512,y5=513,x5=514,S5=515,T5=516,E5=517,M5=518,yx=519,l2=512,h2=513,u2=514,y1=515,f2=516,c2=517,d2=518,p2=519,Id=35044,C5=35048,w5=35040,A5=35045,P5=35049,R5=35041,b5=35046,L5=35050,F5=35042,O5="100",xx="300 es",wm=1035,Uo=2e3,Nd=2001;class bl{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const x=this._listeners;x[t]===void 0&&(x[t]=[]),x[t].indexOf(i)===-1&&x[t].push(i)}hasEventListener(t,i){if(this._listeners===void 0)return!1;const x=this._listeners;return x[t]!==void 0&&x[t].indexOf(i)!==-1}removeEventListener(t,i){if(this._listeners===void 0)return;const T=this._listeners[t];if(T!==void 0){const E=T.indexOf(i);E!==-1&&T.splice(E,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const x=this._listeners[t.type];if(x!==void 0){t.target=this;const T=x.slice(0);for(let E=0,s=T.length;E>8&255]+jr[g>>16&255]+jr[g>>24&255]+"-"+jr[t&255]+jr[t>>8&255]+"-"+jr[t>>16&15|64]+jr[t>>24&255]+"-"+jr[i&63|128]+jr[i>>8&255]+"-"+jr[i>>16&255]+jr[i>>24&255]+jr[x&255]+jr[x>>8&255]+jr[x>>16&255]+jr[x>>24&255]).toLowerCase()}function Zn(g,t,i){return Math.max(t,Math.min(i,g))}function x1(g,t){return(g%t+t)%t}function D5(g,t,i,x,T){return x+(g-t)*(T-x)/(i-t)}function I5(g,t,i){return g!==t?(i-g)/(t-g):0}function pd(g,t,i){return(1-i)*g+i*t}function N5(g,t,i,x){return pd(g,t,1-Math.exp(-i*x))}function B5(g,t=1){return t-Math.abs(x1(g,t*2)-t)}function U5(g,t,i){return g<=t?0:g>=i?1:(g=(g-t)/(i-t),g*g*(3-2*g))}function z5(g,t,i){return g<=t?0:g>=i?1:(g=(g-t)/(i-t),g*g*g*(g*(g*6-15)+10))}function G5(g,t){return g+Math.floor(Math.random()*(t-g+1))}function V5(g,t){return g+Math.random()*(t-g)}function H5(g){return g*(.5-Math.random())}function W5(g){g!==void 0&&(bT=g);let t=bT+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function X5(g){return g*Tu}function Y5(g){return g*tc}function Sx(g){return(g&g-1)===0&&g!==0}function k5(g){return Math.pow(2,Math.ceil(Math.log(g)/Math.LN2))}function Am(g){return Math.pow(2,Math.floor(Math.log(g)/Math.LN2))}function j5(g,t,i,x,T){const E=Math.cos,s=Math.sin,y=E(i/2),e=s(i/2),r=E((t+x)/2),p=s((t+x)/2),h=E((t-x)/2),a=s((t-x)/2),l=E((x-t)/2),n=s((x-t)/2);switch(T){case"XYX":g.set(y*p,e*h,e*a,y*r);break;case"YZY":g.set(e*a,y*p,e*h,y*r);break;case"ZXZ":g.set(e*h,e*a,y*p,y*r);break;case"XZX":g.set(y*p,e*n,e*l,y*r);break;case"YXY":g.set(e*l,y*p,e*n,y*r);break;case"ZYZ":g.set(e*n,e*l,y*p,y*r);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+T)}}function ms(g,t){switch(t.constructor){case Float32Array:return g;case Uint32Array:return g/4294967295;case Uint16Array:return g/65535;case Uint8Array:return g/255;case Int32Array:return Math.max(g/2147483647,-1);case Int16Array:return Math.max(g/32767,-1);case Int8Array:return Math.max(g/127,-1);default:throw new Error("Invalid component type.")}}function Pi(g,t){switch(t.constructor){case Float32Array:return g;case Uint32Array:return Math.round(g*4294967295);case Uint16Array:return Math.round(g*65535);case Uint8Array:return Math.round(g*255);case Int32Array:return Math.round(g*2147483647);case Int16Array:return Math.round(g*32767);case Int8Array:return Math.round(g*127);default:throw new Error("Invalid component type.")}}const fm={DEG2RAD:Tu,RAD2DEG:tc,generateUUID:ra,clamp:Zn,euclideanModulo:x1,mapLinear:D5,inverseLerp:I5,lerp:pd,damp:N5,pingpong:B5,smoothstep:U5,smootherstep:z5,randInt:G5,randFloat:V5,randFloatSpread:H5,seededRandom:W5,degToRad:X5,radToDeg:Y5,isPowerOfTwo:Sx,ceilPowerOfTwo:k5,floorPowerOfTwo:Am,setQuaternionFromProperEuler:j5,normalize:Pi,denormalize:ms};class ve{constructor(t=0,i=0){ve.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,x=this.y,T=t.elements;return this.x=T[0]*i+T[3]*x+T[6],this.y=T[1]*i+T[4]*x+T[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(t)/i;return Math.acos(Zn(x,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,x=this.y-t.y;return i*i+x*x}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const x=Math.cos(i),T=Math.sin(i),E=this.x-t.x,s=this.y-t.y;return this.x=E*x-s*T+t.x,this.y=E*T+s*x+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Di{constructor(t,i,x,T,E,s,y,e,r){Di.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,x,T,E,s,y,e,r)}set(t,i,x,T,E,s,y,e,r){const p=this.elements;return p[0]=t,p[1]=T,p[2]=y,p[3]=i,p[4]=E,p[5]=e,p[6]=x,p[7]=s,p[8]=r,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,x=t.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],this}extractBasis(t,i,x){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),x.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const x=t.elements,T=i.elements,E=this.elements,s=x[0],y=x[3],e=x[6],r=x[1],p=x[4],h=x[7],a=x[2],l=x[5],n=x[8],u=T[0],f=T[3],o=T[6],c=T[1],d=T[4],v=T[7],m=T[2],S=T[5],M=T[8];return E[0]=s*u+y*c+e*m,E[3]=s*f+y*d+e*S,E[6]=s*o+y*v+e*M,E[1]=r*u+p*c+h*m,E[4]=r*f+p*d+h*S,E[7]=r*o+p*v+h*M,E[2]=a*u+l*c+n*m,E[5]=a*f+l*d+n*S,E[8]=a*o+l*v+n*M,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8];return i*s*p-i*y*r-x*E*p+x*y*e+T*E*r-T*s*e}invert(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8],h=p*s-y*r,a=y*e-p*E,l=r*E-s*e,n=i*h+x*a+T*l;if(n===0)return this.set(0,0,0,0,0,0,0,0,0);const u=1/n;return t[0]=h*u,t[1]=(T*r-p*x)*u,t[2]=(y*x-T*s)*u,t[3]=a*u,t[4]=(p*i-T*e)*u,t[5]=(T*E-y*i)*u,t[6]=l*u,t[7]=(x*e-r*i)*u,t[8]=(s*i-x*E)*u,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,x,T,E,s,y){const e=Math.cos(E),r=Math.sin(E);return this.set(x*e,x*r,-x*(e*s+r*y)+s+t,-T*r,T*e,-T*(-r*s+e*y)+y+i,0,0,1),this}scale(t,i){return this.premultiply(C0.makeScale(t,i)),this}rotate(t){return this.premultiply(C0.makeRotation(-t)),this}translate(t,i){return this.premultiply(C0.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,-x,0,x,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,x=t.elements;for(let T=0;T<9;T++)if(i[T]!==x[T])return!1;return!0}fromArray(t,i=0){for(let x=0;x<9;x++)this.elements[x]=t[x+i];return this}toArray(t=[],i=0){const x=this.elements;return t[i]=x[0],t[i+1]=x[1],t[i+2]=x[2],t[i+3]=x[3],t[i+4]=x[4],t[i+5]=x[5],t[i+6]=x[6],t[i+7]=x[7],t[i+8]=x[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const C0=new Di;function v2(g){for(let t=g.length-1;t>=0;--t)if(g[t]>=65535)return!0;return!1}const K5={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Vf(g,t){return new K5[g](t)}function Bd(g){return document.createElementNS("http://www.w3.org/1999/xhtml",g)}function m2(){const g=Bd("canvas");return g.style.display="block",g}const LT={};function Eu(g){g in LT||(LT[g]=!0,console.warn(g))}const FT=new Di().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),OT=new Di().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),sv={[Ho]:{transfer:Fd,primaries:Od,toReference:g=>g,fromReference:g=>g},[mr]:{transfer:mn,primaries:Od,toReference:g=>g.convertSRGBToLinear(),fromReference:g=>g.convertLinearToSRGB()},[qd]:{transfer:Fd,primaries:Dd,toReference:g=>g.applyMatrix3(OT),fromReference:g=>g.applyMatrix3(FT)},[cg]:{transfer:mn,primaries:Dd,toReference:g=>g.convertSRGBToLinear().applyMatrix3(OT),fromReference:g=>g.applyMatrix3(FT).convertLinearToSRGB()}},Z5=new Set([Ho,qd]),sn={enabled:!0,_workingColorSpace:Ho,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(g){if(!Z5.has(g))throw new Error(`Unsupported working color space, "${g}".`);this._workingColorSpace=g},convert:function(g,t,i){if(this.enabled===!1||t===i||!t||!i)return g;const x=sv[t].toReference,T=sv[i].fromReference;return T(x(g))},fromWorkingColorSpace:function(g,t){return this.convert(g,this._workingColorSpace,t)},toWorkingColorSpace:function(g,t){return this.convert(g,t,this._workingColorSpace)},getPrimaries:function(g){return sv[g].primaries},getTransfer:function(g){return g===ia?Fd:sv[g].transfer}};function Kf(g){return g<.04045?g*.0773993808:Math.pow(g*.9478672986+.0521327014,2.4)}function w0(g){return g<.0031308?g*12.92:1.055*Math.pow(g,.41666)-.055}let ff;class S1{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{ff===void 0&&(ff=Bd("canvas")),ff.width=t.width,ff.height=t.height;const x=ff.getContext("2d");t instanceof ImageData?x.putImageData(t,0,0):x.drawImage(t,0,0,t.width,t.height),i=ff}return i.width>2048||i.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),i.toDataURL("image/jpeg",.6)):i.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=Bd("canvas");i.width=t.width,i.height=t.height;const x=i.getContext("2d");x.drawImage(t,0,0,t.width,t.height);const T=x.getImageData(0,0,t.width,t.height),E=T.data;for(let s=0;s0&&(x.userData=this.userData),i||(t.textures[this.uuid]=x),x}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==hg)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ad:t.x=t.x-Math.floor(t.x);break;case $r:t.x=t.x<0?0:1;break;case Pd:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Ad:t.y=t.y-Math.floor(t.y);break;case $r:t.y=t.y<0?0:1;break;case Pd:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Eu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===mr?vh:g1}set encoding(t){Eu("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===vh?mr:ia}}zn.DEFAULT_IMAGE=null;zn.DEFAULT_MAPPING=hg;zn.DEFAULT_ANISOTROPY=1;class an{constructor(t=0,i=0,x=0,T=1){an.prototype.isVector4=!0,this.x=t,this.y=i,this.z=x,this.w=T}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,x,T){return this.x=t,this.y=i,this.z=x,this.w=T,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,x=this.y,T=this.z,E=this.w,s=t.elements;return this.x=s[0]*i+s[4]*x+s[8]*T+s[12]*E,this.y=s[1]*i+s[5]*x+s[9]*T+s[13]*E,this.z=s[2]*i+s[6]*x+s[10]*T+s[14]*E,this.w=s[3]*i+s[7]*x+s[11]*T+s[15]*E,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,x,T,E;const e=t.elements,r=e[0],p=e[4],h=e[8],a=e[1],l=e[5],n=e[9],u=e[2],f=e[6],o=e[10];if(Math.abs(p-a)<.01&&Math.abs(h-u)<.01&&Math.abs(n-f)<.01){if(Math.abs(p+a)<.1&&Math.abs(h+u)<.1&&Math.abs(n+f)<.1&&Math.abs(r+l+o-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const d=(r+1)/2,v=(l+1)/2,m=(o+1)/2,S=(p+a)/4,M=(h+u)/4,w=(n+f)/4;return d>v&&d>m?d<.01?(x=0,T=.707106781,E=.707106781):(x=Math.sqrt(d),T=S/x,E=M/x):v>m?v<.01?(x=.707106781,T=0,E=.707106781):(T=Math.sqrt(v),x=S/T,E=w/T):m<.01?(x=.707106781,T=.707106781,E=0):(E=Math.sqrt(m),x=M/E,T=w/E),this.set(x,T,E,i),this}let c=Math.sqrt((f-n)*(f-n)+(h-u)*(h-u)+(a-p)*(a-p));return Math.abs(c)<.001&&(c=1),this.x=(f-n)/c,this.y=(h-u)/c,this.z=(a-p)/c,this.w=Math.acos((r+l+o-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this.z=t.z+(i.z-t.z)*x,this.w=t.w+(i.w-t.w)*x,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class g2 extends bl{constructor(t=1,i=1,x={}){super(),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=1,this.scissor=new an(0,0,t,i),this.scissorTest=!1,this.viewport=new an(0,0,t,i);const T={width:t,height:i,depth:1};x.encoding!==void 0&&(Eu("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),x.colorSpace=x.encoding===vh?mr:ia),x=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Bn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},x),this.texture=new zn(T,x.mapping,x.wrapS,x.wrapT,x.magFilter,x.minFilter,x.format,x.type,x.anisotropy,x.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=x.generateMipmaps,this.texture.internalFormat=x.internalFormat,this.depthBuffer=x.depthBuffer,this.stencilBuffer=x.stencilBuffer,this.depthTexture=x.depthTexture,this.samples=x.samples}setSize(t,i,x=1){(this.width!==t||this.height!==i||this.depth!==x)&&(this.width=t,this.height=i,this.depth=x,this.texture.image.width=t,this.texture.image.height=i,this.texture.image.depth=x,this.dispose()),this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const i=Object.assign({},t.texture.image);return this.texture.source=new yu(i),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ro extends g2{constructor(t=1,i=1,x={}){super(t,i,x),this.isWebGLRenderTarget=!0}}class dg extends zn{constructor(t=null,i=1,x=1,T=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:x,depth:T},this.magFilter=rr,this.minFilter=rr,this.wrapR=$r,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Q5 extends ro{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGLArrayRenderTarget=!0,this.depth=x,this.texture=new dg(null,t,i,x),this.texture.isRenderTargetTexture=!0}}class T1 extends zn{constructor(t=null,i=1,x=1,T=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:x,depth:T},this.magFilter=rr,this.minFilter=rr,this.wrapR=$r,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class _5 extends ro{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGL3DRenderTarget=!0,this.depth=x,this.texture=new T1(null,t,i,x),this.texture.isRenderTargetTexture=!0}}class q5 extends ro{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGLMultipleRenderTargets=!0;const E=this.texture;this.texture=[];for(let s=0;s=0?1:-1,d=1-o*o;if(d>Number.EPSILON){const m=Math.sqrt(d),S=Math.atan2(m,o*c);f=Math.sin(f*S)/m,y=Math.sin(y*S)/m}const v=y*c;if(e=e*f+a*v,r=r*f+l*v,p=p*f+n*v,h=h*f+u*v,f===1-y){const m=1/Math.sqrt(e*e+r*r+p*p+h*h);e*=m,r*=m,p*=m,h*=m}}t[i]=e,t[i+1]=r,t[i+2]=p,t[i+3]=h}static multiplyQuaternionsFlat(t,i,x,T,E,s){const y=x[T],e=x[T+1],r=x[T+2],p=x[T+3],h=E[s],a=E[s+1],l=E[s+2],n=E[s+3];return t[i]=y*n+p*h+e*l-r*a,t[i+1]=e*n+p*a+r*h-y*l,t[i+2]=r*n+p*l+y*a-e*h,t[i+3]=p*n-y*h-e*a-r*l,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,x,T){return this._x=t,this._y=i,this._z=x,this._w=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const x=t._x,T=t._y,E=t._z,s=t._order,y=Math.cos,e=Math.sin,r=y(x/2),p=y(T/2),h=y(E/2),a=e(x/2),l=e(T/2),n=e(E/2);switch(s){case"XYZ":this._x=a*p*h+r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h-a*l*n;break;case"YXZ":this._x=a*p*h+r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h+a*l*n;break;case"ZXY":this._x=a*p*h-r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h-a*l*n;break;case"ZYX":this._x=a*p*h-r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h+a*l*n;break;case"YZX":this._x=a*p*h+r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h-a*l*n;break;case"XZY":this._x=a*p*h-r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h+a*l*n;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const x=i/2,T=Math.sin(x);return this._x=t.x*T,this._y=t.y*T,this._z=t.z*T,this._w=Math.cos(x),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,x=i[0],T=i[4],E=i[8],s=i[1],y=i[5],e=i[9],r=i[2],p=i[6],h=i[10],a=x+y+h;if(a>0){const l=.5/Math.sqrt(a+1);this._w=.25/l,this._x=(p-e)*l,this._y=(E-r)*l,this._z=(s-T)*l}else if(x>y&&x>h){const l=2*Math.sqrt(1+x-y-h);this._w=(p-e)/l,this._x=.25*l,this._y=(T+s)/l,this._z=(E+r)/l}else if(y>h){const l=2*Math.sqrt(1+y-x-h);this._w=(E-r)/l,this._x=(T+s)/l,this._y=.25*l,this._z=(e+p)/l}else{const l=2*Math.sqrt(1+h-x-y);this._w=(s-T)/l,this._x=(E+r)/l,this._y=(e+p)/l,this._z=.25*l}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let x=t.dot(i)+1;return xMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=x):(this._x=0,this._y=-t.z,this._z=t.y,this._w=x)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=x),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Zn(this.dot(t),-1,1)))}rotateTowards(t,i){const x=this.angleTo(t);if(x===0)return this;const T=Math.min(1,i/x);return this.slerp(t,T),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const x=t._x,T=t._y,E=t._z,s=t._w,y=i._x,e=i._y,r=i._z,p=i._w;return this._x=x*p+s*y+T*r-E*e,this._y=T*p+s*e+E*y-x*r,this._z=E*p+s*r+x*e-T*y,this._w=s*p-x*y-T*e-E*r,this._onChangeCallback(),this}slerp(t,i){if(i===0)return this;if(i===1)return this.copy(t);const x=this._x,T=this._y,E=this._z,s=this._w;let y=s*t._w+x*t._x+T*t._y+E*t._z;if(y<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,y=-y):this.copy(t),y>=1)return this._w=s,this._x=x,this._y=T,this._z=E,this;const e=1-y*y;if(e<=Number.EPSILON){const l=1-i;return this._w=l*s+i*this._w,this._x=l*x+i*this._x,this._y=l*T+i*this._y,this._z=l*E+i*this._z,this.normalize(),this}const r=Math.sqrt(e),p=Math.atan2(r,y),h=Math.sin((1-i)*p)/r,a=Math.sin(i*p)/r;return this._w=s*h+this._w*a,this._x=x*h+this._x*a,this._y=T*h+this._y*a,this._z=E*h+this._z*a,this._onChangeCallback(),this}slerpQuaternions(t,i,x){return this.copy(t).slerp(i,x)}random(){const t=Math.random(),i=Math.sqrt(1-t),x=Math.sqrt(t),T=2*Math.PI*Math.random(),E=2*Math.PI*Math.random();return this.set(i*Math.cos(T),x*Math.sin(E),x*Math.cos(E),i*Math.sin(T))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ct{constructor(t=0,i=0,x=0){Ct.prototype.isVector3=!0,this.x=t,this.y=i,this.z=x}set(t,i,x){return x===void 0&&(x=this.z),this.x=t,this.y=i,this.z=x,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(DT.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(DT.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,x=this.y,T=this.z,E=t.elements;return this.x=E[0]*i+E[3]*x+E[6]*T,this.y=E[1]*i+E[4]*x+E[7]*T,this.z=E[2]*i+E[5]*x+E[8]*T,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,x=this.y,T=this.z,E=t.elements,s=1/(E[3]*i+E[7]*x+E[11]*T+E[15]);return this.x=(E[0]*i+E[4]*x+E[8]*T+E[12])*s,this.y=(E[1]*i+E[5]*x+E[9]*T+E[13])*s,this.z=(E[2]*i+E[6]*x+E[10]*T+E[14])*s,this}applyQuaternion(t){const i=this.x,x=this.y,T=this.z,E=t.x,s=t.y,y=t.z,e=t.w,r=2*(s*T-y*x),p=2*(y*i-E*T),h=2*(E*x-s*i);return this.x=i+e*r+s*h-y*p,this.y=x+e*p+y*r-E*h,this.z=T+e*h+E*p-s*r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,x=this.y,T=this.z,E=t.elements;return this.x=E[0]*i+E[4]*x+E[8]*T,this.y=E[1]*i+E[5]*x+E[9]*T,this.z=E[2]*i+E[6]*x+E[10]*T,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this.z=t.z+(i.z-t.z)*x,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const x=t.x,T=t.y,E=t.z,s=i.x,y=i.y,e=i.z;return this.x=T*e-E*y,this.y=E*s-x*e,this.z=x*y-T*s,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const x=t.dot(this)/i;return this.copy(t).multiplyScalar(x)}projectOnPlane(t){return P0.copy(this).projectOnVector(t),this.sub(P0)}reflect(t){return this.sub(P0.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(t)/i;return Math.acos(Zn(x,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,x=this.y-t.y,T=this.z-t.z;return i*i+x*x+T*T}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,x){const T=Math.sin(i)*t;return this.x=T*Math.sin(x),this.y=Math.cos(i)*t,this.z=T*Math.cos(x),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,x){return this.x=t*Math.sin(i),this.y=x,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),x=this.setFromMatrixColumn(t,1).length(),T=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=x,this.z=T,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,i=Math.random()*Math.PI*2,x=Math.sqrt(1-t**2);return this.x=x*Math.cos(i),this.y=x*Math.sin(i),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const P0=new Ct,DT=new Is;class ys{constructor(t=new Ct(1/0,1/0,1/0),i=new Ct(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,x=t.length;ithis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,$a),$a.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,x;return t.normal.x>0?(i=t.normal.x*this.min.x,x=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,x=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,x+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,x+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,x+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,x+=t.normal.z*this.min.z),i<=-t.constant&&x>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Kc),ov.subVectors(this.max,Kc),cf.subVectors(t.a,Kc),df.subVectors(t.b,Kc),pf.subVectors(t.c,Kc),th.subVectors(df,cf),eh.subVectors(pf,df),_h.subVectors(cf,pf);let i=[0,-th.z,th.y,0,-eh.z,eh.y,0,-_h.z,_h.y,th.z,0,-th.x,eh.z,0,-eh.x,_h.z,0,-_h.x,-th.y,th.x,0,-eh.y,eh.x,0,-_h.y,_h.x,0];return!R0(i,cf,df,pf,ov)||(i=[1,0,0,0,1,0,0,0,1],!R0(i,cf,df,pf,ov))?!1:(lv.crossVectors(th,eh),i=[lv.x,lv.y,lv.z],R0(i,cf,df,pf,ov))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,$a).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize($a).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(fl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),fl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),fl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),fl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),fl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),fl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),fl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),fl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(fl),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const fl=[new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct],$a=new Ct,av=new ys,cf=new Ct,df=new Ct,pf=new Ct,th=new Ct,eh=new Ct,_h=new Ct,Kc=new Ct,ov=new Ct,lv=new Ct,qh=new Ct;function R0(g,t,i,x,T){for(let E=0,s=g.length-3;E<=s;E+=3){qh.fromArray(g,E);const y=T.x*Math.abs(qh.x)+T.y*Math.abs(qh.y)+T.z*Math.abs(qh.z),e=t.dot(qh),r=i.dot(qh),p=x.dot(qh);if(Math.max(-Math.max(e,r,p),Math.min(e,r,p))>y)return!1}return!0}const tN=new ys,Zc=new Ct,b0=new Ct;class Qr{constructor(t=new Ct,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const x=this.center;i!==void 0?x.copy(i):tN.setFromPoints(t).getCenter(x);let T=0;for(let E=0,s=t.length;Ethis.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Zc.subVectors(t,this.center);const i=Zc.lengthSq();if(i>this.radius*this.radius){const x=Math.sqrt(i),T=(x-this.radius)*.5;this.center.addScaledVector(Zc,T/x),this.radius+=T}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(b0.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Zc.copy(t.center).add(b0)),this.expandByPoint(Zc.copy(t.center).sub(b0))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const cl=new Ct,L0=new Ct,hv=new Ct,ih=new Ct,F0=new Ct,uv=new Ct,O0=new Ct;class oc{constructor(t=new Ct,i=new Ct(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,cl)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const x=i.dot(this.direction);return x<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,x)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=cl.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(cl.copy(this.origin).addScaledVector(this.direction,i),cl.distanceToSquared(t))}distanceSqToSegment(t,i,x,T){L0.copy(t).add(i).multiplyScalar(.5),hv.copy(i).sub(t).normalize(),ih.copy(this.origin).sub(L0);const E=t.distanceTo(i)*.5,s=-this.direction.dot(hv),y=ih.dot(this.direction),e=-ih.dot(hv),r=ih.lengthSq(),p=Math.abs(1-s*s);let h,a,l,n;if(p>0)if(h=s*e-y,a=s*y-e,n=E*p,h>=0)if(a>=-n)if(a<=n){const u=1/p;h*=u,a*=u,l=h*(h+s*a+2*y)+a*(s*h+a+2*e)+r}else a=E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;else a=-E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;else a<=-n?(h=Math.max(0,-(-s*E+y)),a=h>0?-E:Math.min(Math.max(-E,-e),E),l=-h*h+a*(a+2*e)+r):a<=n?(h=0,a=Math.min(Math.max(-E,-e),E),l=a*(a+2*e)+r):(h=Math.max(0,-(s*E+y)),a=h>0?E:Math.min(Math.max(-E,-e),E),l=-h*h+a*(a+2*e)+r);else a=s>0?-E:E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;return x&&x.copy(this.origin).addScaledVector(this.direction,h),T&&T.copy(L0).addScaledVector(hv,a),l}intersectSphere(t,i){cl.subVectors(t.center,this.origin);const x=cl.dot(this.direction),T=cl.dot(cl)-x*x,E=t.radius*t.radius;if(T>E)return null;const s=Math.sqrt(E-T),y=x-s,e=x+s;return e<0?null:y<0?this.at(e,i):this.at(y,i)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const x=-(this.origin.dot(t.normal)+t.constant)/i;return x>=0?x:null}intersectPlane(t,i){const x=this.distanceToPlane(t);return x===null?null:this.at(x,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let x,T,E,s,y,e;const r=1/this.direction.x,p=1/this.direction.y,h=1/this.direction.z,a=this.origin;return r>=0?(x=(t.min.x-a.x)*r,T=(t.max.x-a.x)*r):(x=(t.max.x-a.x)*r,T=(t.min.x-a.x)*r),p>=0?(E=(t.min.y-a.y)*p,s=(t.max.y-a.y)*p):(E=(t.max.y-a.y)*p,s=(t.min.y-a.y)*p),x>s||E>T||((E>x||isNaN(x))&&(x=E),(s=0?(y=(t.min.z-a.z)*h,e=(t.max.z-a.z)*h):(y=(t.max.z-a.z)*h,e=(t.min.z-a.z)*h),x>e||y>T)||((y>x||x!==x)&&(x=y),(e=0?x:T,i)}intersectsBox(t){return this.intersectBox(t,cl)!==null}intersectTriangle(t,i,x,T,E){F0.subVectors(i,t),uv.subVectors(x,t),O0.crossVectors(F0,uv);let s=this.direction.dot(O0),y;if(s>0){if(T)return null;y=1}else if(s<0)y=-1,s=-s;else return null;ih.subVectors(this.origin,t);const e=y*this.direction.dot(uv.crossVectors(ih,uv));if(e<0)return null;const r=y*this.direction.dot(F0.cross(ih));if(r<0||e+r>s)return null;const p=-y*ih.dot(O0);return p<0?null:this.at(p/s,E)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class di{constructor(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f){di.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f)}set(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f){const o=this.elements;return o[0]=t,o[4]=i,o[8]=x,o[12]=T,o[1]=E,o[5]=s,o[9]=y,o[13]=e,o[2]=r,o[6]=p,o[10]=h,o[14]=a,o[3]=l,o[7]=n,o[11]=u,o[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new di().fromArray(this.elements)}copy(t){const i=this.elements,x=t.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],i[9]=x[9],i[10]=x[10],i[11]=x[11],i[12]=x[12],i[13]=x[13],i[14]=x[14],i[15]=x[15],this}copyPosition(t){const i=this.elements,x=t.elements;return i[12]=x[12],i[13]=x[13],i[14]=x[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,x){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),x.setFromMatrixColumn(this,2),this}makeBasis(t,i,x){return this.set(t.x,i.x,x.x,0,t.y,i.y,x.y,0,t.z,i.z,x.z,0,0,0,0,1),this}extractRotation(t){const i=this.elements,x=t.elements,T=1/vf.setFromMatrixColumn(t,0).length(),E=1/vf.setFromMatrixColumn(t,1).length(),s=1/vf.setFromMatrixColumn(t,2).length();return i[0]=x[0]*T,i[1]=x[1]*T,i[2]=x[2]*T,i[3]=0,i[4]=x[4]*E,i[5]=x[5]*E,i[6]=x[6]*E,i[7]=0,i[8]=x[8]*s,i[9]=x[9]*s,i[10]=x[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,x=t.x,T=t.y,E=t.z,s=Math.cos(x),y=Math.sin(x),e=Math.cos(T),r=Math.sin(T),p=Math.cos(E),h=Math.sin(E);if(t.order==="XYZ"){const a=s*p,l=s*h,n=y*p,u=y*h;i[0]=e*p,i[4]=-e*h,i[8]=r,i[1]=l+n*r,i[5]=a-u*r,i[9]=-y*e,i[2]=u-a*r,i[6]=n+l*r,i[10]=s*e}else if(t.order==="YXZ"){const a=e*p,l=e*h,n=r*p,u=r*h;i[0]=a+u*y,i[4]=n*y-l,i[8]=s*r,i[1]=s*h,i[5]=s*p,i[9]=-y,i[2]=l*y-n,i[6]=u+a*y,i[10]=s*e}else if(t.order==="ZXY"){const a=e*p,l=e*h,n=r*p,u=r*h;i[0]=a-u*y,i[4]=-s*h,i[8]=n+l*y,i[1]=l+n*y,i[5]=s*p,i[9]=u-a*y,i[2]=-s*r,i[6]=y,i[10]=s*e}else if(t.order==="ZYX"){const a=s*p,l=s*h,n=y*p,u=y*h;i[0]=e*p,i[4]=n*r-l,i[8]=a*r+u,i[1]=e*h,i[5]=u*r+a,i[9]=l*r-n,i[2]=-r,i[6]=y*e,i[10]=s*e}else if(t.order==="YZX"){const a=s*e,l=s*r,n=y*e,u=y*r;i[0]=e*p,i[4]=u-a*h,i[8]=n*h+l,i[1]=h,i[5]=s*p,i[9]=-y*p,i[2]=-r*p,i[6]=l*h+n,i[10]=a-u*h}else if(t.order==="XZY"){const a=s*e,l=s*r,n=y*e,u=y*r;i[0]=e*p,i[4]=-h,i[8]=r*p,i[1]=a*h+u,i[5]=s*p,i[9]=l*h-n,i[2]=n*h-l,i[6]=y*p,i[10]=u*h+a}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(eN,t,iN)}lookAt(t,i,x){const T=this.elements;return ta.subVectors(t,i),ta.lengthSq()===0&&(ta.z=1),ta.normalize(),nh.crossVectors(x,ta),nh.lengthSq()===0&&(Math.abs(x.z)===1?ta.x+=1e-4:ta.z+=1e-4,ta.normalize(),nh.crossVectors(x,ta)),nh.normalize(),fv.crossVectors(ta,nh),T[0]=nh.x,T[4]=fv.x,T[8]=ta.x,T[1]=nh.y,T[5]=fv.y,T[9]=ta.y,T[2]=nh.z,T[6]=fv.z,T[10]=ta.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const x=t.elements,T=i.elements,E=this.elements,s=x[0],y=x[4],e=x[8],r=x[12],p=x[1],h=x[5],a=x[9],l=x[13],n=x[2],u=x[6],f=x[10],o=x[14],c=x[3],d=x[7],v=x[11],m=x[15],S=T[0],M=T[4],w=T[8],C=T[12],A=T[1],P=T[5],b=T[9],O=T[13],I=T[2],D=T[6],B=T[10],G=T[14],z=T[3],X=T[7],j=T[11],Q=T[15];return E[0]=s*S+y*A+e*I+r*z,E[4]=s*M+y*P+e*D+r*X,E[8]=s*w+y*b+e*B+r*j,E[12]=s*C+y*O+e*G+r*Q,E[1]=p*S+h*A+a*I+l*z,E[5]=p*M+h*P+a*D+l*X,E[9]=p*w+h*b+a*B+l*j,E[13]=p*C+h*O+a*G+l*Q,E[2]=n*S+u*A+f*I+o*z,E[6]=n*M+u*P+f*D+o*X,E[10]=n*w+u*b+f*B+o*j,E[14]=n*C+u*O+f*G+o*Q,E[3]=c*S+d*A+v*I+m*z,E[7]=c*M+d*P+v*D+m*X,E[11]=c*w+d*b+v*B+m*j,E[15]=c*C+d*O+v*G+m*Q,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],x=t[4],T=t[8],E=t[12],s=t[1],y=t[5],e=t[9],r=t[13],p=t[2],h=t[6],a=t[10],l=t[14],n=t[3],u=t[7],f=t[11],o=t[15];return n*(+E*e*h-T*r*h-E*y*a+x*r*a+T*y*l-x*e*l)+u*(+i*e*l-i*r*a+E*s*a-T*s*l+T*r*p-E*e*p)+f*(+i*r*h-i*y*l-E*s*h+x*s*l+E*y*p-x*r*p)+o*(-T*y*p-i*e*h+i*y*a+T*s*h-x*s*a+x*e*p)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,x){const T=this.elements;return t.isVector3?(T[12]=t.x,T[13]=t.y,T[14]=t.z):(T[12]=t,T[13]=i,T[14]=x),this}invert(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8],h=t[9],a=t[10],l=t[11],n=t[12],u=t[13],f=t[14],o=t[15],c=h*f*r-u*a*r+u*e*l-y*f*l-h*e*o+y*a*o,d=n*a*r-p*f*r-n*e*l+s*f*l+p*e*o-s*a*o,v=p*u*r-n*h*r+n*y*l-s*u*l-p*y*o+s*h*o,m=n*h*e-p*u*e-n*y*a+s*u*a+p*y*f-s*h*f,S=i*c+x*d+T*v+E*m;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/S;return t[0]=c*M,t[1]=(u*a*E-h*f*E-u*T*l+x*f*l+h*T*o-x*a*o)*M,t[2]=(y*f*E-u*e*E+u*T*r-x*f*r-y*T*o+x*e*o)*M,t[3]=(h*e*E-y*a*E-h*T*r+x*a*r+y*T*l-x*e*l)*M,t[4]=d*M,t[5]=(p*f*E-n*a*E+n*T*l-i*f*l-p*T*o+i*a*o)*M,t[6]=(n*e*E-s*f*E-n*T*r+i*f*r+s*T*o-i*e*o)*M,t[7]=(s*a*E-p*e*E+p*T*r-i*a*r-s*T*l+i*e*l)*M,t[8]=v*M,t[9]=(n*h*E-p*u*E-n*x*l+i*u*l+p*x*o-i*h*o)*M,t[10]=(s*u*E-n*y*E+n*x*r-i*u*r-s*x*o+i*y*o)*M,t[11]=(p*y*E-s*h*E-p*x*r+i*h*r+s*x*l-i*y*l)*M,t[12]=m*M,t[13]=(p*u*T-n*h*T+n*x*a-i*u*a-p*x*f+i*h*f)*M,t[14]=(n*y*T-s*u*T-n*x*e+i*u*e+s*x*f-i*y*f)*M,t[15]=(s*h*T-p*y*T+p*x*e-i*h*e-s*x*a+i*y*a)*M,this}scale(t){const i=this.elements,x=t.x,T=t.y,E=t.z;return i[0]*=x,i[4]*=T,i[8]*=E,i[1]*=x,i[5]*=T,i[9]*=E,i[2]*=x,i[6]*=T,i[10]*=E,i[3]*=x,i[7]*=T,i[11]*=E,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],x=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],T=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,x,T))}makeTranslation(t,i,x){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,x,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),x=Math.sin(t);return this.set(1,0,0,0,0,i,-x,0,0,x,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,0,x,0,0,1,0,0,-x,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,-x,0,0,x,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const x=Math.cos(i),T=Math.sin(i),E=1-x,s=t.x,y=t.y,e=t.z,r=E*s,p=E*y;return this.set(r*s+x,r*y-T*e,r*e+T*y,0,r*y+T*e,p*y+x,p*e-T*s,0,r*e-T*y,p*e+T*s,E*e*e+x,0,0,0,0,1),this}makeScale(t,i,x){return this.set(t,0,0,0,0,i,0,0,0,0,x,0,0,0,0,1),this}makeShear(t,i,x,T,E,s){return this.set(1,x,E,0,t,1,s,0,i,T,1,0,0,0,0,1),this}compose(t,i,x){const T=this.elements,E=i._x,s=i._y,y=i._z,e=i._w,r=E+E,p=s+s,h=y+y,a=E*r,l=E*p,n=E*h,u=s*p,f=s*h,o=y*h,c=e*r,d=e*p,v=e*h,m=x.x,S=x.y,M=x.z;return T[0]=(1-(u+o))*m,T[1]=(l+v)*m,T[2]=(n-d)*m,T[3]=0,T[4]=(l-v)*S,T[5]=(1-(a+o))*S,T[6]=(f+c)*S,T[7]=0,T[8]=(n+d)*M,T[9]=(f-c)*M,T[10]=(1-(a+u))*M,T[11]=0,T[12]=t.x,T[13]=t.y,T[14]=t.z,T[15]=1,this}decompose(t,i,x){const T=this.elements;let E=vf.set(T[0],T[1],T[2]).length();const s=vf.set(T[4],T[5],T[6]).length(),y=vf.set(T[8],T[9],T[10]).length();this.determinant()<0&&(E=-E),t.x=T[12],t.y=T[13],t.z=T[14],Qa.copy(this);const r=1/E,p=1/s,h=1/y;return Qa.elements[0]*=r,Qa.elements[1]*=r,Qa.elements[2]*=r,Qa.elements[4]*=p,Qa.elements[5]*=p,Qa.elements[6]*=p,Qa.elements[8]*=h,Qa.elements[9]*=h,Qa.elements[10]*=h,i.setFromRotationMatrix(Qa),x.x=E,x.y=s,x.z=y,this}makePerspective(t,i,x,T,E,s,y=Uo){const e=this.elements,r=2*E/(i-t),p=2*E/(x-T),h=(i+t)/(i-t),a=(x+T)/(x-T);let l,n;if(y===Uo)l=-(s+E)/(s-E),n=-2*s*E/(s-E);else if(y===Nd)l=-s/(s-E),n=-s*E/(s-E);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+y);return e[0]=r,e[4]=0,e[8]=h,e[12]=0,e[1]=0,e[5]=p,e[9]=a,e[13]=0,e[2]=0,e[6]=0,e[10]=l,e[14]=n,e[3]=0,e[7]=0,e[11]=-1,e[15]=0,this}makeOrthographic(t,i,x,T,E,s,y=Uo){const e=this.elements,r=1/(i-t),p=1/(x-T),h=1/(s-E),a=(i+t)*r,l=(x+T)*p;let n,u;if(y===Uo)n=(s+E)*h,u=-2*h;else if(y===Nd)n=E*h,u=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+y);return e[0]=2*r,e[4]=0,e[8]=0,e[12]=-a,e[1]=0,e[5]=2*p,e[9]=0,e[13]=-l,e[2]=0,e[6]=0,e[10]=u,e[14]=-n,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this}equals(t){const i=this.elements,x=t.elements;for(let T=0;T<16;T++)if(i[T]!==x[T])return!1;return!0}fromArray(t,i=0){for(let x=0;x<16;x++)this.elements[x]=t[x+i];return this}toArray(t=[],i=0){const x=this.elements;return t[i]=x[0],t[i+1]=x[1],t[i+2]=x[2],t[i+3]=x[3],t[i+4]=x[4],t[i+5]=x[5],t[i+6]=x[6],t[i+7]=x[7],t[i+8]=x[8],t[i+9]=x[9],t[i+10]=x[10],t[i+11]=x[11],t[i+12]=x[12],t[i+13]=x[13],t[i+14]=x[14],t[i+15]=x[15],t}}const vf=new Ct,Qa=new di,eN=new Ct(0,0,0),iN=new Ct(1,1,1),nh=new Ct,fv=new Ct,ta=new Ct,IT=new di,NT=new Is;class to{constructor(t=0,i=0,x=0,T=to.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=x,this._order=T}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,x,T=this._order){return this._x=t,this._y=i,this._z=x,this._order=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,x=!0){const T=t.elements,E=T[0],s=T[4],y=T[8],e=T[1],r=T[5],p=T[9],h=T[2],a=T[6],l=T[10];switch(i){case"XYZ":this._y=Math.asin(Zn(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(-p,l),this._z=Math.atan2(-s,E)):(this._x=Math.atan2(a,r),this._z=0);break;case"YXZ":this._x=Math.asin(-Zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(y,l),this._z=Math.atan2(e,r)):(this._y=Math.atan2(-h,E),this._z=0);break;case"ZXY":this._x=Math.asin(Zn(a,-1,1)),Math.abs(a)<.9999999?(this._y=Math.atan2(-h,l),this._z=Math.atan2(-s,r)):(this._y=0,this._z=Math.atan2(e,E));break;case"ZYX":this._y=Math.asin(-Zn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(a,l),this._z=Math.atan2(e,E)):(this._x=0,this._z=Math.atan2(-s,r));break;case"YZX":this._z=Math.asin(Zn(e,-1,1)),Math.abs(e)<.9999999?(this._x=Math.atan2(-p,r),this._y=Math.atan2(-h,E)):(this._x=0,this._y=Math.atan2(y,l));break;case"XZY":this._z=Math.asin(-Zn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(a,r),this._y=Math.atan2(y,E)):(this._x=Math.atan2(-p,l),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,x===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,x){return IT.makeRotationFromQuaternion(t),this.setFromRotationMatrix(IT,i,x)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return NT.setFromEuler(this),this.setFromQuaternion(NT,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}to.DEFAULT_ORDER="XYZ";class Mu{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let i=0;i1){for(let x=0;x0&&(T.userData=this.userData),T.layers=this.layers.mask,T.matrix=this.matrix.toArray(),T.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(T.matrixAutoUpdate=!1),this.isInstancedMesh&&(T.type="InstancedMesh",T.count=this.count,T.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(T.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(T.type="BatchedMesh",T.perObjectFrustumCulled=this.perObjectFrustumCulled,T.sortObjects=this.sortObjects,T.drawRanges=this._drawRanges,T.reservedRanges=this._reservedRanges,T.visibility=this._visibility,T.active=this._active,T.bounds=this._bounds.map(y=>({boxInitialized:y.boxInitialized,boxMin:y.box.min.toArray(),boxMax:y.box.max.toArray(),sphereInitialized:y.sphereInitialized,sphereRadius:y.sphere.radius,sphereCenter:y.sphere.center.toArray()})),T.maxGeometryCount=this._maxGeometryCount,T.maxVertexCount=this._maxVertexCount,T.maxIndexCount=this._maxIndexCount,T.geometryInitialized=this._geometryInitialized,T.geometryCount=this._geometryCount,T.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(T.boundingSphere={center:T.boundingSphere.center.toArray(),radius:T.boundingSphere.radius}),this.boundingBox!==null&&(T.boundingBox={min:T.boundingBox.min.toArray(),max:T.boundingBox.max.toArray()}));function E(y,e){return y[e.uuid]===void 0&&(y[e.uuid]=e.toJSON(t)),e.uuid}if(this.isScene)this.background&&(this.background.isColor?T.background=this.background.toJSON():this.background.isTexture&&(T.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(T.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){T.geometry=E(t.geometries,this.geometry);const y=this.geometry.parameters;if(y!==void 0&&y.shapes!==void 0){const e=y.shapes;if(Array.isArray(e))for(let r=0,p=e.length;r0){T.children=[];for(let y=0;y0){T.animations=[];for(let y=0;y0&&(x.geometries=y),e.length>0&&(x.materials=e),r.length>0&&(x.textures=r),p.length>0&&(x.images=p),h.length>0&&(x.shapes=h),a.length>0&&(x.skeletons=a),l.length>0&&(x.animations=l),n.length>0&&(x.nodes=n)}return x.object=T,x;function s(y){const e=[];for(const r in y){const p=y[r];delete p.metadata,e.push(p)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let x=0;x0?T.multiplyScalar(1/Math.sqrt(E)):T.set(0,0,0)}static getBarycoord(t,i,x,T,E){_a.subVectors(T,i),pl.subVectors(x,i),D0.subVectors(t,i);const s=_a.dot(_a),y=_a.dot(pl),e=_a.dot(D0),r=pl.dot(pl),p=pl.dot(D0),h=s*r-y*y;if(h===0)return E.set(0,0,0),null;const a=1/h,l=(r*e-y*p)*a,n=(s*p-y*e)*a;return E.set(1-l-n,n,l)}static containsPoint(t,i,x,T){return this.getBarycoord(t,i,x,T,vl)===null?!1:vl.x>=0&&vl.y>=0&&vl.x+vl.y<=1}static getInterpolation(t,i,x,T,E,s,y,e){return this.getBarycoord(t,i,x,T,vl)===null?(e.x=0,e.y=0,"z"in e&&(e.z=0),"w"in e&&(e.w=0),null):(e.setScalar(0),e.addScaledVector(E,vl.x),e.addScaledVector(s,vl.y),e.addScaledVector(y,vl.z),e)}static isFrontFacing(t,i,x,T){return _a.subVectors(x,i),pl.subVectors(t,i),_a.cross(pl).dot(T)<0}set(t,i,x){return this.a.copy(t),this.b.copy(i),this.c.copy(x),this}setFromPointsAndIndices(t,i,x,T){return this.a.copy(t[i]),this.b.copy(t[x]),this.c.copy(t[T]),this}setFromAttributeAndIndices(t,i,x,T){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,x),this.c.fromBufferAttribute(t,T),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return _a.subVectors(this.c,this.b),pl.subVectors(this.a,this.b),_a.cross(pl).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return na.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return na.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,x,T,E){return na.getInterpolation(t,this.a,this.b,this.c,i,x,T,E)}containsPoint(t){return na.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return na.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const x=this.a,T=this.b,E=this.c;let s,y;gf.subVectors(T,x),yf.subVectors(E,x),I0.subVectors(t,x);const e=gf.dot(I0),r=yf.dot(I0);if(e<=0&&r<=0)return i.copy(x);N0.subVectors(t,T);const p=gf.dot(N0),h=yf.dot(N0);if(p>=0&&h<=p)return i.copy(T);const a=e*h-p*r;if(a<=0&&e>=0&&p<=0)return s=e/(e-p),i.copy(x).addScaledVector(gf,s);B0.subVectors(t,E);const l=gf.dot(B0),n=yf.dot(B0);if(n>=0&&l<=n)return i.copy(E);const u=l*r-e*n;if(u<=0&&r>=0&&n<=0)return y=r/(r-n),i.copy(x).addScaledVector(yf,y);const f=p*n-l*h;if(f<=0&&h-p>=0&&l-n>=0)return VT.subVectors(E,T),y=(h-p)/(h-p+(l-n)),i.copy(T).addScaledVector(VT,y);const o=1/(f+u+a);return s=u*o,y=a*o,i.copy(x).addScaledVector(gf,s).addScaledVector(yf,y)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const y2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rh={h:0,s:0,l:0},dv={h:0,s:0,l:0};function U0(g,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?g+(t-g)*6*i:i<1/2?t:i<2/3?g+(t-g)*6*(2/3-i):g}class ze{constructor(t,i,x){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,x)}set(t,i,x){if(i===void 0&&x===void 0){const T=t;T&&T.isColor?this.copy(T):typeof T=="number"?this.setHex(T):typeof T=="string"&&this.setStyle(T)}else this.setRGB(t,i,x);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=mr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,sn.toWorkingColorSpace(this,i),this}setRGB(t,i,x,T=sn.workingColorSpace){return this.r=t,this.g=i,this.b=x,sn.toWorkingColorSpace(this,T),this}setHSL(t,i,x,T=sn.workingColorSpace){if(t=x1(t,1),i=Zn(i,0,1),x=Zn(x,0,1),i===0)this.r=this.g=this.b=x;else{const E=x<=.5?x*(1+i):x+i-x*i,s=2*x-E;this.r=U0(s,E,t+1/3),this.g=U0(s,E,t),this.b=U0(s,E,t-1/3)}return sn.toWorkingColorSpace(this,T),this}setStyle(t,i=mr){function x(E){E!==void 0&&parseFloat(E)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let T;if(T=/^(\w+)\(([^\)]*)\)/.exec(t)){let E;const s=T[1],y=T[2];switch(s){case"rgb":case"rgba":if(E=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(255,parseInt(E[1],10))/255,Math.min(255,parseInt(E[2],10))/255,Math.min(255,parseInt(E[3],10))/255,i);if(E=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(100,parseInt(E[1],10))/100,Math.min(100,parseInt(E[2],10))/100,Math.min(100,parseInt(E[3],10))/100,i);break;case"hsl":case"hsla":if(E=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setHSL(parseFloat(E[1])/360,parseFloat(E[2])/100,parseFloat(E[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(T=/^\#([A-Fa-f\d]+)$/.exec(t)){const E=T[1],s=E.length;if(s===3)return this.setRGB(parseInt(E.charAt(0),16)/15,parseInt(E.charAt(1),16)/15,parseInt(E.charAt(2),16)/15,i);if(s===6)return this.setHex(parseInt(E,16),i);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=mr){const x=y2[t.toLowerCase()];return x!==void 0?this.setHex(x,i):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Kf(t.r),this.g=Kf(t.g),this.b=Kf(t.b),this}copyLinearToSRGB(t){return this.r=w0(t.r),this.g=w0(t.g),this.b=w0(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=mr){return sn.fromWorkingColorSpace(Kr.copy(this),t),Math.round(Zn(Kr.r*255,0,255))*65536+Math.round(Zn(Kr.g*255,0,255))*256+Math.round(Zn(Kr.b*255,0,255))}getHexString(t=mr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=sn.workingColorSpace){sn.fromWorkingColorSpace(Kr.copy(this),i);const x=Kr.r,T=Kr.g,E=Kr.b,s=Math.max(x,T,E),y=Math.min(x,T,E);let e,r;const p=(y+s)/2;if(y===s)e=0,r=0;else{const h=s-y;switch(r=p<=.5?h/(s+y):h/(2-s-y),s){case x:e=(T-E)/h+(T0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const x=t[i];if(x===void 0){console.warn(`THREE.Material: parameter '${i}' has value of undefined.`);continue}const T=this[i];if(T===void 0){console.warn(`THREE.Material: '${i}' is not a property of THREE.${this.type}.`);continue}T&&T.isColor?T.set(x):T&&T.isVector3&&x&&x.isVector3?T.copy(x):this[i]=x}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const x={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};x.uuid=this.uuid,x.type=this.type,this.name!==""&&(x.name=this.name),this.color&&this.color.isColor&&(x.color=this.color.getHex()),this.roughness!==void 0&&(x.roughness=this.roughness),this.metalness!==void 0&&(x.metalness=this.metalness),this.sheen!==void 0&&(x.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(x.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(x.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(x.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(x.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(x.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(x.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(x.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(x.shininess=this.shininess),this.clearcoat!==void 0&&(x.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(x.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(x.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(x.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(x.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,x.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(x.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(x.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(x.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(x.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(x.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(x.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(x.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(x.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(x.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(x.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(x.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(x.lightMap=this.lightMap.toJSON(t).uuid,x.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(x.aoMap=this.aoMap.toJSON(t).uuid,x.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(x.bumpMap=this.bumpMap.toJSON(t).uuid,x.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(x.normalMap=this.normalMap.toJSON(t).uuid,x.normalMapType=this.normalMapType,x.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(x.displacementMap=this.displacementMap.toJSON(t).uuid,x.displacementScale=this.displacementScale,x.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(x.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(x.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(x.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(x.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(x.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(x.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(x.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(x.combine=this.combine)),this.envMapIntensity!==void 0&&(x.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(x.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(x.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(x.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(x.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(x.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(x.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(x.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(x.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(x.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(x.size=this.size),this.shadowSide!==null&&(x.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(x.sizeAttenuation=this.sizeAttenuation),this.blending!==Su&&(x.blending=this.blending),this.side!==Al&&(x.side=this.side),this.vertexColors===!0&&(x.vertexColors=!0),this.opacity<1&&(x.opacity=this.opacity),this.transparent===!0&&(x.transparent=!0),this.blendSrc!==Em&&(x.blendSrc=this.blendSrc),this.blendDst!==Mm&&(x.blendDst=this.blendDst),this.blendEquation!==hh&&(x.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(x.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(x.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(x.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(x.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(x.blendAlpha=this.blendAlpha),this.depthFunc!==Md&&(x.depthFunc=this.depthFunc),this.depthTest===!1&&(x.depthTest=this.depthTest),this.depthWrite===!1&&(x.depthWrite=this.depthWrite),this.colorWrite===!1&&(x.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(x.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yx&&(x.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(x.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(x.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fu&&(x.stencilFail=this.stencilFail),this.stencilZFail!==fu&&(x.stencilZFail=this.stencilZFail),this.stencilZPass!==fu&&(x.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(x.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(x.rotation=this.rotation),this.polygonOffset===!0&&(x.polygonOffset=!0),this.polygonOffsetFactor!==0&&(x.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(x.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(x.linewidth=this.linewidth),this.dashSize!==void 0&&(x.dashSize=this.dashSize),this.gapSize!==void 0&&(x.gapSize=this.gapSize),this.scale!==void 0&&(x.scale=this.scale),this.dithering===!0&&(x.dithering=!0),this.alphaTest>0&&(x.alphaTest=this.alphaTest),this.alphaHash===!0&&(x.alphaHash=!0),this.alphaToCoverage===!0&&(x.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(x.premultipliedAlpha=!0),this.forceSinglePass===!0&&(x.forceSinglePass=!0),this.wireframe===!0&&(x.wireframe=!0),this.wireframeLinewidth>1&&(x.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(x.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(x.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(x.flatShading=!0),this.visible===!1&&(x.visible=!1),this.toneMapped===!1&&(x.toneMapped=!1),this.fog===!1&&(x.fog=!1),Object.keys(this.userData).length>0&&(x.userData=this.userData);function T(E){const s=[];for(const y in E){const e=E[y];delete e.metadata,s.push(e)}return s}if(i){const E=T(t.textures),s=T(t.images);E.length>0&&(x.textures=E),s.length>0&&(x.images=s)}return x}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let x=null;if(i!==null){const T=i.length;x=new Array(T);for(let E=0;E!==T;++E)x[E]=i[E].clone()}return this.clippingPlanes=x,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Eh extends Wr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const xl=hN();function hN(){const g=new ArrayBuffer(4),t=new Float32Array(g),i=new Uint32Array(g),x=new Uint32Array(512),T=new Uint32Array(512);for(let e=0;e<256;++e){const r=e-127;r<-27?(x[e]=0,x[e|256]=32768,T[e]=24,T[e|256]=24):r<-14?(x[e]=1024>>-r-14,x[e|256]=1024>>-r-14|32768,T[e]=-r-1,T[e|256]=-r-1):r<=15?(x[e]=r+15<<10,x[e|256]=r+15<<10|32768,T[e]=13,T[e|256]=13):r<128?(x[e]=31744,x[e|256]=64512,T[e]=24,T[e|256]=24):(x[e]=31744,x[e|256]=64512,T[e]=13,T[e|256]=13)}const E=new Uint32Array(2048),s=new Uint32Array(64),y=new Uint32Array(64);for(let e=1;e<1024;++e){let r=e<<13,p=0;for(;!(r&8388608);)r<<=1,p-=8388608;r&=-8388609,p+=947912704,E[e]=r|p}for(let e=1024;e<2048;++e)E[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(y[e]=1024);return{floatView:t,uint32View:i,baseTable:x,shiftTable:T,mantissaTable:E,exponentTable:s,offsetTable:y}}function Ds(g){Math.abs(g)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),g=Zn(g,-65504,65504),xl.floatView[0]=g;const t=xl.uint32View[0],i=t>>23&511;return xl.baseTable[i]+((t&8388607)>>xl.shiftTable[i])}function od(g){const t=g>>10;return xl.uint32View[0]=xl.mantissaTable[xl.offsetTable[t]+(g&1023)]+xl.exponentTable[t],xl.floatView[0]}const uN={toHalfFloat:Ds,fromHalfFloat:od},fr=new Ct,pv=new ve;class on{constructor(t,i,x=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=x,this.usage=Id,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ma,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Eu("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,x){t*=this.itemSize,x*=i.itemSize;for(let T=0,E=this.itemSize;T0&&(t.userData=this.userData),this.parameters!==void 0){const e=this.parameters;for(const r in e)e[r]!==void 0&&(t[r]=e[r]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const x=this.attributes;for(const e in x){const r=x[e];t.data.attributes[e]=r.toJSON(t.data)}const T={};let E=!1;for(const e in this.morphAttributes){const r=this.morphAttributes[e],p=[];for(let h=0,a=r.length;h0&&(T[e]=p,E=!0)}E&&(t.data.morphAttributes=T,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const y=this.boundingSphere;return y!==null&&(t.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const x=t.index;x!==null&&this.setIndex(x.clone(i));const T=t.attributes;for(const r in T){const p=T[r];this.setAttribute(r,p.clone(i))}const E=t.morphAttributes;for(const r in E){const p=[],h=E[r];for(let a=0,l=h.length;a0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;E(t.far-t.near)**2))&&(HT.copy(E).invert(),tu.copy(t.ray).applyMatrix4(HT),!(x.boundingBox!==null&&tu.intersectsBox(x.boundingBox)===!1)&&this._computeIntersections(t,i,tu)))}_computeIntersections(t,i,x){let T;const E=this.geometry,s=this.material,y=E.index,e=E.attributes.position,r=E.attributes.uv,p=E.attributes.uv1,h=E.attributes.normal,a=E.groups,l=E.drawRange;if(y!==null)if(Array.isArray(s))for(let n=0,u=a.length;ni.far?null:{distance:r,point:Tv.clone(),object:g}}function Ev(g,t,i,x,T,E,s,y,e,r){g.getVertexPosition(y,Sf),g.getVertexPosition(e,Tf),g.getVertexPosition(r,Ef);const p=xN(g,t,i,x,Sf,Tf,Ef,Sv);if(p){T&&(gv.fromBufferAttribute(T,y),yv.fromBufferAttribute(T,e),xv.fromBufferAttribute(T,r),p.uv=na.getInterpolation(Sv,Sf,Tf,Ef,gv,yv,xv,new ve)),E&&(gv.fromBufferAttribute(E,y),yv.fromBufferAttribute(E,e),xv.fromBufferAttribute(E,r),p.uv1=na.getInterpolation(Sv,Sf,Tf,Ef,gv,yv,xv,new ve),p.uv2=p.uv1),s&&(XT.fromBufferAttribute(s,y),YT.fromBufferAttribute(s,e),kT.fromBufferAttribute(s,r),p.normal=na.getInterpolation(Sv,Sf,Tf,Ef,XT,YT,kT,new Ct),p.normal.dot(x.direction)>0&&p.normal.multiplyScalar(-1));const h={a:y,b:e,c:r,normal:new Ct,materialIndex:0};na.getNormal(Sf,Tf,Ef,h.normal),p.face=h}return p}class Nu extends Fi{constructor(t=1,i=1,x=1,T=1,E=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:x,widthSegments:T,heightSegments:E,depthSegments:s};const y=this;T=Math.floor(T),E=Math.floor(E),s=Math.floor(s);const e=[],r=[],p=[],h=[];let a=0,l=0;n("z","y","x",-1,-1,x,i,t,s,E,0),n("z","y","x",1,-1,x,i,-t,s,E,1),n("x","z","y",1,1,t,x,i,T,s,2),n("x","z","y",1,-1,t,x,-i,T,s,3),n("x","y","z",1,-1,t,i,x,T,E,4),n("x","y","z",-1,-1,t,i,-x,T,E,5),this.setIndex(e),this.setAttribute("position",new ke(r,3)),this.setAttribute("normal",new ke(p,3)),this.setAttribute("uv",new ke(h,2));function n(u,f,o,c,d,v,m,S,M,w,C){const A=v/M,P=m/w,b=v/2,O=m/2,I=S/2,D=M+1,B=w+1;let G=0,z=0;const X=new Ct;for(let j=0;j0?1:-1,p.push(X.x,X.y,X.z),h.push(tt/M),h.push(1-j/w),G+=1}}for(let j=0;j0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const x={};for(const T in this.extensions)this.extensions[T]===!0&&(x[T]=!0);return Object.keys(x).length>0&&(i.extensions=x),i}}class tp extends ki{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new di,this.projectionMatrix=new di,this.projectionMatrixInverse=new di,this.coordinateSystem=Uo}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const sh=new Ct,jT=new ve,KT=new ve;class Dr extends tp{constructor(t=50,i=1,x=.1,T=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=x,this.far=T,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=tc*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(Tu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return tc*2*Math.atan(Math.tan(Tu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,x){sh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(sh.x,sh.y).multiplyScalar(-t/sh.z),sh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),x.set(sh.x,sh.y).multiplyScalar(-t/sh.z)}getViewSize(t,i){return this.getViewBounds(t,jT,KT),i.subVectors(KT,jT)}setViewOffset(t,i,x,T,E,s){this.aspect=t/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(Tu*.5*this.fov)/this.zoom,x=2*i,T=this.aspect*x,E=-.5*T;const s=this.view;if(this.view!==null&&this.view.enabled){const e=s.fullWidth,r=s.fullHeight;E+=s.offsetX*T/e,i-=s.offsetY*x/r,T*=s.width/e,x*=s.height/r}const y=this.filmOffset;y!==0&&(E+=t*y/this.getFilmWidth()),this.projectionMatrix.makePerspective(E,E+T,i,i-x,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}const Mf=-90,Cf=1;class T2 extends ki{constructor(t,i,x){super(),this.type="CubeCamera",this.renderTarget=x,this.coordinateSystem=null,this.activeMipmapLevel=0;const T=new Dr(Mf,Cf,t,i);T.layers=this.layers,this.add(T);const E=new Dr(Mf,Cf,t,i);E.layers=this.layers,this.add(E);const s=new Dr(Mf,Cf,t,i);s.layers=this.layers,this.add(s);const y=new Dr(Mf,Cf,t,i);y.layers=this.layers,this.add(y);const e=new Dr(Mf,Cf,t,i);e.layers=this.layers,this.add(e);const r=new Dr(Mf,Cf,t,i);r.layers=this.layers,this.add(r)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[x,T,E,s,y,e]=i;for(const r of i)this.remove(r);if(t===Uo)x.up.set(0,1,0),x.lookAt(1,0,0),T.up.set(0,1,0),T.lookAt(-1,0,0),E.up.set(0,0,-1),E.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),y.up.set(0,1,0),y.lookAt(0,0,1),e.up.set(0,1,0),e.lookAt(0,0,-1);else if(t===Nd)x.up.set(0,-1,0),x.lookAt(-1,0,0),T.up.set(0,-1,0),T.lookAt(1,0,0),E.up.set(0,0,1),E.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),y.up.set(0,-1,0),y.lookAt(0,0,1),e.up.set(0,-1,0),e.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const r of i)this.add(r),r.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:x,activeMipmapLevel:T}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[E,s,y,e,r,p]=this.children,h=t.getRenderTarget(),a=t.getActiveCubeFace(),l=t.getActiveMipmapLevel(),n=t.xr.enabled;t.xr.enabled=!1;const u=x.texture.generateMipmaps;x.texture.generateMipmaps=!1,t.setRenderTarget(x,0,T),t.render(i,E),t.setRenderTarget(x,1,T),t.render(i,s),t.setRenderTarget(x,2,T),t.render(i,y),t.setRenderTarget(x,3,T),t.render(i,e),t.setRenderTarget(x,4,T),t.render(i,r),x.texture.generateMipmaps=u,t.setRenderTarget(x,5,T),t.render(i,p),t.setRenderTarget(h,a,l),t.xr.enabled=n,x.texture.needsPMREMUpdate=!0}}class ep extends zn{constructor(t,i,x,T,E,s,y,e,r,p){t=t!==void 0?t:[],i=i!==void 0?i:Pl,super(t,i,x,T,E,s,y,e,r,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class E2 extends ro{constructor(t=1,i={}){super(t,t,i),this.isWebGLCubeRenderTarget=!0;const x={width:t,height:t,depth:1},T=[x,x,x,x,x,x];i.encoding!==void 0&&(Eu("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===vh?mr:ia),this.texture=new ep(T,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Bn}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const x={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},T=new Nu(5,5,5),E=new so({name:"CubemapFromEquirect",uniforms:ec(x.uniforms),vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,side:gs,blending:wl});E.uniforms.tEquirect.value=i;const s=new dr(T,E),y=i.minFilter;return i.minFilter===Bo&&(i.minFilter=Bn),new T2(1,10,this).update(t,s),i.minFilter=y,s.geometry.dispose(),s.material.dispose(),this}clear(t,i,x,T){const E=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(this,s),t.clear(i,x,T);t.setRenderTarget(E)}}const V0=new Ct,MN=new Ct,CN=new Di;class lh{constructor(t=new Ct(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,x,T){return this.normal.set(t,i,x),this.constant=T,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,x){const T=V0.subVectors(x,i).cross(MN.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(T,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const x=t.delta(V0),T=this.normal.dot(x);if(T===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const E=-(t.start.dot(this.normal)+this.constant)/T;return E<0||E>1?null:i.copy(t.start).addScaledVector(x,E)}intersectsLine(t){const i=this.distanceToPoint(t.start),x=this.distanceToPoint(t.end);return i<0&&x>0||x<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const x=i||CN.getNormalMatrix(t),T=this.coplanarPoint(V0).applyMatrix4(t),E=this.normal.applyMatrix3(x).normalize();return this.constant=-T.dot(E),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const eu=new Qr,Mv=new Ct;class ip{constructor(t=new lh,i=new lh,x=new lh,T=new lh,E=new lh,s=new lh){this.planes=[t,i,x,T,E,s]}set(t,i,x,T,E,s){const y=this.planes;return y[0].copy(t),y[1].copy(i),y[2].copy(x),y[3].copy(T),y[4].copy(E),y[5].copy(s),this}copy(t){const i=this.planes;for(let x=0;x<6;x++)i[x].copy(t.planes[x]);return this}setFromProjectionMatrix(t,i=Uo){const x=this.planes,T=t.elements,E=T[0],s=T[1],y=T[2],e=T[3],r=T[4],p=T[5],h=T[6],a=T[7],l=T[8],n=T[9],u=T[10],f=T[11],o=T[12],c=T[13],d=T[14],v=T[15];if(x[0].setComponents(e-E,a-r,f-l,v-o).normalize(),x[1].setComponents(e+E,a+r,f+l,v+o).normalize(),x[2].setComponents(e+s,a+p,f+n,v+c).normalize(),x[3].setComponents(e-s,a-p,f-n,v-c).normalize(),x[4].setComponents(e-y,a-h,f-u,v-d).normalize(),i===Uo)x[5].setComponents(e+y,a+h,f+u,v+d).normalize();else if(i===Nd)x[5].setComponents(y,h,u,d).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),eu.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),eu.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(eu)}intersectsSprite(t){return eu.center.set(0,0,0),eu.radius=.7071067811865476,eu.applyMatrix4(t.matrixWorld),this.intersectsSphere(eu)}intersectsSphere(t){const i=this.planes,x=t.center,T=-t.radius;for(let E=0;E<6;E++)if(i[E].distanceToPoint(x)0?t.max.x:t.min.x,Mv.y=T.normal.y>0?t.max.y:t.min.y,Mv.z=T.normal.z>0?t.max.z:t.min.z,T.distanceToPoint(Mv)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let x=0;x<6;x++)if(i[x].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function M2(){let g=null,t=!1,i=null,x=null;function T(E,s){i(E,s),x=g.requestAnimationFrame(T)}return{start:function(){t!==!0&&i!==null&&(x=g.requestAnimationFrame(T),t=!0)},stop:function(){g.cancelAnimationFrame(x),t=!1},setAnimationLoop:function(E){i=E},setContext:function(E){g=E}}}function wN(g,t){const i=t.isWebGL2,x=new WeakMap;function T(r,p){const h=r.array,a=r.usage,l=h.byteLength,n=g.createBuffer();g.bindBuffer(p,n),g.bufferData(p,h,a),r.onUploadCallback();let u;if(h instanceof Float32Array)u=g.FLOAT;else if(h instanceof Uint16Array)if(r.isFloat16BufferAttribute)if(i)u=g.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else u=g.UNSIGNED_SHORT;else if(h instanceof Int16Array)u=g.SHORT;else if(h instanceof Uint32Array)u=g.UNSIGNED_INT;else if(h instanceof Int32Array)u=g.INT;else if(h instanceof Int8Array)u=g.BYTE;else if(h instanceof Uint8Array)u=g.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)u=g.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:n,type:u,bytesPerElement:h.BYTES_PER_ELEMENT,version:r.version,size:l}}function E(r,p,h){const a=p.array,l=p._updateRange,n=p.updateRanges;if(g.bindBuffer(h,r),l.count===-1&&n.length===0&&g.bufferSubData(h,0,a),n.length!==0){for(let u=0,f=n.length;u 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,WN=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,XN=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,YN=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,kN=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,jN=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,KN=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,ZN=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,JN=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,$N=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,QN=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,_N=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,qN=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,t9=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,e9=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,i9="gl_FragColor = linearToOutputTexel( gl_FragColor );",n9=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,r9=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,s9=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,a9=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,o9=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,l9=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,h9=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,u9=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,f9=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,c9=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,d9=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,p9=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,v9=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,m9=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,g9=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,y9=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,x9=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,S9=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,T9=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,E9=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,M9=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,C9=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,w9=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,A9=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,P9=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,R9=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,b9=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,L9=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,F9=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,O9=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,D9=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,I9=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,N9=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,B9=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,U9=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,z9=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,G9=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,V9=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,H9=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,W9=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,X9=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Y9=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,k9=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,j9=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,K9=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Z9=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,J9=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,$9=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Q9=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,_9=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,q9=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,tB=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,eB=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,iB=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,nB=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,rB=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,sB=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,aB=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,oB=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,lB=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,hB=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,uB=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,fB=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,cB=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,dB=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,pB=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,vB=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,mB=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,gB=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,yB=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,xB=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,SB=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,TB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,EB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,MB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,CB=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const wB=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,AB=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,PB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,RB=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,bB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,LB=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,FB=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,OB=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,DB=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,IB=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,NB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,BB=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,UB=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,zB=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,GB=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,VB=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,HB=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,WB=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,XB=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,YB=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,kB=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,jB=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,KB=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,ZB=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,JB=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,$B=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,QB=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,_B=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,qB=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,t8=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,e8=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,i8=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,n8=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,r8=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Li={alphahash_fragment:AN,alphahash_pars_fragment:PN,alphamap_fragment:RN,alphamap_pars_fragment:bN,alphatest_fragment:LN,alphatest_pars_fragment:FN,aomap_fragment:ON,aomap_pars_fragment:DN,batching_pars_vertex:IN,batching_vertex:NN,begin_vertex:BN,beginnormal_vertex:UN,bsdfs:zN,iridescence_fragment:GN,bumpmap_pars_fragment:VN,clipping_planes_fragment:HN,clipping_planes_pars_fragment:WN,clipping_planes_pars_vertex:XN,clipping_planes_vertex:YN,color_fragment:kN,color_pars_fragment:jN,color_pars_vertex:KN,color_vertex:ZN,common:JN,cube_uv_reflection_fragment:$N,defaultnormal_vertex:QN,displacementmap_pars_vertex:_N,displacementmap_vertex:qN,emissivemap_fragment:t9,emissivemap_pars_fragment:e9,colorspace_fragment:i9,colorspace_pars_fragment:n9,envmap_fragment:r9,envmap_common_pars_fragment:s9,envmap_pars_fragment:a9,envmap_pars_vertex:o9,envmap_physical_pars_fragment:x9,envmap_vertex:l9,fog_vertex:h9,fog_pars_vertex:u9,fog_fragment:f9,fog_pars_fragment:c9,gradientmap_pars_fragment:d9,lightmap_fragment:p9,lightmap_pars_fragment:v9,lights_lambert_fragment:m9,lights_lambert_pars_fragment:g9,lights_pars_begin:y9,lights_toon_fragment:S9,lights_toon_pars_fragment:T9,lights_phong_fragment:E9,lights_phong_pars_fragment:M9,lights_physical_fragment:C9,lights_physical_pars_fragment:w9,lights_fragment_begin:A9,lights_fragment_maps:P9,lights_fragment_end:R9,logdepthbuf_fragment:b9,logdepthbuf_pars_fragment:L9,logdepthbuf_pars_vertex:F9,logdepthbuf_vertex:O9,map_fragment:D9,map_pars_fragment:I9,map_particle_fragment:N9,map_particle_pars_fragment:B9,metalnessmap_fragment:U9,metalnessmap_pars_fragment:z9,morphcolor_vertex:G9,morphnormal_vertex:V9,morphtarget_pars_vertex:H9,morphtarget_vertex:W9,normal_fragment_begin:X9,normal_fragment_maps:Y9,normal_pars_fragment:k9,normal_pars_vertex:j9,normal_vertex:K9,normalmap_pars_fragment:Z9,clearcoat_normal_fragment_begin:J9,clearcoat_normal_fragment_maps:$9,clearcoat_pars_fragment:Q9,iridescence_pars_fragment:_9,opaque_fragment:q9,packing:tB,premultiplied_alpha_fragment:eB,project_vertex:iB,dithering_fragment:nB,dithering_pars_fragment:rB,roughnessmap_fragment:sB,roughnessmap_pars_fragment:aB,shadowmap_pars_fragment:oB,shadowmap_pars_vertex:lB,shadowmap_vertex:hB,shadowmask_pars_fragment:uB,skinbase_vertex:fB,skinning_pars_vertex:cB,skinning_vertex:dB,skinnormal_vertex:pB,specularmap_fragment:vB,specularmap_pars_fragment:mB,tonemapping_fragment:gB,tonemapping_pars_fragment:yB,transmission_fragment:xB,transmission_pars_fragment:SB,uv_pars_fragment:TB,uv_pars_vertex:EB,uv_vertex:MB,worldpos_vertex:CB,background_vert:wB,background_frag:AB,backgroundCube_vert:PB,backgroundCube_frag:RB,cube_vert:bB,cube_frag:LB,depth_vert:FB,depth_frag:OB,distanceRGBA_vert:DB,distanceRGBA_frag:IB,equirect_vert:NB,equirect_frag:BB,linedashed_vert:UB,linedashed_frag:zB,meshbasic_vert:GB,meshbasic_frag:VB,meshlambert_vert:HB,meshlambert_frag:WB,meshmatcap_vert:XB,meshmatcap_frag:YB,meshnormal_vert:kB,meshnormal_frag:jB,meshphong_vert:KB,meshphong_frag:ZB,meshphysical_vert:JB,meshphysical_frag:$B,meshtoon_vert:QB,meshtoon_frag:_B,points_vert:qB,points_frag:t8,shadow_vert:e8,shadow_frag:i8,sprite_vert:n8,sprite_frag:r8},Fe={common:{diffuse:{value:new ze(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Di},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Di}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Di}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Di}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Di},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Di},normalScale:{value:new ve(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Di},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Di}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Di}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Di}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ze(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0},uvTransform:{value:new Di}},sprite:{diffuse:{value:new ze(16777215)},opacity:{value:1},center:{value:new ve(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Di},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0}}},eo={basic:{uniforms:ps([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Li.meshbasic_vert,fragmentShader:Li.meshbasic_frag},lambert:{uniforms:ps([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)}}]),vertexShader:Li.meshlambert_vert,fragmentShader:Li.meshlambert_frag},phong:{uniforms:ps([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)},specular:{value:new ze(1118481)},shininess:{value:30}}]),vertexShader:Li.meshphong_vert,fragmentShader:Li.meshphong_frag},standard:{uniforms:ps([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag},toon:{uniforms:ps([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)}}]),vertexShader:Li.meshtoon_vert,fragmentShader:Li.meshtoon_frag},matcap:{uniforms:ps([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Li.meshmatcap_vert,fragmentShader:Li.meshmatcap_frag},points:{uniforms:ps([Fe.points,Fe.fog]),vertexShader:Li.points_vert,fragmentShader:Li.points_frag},dashed:{uniforms:ps([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Li.linedashed_vert,fragmentShader:Li.linedashed_frag},depth:{uniforms:ps([Fe.common,Fe.displacementmap]),vertexShader:Li.depth_vert,fragmentShader:Li.depth_frag},normal:{uniforms:ps([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Li.meshnormal_vert,fragmentShader:Li.meshnormal_frag},sprite:{uniforms:ps([Fe.sprite,Fe.fog]),vertexShader:Li.sprite_vert,fragmentShader:Li.sprite_frag},background:{uniforms:{uvTransform:{value:new Di},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Li.background_vert,fragmentShader:Li.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Li.backgroundCube_vert,fragmentShader:Li.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Li.cube_vert,fragmentShader:Li.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Li.equirect_vert,fragmentShader:Li.equirect_frag},distanceRGBA:{uniforms:ps([Fe.common,Fe.displacementmap,{referencePosition:{value:new Ct},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Li.distanceRGBA_vert,fragmentShader:Li.distanceRGBA_frag},shadow:{uniforms:ps([Fe.lights,Fe.fog,{color:{value:new ze(0)},opacity:{value:1}}]),vertexShader:Li.shadow_vert,fragmentShader:Li.shadow_frag}};eo.physical={uniforms:ps([eo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Di},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Di},clearcoatNormalScale:{value:new ve(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Di},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Di},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Di},sheen:{value:0},sheenColor:{value:new ze(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Di},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Di},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Di},transmissionSamplerSize:{value:new ve},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Di},attenuationDistance:{value:0},attenuationColor:{value:new ze(0)},specularColor:{value:new ze(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Di},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Di},anisotropyVector:{value:new ve},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Di}}]),vertexShader:Li.meshphysical_vert,fragmentShader:Li.meshphysical_frag};const Cv={r:0,b:0,g:0};function s8(g,t,i,x,T,E,s){const y=new ze(0);let e=E===!0?0:1,r,p,h=null,a=0,l=null;function n(f,o){let c=!1,d=o.isScene===!0?o.background:null;d&&d.isTexture&&(d=(o.backgroundBlurriness>0?i:t).get(d)),d===null?u(y,e):d&&d.isColor&&(u(d,1),c=!0);const v=g.xr.getEnvironmentBlendMode();v==="additive"?x.buffers.color.setClear(0,0,0,1,s):v==="alpha-blend"&&x.buffers.color.setClear(0,0,0,0,s),(g.autoClear||c)&&g.clear(g.autoClearColor,g.autoClearDepth,g.autoClearStencil),d&&(d.isCubeTexture||d.mapping===ac)?(p===void 0&&(p=new dr(new Nu(1,1,1),new so({name:"BackgroundCubeMaterial",uniforms:ec(eo.backgroundCube.uniforms),vertexShader:eo.backgroundCube.vertexShader,fragmentShader:eo.backgroundCube.fragmentShader,side:gs,depthTest:!1,depthWrite:!1,fog:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(m,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),T.update(p)),p.material.uniforms.envMap.value=d,p.material.uniforms.flipEnvMap.value=d.isCubeTexture&&d.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=o.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,p.material.toneMapped=sn.getTransfer(d.colorSpace)!==mn,(h!==d||a!==d.version||l!==g.toneMapping)&&(p.material.needsUpdate=!0,h=d,a=d.version,l=g.toneMapping),p.layers.enableAll(),f.unshift(p,p.geometry,p.material,0,0,null)):d&&d.isTexture&&(r===void 0&&(r=new dr(new lc(2,2),new so({name:"BackgroundMaterial",uniforms:ec(eo.background.uniforms),vertexShader:eo.background.vertexShader,fragmentShader:eo.background.fragmentShader,side:Al,depthTest:!1,depthWrite:!1,fog:!1})),r.geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),T.update(r)),r.material.uniforms.t2D.value=d,r.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,r.material.toneMapped=sn.getTransfer(d.colorSpace)!==mn,d.matrixAutoUpdate===!0&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),(h!==d||a!==d.version||l!==g.toneMapping)&&(r.material.needsUpdate=!0,h=d,a=d.version,l=g.toneMapping),r.layers.enableAll(),f.unshift(r,r.geometry,r.material,0,0,null))}function u(f,o){f.getRGB(Cv,x2(g)),x.buffers.color.setClear(Cv.r,Cv.g,Cv.b,o,s)}return{getClearColor:function(){return y},setClearColor:function(f,o=1){y.set(f),e=o,u(y,e)},getClearAlpha:function(){return e},setClearAlpha:function(f){e=f,u(y,e)},render:n}}function a8(g,t,i,x){const T=g.getParameter(g.MAX_VERTEX_ATTRIBS),E=x.isWebGL2?null:t.get("OES_vertex_array_object"),s=x.isWebGL2||E!==null,y={},e=f(null);let r=e,p=!1;function h(I,D,B,G,z){let X=!1;if(s){const j=u(G,B,D);r!==j&&(r=j,l(r.object)),X=o(I,G,B,z),X&&c(I,G,B,z)}else{const j=D.wireframe===!0;(r.geometry!==G.id||r.program!==B.id||r.wireframe!==j)&&(r.geometry=G.id,r.program=B.id,r.wireframe=j,X=!0)}z!==null&&i.update(z,g.ELEMENT_ARRAY_BUFFER),(X||p)&&(p=!1,w(I,D,B,G),z!==null&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,i.get(z).buffer))}function a(){return x.isWebGL2?g.createVertexArray():E.createVertexArrayOES()}function l(I){return x.isWebGL2?g.bindVertexArray(I):E.bindVertexArrayOES(I)}function n(I){return x.isWebGL2?g.deleteVertexArray(I):E.deleteVertexArrayOES(I)}function u(I,D,B){const G=B.wireframe===!0;let z=y[I.id];z===void 0&&(z={},y[I.id]=z);let X=z[D.id];X===void 0&&(X={},z[D.id]=X);let j=X[G];return j===void 0&&(j=f(a()),X[G]=j),j}function f(I){const D=[],B=[],G=[];for(let z=0;z=0){const Z=z[tt];let U=X[tt];if(U===void 0&&(tt==="instanceMatrix"&&I.instanceMatrix&&(U=I.instanceMatrix),tt==="instanceColor"&&I.instanceColor&&(U=I.instanceColor)),Z===void 0||Z.attribute!==U||U&&Z.data!==U.data)return!0;j++}return r.attributesNum!==j||r.index!==G}function c(I,D,B,G){const z={},X=D.attributes;let j=0;const Q=B.getAttributes();for(const tt in Q)if(Q[tt].location>=0){let Z=X[tt];Z===void 0&&(tt==="instanceMatrix"&&I.instanceMatrix&&(Z=I.instanceMatrix),tt==="instanceColor"&&I.instanceColor&&(Z=I.instanceColor));const U={};U.attribute=Z,Z&&Z.data&&(U.data=Z.data),z[tt]=U,j++}r.attributes=z,r.attributesNum=j,r.index=G}function d(){const I=r.newAttributes;for(let D=0,B=I.length;D=0){let Y=z[Q];if(Y===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(Y=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(Y=I.instanceColor)),Y!==void 0){const Z=Y.normalized,U=Y.itemSize,H=i.get(Y);if(H===void 0)continue;const J=H.buffer,_=H.type,q=H.bytesPerElement,at=x.isWebGL2===!0&&(_===g.INT||_===g.UNSIGNED_INT||Y.gpuType===h1);if(Y.isInterleavedBufferAttribute){const ot=Y.data,rt=ot.stride,gt=Y.offset;if(ot.isInstancedInterleavedBuffer){for(let yt=0;yt0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&g.getShaderPrecisionFormat(g.VERTEX_SHADER,g.MEDIUM_FLOAT).precision>0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&g.constructor.name==="WebGL2RenderingContext";let y=i.precision!==void 0?i.precision:"highp";const e=E(y);e!==y&&(console.warn("THREE.WebGLRenderer:",y,"not supported, using",e,"instead."),y=e);const r=s||t.has("WEBGL_draw_buffers"),p=i.logarithmicDepthBuffer===!0,h=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS),a=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=g.getParameter(g.MAX_TEXTURE_SIZE),n=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE),u=g.getParameter(g.MAX_VERTEX_ATTRIBS),f=g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS),o=g.getParameter(g.MAX_VARYING_VECTORS),c=g.getParameter(g.MAX_FRAGMENT_UNIFORM_VECTORS),d=a>0,v=s||t.has("OES_texture_float"),m=d&&v,S=s?g.getParameter(g.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:r,getMaxAnisotropy:T,getMaxPrecision:E,precision:y,logarithmicDepthBuffer:p,maxTextures:h,maxVertexTextures:a,maxTextureSize:l,maxCubemapSize:n,maxAttributes:u,maxVertexUniforms:f,maxVaryings:o,maxFragmentUniforms:c,vertexTextures:d,floatFragmentTextures:v,floatVertexTextures:m,maxSamples:S}}function h8(g){const t=this;let i=null,x=0,T=!1,E=!1;const s=new lh,y=new Di,e={value:null,needsUpdate:!1};this.uniform=e,this.numPlanes=0,this.numIntersection=0,this.init=function(h,a){const l=h.length!==0||a||x!==0||T;return T=a,x=h.length,l},this.beginShadows=function(){E=!0,p(null)},this.endShadows=function(){E=!1},this.setGlobalState=function(h,a){i=p(h,a,0)},this.setState=function(h,a,l){const n=h.clippingPlanes,u=h.clipIntersection,f=h.clipShadows,o=g.get(h);if(!T||n===null||n.length===0||E&&!f)E?p(null):r();else{const c=E?0:x,d=c*4;let v=o.clippingState||null;e.value=v,v=p(n,a,d,l);for(let m=0;m!==d;++m)v[m]=i[m];o.clippingState=v,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=c}};function r(){e.value!==i&&(e.value=i,e.needsUpdate=x>0),t.numPlanes=x,t.numIntersection=0}function p(h,a,l,n){const u=h!==null?h.length:0;let f=null;if(u!==0){if(f=e.value,n!==!0||f===null){const o=l+u*4,c=a.matrixWorldInverse;y.getNormalMatrix(c),(f===null||f.length0){const r=new E2(e.height);return r.fromEquirectangularTexture(g,s),t.set(s,r),s.addEventListener("dispose",T),i(r.texture,s.mapping)}else return null}}return s}function T(s){const y=s.target;y.removeEventListener("dispose",T);const e=t.get(y);e!==void 0&&(t.delete(y),e.dispose())}function E(){t=new WeakMap}return{get:x,dispose:E}}class np extends tp{constructor(t=-1,i=1,x=1,T=-1,E=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=x,this.bottom=T,this.near=E,this.far=s,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,x,T,E,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),x=(this.right+this.left)/2,T=(this.top+this.bottom)/2;let E=x-t,s=x+t,y=T+i,e=T-i;if(this.view!==null&&this.view.enabled){const r=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;E+=r*this.view.offsetX,s=E+r*this.view.width,y-=p*this.view.offsetY,e=y-p*this.view.height}this.projectionMatrix.makeOrthographic(E,s,y,e,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}const Hf=4,ZT=[.125,.215,.35,.446,.526,.582],pu=20,H0=new np,JT=new ze;let W0=null,X0=0,Y0=0;const cu=(1+Math.sqrt(5))/2,wf=1/cu,$T=[new Ct(1,1,1),new Ct(-1,1,1),new Ct(1,1,-1),new Ct(-1,1,-1),new Ct(0,cu,wf),new Ct(0,cu,-wf),new Ct(wf,0,cu),new Ct(-wf,0,cu),new Ct(cu,wf,0),new Ct(-cu,wf,0)];class Tx{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,i=0,x=.1,T=100){W0=this._renderer.getRenderTarget(),X0=this._renderer.getActiveCubeFace(),Y0=this._renderer.getActiveMipmapLevel(),this._setSize(256);const E=this._allocateTargets();return E.depthBuffer=!0,this._sceneToCubeUV(t,x,T,E),i>0&&this._blur(E,0,0,i),this._applyPMREM(E),this._cleanup(E),E}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=qT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=_T(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?d:0,d,d),p.setRenderTarget(T),u&&p.render(n,y),p.render(t,y)}n.geometry.dispose(),n.material.dispose(),p.toneMapping=a,p.autoClear=h,t.background=f}_textureToCubeUV(t,i){const x=this._renderer,T=t.mapping===Pl||t.mapping===yh;T?(this._cubemapMaterial===null&&(this._cubemapMaterial=qT()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=_T());const E=T?this._cubemapMaterial:this._equirectMaterial,s=new dr(this._lodPlanes[0],E),y=E.uniforms;y.envMap.value=t;const e=this._cubeSize;wv(i,0,0,3*e,2*e),x.setRenderTarget(i),x.render(s,H0)}_applyPMREM(t){const i=this._renderer,x=i.autoClear;i.autoClear=!1;for(let T=1;Tpu&&console.warn(`sigmaRadians, ${E}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${pu}`);const o=[];let c=0;for(let M=0;Md-Hf?T-d+Hf:0),S=4*(this._cubeSize-v);wv(i,m,S,3*v,2*v),e.setRenderTarget(i),e.render(h,H0)}}function f8(g){const t=[],i=[],x=[];let T=g;const E=g-Hf+1+ZT.length;for(let s=0;sg-Hf?e=ZT[s-g+Hf-1]:s===0&&(e=0),x.push(e);const r=1/(y-2),p=-r,h=1+r,a=[p,p,h,p,h,h,p,p,h,h,p,h],l=6,n=6,u=3,f=2,o=1,c=new Float32Array(u*n*l),d=new Float32Array(f*n*l),v=new Float32Array(o*n*l);for(let S=0;S2?0:-1,C=[M,w,0,M+2/3,w,0,M+2/3,w+1,0,M,w,0,M+2/3,w+1,0,M,w+1,0];c.set(C,u*n*S),d.set(a,f*n*S);const A=[S,S,S,S,S,S];v.set(A,o*n*S)}const m=new Fi;m.setAttribute("position",new on(c,u)),m.setAttribute("uv",new on(d,f)),m.setAttribute("faceIndex",new on(v,o)),t.push(m),T>Hf&&T--}return{lodPlanes:t,sizeLods:i,sigmas:x}}function QT(g,t,i){const x=new ro(g,t,i);return x.texture.mapping=ac,x.texture.name="PMREM.cubeUv",x.scissorTest=!0,x}function wv(g,t,i,x,T){g.viewport.set(t,i,x,T),g.scissor.set(t,i,x,T)}function c8(g,t,i){const x=new Float32Array(pu),T=new Ct(0,1,0);return new so({name:"SphericalGaussianBlur",defines:{n:pu,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${g}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:x},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:T}},vertexShader:C1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:wl,depthTest:!1,depthWrite:!1})}function _T(){return new so({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:C1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:wl,depthTest:!1,depthWrite:!1})}function qT(){return new so({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:C1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:wl,depthTest:!1,depthWrite:!1})}function C1(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function d8(g){let t=new WeakMap,i=null;function x(y){if(y&&y.isTexture){const e=y.mapping,r=e===Cd||e===wd,p=e===Pl||e===yh;if(r||p)if(y.isRenderTargetTexture&&y.needsPMREMUpdate===!0){y.needsPMREMUpdate=!1;let h=t.get(y);return i===null&&(i=new Tx(g)),h=r?i.fromEquirectangular(y,h):i.fromCubemap(y,h),t.set(y,h),h.texture}else{if(t.has(y))return t.get(y).texture;{const h=y.image;if(r&&h&&h.height>0||p&&h&&T(h)){i===null&&(i=new Tx(g));const a=r?i.fromEquirectangular(y):i.fromCubemap(y);return t.set(y,a),y.addEventListener("dispose",E),a.texture}else return null}}}return y}function T(y){let e=0;const r=6;for(let p=0;pt.maxTextureSize&&(A=Math.ceil(C/t.maxTextureSize),C=t.maxTextureSize);const P=new Float32Array(C*A*4*n),b=new dg(P,C,A,n);b.type=Ma,b.needsUpdate=!0;const O=w*4;for(let D=0;D0)return g;const T=t*i;let E=tE[T];if(E===void 0&&(E=new Float32Array(T),tE[T]=E),t!==0){x.toArray(E,0);for(let s=1,y=0;s!==t;++s)y+=i,g[s].toArray(E,y)}return E}function yr(g,t){if(g.length!==t.length)return!1;for(let i=0,x=g.length;i":" "} ${y}: ${i[s]}`)}return x.join(` +`)}function v6(g){const t=sn.getPrimaries(sn.workingColorSpace),i=sn.getPrimaries(g);let x;switch(t===i?x="":t===Dd&&i===Od?x="LinearDisplayP3ToLinearSRGB":t===Od&&i===Dd&&(x="LinearSRGBToLinearDisplayP3"),g){case Ho:case qd:return[x,"LinearTransferOETF"];case mr:case cg:return[x,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",g),[x,"LinearTransferOETF"]}}function oE(g,t,i){const x=g.getShaderParameter(t,g.COMPILE_STATUS),T=g.getShaderInfoLog(t).trim();if(x&&T==="")return"";const E=/ERROR: 0:(\d+)/.exec(T);if(E){const s=parseInt(E[1]);return i.toUpperCase()+` + +`+T+` + +`+p6(g.getShaderSource(t),s)}else return T}function m6(g,t){const i=v6(t);return`vec4 ${g}( vec4 value ) { return ${i[0]}( ${i[1]}( value ) ); }`}function g6(g,t){let i;switch(t){case Ww:i="Linear";break;case Xw:i="Reinhard";break;case Yw:i="OptimizedCineon";break;case l1:i="ACESFilmic";break;case jw:i="AgX";break;case kw:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+g+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function y6(g){return[g.extensionDerivatives||g.envMapCubeUVHeight||g.bumpMap||g.normalMapTangentSpace||g.clearcoatNormalMap||g.flatShading||g.alphaToCoverage||g.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(g.extensionFragDepth||g.logarithmicDepthBuffer)&&g.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",g.extensionDrawBuffers&&g.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(g.extensionShaderTextureLOD||g.envMap||g.transmission)&&g.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Wf).join(` +`)}function x6(g){return[g.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",g.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Wf).join(` +`)}function S6(g){const t=[];for(const i in g){const x=g[i];x!==!1&&t.push("#define "+i+" "+x)}return t.join(` +`)}function T6(g,t){const i={},x=g.getProgramParameter(t,g.ACTIVE_ATTRIBUTES);for(let T=0;T/gm;function Ex(g){return g.replace(E6,C6)}const M6=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function C6(g,t){let i=Li[t];if(i===void 0){const x=M6.get(t);if(x!==void 0)i=Li[x],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,x);else throw new Error("Can not resolve #include <"+t+">")}return Ex(i)}const w6=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function uE(g){return g.replace(w6,A6)}function A6(g,t,i,x){let T="";for(let E=parseInt(t);E0&&(o+=` +`),c=[l,"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u].filter(Wf).join(` +`),c.length>0&&(c+=` +`)):(o=[fE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+e:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Wf).join(` +`),c=[l,fE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+r:"",i.envMap?"#define "+p:"",i.envMap?"#define "+h:"",a?"#define CUBEUV_TEXEL_WIDTH "+a.texelWidth:"",a?"#define CUBEUV_TEXEL_HEIGHT "+a.texelHeight:"",a?"#define CUBEUV_MAX_MIP "+a.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+e:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==zo?"#define TONE_MAPPING":"",i.toneMapping!==zo?Li.tonemapping_pars_fragment:"",i.toneMapping!==zo?g6("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",Li.colorspace_pars_fragment,m6("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",` +`].filter(Wf).join(` +`)),s=Ex(s),s=lE(s,i),s=hE(s,i),y=Ex(y),y=lE(y,i),y=hE(y,i),s=uE(s),y=uE(y),i.isWebGL2&&i.isRawShaderMaterial!==!0&&(d=`#version 300 es +`,o=[n,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+o,c=["precision mediump sampler2DArray;","#define varying in",i.glslVersion===xx?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===xx?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+c);const v=d+o+s,m=d+c+y,S=aE(T,T.VERTEX_SHADER,v),M=aE(T,T.FRAGMENT_SHADER,m);T.attachShader(f,S),T.attachShader(f,M),i.index0AttributeName!==void 0?T.bindAttribLocation(f,0,i.index0AttributeName):i.morphTargets===!0&&T.bindAttribLocation(f,0,"position"),T.linkProgram(f);function w(b){if(g.debug.checkShaderErrors){const O=T.getProgramInfoLog(f).trim(),I=T.getShaderInfoLog(S).trim(),D=T.getShaderInfoLog(M).trim();let B=!0,G=!0;if(T.getProgramParameter(f,T.LINK_STATUS)===!1)if(B=!1,typeof g.debug.onShaderError=="function")g.debug.onShaderError(T,f,S,M);else{const z=oE(T,S,"vertex"),X=oE(T,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+T.getError()+" - VALIDATE_STATUS "+T.getProgramParameter(f,T.VALIDATE_STATUS)+` + +Material Name: `+b.name+` +Material Type: `+b.type+` + +Program Info Log: `+O+` +`+z+` +`+X)}else O!==""?console.warn("THREE.WebGLProgram: Program Info Log:",O):(I===""||D==="")&&(G=!1);G&&(b.diagnostics={runnable:B,programLog:O,vertexShader:{log:I,prefix:o},fragmentShader:{log:D,prefix:c}})}T.deleteShader(S),T.deleteShader(M),C=new cm(T,f),A=T6(T,f)}let C;this.getUniforms=function(){return C===void 0&&w(this),C};let A;this.getAttributes=function(){return A===void 0&&w(this),A};let P=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=T.getProgramParameter(f,c6)),P},this.destroy=function(){x.releaseStatesOfProgram(this),T.deleteProgram(f),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=d6++,this.cacheKey=t,this.usedTimes=1,this.program=f,this.vertexShader=S,this.fragmentShader=M,this}let D6=0;class I6{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,x=t.fragmentShader,T=this._getShaderStage(i),E=this._getShaderStage(x),s=this._getShaderCacheForMaterial(t);return s.has(T)===!1&&(s.add(T),T.usedTimes++),s.has(E)===!1&&(s.add(E),E.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const x of i)x.usedTimes--,x.usedTimes===0&&this.shaderCache.delete(x.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let x=i.get(t);return x===void 0&&(x=new Set,i.set(t,x)),x}_getShaderStage(t){const i=this.shaderCache;let x=i.get(t);return x===void 0&&(x=new N6(t),i.set(t,x)),x}}class N6{constructor(t){this.id=D6++,this.code=t,this.usedTimes=0}}function B6(g,t,i,x,T,E,s){const y=new Mu,e=new I6,r=new Set,p=[],h=T.isWebGL2,a=T.logarithmicDepthBuffer,l=T.vertexTextures;let n=T.precision;const u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function f(A){return r.add(A),A===0?"uv":`uv${A}`}function o(A,P,b,O,I){const D=O.fog,B=I.geometry,G=A.isMeshStandardMaterial?O.environment:null,z=(A.isMeshStandardMaterial?i:t).get(A.envMap||G),X=z&&z.mapping===ac?z.image.height:null,j=u[A.type];A.precision!==null&&(n=T.getMaxPrecision(A.precision),n!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",n,"instead."));const Q=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,tt=Q!==void 0?Q.length:0;let Y=0;B.morphAttributes.position!==void 0&&(Y=1),B.morphAttributes.normal!==void 0&&(Y=2),B.morphAttributes.color!==void 0&&(Y=3);let Z,U,H,J;if(j){const Ii=eo[j];Z=Ii.vertexShader,U=Ii.fragmentShader}else Z=A.vertexShader,U=A.fragmentShader,e.update(A),H=e.getVertexShaderID(A),J=e.getFragmentShaderID(A);const _=g.getRenderTarget(),q=I.isInstancedMesh===!0,at=I.isBatchedMesh===!0,ot=!!A.map,rt=!!A.matcap,gt=!!z,yt=!!A.aoMap,Et=!!A.lightMap,At=!!A.bumpMap,Pt=!!A.normalMap,Vt=!!A.displacementMap,dt=!!A.emissiveMap,ut=!!A.metalnessMap,Rt=!!A.roughnessMap,Dt=A.anisotropy>0,Ht=A.clearcoat>0,Bt=A.iridescence>0,re=A.sheen>0,le=A.transmission>0,ge=Dt&&!!A.anisotropyMap,xe=Ht&&!!A.clearcoatMap,Pe=Ht&&!!A.clearcoatNormalMap,te=Ht&&!!A.clearcoatRoughnessMap,Ge=Bt&&!!A.iridescenceMap,Oe=Bt&&!!A.iridescenceThicknessMap,Be=re&&!!A.sheenColorMap,Le=re&&!!A.sheenRoughnessMap,ne=!!A.specularMap,je=!!A.specularColorMap,si=!!A.specularIntensityMap,Mi=le&&!!A.transmissionMap,he=le&&!!A.thicknessMap,Ti=!!A.gradientMap,bt=!!A.alphaMap,Ce=A.alphaTest>0,we=!!A.alphaHash,Ve=!!A.extensions;let Je=zo;A.toneMapped&&(_===null||_.isXRRenderTarget===!0)&&(Je=g.toneMapping);const Gi={isWebGL2:h,shaderID:j,shaderType:A.type,shaderName:A.name,vertexShader:Z,fragmentShader:U,defines:A.defines,customVertexShaderID:H,customFragmentShaderID:J,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:n,batching:at,instancing:q,instancingColor:q&&I.instanceColor!==null,supportsVertexTextures:l,outputColorSpace:_===null?g.outputColorSpace:_.isXRRenderTarget===!0?_.texture.colorSpace:Ho,alphaToCoverage:!!A.alphaToCoverage,map:ot,matcap:rt,envMap:gt,envMapMode:gt&&z.mapping,envMapCubeUVHeight:X,aoMap:yt,lightMap:Et,bumpMap:At,normalMap:Pt,displacementMap:l&&Vt,emissiveMap:dt,normalMapObjectSpace:Pt&&A.normalMapType===o2,normalMapTangentSpace:Pt&&A.normalMapType===Th,metalnessMap:ut,roughnessMap:Rt,anisotropy:Dt,anisotropyMap:ge,clearcoat:Ht,clearcoatMap:xe,clearcoatNormalMap:Pe,clearcoatRoughnessMap:te,iridescence:Bt,iridescenceMap:Ge,iridescenceThicknessMap:Oe,sheen:re,sheenColorMap:Be,sheenRoughnessMap:Le,specularMap:ne,specularColorMap:je,specularIntensityMap:si,transmission:le,transmissionMap:Mi,thicknessMap:he,gradientMap:Ti,opaque:A.transparent===!1&&A.blending===Su&&A.alphaToCoverage===!1,alphaMap:bt,alphaTest:Ce,alphaHash:we,combine:A.combine,mapUv:ot&&f(A.map.channel),aoMapUv:yt&&f(A.aoMap.channel),lightMapUv:Et&&f(A.lightMap.channel),bumpMapUv:At&&f(A.bumpMap.channel),normalMapUv:Pt&&f(A.normalMap.channel),displacementMapUv:Vt&&f(A.displacementMap.channel),emissiveMapUv:dt&&f(A.emissiveMap.channel),metalnessMapUv:ut&&f(A.metalnessMap.channel),roughnessMapUv:Rt&&f(A.roughnessMap.channel),anisotropyMapUv:ge&&f(A.anisotropyMap.channel),clearcoatMapUv:xe&&f(A.clearcoatMap.channel),clearcoatNormalMapUv:Pe&&f(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:te&&f(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Ge&&f(A.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&f(A.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&f(A.sheenColorMap.channel),sheenRoughnessMapUv:Le&&f(A.sheenRoughnessMap.channel),specularMapUv:ne&&f(A.specularMap.channel),specularColorMapUv:je&&f(A.specularColorMap.channel),specularIntensityMapUv:si&&f(A.specularIntensityMap.channel),transmissionMapUv:Mi&&f(A.transmissionMap.channel),thicknessMapUv:he&&f(A.thicknessMap.channel),alphaMapUv:bt&&f(A.alphaMap.channel),vertexTangents:!!B.attributes.tangent&&(Pt||Dt),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,pointsUvs:I.isPoints===!0&&!!B.attributes.uv&&(ot||bt),fog:!!D,useFog:A.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:a,skinning:I.isSkinnedMesh===!0,morphTargets:B.morphAttributes.position!==void 0,morphNormals:B.morphAttributes.normal!==void 0,morphColors:B.morphAttributes.color!==void 0,morphTargetsCount:tt,morphTextureStride:Y,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:g.shadowMap.enabled&&b.length>0,shadowMapType:g.shadowMap.type,toneMapping:Je,useLegacyLights:g._useLegacyLights,decodeVideoTexture:ot&&A.map.isVideoTexture===!0&&sn.getTransfer(A.map.colorSpace)===mn,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===Io,flipSided:A.side===gs,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:Ve&&A.extensions.derivatives===!0,extensionFragDepth:Ve&&A.extensions.fragDepth===!0,extensionDrawBuffers:Ve&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ve&&A.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ve&&A.extensions.clipCullDistance===!0&&x.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ve&&A.extensions.multiDraw===!0&&x.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||x.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||x.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||x.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:x.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return Gi.vertexUv1s=r.has(1),Gi.vertexUv2s=r.has(2),Gi.vertexUv3s=r.has(3),r.clear(),Gi}function c(A){const P=[];if(A.shaderID?P.push(A.shaderID):(P.push(A.customVertexShaderID),P.push(A.customFragmentShaderID)),A.defines!==void 0)for(const b in A.defines)P.push(b),P.push(A.defines[b]);return A.isRawShaderMaterial===!1&&(d(P,A),v(P,A),P.push(g.outputColorSpace)),P.push(A.customProgramCacheKey),P.join()}function d(A,P){A.push(P.precision),A.push(P.outputColorSpace),A.push(P.envMapMode),A.push(P.envMapCubeUVHeight),A.push(P.mapUv),A.push(P.alphaMapUv),A.push(P.lightMapUv),A.push(P.aoMapUv),A.push(P.bumpMapUv),A.push(P.normalMapUv),A.push(P.displacementMapUv),A.push(P.emissiveMapUv),A.push(P.metalnessMapUv),A.push(P.roughnessMapUv),A.push(P.anisotropyMapUv),A.push(P.clearcoatMapUv),A.push(P.clearcoatNormalMapUv),A.push(P.clearcoatRoughnessMapUv),A.push(P.iridescenceMapUv),A.push(P.iridescenceThicknessMapUv),A.push(P.sheenColorMapUv),A.push(P.sheenRoughnessMapUv),A.push(P.specularMapUv),A.push(P.specularColorMapUv),A.push(P.specularIntensityMapUv),A.push(P.transmissionMapUv),A.push(P.thicknessMapUv),A.push(P.combine),A.push(P.fogExp2),A.push(P.sizeAttenuation),A.push(P.morphTargetsCount),A.push(P.morphAttributeCount),A.push(P.numDirLights),A.push(P.numPointLights),A.push(P.numSpotLights),A.push(P.numSpotLightMaps),A.push(P.numHemiLights),A.push(P.numRectAreaLights),A.push(P.numDirLightShadows),A.push(P.numPointLightShadows),A.push(P.numSpotLightShadows),A.push(P.numSpotLightShadowsWithMaps),A.push(P.numLightProbes),A.push(P.shadowMapType),A.push(P.toneMapping),A.push(P.numClippingPlanes),A.push(P.numClipIntersection),A.push(P.depthPacking)}function v(A,P){y.disableAll(),P.isWebGL2&&y.enable(0),P.supportsVertexTextures&&y.enable(1),P.instancing&&y.enable(2),P.instancingColor&&y.enable(3),P.matcap&&y.enable(4),P.envMap&&y.enable(5),P.normalMapObjectSpace&&y.enable(6),P.normalMapTangentSpace&&y.enable(7),P.clearcoat&&y.enable(8),P.iridescence&&y.enable(9),P.alphaTest&&y.enable(10),P.vertexColors&&y.enable(11),P.vertexAlphas&&y.enable(12),P.vertexUv1s&&y.enable(13),P.vertexUv2s&&y.enable(14),P.vertexUv3s&&y.enable(15),P.vertexTangents&&y.enable(16),P.anisotropy&&y.enable(17),P.alphaHash&&y.enable(18),P.batching&&y.enable(19),A.push(y.mask),y.disableAll(),P.fog&&y.enable(0),P.useFog&&y.enable(1),P.flatShading&&y.enable(2),P.logarithmicDepthBuffer&&y.enable(3),P.skinning&&y.enable(4),P.morphTargets&&y.enable(5),P.morphNormals&&y.enable(6),P.morphColors&&y.enable(7),P.premultipliedAlpha&&y.enable(8),P.shadowMapEnabled&&y.enable(9),P.useLegacyLights&&y.enable(10),P.doubleSided&&y.enable(11),P.flipSided&&y.enable(12),P.useDepthPacking&&y.enable(13),P.dithering&&y.enable(14),P.transmission&&y.enable(15),P.sheen&&y.enable(16),P.opaque&&y.enable(17),P.pointsUvs&&y.enable(18),P.decodeVideoTexture&&y.enable(19),P.alphaToCoverage&&y.enable(20),A.push(y.mask)}function m(A){const P=u[A.type];let b;if(P){const O=eo[P];b=S2.clone(O.uniforms)}else b=A.uniforms;return b}function S(A,P){let b;for(let O=0,I=p.length;O0?x.push(o):l.transparent===!0?T.push(o):i.push(o)}function e(h,a,l,n,u,f){const o=s(h,a,l,n,u,f);l.transmission>0?x.unshift(o):l.transparent===!0?T.unshift(o):i.unshift(o)}function r(h,a){i.length>1&&i.sort(h||z6),x.length>1&&x.sort(a||cE),T.length>1&&T.sort(a||cE)}function p(){for(let h=t,a=g.length;h=E.length?(s=new dE,E.push(s)):s=E[T],s}function i(){g=new WeakMap}return{get:t,dispose:i}}function V6(){const g={};return{get:function(t){if(g[t.id]!==void 0)return g[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Ct,color:new ze};break;case"SpotLight":i={position:new Ct,direction:new Ct,color:new ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ct,color:new ze,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ct,skyColor:new ze,groundColor:new ze};break;case"RectAreaLight":i={color:new ze,position:new Ct,halfWidth:new Ct,halfHeight:new Ct};break}return g[t.id]=i,i}}}function H6(){const g={};return{get:function(t){if(g[t.id]!==void 0)return g[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve,shadowCameraNear:1,shadowCameraFar:1e3};break}return g[t.id]=i,i}}}let W6=0;function X6(g,t){return(t.castShadow?2:0)-(g.castShadow?2:0)+(t.map?1:0)-(g.map?1:0)}function Y6(g,t){const i=new V6,x=H6(),T={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)T.probe.push(new Ct);const E=new Ct,s=new di,y=new di;function e(p,h){let a=0,l=0,n=0;for(let b=0;b<9;b++)T.probe[b].set(0,0,0);let u=0,f=0,o=0,c=0,d=0,v=0,m=0,S=0,M=0,w=0,C=0;p.sort(X6);const A=h===!0?Math.PI:1;for(let b=0,O=p.length;b0&&(t.isWebGL2?g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_FLOAT_1,T.rectAreaLTC2=Fe.LTC_FLOAT_2):(T.rectAreaLTC1=Fe.LTC_HALF_1,T.rectAreaLTC2=Fe.LTC_HALF_2):g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_FLOAT_1,T.rectAreaLTC2=Fe.LTC_FLOAT_2):g.has("OES_texture_half_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_HALF_1,T.rectAreaLTC2=Fe.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),T.ambient[0]=a,T.ambient[1]=l,T.ambient[2]=n;const P=T.hash;(P.directionalLength!==u||P.pointLength!==f||P.spotLength!==o||P.rectAreaLength!==c||P.hemiLength!==d||P.numDirectionalShadows!==v||P.numPointShadows!==m||P.numSpotShadows!==S||P.numSpotMaps!==M||P.numLightProbes!==C)&&(T.directional.length=u,T.spot.length=o,T.rectArea.length=c,T.point.length=f,T.hemi.length=d,T.directionalShadow.length=v,T.directionalShadowMap.length=v,T.pointShadow.length=m,T.pointShadowMap.length=m,T.spotShadow.length=S,T.spotShadowMap.length=S,T.directionalShadowMatrix.length=v,T.pointShadowMatrix.length=m,T.spotLightMatrix.length=S+M-w,T.spotLightMap.length=M,T.numSpotLightShadowsWithMaps=w,T.numLightProbes=C,P.directionalLength=u,P.pointLength=f,P.spotLength=o,P.rectAreaLength=c,P.hemiLength=d,P.numDirectionalShadows=v,P.numPointShadows=m,P.numSpotShadows=S,P.numSpotMaps=M,P.numLightProbes=C,T.version=W6++)}function r(p,h){let a=0,l=0,n=0,u=0,f=0;const o=h.matrixWorldInverse;for(let c=0,d=p.length;c=y.length?(e=new pE(g,t),y.push(e)):e=y[s],e}function T(){i=new WeakMap}return{get:x,dispose:T}}class A1 extends Wr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=s2,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class P1 extends Wr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const j6=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,K6=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Z6(g,t,i){let x=new ip;const T=new ve,E=new ve,s=new an,y=new A1({depthPacking:a2}),e=new P1,r={},p=i.maxTextureSize,h={[Al]:gs,[gs]:Al,[Io]:Io},a=new so({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ve},radius:{value:4}},vertexShader:j6,fragmentShader:K6}),l=a.clone();l.defines.HORIZONTAL_PASS=1;const n=new Fi;n.setAttribute("position",new on(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const u=new dr(n,a),f=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=lg;let o=this.type;this.render=function(S,M,w){if(f.enabled===!1||f.autoUpdate===!1&&f.needsUpdate===!1||S.length===0)return;const C=g.getRenderTarget(),A=g.getActiveCubeFace(),P=g.getActiveMipmapLevel(),b=g.state;b.setBlending(wl),b.buffers.color.setClear(1,1,1,1),b.buffers.depth.setTest(!0),b.setScissorTest(!1);const O=o!==qa&&this.type===qa,I=o===qa&&this.type!==qa;for(let D=0,B=S.length;Dp||T.y>p)&&(T.x>p&&(E.x=Math.floor(p/X.x),T.x=E.x*X.x,z.mapSize.x=E.x),T.y>p&&(E.y=Math.floor(p/X.y),T.y=E.y*X.y,z.mapSize.y=E.y)),z.map===null||O===!0||I===!0){const Q=this.type!==qa?{minFilter:rr,magFilter:rr}:{};z.map!==null&&z.map.dispose(),z.map=new ro(T.x,T.y,Q),z.map.texture.name=G.name+".shadowMap",z.camera.updateProjectionMatrix()}g.setRenderTarget(z.map),g.clear();const j=z.getViewportCount();for(let Q=0;Q0||M.map&&M.alphaTest>0){const b=A.uuid,O=M.uuid;let I=r[b];I===void 0&&(I={},r[b]=I);let D=I[O];D===void 0&&(D=A.clone(),I[O]=D,M.addEventListener("dispose",m)),A=D}if(A.visible=M.visible,A.wireframe=M.wireframe,C===qa?A.side=M.shadowSide!==null?M.shadowSide:M.side:A.side=M.shadowSide!==null?M.shadowSide:h[M.side],A.alphaMap=M.alphaMap,A.alphaTest=M.alphaTest,A.map=M.map,A.clipShadows=M.clipShadows,A.clippingPlanes=M.clippingPlanes,A.clipIntersection=M.clipIntersection,A.displacementMap=M.displacementMap,A.displacementScale=M.displacementScale,A.displacementBias=M.displacementBias,A.wireframeLinewidth=M.wireframeLinewidth,A.linewidth=M.linewidth,w.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const b=g.properties.get(A);b.light=w}return A}function v(S,M,w,C,A){if(S.visible===!1)return;if(S.layers.test(M.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&A===qa)&&(!S.frustumCulled||x.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,S.matrixWorld);const O=t.update(S),I=S.material;if(Array.isArray(I)){const D=O.groups;for(let B=0,G=D.length;B=1):j.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),z=X>=2);let Q=null,tt={};const Y=g.getParameter(g.SCISSOR_BOX),Z=g.getParameter(g.VIEWPORT),U=new an().fromArray(Y),H=new an().fromArray(Z);function J(bt,Ce,we,Ve){const Je=new Uint8Array(4),Gi=g.createTexture();g.bindTexture(bt,Gi),g.texParameteri(bt,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(bt,g.TEXTURE_MAG_FILTER,g.NEAREST);for(let Ii=0;Ii"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let h;const a=new WeakMap;let l=!1;try{l=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function n(dt,ut){return l?new OffscreenCanvas(dt,ut):Bd("canvas")}function u(dt,ut,Rt,Dt){let Ht=1;if((dt.width>Dt||dt.height>Dt)&&(Ht=Dt/Math.max(dt.width,dt.height)),Ht<1||ut===!0)if(typeof HTMLImageElement<"u"&&dt instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&dt instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&dt instanceof ImageBitmap){const Bt=ut?Am:Math.floor,re=Bt(Ht*dt.width),le=Bt(Ht*dt.height);h===void 0&&(h=n(re,le));const ge=Rt?n(re,le):h;return ge.width=re,ge.height=le,ge.getContext("2d").drawImage(dt,0,0,re,le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+dt.width+"x"+dt.height+") to ("+re+"x"+le+")."),ge}else return"data"in dt&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+dt.width+"x"+dt.height+")."),dt;return dt}function f(dt){return Sx(dt.width)&&Sx(dt.height)}function o(dt){return y?!1:dt.wrapS!==$r||dt.wrapT!==$r||dt.minFilter!==rr&&dt.minFilter!==Bn}function c(dt,ut){return dt.generateMipmaps&&ut&&dt.minFilter!==rr&&dt.minFilter!==Bn}function d(dt){g.generateMipmap(dt)}function v(dt,ut,Rt,Dt,Ht=!1){if(y===!1)return ut;if(dt!==null){if(g[dt]!==void 0)return g[dt];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+dt+"'")}let Bt=ut;if(ut===g.RED&&(Rt===g.FLOAT&&(Bt=g.R32F),Rt===g.HALF_FLOAT&&(Bt=g.R16F),Rt===g.UNSIGNED_BYTE&&(Bt=g.R8)),ut===g.RED_INTEGER&&(Rt===g.UNSIGNED_BYTE&&(Bt=g.R8UI),Rt===g.UNSIGNED_SHORT&&(Bt=g.R16UI),Rt===g.UNSIGNED_INT&&(Bt=g.R32UI),Rt===g.BYTE&&(Bt=g.R8I),Rt===g.SHORT&&(Bt=g.R16I),Rt===g.INT&&(Bt=g.R32I)),ut===g.RG&&(Rt===g.FLOAT&&(Bt=g.RG32F),Rt===g.HALF_FLOAT&&(Bt=g.RG16F),Rt===g.UNSIGNED_BYTE&&(Bt=g.RG8)),ut===g.RGBA){const re=Ht?Fd:sn.getTransfer(Dt);Rt===g.FLOAT&&(Bt=g.RGBA32F),Rt===g.HALF_FLOAT&&(Bt=g.RGBA16F),Rt===g.UNSIGNED_BYTE&&(Bt=re===mn?g.SRGB8_ALPHA8:g.RGBA8),Rt===g.UNSIGNED_SHORT_4_4_4_4&&(Bt=g.RGBA4),Rt===g.UNSIGNED_SHORT_5_5_5_1&&(Bt=g.RGB5_A1)}return(Bt===g.R16F||Bt===g.R32F||Bt===g.RG16F||Bt===g.RG32F||Bt===g.RGBA16F||Bt===g.RGBA32F)&&t.get("EXT_color_buffer_float"),Bt}function m(dt,ut,Rt){return c(dt,Rt)===!0||dt.isFramebufferTexture&&dt.minFilter!==rr&&dt.minFilter!==Bn?Math.log2(Math.max(ut.width,ut.height))+1:dt.mipmaps!==void 0&&dt.mipmaps.length>0?dt.mipmaps.length:dt.isCompressedTexture&&Array.isArray(dt.image)?ut.mipmaps.length:1}function S(dt){return dt===rr||dt===Cm||dt===du?g.NEAREST:g.LINEAR}function M(dt){const ut=dt.target;ut.removeEventListener("dispose",M),C(ut),ut.isVideoTexture&&p.delete(ut)}function w(dt){const ut=dt.target;ut.removeEventListener("dispose",w),P(ut)}function C(dt){const ut=x.get(dt);if(ut.__webglInit===void 0)return;const Rt=dt.source,Dt=a.get(Rt);if(Dt){const Ht=Dt[ut.__cacheKey];Ht.usedTimes--,Ht.usedTimes===0&&A(dt),Object.keys(Dt).length===0&&a.delete(Rt)}x.remove(dt)}function A(dt){const ut=x.get(dt);g.deleteTexture(ut.__webglTexture);const Rt=dt.source,Dt=a.get(Rt);delete Dt[ut.__cacheKey],s.memory.textures--}function P(dt){const ut=dt.texture,Rt=x.get(dt),Dt=x.get(ut);if(Dt.__webglTexture!==void 0&&(g.deleteTexture(Dt.__webglTexture),s.memory.textures--),dt.depthTexture&&dt.depthTexture.dispose(),dt.isWebGLCubeRenderTarget)for(let Ht=0;Ht<6;Ht++){if(Array.isArray(Rt.__webglFramebuffer[Ht]))for(let Bt=0;Bt=T.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+dt+" texture units while this GPU supports only "+T.maxTextures),b+=1,dt}function D(dt){const ut=[];return ut.push(dt.wrapS),ut.push(dt.wrapT),ut.push(dt.wrapR||0),ut.push(dt.magFilter),ut.push(dt.minFilter),ut.push(dt.anisotropy),ut.push(dt.internalFormat),ut.push(dt.format),ut.push(dt.type),ut.push(dt.generateMipmaps),ut.push(dt.premultiplyAlpha),ut.push(dt.flipY),ut.push(dt.unpackAlignment),ut.push(dt.colorSpace),ut.join()}function B(dt,ut){const Rt=x.get(dt);if(dt.isVideoTexture&&Pt(dt),dt.isRenderTargetTexture===!1&&dt.version>0&&Rt.__version!==dt.version){const Dt=dt.image;if(Dt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Dt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{U(Rt,dt,ut);return}}i.bindTexture(g.TEXTURE_2D,Rt.__webglTexture,g.TEXTURE0+ut)}function G(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){U(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_2D_ARRAY,Rt.__webglTexture,g.TEXTURE0+ut)}function z(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){U(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_3D,Rt.__webglTexture,g.TEXTURE0+ut)}function X(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){H(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_CUBE_MAP,Rt.__webglTexture,g.TEXTURE0+ut)}const j={[Ad]:g.REPEAT,[$r]:g.CLAMP_TO_EDGE,[Pd]:g.MIRRORED_REPEAT},Q={[rr]:g.NEAREST,[Cm]:g.NEAREST_MIPMAP_NEAREST,[du]:g.NEAREST_MIPMAP_LINEAR,[Bn]:g.LINEAR,[dd]:g.LINEAR_MIPMAP_NEAREST,[Bo]:g.LINEAR_MIPMAP_LINEAR},tt={[l2]:g.NEVER,[p2]:g.ALWAYS,[h2]:g.LESS,[y1]:g.LEQUAL,[u2]:g.EQUAL,[d2]:g.GEQUAL,[f2]:g.GREATER,[c2]:g.NOTEQUAL};function Y(dt,ut,Rt){if(ut.type===Ma&&t.has("OES_texture_float_linear")===!1&&(ut.magFilter===Bn||ut.magFilter===dd||ut.magFilter===du||ut.magFilter===Bo||ut.minFilter===Bn||ut.minFilter===dd||ut.minFilter===du||ut.minFilter===Bo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),Rt?(g.texParameteri(dt,g.TEXTURE_WRAP_S,j[ut.wrapS]),g.texParameteri(dt,g.TEXTURE_WRAP_T,j[ut.wrapT]),(dt===g.TEXTURE_3D||dt===g.TEXTURE_2D_ARRAY)&&g.texParameteri(dt,g.TEXTURE_WRAP_R,j[ut.wrapR]),g.texParameteri(dt,g.TEXTURE_MAG_FILTER,Q[ut.magFilter]),g.texParameteri(dt,g.TEXTURE_MIN_FILTER,Q[ut.minFilter])):(g.texParameteri(dt,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(dt,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),(dt===g.TEXTURE_3D||dt===g.TEXTURE_2D_ARRAY)&&g.texParameteri(dt,g.TEXTURE_WRAP_R,g.CLAMP_TO_EDGE),(ut.wrapS!==$r||ut.wrapT!==$r)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),g.texParameteri(dt,g.TEXTURE_MAG_FILTER,S(ut.magFilter)),g.texParameteri(dt,g.TEXTURE_MIN_FILTER,S(ut.minFilter)),ut.minFilter!==rr&&ut.minFilter!==Bn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),ut.compareFunction&&(g.texParameteri(dt,g.TEXTURE_COMPARE_MODE,g.COMPARE_REF_TO_TEXTURE),g.texParameteri(dt,g.TEXTURE_COMPARE_FUNC,tt[ut.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){const Dt=t.get("EXT_texture_filter_anisotropic");if(ut.magFilter===rr||ut.minFilter!==du&&ut.minFilter!==Bo||ut.type===Ma&&t.has("OES_texture_float_linear")===!1||y===!1&&ut.type===qf&&t.has("OES_texture_half_float_linear")===!1)return;(ut.anisotropy>1||x.get(ut).__currentAnisotropy)&&(g.texParameterf(dt,Dt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ut.anisotropy,T.getMaxAnisotropy())),x.get(ut).__currentAnisotropy=ut.anisotropy)}}function Z(dt,ut){let Rt=!1;dt.__webglInit===void 0&&(dt.__webglInit=!0,ut.addEventListener("dispose",M));const Dt=ut.source;let Ht=a.get(Dt);Ht===void 0&&(Ht={},a.set(Dt,Ht));const Bt=D(ut);if(Bt!==dt.__cacheKey){Ht[Bt]===void 0&&(Ht[Bt]={texture:g.createTexture(),usedTimes:0},s.memory.textures++,Rt=!0),Ht[Bt].usedTimes++;const re=Ht[dt.__cacheKey];re!==void 0&&(Ht[dt.__cacheKey].usedTimes--,re.usedTimes===0&&A(ut)),dt.__cacheKey=Bt,dt.__webglTexture=Ht[Bt].texture}return Rt}function U(dt,ut,Rt){let Dt=g.TEXTURE_2D;(ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Dt=g.TEXTURE_2D_ARRAY),ut.isData3DTexture&&(Dt=g.TEXTURE_3D);const Ht=Z(dt,ut),Bt=ut.source;i.bindTexture(Dt,dt.__webglTexture,g.TEXTURE0+Rt);const re=x.get(Bt);if(Bt.version!==re.__version||Ht===!0){i.activeTexture(g.TEXTURE0+Rt);const le=sn.getPrimaries(sn.workingColorSpace),ge=ut.colorSpace===ia?null:sn.getPrimaries(ut.colorSpace),xe=ut.colorSpace===ia||le===ge?g.NONE:g.BROWSER_DEFAULT_WEBGL;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,ut.flipY),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ut.premultiplyAlpha),g.pixelStorei(g.UNPACK_ALIGNMENT,ut.unpackAlignment),g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,xe);const Pe=o(ut)&&f(ut.image)===!1;let te=u(ut.image,Pe,!1,T.maxTextureSize);te=Vt(ut,te);const Ge=f(te)||y,Oe=E.convert(ut.format,ut.colorSpace);let Be=E.convert(ut.type),Le=v(ut.internalFormat,Oe,Be,ut.colorSpace,ut.isVideoTexture);Y(Dt,ut,Ge);let ne;const je=ut.mipmaps,si=y&&ut.isVideoTexture!==!0&&Le!==v1,Mi=re.__version===void 0||Ht===!0,he=Bt.dataReady,Ti=m(ut,te,Ge);if(ut.isDepthTexture)Le=g.DEPTH_COMPONENT,y?ut.type===Ma?Le=g.DEPTH_COMPONENT32F:ut.type===El?Le=g.DEPTH_COMPONENT24:ut.type===dh?Le=g.DEPTH24_STENCIL8:Le=g.DEPTH_COMPONENT16:ut.type===Ma&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),ut.format===ph&&Le===g.DEPTH_COMPONENT&&ut.type!==ug&&ut.type!==El&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),ut.type=El,Be=E.convert(ut.type)),ut.format===bu&&Le===g.DEPTH_COMPONENT&&(Le=g.DEPTH_STENCIL,ut.type!==dh&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),ut.type=dh,Be=E.convert(ut.type))),Mi&&(si?i.texStorage2D(g.TEXTURE_2D,1,Le,te.width,te.height):i.texImage2D(g.TEXTURE_2D,0,Le,te.width,te.height,0,Oe,Be,null));else if(ut.isDataTexture)if(je.length>0&&Ge){si&&Mi&&i.texStorage2D(g.TEXTURE_2D,Ti,Le,je[0].width,je[0].height);for(let bt=0,Ce=je.length;bt>=1,Ce>>=1}}else if(je.length>0&&Ge){si&&Mi&&i.texStorage2D(g.TEXTURE_2D,Ti,Le,je[0].width,je[0].height);for(let bt=0,Ce=je.length;bt0&&he++,i.texStorage2D(g.TEXTURE_CUBE_MAP,he,ne,te[0].width,te[0].height));for(let bt=0;bt<6;bt++)if(Pe){je?Mi&&i.texSubImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,te[bt].width,te[bt].height,Be,Le,te[bt].data):i.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,ne,te[bt].width,te[bt].height,0,Be,Le,te[bt].data);for(let Ce=0;Ce>Bt),te=Math.max(1,ut.height>>Bt);Ht===g.TEXTURE_3D||Ht===g.TEXTURE_2D_ARRAY?i.texImage3D(Ht,Bt,ge,Pe,te,ut.depth,0,re,le,null):i.texImage2D(Ht,Bt,ge,Pe,te,0,re,le,null)}i.bindFramebuffer(g.FRAMEBUFFER,dt),At(ut)?e.framebufferTexture2DMultisampleEXT(g.FRAMEBUFFER,Dt,Ht,x.get(Rt).__webglTexture,0,Et(ut)):(Ht===g.TEXTURE_2D||Ht>=g.TEXTURE_CUBE_MAP_POSITIVE_X&&Ht<=g.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&g.framebufferTexture2D(g.FRAMEBUFFER,Dt,Ht,x.get(Rt).__webglTexture,Bt),i.bindFramebuffer(g.FRAMEBUFFER,null)}function _(dt,ut,Rt){if(g.bindRenderbuffer(g.RENDERBUFFER,dt),ut.depthBuffer&&!ut.stencilBuffer){let Dt=y===!0?g.DEPTH_COMPONENT24:g.DEPTH_COMPONENT16;if(Rt||At(ut)){const Ht=ut.depthTexture;Ht&&Ht.isDepthTexture&&(Ht.type===Ma?Dt=g.DEPTH_COMPONENT32F:Ht.type===El&&(Dt=g.DEPTH_COMPONENT24));const Bt=Et(ut);At(ut)?e.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Bt,Dt,ut.width,ut.height):g.renderbufferStorageMultisample(g.RENDERBUFFER,Bt,Dt,ut.width,ut.height)}else g.renderbufferStorage(g.RENDERBUFFER,Dt,ut.width,ut.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,dt)}else if(ut.depthBuffer&&ut.stencilBuffer){const Dt=Et(ut);Rt&&At(ut)===!1?g.renderbufferStorageMultisample(g.RENDERBUFFER,Dt,g.DEPTH24_STENCIL8,ut.width,ut.height):At(ut)?e.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Dt,g.DEPTH24_STENCIL8,ut.width,ut.height):g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_STENCIL,ut.width,ut.height),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_STENCIL_ATTACHMENT,g.RENDERBUFFER,dt)}else{const Dt=ut.isWebGLMultipleRenderTargets===!0?ut.texture:[ut.texture];for(let Ht=0;Ht0){Rt.__webglFramebuffer[le]=[];for(let ge=0;ge0){Rt.__webglFramebuffer=[];for(let le=0;le0&&At(dt)===!1){const le=Bt?ut:[ut];Rt.__webglMultisampledFramebuffer=g.createFramebuffer(),Rt.__webglColorRenderbuffer=[],i.bindFramebuffer(g.FRAMEBUFFER,Rt.__webglMultisampledFramebuffer);for(let ge=0;ge0)for(let ge=0;ge0)for(let ge=0;ge0&&At(dt)===!1){const ut=dt.isWebGLMultipleRenderTargets?dt.texture:[dt.texture],Rt=dt.width,Dt=dt.height;let Ht=g.COLOR_BUFFER_BIT;const Bt=[],re=dt.stencilBuffer?g.DEPTH_STENCIL_ATTACHMENT:g.DEPTH_ATTACHMENT,le=x.get(dt),ge=dt.isWebGLMultipleRenderTargets===!0;if(ge)for(let xe=0;xe0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&ut.__useRenderToTexture!==!1}function Pt(dt){const ut=s.render.frame;p.get(dt)!==ut&&(p.set(dt,ut),dt.update())}function Vt(dt,ut){const Rt=dt.colorSpace,Dt=dt.format,Ht=dt.type;return dt.isCompressedTexture===!0||dt.isVideoTexture===!0||dt.format===wm||Rt!==Ho&&Rt!==ia&&(sn.getTransfer(Rt)===mn?y===!1?t.has("EXT_sRGB")===!0&&Dt===vs?(dt.format=wm,dt.minFilter=Bn,dt.generateMipmaps=!1):ut=S1.sRGBToLinear(ut):(Dt!==vs||Ht!==Go)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Rt)),ut}this.allocateTextureUnit=I,this.resetTextureUnits=O,this.setTexture2D=B,this.setTexture2DArray=G,this.setTexture3D=z,this.setTextureCube=X,this.rebindTextures=ot,this.setupRenderTarget=rt,this.updateRenderTargetMipmap=gt,this.updateMultisampleRenderTarget=yt,this.setupDepthRenderbuffer=at,this.setupFrameBufferTexture=J,this.useMultisampledRTT=At}function b2(g,t,i){const x=i.isWebGL2;function T(E,s=ia){let y;const e=sn.getTransfer(s);if(E===Go)return g.UNSIGNED_BYTE;if(E===u1)return g.UNSIGNED_SHORT_4_4_4_4;if(E===f1)return g.UNSIGNED_SHORT_5_5_5_1;if(E===Zw)return g.BYTE;if(E===Jw)return g.SHORT;if(E===ug)return g.UNSIGNED_SHORT;if(E===h1)return g.INT;if(E===El)return g.UNSIGNED_INT;if(E===Ma)return g.FLOAT;if(E===qf)return x?g.HALF_FLOAT:(y=t.get("OES_texture_half_float"),y!==null?y.HALF_FLOAT_OES:null);if(E===$w)return g.ALPHA;if(E===vs)return g.RGBA;if(E===Qw)return g.LUMINANCE;if(E===_w)return g.LUMINANCE_ALPHA;if(E===ph)return g.DEPTH_COMPONENT;if(E===bu)return g.DEPTH_STENCIL;if(E===wm)return y=t.get("EXT_sRGB"),y!==null?y.SRGB_ALPHA_EXT:null;if(E===qw)return g.RED;if(E===c1)return g.RED_INTEGER;if(E===t2)return g.RG;if(E===d1)return g.RG_INTEGER;if(E===p1)return g.RGBA_INTEGER;if(E===sm||E===am||E===om||E===lm)if(e===mn)if(y=t.get("WEBGL_compressed_texture_s3tc_srgb"),y!==null){if(E===sm)return y.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(E===am)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(E===om)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(E===lm)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(y=t.get("WEBGL_compressed_texture_s3tc"),y!==null){if(E===sm)return y.COMPRESSED_RGB_S3TC_DXT1_EXT;if(E===am)return y.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(E===om)return y.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(E===lm)return y.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(E===Ky||E===Zy||E===Jy||E===$y)if(y=t.get("WEBGL_compressed_texture_pvrtc"),y!==null){if(E===Ky)return y.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(E===Zy)return y.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(E===Jy)return y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(E===$y)return y.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(E===v1)return y=t.get("WEBGL_compressed_texture_etc1"),y!==null?y.COMPRESSED_RGB_ETC1_WEBGL:null;if(E===Qy||E===_y)if(y=t.get("WEBGL_compressed_texture_etc"),y!==null){if(E===Qy)return e===mn?y.COMPRESSED_SRGB8_ETC2:y.COMPRESSED_RGB8_ETC2;if(E===_y)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:y.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(E===qy||E===tx||E===ex||E===ix||E===nx||E===rx||E===sx||E===ax||E===ox||E===lx||E===hx||E===ux||E===fx||E===cx)if(y=t.get("WEBGL_compressed_texture_astc"),y!==null){if(E===qy)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:y.COMPRESSED_RGBA_ASTC_4x4_KHR;if(E===tx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:y.COMPRESSED_RGBA_ASTC_5x4_KHR;if(E===ex)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:y.COMPRESSED_RGBA_ASTC_5x5_KHR;if(E===ix)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:y.COMPRESSED_RGBA_ASTC_6x5_KHR;if(E===nx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:y.COMPRESSED_RGBA_ASTC_6x6_KHR;if(E===rx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:y.COMPRESSED_RGBA_ASTC_8x5_KHR;if(E===sx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:y.COMPRESSED_RGBA_ASTC_8x6_KHR;if(E===ax)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:y.COMPRESSED_RGBA_ASTC_8x8_KHR;if(E===ox)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:y.COMPRESSED_RGBA_ASTC_10x5_KHR;if(E===lx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:y.COMPRESSED_RGBA_ASTC_10x6_KHR;if(E===hx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:y.COMPRESSED_RGBA_ASTC_10x8_KHR;if(E===ux)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:y.COMPRESSED_RGBA_ASTC_10x10_KHR;if(E===fx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:y.COMPRESSED_RGBA_ASTC_12x10_KHR;if(E===cx)return e===mn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:y.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(E===hm||E===dx||E===px)if(y=t.get("EXT_texture_compression_bptc"),y!==null){if(E===hm)return e===mn?y.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:y.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(E===dx)return y.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(E===px)return y.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(E===e2||E===vx||E===mx||E===gx)if(y=t.get("EXT_texture_compression_rgtc"),y!==null){if(E===hm)return y.COMPRESSED_RED_RGTC1_EXT;if(E===vx)return y.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(E===mx)return y.COMPRESSED_RED_GREEN_RGTC2_EXT;if(E===gx)return y.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return E===dh?x?g.UNSIGNED_INT_24_8:(y=t.get("WEBGL_depth_texture"),y!==null?y.UNSIGNED_INT_24_8_WEBGL:null):g[E]!==void 0?g[E]:null}return{convert:T}}class L2 extends Dr{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Xf extends ki{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Q6={type:"move"};class j0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Xf,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Xf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ct,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ct),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Xf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ct,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ct),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const x of t.hand.values())this._getHandJoint(i,x)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,x){let T=null,E=null,s=null;const y=this._targetRay,e=this._grip,r=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(r&&t.hand){s=!0;for(const u of t.hand.values()){const f=i.getJointPose(u,x),o=this._getHandJoint(r,u);f!==null&&(o.matrix.fromArray(f.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,o.jointRadius=f.radius),o.visible=f!==null}const p=r.joints["index-finger-tip"],h=r.joints["thumb-tip"],a=p.position.distanceTo(h.position),l=.02,n=.005;r.inputState.pinching&&a>l+n?(r.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!r.inputState.pinching&&a<=l-n&&(r.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else e!==null&&t.gripSpace&&(E=i.getPose(t.gripSpace,x),E!==null&&(e.matrix.fromArray(E.transform.matrix),e.matrix.decompose(e.position,e.rotation,e.scale),e.matrixWorldNeedsUpdate=!0,E.linearVelocity?(e.hasLinearVelocity=!0,e.linearVelocity.copy(E.linearVelocity)):e.hasLinearVelocity=!1,E.angularVelocity?(e.hasAngularVelocity=!0,e.angularVelocity.copy(E.angularVelocity)):e.hasAngularVelocity=!1));y!==null&&(T=i.getPose(t.targetRaySpace,x),T===null&&E!==null&&(T=E),T!==null&&(y.matrix.fromArray(T.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,T.linearVelocity?(y.hasLinearVelocity=!0,y.linearVelocity.copy(T.linearVelocity)):y.hasLinearVelocity=!1,T.angularVelocity?(y.hasAngularVelocity=!0,y.angularVelocity.copy(T.angularVelocity)):y.hasAngularVelocity=!1,this.dispatchEvent(Q6)))}return y!==null&&(y.visible=T!==null),e!==null&&(e.visible=E!==null),r!==null&&(r.visible=s!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const x=new Xf;x.matrixAutoUpdate=!1,x.visible=!1,t.joints[i.jointName]=x,t.add(x)}return t.joints[i.jointName]}}const _6=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,q6=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class tU{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i,x){if(this.texture===null){const T=new zn,E=t.properties.get(T);E.__webglTexture=i.texture,(i.depthNear!=x.depthNear||i.depthFar!=x.depthFar)&&(this.depthNear=i.depthNear,this.depthFar=i.depthFar),this.texture=T}}render(t,i){if(this.texture!==null){if(this.mesh===null){const x=i.cameras[0].viewport,T=new so({extensions:{fragDepth:!0},vertexShader:_6,fragmentShader:q6,uniforms:{depthColor:{value:this.texture},depthWidth:{value:x.z},depthHeight:{value:x.w}}});this.mesh=new dr(new lc(20,20),T)}t.render(this.mesh,i)}}reset(){this.texture=null,this.mesh=null}}class eU extends bl{constructor(t,i){super();const x=this;let T=null,E=1,s=null,y="local-floor",e=1,r=null,p=null,h=null,a=null,l=null,n=null;const u=new tU,f=i.getContextAttributes();let o=null,c=null;const d=[],v=[],m=new ve;let S=null;const M=new Dr;M.layers.enable(1),M.viewport=new an;const w=new Dr;w.layers.enable(2),w.viewport=new an;const C=[M,w],A=new L2;A.layers.enable(1),A.layers.enable(2);let P=null,b=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let U=d[Z];return U===void 0&&(U=new j0,d[Z]=U),U.getTargetRaySpace()},this.getControllerGrip=function(Z){let U=d[Z];return U===void 0&&(U=new j0,d[Z]=U),U.getGripSpace()},this.getHand=function(Z){let U=d[Z];return U===void 0&&(U=new j0,d[Z]=U),U.getHandSpace()};function O(Z){const U=v.indexOf(Z.inputSource);if(U===-1)return;const H=d[U];H!==void 0&&(H.update(Z.inputSource,Z.frame,r||s),H.dispatchEvent({type:Z.type,data:Z.inputSource}))}function I(){T.removeEventListener("select",O),T.removeEventListener("selectstart",O),T.removeEventListener("selectend",O),T.removeEventListener("squeeze",O),T.removeEventListener("squeezestart",O),T.removeEventListener("squeezeend",O),T.removeEventListener("end",I),T.removeEventListener("inputsourceschange",D);for(let Z=0;Z=0&&(v[J]=null,d[J].disconnect(H))}for(let U=0;U=v.length){v.push(H),J=q;break}else if(v[q]===null){v[q]=H,J=q;break}if(J===-1)break}const _=d[J];_&&_.connect(H)}}const B=new Ct,G=new Ct;function z(Z,U,H){B.setFromMatrixPosition(U.matrixWorld),G.setFromMatrixPosition(H.matrixWorld);const J=B.distanceTo(G),_=U.projectionMatrix.elements,q=H.projectionMatrix.elements,at=_[14]/(_[10]-1),ot=_[14]/(_[10]+1),rt=(_[9]+1)/_[5],gt=(_[9]-1)/_[5],yt=(_[8]-1)/_[0],Et=(q[8]+1)/q[0],At=at*yt,Pt=at*Et,Vt=J/(-yt+Et),dt=Vt*-yt;U.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(dt),Z.translateZ(Vt),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const ut=at+Vt,Rt=ot+Vt,Dt=At-dt,Ht=Pt+(J-dt),Bt=rt*ot/Rt*ut,re=gt*ot/Rt*ut;Z.projectionMatrix.makePerspective(Dt,Ht,Bt,re,ut,Rt),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function X(Z,U){U===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(U.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(T===null)return;u.texture!==null&&(Z.near=u.depthNear,Z.far=u.depthFar),A.near=w.near=M.near=Z.near,A.far=w.far=M.far=Z.far,(P!==A.near||b!==A.far)&&(T.updateRenderState({depthNear:A.near,depthFar:A.far}),P=A.near,b=A.far,M.near=P,M.far=b,w.near=P,w.far=b,M.updateProjectionMatrix(),w.updateProjectionMatrix(),Z.updateProjectionMatrix());const U=Z.parent,H=A.cameras;X(A,U);for(let J=0;J0&&(f.alphaTest.value=o.alphaTest);const c=t.get(o).envMap;if(c&&(f.envMap.value=c,f.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1,f.reflectivity.value=o.reflectivity,f.ior.value=o.ior,f.refractionRatio.value=o.refractionRatio),o.lightMap){f.lightMap.value=o.lightMap;const d=g._useLegacyLights===!0?Math.PI:1;f.lightMapIntensity.value=o.lightMapIntensity*d,i(o.lightMap,f.lightMapTransform)}o.aoMap&&(f.aoMap.value=o.aoMap,f.aoMapIntensity.value=o.aoMapIntensity,i(o.aoMap,f.aoMapTransform))}function s(f,o){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,o.map&&(f.map.value=o.map,i(o.map,f.mapTransform))}function y(f,o){f.dashSize.value=o.dashSize,f.totalSize.value=o.dashSize+o.gapSize,f.scale.value=o.scale}function e(f,o,c,d){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,f.size.value=o.size*c,f.scale.value=d*.5,o.map&&(f.map.value=o.map,i(o.map,f.uvTransform)),o.alphaMap&&(f.alphaMap.value=o.alphaMap,i(o.alphaMap,f.alphaMapTransform)),o.alphaTest>0&&(f.alphaTest.value=o.alphaTest)}function r(f,o){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,f.rotation.value=o.rotation,o.map&&(f.map.value=o.map,i(o.map,f.mapTransform)),o.alphaMap&&(f.alphaMap.value=o.alphaMap,i(o.alphaMap,f.alphaMapTransform)),o.alphaTest>0&&(f.alphaTest.value=o.alphaTest)}function p(f,o){f.specular.value.copy(o.specular),f.shininess.value=Math.max(o.shininess,1e-4)}function h(f,o){o.gradientMap&&(f.gradientMap.value=o.gradientMap)}function a(f,o){f.metalness.value=o.metalness,o.metalnessMap&&(f.metalnessMap.value=o.metalnessMap,i(o.metalnessMap,f.metalnessMapTransform)),f.roughness.value=o.roughness,o.roughnessMap&&(f.roughnessMap.value=o.roughnessMap,i(o.roughnessMap,f.roughnessMapTransform)),t.get(o).envMap&&(f.envMapIntensity.value=o.envMapIntensity)}function l(f,o,c){f.ior.value=o.ior,o.sheen>0&&(f.sheenColor.value.copy(o.sheenColor).multiplyScalar(o.sheen),f.sheenRoughness.value=o.sheenRoughness,o.sheenColorMap&&(f.sheenColorMap.value=o.sheenColorMap,i(o.sheenColorMap,f.sheenColorMapTransform)),o.sheenRoughnessMap&&(f.sheenRoughnessMap.value=o.sheenRoughnessMap,i(o.sheenRoughnessMap,f.sheenRoughnessMapTransform))),o.clearcoat>0&&(f.clearcoat.value=o.clearcoat,f.clearcoatRoughness.value=o.clearcoatRoughness,o.clearcoatMap&&(f.clearcoatMap.value=o.clearcoatMap,i(o.clearcoatMap,f.clearcoatMapTransform)),o.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=o.clearcoatRoughnessMap,i(o.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),o.clearcoatNormalMap&&(f.clearcoatNormalMap.value=o.clearcoatNormalMap,i(o.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(o.clearcoatNormalScale),o.side===gs&&f.clearcoatNormalScale.value.negate())),o.iridescence>0&&(f.iridescence.value=o.iridescence,f.iridescenceIOR.value=o.iridescenceIOR,f.iridescenceThicknessMinimum.value=o.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=o.iridescenceThicknessRange[1],o.iridescenceMap&&(f.iridescenceMap.value=o.iridescenceMap,i(o.iridescenceMap,f.iridescenceMapTransform)),o.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=o.iridescenceThicknessMap,i(o.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),o.transmission>0&&(f.transmission.value=o.transmission,f.transmissionSamplerMap.value=c.texture,f.transmissionSamplerSize.value.set(c.width,c.height),o.transmissionMap&&(f.transmissionMap.value=o.transmissionMap,i(o.transmissionMap,f.transmissionMapTransform)),f.thickness.value=o.thickness,o.thicknessMap&&(f.thicknessMap.value=o.thicknessMap,i(o.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=o.attenuationDistance,f.attenuationColor.value.copy(o.attenuationColor)),o.anisotropy>0&&(f.anisotropyVector.value.set(o.anisotropy*Math.cos(o.anisotropyRotation),o.anisotropy*Math.sin(o.anisotropyRotation)),o.anisotropyMap&&(f.anisotropyMap.value=o.anisotropyMap,i(o.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=o.specularIntensity,f.specularColor.value.copy(o.specularColor),o.specularColorMap&&(f.specularColorMap.value=o.specularColorMap,i(o.specularColorMap,f.specularColorMapTransform)),o.specularIntensityMap&&(f.specularIntensityMap.value=o.specularIntensityMap,i(o.specularIntensityMap,f.specularIntensityMapTransform))}function n(f,o){o.matcap&&(f.matcap.value=o.matcap)}function u(f,o){const c=t.get(o).light;f.referencePosition.value.setFromMatrixPosition(c.matrixWorld),f.nearDistance.value=c.shadow.camera.near,f.farDistance.value=c.shadow.camera.far}return{refreshFogUniforms:x,refreshMaterialUniforms:T}}function nU(g,t,i,x){let T={},E={},s=[];const y=i.isWebGL2?g.getParameter(g.MAX_UNIFORM_BUFFER_BINDINGS):0;function e(c,d){const v=d.program;x.uniformBlockBinding(c,v)}function r(c,d){let v=T[c.id];v===void 0&&(n(c),v=p(c),T[c.id]=v,c.addEventListener("dispose",f));const m=d.program;x.updateUBOMapping(c,m);const S=t.render.frame;E[c.id]!==S&&(a(c),E[c.id]=S)}function p(c){const d=h();c.__bindingPointIndex=d;const v=g.createBuffer(),m=c.__size,S=c.usage;return g.bindBuffer(g.UNIFORM_BUFFER,v),g.bufferData(g.UNIFORM_BUFFER,m,S),g.bindBuffer(g.UNIFORM_BUFFER,null),g.bindBufferBase(g.UNIFORM_BUFFER,d,v),v}function h(){for(let c=0;c0&&(v+=m-S),c.__size=v,c.__cache={},this}function u(c){const d={boundary:0,storage:0};return typeof c=="number"||typeof c=="boolean"?(d.boundary=4,d.storage=4):c.isVector2?(d.boundary=8,d.storage=8):c.isVector3||c.isColor?(d.boundary=16,d.storage=12):c.isVector4?(d.boundary=16,d.storage=16):c.isMatrix3?(d.boundary=48,d.storage=48):c.isMatrix4?(d.boundary=64,d.storage=64):c.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",c),d}function f(c){const d=c.target;d.removeEventListener("dispose",f);const v=s.indexOf(d.__bindingPointIndex);s.splice(v,1),g.deleteBuffer(T[d.id]),delete T[d.id],delete E[d.id]}function o(){for(const c in T)g.deleteBuffer(T[c]);s=[],T={},E={}}return{bind:e,update:r,dispose:o}}class R1{constructor(t={}){const{canvas:i=m2(),context:x=null,depth:T=!0,stencil:E=!0,alpha:s=!1,antialias:y=!1,premultipliedAlpha:e=!0,preserveDrawingBuffer:r=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:h=!1}=t;this.isWebGLRenderer=!0;let a;x!==null?a=x.getContextAttributes().alpha:a=s;const l=new Uint32Array(4),n=new Int32Array(4);let u=null,f=null;const o=[],c=[];this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=mr,this._useLegacyLights=!1,this.toneMapping=zo,this.toneMappingExposure=1;const d=this;let v=!1,m=0,S=0,M=null,w=-1,C=null;const A=new an,P=new an;let b=null;const O=new ze(0);let I=0,D=i.width,B=i.height,G=1,z=null,X=null;const j=new an(0,0,D,B),Q=new an(0,0,D,B);let tt=!1;const Y=new ip;let Z=!1,U=!1,H=null;const J=new di,_=new ve,q=new Ct,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return M===null?G:1}let rt=x;function gt(Tt,Zt){for(let qt=0;qt{function Te(){if(ie.forEach(function(Ue){Vt.get(Ue).currentProgram.isReady()&&ie.delete(Ue)}),ie.size===0){ee(Tt);return}setTimeout(Te,10)}yt.get("KHR_parallel_shader_compile")!==null?Te():setTimeout(Te,10)})};let Ii=null;function nn(Tt){Ii&&Ii(Tt)}function Jn(){pi.stop()}function Vi(){pi.start()}const pi=new M2;pi.setAnimationLoop(nn),typeof self<"u"&&pi.setContext(self),this.setAnimationLoop=function(Tt){Ii=Tt,he.setAnimationLoop(Tt),Tt===null?pi.stop():pi.start()},he.addEventListener("sessionstart",Jn),he.addEventListener("sessionend",Vi),this.render=function(Tt,Zt){if(Zt!==void 0&&Zt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(v===!0)return;Tt.matrixWorldAutoUpdate===!0&&Tt.updateMatrixWorld(),Zt.parent===null&&Zt.matrixWorldAutoUpdate===!0&&Zt.updateMatrixWorld(),he.enabled===!0&&he.isPresenting===!0&&(he.cameraAutoUpdate===!0&&he.updateCamera(Zt),Zt=he.getCamera()),Tt.isScene===!0&&Tt.onBeforeRender(d,Tt,Zt,M),f=xe.get(Tt,c.length),f.init(),c.push(f),J.multiplyMatrices(Zt.projectionMatrix,Zt.matrixWorldInverse),Y.setFromProjectionMatrix(J),U=this.localClippingEnabled,Z=Pe.init(this.clippingPlanes,U),u=ge.get(Tt,o.length),u.init(),o.push(u),Xi(Tt,Zt,0,d.sortObjects),u.finish(),d.sortObjects===!0&&u.sort(z,X),this.info.render.frame++,Z===!0&&Pe.beginShadows();const qt=f.state.shadowsArray;if(te.render(qt,Tt,Zt),Z===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(he.enabled===!1||he.isPresenting===!1||he.hasDepthSensing()===!1)&&Ge.render(u,Tt),f.setupLights(d._useLegacyLights),Zt.isArrayCamera){const ie=Zt.cameras;for(let ee=0,Te=ie.length;ee0?f=c[c.length-1]:f=null,o.pop(),o.length>0?u=o[o.length-1]:u=null};function Xi(Tt,Zt,qt,ie){if(Tt.visible===!1)return;if(Tt.layers.test(Zt.layers)){if(Tt.isGroup)qt=Tt.renderOrder;else if(Tt.isLOD)Tt.autoUpdate===!0&&Tt.update(Zt);else if(Tt.isLight)f.pushLight(Tt),Tt.castShadow&&f.pushShadow(Tt);else if(Tt.isSprite){if(!Tt.frustumCulled||Y.intersectsSprite(Tt)){ie&&q.setFromMatrixPosition(Tt.matrixWorld).applyMatrix4(J);const Ue=Bt.update(Tt),We=Tt.material;We.visible&&u.push(Tt,Ue,We,qt,q.z,null)}}else if((Tt.isMesh||Tt.isLine||Tt.isPoints)&&(!Tt.frustumCulled||Y.intersectsObject(Tt))){const Ue=Bt.update(Tt),We=Tt.material;if(ie&&(Tt.boundingSphere!==void 0?(Tt.boundingSphere===null&&Tt.computeBoundingSphere(),q.copy(Tt.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),q.copy(Ue.boundingSphere.center)),q.applyMatrix4(Tt.matrixWorld).applyMatrix4(J)),Array.isArray(We)){const $e=Ue.groups;for(let ti=0,ni=$e.length;ti0&&oa(ee,Te,Zt,qt),ie&&At.viewport(A.copy(ie)),ee.length>0&&Us(ee,Zt,qt),Te.length>0&&Us(Te,Zt,qt),Ue.length>0&&Us(Ue,Zt,qt),At.buffers.depth.setTest(!0),At.buffers.depth.setMask(!0),At.buffers.color.setMask(!0),At.setPolygonOffset(!1)}function oa(Tt,Zt,qt,ie){if((qt.isScene===!0?qt.overrideMaterial:null)!==null)return;const Te=Et.isWebGL2;H===null&&(H=new ro(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")?qf:Go,minFilter:Bo,samples:Te?4:0})),d.getDrawingBufferSize(_),Te?H.setSize(_.x,_.y):H.setSize(Am(_.x),Am(_.y));const Ue=d.getRenderTarget();d.setRenderTarget(H),d.getClearColor(O),I=d.getClearAlpha(),I<1&&d.setClearColor(16777215,.5),d.clear();const We=d.toneMapping;d.toneMapping=zo,Us(Tt,qt,ie),dt.updateMultisampleRenderTarget(H),dt.updateRenderTargetMipmap(H);let $e=!1;for(let ti=0,ni=Zt.length;ti0),oi=!!qt.morphAttributes.position,$i=!!qt.morphAttributes.normal,un=!!qt.morphAttributes.color;let ji=zo;ie.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(ji=d.toneMapping);const yn=qt.morphAttributes.position||qt.morphAttributes.normal||qt.morphAttributes.color,ei=yn!==void 0?yn.length:0,Se=Vt.get(ie),Br=f.state.lights;if(Z===!0&&(U===!0||Tt!==C)){const En=Tt===C&&ie.id===w;Pe.setState(ie,Tt,En)}let gi=!1;ie.version===Se.__version?(Se.needsLights&&Se.lightsStateVersion!==Br.state.version||Se.outputColorSpace!==We||ee.isBatchedMesh&&Se.batching===!1||!ee.isBatchedMesh&&Se.batching===!0||ee.isInstancedMesh&&Se.instancing===!1||!ee.isInstancedMesh&&Se.instancing===!0||ee.isSkinnedMesh&&Se.skinning===!1||!ee.isSkinnedMesh&&Se.skinning===!0||ee.isInstancedMesh&&Se.instancingColor===!0&&ee.instanceColor===null||ee.isInstancedMesh&&Se.instancingColor===!1&&ee.instanceColor!==null||Se.envMap!==$e||ie.fog===!0&&Se.fog!==Te||Se.numClippingPlanes!==void 0&&(Se.numClippingPlanes!==Pe.numPlanes||Se.numIntersection!==Pe.numIntersection)||Se.vertexAlphas!==ti||Se.vertexTangents!==ni||Se.morphTargets!==oi||Se.morphNormals!==$i||Se.morphColors!==un||Se.toneMapping!==ji||Et.isWebGL2===!0&&Se.morphTargetsCount!==ei)&&(gi=!0):(gi=!0,Se.__version=ie.version);let fn=Se.currentProgram;gi===!0&&(fn=lo(ie,Zt,ee));let Ni=!1,Vn=!1,vn=!1;const Ki=fn.getUniforms(),pr=Se.uniforms;if(At.useProgram(fn.program)&&(Ni=!0,Vn=!0,vn=!0),ie.id!==w&&(w=ie.id,Vn=!0),Ni||C!==Tt){Ki.setValue(rt,"projectionMatrix",Tt.projectionMatrix),Ki.setValue(rt,"viewMatrix",Tt.matrixWorldInverse);const En=Ki.map.cameraPosition;En!==void 0&&En.setValue(rt,q.setFromMatrixPosition(Tt.matrixWorld)),Et.logarithmicDepthBuffer&&Ki.setValue(rt,"logDepthBufFC",2/(Math.log(Tt.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Ki.setValue(rt,"isOrthographic",Tt.isOrthographicCamera===!0),C!==Tt&&(C=Tt,Vn=!0,vn=!0)}if(ee.isSkinnedMesh){Ki.setOptional(rt,ee,"bindMatrix"),Ki.setOptional(rt,ee,"bindMatrixInverse");const En=ee.skeleton;En&&(Et.floatVertexTextures?(En.boneTexture===null&&En.computeBoneTexture(),Ki.setValue(rt,"boneTexture",En.boneTexture,dt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ee.isBatchedMesh&&(Ki.setOptional(rt,ee,"batchingTexture"),Ki.setValue(rt,"batchingTexture",ee._matricesTexture,dt));const Gs=qt.morphAttributes;if((Gs.position!==void 0||Gs.normal!==void 0||Gs.color!==void 0&&Et.isWebGL2===!0)&&Oe.update(ee,qt,fn),(Vn||Se.receiveShadow!==ee.receiveShadow)&&(Se.receiveShadow=ee.receiveShadow,Ki.setValue(rt,"receiveShadow",ee.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(pr.envMap.value=$e,pr.flipEnvMap.value=$e.isCubeTexture&&$e.isRenderTargetTexture===!1?-1:1),Vn&&(Ki.setValue(rt,"toneMappingExposure",d.toneMappingExposure),Se.needsLights&&ho(pr,vn),Te&&ie.fog===!0&&le.refreshFogUniforms(pr,Te),le.refreshMaterialUniforms(pr,ie,G,B,H),cm.upload(rt,qr(Se),pr,dt)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(cm.upload(rt,qr(Se),pr,dt),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Ki.setValue(rt,"center",ee.center),Ki.setValue(rt,"modelViewMatrix",ee.modelViewMatrix),Ki.setValue(rt,"normalMatrix",ee.normalMatrix),Ki.setValue(rt,"modelMatrix",ee.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const En=ie.uniformsGroups;for(let la=0,$n=En.length;la<$n;la++)if(Et.isWebGL2){const ba=En[la];si.update(ba,fn),si.bind(ba,fn)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fn}function ho(Tt,Zt){Tt.ambientLightColor.needsUpdate=Zt,Tt.lightProbe.needsUpdate=Zt,Tt.directionalLights.needsUpdate=Zt,Tt.directionalLightShadows.needsUpdate=Zt,Tt.pointLights.needsUpdate=Zt,Tt.pointLightShadows.needsUpdate=Zt,Tt.spotLights.needsUpdate=Zt,Tt.spotLightShadows.needsUpdate=Zt,Tt.rectAreaLights.needsUpdate=Zt,Tt.hemisphereLights.needsUpdate=Zt}function Ll(Tt){return Tt.isMeshLambertMaterial||Tt.isMeshToonMaterial||Tt.isMeshPhongMaterial||Tt.isMeshStandardMaterial||Tt.isShadowMaterial||Tt.isShaderMaterial&&Tt.lights===!0}this.getActiveCubeFace=function(){return m},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(Tt,Zt,qt){Vt.get(Tt.texture).__webglTexture=Zt,Vt.get(Tt.depthTexture).__webglTexture=qt;const ie=Vt.get(Tt);ie.__hasExternalTextures=!0,ie.__hasExternalTextures&&(ie.__autoAllocateDepthBuffer=qt===void 0,ie.__autoAllocateDepthBuffer||yt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ie.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(Tt,Zt){const qt=Vt.get(Tt);qt.__webglFramebuffer=Zt,qt.__useDefaultFramebuffer=Zt===void 0},this.setRenderTarget=function(Tt,Zt=0,qt=0){M=Tt,m=Zt,S=qt;let ie=!0,ee=null,Te=!1,Ue=!1;if(Tt){const $e=Vt.get(Tt);$e.__useDefaultFramebuffer!==void 0?(At.bindFramebuffer(rt.FRAMEBUFFER,null),ie=!1):$e.__webglFramebuffer===void 0?dt.setupRenderTarget(Tt):$e.__hasExternalTextures&&dt.rebindTextures(Tt,Vt.get(Tt.texture).__webglTexture,Vt.get(Tt.depthTexture).__webglTexture);const ti=Tt.texture;(ti.isData3DTexture||ti.isDataArrayTexture||ti.isCompressedArrayTexture)&&(Ue=!0);const ni=Vt.get(Tt).__webglFramebuffer;Tt.isWebGLCubeRenderTarget?(Array.isArray(ni[Zt])?ee=ni[Zt][qt]:ee=ni[Zt],Te=!0):Et.isWebGL2&&Tt.samples>0&&dt.useMultisampledRTT(Tt)===!1?ee=Vt.get(Tt).__webglMultisampledFramebuffer:Array.isArray(ni)?ee=ni[qt]:ee=ni,A.copy(Tt.viewport),P.copy(Tt.scissor),b=Tt.scissorTest}else A.copy(j).multiplyScalar(G).floor(),P.copy(Q).multiplyScalar(G).floor(),b=tt;if(At.bindFramebuffer(rt.FRAMEBUFFER,ee)&&Et.drawBuffers&&ie&&At.drawBuffers(Tt,ee),At.viewport(A),At.scissor(P),At.setScissorTest(b),Te){const $e=Vt.get(Tt.texture);rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+Zt,$e.__webglTexture,qt)}else if(Ue){const $e=Vt.get(Tt.texture),ti=Zt||0;rt.framebufferTextureLayer(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,$e.__webglTexture,qt||0,ti)}w=-1},this.readRenderTargetPixels=function(Tt,Zt,qt,ie,ee,Te,Ue){if(!(Tt&&Tt.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Vt.get(Tt).__webglFramebuffer;if(Tt.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){At.bindFramebuffer(rt.FRAMEBUFFER,We);try{const $e=Tt.texture,ti=$e.format,ni=$e.type;if(ti!==vs&&ne.convert(ti)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const oi=ni===qf&&(yt.has("EXT_color_buffer_half_float")||Et.isWebGL2&&yt.has("EXT_color_buffer_float"));if(ni!==Go&&ne.convert(ni)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ni===Ma&&(Et.isWebGL2||yt.has("OES_texture_float")||yt.has("WEBGL_color_buffer_float")))&&!oi){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Zt>=0&&Zt<=Tt.width-ie&&qt>=0&&qt<=Tt.height-ee&&rt.readPixels(Zt,qt,ie,ee,ne.convert(ti),ne.convert(ni),Te)}finally{const $e=M!==null?Vt.get(M).__webglFramebuffer:null;At.bindFramebuffer(rt.FRAMEBUFFER,$e)}}},this.copyFramebufferToTexture=function(Tt,Zt,qt=0){const ie=Math.pow(2,-qt),ee=Math.floor(Zt.image.width*ie),Te=Math.floor(Zt.image.height*ie);dt.setTexture2D(Zt,0),rt.copyTexSubImage2D(rt.TEXTURE_2D,qt,0,0,Tt.x,Tt.y,ee,Te),At.unbindTexture()},this.copyTextureToTexture=function(Tt,Zt,qt,ie=0){const ee=Zt.image.width,Te=Zt.image.height,Ue=ne.convert(qt.format),We=ne.convert(qt.type);dt.setTexture2D(qt,0),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,qt.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,qt.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,qt.unpackAlignment),Zt.isDataTexture?rt.texSubImage2D(rt.TEXTURE_2D,ie,Tt.x,Tt.y,ee,Te,Ue,We,Zt.image.data):Zt.isCompressedTexture?rt.compressedTexSubImage2D(rt.TEXTURE_2D,ie,Tt.x,Tt.y,Zt.mipmaps[0].width,Zt.mipmaps[0].height,Ue,Zt.mipmaps[0].data):rt.texSubImage2D(rt.TEXTURE_2D,ie,Tt.x,Tt.y,Ue,We,Zt.image),ie===0&&qt.generateMipmaps&&rt.generateMipmap(rt.TEXTURE_2D),At.unbindTexture()},this.copyTextureToTexture3D=function(Tt,Zt,qt,ie,ee=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Te=Tt.max.x-Tt.min.x+1,Ue=Tt.max.y-Tt.min.y+1,We=Tt.max.z-Tt.min.z+1,$e=ne.convert(ie.format),ti=ne.convert(ie.type);let ni;if(ie.isData3DTexture)dt.setTexture3D(ie,0),ni=rt.TEXTURE_3D;else if(ie.isDataArrayTexture||ie.isCompressedArrayTexture)dt.setTexture2DArray(ie,0),ni=rt.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,ie.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,ie.unpackAlignment);const oi=rt.getParameter(rt.UNPACK_ROW_LENGTH),$i=rt.getParameter(rt.UNPACK_IMAGE_HEIGHT),un=rt.getParameter(rt.UNPACK_SKIP_PIXELS),ji=rt.getParameter(rt.UNPACK_SKIP_ROWS),yn=rt.getParameter(rt.UNPACK_SKIP_IMAGES),ei=qt.isCompressedTexture?qt.mipmaps[ee]:qt.image;rt.pixelStorei(rt.UNPACK_ROW_LENGTH,ei.width),rt.pixelStorei(rt.UNPACK_IMAGE_HEIGHT,ei.height),rt.pixelStorei(rt.UNPACK_SKIP_PIXELS,Tt.min.x),rt.pixelStorei(rt.UNPACK_SKIP_ROWS,Tt.min.y),rt.pixelStorei(rt.UNPACK_SKIP_IMAGES,Tt.min.z),qt.isDataTexture||qt.isData3DTexture?rt.texSubImage3D(ni,ee,Zt.x,Zt.y,Zt.z,Te,Ue,We,$e,ti,ei.data):qt.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),rt.compressedTexSubImage3D(ni,ee,Zt.x,Zt.y,Zt.z,Te,Ue,We,$e,ei.data)):rt.texSubImage3D(ni,ee,Zt.x,Zt.y,Zt.z,Te,Ue,We,$e,ti,ei),rt.pixelStorei(rt.UNPACK_ROW_LENGTH,oi),rt.pixelStorei(rt.UNPACK_IMAGE_HEIGHT,$i),rt.pixelStorei(rt.UNPACK_SKIP_PIXELS,un),rt.pixelStorei(rt.UNPACK_SKIP_ROWS,ji),rt.pixelStorei(rt.UNPACK_SKIP_IMAGES,yn),ee===0&&ie.generateMipmaps&&rt.generateMipmap(ni),At.unbindTexture()},this.initTexture=function(Tt){Tt.isCubeTexture?dt.setTextureCube(Tt,0):Tt.isData3DTexture?dt.setTexture3D(Tt,0):Tt.isDataArrayTexture||Tt.isCompressedArrayTexture?dt.setTexture2DArray(Tt,0):dt.setTexture2D(Tt,0),At.unbindTexture()},this.resetState=function(){m=0,S=0,M=null,At.reset(),je.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Uo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=t===cg?"display-p3":"srgb",i.unpackColorSpace=sn.workingColorSpace===qd?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===mr?vh:g1}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===vh?mr:Ho}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class F2 extends R1{}F2.prototype.isWebGL1Renderer=!0;class vg{constructor(t,i=25e-5){this.isFogExp2=!0,this.name="",this.color=new ze(t),this.density=i}clone(){return new vg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class mg{constructor(t,i=1,x=1e3){this.isFog=!0,this.name="",this.color=new ze(t),this.near=i,this.far=x}clone(){return new mg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Pm extends ki{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i}}class gg{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=Id,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=ra()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Eu("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,x){t*=this.stride,x*=i.stride;for(let T=0,E=this.stride;Tt.far||i.push({distance:e,point:Qc.clone(),uv:na.getInterpolation(Qc,Av,qc,Pv,vE,K0,mE,new ve),face:null,object:this})}copy(t,i){return super.copy(t,i),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Rv(g,t,i,x,T,E){bf.subVectors(g,i).addScalar(.5).multiply(x),T!==void 0?(_c.x=E*bf.x-T*bf.y,_c.y=T*bf.x+E*bf.y):_c.copy(bf),g.copy(t),g.x+=_c.x,g.y+=_c.y,g.applyMatrix4(O2)}const bv=new Ct,gE=new Ct;class I2 extends ki{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const i=t.levels;for(let x=0,T=i.length;x0){let x,T;for(x=1,T=i.length;x0){bv.setFromMatrixPosition(this.matrixWorld);const T=t.ray.origin.distanceTo(bv);this.getObjectForDistance(T).raycast(t,i)}}update(t){const i=this.levels;if(i.length>1){bv.setFromMatrixPosition(t.matrixWorld),gE.setFromMatrixPosition(this.matrixWorld);const x=bv.distanceTo(gE)/t.zoom;i[0].object.visible=!0;let T,E;for(T=1,E=i.length;T=s)i[T-1].object.visible=!1,i[T].object.visible=!0;else break}for(this._currentLevel=T-1;T=x.length&&x.push({start:-1,count:-1,z:-1});const E=x[this.index];T.push(E),this.index++,E.start=t.start,E.count=t.count,E.z=i}reset(){this.list.length=0,this.index=0}}const Ff="batchId",ah=new di,AE=new di,uU=new di,PE=new di,$0=new ip,Ov=new ys,iu=new Qr,id=new Ct,Q0=new hU,Zr=new dr,Dv=[];function fU(g,t,i=0){const x=t.itemSize;if(g.isInterleavedBufferAttribute||g.array.constructor!==t.array.constructor){const T=g.count;for(let E=0;E65536?new Uint32Array(E):new Uint16Array(E);i.setIndex(new on(y,1))}const s=T>65536?new Uint32Array(x):new Uint16Array(x);i.setAttribute(Ff,new on(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Ff))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Ff}"`);const i=this.geometry;if(!!t.getIndex()!=!!i.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const x in i.attributes){if(x===Ff)continue;if(!t.hasAttribute(x))throw new Error(`BatchedMesh: Added geometry missing "${x}". All geometries must have consistent attributes.`);const T=t.getAttribute(x),E=i.getAttribute(x);if(T.itemSize!==E.itemSize||T.normalized!==E.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ys);const t=this._geometryCount,i=this.boundingBox,x=this._active;i.makeEmpty();for(let T=0;T=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const T={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let E=null;const s=this._reservedRanges,y=this._drawRanges,e=this._bounds;this._geometryCount!==0&&(E=s[s.length-1]),i===-1?T.vertexCount=t.getAttribute("position").count:T.vertexCount=i,E===null?T.vertexStart=0:T.vertexStart=E.vertexStart+E.vertexCount;const r=t.getIndex(),p=r!==null;if(p&&(x===-1?T.indexCount=r.count:T.indexCount=x,E===null?T.indexStart=0:T.indexStart=E.indexStart+E.indexCount),T.indexStart!==-1&&T.indexStart+T.indexCount>this._maxIndexCount||T.vertexStart+T.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,a=this._active,l=this._matricesTexture,n=this._matricesTexture.image.data;h.push(!0),a.push(!0);const u=this._geometryCount;this._geometryCount++,uU.toArray(n,u*16),l.needsUpdate=!0,s.push(T),y.push({start:p?T.indexStart:T.vertexStart,count:-1}),e.push({boxInitialized:!1,box:new ys,sphereInitialized:!1,sphere:new Qr});const f=this.geometry.getAttribute(Ff);for(let o=0;o=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(i);const x=this.geometry,T=x.getIndex()!==null,E=x.getIndex(),s=i.getIndex(),y=this._reservedRanges[t];if(T&&s.count>y.indexCount||i.attributes.position.count>y.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const e=y.vertexStart,r=y.vertexCount;for(const l in x.attributes){if(l===Ff)continue;const n=i.getAttribute(l),u=x.getAttribute(l);fU(n,u,e);const f=n.itemSize;for(let o=n.count,c=r;o=i.length||i[t]===!1?this:(i[t]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(t,i){if(this._active[t]===!1)return null;const T=this._bounds[t],E=T.box,s=this.geometry;if(T.boxInitialized===!1){E.makeEmpty();const y=s.index,e=s.attributes.position,r=this._drawRanges[t];for(let p=r.start,h=r.start+r.count;p=s||x[t]===!1?this:(i.toArray(E,t*16),T.needsUpdate=!0,this)}getMatrixAt(t,i){const x=this._active,T=this._matricesTexture.image.data,E=this._geometryCount;return t>=E||x[t]===!1?null:i.fromArray(T,t*16)}setVisibleAt(t,i){const x=this._visibility,T=this._active,E=this._geometryCount;return t>=E||T[t]===!1||x[t]===i?this:(x[t]=i,this._visibilityChanged=!0,this)}getVisibleAt(t){const i=this._visibility,x=this._active,T=this._geometryCount;return t>=T||x[t]===!1?!1:i[t]}raycast(t,i){const x=this._visibility,T=this._active,E=this._drawRanges,s=this._geometryCount,y=this.matrixWorld,e=this.geometry;Zr.material=this.material,Zr.geometry.index=e.index,Zr.geometry.attributes=e.attributes,Zr.geometry.boundingBox===null&&(Zr.geometry.boundingBox=new ys),Zr.geometry.boundingSphere===null&&(Zr.geometry.boundingSphere=new Qr);for(let r=0;r({...i})),this._reservedRanges=t._reservedRanges.map(i=>({...i})),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map(i=>({boxInitialized:i.boxInitialized,box:i.box.clone(),sphereInitialized:i.sphereInitialized,sphere:i.sphere.clone()})),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,i,x,T,E){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=T.getIndex(),y=s===null?1:s.array.BYTES_PER_ELEMENT,e=this._active,r=this._visibility,p=this._multiDrawStarts,h=this._multiDrawCounts,a=this._drawRanges,l=this.perObjectFrustumCulled;l&&(PE.multiplyMatrices(x.projectionMatrix,x.matrixWorldInverse).multiply(this.matrixWorld),$0.setFromProjectionMatrix(PE,t.coordinateSystem));let n=0;if(this.sortObjects){AE.copy(this.matrixWorld).invert(),id.setFromMatrixPosition(x.matrixWorld).applyMatrix4(AE);for(let o=0,c=r.length;oe)continue;a.applyMatrix4(this.matrixWorld);const w=t.ray.origin.distanceTo(a);wt.far||i.push({distance:w,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}else{const o=Math.max(0,s.start),c=Math.min(f.count,s.start+s.count);for(let d=o,v=c-1;de)continue;a.applyMatrix4(this.matrixWorld);const S=t.ray.origin.distanceTo(a);St.far||i.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const i=this.geometry.morphAttributes,x=Object.keys(i);if(x.length>0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;E0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;ET.far)return;E.push({distance:r,distanceToRay:Math.sqrt(y),point:e,index:t,face:null,object:s})}}class cU extends zn{constructor(t,i,x,T,E,s,y,e,r){super(t,i,x,T,E,s,y,e,r),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Bn,this.magFilter=E!==void 0?E:Bn,this.generateMipmaps=!1;const p=this;function h(){p.needsUpdate=!0,t.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class dU extends zn{constructor(t,i){super({width:t,height:i}),this.isFramebufferTexture=!0,this.magFilter=rr,this.minFilter=rr,this.generateMipmaps=!1,this.needsUpdate=!0}}class xg extends zn{constructor(t,i,x,T,E,s,y,e,r,p,h,a){super(null,s,y,e,r,p,T,E,h,a),this.isCompressedTexture=!0,this.image={width:i,height:x},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class pU extends xg{constructor(t,i,x,T,E,s){super(t,i,x,E,s),this.isCompressedArrayTexture=!0,this.image.depth=T,this.wrapR=$r}}class vU extends xg{constructor(t,i,x){super(void 0,t[0].width,t[0].height,i,x,Pl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class mU extends zn{constructor(t,i,x,T,E,s,y,e,r){super(t,i,x,T,E,s,y,e,r),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ao{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,i){const x=this.getUtoTmapping(t);return this.getPoint(x,i)}getPoints(t=5){const i=[];for(let x=0;x<=t;x++)i.push(this.getPoint(x/t));return i}getSpacedPoints(t=5){const i=[];for(let x=0;x<=t;x++)i.push(this.getPointAt(x/t));return i}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const i=[];let x,T=this.getPoint(0),E=0;i.push(0);for(let s=1;s<=t;s++)x=this.getPoint(s/t),E+=x.distanceTo(T),i.push(E),T=x;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,i){const x=this.getLengths();let T=0;const E=x.length;let s;i?s=i:s=t*x[E-1];let y=0,e=E-1,r;for(;y<=e;)if(T=Math.floor(y+(e-y)/2),r=x[T]-s,r<0)y=T+1;else if(r>0)e=T-1;else{e=T;break}if(T=e,x[T]===s)return T/(E-1);const p=x[T],a=x[T+1]-p,l=(s-p)/a;return(T+l)/(E-1)}getTangent(t,i){let T=t-1e-4,E=t+1e-4;T<0&&(T=0),E>1&&(E=1);const s=this.getPoint(T),y=this.getPoint(E),e=i||(s.isVector2?new ve:new Ct);return e.copy(y).sub(s).normalize(),e}getTangentAt(t,i){const x=this.getUtoTmapping(t);return this.getTangent(x,i)}computeFrenetFrames(t,i){const x=new Ct,T=[],E=[],s=[],y=new Ct,e=new di;for(let l=0;l<=t;l++){const n=l/t;T[l]=this.getTangentAt(n,new Ct)}E[0]=new Ct,s[0]=new Ct;let r=Number.MAX_VALUE;const p=Math.abs(T[0].x),h=Math.abs(T[0].y),a=Math.abs(T[0].z);p<=r&&(r=p,x.set(1,0,0)),h<=r&&(r=h,x.set(0,1,0)),a<=r&&x.set(0,0,1),y.crossVectors(T[0],x).normalize(),E[0].crossVectors(T[0],y),s[0].crossVectors(T[0],E[0]);for(let l=1;l<=t;l++){if(E[l]=E[l-1].clone(),s[l]=s[l-1].clone(),y.crossVectors(T[l-1],T[l]),y.length()>Number.EPSILON){y.normalize();const n=Math.acos(Zn(T[l-1].dot(T[l]),-1,1));E[l].applyMatrix4(e.makeRotationAxis(y,n))}s[l].crossVectors(T[l],E[l])}if(i===!0){let l=Math.acos(Zn(E[0].dot(E[t]),-1,1));l/=t,T[0].dot(y.crossVectors(E[0],E[t]))>0&&(l=-l);for(let n=1;n<=t;n++)E[n].applyMatrix4(e.makeRotationAxis(T[n],l*n)),s[n].crossVectors(T[n],E[n])}return{tangents:T,normals:E,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Sg extends ao{constructor(t=0,i=0,x=1,T=1,E=0,s=Math.PI*2,y=!1,e=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=i,this.xRadius=x,this.yRadius=T,this.aStartAngle=E,this.aEndAngle=s,this.aClockwise=y,this.aRotation=e}getPoint(t,i){const x=i||new ve,T=Math.PI*2;let E=this.aEndAngle-this.aStartAngle;const s=Math.abs(E)T;)E-=T;E0?0:(Math.floor(Math.abs(y)/E)+1)*E:e===0&&y===E-1&&(y=E-2,e=1);let r,p;this.closed||y>0?r=T[(y-1)%E]:(Uv.subVectors(T[0],T[1]).add(T[0]),r=Uv);const h=T[y%E],a=T[(y+1)%E];if(this.closed||y+2T.length-2?T.length-1:s+1],h=T[s>T.length-3?T.length-1:s+2];return x.set(NE(y,e.x,r.x,p.x,h.x),NE(y,e.y,r.y,p.y,h.y)),x}copy(t){super.copy(t),this.points=[];for(let i=0,x=t.points.length;i=x){const s=T[E]-x,y=this.curves[E],e=y.getLength(),r=e===0?0:1-s/e;return y.getPointAt(r,i)}E++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let i=0;for(let x=0,T=this.curves.length;x1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let i=0,x=t.curves.length;i0){const h=r.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(r);const p=r.getPoint(1);return this.currentPoint.copy(p),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class rp extends Fi{constructor(t=[new ve(0,-.5),new ve(.5,0),new ve(0,.5)],i=12,x=0,T=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:i,phiStart:x,phiLength:T},i=Math.floor(i),T=Zn(T,0,Math.PI*2);const E=[],s=[],y=[],e=[],r=[],p=1/i,h=new Ct,a=new ve,l=new Ct,n=new Ct,u=new Ct;let f=0,o=0;for(let c=0;c<=t.length-1;c++)switch(c){case 0:f=t[c+1].x-t[c].x,o=t[c+1].y-t[c].y,l.x=o*1,l.y=-f,l.z=o*0,u.copy(l),l.normalize(),e.push(l.x,l.y,l.z);break;case t.length-1:e.push(u.x,u.y,u.z);break;default:f=t[c+1].x-t[c].x,o=t[c+1].y-t[c].y,l.x=o*1,l.y=-f,l.z=o*0,n.copy(l),l.x+=u.x,l.y+=u.y,l.z+=u.z,l.normalize(),e.push(l.x,l.y,l.z),u.copy(n)}for(let c=0;c<=i;c++){const d=x+c*p*T,v=Math.sin(d),m=Math.cos(d);for(let S=0;S<=t.length-1;S++){h.x=t[S].x*v,h.y=t[S].y,h.z=t[S].x*m,s.push(h.x,h.y,h.z),a.x=c/i,a.y=S/(t.length-1),y.push(a.x,a.y);const M=e[3*S+0]*v,w=e[3*S+1],C=e[3*S+0]*m;r.push(M,w,C)}}for(let c=0;c0&&d(!0),i>0&&d(!1)),this.setIndex(p),this.setAttribute("position",new ke(h,3)),this.setAttribute("normal",new ke(a,3)),this.setAttribute("uv",new ke(l,2));function c(){const v=new Ct,m=new Ct;let S=0;const M=(i-t)/x;for(let w=0;w<=E;w++){const C=[],A=w/E,P=A*(i-t)+t;for(let b=0;b<=T;b++){const O=b/T,I=O*e+y,D=Math.sin(I),B=Math.cos(I);m.x=P*D,m.y=-A*x+f,m.z=P*B,h.push(m.x,m.y,m.z),v.set(D,M,B).normalize(),a.push(v.x,v.y,v.z),l.push(O,1-A),C.push(n++)}u.push(C)}for(let w=0;w.9&&M<.1&&(d<.2&&(s[c+0]+=1),v<.2&&(s[c+2]+=1),m<.2&&(s[c+4]+=1))}}function a(c){E.push(c.x,c.y,c.z)}function l(c,d){const v=c*3;d.x=t[v+0],d.y=t[v+1],d.z=t[v+2]}function n(){const c=new Ct,d=new Ct,v=new Ct,m=new Ct,S=new ve,M=new ve,w=new ve;for(let C=0,A=0;C80*i){y=r=g[0],e=p=g[1];for(let n=i;nr&&(r=h),a>p&&(p=a);l=Math.max(r-y,p-e),l=l!==0?32767/l:0}return zd(E,s,i,y,e,l,0),s}};function j2(g,t,i,x,T){let E,s;if(T===VU(g,t,i,x)>0)for(E=t;E=t;E-=x)s=BE(E,g[E],g[E+1],s);return s&&wg(s,s.next)&&(Vd(s),s=s.next),s}function Fu(g,t){if(!g)return g;t||(t=g);let i=g,x;do if(x=!1,!i.steiner&&(wg(i,i.next)||Un(i.prev,i,i.next)===0)){if(Vd(i),i=t=i.prev,i===i.next)break;x=!0}else i=i.next;while(x||i!==t);return t}function zd(g,t,i,x,T,E,s){if(!g)return;!s&&E&&IU(g,x,T,E);let y=g,e,r;for(;g.prev!==g.next;){if(e=g.prev,r=g.next,E?AU(g,x,T,E):wU(g)){t.push(e.i/i|0),t.push(g.i/i|0),t.push(r.i/i|0),Vd(g),g=r.next,y=r.next;continue}if(g=r,g===y){s?s===1?(g=PU(Fu(g),t,i),zd(g,t,i,x,T,E,2)):s===2&&RU(g,t,i,x,T,E):zd(Fu(g),t,i,x,T,E,1);break}}}function wU(g){const t=g.prev,i=g,x=g.next;if(Un(t,i,x)>=0)return!1;const T=t.x,E=i.x,s=x.x,y=t.y,e=i.y,r=x.y,p=TE?T>s?T:s:E>s?E:s,l=y>e?y>r?y:r:e>r?e:r;let n=x.next;for(;n!==t;){if(n.x>=p&&n.x<=a&&n.y>=h&&n.y<=l&&Yf(T,y,E,e,s,r,n.x,n.y)&&Un(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function AU(g,t,i,x){const T=g.prev,E=g,s=g.next;if(Un(T,E,s)>=0)return!1;const y=T.x,e=E.x,r=s.x,p=T.y,h=E.y,a=s.y,l=ye?y>r?y:r:e>r?e:r,f=p>h?p>a?p:a:h>a?h:a,o=Cx(l,n,t,i,x),c=Cx(u,f,t,i,x);let d=g.prevZ,v=g.nextZ;for(;d&&d.z>=o&&v&&v.z<=c;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==s&&Yf(y,p,e,h,r,a,d.x,d.y)&&Un(d.prev,d,d.next)>=0||(d=d.prevZ,v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==s&&Yf(y,p,e,h,r,a,v.x,v.y)&&Un(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;d&&d.z>=o;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==s&&Yf(y,p,e,h,r,a,d.x,d.y)&&Un(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;v&&v.z<=c;){if(v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==s&&Yf(y,p,e,h,r,a,v.x,v.y)&&Un(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function PU(g,t,i){let x=g;do{const T=x.prev,E=x.next.next;!wg(T,E)&&K2(T,x,x.next,E)&&Gd(T,E)&&Gd(E,T)&&(t.push(T.i/i|0),t.push(x.i/i|0),t.push(E.i/i|0),Vd(x),Vd(x.next),x=g=E),x=x.next}while(x!==g);return Fu(x)}function RU(g,t,i,x,T,E){let s=g;do{let y=s.next.next;for(;y!==s.prev;){if(s.i!==y.i&&UU(s,y)){let e=Z2(s,y);s=Fu(s,s.next),e=Fu(e,e.next),zd(s,t,i,x,T,E,0),zd(e,t,i,x,T,E,0);return}y=y.next}s=s.next}while(s!==g)}function bU(g,t,i,x){const T=[];let E,s,y,e,r;for(E=0,s=t.length;E=i.next.y&&i.next.y!==i.y){const a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=E&&a>x&&(x=a,T=i.x=i.x&&i.x>=e&&E!==i.x&&Yf(sT.x||i.x===T.x&&DU(T,i)))&&(T=i,p=h)),i=i.next;while(i!==y);return T}function DU(g,t){return Un(g.prev,g,t.prev)<0&&Un(t.next,g,g.next)<0}function IU(g,t,i,x){let T=g;do T.z===0&&(T.z=Cx(T.x,T.y,t,i,x)),T.prevZ=T.prev,T.nextZ=T.next,T=T.next;while(T!==g);T.prevZ.nextZ=null,T.prevZ=null,NU(T)}function NU(g){let t,i,x,T,E,s,y,e,r=1;do{for(i=g,g=null,E=null,s=0;i;){for(s++,x=i,y=0,t=0;t0||e>0&&x;)y!==0&&(e===0||!x||i.z<=x.z)?(T=i,i=i.nextZ,y--):(T=x,x=x.nextZ,e--),E?E.nextZ=T:g=T,T.prevZ=E,E=T;i=x}E.nextZ=null,r*=2}while(s>1);return g}function Cx(g,t,i,x,T){return g=(g-i)*T|0,t=(t-x)*T|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,g|t<<1}function BU(g){let t=g,i=g;do(t.x=(g-s)*(E-y)&&(g-s)*(x-y)>=(i-s)*(t-y)&&(i-s)*(E-y)>=(T-s)*(x-y)}function UU(g,t){return g.next.i!==t.i&&g.prev.i!==t.i&&!zU(g,t)&&(Gd(g,t)&&Gd(t,g)&&GU(g,t)&&(Un(g.prev,g,t.prev)||Un(g,t.prev,t))||wg(g,t)&&Un(g.prev,g,g.next)>0&&Un(t.prev,t,t.next)>0)}function Un(g,t,i){return(t.y-g.y)*(i.x-t.x)-(t.x-g.x)*(i.y-t.y)}function wg(g,t){return g.x===t.x&&g.y===t.y}function K2(g,t,i,x){const T=Wv(Un(g,t,i)),E=Wv(Un(g,t,x)),s=Wv(Un(i,x,g)),y=Wv(Un(i,x,t));return!!(T!==E&&s!==y||T===0&&Hv(g,i,t)||E===0&&Hv(g,x,t)||s===0&&Hv(i,g,x)||y===0&&Hv(i,t,x))}function Hv(g,t,i){return t.x<=Math.max(g.x,i.x)&&t.x>=Math.min(g.x,i.x)&&t.y<=Math.max(g.y,i.y)&&t.y>=Math.min(g.y,i.y)}function Wv(g){return g>0?1:g<0?-1:0}function zU(g,t){let i=g;do{if(i.i!==g.i&&i.next.i!==g.i&&i.i!==t.i&&i.next.i!==t.i&&K2(i,i.next,g,t))return!0;i=i.next}while(i!==g);return!1}function Gd(g,t){return Un(g.prev,g,g.next)<0?Un(g,t,g.next)>=0&&Un(g,g.prev,t)>=0:Un(g,t,g.prev)<0||Un(g,g.next,t)<0}function GU(g,t){let i=g,x=!1;const T=(g.x+t.x)/2,E=(g.y+t.y)/2;do i.y>E!=i.next.y>E&&i.next.y!==i.y&&T<(i.next.x-i.x)*(E-i.y)/(i.next.y-i.y)+i.x&&(x=!x),i=i.next;while(i!==g);return x}function Z2(g,t){const i=new wx(g.i,g.x,g.y),x=new wx(t.i,t.x,t.y),T=g.next,E=t.prev;return g.next=t,t.prev=g,i.next=T,T.prev=i,x.next=i,i.prev=x,E.next=x,x.prev=E,x}function BE(g,t,i,x){const T=new wx(g,t,i);return x?(T.next=x.next,T.prev=x,x.next.prev=T,x.next=T):(T.prev=T,T.next=T),T}function Vd(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 wx(g,t,i){this.i=g,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function VU(g,t,i,x){let T=0;for(let E=t,s=i-x;E2&&g[t-1].equals(g[0])&&g.pop()}function zE(g,t){for(let i=0;iNumber.EPSILON){const Bt=Math.sqrt(Dt),re=Math.sqrt(ut*ut+Rt*Rt),le=gt.x-dt/Bt,ge=gt.y+Vt/Bt,xe=yt.x-Rt/re,Pe=yt.y+ut/re,te=((xe-le)*Rt-(Pe-ge)*ut)/(Vt*Rt-dt*ut);Et=le+Vt*te-rt.x,At=ge+dt*te-rt.y;const Ge=Et*Et+At*At;if(Ge<=2)return new ve(Et,At);Pt=Math.sqrt(Ge/2)}else{let Bt=!1;Vt>Number.EPSILON?ut>Number.EPSILON&&(Bt=!0):Vt<-Number.EPSILON?ut<-Number.EPSILON&&(Bt=!0):Math.sign(dt)===Math.sign(Rt)&&(Bt=!0),Bt?(Et=-dt,At=Vt,Pt=Math.sqrt(Dt)):(Et=Vt,At=dt,Pt=Math.sqrt(Dt/2))}return new ve(Et/Pt,At/Pt)}const X=[];for(let rt=0,gt=I.length,yt=gt-1,Et=rt+1;rt=0;rt--){const gt=rt/f,yt=l*Math.cos(gt*Math.PI/2),Et=n*Math.sin(gt*Math.PI/2)+u;for(let At=0,Pt=I.length;At=0;){const Et=yt;let At=yt-1;At<0&&(At=rt.length-1);for(let Pt=0,Vt=p+f*2;Pt0)&&l.push(d,v,S),(o!==x-1||e0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class q2 extends Wr{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ze(16777215),this.specular=new ze(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Th,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class tA extends Wr{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ze(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Th,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class eA extends Wr{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Th,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class iA extends Wr{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Th,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_d,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class nA extends Wr{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ze(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Th,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class rA extends xs{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function xu(g,t,i){return!g||!i&&g.constructor===t?g:typeof t.BYTES_PER_ELEMENT=="number"?new t(g):Array.prototype.slice.call(g)}function sA(g){return ArrayBuffer.isView(g)&&!(g instanceof DataView)}function aA(g){function t(T,E){return g[T]-g[E]}const i=g.length,x=new Array(i);for(let T=0;T!==i;++T)x[T]=T;return x.sort(t),x}function Ax(g,t,i){const x=g.length,T=new g.constructor(x);for(let E=0,s=0;s!==x;++E){const y=i[E]*t;for(let e=0;e!==t;++e)T[s++]=g[y+e]}return T}function z1(g,t,i,x){let T=1,E=g[0];for(;E!==void 0&&E[x]===void 0;)E=g[T++];if(E===void 0)return;let s=E[x];if(s!==void 0)if(Array.isArray(s))do s=E[x],s!==void 0&&(t.push(E.time),i.push.apply(i,s)),E=g[T++];while(E!==void 0);else if(s.toArray!==void 0)do s=E[x],s!==void 0&&(t.push(E.time),s.toArray(i,i.length)),E=g[T++];while(E!==void 0);else do s=E[x],s!==void 0&&(t.push(E.time),i.push(s)),E=g[T++];while(E!==void 0)}function YU(g,t,i,x,T=30){const E=g.clone();E.name=t;const s=[];for(let e=0;e=x)){h.push(r.times[l]);for(let u=0;uE.tracks[e].times[0]&&(y=E.tracks[e].times[0]);for(let e=0;e=y.times[n]){const o=n*h+p,c=o+h-p;u=y.values.slice(o,c)}else{const o=y.createInterpolant(),c=p,d=h-p;o.evaluate(E),u=o.resultBuffer.slice(c,d)}e==="quaternion"&&new Is().fromArray(u).normalize().conjugate().toArray(u);const f=r.times.length;for(let o=0;o=E)){const y=i[1];t=E)break e}s=x,x=0;break i}break t}for(;x>>1;ti;)--s;if(++s,E!==0||s!==T){E>=s&&(s=Math.max(s,1),E=s-1);const y=this.getValueSize();this.times=x.slice(E,s),this.values=this.values.slice(E*y,s*y)}return this}validate(){let t=!0;const i=this.getValueSize();i-Math.floor(i)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const x=this.times,T=this.values,E=x.length;E===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let y=0;y!==E;y++){const e=x[y];if(typeof e=="number"&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,y,e),t=!1;break}if(s!==null&&s>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,y,e,s),t=!1;break}s=e}if(T!==void 0&&sA(T))for(let y=0,e=T.length;y!==e;++y){const r=T[y];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,y,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),i=this.values.slice(),x=this.getValueSize(),T=this.getInterpolation()===um,E=t.length-1;let s=1;for(let y=1;y0){t[s]=t[E];for(let y=E*x,e=s*x,r=0;r!==x;++r)i[e+r]=i[y+r];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=i.slice(0,s*x)):(this.times=t,this.values=i),this}clone(){const t=this.times.slice(),i=this.values.slice(),x=this.constructor,T=new x(this.name,t,i);return T.createInterpolant=this.createInterpolant,T}}oo.prototype.TimeBufferType=Float32Array;oo.prototype.ValueBufferType=Float32Array;oo.prototype.DefaultInterpolation=bd;class Bu extends oo{}Bu.prototype.ValueTypeName="bool";Bu.prototype.ValueBufferType=Array;Bu.prototype.DefaultInterpolation=Rd;Bu.prototype.InterpolantFactoryMethodLinear=void 0;Bu.prototype.InterpolantFactoryMethodSmooth=void 0;class V1 extends oo{}V1.prototype.ValueTypeName="color";class Hd extends oo{}Hd.prototype.ValueTypeName="number";class hA extends op{constructor(t,i,x,T){super(t,i,x,T)}interpolate_(t,i,x,T){const E=this.resultBuffer,s=this.sampleValues,y=this.valueSize,e=(x-i)/(T-i);let r=t*y;for(let p=r+y;r!==p;r+=4)Is.slerpFlat(E,0,s,r-y,s,r,e);return E}}class fc extends oo{InterpolantFactoryMethodLinear(t){return new hA(this.times,this.values,this.getValueSize(),t)}}fc.prototype.ValueTypeName="quaternion";fc.prototype.DefaultInterpolation=bd;fc.prototype.InterpolantFactoryMethodSmooth=void 0;class Uu extends oo{}Uu.prototype.ValueTypeName="string";Uu.prototype.ValueBufferType=Array;Uu.prototype.DefaultInterpolation=Rd;Uu.prototype.InterpolantFactoryMethodLinear=void 0;Uu.prototype.InterpolantFactoryMethodSmooth=void 0;class Wd extends oo{}Wd.prototype.ValueTypeName="vector";class Xd{constructor(t,i=-1,x,T=fg){this.name=t,this.tracks=x,this.duration=i,this.blendMode=T,this.uuid=ra(),this.duration<0&&this.resetDuration()}static parse(t){const i=[],x=t.tracks,T=1/(t.fps||1);for(let s=0,y=x.length;s!==y;++s)i.push(ZU(x[s]).scale(T));const E=new this(t.name,t.duration,i,t.blendMode);return E.uuid=t.uuid,E}static toJSON(t){const i=[],x=t.tracks,T={name:t.name,duration:t.duration,tracks:i,uuid:t.uuid,blendMode:t.blendMode};for(let E=0,s=x.length;E!==s;++E)i.push(oo.toJSON(x[E]));return T}static CreateFromMorphTargetSequence(t,i,x,T){const E=i.length,s=[];for(let y=0;y1){const h=p[1];let a=T[h];a||(T[h]=a=[]),a.push(r)}}const s=[];for(const y in T)s.push(this.CreateFromMorphTargetSequence(y,T[y],i,x));return s}static parseAnimation(t,i){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const x=function(h,a,l,n,u){if(l.length!==0){const f=[],o=[];z1(l,f,o,n),f.length!==0&&u.push(new h(a,f,o))}},T=[],E=t.name||"default",s=t.fps||30,y=t.blendMode;let e=t.length||-1;const r=t.hierarchy||[];for(let h=0;h{i&&i(E),this.manager.itemEnd(t)},0),E;if(ml[t]!==void 0){ml[t].push({onLoad:i,onProgress:x,onError:T});return}ml[t]=[],ml[t].push({onLoad:i,onProgress:x,onError:T});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),y=this.mimeType,e=this.responseType;fetch(s).then(r=>{if(r.status===200||r.status===0){if(r.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||r.body===void 0||r.body.getReader===void 0)return r;const p=ml[t],h=r.body.getReader(),a=r.headers.get("Content-Length")||r.headers.get("X-File-Size"),l=a?parseInt(a):0,n=l!==0;let u=0;const f=new ReadableStream({start(o){c();function c(){h.read().then(({done:d,value:v})=>{if(d)o.close();else{u+=v.byteLength;const m=new ProgressEvent("progress",{lengthComputable:n,loaded:u,total:l});for(let S=0,M=p.length;S{switch(e){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"document":return r.text().then(p=>new DOMParser().parseFromString(p,y));case"json":return r.json();default:if(y===void 0)return r.text();{const h=/charset="?([^;"\s]*)"?/i.exec(y),a=h&&h[1]?h[1].toLowerCase():void 0,l=new TextDecoder(a);return r.arrayBuffer().then(n=>l.decode(n))}}}).then(r=>{Ml.add(t,r);const p=ml[t];delete ml[t];for(let h=0,a=p.length;h{const p=ml[t];if(p===void 0)throw this.manager.itemError(t),r;delete ml[t];for(let h=0,a=p.length;h{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class $U extends Bs{constructor(t){super(t)}load(t,i,x,T){const E=this,s=new Rl(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(y){try{i(E.parse(JSON.parse(y)))}catch(e){T?T(e):console.error(e),E.manager.itemError(t)}},x,T)}parse(t){const i=[];for(let x=0;x0:T.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const E in t.uniforms){const s=t.uniforms[E];switch(T.uniforms[E]={},s.type){case"t":T.uniforms[E].value=x(s.value);break;case"c":T.uniforms[E].value=new ze().setHex(s.value);break;case"v2":T.uniforms[E].value=new ve().fromArray(s.value);break;case"v3":T.uniforms[E].value=new Ct().fromArray(s.value);break;case"v4":T.uniforms[E].value=new an().fromArray(s.value);break;case"m3":T.uniforms[E].value=new Di().fromArray(s.value);break;case"m4":T.uniforms[E].value=new di().fromArray(s.value);break;default:T.uniforms[E].value=s.value}}if(t.defines!==void 0&&(T.defines=t.defines),t.vertexShader!==void 0&&(T.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(T.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(T.glslVersion=t.glslVersion),t.extensions!==void 0)for(const E in t.extensions)T.extensions[E]=t.extensions[E];if(t.lights!==void 0&&(T.lights=t.lights),t.clipping!==void 0&&(T.clipping=t.clipping),t.size!==void 0&&(T.size=t.size),t.sizeAttenuation!==void 0&&(T.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(T.map=x(t.map)),t.matcap!==void 0&&(T.matcap=x(t.matcap)),t.alphaMap!==void 0&&(T.alphaMap=x(t.alphaMap)),t.bumpMap!==void 0&&(T.bumpMap=x(t.bumpMap)),t.bumpScale!==void 0&&(T.bumpScale=t.bumpScale),t.normalMap!==void 0&&(T.normalMap=x(t.normalMap)),t.normalMapType!==void 0&&(T.normalMapType=t.normalMapType),t.normalScale!==void 0){let E=t.normalScale;Array.isArray(E)===!1&&(E=[E,E]),T.normalScale=new ve().fromArray(E)}return t.displacementMap!==void 0&&(T.displacementMap=x(t.displacementMap)),t.displacementScale!==void 0&&(T.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(T.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(T.roughnessMap=x(t.roughnessMap)),t.metalnessMap!==void 0&&(T.metalnessMap=x(t.metalnessMap)),t.emissiveMap!==void 0&&(T.emissiveMap=x(t.emissiveMap)),t.emissiveIntensity!==void 0&&(T.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(T.specularMap=x(t.specularMap)),t.specularIntensityMap!==void 0&&(T.specularIntensityMap=x(t.specularIntensityMap)),t.specularColorMap!==void 0&&(T.specularColorMap=x(t.specularColorMap)),t.envMap!==void 0&&(T.envMap=x(t.envMap)),t.envMapIntensity!==void 0&&(T.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(T.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(T.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(T.lightMap=x(t.lightMap)),t.lightMapIntensity!==void 0&&(T.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(T.aoMap=x(t.aoMap)),t.aoMapIntensity!==void 0&&(T.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(T.gradientMap=x(t.gradientMap)),t.clearcoatMap!==void 0&&(T.clearcoatMap=x(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(T.clearcoatRoughnessMap=x(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(T.clearcoatNormalMap=x(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(T.clearcoatNormalScale=new ve().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(T.iridescenceMap=x(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(T.iridescenceThicknessMap=x(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(T.transmissionMap=x(t.transmissionMap)),t.thicknessMap!==void 0&&(T.thicknessMap=x(t.thicknessMap)),t.anisotropyMap!==void 0&&(T.anisotropyMap=x(t.anisotropyMap)),t.sheenColorMap!==void 0&&(T.sheenColorMap=x(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(T.sheenRoughnessMap=x(t.sheenRoughnessMap)),T}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){const i={ShadowMaterial:$2,SpriteMaterial:b1,RawShaderMaterial:Q2,ShaderMaterial:so,PointsMaterial:F1,MeshPhysicalMaterial:_2,MeshStandardMaterial:yl,MeshPhongMaterial:q2,MeshToonMaterial:tA,MeshNormalMaterial:eA,MeshLambertMaterial:iA,MeshDepthMaterial:A1,MeshDistanceMaterial:P1,MeshBasicMaterial:Eh,MeshMatcapMaterial:nA,LineDashedMaterial:rA,LineBasicMaterial:xs,Material:Wr};return new i[t]}}class Px{static decodeText(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let i="";for(let x=0,T=t.length;x0){const e=new H1(i);E=new Yd(e),E.setCrossOrigin(this.crossOrigin);for(let r=0,p=t.length;r0){T=new Yd(this.manager),T.setCrossOrigin(this.crossOrigin);for(let s=0,y=t.length;s{const f=new ys;f.min.fromArray(u.boxMin),f.max.fromArray(u.boxMax);const o=new Qr;return o.radius=u.sphereRadius,o.center.fromArray(u.sphereCenter),{boxInitialized:u.boxInitialized,box:f,sphereInitialized:u.sphereInitialized,sphere:o}}),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=r(t.matricesTexture.uuid);break;case"LOD":s=new I2;break;case"Line":s=new xh(y(t.geometry),e(t.material));break;case"LineLoop":s=new z2(y(t.geometry),e(t.material));break;case"LineSegments":s=new Xo(y(t.geometry),e(t.material));break;case"PointCloud":case"Points":s=new G2(y(t.geometry),e(t.material));break;case"Sprite":s=new D2(e(t.material));break;case"Group":s=new Xf;break;case"Bone":s=new L1;break;default:s=new ki}if(s.uuid=t.uuid,t.name!==void 0&&(s.name=t.name),t.matrix!==void 0?(s.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(t.position!==void 0&&s.position.fromArray(t.position),t.rotation!==void 0&&s.rotation.fromArray(t.rotation),t.quaternion!==void 0&&s.quaternion.fromArray(t.quaternion),t.scale!==void 0&&s.scale.fromArray(t.scale)),t.up!==void 0&&s.up.fromArray(t.up),t.castShadow!==void 0&&(s.castShadow=t.castShadow),t.receiveShadow!==void 0&&(s.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(s.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(s.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(s.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(s.visible=t.visible),t.frustumCulled!==void 0&&(s.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(s.renderOrder=t.renderOrder),t.userData!==void 0&&(s.userData=t.userData),t.layers!==void 0&&(s.layers.mask=t.layers),t.children!==void 0){const a=t.children;for(let l=0;l"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,i,x,T){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const E=this,s=Ml.get(t);if(s!==void 0){if(E.manager.itemStart(t),s.then){s.then(r=>{i&&i(r),E.manager.itemEnd(t)}).catch(r=>{T&&T(r)});return}return setTimeout(function(){i&&i(s),E.manager.itemEnd(t)},0),s}const y={};y.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",y.headers=this.requestHeader;const e=fetch(t,y).then(function(r){return r.blob()}).then(function(r){return createImageBitmap(r,Object.assign(E.options,{colorSpaceConversion:"none"}))}).then(function(r){return Ml.add(t,r),i&&i(r),E.manager.itemEnd(t),r}).catch(function(r){T&&T(r),Ml.remove(t),E.manager.itemError(t),E.manager.itemEnd(t)});Ml.add(t,e),E.manager.itemStart(t)}}let Xv,X1=class{static getContext(){return Xv===void 0&&(Xv=new(window.AudioContext||window.webkitAudioContext)),Xv}static setContext(t){Xv=t}};class az extends Bs{constructor(t){super(t)}load(t,i,x,T){const E=this,s=new Rl(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{const r=e.slice(0);X1.getContext().decodeAudioData(r,function(h){i(h)}).catch(y)}catch(r){y(r)}},x,T);function y(e){T?T(e):console.error(e),E.manager.itemError(t)}}}const jE=new di,KE=new di,nu=new di;class oz{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Dr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Dr,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const i=this._cache;if(i.focus!==t.focus||i.fov!==t.fov||i.aspect!==t.aspect*this.aspect||i.near!==t.near||i.far!==t.far||i.zoom!==t.zoom||i.eyeSep!==this.eyeSep){i.focus=t.focus,i.fov=t.fov,i.aspect=t.aspect*this.aspect,i.near=t.near,i.far=t.far,i.zoom=t.zoom,i.eyeSep=this.eyeSep,nu.copy(t.projectionMatrix);const T=i.eyeSep/2,E=T*i.near/i.focus,s=i.near*Math.tan(Tu*i.fov*.5)/i.zoom;let y,e;KE.elements[12]=-T,jE.elements[12]=T,y=-s*i.aspect+E,e=s*i.aspect+E,nu.elements[0]=2*i.near/(e-y),nu.elements[8]=(e+y)/(e-y),this.cameraL.projectionMatrix.copy(nu),y=-s*i.aspect-E,e=s*i.aspect-E,nu.elements[0]=2*i.near/(e-y),nu.elements[8]=(e+y)/(e-y),this.cameraR.projectionMatrix.copy(nu)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(KE),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(jE)}}class Y1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ZE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const i=ZE();t=(i-this.oldTime)/1e3,this.oldTime=i,this.elapsedTime+=t}return t}}function ZE(){return(typeof performance>"u"?Date:performance).now()}const ru=new Ct,JE=new Is,lz=new Ct,su=new Ct;class hz extends ki{constructor(){super(),this.type="AudioListener",this.context=X1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Y1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const i=this.context.listener,x=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ru,JE,lz),su.set(0,0,-1).applyQuaternion(JE),i.positionX){const T=this.context.currentTime+this.timeDelta;i.positionX.linearRampToValueAtTime(ru.x,T),i.positionY.linearRampToValueAtTime(ru.y,T),i.positionZ.linearRampToValueAtTime(ru.z,T),i.forwardX.linearRampToValueAtTime(su.x,T),i.forwardY.linearRampToValueAtTime(su.y,T),i.forwardZ.linearRampToValueAtTime(su.z,T),i.upX.linearRampToValueAtTime(x.x,T),i.upY.linearRampToValueAtTime(x.y,T),i.upZ.linearRampToValueAtTime(x.z,T)}else i.setPosition(ru.x,ru.y,ru.z),i.setOrientation(su.x,su.y,su.z,x.x,x.y,x.z)}}let EA=class extends ki{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const i=this.context.createBufferSource();return i.buffer=this.buffer,i.loop=this.loop,i.loopStart=this.loopStart,i.loopEnd=this.loopEnd,i.onended=this.onEnded.bind(this),i.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=i,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,i=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,i=this.filters.length;t0&&this._mixBufferRegionAdditive(x,T,this._addIndex*i,1,i);for(let e=i,r=i+i;e!==r;++e)if(x[e]!==x[e+i]){y.setValue(x,T);break}}saveOriginalState(){const t=this.binding,i=this.buffer,x=this.valueSize,T=x*this._origIndex;t.getValue(i,T);for(let E=x,s=T;E!==s;++E)i[E]=i[T+E%x];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,i=t+this.valueSize;for(let x=t;x=.5)for(let s=0;s!==E;++s)t[i+s]=t[x+s]}_slerp(t,i,x,T){Is.slerpFlat(t,i,t,i,t,x,T)}_slerpAdditive(t,i,x,T,E){const s=this._workIndex*E;Is.multiplyQuaternionsFlat(t,s,t,i,t,x),Is.slerpFlat(t,i,t,i,t,s,T)}_lerp(t,i,x,T,E){const s=1-T;for(let y=0;y!==E;++y){const e=i+y;t[e]=t[e]*s+t[x+y]*T}}_lerpAdditive(t,i,x,T,E){for(let s=0;s!==E;++s){const y=i+s;t[y]=t[y]+t[x+s]*T}}}const k1="\\[\\]\\.:\\/",dz=new RegExp("["+k1+"]","g"),j1="[^"+k1+"]",pz="[^"+k1.replace("\\.","")+"]",vz=/((?:WC+[\/:])*)/.source.replace("WC",j1),mz=/(WCOD+)?/.source.replace("WCOD",pz),gz=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",j1),yz=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",j1),xz=new RegExp("^"+vz+mz+gz+yz+"$"),Sz=["material","materials","bones","map"];class Tz{constructor(t,i,x){const T=x||Yi.parseTrackName(i);this._targetGroup=t,this._bindings=t.subscribe_(i,T)}getValue(t,i){this.bind();const x=this._targetGroup.nCachedObjects_,T=this._bindings[x];T!==void 0&&T.getValue(t,i)}setValue(t,i){const x=this._bindings;for(let T=this._targetGroup.nCachedObjects_,E=x.length;T!==E;++T)x[T].setValue(t,i)}bind(){const t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=t.length;i!==x;++i)t[i].bind()}unbind(){const t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=t.length;i!==x;++i)t[i].unbind()}}class Yi{constructor(t,i,x){this.path=i,this.parsedPath=x||Yi.parseTrackName(i),this.node=Yi.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,x){return t&&t.isAnimationObjectGroup?new Yi.Composite(t,i,x):new Yi(t,i,x)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(dz,"")}static parseTrackName(t){const i=xz.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const x={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},T=x.nodeName&&x.nodeName.lastIndexOf(".");if(T!==void 0&&T!==-1){const E=x.nodeName.substring(T+1);Sz.indexOf(E)!==-1&&(x.nodeName=x.nodeName.substring(0,T),x.objectName=E)}if(x.propertyName===null||x.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return x}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){const x=t.skeleton.getBoneByName(i);if(x!==void 0)return x}if(t.children){const x=function(E){for(let s=0;s=E){const h=E++,a=t[h];i[a.uuid]=p,t[p]=a,i[r]=h,t[h]=e;for(let l=0,n=T;l!==n;++l){const u=x[l],f=u[h],o=u[p];u[p]=f,u[h]=o}}}this.nCachedObjects_=E}uncache(){const t=this._objects,i=this._indicesByUUID,x=this._bindings,T=x.length;let E=this.nCachedObjects_,s=t.length;for(let y=0,e=arguments.length;y!==e;++y){const r=arguments[y],p=r.uuid,h=i[p];if(h!==void 0)if(delete i[p],h0&&(i[l.uuid]=h),t[h]=l,t.pop();for(let n=0,u=T;n!==u;++n){const f=x[n];f[h]=f[a],f.pop()}}}this.nCachedObjects_=E}subscribe_(t,i){const x=this._bindingsIndicesByPath;let T=x[t];const E=this._bindings;if(T!==void 0)return E[T];const s=this._paths,y=this._parsedPaths,e=this._objects,r=e.length,p=this.nCachedObjects_,h=new Array(r);T=E.length,x[t]=T,s.push(t),y.push(i),E.push(h);for(let a=p,l=e.length;a!==l;++a){const n=e[a];h[a]=new Yi(n,t,i)}return h}unsubscribe_(t){const i=this._bindingsIndicesByPath,x=i[t];if(x!==void 0){const T=this._paths,E=this._parsedPaths,s=this._bindings,y=s.length-1,e=s[y],r=t[y];i[r]=x,s[x]=e,s.pop(),E[x]=E[y],E.pop(),T[x]=T[y],T.pop()}}}class CA{constructor(t,i,x=null,T=i.blendMode){this._mixer=t,this._clip=i,this._localRoot=x,this.blendMode=T;const E=i.tracks,s=E.length,y=new Array(s),e={endingStart:mu,endingEnd:mu};for(let r=0;r!==s;++r){const p=E[r].createInterpolant(null);y[r]=p,p.settings=e}this._interpolantSettings=e,this._interpolants=y,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=n2,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,i){return this.loop=t,this.repetitions=i,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,i,x){if(t.fadeOut(i),this.fadeIn(i),x){const T=this._clip.duration,E=t._clip.duration,s=E/T,y=T/E;t.warp(1,s,i),this.warp(y,1,i)}return this}crossFadeTo(t,i,x){return t.crossFadeFrom(this,i,x)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,i,x){const T=this._mixer,E=T.time,s=this.timeScale;let y=this._timeScaleInterpolant;y===null&&(y=T._lendControlInterpolant(),this._timeScaleInterpolant=y);const e=y.parameterPositions,r=y.sampleValues;return e[0]=E,e[1]=E+x,r[0]=t/s,r[1]=i/s,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,i,x,T){if(!this.enabled){this._updateWeight(t);return}const E=this._startTime;if(E!==null){const e=(t-E)*x;e<0||x===0?i=0:(this._startTime=null,i=x*e)}i*=this._updateTimeScale(t);const s=this._updateTime(i),y=this._updateWeight(t);if(y>0){const e=this._interpolants,r=this._propertyBindings;switch(this.blendMode){case m1:for(let p=0,h=e.length;p!==h;++p)e[p].evaluate(s),r[p].accumulateAdditive(y);break;case fg:default:for(let p=0,h=e.length;p!==h;++p)e[p].evaluate(s),r[p].accumulate(T,y)}}}_updateWeight(t){let i=0;if(this.enabled){i=this.weight;const x=this._weightInterpolant;if(x!==null){const T=x.evaluate(t)[0];i*=T,t>x.parameterPositions[1]&&(this.stopFading(),T===0&&(this.enabled=!1))}}return this._effectiveWeight=i,i}_updateTimeScale(t){let i=0;if(!this.paused){i=this.timeScale;const x=this._timeScaleInterpolant;if(x!==null){const T=x.evaluate(t)[0];i*=T,t>x.parameterPositions[1]&&(this.stopWarping(),i===0?this.paused=!0:this.timeScale=i)}}return this._effectiveTimeScale=i,i}_updateTime(t){const i=this._clip.duration,x=this.loop;let T=this.time+t,E=this._loopCount;const s=x===r2;if(t===0)return E===-1?T:s&&(E&1)===1?i-T:T;if(x===i2){E===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(T>=i)T=i;else if(T<0)T=0;else{this.time=T;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(E===-1&&(t>=0?(E=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),T>=i||T<0){const y=Math.floor(T/i);T-=i*y,E+=Math.abs(y);const e=this.repetitions-E;if(e<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,T=t>0?i:0,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(e===1){const r=t<0;this._setEndings(r,!r,s)}else this._setEndings(!1,!1,s);this._loopCount=E,this.time=T,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:y})}}else this.time=T;if(s&&(E&1)===1)return i-T}return T}_setEndings(t,i,x){const T=this._interpolantSettings;x?(T.endingStart=gu,T.endingEnd=gu):(t?T.endingStart=this.zeroSlopeAtStart?gu:mu:T.endingStart=Ld,i?T.endingEnd=this.zeroSlopeAtEnd?gu:mu:T.endingEnd=Ld)}_scheduleFading(t,i,x){const T=this._mixer,E=T.time;let s=this._weightInterpolant;s===null&&(s=T._lendControlInterpolant(),this._weightInterpolant=s);const y=s.parameterPositions,e=s.sampleValues;return y[0]=E,e[0]=i,y[1]=E+t,e[1]=x,this}}const Mz=new Float32Array(1);class Cz extends bl{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,i){const x=t._localRoot||this._root,T=t._clip.tracks,E=T.length,s=t._propertyBindings,y=t._interpolants,e=x.uuid,r=this._bindingsByRootAndName;let p=r[e];p===void 0&&(p={},r[e]=p);for(let h=0;h!==E;++h){const a=T[h],l=a.name;let n=p[l];if(n!==void 0)++n.referenceCount,s[h]=n;else{if(n=s[h],n!==void 0){n._cacheIndex===null&&(++n.referenceCount,this._addInactiveBinding(n,e,l));continue}const u=i&&i._propertyBindings[h].binding.parsedPath;n=new MA(Yi.create(x,l,u),a.ValueTypeName,a.getValueSize()),++n.referenceCount,this._addInactiveBinding(n,e,l),s[h]=n}y[h].resultBuffer=n.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const x=(t._localRoot||this._root).uuid,T=t._clip.uuid,E=this._actionsByClip[T];this._bindAction(t,E&&E.knownActions[0]),this._addInactiveAction(t,T,x)}const i=t._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];E.useCount++===0&&(this._lendBinding(E),E.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const i=t._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];--E.useCount===0&&(E.restoreOriginalState(),this._takeBackBinding(E))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const i=t._cacheIndex;return i!==null&&i=0;--x)t[x].stop();return this}update(t){t*=this.timeScale;const i=this._actions,x=this._nActiveActions,T=this.time+=t,E=Math.sign(t),s=this._accuIndex^=1;for(let r=0;r!==x;++r)i[r]._update(T,t,E,s);const y=this._bindings,e=this._nActiveBindings;for(let r=0;r!==e;++r)y[r].apply(s);return this}setTime(t){this.time=0;for(let i=0;ithis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_E).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const qE=new Ct,Yv=new Ct;class Oz{constructor(t=new Ct,i=new Ct){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){qE.subVectors(t,this.start),Yv.subVectors(this.end,this.start);const x=Yv.dot(Yv);let E=Yv.dot(qE)/x;return i&&(E=Zn(E,0,1)),E}closestPointToPoint(t,i,x){const T=this.closestPointToPointParameter(t,i);return this.delta(x).multiplyScalar(T).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const tM=new Ct;class Dz extends ki{constructor(t,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="SpotLightHelper";const x=new Fi,T=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,y=1,e=32;s1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{sM.set(t.z,0,-t.x).normalize();const i=Math.acos(t.y);this.quaternion.setFromAxisAngle(sM,i)}}setLength(t,i=t*.2,x=i*.2){this.line.scale.set(1,Math.max(1e-4,t-i),1),this.line.updateMatrix(),this.cone.scale.set(x,i,x),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class jz extends Xo{constructor(t=1){const i=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],x=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],T=new Fi;T.setAttribute("position",new ke(i,3)),T.setAttribute("color",new ke(x,3));const E=new xs({vertexColors:!0,toneMapped:!1});super(T,E),this.type="AxesHelper"}setColors(t,i,x){const T=new ze,E=this.geometry.attributes.color.array;return T.set(t),T.toArray(E,0),T.toArray(E,3),T.set(i),T.toArray(E,6),T.toArray(E,9),T.set(x),T.toArray(E,12),T.toArray(E,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Kz{constructor(){this.type="ShapePath",this.color=new ze,this.subPaths=[],this.currentPath=null}moveTo(t,i){return this.currentPath=new Ud,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,i),this}lineTo(t,i){return this.currentPath.lineTo(t,i),this}quadraticCurveTo(t,i,x,T){return this.currentPath.quadraticCurveTo(t,i,x,T),this}bezierCurveTo(t,i,x,T,E,s){return this.currentPath.bezierCurveTo(t,i,x,T,E,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function i(o){const c=[];for(let d=0,v=o.length;dNumber.EPSILON){if(A<0&&(M=c[S],C=-C,w=c[m],A=-A),o.yw.y)continue;if(o.y===M.y){if(o.x===M.x)return!0}else{const P=A*(o.x-M.x)-C*(o.y-M.y);if(P===0)return!0;if(P<0)continue;v=!v}}else{if(o.y!==M.y)continue;if(w.x<=o.x&&o.x<=M.x||M.x<=o.x&&o.x<=w.x)return!0}}return v}const T=Vo.isClockWise,E=this.subPaths;if(E.length===0)return[];let s,y,e;const r=[];if(E.length===1)return y=E[0],e=new wu,e.curves=y.curves,r.push(e),r;let p=!T(E[0].getPoints());p=t?!p:p;const h=[],a=[];let l=[],n=0,u;a[n]=void 0,l[n]=[];for(let o=0,c=E.length;o1){let o=!1,c=0;for(let d=0,v=a.length;d0&&o===!1&&(l=h)}let f;for(let o=0,c=a.length;o{const h=typeof r=="function"?r(t):r;if(h!==t){const a=t;t=p?h:Object.assign({},t,h),i.forEach(l=>l(t,a))}},T=()=>t,E=(r,p=T,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let a=p(t);function l(){const n=p(t);if(!h(a,n)){const u=a;r(a=n,u)}}return i.add(l),()=>i.delete(l)},e={setState:x,getState:T,subscribe:(r,p,h)=>p||h?E(r,p,h):(i.add(r),()=>i.delete(r)),destroy:()=>i.clear()};return t=g(x,T,e),e}const $z=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),aM=$z?Me.useEffect:Me.useLayoutEffect;function Qz(g){const t=typeof g=="function"?Jz(g):g,i=(x=t.getState,T=Object.is)=>{const[,E]=Me.useReducer(f=>f+1,0),s=t.getState(),y=Me.useRef(s),e=Me.useRef(x),r=Me.useRef(T),p=Me.useRef(!1),h=Me.useRef();h.current===void 0&&(h.current=x(s));let a,l=!1;(y.current!==s||e.current!==x||r.current!==T||p.current)&&(a=x(s),l=!T(h.current,a)),aM(()=>{l&&(h.current=a),y.current=s,e.current=x,r.current=T,p.current=!1});const n=Me.useRef(s);aM(()=>{const f=()=>{try{const c=t.getState(),d=e.current(c);r.current(h.current,d)||(y.current=c,h.current=d,E())}catch{p.current=!0,E()}},o=t.subscribe(f);return t.getState()!==n.current&&f(),o},[]);const u=l?a:h.current;return Me.useDebugValue(u),u};return Object.assign(i,t),i[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const x=[i,t];return{next(){const T=x.length<=0;return{value:x.shift(),done:T}}}},i}var RA={exports:{}},oy={exports:{}},ly={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oM;function _z(){return oM||(oM=1,function(g){function t(z,X){var j=z.length;z.push(X);t:for(;0>>1,tt=z[Q];if(0>>1;QT(U,j))HT(J,U)?(z[Q]=J,z[H]=j,Q=H):(z[Q]=U,z[Z]=j,Q=Z);else if(HT(J,j))z[Q]=J,z[H]=j,Q=H;else break t}}return X}function T(z,X){var j=z.sortIndex-X.sortIndex;return j!==0?j:z.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var s=Date,y=s.now();g.unstable_now=function(){return s.now()-y}}var e=[],r=[],p=1,h=null,a=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var X=i(r);X!==null;){if(X.callback===null)x(r);else if(X.startTime<=z)x(r),X.sortIndex=X.expirationTime,t(e,X);else break;X=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(e)!==null)n=!0,B(m);else{var X=i(r);X!==null&&G(v,X.startTime-z)}}function m(z,X){n=!1,u&&(u=!1,o(w),w=-1),l=!0;var j=a;try{for(d(X),h=i(e);h!==null&&(!(h.expirationTime>X)||z&&!P());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,a=h.priorityLevel;var tt=Q(h.expirationTime<=X);X=g.unstable_now(),typeof tt=="function"?h.callback=tt:h===i(e)&&x(e),d(X)}else x(e);h=i(e)}if(h!==null)var Y=!0;else{var Z=i(r);Z!==null&&G(v,Z.startTime-X),Y=!1}return Y}finally{h=null,a=j,l=!1}}var S=!1,M=null,w=-1,C=5,A=-1;function P(){return!(g.unstable_now()-Az||125Q?(z.sortIndex=j,t(r,z),i(e)===null&&z===i(r)&&(u?(o(w),w=-1):u=!0,G(v,j-Q))):(z.sortIndex=tt,t(e,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var X=a;return function(){var j=a;a=X;try{return z.apply(this,arguments)}finally{a=j}}}}(ly)),ly}var lM;function qz(){return lM||(lM=1,oy.exports=_z()),oy.exports}/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var t7=function(t){var i={},x=Me,T=qz(),E=Object.assign;function s(L){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+L,W=1;WXt||it[wt]!==lt[Xt]){var oe=` +`+it[wt].replace(" at new "," at ");return L.displayName&&oe.includes("")&&(oe=oe.replace("",L.displayName)),oe}while(1<=wt&&0<=Xt);break}}}finally{ni=!1,Error.prepareStackTrace=W}return(L=L?L.displayName||L.name:"")?ti(L):""}var $i=Object.prototype.hasOwnProperty,un=[],ji=-1;function yn(L){return{current:L}}function ei(L){0>ji||(L.current=un[ji],un[ji]=null,ji--)}function Se(L,F){ji++,un[ji]=L.current,L.current=F}var Br={},gi=yn(Br),fn=yn(!1),Ni=Br;function Vn(L,F){var W=L.type.contextTypes;if(!W)return Br;var $=L.stateNode;if($&&$.__reactInternalMemoizedUnmaskedChildContext===F)return $.__reactInternalMemoizedMaskedChildContext;var it={},lt;for(lt in W)it[lt]=F[lt];return $&&(L=L.stateNode,L.__reactInternalMemoizedUnmaskedChildContext=F,L.__reactInternalMemoizedMaskedChildContext=it),it}function vn(L){return L=L.childContextTypes,L!=null}function Ki(){ei(fn),ei(gi)}function pr(L,F,W){if(gi.current!==Br)throw Error(s(168));Se(gi,F),Se(fn,W)}function Gs(L,F,W){var $=L.stateNode;if(F=F.childContextTypes,typeof $.getChildContext!="function")return W;$=$.getChildContext();for(var it in $)if(!(it in F))throw Error(s(108,w(L)||"Unknown",it));return E({},W,$)}function En(L){return L=(L=L.stateNode)&&L.__reactInternalMemoizedMergedChildContext||Br,Ni=gi.current,Se(gi,L),Se(fn,fn.current),!0}function la(L,F,W){var $=L.stateNode;if(!$)throw Error(s(169));W?(L=Gs(L,F,Ni),$.__reactInternalMemoizedMergedChildContext=L,ei(fn),ei(gi),Se(gi,L)):ei(fn),Se(fn,W)}var $n=Math.clz32?Math.clz32:uo,ba=Math.log,Vs=Math.LN2;function uo(L){return L>>>=0,L===0?32:31-(ba(L)/Vs|0)|0}var La=64,fo=4194304;function yi(L){switch(L&-L){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return L&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return L&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return L}}function Fa(L,F){var W=L.pendingLanes;if(W===0)return 0;var $=0,it=L.suspendedLanes,lt=L.pingedLanes,wt=W&268435455;if(wt!==0){var Xt=wt&~it;Xt!==0?$=yi(Xt):(lt&=wt,lt!==0&&($=yi(lt)))}else wt=W&~it,wt!==0?$=yi(wt):lt!==0&&($=yi(lt));if($===0)return 0;if(F!==0&&F!==$&&!(F&it)&&(it=$&-$,lt=F&-F,it>=lt||it===16&&(lt&4194240)!==0))return F;if($&4&&($|=W&16),F=L.entangledLanes,F!==0)for(L=L.entanglements,F&=$;0W;W++)F.push(L);return F}function Ws(L,F,W){L.pendingLanes|=F,F!==536870912&&(L.suspendedLanes=0,L.pingedLanes=0),L=L.eventTimes,F=31-$n(F),L[F]=W}function Xs(L,F){var W=L.pendingLanes&~F;L.pendingLanes=F,L.suspendedLanes=0,L.pingedLanes=0,L.expiredLanes&=F,L.mutableReadLanes&=F,L.entangledLanes&=F,F=L.entanglements;var $=L.eventTimes;for(L=L.expirationTimes;0>=wt,it-=wt,Ms=1<<32-$n(F)+it|W<Ai?(kn=xi,xi=null):kn=xi.sibling;var zi=Qe($t,xi,se[Ai],Ne);if(zi===null){xi===null&&(xi=kn);break}L&&xi&&zi.alternate===null&&F($t,xi),kt=lt(zi,kt,Ai),wi===null?Ye=zi:wi.sibling=zi,wi=zi,xi=kn}if(Ai===se.length)return W($t,xi),qi&&Cs($t,Ai),Ye;if(xi===null){for(;AiAi?(kn=xi,xi=null):kn=xi.sibling;var ya=Qe($t,xi,zi.value,Ne);if(ya===null){xi===null&&(xi=kn);break}L&&xi&&ya.alternate===null&&F($t,xi),kt=lt(ya,kt,Ai),wi===null?Ye=ya:wi.sibling=ya,wi=ya,xi=kn}if(zi.done)return W($t,xi),qi&&Cs($t,Ai),Ye;if(xi===null){for(;!zi.done;Ai++,zi=se.next())zi=mi($t,zi.value,Ne),zi!==null&&(kt=lt(zi,kt,Ai),wi===null?Ye=zi:wi.sibling=zi,wi=zi);return qi&&Cs($t,Ai),Ye}for(xi=$($t,xi);!zi.done;Ai++,zi=se.next())zi=tn(xi,$t,Ai,zi.value,Ne),zi!==null&&(L&&zi.alternate!==null&&xi.delete(zi.key===null?Ai:zi.key),kt=lt(zi,kt,Ai),wi===null?Ye=zi:wi.sibling=zi,wi=zi);return L&&xi.forEach(function(of){return F($t,of)}),qi&&Cs($t,Ai),Ye}function us($t,kt,se,Ne){if(typeof se=="object"&&se!==null&&se.type===p&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case e:t:{for(var Ye=se.key,wi=kt;wi!==null;){if(wi.key===Ye){if(Ye=se.type,Ye===p){if(wi.tag===7){W($t,wi.sibling),kt=it(wi,se.props.children),kt.return=$t,$t=kt;break t}}else if(wi.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===d&&Wa(Ye)===wi.type){W($t,wi.sibling),kt=it(wi,se.props),kt.ref=Ha($t,wi,se),kt.return=$t,$t=kt;break t}W($t,wi);break}else F($t,wi);wi=wi.sibling}se.type===p?(kt=Fo(se.props.children,$t.mode,Ne,se.key),kt.return=$t,$t=kt):(Ne=sf(se.type,se.key,se.props,null,$t.mode,Ne),Ne.ref=Ha($t,kt,se),Ne.return=$t,$t=Ne)}return wt($t);case r:t:{for(wi=se.key;kt!==null;){if(kt.key===wi)if(kt.tag===4&&kt.stateNode.containerInfo===se.containerInfo&&kt.stateNode.implementation===se.implementation){W($t,kt.sibling),kt=it(kt,se.children||[]),kt.return=$t,$t=kt;break t}else{W($t,kt);break}else F($t,kt);kt=kt.sibling}kt=bs(se,$t.mode,Ne),kt.return=$t,$t=kt}return wt($t);case d:return wi=se._init,us($t,kt,wi(se._payload),Ne)}if(D(se))return Xe($t,kt,se,Ne);if(S(se))return Lr($t,kt,se,Ne);_n($t,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,kt!==null&&kt.tag===6?(W($t,kt.sibling),kt=it(kt,se),kt.return=$t,$t=kt):(W($t,kt),kt=br(se,$t.mode,Ne),kt.return=$t,$t=kt),wt($t)):W($t,kt)}return us}var Vr=Xa(!0),bh=Xa(!1),V={},K=yn(V),et=yn(V),st=yn(V);function ht(L){if(L===V)throw Error(s(174));return L}function pt(L,F){Se(st,F),Se(et,L),Se(K,V),L=G(F),ei(K),Se(K,L)}function Mt(){ei(K),ei(et),ei(st)}function Nt(L){var F=ht(st.current),W=ht(K.current);F=z(W,L.type,F),W!==F&&(Se(et,L),Se(K,F))}function zt(L){et.current===L&&(ei(K),ei(et))}var ct=yn(0);function St(L){for(var F=L;F!==null;){if(F.tag===13){var W=F.memoizedState;if(W!==null&&(W=W.dehydrated,W===null||Ra(W)||oa(W)))return F}else if(F.tag===19&&F.memoizedProps.revealOrder!==void 0){if(F.flags&128)return F}else if(F.child!==null){F.child.return=F,F=F.child;continue}if(F===L)break;for(;F.sibling===null;){if(F.return===null||F.return===L)return null;F=F.return}F.sibling.return=F.return,F=F.sibling}return null}var vt=[];function Ft(){for(var L=0;LW?W:4,L(!0);var $=Ut.transition;Ut.transition={};try{L(!1),F()}finally{Bi=W,Ut.transition=$}}function cp(){return Ze().memoizedState}function qn(L,F,W){var $=ma(L);W={lane:$,action:W,hasEagerState:!1,eagerState:null,next:null},dp(L)?pp(F,W):(mc(L,F,W),W=Ar(),L=Ps(L,$,W),L!==null&&vp(L,F,$))}function Mr(L,F,W){var $=ma(L),it={lane:$,action:W,hasEagerState:!1,eagerState:null,next:null};if(dp(L))pp(F,it);else{mc(L,F,it);var lt=L.alternate;if(L.lanes===0&&(lt===null||lt.lanes===0)&&(lt=F.lastRenderedReducer,lt!==null))try{var wt=F.lastRenderedState,Xt=lt(wt,W);if(it.hasEagerState=!0,it.eagerState=Xt,Es(Xt,wt))return}catch{}finally{}W=Ar(),L=Ps(L,$,W),L!==null&&vp(L,F,$)}}function dp(L){var F=L.alternate;return L===It||F!==null&&F===It}function pp(L,F){ae=Qt=!0;var W=L.pending;W===null?F.next=F:(F.next=W.next,W.next=F),L.pending=F}function mc(L,F,W){Xn!==null&&L.mode&1&&!(Ci&2)?(L=F.interleaved,L===null?(W.next=W,Xr===null?Xr=[F]:Xr.push(F)):(W.next=L.next,L.next=W),F.interleaved=W):(L=F.pending,L===null?W.next=W:(W.next=L.next,L.next=W),F.pending=W)}function vp(L,F,W){if(W&4194240){var $=F.lanes;$&=L.pendingLanes,W|=$,F.lanes=W,Fl(L,W)}}var Vl={readContext:Qi,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},Ih={readContext:Qi,useCallback:function(L,F){return _e().memoizedState=[L,F===void 0?null:F],L},useContext:Qi,useEffect:Gl,useImperativeHandle:function(L,F,W){return W=W!=null?W.concat([L]):null,To(4194308,4,Fh.bind(null,F,L),W)},useLayoutEffect:function(L,F){return To(4194308,4,L,F)},useInsertionEffect:function(L,F){return To(4,2,L,F)},useMemo:function(L,F){var W=_e();return F=F===void 0?null:F,L=L(),W.memoizedState=[L,F],L},useReducer:function(L,F,W){var $=_e();return F=W!==void 0?W(F):F,$.memoizedState=$.baseState=F,L={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:L,lastRenderedState:F},$.queue=L,L=L.dispatch=qn.bind(null,It,L),[$.memoizedState,L]},useRef:function(L){var F=_e();return L={current:L},F.memoizedState=L},useState:xo,useDebugValue:Dh,useDeferredValue:function(L){var F=xo(L),W=F[0],$=F[1];return Gl(function(){var it=Ut.transition;Ut.transition={};try{$(L)}finally{Ut.transition=it}},[L]),W},useTransition:function(){var L=xo(!1),F=L[0];return L=Ng.bind(null,L[1]),_e().memoizedState=L,[F,L]},useMutableSource:function(){},useSyncExternalStore:function(L,F,W){var $=It,it=_e();if(qi){if(W===void 0)throw Error(s(407));W=W()}else{if(W=F(),Xn===null)throw Error(s(349));Wt&30||wn($,F,W)}it.memoizedState=W;var lt={value:W,getSnapshot:F};return it.queue=lt,Gl(Ln.bind(null,$,lt,L),[L]),$.flags|=2048,So(9,yo.bind(null,$,lt,W,F),void 0,null),W},useId:function(){var L=_e(),F=Xn.identifierPrefix;if(qi){var W=is,$=Ms;W=($&~(1<<32-$n($)-1)).toString(32)+W,F=":"+F+"R"+W,W=ue++,0Hh&&(F.flags|=128,$=!0,Cr(it,!1),F.lanes=4194304)}else{if(!$)if(L=St(lt),L!==null){if(F.flags|=128,$=!0,L=L.updateQueue,L!==null&&(F.updateQueue=L,F.flags|=4),Cr(it,!0),it.tail===null&&it.tailMode==="hidden"&&!lt.alternate&&!qi)return ri(F),null}else 2*rn()-it.renderingStartTime>Hh&&W!==1073741824&&(F.flags|=128,$=!0,Cr(it,!1),F.lanes=4194304);it.isBackwards?(lt.sibling=F.child,F.child=lt):(L=it.last,L!==null?L.sibling=lt:F.child=lt,it.last=lt)}return it.tail!==null?(F=it.tail,it.rendering=F,it.tail=F.sibling,it.renderingStartTime=rn(),F.sibling=null,L=ct.current,Se(ct,$?L&1|2:L&1),F):(ri(F),null);case 22:case 23:return Dc(),$=F.memoizedState!==null,L!==null&&L.memoizedState!==null!==$&&(F.flags|=8192),$&&F.mode&1?ls&1073741824&&(ri(F),ot&&F.subtreeFlags&6&&(F.flags|=8192)):ri(F),null;case 24:return null;case 25:return null}throw Error(s(156,F.tag))}var Ug=y.ReactCurrentOwner,ss=!1;function Fn(L,F,W,$){F.child=L===null?bh(F,null,W,$):Vr(F,L.child,W,$)}function Sp(L,F,W,$,it){W=W.render;var lt=F.ref;return Ys(F,it),$=me(L,F,W,$,lt,it),W=be(),L!==null&&!ss?(F.updateQueue=L.updateQueue,F.flags&=-2053,L.lanes&=~it,tr(L,F,it)):(qi&&W&&zl(F),F.flags|=1,Fn(L,F,$,it),F.child)}function Tp(L,F,W,$,it){if(L===null){var lt=W.type;return typeof lt=="function"&&!Gc(lt)&<.defaultProps===void 0&&W.compare===null&&W.defaultProps===void 0?(F.tag=15,F.type=lt,Ep(L,F,lt,$,it)):(L=sf(W.type,null,$,F,F.mode,it),L.ref=F.ref,L.return=F,F.child=L)}if(lt=L.child,!(L.lanes&it)){var wt=lt.memoizedProps;if(W=W.compare,W=W!==null?W:xn,W(wt,$)&&L.ref===F.ref)return tr(L,F,it)}return F.flags|=1,L=Ka(lt,$),L.ref=F.ref,L.return=F,F.child=L}function Ep(L,F,W,$,it){if(L!==null&&xn(L.memoizedProps,$)&&L.ref===F.ref)if(ss=!1,(L.lanes&it)!==0)L.flags&131072&&(ss=!0);else return F.lanes=L.lanes,tr(L,F,it);return js(L,F,W,$,it)}function Mp(L,F,W){var $=F.pendingProps,it=$.children,lt=L!==null?L.memoizedState:null;if($.mode==="hidden")if(!(F.mode&1))F.memoizedState={baseLanes:0,cachePool:null},Se(jl,ls),ls|=W;else if(W&1073741824)F.memoizedState={baseLanes:0,cachePool:null},$=lt!==null?lt.baseLanes:W,Se(jl,ls),ls|=$;else return L=lt!==null?lt.baseLanes|W:W,F.lanes=F.childLanes=1073741824,F.memoizedState={baseLanes:L,cachePool:null},F.updateQueue=null,Se(jl,ls),ls|=L,null;else lt!==null?($=lt.baseLanes|W,F.memoizedState=null):$=W,Se(jl,ls),ls|=$;return Fn(L,F,it,W),F.child}function Cp(L,F){var W=F.ref;(L===null&&W!==null||L!==null&&L.ref!==W)&&(F.flags|=512,F.flags|=2097152)}function js(L,F,W,$,it){var lt=vn(W)?Ni:gi.current;return lt=Vn(F,lt),Ys(F,it),W=me(L,F,W,$,lt,it),$=be(),L!==null&&!ss?(F.updateQueue=L.updateQueue,F.flags&=-2053,L.lanes&=~it,tr(L,F,it)):(qi&&$&&zl(F),F.flags|=1,Fn(L,F,W,it),F.child)}function wp(L,F,W,$,it){if(vn(W)){var lt=!0;En(F)}else lt=!1;if(Ys(F,it),F.stateNode===null)L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),Zo(F,W,$),Ga(F,W,$,it),$=!0;else if(L===null){var wt=F.stateNode,Xt=F.memoizedProps;wt.props=Xt;var oe=wt.context,Ee=W.contextType;typeof Ee=="object"&&Ee!==null?Ee=Qi(Ee):(Ee=vn(W)?Ni:gi.current,Ee=Vn(F,Ee));var He=W.getDerivedStateFromProps,mi=typeof He=="function"||typeof wt.getSnapshotBeforeUpdate=="function";mi||typeof wt.UNSAFE_componentWillReceiveProps!="function"&&typeof wt.componentWillReceiveProps!="function"||(Xt!==$||oe!==Ee)&&Jo(F,wt,$,Ee),Sn=!1;var Qe=F.memoizedState;wt.state=Qe,Yr(F,$,wt,it),oe=F.memoizedState,Xt!==$||Qe!==oe||fn.current||Sn?(typeof He=="function"&&(ts(F,W,He,$),oe=F.memoizedState),(Xt=Sn||Ul(F,W,Xt,$,Qe,oe,Ee))?(mi||typeof wt.UNSAFE_componentWillMount!="function"&&typeof wt.componentWillMount!="function"||(typeof wt.componentWillMount=="function"&&wt.componentWillMount(),typeof wt.UNSAFE_componentWillMount=="function"&&wt.UNSAFE_componentWillMount()),typeof wt.componentDidMount=="function"&&(F.flags|=4194308)):(typeof wt.componentDidMount=="function"&&(F.flags|=4194308),F.memoizedProps=$,F.memoizedState=oe),wt.props=$,wt.state=oe,wt.context=Ee,$=Xt):(typeof wt.componentDidMount=="function"&&(F.flags|=4194308),$=!1)}else{wt=F.stateNode,Ua(L,F),Xt=F.memoizedProps,Ee=F.type===F.elementType?Xt:bn(F.type,Xt),wt.props=Ee,mi=F.pendingProps,Qe=wt.context,oe=W.contextType,typeof oe=="object"&&oe!==null?oe=Qi(oe):(oe=vn(W)?Ni:gi.current,oe=Vn(F,oe));var tn=W.getDerivedStateFromProps;(He=typeof tn=="function"||typeof wt.getSnapshotBeforeUpdate=="function")||typeof wt.UNSAFE_componentWillReceiveProps!="function"&&typeof wt.componentWillReceiveProps!="function"||(Xt!==mi||Qe!==oe)&&Jo(F,wt,$,oe),Sn=!1,Qe=F.memoizedState,wt.state=Qe,Yr(F,$,wt,it);var Xe=F.memoizedState;Xt!==mi||Qe!==Xe||fn.current||Sn?(typeof tn=="function"&&(ts(F,W,tn,$),Xe=F.memoizedState),(Ee=Sn||Ul(F,W,Ee,$,Qe,Xe,oe)||!1)?(He||typeof wt.UNSAFE_componentWillUpdate!="function"&&typeof wt.componentWillUpdate!="function"||(typeof wt.componentWillUpdate=="function"&&wt.componentWillUpdate($,Xe,oe),typeof wt.UNSAFE_componentWillUpdate=="function"&&wt.UNSAFE_componentWillUpdate($,Xe,oe)),typeof wt.componentDidUpdate=="function"&&(F.flags|=4),typeof wt.getSnapshotBeforeUpdate=="function"&&(F.flags|=1024)):(typeof wt.componentDidUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=4),typeof wt.getSnapshotBeforeUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=1024),F.memoizedProps=$,F.memoizedState=Xe),wt.props=$,wt.state=Xe,wt.context=oe,$=Ee):(typeof wt.componentDidUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=4),typeof wt.getSnapshotBeforeUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=1024),$=!1)}return yc(L,F,W,$,lt,it)}function yc(L,F,W,$,it,lt){Cp(L,F);var wt=(F.flags&128)!==0;if(!$&&!wt)return it&&la(F,W,!1),tr(L,F,lt);$=F.stateNode,Ug.current=F;var Xt=wt&&typeof W.getDerivedStateFromError!="function"?null:$.render();return F.flags|=1,L!==null&&wt?(F.child=Vr(F,L.child,null,lt),F.child=Vr(F,null,Xt,lt)):Fn(L,F,Xt,lt),F.memoizedState=$.state,it&&la(F,W,!0),F.child}function Ap(L){var F=L.stateNode;F.pendingContext?pr(L,F.pendingContext,F.pendingContext!==F.context):F.context&&pr(L,F.context,!1),pt(L,F.containerInfo)}function Pp(L,F,W,$,it){return go(),Va(it),F.flags|=256,Fn(L,F,W,$),F.child}var Xu={dehydrated:null,treeContext:null,retryLane:0};function As(L){return{baseLanes:L,cachePool:null}}function Rp(L,F,W){var $=F.pendingProps,it=ct.current,lt=!1,wt=(F.flags&128)!==0,Xt;if((Xt=wt)||(Xt=L!==null&&L.memoizedState===null?!1:(it&2)!==0),Xt?(lt=!0,F.flags&=-129):(L===null||L.memoizedState!==null)&&(it|=1),Se(ct,it&1),L===null)return dn(F),L=F.memoizedState,L!==null&&(L=L.dehydrated,L!==null)?(F.mode&1?oa(L)?F.lanes=8:F.lanes=1073741824:F.lanes=1,null):(it=$.children,L=$.fallback,lt?($=F.mode,lt=F.child,it={mode:"hidden",children:it},!($&1)&<!==null?(lt.childLanes=0,lt.pendingProps=it):lt=jh(it,$,0,null),L=Fo(L,$,W,null),lt.return=F,L.return=F,lt.sibling=L,F.child=lt,F.child.memoizedState=As(W),F.memoizedState=Xu,L):xc(F,it));if(it=L.memoizedState,it!==null){if(Xt=it.dehydrated,Xt!==null){if(wt)return F.flags&256?(F.flags&=-257,Yu(L,F,W,Error(s(422)))):F.memoizedState!==null?(F.child=L.child,F.flags|=128,null):(lt=$.fallback,it=F.mode,$=jh({mode:"visible",children:$.children},it,0,null),lt=Fo(lt,it,W,null),lt.flags|=2,$.return=F,lt.return=F,$.sibling=lt,F.child=$,F.mode&1&&Vr(F,L.child,null,W),F.child.memoizedState=As(W),F.memoizedState=Xu,lt);if(!(F.mode&1))F=Yu(L,F,W,null);else if(oa(Xt))F=Yu(L,F,W,Error(s(419)));else if($=(W&L.childLanes)!==0,ss||$){if($=Xn,$!==null){switch(W&-W){case 4:lt=2;break;case 16:lt=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:lt=32;break;case 536870912:lt=268435456;break;default:lt=0}$=lt&($.suspendedLanes|W)?0:lt,$!==0&&$!==it.retryLane&&(it.retryLane=$,Ps(L,$,-1))}ef(),F=Yu(L,F,W,Error(s(421)))}else Ra(Xt)?(F.flags|=128,F.child=L.child,F=Lo.bind(null,L),Us(Xt,F),F=null):(W=it.treeContext,gt&&(Wn=zs(Xt),Qn=F,qi=!0,ns=null,mo=!1,W!==null&&(ar[or++]=Ms,ar[or++]=is,ar[or++]=ca,Ms=W.id,is=W.overflow,ca=F)),F=xc(F,F.pendingProps.children),F.flags|=4096);return F}return lt?($=Lp(L,F,$.children,$.fallback,W),lt=F.child,it=L.child.memoizedState,lt.memoizedState=it===null?As(W):{baseLanes:it.baseLanes|W,cachePool:null},lt.childLanes=L.childLanes&~W,F.memoizedState=Xu,$):(W=bp(L,F,$.children,W),F.memoizedState=null,W)}return lt?($=Lp(L,F,$.children,$.fallback,W),lt=F.child,it=L.child.memoizedState,lt.memoizedState=it===null?As(W):{baseLanes:it.baseLanes|W,cachePool:null},lt.childLanes=L.childLanes&~W,F.memoizedState=Xu,$):(W=bp(L,F,$.children,W),F.memoizedState=null,W)}function xc(L,F){return F=jh({mode:"visible",children:F},L.mode,0,null),F.return=L,L.child=F}function bp(L,F,W,$){var it=L.child;return L=it.sibling,W=Ka(it,{mode:"visible",children:W}),!(F.mode&1)&&(W.lanes=$),W.return=F,W.sibling=null,L!==null&&($=F.deletions,$===null?(F.deletions=[L],F.flags|=16):$.push(L)),F.child=W}function Lp(L,F,W,$,it){var lt=F.mode;L=L.child;var wt=L.sibling,Xt={mode:"hidden",children:W};return!(lt&1)&&F.child!==L?(W=F.child,W.childLanes=0,W.pendingProps=Xt,F.deletions=null):(W=Ka(L,Xt),W.subtreeFlags=L.subtreeFlags&14680064),wt!==null?$=Ka(wt,$):($=Fo($,lt,it,null),$.flags|=2),$.return=F,W.return=F,W.sibling=$,F.child=W,$}function Yu(L,F,W,$){return $!==null&&Va($),Vr(F,L.child,null,W),L=xc(F,F.pendingProps.children),L.flags|=2,F.memoizedState=null,L}function Eo(L,F,W){L.lanes|=F;var $=L.alternate;$!==null&&($.lanes|=F),Ba(L.return,F,W)}function Sc(L,F,W,$,it){var lt=L.memoizedState;lt===null?L.memoizedState={isBackwards:F,rendering:null,renderingStartTime:0,last:$,tail:W,tailMode:it}:(lt.isBackwards=F,lt.rendering=null,lt.renderingStartTime=0,lt.last=$,lt.tail=W,lt.tailMode=it)}function Fp(L,F,W){var $=F.pendingProps,it=$.revealOrder,lt=$.tail;if(Fn(L,F,$.children,W),$=ct.current,$&2)$=$&1|2,F.flags|=128;else{if(L!==null&&L.flags&128)t:for(L=F.child;L!==null;){if(L.tag===13)L.memoizedState!==null&&Eo(L,W,F);else if(L.tag===19)Eo(L,W,F);else if(L.child!==null){L.child.return=L,L=L.child;continue}if(L===F)break t;for(;L.sibling===null;){if(L.return===null||L.return===F)break t;L=L.return}L.sibling.return=L.return,L=L.sibling}$&=1}if(Se(ct,$),!(F.mode&1))F.memoizedState=null;else switch(it){case"forwards":for(W=F.child,it=null;W!==null;)L=W.alternate,L!==null&&St(L)===null&&(it=W),W=W.sibling;W=it,W===null?(it=F.child,F.child=null):(it=W.sibling,W.sibling=null),Sc(F,!1,it,W,lt);break;case"backwards":for(W=null,it=F.child,F.child=null;it!==null;){if(L=it.alternate,L!==null&&St(L)===null){F.child=it;break}L=it.sibling,it.sibling=W,W=it,it=L}Sc(F,!0,W,null,lt);break;case"together":Sc(F,!1,null,null,void 0);break;default:F.memoizedState=null}return F.child}function tr(L,F,W){if(L!==null&&(F.dependencies=L.dependencies),Zl|=F.lanes,!(W&F.childLanes))return null;if(L!==null&&F.child!==L.child)throw Error(s(153));if(F.child!==null){for(L=F.child,W=Ka(L,L.pendingProps),F.child=W,W.return=F;L.sibling!==null;)L=L.sibling,W=W.sibling=Ka(L,L.pendingProps),W.return=F;W.sibling=null}return F.child}function zg(L,F,W){switch(F.tag){case 3:Ap(F),go();break;case 5:Nt(F);break;case 1:vn(F.type)&&En(F);break;case 4:pt(F,F.stateNode.containerInfo);break;case 10:Il(F,F.type._context,F.memoizedProps.value);break;case 13:var $=F.memoizedState;if($!==null)return $.dehydrated!==null?(Se(ct,ct.current&1),F.flags|=128,null):W&F.child.childLanes?Rp(L,F,W):(Se(ct,ct.current&1),L=tr(L,F,W),L!==null?L.sibling:null);Se(ct,ct.current&1);break;case 19:if($=(W&F.childLanes)!==0,L.flags&128){if($)return Fp(L,F,W);F.flags|=128}var it=F.memoizedState;if(it!==null&&(it.rendering=null,it.tail=null,it.lastEffect=null),Se(ct,ct.current),$)break;return null;case 22:case 23:return F.lanes=0,Mp(L,F,W)}return tr(L,F,W)}function Gg(L,F){switch(lr(F),F.tag){case 1:return vn(F.type)&&Ki(),L=F.flags,L&65536?(F.flags=L&-65537|128,F):null;case 3:return Mt(),ei(fn),ei(gi),Ft(),L=F.flags,L&65536&&!(L&128)?(F.flags=L&-65537|128,F):null;case 5:return zt(F),null;case 13:if(ei(ct),L=F.memoizedState,L!==null&&L.dehydrated!==null){if(F.alternate===null)throw Error(s(340));go()}return L=F.flags,L&65536?(F.flags=L&-65537|128,F):null;case 19:return ei(ct),null;case 4:return Mt(),null;case 10:return Nl(F.type._context),null;case 22:case 23:return Dc(),null;case 24:return null;default:return null}}var ku=!1,el=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,De=null;function Uh(L,F){var W=L.ref;if(W!==null)if(typeof W=="function")try{W(null)}catch($){Rr(L,F,$)}else W.current=null}function Tc(L,F,W){try{W()}catch($){Rr(L,F,$)}}var Op=!1;function Ec(L,F){for(X(L.containerInfo),De=F;De!==null;)if(L=De,F=L.child,(L.subtreeFlags&1028)!==0&&F!==null)F.return=L,De=F;else for(;De!==null;){L=De;try{var W=L.alternate;if(L.flags&1024)switch(L.tag){case 0:case 11:case 15:break;case 1:if(W!==null){var $=W.memoizedProps,it=W.memoizedState,lt=L.stateNode,wt=lt.getSnapshotBeforeUpdate(L.elementType===L.type?$:bn(L.type,$),it);lt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:ot&&Ce(L.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Xt){Rr(L,L.return,Xt)}if(F=L.sibling,F!==null){F.return=L.return,De=F;break}De=L.return}return W=Op,Op=!1,W}function Ks(L,F,W){var $=F.updateQueue;if($=$!==null?$.lastEffect:null,$!==null){var it=$=$.next;do{if((it.tag&L)===L){var lt=it.destroy;it.destroy=void 0,lt!==void 0&&Tc(F,W,lt)}it=it.next}while(it!==$)}}function Mo(L,F){if(F=F.updateQueue,F=F!==null?F.lastEffect:null,F!==null){var W=F=F.next;do{if((W.tag&L)===L){var $=W.create;W.destroy=$()}W=W.next}while(W!==F)}}function Mc(L){var F=L.ref;if(F!==null){var W=L.stateNode;switch(L.tag){case 5:L=B(W);break;default:L=W}typeof F=="function"?F(L):F.current=L}}function Cc(L,F,W){if(Sr&&typeof Sr.onCommitFiberUnmount=="function")try{Sr.onCommitFiberUnmount(po,F)}catch{}switch(F.tag){case 0:case 11:case 14:case 15:if(L=F.updateQueue,L!==null&&(L=L.lastEffect,L!==null)){var $=L=L.next;do{var it=$,lt=it.destroy;it=it.tag,lt!==void 0&&(it&2||it&4)&&Tc(F,W,lt),$=$.next}while($!==L)}break;case 1:if(Uh(F,W),L=F.stateNode,typeof L.componentWillUnmount=="function")try{L.props=F.memoizedProps,L.state=F.memoizedState,L.componentWillUnmount()}catch(wt){Rr(F,W,wt)}break;case 5:Uh(F,W);break;case 4:ot?Ac(L,F,W):rt&&rt&&(F=F.stateNode.containerInfo,W=Ve(F),Ii(F,W))}}function Dp(L,F,W){for(var $=F;;)if(Cc(L,$,W),$.child===null||ot&&$.tag===4){if($===F)break;for(;$.sibling===null;){if($.return===null||$.return===F)return;$=$.return}$.sibling.return=$.return,$=$.sibling}else $.child.return=$,$=$.child}function va(L){var F=L.alternate;F!==null&&(L.alternate=null,va(F)),L.child=null,L.deletions=null,L.sibling=null,L.tag===5&&(F=L.stateNode,F!==null&&Pt(F)),L.stateNode=null,L.return=null,L.dependencies=null,L.memoizedProps=null,L.memoizedState=null,L.pendingProps=null,L.stateNode=null,L.updateQueue=null}function ju(L){return L.tag===5||L.tag===3||L.tag===4}function Co(L){t:for(;;){for(;L.sibling===null;){if(L.return===null||ju(L.return))return null;L=L.return}for(L.sibling.return=L.return,L=L.sibling;L.tag!==5&&L.tag!==6&&L.tag!==18;){if(L.flags&2||L.child===null||L.tag===4)continue t;L.child.return=L,L=L.child}if(!(L.flags&2))return L.stateNode}}function as(L){if(ot){t:{for(var F=L.return;F!==null;){if(ju(F))break t;F=F.return}throw Error(s(160))}var W=F;switch(W.tag){case 5:F=W.stateNode,W.flags&32&&(si(F),W.flags&=-33),W=Co(L),Ku(L,W,F);break;case 3:case 4:F=W.stateNode.containerInfo,W=Co(L),wc(L,W,F);break;default:throw Error(s(161))}}}function wc(L,F,W){var $=L.tag;if($===5||$===6)L=L.stateNode,F?Le(W,L,F):Pe(W,L);else if($!==4&&(L=L.child,L!==null))for(wc(L,F,W),L=L.sibling;L!==null;)wc(L,F,W),L=L.sibling}function Ku(L,F,W){var $=L.tag;if($===5||$===6)L=L.stateNode,F?Be(W,L,F):xe(W,L);else if($!==4&&(L=L.child,L!==null))for(Ku(L,F,W),L=L.sibling;L!==null;)Ku(L,F,W),L=L.sibling}function Ac(L,F,W){for(var $=F,it=!1,lt,wt;;){if(!it){it=$.return;t:for(;;){if(it===null)throw Error(s(160));switch(lt=it.stateNode,it.tag){case 5:wt=!1;break t;case 3:lt=lt.containerInfo,wt=!0;break t;case 4:lt=lt.containerInfo,wt=!0;break t}it=it.return}it=!0}if($.tag===5||$.tag===6)Dp(L,$,W),wt?je(lt,$.stateNode):ne(lt,$.stateNode);else if($.tag===18)wt?ee(lt,$.stateNode):ie(lt,$.stateNode);else if($.tag===4){if($.child!==null){lt=$.stateNode.containerInfo,wt=!0,$.child.return=$,$=$.child;continue}}else if(Cc(L,$,W),$.child!==null){$.child.return=$,$=$.child;continue}if($===F)break;for(;$.sibling===null;){if($.return===null||$.return===F)return;$=$.return,$.tag===4&&(it=!1)}$.sibling.return=$.return,$=$.sibling}}function il(L,F){if(ot){switch(F.tag){case 0:case 11:case 14:case 15:Ks(3,F,F.return),Mo(3,F),Ks(5,F,F.return);return;case 1:return;case 5:var W=F.stateNode;if(W!=null){var $=F.memoizedProps;L=L!==null?L.memoizedProps:$;var it=F.type,lt=F.updateQueue;F.updateQueue=null,lt!==null&&Oe(W,lt,it,L,$,F)}return;case 6:if(F.stateNode===null)throw Error(s(162));W=F.memoizedProps,te(F.stateNode,L!==null?L.memoizedProps:W,W);return;case 3:gt&&L!==null&&L.memoizedState.isDehydrated&&Zt(F.stateNode.containerInfo);return;case 12:return;case 13:Zs(F);return;case 19:Zs(F);return;case 17:return}throw Error(s(163))}switch(F.tag){case 0:case 11:case 14:case 15:Ks(3,F,F.return),Mo(3,F),Ks(5,F,F.return);return;case 12:return;case 13:Zs(F);return;case 19:Zs(F);return;case 3:gt&&L!==null&&L.memoizedState.isDehydrated&&Zt(F.stateNode.containerInfo);break;case 22:case 23:return}t:if(rt){switch(F.tag){case 1:case 5:case 6:break t;case 3:case 4:F=F.stateNode,Ii(F.containerInfo,F.pendingChildren);break t}throw Error(s(163))}}function Zs(L){var F=L.updateQueue;if(F!==null){L.updateQueue=null;var W=L.stateNode;W===null&&(W=L.stateNode=new Vg),F.forEach(function($){var it=Hp.bind(null,L,$);W.has($)||(W.add($),$.then(it,it))})}}function Ip(L,F){for(De=F;De!==null;){F=De;var W=F.deletions;if(W!==null)for(var $=0;$";case Gh:return":has("+(Vh(L)||"")+")";case os:return'[role="'+L.value+'"]';case nl:return'"'+L.value+'"';case Yl:return'[data-testname="'+L.value+'"]';default:throw Error(s(365))}}function Bp(L,F){var W=[];L=[L,0];for(var $=0;$it&&(it=wt),$&=~lt}if($=it,$=rn()-$,$=(120>$?120:480>$?480:1080>$?1080:1920>$?1920:3e3>$?3e3:4320>$?4320:1960*Wg($/1960))-$,10<$){L.timeoutHandle=J(Po.bind(null,L,wr),$);break}Po(L,wr);break;case 5:Po(L,wr);break;default:throw Error(s(329))}}}return ii(L,rn()),L.callbackNode===W?Up.bind(null,L):null}function Oc(L,F){var W=Jl;return L.current.memoizedState.isDehydrated&&(ga(L,F).flags|=256),L=Pr(L,F),L!==2&&(F=wr,wr=W,F!==null&&sl(F)),L}function sl(L){wr===null?wr=L:wr.push.apply(wr,L)}function zp(L){for(var F=L;;){if(F.flags&16384){var W=F.updateQueue;if(W!==null&&(W=W.stores,W!==null))for(var $=0;$L?16:L,ja===null)var $=!1;else{if(L=ja,ja=null,Xh=0,Ci&6)throw Error(s(331));var it=Ci;for(Ci|=4,De=L.current;De!==null;){var lt=De,wt=lt.child;if(De.flags&16){var Xt=lt.deletions;if(Xt!==null){for(var oe=0;oern()-Fc?ga(L,0):Lc|=W),ii(L,F)}function Vp(L,F){F===0&&(L.mode&1?(F=fo,fo<<=1,!(fo&130023424)&&(fo=4194304)):F=1);var W=Ar();L=Ql(L,F),L!==null&&(Ws(L,F,W),ii(L,W))}function Lo(L){var F=L.memoizedState,W=0;F!==null&&(W=F.retryLane),Vp(L,W)}function Hp(L,F){var W=0;switch(L.tag){case 13:var $=L.stateNode,it=L.memoizedState;it!==null&&(W=it.retryLane);break;case 19:$=L.stateNode;break;default:throw Error(s(314))}$!==null&&$.delete(F),Vp(L,W)}var zc;zc=function(L,F,W){if(L!==null)if(L.memoizedProps!==F.pendingProps||fn.current)ss=!0;else{if(!(L.lanes&W)&&!(F.flags&128))return ss=!1,zg(L,F,W);ss=!!(L.flags&131072)}else ss=!1,qi&&F.flags&1048576&&Rh(F,$o,F.index);switch(F.lanes=0,F.tag){case 2:var $=F.type;L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),L=F.pendingProps;var it=Vn(F,gi.current);Ys(F,W),it=me(null,F,$,L,it,W);var lt=be();return F.flags|=1,typeof it=="object"&&it!==null&&typeof it.render=="function"&&it.$$typeof===void 0?(F.tag=1,F.memoizedState=null,F.updateQueue=null,vn($)?(lt=!0,En(F)):lt=!1,F.memoizedState=it.state!==null&&it.state!==void 0?it.state:null,Hn(F),it.updater=vo,F.stateNode=it,it._reactInternals=F,Ga(F,$,L,W),F=yc(null,F,$,!0,lt,W)):(F.tag=0,qi&<&&zl(F),Fn(null,F,it,W),F=F.child),F;case 16:$=F.elementType;t:{switch(L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),L=F.pendingProps,it=$._init,$=it($._payload),F.type=$,it=F.tag=Wp($),L=bn($,L),it){case 0:F=js(null,F,$,L,W);break t;case 1:F=wp(null,F,$,L,W);break t;case 11:F=Sp(null,F,$,L,W);break t;case 14:F=Tp(null,F,$,bn($.type,L),W);break t}throw Error(s(306,$,""))}return F;case 0:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:bn($,it),js(L,F,$,it,W);case 1:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:bn($,it),wp(L,F,$,it,W);case 3:t:{if(Ap(F),L===null)throw Error(s(387));$=F.pendingProps,lt=F.memoizedState,it=lt.element,Ua(L,F),Yr(F,$,null,W);var wt=F.memoizedState;if($=wt.element,gt&<.isDehydrated)if(lt={element:$,isDehydrated:!1,cache:wt.cache,transitions:wt.transitions},F.updateQueue.baseState=lt,F.memoizedState=lt,F.flags&256){it=Error(s(423)),F=Pp(L,F,$,W,it);break t}else if($!==it){it=Error(s(424)),F=Pp(L,F,$,W,it);break t}else for(gt&&(Wn=qr(F.stateNode.containerInfo),Qn=F,qi=!0,ns=null,mo=!1),W=bh(F,null,$,W),F.child=W;W;)W.flags=W.flags&-3|4096,W=W.sibling;else{if(go(),$===it){F=tr(L,F,W);break t}Fn(L,F,$,W)}F=F.child}return F;case 5:return Nt(F),L===null&&dn(F),$=F.type,it=F.pendingProps,lt=L!==null?L.memoizedProps:null,wt=it.children,U($,it)?wt=null:lt!==null&&U($,lt)&&(F.flags|=32),Cp(L,F),Fn(L,F,wt,W),F.child;case 6:return L===null&&dn(F),null;case 13:return Rp(L,F,W);case 4:return pt(F,F.stateNode.containerInfo),$=F.pendingProps,L===null?F.child=Vr(F,null,$,W):Fn(L,F,$,W),F.child;case 11:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:bn($,it),Sp(L,F,$,it,W);case 7:return Fn(L,F,F.pendingProps,W),F.child;case 8:return Fn(L,F,F.pendingProps.children,W),F.child;case 12:return Fn(L,F,F.pendingProps.children,W),F.child;case 10:t:{if($=F.type._context,it=F.pendingProps,lt=F.memoizedProps,wt=it.value,Il(F,$,wt),lt!==null)if(Es(lt.value,wt)){if(lt.children===it.children&&!fn.current){F=tr(L,F,W);break t}}else for(lt=F.child,lt!==null&&(lt.return=F);lt!==null;){var Xt=lt.dependencies;if(Xt!==null){wt=lt.child;for(var oe=Xt.firstContext;oe!==null;){if(oe.context===$){if(lt.tag===1){oe=Cn(-1,W&-W),oe.tag=2;var Ee=lt.updateQueue;if(Ee!==null){Ee=Ee.shared;var He=Ee.pending;He===null?oe.next=oe:(oe.next=He.next,He.next=oe),Ee.pending=oe}}lt.lanes|=W,oe=lt.alternate,oe!==null&&(oe.lanes|=W),Ba(lt.return,W,F),Xt.lanes|=W;break}oe=oe.next}}else if(lt.tag===10)wt=lt.type===F.type?null:lt.child;else if(lt.tag===18){if(wt=lt.return,wt===null)throw Error(s(341));wt.lanes|=W,Xt=wt.alternate,Xt!==null&&(Xt.lanes|=W),Ba(wt,W,F),wt=lt.sibling}else wt=lt.child;if(wt!==null)wt.return=lt;else for(wt=lt;wt!==null;){if(wt===F){wt=null;break}if(lt=wt.sibling,lt!==null){lt.return=wt.return,wt=lt;break}wt=wt.return}lt=wt}Fn(L,F,it.children,W),F=F.child}return F;case 9:return it=F.type,$=F.pendingProps.children,Ys(F,W),it=Qi(it),$=$(it),F.flags|=1,Fn(L,F,$,W),F.child;case 14:return $=F.type,it=bn($,F.pendingProps),it=bn($.type,it),Tp(L,F,$,it,W);case 15:return Ep(L,F,F.type,F.pendingProps,W);case 17:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:bn($,it),L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),F.tag=1,vn($)?(L=!0,En(F)):L=!1,Ys(F,W),Zo(F,$,it),Ga(F,$,it,W),yc(null,F,$,!0,L,W);case 19:return Fp(L,F,W);case 22:return Mp(L,F,W)}throw Error(s(156,F.tag))};function rf(L,F){return Ur(L,F)}function Xg(L,F,W,$){this.tag=L,this.key=W,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=F,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=$,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rs(L,F,W,$){return new Xg(L,F,W,$)}function Gc(L){return L=L.prototype,!(!L||!L.isReactComponent)}function Wp(L){if(typeof L=="function")return Gc(L)?1:0;if(L!=null){if(L=L.$$typeof,L===u)return 11;if(L===c)return 14}return 2}function Ka(L,F){var W=L.alternate;return W===null?(W=Rs(L.tag,F,L.key,L.mode),W.elementType=L.elementType,W.type=L.type,W.stateNode=L.stateNode,W.alternate=L,L.alternate=W):(W.pendingProps=F,W.type=L.type,W.flags=0,W.subtreeFlags=0,W.deletions=null),W.flags=L.flags&14680064,W.childLanes=L.childLanes,W.lanes=L.lanes,W.child=L.child,W.memoizedProps=L.memoizedProps,W.memoizedState=L.memoizedState,W.updateQueue=L.updateQueue,F=L.dependencies,W.dependencies=F===null?null:{lanes:F.lanes,firstContext:F.firstContext},W.sibling=L.sibling,W.index=L.index,W.ref=L.ref,W}function sf(L,F,W,$,it,lt){var wt=2;if($=L,typeof L=="function")Gc(L)&&(wt=1);else if(typeof L=="string")wt=5;else t:switch(L){case p:return Fo(W.children,it,lt,F);case h:wt=8,it|=8;break;case a:return L=Rs(12,W,F,it|2),L.elementType=a,L.lanes=lt,L;case f:return L=Rs(13,W,F,it),L.elementType=f,L.lanes=lt,L;case o:return L=Rs(19,W,F,it),L.elementType=o,L.lanes=lt,L;case v:return jh(W,it,lt,F);default:if(typeof L=="object"&&L!==null)switch(L.$$typeof){case l:wt=10;break t;case n:wt=9;break t;case u:wt=11;break t;case c:wt=14;break t;case d:wt=16,$=null;break t}throw Error(s(130,L==null?L:typeof L,""))}return F=Rs(wt,W,F,it),F.elementType=L,F.type=$,F.lanes=lt,F}function Fo(L,F,W,$){return L=Rs(7,L,$,F),L.lanes=W,L}function jh(L,F,W,$){return L=Rs(22,L,$,F),L.elementType=v,L.lanes=W,L.stateNode={},L}function br(L,F,W){return L=Rs(6,L,null,F),L.lanes=W,L}function bs(L,F,W){return F=Rs(4,L.children!==null?L.children:[],L.key,F),F.lanes=W,F.stateNode={containerInfo:L.containerInfo,pendingChildren:null,implementation:L.implementation},F}function Yg(L,F,W,$,it){this.tag=F,this.containerInfo=L,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hs(0),this.expirationTimes=Hs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hs(0),this.identifierPrefix=$,this.onRecoverableError=it,gt&&(this.mutableSourceEagerHydrationData=null)}function Xp(L,F,W,$,it,lt,wt,Xt,oe){return L=new Yg(L,F,W,Xt,oe),F===1?(F=1,lt===!0&&(F|=8)):F=0,lt=Rs(3,null,null,F),L.current=lt,lt.stateNode=L,lt.memoizedState={element:$,isDehydrated:W,cache:null,transitions:null},Hn(lt),L}function Kh(L){if(!L)return Br;L=L._reactInternals;t:{if(C(L)!==L||L.tag!==1)throw Error(s(170));var F=L;do{switch(F.tag){case 3:F=F.stateNode.context;break t;case 1:if(vn(F.type)){F=F.stateNode.__reactInternalMemoizedMergedChildContext;break t}}F=F.return}while(F!==null);throw Error(s(171))}if(L.tag===1){var W=L.type;if(vn(W))return Gs(L,W,F)}return F}function al(L){var F=L._reactInternals;if(F===void 0)throw typeof L.render=="function"?Error(s(188)):(L=Object.keys(L).join(","),Error(s(268,L)));return L=b(F),L===null?null:L.stateNode}function Vc(L,F){if(L=L.memoizedState,L!==null&&L.dehydrated!==null){var W=L.retryLane;L.retryLane=W!==0&&W=Ee&<>=mi&&it<=He&&wt<=Qe){L.splice(F,1);break}else if($!==Ee||W.width!==oe.width||Qewt){if(!(lt!==mi||W.height!==oe.height||He<$||Ee>it)){Ee>$&&(oe.width+=Ee-$,oe.x=$),Helt&&(oe.height+=mi-lt,oe.y=lt),QeW&&(W=wt)),wt ")+` + +No matching component was found for: + `)+L.join(" > ")}return null},i.getPublicRootInstance=function(L){if(L=L.current,!L.child)return null;switch(L.child.tag){case 5:return B(L.child.stateNode);default:return L.child.stateNode}},i.injectIntoDevTools=function(L){if(L={bundleType:L.bundleType,version:L.version,rendererPackageName:L.rendererPackageName,rendererConfig:L.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:kg,findFiberByHostInstance:L.findFiberByHostInstance||Yp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")L=!1;else{var F=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(F.isDisabled||!F.supportsFiber)L=!0;else{try{po=F.inject(L),Sr=F}catch{}L=!!F.checkDCE}}return L},i.isAlreadyRendering=function(){return!1},i.observeVisibleRects=function(L,F,W,$){if(!ut)throw Error(s(363));L=Rc(L,F);var it=ge(L,W,$).disconnect;return{disconnect:function(){it()}}},i.registerMutableSourceForHydration=function(L,F){var W=F._getVersion;W=W(F._source),L.mutableSourceEagerHydrationData==null?L.mutableSourceEagerHydrationData=[F,W]:L.mutableSourceEagerHydrationData.push(F,W)},i.runWithPriority=function(L,F){var W=Bi;try{return Bi=L,F()}finally{Bi=W}},i.shouldError=function(){return null},i.shouldSuspend=function(){return!1},i.updateContainer=function(L,F,W,$){var it=F.current,lt=Ar(),wt=ma(it);return W=Kh(W),F.context===null?F.context=W:F.pendingContext=W,F=Cn(lt,wt),F.payload={element:L},$=$===void 0?null:$,$!==null&&(F.callback=$),Tr(it,F),L=Ps(it,wt,lt),L!==null&&ha(L,it,wt),wt},i};RA.exports=t7;var e7=RA.exports;const i7=kd(e7);var bA={exports:{}},LA={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(g){function t(z,X){var j=z.length;z.push(X);t:for(;0>>1,tt=z[Q];if(0>>1;QT(U,j))HT(J,U)?(z[Q]=J,z[H]=j,Q=H):(z[Q]=U,z[Z]=j,Q=Z);else if(HT(J,j))z[Q]=J,z[H]=j,Q=H;else break t}}return X}function T(z,X){var j=z.sortIndex-X.sortIndex;return j!==0?j:z.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var s=Date,y=s.now();g.unstable_now=function(){return s.now()-y}}var e=[],r=[],p=1,h=null,a=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var X=i(r);X!==null;){if(X.callback===null)x(r);else if(X.startTime<=z)x(r),X.sortIndex=X.expirationTime,t(e,X);else break;X=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(e)!==null)n=!0,B(m);else{var X=i(r);X!==null&&G(v,X.startTime-z)}}function m(z,X){n=!1,u&&(u=!1,o(w),w=-1),l=!0;var j=a;try{for(d(X),h=i(e);h!==null&&(!(h.expirationTime>X)||z&&!P());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,a=h.priorityLevel;var tt=Q(h.expirationTime<=X);X=g.unstable_now(),typeof tt=="function"?h.callback=tt:h===i(e)&&x(e),d(X)}else x(e);h=i(e)}if(h!==null)var Y=!0;else{var Z=i(r);Z!==null&&G(v,Z.startTime-X),Y=!1}return Y}finally{h=null,a=j,l=!1}}var S=!1,M=null,w=-1,C=5,A=-1;function P(){return!(g.unstable_now()-Az||125Q?(z.sortIndex=j,t(r,z),i(e)===null&&z===i(r)&&(u?(o(w),w=-1):u=!0,G(v,j-Q))):(z.sortIndex=tt,t(e,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var X=a;return function(){var j=a;a=X;try{return z.apply(this,arguments)}finally{a=j}}}})(LA);bA.exports=LA;var hM=bA.exports;const Z1={},n7=g=>void Object.assign(Z1,g);function r7(g,t){function i(p,{args:h=[],attach:a,...l},n){let u=`${p[0].toUpperCase()}${p.slice(1)}`,f;if(p==="primitive"){if(l.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const o=l.object;f=If(o,{type:p,root:n,attach:a,primitive:!0})}else{const o=Z1[u];if(!o)throw new Error(`R3F: ${u} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");f=If(new o(...h),{type:p,root:n,attach:a,memoizedProps:{args:h}})}return f.__r3f.attach===void 0&&(f instanceof Fi?f.__r3f.attach="geometry":f instanceof Wr&&(f.__r3f.attach="material")),u!=="inject"&&fy(f,l),f}function x(p,h){let a=!1;if(h){var l,n;(l=h.__r3f)!=null&&l.attach?uy(p,h,h.__r3f.attach):h.isObject3D&&p.isObject3D&&(p.add(h),a=!0),a||(n=p.__r3f)==null||n.objects.push(h),h.__r3f||If(h,{}),h.__r3f.parent=p,Lx(h),Nf(h)}}function T(p,h,a){let l=!1;if(h){var n,u;if((n=h.__r3f)!=null&&n.attach)uy(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){h.parent=p,h.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:h});const f=p.children.filter(c=>c!==h),o=f.indexOf(a);p.children=[...f.slice(0,o),h,...f.slice(o)],l=!0}l||(u=p.__r3f)==null||u.objects.push(h),h.__r3f||If(h,{}),h.__r3f.parent=p,Lx(h),Nf(h)}}function E(p,h,a=!1){p&&[...p].forEach(l=>s(h,l,a))}function s(p,h,a){if(h){var l,n,u;if(h.__r3f&&(h.__r3f.parent=null),(l=p.__r3f)!=null&&l.objects&&(p.__r3f.objects=p.__r3f.objects.filter(v=>v!==h)),(n=h.__r3f)!=null&&n.attach)pM(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){var f;p.remove(h),(f=h.__r3f)!=null&&f.root&&c7(dm(h),h)}const c=(u=h.__r3f)==null?void 0:u.primitive,d=!c&&(a===void 0?h.dispose!==null:a);if(!c){var o;E((o=h.__r3f)==null?void 0:o.objects,h,d),E(h.children,h,d)}if(delete h.__r3f,d&&h.dispose&&h.type!=="Scene"){const v=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?hM.unstable_scheduleCallback(hM.unstable_IdlePriority,v):v()}Nf(p)}}function y(p,h,a,l){var n;const u=(n=p.__r3f)==null?void 0:n.parent;if(!u)return;const f=i(h,a,p.__r3f.root);if(p.children){for(const o of p.children)o.__r3f&&x(f,o);p.children=p.children.filter(o=>!o.__r3f)}p.__r3f.objects.forEach(o=>x(f,o)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||s(u,p),f.parent&&(f.__r3f.autoRemovedBeforeAppend=!0),x(u,f),f.raycast&&f.__r3f.eventCount&&dm(f).getState().internal.interaction.push(f),[l,l.alternate].forEach(o=>{o!==null&&(o.stateNode=f,o.ref&&(typeof o.ref=="function"?o.ref(f):o.ref.current=f))})}const e=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:i7({createInstance:i,removeChild:s,appendChild:x,appendInitialChild:x,insertBefore:T,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,h)=>{if(!h)return;const a=p.getState().scene;a.__r3f&&(a.__r3f.root=p,x(a,h))},removeChildFromContainer:(p,h)=>{h&&s(p.getState().scene,h)},insertInContainerBefore:(p,h,a)=>{if(!h||!a)return;const l=p.getState().scene;l.__r3f&&T(l,h,a)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var h;return!!((h=p?.__r3f)!=null?h:{}).handlers},prepareUpdate(p,h,a,l){var n;if(((n=p?.__r3f)!=null?n:{}).primitive&&l.object&&l.object!==p)return[!0];{const{args:f=[],children:o,...c}=l,{args:d=[],children:v,...m}=a;if(!Array.isArray(f))throw new Error("R3F: the args prop must be an array!");if(f.some((M,w)=>M!==d[w]))return[!0];const S=UA(p,c,m,!0);return S.changes.length?[!1,S]:null}},commitUpdate(p,[h,a],l,n,u,f){h?y(p,l,u,f):fy(p,a)},commitMount(p,h,a,l){var n;const u=(n=p.__r3f)!=null?n:{};p.raycast&&u.handlers&&u.eventCount&&dm(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>If(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var h;const{attach:a,parent:l}=(h=p.__r3f)!=null?h:{};a&&l&&pM(l,p,a),p.isObject3D&&(p.visible=!1),Nf(p)},unhideInstance(p,h){var a;const{attach:l,parent:n}=(a=p.__r3f)!=null?a:{};l&&n&&uy(n,p,l),(p.isObject3D&&h.visible==null||h.visible)&&(p.visible=!0),Nf(p)},createTextInstance:e,hideTextInstance:e,unhideTextInstance:e,getCurrentEventPriority:()=>t?t():kf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&An.fun(performance.now)?performance.now:An.fun(Date.now)?Date.now:()=>0,scheduleTimeout:An.fun(setTimeout)?setTimeout:void 0,cancelTimeout:An.fun(clearTimeout)?clearTimeout:void 0}),applyProps:fy}}var uM,fM;const hy=g=>"colorSpace"in g||"outputColorSpace"in g,FA=()=>{var g;return(g=Z1.ColorManagement)!=null?g:null},OA=g=>g&&g.isOrthographicCamera,s7=g=>g&&g.hasOwnProperty("current"),lp=typeof window<"u"&&((uM=window.document)!=null&&uM.createElement||((fM=window.navigator)==null?void 0:fM.product)==="ReactNative")?Me.useLayoutEffect:Me.useEffect;function DA(g){const t=Me.useRef(g);return lp(()=>void(t.current=g),[g]),t}function a7({set:g}){return lp(()=>(g(new Promise(()=>null)),()=>g(!1)),[g]),null}class IA extends Me.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}IA.getDerivedStateFromError=()=>({error:!0});const NA="__default",cM=new Map,o7=g=>g&&!!g.memoized&&!!g.changes;function BA(g){var t;const i=typeof window<"u"?(t=window.devicePixelRatio)!=null?t:2:1;return Array.isArray(g)?Math.min(Math.max(g[0],i),g[1]):g}const rd=g=>{var t;return(t=g.__r3f)==null?void 0:t.root.getState()};function dm(g){let t=g.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const An={obj:g=>g===Object(g)&&!An.arr(g)&&typeof g!="function",fun:g=>typeof g=="function",str:g=>typeof g=="string",num:g=>typeof g=="number",boo:g=>typeof g=="boolean",und:g=>g===void 0,arr:g=>Array.isArray(g),equ(g,t,{arrays:i="shallow",objects:x="reference",strict:T=!0}={}){if(typeof g!=typeof t||!!g!=!!t)return!1;if(An.str(g)||An.num(g))return g===t;const E=An.obj(g);if(E&&x==="reference")return g===t;const s=An.arr(g);if(s&&i==="reference")return g===t;if((s||E)&&g===t)return!0;let y;for(y in g)if(!(y in t))return!1;if(E&&i==="shallow"&&x==="shallow"){for(y in T?t:g)if(!An.equ(g[y],t[y],{strict:T,objects:"reference"}))return!1}else for(y in T?t:g)if(g[y]!==t[y])return!1;if(An.und(y)){if(s&&g.length===0&&t.length===0||E&&Object.keys(g).length===0&&Object.keys(t).length===0)return!0;if(g!==t)return!1}return!0}};function l7(g){g.dispose&&g.type!=="Scene"&&g.dispose();for(const t in g)t.dispose==null||t.dispose(),delete g[t]}function If(g,t){const i=g;return i.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},g}function bx(g,t){let i=g;if(t.includes("-")){const x=t.split("-"),T=x.pop();return i=x.reduce((E,s)=>E[s],g),{target:i,key:T}}else return{target:i,key:t}}const dM=/-\d+$/;function uy(g,t,i){if(An.str(i)){if(dM.test(i)){const E=i.replace(dM,""),{target:s,key:y}=bx(g,E);Array.isArray(s[y])||(s[y]=[])}const{target:x,key:T}=bx(g,i);t.__r3f.previousAttach=x[T],x[T]=t}else t.__r3f.previousAttach=i(g,t)}function pM(g,t,i){var x,T;if(An.str(i)){const{target:E,key:s}=bx(g,i),y=t.__r3f.previousAttach;y===void 0?delete E[s]:E[s]=y}else(x=t.__r3f)==null||x.previousAttach==null||x.previousAttach(g,t);(T=t.__r3f)==null||delete T.previousAttach}function UA(g,{children:t,key:i,ref:x,...T},{children:E,key:s,ref:y,...e}={},r=!1){var p;const h=(p=g?.__r3f)!=null?p:{},a=Object.entries(T),l=[];if(r){const u=Object.keys(e);for(let f=0;f{var o;if((o=g.__r3f)!=null&&o.primitive&&u==="object"||An.equ(f,e[u]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(u))return l.push([u,f,!0,[]]);let c=[];u.includes("-")&&(c=u.split("-")),l.push([u,f,!1,c]);for(const d in T){const v=T[d];d.startsWith(`${u}-`)&&l.push([d,v,!1,d.split("-")])}});const n={...T};return h.memoizedProps&&h.memoizedProps.args&&(n.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(n.attach=h.memoizedProps.attach),{memoized:n,changes:l}}const h7=typeof process<"u"&&!1;function fy(g,t){var i,x,T;const E=(i=g.__r3f)!=null?i:{},s=E.root,y=(x=s==null||s.getState==null?void 0:s.getState())!=null?x:{},{memoized:e,changes:r}=o7(t)?t:UA(g,t),p=E.eventCount;g.__r3f&&(g.__r3f.memoizedProps=e);for(let a=0;ad[v],g),!(c&&c.set))){const[d,...v]=f.reverse();o=v.reverse().reduce((m,S)=>m[S],g),l=d}if(n===NA+"remove")if(o.constructor){let d=cM.get(o.constructor);d||(d=new o.constructor,cM.set(o.constructor,d)),n=d[l]}else n=0;if(u)n?E.handlers[l]=n:delete E.handlers[l],E.eventCount=Object.keys(E.handlers).length;else if(c&&c.set&&(c.copy||c instanceof Mu)){if(Array.isArray(n))c.fromArray?c.fromArray(n):c.set(...n);else if(c.copy&&n&&n.constructor&&(h7?c.constructor.name===n.constructor.name:c.constructor===n.constructor))c.copy(n);else if(n!==void 0){const d=c instanceof ze;!d&&c.setScalar?c.setScalar(n):c instanceof Mu&&n instanceof Mu?c.mask=n.mask:c.set(n),!FA()&&!y.linear&&d&&c.convertSRGBToLinear()}}else if(o[l]=n,o[l]instanceof zn&&o[l].format===vs&&o[l].type===Go){const d=o[l];hy(d)&&hy(y.gl)?d.colorSpace=y.gl.outputColorSpace:d.encoding=y.gl.outputEncoding}Nf(g)}if(E.parent&&g.raycast&&p!==E.eventCount){const a=dm(g).getState().internal,l=a.interaction.indexOf(g);l>-1&&a.interaction.splice(l,1),E.eventCount&&a.interaction.push(g)}return!(r.length===1&&r[0][0]==="onUpdate")&&r.length&&(T=g.__r3f)!=null&&T.parent&&Lx(g),g}function Nf(g){var t,i;const x=(t=g.__r3f)==null||(i=t.root)==null||i.getState==null?void 0:i.getState();x&&x.internal.frames===0&&x.invalidate()}function Lx(g){g.onUpdate==null||g.onUpdate(g)}function u7(g,t){g.manual||(OA(g)?(g.left=t.width/-2,g.right=t.width/2,g.top=t.height/2,g.bottom=t.height/-2):g.aspect=t.width/t.height,g.updateProjectionMatrix(),g.updateMatrixWorld())}function $v(g){return(g.eventObject||g.object).uuid+"/"+g.index+g.instanceId}function f7(){var g;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return kf.DefaultEventPriority;switch((g=t.event)==null?void 0:g.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return kf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return kf.ContinuousEventPriority;default:return kf.DefaultEventPriority}}function zA(g,t,i,x){const T=i.get(t);T&&(i.delete(t),i.size===0&&(g.delete(x),T.target.releasePointerCapture(x)))}function c7(g,t){const{internal:i}=g.getState();i.interaction=i.interaction.filter(x=>x!==t),i.initialHits=i.initialHits.filter(x=>x!==t),i.hovered.forEach((x,T)=>{(x.eventObject===t||x.object===t)&&i.hovered.delete(T)}),i.capturedMap.forEach((x,T)=>{zA(i.capturedMap,t,x,T)})}function d7(g){function t(e){const{internal:r}=g.getState(),p=e.offsetX-r.initialClick[0],h=e.offsetY-r.initialClick[1];return Math.round(Math.sqrt(p*p+h*h))}function i(e){return e.filter(r=>["Move","Over","Enter","Out","Leave"].some(p=>{var h;return(h=r.__r3f)==null?void 0:h.handlers["onPointer"+p]}))}function x(e,r){const p=g.getState(),h=new Set,a=[],l=r?r(p.internal.interaction):p.internal.interaction;for(let o=0;o{const d=rd(o.object),v=rd(c.object);return!d||!v?o.distance-c.distance:v.events.priority-d.events.priority||o.distance-c.distance}).filter(o=>{const c=$v(o);return h.has(c)?!1:(h.add(c),!0)});p.events.filter&&(u=p.events.filter(u,p));for(const o of u){let c=o.object;for(;c;){var f;(f=c.__r3f)!=null&&f.eventCount&&a.push({...o,eventObject:c}),c=c.parent}}if("pointerId"in e&&p.internal.capturedMap.has(e.pointerId))for(let o of p.internal.capturedMap.get(e.pointerId).values())h.has($v(o.intersection))||a.push(o.intersection);return a}function T(e,r,p,h){const a=g.getState();if(e.length){const l={stopped:!1};for(const n of e){const u=rd(n.object)||a,{raycaster:f,pointer:o,camera:c,internal:d}=u,v=new Ct(o.x,o.y,0).unproject(c),m=A=>{var P,b;return(P=(b=d.capturedMap.get(A))==null?void 0:b.has(n.eventObject))!=null?P:!1},S=A=>{const P={intersection:n,target:r.target};d.capturedMap.has(A)?d.capturedMap.get(A).set(n.eventObject,P):d.capturedMap.set(A,new Map([[n.eventObject,P]])),r.target.setPointerCapture(A)},M=A=>{const P=d.capturedMap.get(A);P&&zA(d.capturedMap,n.eventObject,P,A)};let w={};for(let A in r){let P=r[A];typeof P!="function"&&(w[A]=P)}let C={...n,...w,pointer:o,intersections:e,stopped:l.stopped,delta:p,unprojectedPoint:v,ray:f.ray,camera:c,stopPropagation(){const A="pointerId"in r&&d.capturedMap.get(r.pointerId);if((!A||A.has(n.eventObject))&&(C.stopped=l.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(P=>P.eventObject===n.eventObject))){const P=e.slice(0,e.indexOf(n));E([...P,n])}},target:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},currentTarget:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},nativeEvent:r};if(h(C),l.stopped===!0)break}}return e}function E(e){const{internal:r}=g.getState();for(const p of r.hovered.values())if(!e.length||!e.find(h=>h.object===p.object&&h.index===p.index&&h.instanceId===p.instanceId)){const a=p.eventObject.__r3f,l=a?.handlers;if(r.hovered.delete($v(p)),a!=null&&a.eventCount){const n={...p,intersections:e};l.onPointerOut==null||l.onPointerOut(n),l.onPointerLeave==null||l.onPointerLeave(n)}}}function s(e,r){for(let p=0;pE([]);case"onLostPointerCapture":return r=>{const{internal:p}=g.getState();"pointerId"in r&&p.capturedMap.has(r.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(r.pointerId)&&(p.capturedMap.delete(r.pointerId),E([]))})}}return function(p){const{onPointerMissed:h,internal:a}=g.getState();a.lastEvent.current=p;const l=e==="onPointerMove",n=e==="onClick"||e==="onContextMenu"||e==="onDoubleClick",f=x(p,l?i:void 0),o=n?t(p):0;e==="onPointerDown"&&(a.initialClick=[p.offsetX,p.offsetY],a.initialHits=f.map(d=>d.eventObject)),n&&!f.length&&o<=2&&(s(p,a.interaction),h&&h(p)),l&&E(f);function c(d){const v=d.eventObject,m=v.__r3f,S=m?.handlers;if(m!=null&&m.eventCount)if(l){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const M=$v(d),w=a.hovered.get(M);w?w.stopped&&d.stopPropagation():(a.hovered.set(M,d),S.onPointerOver==null||S.onPointerOver(d),S.onPointerEnter==null||S.onPointerEnter(d))}S.onPointerMove==null||S.onPointerMove(d)}else{const M=S[e];M?(!n||a.initialHits.includes(v))&&(s(p,a.interaction.filter(w=>!a.initialHits.includes(w))),M(d)):n&&a.initialHits.includes(v)&&s(p,a.interaction.filter(w=>!a.initialHits.includes(w)))}}T(f,p,o,c)}}return{handlePointer:y}}const GA=g=>!!(g!=null&&g.render),VA=Me.createContext(null),p7=(g,t)=>{const i=Qz((y,e)=>{const r=new Ct,p=new Ct,h=new Ct;function a(o=e().camera,c=p,d=e().size){const{width:v,height:m,top:S,left:M}=d,w=v/m;c instanceof Ct?h.copy(c):h.set(...c);const C=o.getWorldPosition(r).distanceTo(h);if(OA(o))return{width:v/o.zoom,height:m/o.zoom,top:S,left:M,factor:1,distance:C,aspect:w};{const A=o.fov*Math.PI/180,P=2*Math.tan(A/2)*C,b=P*(v/m);return{width:b,height:P,top:S,left:M,factor:v/b,distance:C,aspect:w}}}let l;const n=o=>y(c=>({performance:{...c.performance,current:o}})),u=new ve;return{set:y,get:e,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(o=1)=>g(e(),o),advance:(o,c)=>t(o,c,e()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Y1,pointer:u,mouse:u,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const o=e();l&&clearTimeout(l),o.performance.current!==o.performance.min&&n(o.performance.min),l=setTimeout(()=>n(e().performance.max),o.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:a},setEvents:o=>y(c=>({...c,events:{...c.events,...o}})),setSize:(o,c,d,v,m)=>{const S=e().camera,M={width:o,height:c,top:v||0,left:m||0,updateStyle:d};y(w=>({size:M,viewport:{...w.viewport,...a(S,p,M)}}))},setDpr:o=>y(c=>{const d=BA(o);return{viewport:{...c.viewport,dpr:d,initialDpr:c.viewport.initialDpr||d}}}),setFrameloop:(o="always")=>{const c=e().clock;c.stop(),c.elapsedTime=0,o!=="never"&&(c.start(),c.elapsedTime=0),y(()=>({frameloop:o}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Me.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(o,c,d)=>{const v=e().internal;return v.priority=v.priority+(c>0?1:0),v.subscribers.push({ref:o,priority:c,store:d}),v.subscribers=v.subscribers.sort((m,S)=>m.priority-S.priority),()=>{const m=e().internal;m!=null&&m.subscribers&&(m.priority=m.priority-(c>0?1:0),m.subscribers=m.subscribers.filter(S=>S.ref!==o))}}}}}),x=i.getState();let T=x.size,E=x.viewport.dpr,s=x.camera;return i.subscribe(()=>{const{camera:y,size:e,viewport:r,gl:p,set:h}=i.getState();if(e.width!==T.width||e.height!==T.height||r.dpr!==E){var a;T=e,E=r.dpr,u7(y,e),p.setPixelRatio(r.dpr);const l=(a=e.updateStyle)!=null?a:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(e.width,e.height,l)}y!==s&&(s=y,h(l=>({viewport:{...l.viewport,...l.viewport.getCurrentViewport(y)}})))}),i.subscribe(y=>g(y)),i};let Qv,v7=new Set,m7=new Set,g7=new Set;function cy(g,t){if(g.size)for(const{callback:i}of g.values())i(t)}function sd(g,t){switch(g){case"before":return cy(v7,t);case"after":return cy(m7,t);case"tail":return cy(g7,t)}}let dy,py;function vy(g,t,i){let x=t.clock.getDelta();for(t.frameloop==="never"&&typeof g=="number"&&(x=g-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=g),dy=t.internal.subscribers,Qv=0;Qv0)&&!((p=E.gl.xr)!=null&&p.isPresenting)&&(x+=vy(r,E))}if(i=!1,sd("after",r),x===0)return sd("tail",r),t=!1,cancelAnimationFrame(T)}function y(r,p=1){var h;if(!r)return g.forEach(a=>y(a.store.getState(),p));(h=r.gl.xr)!=null&&h.isPresenting||!r.internal.active||r.frameloop==="never"||(p>1?r.internal.frames=Math.min(60,r.internal.frames+p):i?r.internal.frames=2:r.internal.frames=1,t||(t=!0,requestAnimationFrame(s)))}function e(r,p=!0,h,a){if(p&&sd("before",r),h)vy(r,h,a);else for(const l of g.values())vy(r,l.store.getState());p&&sd("after",r)}return{loop:s,invalidate:y,advance:e}}function x7(){const g=Me.useContext(VA);if(!g)throw new Error("R3F: Hooks can only be used within the Canvas component!");return g}function S7(g,t=0){const i=x7(),x=i.getState().internal.subscribe,T=DA(g);return lp(()=>x(T,t,i),[t,x,i]),null}const nc=new Map,{invalidate:vM,advance:mM}=y7(nc),{reconciler:bm,applyProps:Of}=r7(nc,f7),Df={objects:"shallow",strict:!1},T7=(g,t)=>{const i=typeof g=="function"?g(t):g;return GA(i)?i:new R1({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...g})};function E7(g,t){const i=typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement;if(t){const{width:x,height:T,top:E,left:s,updateStyle:y=i}=t;return{width:x,height:T,top:E,left:s,updateStyle:y}}else if(typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement&&g.parentElement){const{width:x,height:T,top:E,left:s}=g.parentElement.getBoundingClientRect();return{width:x,height:T,top:E,left:s,updateStyle:i}}else if(typeof OffscreenCanvas<"u"&&g instanceof OffscreenCanvas)return{width:g.width,height:g.height,top:0,left:0,updateStyle:i};return{width:0,height:0,top:0,left:0}}function M7(g){const t=nc.get(g),i=t?.fiber,x=t?.store;t&&console.warn("R3F.createRoot should only be called once!");const T=typeof reportError=="function"?reportError:console.error,E=x||p7(vM,mM),s=i||bm.createContainer(E,kf.ConcurrentRoot,null,!1,null,"",T,null);t||nc.set(g,{fiber:s,store:E});let y,e=!1,r;return{configure(p={}){let{gl:h,size:a,scene:l,events:n,onCreated:u,shadows:f=!1,linear:o=!1,flat:c=!1,legacy:d=!1,orthographic:v=!1,frameloop:m="always",dpr:S=[1,2],performance:M,raycaster:w,camera:C,onPointerMissed:A}=p,P=E.getState(),b=P.gl;P.gl||P.set({gl:b=T7(h,g)});let O=P.raycaster;O||P.set({raycaster:O=new wA});const{params:I,...D}=w||{};if(An.equ(D,O,Df)||Of(O,{...D}),An.equ(I,O.params,Df)||Of(O,{params:{...O.params,...I}}),!P.camera||P.camera===r&&!An.equ(r,C,Df)){r=C;const j=C instanceof tp,Q=j?C:v?new np(0,0,0,0,.1,1e3):new Dr(75,0,.1,1e3);j||(Q.position.z=5,C&&Of(Q,C),!P.camera&&!(C!=null&&C.rotation)&&Q.lookAt(0,0,0)),P.set({camera:Q}),O.camera=Q}if(!P.scene){let j;l instanceof Pm?j=l:(j=new Pm,l&&Of(j,l)),P.set({scene:If(j)})}if(!P.xr){var B;const j=(Y,Z)=>{const U=E.getState();U.frameloop!=="never"&&mM(Y,!0,U,Z)},Q=()=>{const Y=E.getState();Y.gl.xr.enabled=Y.gl.xr.isPresenting,Y.gl.xr.setAnimationLoop(Y.gl.xr.isPresenting?j:null),Y.gl.xr.isPresenting||vM(Y)},tt={connect(){const Y=E.getState().gl;Y.xr.addEventListener("sessionstart",Q),Y.xr.addEventListener("sessionend",Q)},disconnect(){const Y=E.getState().gl;Y.xr.removeEventListener("sessionstart",Q),Y.xr.removeEventListener("sessionend",Q)}};typeof((B=b.xr)==null?void 0:B.addEventListener)=="function"&&tt.connect(),P.set({xr:tt})}if(b.shadowMap){const j=b.shadowMap.enabled,Q=b.shadowMap.type;if(b.shadowMap.enabled=!!f,An.boo(f))b.shadowMap.type=cd;else if(An.str(f)){var G;const tt={basic:mw,percentage:lg,soft:cd,variance:qa};b.shadowMap.type=(G=tt[f])!=null?G:cd}else An.obj(f)&&Object.assign(b.shadowMap,f);(j!==b.shadowMap.enabled||Q!==b.shadowMap.type)&&(b.shadowMap.needsUpdate=!0)}const z=FA();z&&("enabled"in z?z.enabled=!d:"legacyMode"in z&&(z.legacyMode=d)),e||Of(b,{outputEncoding:o?3e3:3001,toneMapping:c?zo:l1}),P.legacy!==d&&P.set(()=>({legacy:d})),P.linear!==o&&P.set(()=>({linear:o})),P.flat!==c&&P.set(()=>({flat:c})),h&&!An.fun(h)&&!GA(h)&&!An.equ(h,b,Df)&&Of(b,h),n&&!P.events.handlers&&P.set({events:n(E)});const X=E7(g,a);return An.equ(X,P.size,Df)||P.setSize(X.width,X.height,X.updateStyle,X.top,X.left),S&&P.viewport.dpr!==BA(S)&&P.setDpr(S),P.frameloop!==m&&P.setFrameloop(m),P.onPointerMissed||P.set({onPointerMissed:A}),M&&!An.equ(M,P.performance,Df)&&P.set(j=>({performance:{...j.performance,...M}})),y=u,e=!0,this},render(p){return e||this.configure(),bm.updateContainer(Me.createElement(C7,{store:E,children:p,onCreated:y,rootElement:g}),s,null,()=>{}),E},unmount(){HA(g)}}}function C7({store:g,children:t,onCreated:i,rootElement:x}){return lp(()=>{const T=g.getState();T.set(E=>({internal:{...E.internal,active:!0}})),i&&i(T),g.getState().events.connected||T.events.connect==null||T.events.connect(x)},[]),Me.createElement(VA.Provider,{value:g},t)}function HA(g,t){const i=nc.get(g),x=i?.fiber;if(x){const T=i?.store.getState();T&&(T.internal.active=!1),bm.updateContainer(null,x,null,()=>{T&&setTimeout(()=>{try{var E,s,y,e;T.events.disconnect==null||T.events.disconnect(),(E=T.gl)==null||(s=E.renderLists)==null||s.dispose==null||s.dispose(),(y=T.gl)==null||y.forceContextLoss==null||y.forceContextLoss(),(e=T.gl)!=null&&e.xr&&T.xr.disconnect(),l7(T),nc.delete(g),t&&t(g)}catch{}},500)})}}bm.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Me.version});function Lm(){return Lm=Object.assign?Object.assign.bind():function(g){for(var t=1;t=0?x=setTimeout(e,t-p):(x=null,i||(y=g.apply(E,T),E=T=null))}var r=function(){E=this,T=arguments,s=Date.now();var p=i&&!x;return x||(x=setTimeout(e,t)),p&&(y=g.apply(E,T),E=T=null),y};return r.clear=function(){x&&(clearTimeout(x),x=null)},r.flush=function(){x&&(y=g.apply(E,T),E=T=null,clearTimeout(x),x=null)},r}Fx.debounce=Fx;var w7=Fx;const gM=kd(w7);function A7(g){let{debounce:t,scroll:i,polyfill:x,offsetSize:T}=g===void 0?{debounce:0,scroll:!1,offsetSize:!1}:g;const E=x||(typeof window>"u"?class{}:window.ResizeObserver);if(!E)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,y]=Me.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),e=Me.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),r=t?typeof t=="number"?t:t.scroll:null,p=t?typeof t=="number"?t:t.resize:null,h=Me.useRef(!1);Me.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[a,l,n]=Me.useMemo(()=>{const c=()=>{if(!e.current.element)return;const{left:d,top:v,width:m,height:S,bottom:M,right:w,x:C,y:A}=e.current.element.getBoundingClientRect(),P={left:d,top:v,width:m,height:S,bottom:M,right:w,x:C,y:A};e.current.element instanceof HTMLElement&&T&&(P.height=e.current.element.offsetHeight,P.width=e.current.element.offsetWidth),Object.freeze(P),h.current&&!L7(e.current.lastBounds,P)&&y(e.current.lastBounds=P)};return[c,p?gM(c,p):c,r?gM(c,r):c]},[y,T,r,p]);function u(){e.current.scrollContainers&&(e.current.scrollContainers.forEach(c=>c.removeEventListener("scroll",n,!0)),e.current.scrollContainers=null),e.current.resizeObserver&&(e.current.resizeObserver.disconnect(),e.current.resizeObserver=null)}function f(){e.current.element&&(e.current.resizeObserver=new E(n),e.current.resizeObserver.observe(e.current.element),i&&e.current.scrollContainers&&e.current.scrollContainers.forEach(c=>c.addEventListener("scroll",n,{capture:!0,passive:!0})))}const o=c=>{!c||c===e.current.element||(u(),e.current.element=c,e.current.scrollContainers=WA(c),f())};return R7(n,!!i),P7(l),Me.useEffect(()=>{u(),f()},[i,n,l]),Me.useEffect(()=>u,[]),[o,s,a]}function P7(g){Me.useEffect(()=>{const t=g;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[g])}function R7(g,t){Me.useEffect(()=>{if(t){const i=g;return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)}},[g,t])}function WA(g){const t=[];if(!g||g===document.body)return t;const{overflow:i,overflowX:x,overflowY:T}=window.getComputedStyle(g);return[i,x,T].some(E=>E==="auto"||E==="scroll")&&t.push(g),[...t,...WA(g.parentElement)]}const b7=["x","y","top","bottom","left","right","width","height"],L7=(g,t)=>b7.every(i=>g[i]===t[i]);var F7=Object.defineProperty,O7=Object.defineProperties,D7=Object.getOwnPropertyDescriptors,yM=Object.getOwnPropertySymbols,I7=Object.prototype.hasOwnProperty,N7=Object.prototype.propertyIsEnumerable,xM=(g,t,i)=>t in g?F7(g,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[t]=i,SM=(g,t)=>{for(var i in t||(t={}))I7.call(t,i)&&xM(g,i,t[i]);if(yM)for(var i of yM(t))N7.call(t,i)&&xM(g,i,t[i]);return g},B7=(g,t)=>O7(g,D7(t)),TM,EM;typeof window<"u"&&((TM=window.document)!=null&&TM.createElement||((EM=window.navigator)==null?void 0:EM.product)==="ReactNative")?Me.useLayoutEffect:Me.useEffect;function XA(g,t,i){if(!g)return;if(i(g)===!0)return g;let x=t?g.return:g.child;for(;x;){const T=XA(x,t,i);if(T)return T;x=t?null:x.sibling}}function YA(g){try{return Object.defineProperties(g,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return g}}const MM=console.error;console.error=function(){const g=[...arguments].join("");if(g?.startsWith("Warning:")&&g.includes("useContext")){console.error=MM;return}return MM.apply(this,arguments)};const J1=YA(Me.createContext(null));class kA extends Me.Component{render(){return Me.createElement(J1.Provider,{value:this._reactInternals},this.props.children)}}function U7(){const g=Me.useContext(J1);if(g===null)throw new Error("its-fine: useFiber must be called within a !");const t=Me.useId();return Me.useMemo(()=>{for(const x of[g,g?.alternate]){if(!x)continue;const T=XA(x,!1,E=>{let s=E.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}});if(T)return T}},[g,t])}function z7(){const g=U7(),[t]=Me.useState(()=>new Map);t.clear();let i=g;for(;i;){if(i.type&&typeof i.type=="object"){const T=i.type._context===void 0&&i.type.Provider===i.type?i.type:i.type._context;T&&T!==J1&&!t.has(T)&&t.set(T,Me.useContext(YA(T)))}i=i.return}return t}function G7(){const g=z7();return Me.useMemo(()=>Array.from(g.keys()).reduce((t,i)=>x=>Me.createElement(t,null,Me.createElement(i.Provider,B7(SM({},x),{value:g.get(i)}))),t=>Me.createElement(kA,SM({},t))),[g])}const my={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function V7(g){const{handlePointer:t}=d7(g);return{priority:1,enabled:!0,compute(i,x,T){x.pointer.set(i.offsetX/x.size.width*2-1,-(i.offsetY/x.size.height)*2+1),x.raycaster.setFromCamera(x.pointer,x.camera)},connected:void 0,handlers:Object.keys(my).reduce((i,x)=>({...i,[x]:t(x)}),{}),update:()=>{var i;const{events:x,internal:T}=g.getState();(i=T.lastEvent)!=null&&i.current&&x.handlers&&x.handlers.onPointerMove(T.lastEvent.current)},connect:i=>{var x;const{set:T,events:E}=g.getState();E.disconnect==null||E.disconnect(),T(s=>({events:{...s.events,connected:i}})),Object.entries((x=E.handlers)!=null?x:[]).forEach(([s,y])=>{const[e,r]=my[s];i.addEventListener(e,y,{passive:r})})},disconnect:()=>{const{set:i,events:x}=g.getState();if(x.connected){var T;Object.entries((T=x.handlers)!=null?T:[]).forEach(([E,s])=>{if(x&&x.connected instanceof HTMLElement){const[y]=my[E];x.connected.removeEventListener(y,s)}}),i(E=>({events:{...E.events,connected:void 0}}))}}}}const H7=Me.forwardRef(function({children:t,fallback:i,resize:x,style:T,gl:E,events:s=V7,eventSource:y,eventPrefix:e,shadows:r,linear:p,flat:h,legacy:a,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:o,camera:c,scene:d,onPointerMissed:v,onCreated:m,...S},M){Me.useMemo(()=>n7(Zz),[]);const w=G7(),[C,A]=A7({scroll:!0,debounce:{scroll:50,resize:0},...x}),P=Me.useRef(null),b=Me.useRef(null);Me.useImperativeHandle(M,()=>P.current);const O=DA(v),[I,D]=Me.useState(!1),[B,G]=Me.useState(!1);if(I)throw I;if(B)throw B;const z=Me.useRef(null);lp(()=>{const j=P.current;A.width>0&&A.height>0&&j&&(z.current||(z.current=M7(j)),z.current.configure({gl:E,events:s,shadows:r,linear:p,flat:h,legacy:a,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:o,camera:c,scene:d,size:A,onPointerMissed:(...Q)=>O.current==null?void 0:O.current(...Q),onCreated:Q=>{Q.events.connect==null||Q.events.connect(y?s7(y)?y.current:y:b.current),e&&Q.setEvents({compute:(tt,Y)=>{const Z=tt[e+"X"],U=tt[e+"Y"];Y.pointer.set(Z/Y.size.width*2-1,-(U/Y.size.height)*2+1),Y.raycaster.setFromCamera(Y.pointer,Y.camera)}}),m?.(Q)}}),z.current.render(Me.createElement(w,null,Me.createElement(IA,{set:G},Me.createElement(Me.Suspense,{fallback:Me.createElement(a7,{set:D})},t)))))}),Me.useEffect(()=>{const j=P.current;if(j)return()=>HA(j)},[]);const X=y?"none":"auto";return Me.createElement("div",Lm({ref:b,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:X,...T}},S),Me.createElement("div",{ref:C,style:{width:"100%",height:"100%"}},Me.createElement("canvas",{ref:P,style:{display:"block"}},i)))}),W7=Me.forwardRef(function(t,i){return Me.createElement(kA,null,Me.createElement(H7,Lm({},t,{ref:i})))});function io(g,t={}){let i=Me.useCallback(T=>t.keys?QO(g,t.keys,T):g.listen(T),[t.keys,g]),x=g.get.bind(g);return Me.useSyncExternalStore(i,x,x)}const X7=[new to(-Math.PI/2,-Math.PI/2,-Math.PI/2),new to(0,Math.PI/2,0),new to(0,-Math.PI/2,-Math.PI/2),new to(Math.PI/2,Math.PI,Math.PI),new to(0,0,-Math.PI/2),new to(Math.PI,0,0)],Y7=({diceValues:g,isRolling:t,textures:i})=>{const x=Me.useRef([]),T=Me.useRef([]);return Me.useEffect(()=>{const E=new fA,s=new ze(16766720);T.current=[new yl({map:E.load(i.side1),color:s}),new yl({map:E.load(i.side2),color:s}),new yl({map:E.load(i.side3),color:s}),new yl({map:E.load(i.side4),color:s}),new yl({map:E.load(i.side5),color:s}),new yl({map:E.load(i.side6),color:s})],x.current.forEach(y=>{y&&(y.material=T.current)})},[i]),S7(()=>{x.current.forEach((E,s)=>{if(E)if(t)E.rotation.x+=.2,E.rotation.y+=.2;else{const y=X7[g[s]-1];E.rotation.x=fm.lerp(E.rotation.x,y.x,.1),E.rotation.y=fm.lerp(E.rotation.y,y.y,.1),E.rotation.z=fm.lerp(E.rotation.z,y.z,.1)}})}),Yt.jsx(Yt.Fragment,{children:g.map((E,s)=>Yt.jsxs("mesh",{ref:y=>x.current[s]=y,position:[s*2-(g.length-1),0,0],children:[Yt.jsx("boxGeometry",{args:[1,1,1]}),T.current.length===6&&T.current.map((y,e)=>Yt.jsx("meshStandardMaterial",{attach:`material-${e}`,...y},e))]},s))})},k7=({styleClass:g,textures:t,diceCount:i})=>{const x=io(Ed);Me.useEffect(()=>{XI("Dice"),kI(t),YI({type:"ROLL_DICE",diceValues:Array(i).fill(1),isRolling:!1})},[t,i]);const T=()=>{RT(!0),setTimeout(()=>{const E=Array.from({length:i},()=>Math.floor(Math.random()*6)+1);dw(E),RT(!1);const s={diceValues:E};Si.emit("diceRollResult",s)},2e3)};return Yt.jsxs("div",{className:`flex flex-col items-center justify-center p-4 ${g}`,children:[Yt.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Dice Roller"}),Yt.jsxs(W7,{className:"w-full h-full",camera:{position:[0,0,5]},children:[Yt.jsx("ambientLight",{intensity:2.5}),Yt.jsx("pointLight",{position:[10,10,10]}),vT(x.action)&&Yt.jsx(Y7,{diceValues:x.action.diceValues,isRolling:x.action.isRolling,textures:x.textures})]}),vT(x.action)&&Yt.jsx("button",{onClick:T,className:`mt-4 p-2 border border-yellow-300 rounded text-yellow-400 hover:scale-110 ${x.action.isRolling?"opacity-50":""}`,disabled:x.action.isRolling,children:"Roll Dice"})]})},j7=({text:g,speed:t=80,onComplete:i})=>{const[x,T]=Me.useState([]),E=Me.useRef([]);return Me.useEffect(()=>{let s,y=0;const e=g.split(/(<\/?span[^>]*>)/g).filter(Boolean),r=[];e.forEach((h,a)=>{if(h.startsWith("/);if(l){const n=l[1];r.push(Yt.jsx("span",{className:n},`span-${a}`))}else r.push(Yt.jsx("span",{},`span-${a}`))}else h.split("").forEach((l,n)=>{r.push(Yt.jsx("span",{children:l},`char-${a}-${n}`))})}),y=0;const p=()=>{y{window.clearTimeout(s)}},[g,t,i]),Yt.jsx("div",{children:x})},jA=Ou.memo(j7);class KA{constructor(t,i,x){this.scene=t,this.gridEngine=i,this.quadtree=x,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers(),this.tooltip=this.scene.add.text(0,0,"Press [F]",{font:"16px Arial",backgroundColor:"#000000"}).setDepth(4).setPadding(3,2,2,3).setVisible(!1)}initializeWASDKeys(){const t=this.scene.input.keyboard;t&&(this.wasdKeys={W:t.addKey(Phaser.Input.Keyboard.KeyCodes.W),A:t.addKey(Phaser.Input.Keyboard.KeyCodes.A),S:t.addKey(Phaser.Input.Keyboard.KeyCodes.S),D:t.addKey(Phaser.Input.Keyboard.KeyCodes.D)})}handleConsume(t){const i=Tl(t);i&&i.consumable?(qe.log(`Consuming item: ${i.name}`),HI(i),PT(i.id)):qe.log(`Item ${t} is not consumable`)}handleEquip(t){const i=Tl(t);i&&(qe.log(`Equipping item: ${i.name}`),OI("weapon",i.id))}handleUnequip(t){const i=Tl(t);i&&(qe.log(`Unequipping item: ${i.name}`),DI("weapon"))}handleDiscard(t){qe.log(`Discarding item: ${t}`),PT(t)}handleView(t){const i=Tl(t);if(i&&(qe.log(`Viewing item: ${i.name} with ${i.slug}`),i.slug)){const x=`https://kbve.com/${i.slug}#${i.name.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")}`;window.open(x,"_blank")}}registerEventHandlers(){Si.on("itemAction",this.handleItemAction.bind(this));//! Broken +Si.on("playerMove",this.handlePlayerMove.bind(this)),Si.on("playerReward",this.handlePlayerReward.bind(this)),Si.on("playerDamage",this.handlePlayerCombatDamage.bind(this))}handleItemAction(t){if(t)switch(qe.log(`Preparing Action: ${t.itemId} with ${t.action}`),t.action){case"consume":this.handleConsume(t.itemId);break;case"equip":this.handleEquip(t.itemId);break;case"unequip":this.handleUnequip(t.itemId);break;case"discard":this.handleDiscard(t.itemId);break;case"view":this.handleView(t.itemId);break;default:qe.log(`Unknown action: ${t.action}`)}}handlePlayerReward(t){qe.log("Rewarding the player"),t&&(Si.emit("notification",{title:"Success",message:t.message,notificationType:Ru.success}),FI(t.item))}handlePlayerCombatDamage(t){t&&(cw(parseInt(t.damage)),Si.emit("notification",{title:"Danger",message:`You taken ${t.damage} points of damage!`,notificationType:Ru.danger}))}handlePlayerMove(t){t&&this.gridEngine.moveTo("player",{x:t.x,y:t.y})}checkForNearbyObjects(){const i=this.gridEngine.getPosition("player"),x=i.x*48,T=i.y*48;this.quadtree.query(i).length>0?this.tooltip.setPosition(x,T-60).setVisible(!0):this.tooltip.setVisible(!1)}handleMovement(){if(!this.cursor)return;const t=this.cursor,i=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const x=this.gridEngine.getPosition("player"),T=this.quadtree.query(x);for(const E of T)E.action()}(t.left.isDown||i.A.isDown)&&(t.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-left"):(t.left.isDown||i.A.isDown)&&(t.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-left"):(t.right.isDown||i.D.isDown)&&(t.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-right"):(t.right.isDown||i.D.isDown)&&(t.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-right"):t.left.isDown||i.A.isDown?this.gridEngine.move("player","left"):t.right.isDown||i.D.isDown?this.gridEngine.move("player","right"):t.up.isDown||i.W.isDown?this.gridEngine.move("player","up"):(t.down.isDown||i.S.isDown)&&this.gridEngine.move("player","down"),this.checkForNearbyObjects()}}class ZA extends Phaser.GameObjects.Container{constructor(t,i,x,T){const E=i.x,s=i.y-i.height+10;super(t,E,s),this.sprite=i;const y=150,e=40+T.length*20;this.background=t.add.rectangle(0,0,y,e,0,.7),this.text=t.add.text(0,-e/2+10,x,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=T.map((r,p)=>{const h=t.add.text(0,-e/2+30+p*20,r.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return h.setInteractive({useHandCursor:!0}),h.on("pointerdown",r.callback),h}),this.add(this.background),this.add(this.text),this.buttons.forEach(r=>this.add(r)),this.scene.add.existing(this)}updatePosition(){this.setPosition(this.sprite.x-30,this.sprite.y-this.sprite.height-this.background.height/2+100)}static attachToSprite(t,i,x,T){i.setInteractive(),i.on("pointerover",E=>{const s={npcId:i.name,npcName:x,actions:T.map(e=>e.label),coords:{x:E.x,y:E.y}};if(Si.emit("npcInteraction",s),!i.getData("tooltipMenu")){const e=new ZA(t,i,x,T);i.setData("tooltipMenu",e)}const y=i.getData("tooltipMenu");y.setVisible(!0),y.updatePosition()}),i.on("pointerout",()=>{const E=i.getData("tooltipMenu");E&&E.setVisible(!1)})}static updateAllTooltipPositions(t){t.children.list.forEach(i=>{if(i instanceof Phaser.GameObjects.Sprite){const x=i.getData("tooltipMenu");x&&x.updatePosition()}})}}let FG=class extends Phaser.GameObjects.Sprite{};function K7(g,t,i,x){const y=g.add.graphics();y.fillStyle(16777215,1),y.fillRoundedRect(0,0,200,60,16),y.setDepth(99);const e=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});e.setOrigin(.5),e.setWordWrapWidth(200-10*2),e.setDepth(100);const r=g.add.container(0,0,[y,e]);return r.setDepth(100),t.messageBubble=r,J7(t),g.time.addEvent({delay:x,callback:()=>{r.destroy(),t.messageBubble===r&&(t.messageBubble=void 0)},callbackScope:g}),r}function Z7(g,t,i){const s=g.add.graphics();s.fillStyle(16777215,1),s.fillRoundedRect(0,0,200,60,16),s.setDepth(99);const y=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});y.setOrigin(.5),y.setWordWrapWidth(200-10*2),y.setDepth(100);const e=g.add.container(0,0,[s,y]);return e.setDepth(100),t.textBubble=e,Ox(t),e}function Ox(g){const t=g.textBubble;t&&(t.x=g.x,t.y=g.y-g.height-t.height/2)}function J7(g){const t=g.messageBubble;t&&(t.x=g.x,t.y=g.y-g.height-t.height/2)}var JA={exports:{}};(function(g,t){(function(i,x){g.exports=x()})(Ty,function(){var i=function(V,K){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(et,st){et.__proto__=st}||function(et,st){for(var ht in st)Object.prototype.hasOwnProperty.call(st,ht)&&(et[ht]=st[ht])})(V,K)},x=function(){return(x=Object.assign||function(V){for(var K,et=1,st=arguments.length;et"u"||E.Promise||(E.Promise=Promise);var r=Object.getPrototypeOf,p={}.hasOwnProperty;function h(V,K){return p.call(V,K)}function a(V,K){typeof K=="function"&&(K=K(r(V))),(typeof Reflect>"u"?s:Reflect.ownKeys)(K).forEach(function(et){n(V,et,K[et])})}var l=Object.defineProperty;function n(V,K,et,st){l(V,K,e(et&&h(et,"get")&&typeof et.get=="function"?{get:et.get,set:et.set,configurable:!0}:{value:et,configurable:!0,writable:!0},st))}function u(V){return{from:function(K){return V.prototype=Object.create(K.prototype),n(V.prototype,"constructor",V),{extend:a.bind(null,V.prototype)}}}}var f=Object.getOwnPropertyDescriptor,o=[].slice;function c(V,K,et){return o.call(V,K,et)}function d(V,K){return K(V)}function v(V){if(!V)throw new Error("Assertion Failed")}function m(V){E.setImmediate?setImmediate(V):setTimeout(V,0)}function S(V,K){if(typeof K=="string"&&h(V,K))return V[K];if(!K)return V;if(typeof K!="string"){for(var et=[],st=0,ht=K.length;st"u"?[]:function(){var V=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[V,r(V),V];var K=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[K,r(K),V]}(),re=Vs[0],hr=Vs[1],Vs=Vs[2],hr=hr&&hr.then,le=re&&re.constructor,ge=!!Vs,xe=function(V,K){je.push([V,K]),te&&(queueMicrotask(Gi),te=!1)},Pe=!0,te=!0,Ge=[],Oe=[],Be=gt,Le={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:rt,pgp:!1,env:{},finalize:rt},ne=Le,je=[],si=0,Mi=[];function he(V){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var K=this._PSD=ne;if(typeof V!="function"){if(V!==Ht)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Ce(this,this._value))}this._state=null,this._value=null,++K.ref,function et(st,ht){try{ht(function(pt){if(st._state===null){if(pt===st)throw new TypeError("A promise cannot be resolved with itself.");var Mt=st._lib&&Ii();pt&&typeof pt.then=="function"?et(st,function(Nt,zt){pt instanceof he?pt._then(Nt,zt):pt.then(Nt,zt)}):(st._state=!0,st._value=pt,we(st)),Mt&&nn()}},Ce.bind(null,st))}catch(pt){Ce(st,pt)}}(this,V)}var Ti={get:function(){var V=ne,K=_r;function et(st,ht){var pt=this,Mt=!V.global&&(V!==ne||K!==_r),Nt=Mt&&!Ss(),zt=new he(function(ct,St){Ve(pt,new bt(ie(st,V,Mt,Nt),ie(ht,V,Mt,Nt),ct,St,V))});return this._consoleTask&&(zt._consoleTask=this._consoleTask),zt}return et.prototype=Ht,et},set:function(V){n(this,"then",V&&V.prototype===Ht?Ti:{get:function(){return V},set:Ti.set})}};function bt(V,K,et,st,ht){this.onFulfilled=typeof V=="function"?V:null,this.onRejected=typeof K=="function"?K:null,this.resolve=et,this.reject=st,this.psd=ht}function Ce(V,K){var et,st;Oe.push(K),V._state===null&&(et=V._lib&&Ii(),K=Be(K),V._state=!1,V._value=K,st=V,Ge.some(function(ht){return ht._value===st._value})||Ge.push(st),we(V),et&&nn())}function we(V){var K=V._listeners;V._listeners=[];for(var et=0,st=K.length;et.",$e="String expected.",ti=[],ni="__dbnames",oi="readonly",$i="readwrite";function un(V,K){return V?K?function(){return V.apply(this,arguments)&&K.apply(this,arguments)}:V:K}var ji={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function yn(V){return typeof V!="string"||/\./.test(V)?function(K){return K}:function(K){return K[V]===void 0&&V in K&&delete(K=O(K))[V],K}}function ei(){throw q.Type()}function Se(V,K){try{var et=Br(V),st=Br(K);if(et!==st)return et==="Array"?1:st==="Array"?-1:et==="binary"?1:st==="binary"?-1:et==="string"?1:st==="string"?-1:et==="Date"?1:st!=="Date"?NaN:-1;switch(et){case"number":case"Date":case"string":return KQt+ae&&Kt(Qt+Ft)})})}var Jt=Ki(et)&&et.limit===1/0&&(typeof V!="function"||V===Fa)&&{index:et.index,range:et.range};return Kt(0).then(function(){if(0=Ft})).length!==0?(St.forEach(function(Kt){Wt.push(function(){var Jt=It,Qt=Kt._cfg.dbschema;Na(vt,Jt,Ut),Na(vt,Qt,Ut),It=vt._dbSchema=Qt;var ae=bn(Jt,Qt);ae.add.forEach(function(me){Oa(Ut,me[0],me[1].primKey,me[1].indexes)}),ae.change.forEach(function(me){if(me.recreate)throw new q.Upgrade("Not yet support for changing primary key");var be=Ut.objectStore(me.name);me.add.forEach(function(_e){return Mn(be,_e)}),me.change.forEach(function(_e){be.deleteIndex(_e.name),Mn(be,_e)}),me.del.forEach(function(_e){return be.deleteIndex(_e)})});var ue=Kt._cfg.contentUpgrade;if(ue&&Kt._cfg.version>Ft){Ko(vt,Ut),Lt._memoizedTables={};var Re=w(Qt);ae.del.forEach(function(me){Re[me]=Jt[me]}),Gr(vt,[vt.Transaction.prototype]),Dl(vt,[vt.Transaction.prototype],s(Re),Re),Lt.schema=Re;var pe,Ae=Q(ue);return Ae&&zs(),ae=he.follow(function(){var me;(pe=ue(Lt))&&Ae&&(me=Ss.bind(null,null),pe.then(me,me))}),pe&&typeof pe.then=="function"?he.resolve(pe):ae.then(function(){return pe})}}),Wt.push(function(Jt){var Qt,ae,ue=Kt._cfg.dbschema;Qt=ue,ae=Jt,[].slice.call(ae.db.objectStoreNames).forEach(function(Re){return Qt[Re]==null&&ae.db.deleteObjectStore(Re)}),Gr(vt,[vt.Transaction.prototype]),Dl(vt,[vt.Transaction.prototype],vt._storeNames,vt._dbSchema),Lt.schema=vt._dbSchema}),Wt.push(function(Jt){vt.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(vt.idbdb.version/10)===Kt._cfg.version?(vt.idbdb.deleteObjectStore("$meta"),delete vt._dbSchema.$meta,vt._storeNames=vt._storeNames.filter(function(Qt){return Qt!=="$meta"})):Jt.objectStore("$meta").put(Kt._cfg.version,"version"))})}),function Kt(){return Wt.length?he.resolve(Wt.shift()(Lt.idbtrans)).then(Kt):he.resolve()}().then(function(){Da(It,Ut)})):he.resolve();var vt,Ft,Lt,Ut,Wt,It}).catch(Mt)):(s(ht).forEach(function(St){Oa(et,St,ht[St].primKey,ht[St].indexes)}),Ko(V,et),void he.follow(function(){return V.on.populate.fire(pt)}).catch(Mt));var zt,ct})}function Ph(V,K){Da(V._dbSchema,K),K.db.version%10!=0||K.objectStoreNames.contains("$meta")||K.db.createObjectStore("$meta").add(Math.ceil(K.db.version/10-1),"version");var et=Ia(0,V.idbdb,K);Na(V,V._dbSchema,K);for(var st=0,ht=bn(et,V._dbSchema).change;stMath.pow(2,62)?0:It.oldVersion,vt=It<1,V.idbdb=Wt.result,pt&&Ph(V,St),xn(V,It/10,St,Lt))},Lt),Wt.onsuccess=pi(function(){St=null;var It,Kt,Jt,Qt,ae,ue=V.idbdb=Wt.result,Re=c(ue.objectStoreNames);if(0"u"?he.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Ft){function Lt(){return indexedDB.databases().finally(Ft)}zt=setInterval(Lt,100),Lt()}).finally(function(){return clearInterval(zt)}):Promise.resolve()).then(Nt)]).then(function(){return Mt(),K.onReadyBeingFired=[],he.resolve(Xr(function(){return V.on.ready.fire(V.vip)})).then(function Ft(){if(0K.limit?Ft.length=K.limit:V.length===K.limit&&Ft.length=Kt.limit&&(!Kt.values||ue.req.values)&&mo(ue.req.query.range,Kt.query.range)}),!1,Jt,Qt];case"count":return ae=Qt.find(function(ue){return qi(ue.req.query.range,Kt.query.range)}),[ae,!!ae,Jt,Qt]}}(K,et,"query",pt),St=ct[0],vt=ct[1],Ft=ct[2],Lt=ct[3];return St&&vt?St.obsSet=pt.obsSet:(vt=st.query(pt).then(function(Ut){var Wt=Ut.result;if(St&&(St.res=Wt),Mt){for(var It=0,Kt=Wt.length;It{qe.log(`Texture ${s} loaded successfully.`),this.addNPCToScene(t,E,x,T)}),t.load.start()}else throw new Error(`Sprite with ID ${E.spriteImageId} not found`)}}catch(E){E instanceof Error?qe.error(`Failed to load NPC: ${E.message}`):qe.error("Failed to load NPC:",E)}}addNPCToScene(t,i,x,T){try{qe.log(`Adding NPC to scene: ${JSON.stringify(i)}`),qe.log(`Using sprite key: ${i.spriteKey}`);const E=t.add.sprite(0,0,i.spriteKey);E.scale=i.scale||1.5,E.name=i.id||"Error Missing Name",qe.log(`NPC Sprite created with texture key ${i.spriteKey} at position (${i.startPosition.x}, ${i.startPosition.y})`);const s={id:i.id,sprite:E,walkingAnimationMapping:i.walkingAnimationMapping,startPosition:{x:x??i.startPosition.x,y:T??i.startPosition.y},speed:i.speed};if(qe.log(`Grid engine config: ${JSON.stringify(s)}`),!t.textures.exists(i.spriteKey))throw new Error(`Texture with key ${i.spriteKey} does not exist in the scene`);t.gridEngine.addCharacter(s),qe.log(`NPC added to grid engine with ID ${i.id}`),((e,r,p)=>{const h=t.gridEngine.getPosition(e.name);qe.log(`Attaching NPC events to ${r} at position: ${JSON.stringify(h)}`),$A.attachNPCEvent(e,r,p,{coords:h})})(E,i.name,i.actions.map(e=>({label:e}))),qe.log(`NPC ${i.name} added to scene successfully`)}catch(E){E instanceof Error?qe.error(`Error adding NPC to scene from addNPCToScene: ${E.message}`):qe.error("Error adding NPC to scene:",E)}}async addDialogue(t){await this.dialogues.put(t)}async getDialogue(t){return await this.dialogues.get(t)}async getAllDialogues(){return await this.dialogues.toArray()}async getDialoguesForNPC(t){const i=await this.getNPC(t);if(!i)throw new Error(`NPC with ID ${t} not found`);return(await Promise.all((i.dialogues||[]).map(T=>this.getDialogue(T.dialogueId)))).filter(T=>T!==void 0)}async markDialogueAsRead(t,i){const x=await this.getNPC(t);if(!x)throw new Error(`NPC with ID ${t} not found`);const T=x.dialogues?.find(E=>E.dialogueId===i);T&&(T.read=!0,await this.addNPC(x))}async fetchDialogues(t){try{const x=(await gn.get(t)).data.key,T=Object.values(x).map(E=>({...E}));await this.dialogues.bulkPut(T)}catch(i){qe.error(`Failed to fetch dialogues from ${t}:`,i)}}async getPrioritizedDialoguesForNPC(t){try{const i=await this.getNPC(t);if(!i)throw new Error(`NPC with ID ${t} not found`);const T=(await Promise.all((i.dialogues||[]).map(async E=>{const s=await this.getDialogue(E.dialogueId);return s?{...s,priority:E.priority,read:E.read}:null}))).filter(E=>E!==null);return T.sort((E,s)=>s.priority-E.priority),T}catch(i){return qe.error(`Failed to get prioritized dialogues for NPC with ID ${t}:`,i),[]}}async getNPCNameById(t){return(await this.getNPC(t))?.name}async getNPCAvatarById(t){const i=await this.getNPC(t);if(i?.avatarImageId)return(await this.getAvatar(i.avatarImageId))?.avatarData}async getNPCSlugById(t){return(await this.getNPC(t))?.slug}async getNPCHealthById(t){try{return(await this.getNPC(t))?.stats?.health}catch(i){qe.error(`Failed to get health for NPC with ID ${t}:`,i);return}}async getNPCManaById(t){try{return(await this.getNPC(t))?.stats?.mana}catch(i){qe.error(`Failed to get mana for NPC with ID ${t}:`,i);return}}async createNPCSession(t,i){try{const x=this.getNPCNameById(i),T=this.getNPCSlugById(i),E=this.getNPCAvatarById(i),s=this.getNPCHealthById(i),y=this.getNPCManaById(i),[e,r,p,h,a]=await Promise.all([x,T,E,s,y]),l={...t.get(),[`${i}_name`]:e||"Unknown",[`${i}_slug`]:r||"Unknown",[`${i}_avatar`]:p?URL.createObjectURL(p):"Unknown",[`${i}_health`]:h||"100",[`${i}_mana`]:a||"100"};t.set(l)}catch{const T={...t.get(),[`${i}_name`]:"Unknown",[`${i}_slug`]:"Unknown",[`${i}_avatar`]:"Unknown",[`${i}_hp`]:"100",[`${i}_mana`]:"100"};t.set(T)}}}const Zf=new Q7;class _7{constructor(){this.actionHandlers={talk:this.talkToNPC.bind(this),quest:this.questWithNPC.bind(this),trade:this.tradeWithNPC.bind(this),combat:this.startCombat.bind(this),heal:this.healNPC.bind(this),steal:this.stealFromNPC.bind(this),lore:this.loreFromNPC.bind(this)}}getActionHandler(t){return this.actionHandlers[t]}loreFromNPC(t){qe.log(`Pulling up the lore of the NPC with ID: ${t.npcId}`)}questWithNPC(t){qe.log(`Starting quest with NPC with ID: ${t.npcId}`)}healNPC(t){qe.log(`Healing NPC with ID: ${t.npcId}`)}async talkToNPC(t){try{qe.log(`Talking to NPC with ID: ${t.npcId}`);const i=await Zf.getPrioritizedDialoguesForNPC(t.npcId);if(qe.log(i),i.length>0){const x=i[0];Si.emit("npcDialogue",{npcId:t.npcId,dialogue:x},1e3)}else qe.log("No dialogues available for this NPC.")}catch(i){qe.error(`Failed to fetch dialogues for NPC with ID ${t.npcId}:`,i)}}tradeWithNPC(t){qe.log(`Trading with NPC with ID: ${t.npcId}`)}moveToNPC(t){const x=t.data?.coords||{x:10,y:15};Si.emit("playerMove",x)}stealFromNPC(t){qe.log(`Attempting to steal from NPC with ID: ${t.npcId}`);const i={npcId:t.npcId,npcName:t.npcName,data:t.data};Si.emit("playerSteal",i)}startCombat(t){qe.log(`Starting combat with NPC with ID: ${t.npcId}`)}checkFish(t){qe.log(`Checking fish for NPC with ID: ${t.npcId}`)}attachNPCEvent(t,i,x,T){t.setInteractive(),t.on("pointerover",E=>{const s={npcId:t.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};Si.emit("npcInteraction",s)}),t.on("pointerout",()=>{}),t.on("pointerdown",E=>{const s={npcId:t.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};qe.log(`Click Registered at X: ${s.coords.x} Y: ${s.coords.y}`),Si.emit("npcInteractionClick",s,1e3)})}}const $A=new _7;function QA(g){return+g[g.length-1]}function _A(g){return g.startsWith("monster_bird_")&&!g.startsWith("monster_bird_shadow")}function qA(g,t,i,x,T){const E=[];for(let s=0;s<10;s++){const y=g.add.sprite(0,0,"monster_bird");y.setCrop(t,i,x,T),y.scale=3,E.push(y)}return E}function tP(g){return qA(g,0,0,61,47)}function eP(g){return qA(g,22,47,16,10)}function iP(g){g.anims.create({key:"bird",frames:g.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class q7 extends Qm.Scene{mainMenuButtonImage;mainMenuButtonText;constructor(){super("Preloader")}preload(){this.load.image("mainBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.image("scroll","https://kbve.com/assets/img/fishchip/scroll.webp"),this.load.audio("music","https://kbve.com/assets/img/fishchip/bg.ogg"),this.load.image("creditsBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.audio("type","https://kbve.com/assets/img/fishchip/type.mp3"),this.load.spritesheet("fishing","https://kbve.com/assets/img/fishchip/animate.png",{frameWidth:800,frameHeight:600}),this.load.image("fish","https://kbve.com/assets/img/letter_logo.png"),this.load.image("background","https://kbve.com/assets/img/fishchip/scaled_fish_menu_minigame.webp"),this.load.image("tiles","https://kbve.com/assets/img/fishchip/desert_tileset_1.png"),this.load.image("cloud-city-tiles","/assets/map/cloud_tileset.png"),this.load.tilemapTiledJSON("cloud-city-map-large","/assets/map/cloud_city_large.json"),this.load.tilemapTiledJSON("cloud-city-map","https://kbve.com/assets/img/fishchip/cloud_city.json"),this.load.spritesheet("player","https://kbve.com/assets/img/fishchip/chip_charactersheet_warmer.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("knights","/assets/entity/knights.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("jacko","/assets/entity/jacko.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("monks","/assets/entity/monks.png",{frameWidth:52,frameHeight:72}),RI()}async create(){await Zf.initializeDatabase(),this.sound.get("music")?.isPlaying||this.sound.add("music",{loop:!0,volume:.1}).play(),this.add.image(480,480,"mainBg").setScale(.1),this.mainMenuButtonImage=this.add.image(480,480,"scroll").setAlpha(.9).setScale(.7,.2).setInteractive({useHandCursor:!0}),this.mainMenuButtonText=this.add.text(480,480,"Start Game",{fontFamily:"Arial Black",fontSize:50,color:"#ffffff",stroke:"#000000",strokeThickness:6}).setOrigin(.5).setInteractive({useHandCursor:!0}),this.mainMenuButtonText.on("pointerdown",()=>{this.scene.start("SandCity")},this)}}let DG=class extends Uf.GameObjects.Sprite{textBubble;tooltip};class tG extends Qm.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"SandCity"});const t={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new vu(t)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),Si.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${o1()}`,notificationType:Ru.success})}async create(){const t=this.make.tilemap({key:"cloud-city-map"});t.addTilesetImage("Cloud City","tiles");for(let T=0;T({id:"monster_bird_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1})),...this.monsterBirdShadows.map((T,E)=>({id:"monster_bird_shadow_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(t,x),this.loadRanges(),this.playerController=new KA(this,this.gridEngine,this.quadtree),K7(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!",3e3),await Zf.loadCharacter(this,"01J2DT4G871KJ0VNSHCNC5REDM",6,6),await Zf.loadCharacter(this,"01J2HCTMQ58JBMJGW9YA3FBQCG",8,8),await Zf.loadCharacter(this,"01J2HQJBMBGEEMWDBDWATRCY3T",8,15),this.gridEngine.moveRandomly("npc",1500,3),this.gridEngine.moveRandomly("fishNpc",1500,3);for(let T=0;T<10;T++)this.gridEngine.moveRandomly("monster_bird_"+T,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:T,exitTile:E,enterTile:s})=>{_A(T)&&this.gridEngine.moveTo("monster_bird_shadow_"+QA(T),{x:s.x,y:s.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const t=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Si.emit("charEvent",i)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const i={message:"Sign does not have much to say.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Si.emit("charEvent",i)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Si.emit("charEvent",i)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Si.emit("charEvent",i)}}];for(const i of t)this.quadtree.insert(i)}update(){this.playerController?.handleMovement()}}class NG extends Uf.GameObjects.Sprite{textBubble}class eG extends Qm.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"CloudCity"});const t={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new vu(t)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57})}create(){const t=this.make.tilemap({key:"cloud-city-map-large"});t.addTilesetImage("cloud_tileset","cloud-city-tiles");for(let T=0;T({id:"monster_bird_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1})),...this.monsterBirdShadows.map((T,E)=>({id:"monster_bird_shadow_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(t,x),this.loadRanges(),this.playerController=new KA(this,this.gridEngine,this.quadtree),Z7(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let T=0;T<10;T++)this.gridEngine.moveRandomly("monster_bird_"+T,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:T,exitTile:E,enterTile:s})=>{_A(T)&&this.gridEngine.moveTo("monster_bird_shadow_"+QA(T),{x:s.x,y:s.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const t=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Si.emit("charEvent",i,1e3)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const T={message:`The Database Response time: ${(await(await fetch("https://api.cryptothrone.com/api/v1/speed")).json()).message.time_ms} ms`,character_name:"Planets Be Scalin",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Si.emit("charEvent",T,1e3)}catch(i){console.error("Error fetching data:",i);const x={message:"Sign does not have much to say. Failed to fetch response time.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Si.emit("charEvent",x,1e3)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Si.emit("charEvent",i,1e3)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Si.emit("charEvent",i,1e3)}}];for(const i of t)this.quadtree.insert(i)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&Ox(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&Ox(this.fishNpcSprite)}}const iG=mm.div` + width: 100vw; + height: 100vh; +`;function nG(){const g=Me.useRef(null);return Me.useEffect(()=>{let t=null;if(g.current){const i=g.current,x={title:"CryptoThrone",render:{antialias:!1},scale:{mode:Uf.Scale.FIT,autoCenter:Uf.Scale.CENTER_BOTH,zoom:1},type:Uf.AUTO,transparent:!0,width:window.innerWidth,height:window.innerHeight,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:$O,mapping:"gridEngine"}]},scene:[q7,tG,eG],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!0}},parent:i};t=new Uf.Game(x);const T=()=>{t&&t.scale.resize(window.innerWidth,window.innerHeight)};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T),t&&t.destroy(!0)}}},[]),Yt.jsx(iG,{children:Yt.jsx("div",{className:"w-full h-full scrollbar-hide",ref:g})})}const wM=jd({message:""}),rG=()=>{const g=io(wM);Me.useEffect(()=>{const i=x=>{if(x){wM.set(x);const T=document.querySelector("#hs-stacked-overlays");T&&(T.classList.remove("hidden"),T.classList.add("open"))}};return Si.on("charEvent",i),()=>{Si.off("charEvent",i)}},[]);const t=()=>{const i=document.querySelector("#hs-stacked-overlays");i&&(i.classList.add("hidden"),i.classList.remove("open"))};return Yt.jsx(Yt.Fragment,{children:Yt.jsx("div",{id:"hs-stacked-overlays",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 hidden size-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:Yt.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto",children:Yt.jsxs("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover",style:{backgroundImage:`url(${g.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[Yt.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[Yt.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${g.character_name||"NPC"}`}),Yt.jsx("img",{src:g.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),Yt.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[Yt.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[Yt.jsx("h3",{className:"font-bold text-yellow-400",children:""}),Yt.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:t,children:[Yt.jsx("span",{className:"sr-only",children:"Close"}),Yt.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt.jsx("path",{d:"M18 6 6 18"}),Yt.jsx("path",{d:"m6 6 12 12"})]})]})]}),Yt.jsx("div",{className:"p-4 overflow-y-auto",children:Yt.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:g.message||"No Message"})}),Yt.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:Yt.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:t,children:[Yt.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),Yt.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},AM=({settingKey:g,label:t,collapseIcon:i=_I,expandIcon:x=qI})=>{const T=gl(g),E=()=>uh(g,!T);return Yt.jsxs("button",{onClick:E,className:"bg-yellow-500 text-white text-sm p-2 rounded ml-2 flex items-center w-20 h-10",children:[T?Yt.jsx(x,{className:"w-2"}):Yt.jsx(i,{className:"w-4"}),Yt.jsx("span",{className:"ml-2 text-xs",children:t})]})},sG=({stats:g})=>{const t=(i,x)=>{const T=typeof i=="string"?parseInt(i,10):i,E=typeof x=="string"?parseInt(x,10):x;return Math.min(T/E*100,100)};return Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),Yt.jsxs("div",{className:"mb-2",children:[Yt.jsx("p",{className:"text-sm text-green-400",children:`HP: ${g.health||"0"} / ${g.maxHealth}`}),Yt.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:Yt.jsx("div",{className:"bg-green-400 h-full rounded",style:{width:`${t(g.health,g.maxHealth)}%`}})})]}),Yt.jsxs("div",{className:"mb-2",children:[Yt.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${g.mana||"0"} / ${g.maxMana}`}),Yt.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:Yt.jsx("div",{className:"bg-blue-400 h-full rounded",style:{width:`${t(g.mana,g.maxMana)}%`}})})]}),Yt.jsxs("div",{className:"mb-2",children:[Yt.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${g.energy||"0"} / ${g.maxEnergy}`}),Yt.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:Yt.jsx("div",{className:"bg-yellow-400 h-full rounded",style:{width:`${t(g.energy,g.maxEnergy)}%`}})})]})]})},aG=({settingKey:g,label:t})=>{const i=gl(g),x=()=>{uh(g,!i)};return Yt.jsxs("label",{className:"flex items-center cursor-pointer",children:[Yt.jsx("span",{className:"mr-2 text-sm",children:t}),Yt.jsxs("div",{className:"relative",children:[Yt.jsx("input",{type:"checkbox",className:"sr-only",checked:i,onChange:x}),Yt.jsx("div",{className:"w-10 h-4 bg-gray-400 rounded-full shadow-inner"}),Yt.jsx("div",{className:`absolute w-6 h-6 bg-white opacity-75 rounded-full shadow -left-1 -top-1 transition-transform ${i?"transform translate-x-full bg-yellow-500 !opacity-100":""}`})]})]})},oG=(g,t)=>{const i=Tl(g);return i?Yt.jsxs("div",{style:{top:t.y,left:t.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[Yt.jsx("p",{className:"text-sm font-semibold",children:i.name}),Yt.jsxs("p",{className:"text-xs",children:["Type: ",i.type]}),Yt.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(i.bonuses)]}),Yt.jsxs("p",{className:"text-xs",children:["Durability: ",i.durability]}),Yt.jsxs("p",{className:"text-xs",children:["Weight: ",i.weight]})]}):null},lG=(g,t,i,x)=>Yt.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(g).map(T=>{const E=g[T];return hG(E,t,i,x)})}),hG=(g,t,i,x)=>{if(!g)return Yt.jsx("li",{className:"text-sm relative flex items-center justify-center border border-gray-500 bg-gray-200",style:{width:"32px",height:"32px"}},`empty-${Math.random()}`);const T=Tl(g);return T?Yt.jsxs("li",{className:"text-sm relative",onMouseEnter:E=>t(T.id,E),onMouseLeave:i,onClick:E=>x(T.id,E),children:[T.name," (",T.type,") - Bonuses: ",JSON.stringify(T.bonuses)," - Durability: ",T.durability," - Weight: ",T.weight]},T.id):null},uG=(g,t,i,x)=>Yt.jsx("ul",{className:"grid grid-cols-8 gap-1",children:g.map((T,E)=>{const s=Tl(T);return s?Yt.jsx("li",{className:"text-sm relative hover:scale-[1.3] transition ease-in-out duration-100",onMouseEnter:y=>t(s.id,y),onMouseLeave:i,onClick:y=>x(s.id,y),children:Yt.jsx("img",{src:s.img,alt:s.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},E):null})}),fG=()=>Yt.jsx("div",{className:"transition transform duration-1000 ease-in-out",children:Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Settings"}),Yt.jsx("p",{className:"text-sm",children:"Additional settings can go here."}),Yt.jsx(aG,{settingKey:"debugMode",label:"Debug Mode"})]})}),cG=()=>{const g=io(Tn);io(Sm),io(PI),io(Jr),Me.useEffect(()=>{const r=p=>{};return Si.on("playerEvent",r),()=>{Si.off("playerEvent",r)}},[]);const t=(r,p)=>{uh("tooltipItem",{id:r,position:{x:p.clientX+10,y:p.clientY-150}})},i=()=>{uh("tooltipItem",{...gl("tooltipItem"),id:null})},x=(r,p)=>{uh("submenuItem",{id:r,position:{x:p.clientX,y:p.clientY-150}})},T=()=>{uh("submenuItem",{...gl("submenuItem"),id:null})},E=(r,p)=>{const h=Tl(r);if(h){const a={itemId:h.id,action:p};Si.emit("itemAction",a),T()}};if(!g||!g.stats)return null;const s=gl("submenuItem"),y=s.id?WI(s.id):[],e=gl("tooltipItem");return Yt.jsxs("div",{className:"fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",children:[Yt.jsxs("div",{className:"flex flex-row space-y-2 align-top",children:[Yt.jsx(AM,{settingKey:"isStatsMenuCollapsed",label:"Stats"}),Yt.jsx(AM,{settingKey:"isSettingsMenuCollapsed",label:"Settings"})]}),Yt.jsx("div",{className:`transition transform duration-1000 ease-in-out ${gl("isSettingsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:Yt.jsx(fG,{})}),Yt.jsxs("div",{className:`transition transform duration-1000 ease-in-out ${gl("isStatsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:[Yt.jsx(sG,{stats:g.stats}),Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),Yt.jsx("p",{className:"text-sm",children:g.stats.username||"Guest"})]}),Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),Yt.jsx("p",{className:"text-sm",children:""})]}),Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),uG(g.inventory.backpack,t,i,x)]}),Yt.jsxs("div",{className:"mb-4",children:[Yt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),lG(g.inventory.equipment,t,i,x)]}),e.id&&oG(e.id,e.position),s.id&&Yt.jsxs("div",{style:{top:s.position.y,left:s.position.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[Yt.jsx("button",{onClick:T,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),Yt.jsx("p",{className:"text-sm strong",children:"Actions:"}),Yt.jsxs("ul",{className:"text-xs",children:[y.map(r=>Yt.jsx("li",{onClick:()=>s.id&&E(s.id,r),className:"cursor-pointer hover:bg-gray-600",children:r.charAt(0).toUpperCase()+r.slice(1)},r)),Yt.jsx("li",{onClick:T,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})]})},gy=jd(null),yy=jd(null),dG=()=>{const g=io(gy),[t,i]=Me.useState({x:0,y:0}),x=Me.useRef(null);Me.useEffect(()=>{const e=r=>{r&&(gy.set(r),setTimeout(()=>{i(T(r.coords.x,r.coords.y))},0))};return Si.on("npcInteractionClick",e),()=>{Si.off("npcInteractionClick",e)}},[]);const T=(e,r)=>{const h=x.current;if(!h)return{x:e,y:r};const a=h.getBoundingClientRect();let l=e,n=r;return l+a.width>window.innerWidth-10&&(l=window.innerWidth-a.width-10),n+a.height>window.innerHeight-10&&(n=window.innerHeight-a.height-10),l<10&&(l=10),n<10&&(n=10),{x:l,y:n}},E=e=>{if(g){const r=$A.getActionHandler(e);r&&(r(g),s())}},s=()=>{gy.set(null)},y=()=>{if(!g)return null;const{npcName:e,actions:r,npcId:p}=g,{x:h,y:a}=t;return Yt.jsxs("div",{ref:x,className:"absolute bg-zinc-900 border border-yellow-300 rounded-md p-2 z-[100]",style:{left:`${h}px`,top:`${a}px`},children:[Yt.jsxs("div",{className:"flex justify-between items-center mb-2",children:[Yt.jsx("h3",{className:"font-bold text-sm text-white",children:e}),Yt.jsx("button",{onClick:s,className:"text-xs font-bold m-1 text-yellow-300 border rounded-full pl-1 pr-1 hover:text-yellow-500 hover:scale-110",children:"X"})]}),r.map((l,n)=>Yt.jsx("button",{onClick:()=>E(l),className:"block w-full text-sm py-1 px-2 mb-1 bg-yellow-500 hover:bg-yellow-400 rounded capitalize",children:l},n)),Yt.jsx("button",{onClick:s,className:"block w-full text-xs py-1 px-2 mt-2 bg-red-500 hover:bg-red-600 rounded text-white",children:"Close"})]},p)};return Yt.jsx("div",{children:y()})},xy=jd(null),Sy=jd({}),pG=Ou.memo(({text:g,onComplete:t})=>Yt.jsx(jA,{text:g,onComplete:t})),vG=Ou.memo(({text:g,onComplete:t})=>Yt.jsx(jA,{text:g,onComplete:t})),mG=()=>{const g=io(xy),t=io(Sy),[i,x]=Me.useState(!1),[T,E]=Me.useState(!1);Me.useEffect(()=>{const y=e=>{if(e){xy.set(e);const r=document.querySelector("#hs-stacked-overlays-dialogue");r&&(r.classList.remove("hidden"),r.classList.add("open")),e.npcId&&(Zf.createNPCSession(Sy,e.npcId),x(!1),E(!1))}};return Si.on("npcDialogue",y),()=>{Si.off("npcDialogue",y)}},[]);const s=()=>{const y=document.querySelector("#hs-stacked-overlays-dialogue");y&&(y.classList.add("hidden"),y.classList.remove("open")),xy.set(null),Sy.set({}),x(!1),E(!1)};return Yt.jsx(Yt.Fragment,{children:Yt.jsx("div",{id:"hs-stacked-overlays-dialogue",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 w-full h-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:Yt.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all w-full h-full sm:max-w-lg sm:w-full m-3 sm:mx-auto md:min-w-fit",children:Yt.jsx("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover min-w-[800px] min-h-[500px]",style:{backgroundImage:`url(${g?.dialogue.backgroundImage||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:g?Yt.jsxs(Yt.Fragment,{children:[Yt.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center relative",children:[Yt.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4 p-4 absolute top-2 left-2",children:g.npcId&&t[`${g.npcId}_name`]?t[`${g.npcId}_name`]:"Unknown"}),Yt.jsx("img",{src:g.npcId&&t[`${g.npcId}_avatar`]?t[`${g.npcId}_avatar`]:"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md absolute bottom-0 left-0"})]}),Yt.jsxs("div",{className:"w-full md:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[Yt.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[Yt.jsx("h3",{className:"font-bold text-yellow-400 text-shadow-outline-white",children:g.dialogue.title||"Dialogue"}),Yt.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays-dialogue",onClick:s,children:[Yt.jsx("span",{className:"sr-only",children:"Close"}),Yt.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt.jsx("path",{d:"M18 6 6 18"}),Yt.jsx("path",{d:"m6 6 12 12"})]})]})]}),Yt.jsx("div",{className:"p-4 overflow-y-auto",children:Yt.jsxs("div",{className:"flex flex-col",children:[Yt.jsx("div",{className:"flex justify-end",children:Yt.jsxs("div",{className:"w-3/4 mt-1 mb-2 text-yellow-400 text-shadow-outline-whites bg-zinc-950/40 rounded-xl p-4 text-right",children:[g.dialogue.playerResponse&&!T&&Yt.jsx(vG,{text:`${g.dialogue.playerResponse}`,onComplete:()=>E(!0)}),T&&Yt.jsx("div",{children:g.dialogue.playerResponse})]})}),Yt.jsx("div",{className:"mt-1 mb-2 text-white bg-zinc-950/40 text-shadow-outline-white rounded-xl p-4 flex w-3/4",children:Yt.jsxs("div",{className:"w-full",children:[g.dialogue.message&&T&&!i&&Yt.jsx(pG,{text:g.dialogue.message,onComplete:()=>x(!0)}),i&&Yt.jsx("div",{children:g.dialogue.message})]})})]})}),Yt.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:Yt.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays-dialogue",onClick:s,disabled:!T,children:[Yt.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),Yt.jsx("span",{className:`relative ${T?"":"text-gray-500"}`,children:"Okay."})]})})]})]}):Yt.jsx("div",{className:"w-full p-4 rounded-xl flex flex-col items-center justify-center",children:Yt.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4 p-4",children:"Loading..."})})})})})})},gG=()=>{const g=io(Qh);Me.useEffect(()=>{const i=x=>{if(x){const T=Date.now()+Math.random(),E={id:T,...x};Qh.set([...Qh.get(),E]),setTimeout(()=>{Qh.set(Qh.get().filter(s=>s.id!==T))},5e3)}};return Si.on("notification",i),()=>{Si.off("notification",i)}},[]);const t=i=>{Qh.set(Qh.get().filter(x=>x.id!==i))};return Yt.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(g)&&g.map(i=>Yt.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${i.notificationType.color}`,role:"alert",children:Yt.jsxs("div",{className:"flex p-4",children:[Yt.jsx("img",{src:i.notificationType.imgUrl,alt:i.notificationType.type,className:"flex-shrink-0 size-4"}),Yt.jsxs("div",{className:"ms-2",children:[Yt.jsx("h3",{className:"text-sm font-bold",children:i.title}),Yt.jsx("p",{className:"text-sm",children:i.message})]}),Yt.jsx("div",{className:"ms-auto",children:Yt.jsxs("button",{type:"button",className:"inline-flex flex-shrink-0 justify-center items-center size-5 rounded-lg text-gray-800 opacity-50 hover:opacity-100 focus:outline-none focus:opacity-100 dark:text-white",onClick:()=>t(i.id),children:[Yt.jsx("span",{className:"sr-only",children:"Close"}),Yt.jsxs("svg",{className:"flex-shrink-0 size-4 bg-zinc-900",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Yt.jsx("path",{d:"M18 6 6 18"}),Yt.jsx("path",{d:"m6 6 12 12"})]})]})})]})},i.id))})},yG=()=>{const g=io(yy),[t,i]=Me.useState([]),[x,T]=Me.useState(null);Me.useEffect(()=>{const y=r=>{r&&yy.set(r)},e=r=>{r&&i(r.diceValues)};return Si.on("playerSteal",y),Si.on("diceRollResult",e),()=>{Si.off("playerSteal",y),Si.off("diceRollResult",e)}},[]),Me.useEffect(()=>{t.length>0&&E(t)},[t]);const E=y=>{const e=y.reduce((a,l)=>a+l,0);if(T(e),!g)return;let r="",p="";switch(!0){case e>=24:r="01J27QABD2GPFNRVK69S51HSGB",p=`You successfully stole a ${r}!`;break;case e>=20:r="01J27QN2KZG1RDZW4CE9Q9Z3YQ",p=`You successfully stole a ${r}!`;break;case e>=18:r="01J269PK47V1DWX2S1251DEASD",p=`You successfully stole a ${r}!`;break;case e>=15:r="Blue Shark",p=`You successfully stole a ${r}!`;break;case e>=12:r="Salmon",p=`You successfully stole a ${r}!`;break;case e<=4:Si.emit("notification",{title:"Danger",message:`You crit failed to steal from ${g.npcName}!`,notificationType:Ru.danger}),Si.emit("playerDamage",{damage:"5"});break;default:Si.emit("notification",{title:"Danger",message:`You failed to steal from ${g.npcName}!`,notificationType:Ru.danger}),Si.emit("playerDamage",{damage:"1"});return}const h=bI(r);h?Si.emit("playerReward",{message:p,item:h}):console.warn("Item not found in ItemDB")},s=()=>{dw([]),i([]),T(null),yy.set(null)};return g?Yt.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 bg-zinc-800 bg-opacity-50",children:Yt.jsxs("div",{className:"bg-zinc-800 p-4 rounded-lg shadow-lg w-3/4",children:[Yt.jsx(xG,{npcName:g.npcName,roll:x}),Yt.jsx(TG,{}),Yt.jsx(EG,{handleClose:s})]})}):null},xG=({npcName:g,roll:t})=>Yt.jsxs("div",{children:[Yt.jsx("h2",{className:"text-lg text-yellow-400 font-bold mb-4",children:"Steal Attempt"}),Yt.jsxs("p",{className:"mb-4",children:["Roll the dice to steal from ",g,". You need a total of 12 or higher to succeed."]}),t!==null&&Yt.jsxs("p",{className:"mb-4",children:["Your roll: ",t]})]}),SG=()=>Yt.jsx(k7,{textures:{side1:"/assets/items/set/dice/dice1.png",side2:"/assets/items/set/dice/dice2.png",side3:"/assets/items/set/dice/dice3.png",side4:"/assets/items/set/dice/dice4.png",side5:"/assets/items/set/dice/dice5.png",side6:"/assets/items/set/dice/dice6.png"},styleClass:"h-96",diceCount:4}),TG=Me.memo(SG),EG=({handleClose:g})=>Yt.jsx("button",{onClick:g,className:"block w-full py-2 bg-red-500 text-white rounded hover:bg-red-700 mt-2",children:"Close"}),MG=mm.div` + // Your style here +`;function BG(){return Yt.jsxs(MG,{children:[Yt.jsx(cG,{}),Yt.jsxs("div",{className:"flex justify-center items-center h-screen overflow-hidden",children:[Yt.jsx(mG,{}),Yt.jsx(yG,{}),Yt.jsx(nG,{}),Yt.jsx(gG,{})]}),Yt.jsx(dG,{}),Yt.jsx(rG,{})]})}export{BG as default}; diff --git a/docs/_astro/App.DxAk5t4Z.js b/docs/_astro/App.DxAk5t4Z.js deleted file mode 100644 index 170df90..0000000 --- a/docs/_astro/App.DxAk5t4Z.js +++ /dev/null @@ -1,6405 +0,0 @@ -import{j as ut}from"./jsx-runtime.BPj4-Rfu.js";import{g as Wu,R as Rs,r as pe,c as Hx}from"./index.SSXOyoI7.js";import{g as zi,D as Ai,a as jx,r as fu,e as Kx,u as $x,b as jt,n as _s,c as Zx,d as Jx,f as Qx,h as Zs,i as kx,j as qx,k as _x,l as du,m as di,o as Gi,s as Ts,p as ty,q as ey,t as iy,v as sy,w as ny,x as ry,T as Yu,y as _i,M as ay,z as oy,A as hy}from"./npchandler.B5V8c1BD.js";import{a as rn}from"./index.DxhZiom7.js";import"./index.BH1EYZ08.js";var Hu={exports:{}},qt={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var go=Symbol.for("react.element"),mo=Symbol.for("react.portal"),lr=Symbol.for("react.fragment"),ur=Symbol.for("react.strict_mode"),fr=Symbol.for("react.profiler"),dr=Symbol.for("react.provider"),cr=Symbol.for("react.context"),ly=Symbol.for("react.server_context"),vr=Symbol.for("react.forward_ref"),pr=Symbol.for("react.suspense"),gr=Symbol.for("react.suspense_list"),mr=Symbol.for("react.memo"),xr=Symbol.for("react.lazy"),uy=Symbol.for("react.offscreen"),ju;ju=Symbol.for("react.module.reference");function ti(E){if(typeof E=="object"&&E!==null){var S=E.$$typeof;switch(S){case go:switch(E=E.type,E){case lr:case fr:case ur:case pr:case gr:return E;default:switch(E=E&&E.$$typeof,E){case ly:case cr:case vr:case xr:case mr:case dr:return E;default:return S}}case mo:return S}}}qt.ContextConsumer=cr;qt.ContextProvider=dr;qt.Element=go;qt.ForwardRef=vr;qt.Fragment=lr;qt.Lazy=xr;qt.Memo=mr;qt.Portal=mo;qt.Profiler=fr;qt.StrictMode=ur;qt.Suspense=pr;qt.SuspenseList=gr;qt.isAsyncMode=function(){return!1};qt.isConcurrentMode=function(){return!1};qt.isContextConsumer=function(E){return ti(E)===cr};qt.isContextProvider=function(E){return ti(E)===dr};qt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===go};qt.isForwardRef=function(E){return ti(E)===vr};qt.isFragment=function(E){return ti(E)===lr};qt.isLazy=function(E){return ti(E)===xr};qt.isMemo=function(E){return ti(E)===mr};qt.isPortal=function(E){return ti(E)===mo};qt.isProfiler=function(E){return ti(E)===fr};qt.isStrictMode=function(E){return ti(E)===ur};qt.isSuspense=function(E){return ti(E)===pr};qt.isSuspenseList=function(E){return ti(E)===gr};qt.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===lr||E===fr||E===ur||E===pr||E===gr||E===uy||typeof E=="object"&&E!==null&&(E.$$typeof===xr||E.$$typeof===mr||E.$$typeof===dr||E.$$typeof===cr||E.$$typeof===vr||E.$$typeof===ju||E.getModuleId!==void 0)};qt.typeOf=ti;Hu.exports=qt;var Ku=Hu.exports;function fy(E){function S(J,X,Y,D,z){for(var W=0,H=0,Z=0,Q=0,k,et,st=0,rt=0,ot,dt=ot=k=0,at=0,pt=0,Pt=0,Ct=0,Et=Y.length,vt=Et-1,St,gt="",Mt="",It="",Kt="",Gt;atk)&&(Ct=(gt=gt.replace(" ",":")).length),0D&&(D=(X=X.trim()).charCodeAt(0)),D){case 38:return X.replace(s,"$1"+J.trim());case 58:return J.trim()+X.replace(s,"$1"+J.trim());default:if(0<1*Y&&0H.charCodeAt(8))break;case 115:z=z.replace(H,"-webkit-"+H)+";"+z;break;case 207:case 102:z=z.replace(H,"-webkit-"+(102Y.charCodeAt(0)&&(Y=Y.trim()),K=Y,Y=[K],01?S-1:0),B=1;B0?" Args: "+A.join(", "):""))}var Oy=function(){function E(A){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=A}var S=E.prototype;return S.indexOfGroup=function(A){for(var B=0,I=0;I=this.groupSizes.length){for(var I=this.groupSizes,b=I.length,c=b;A>=c;)(c<<=1)<0&&an(16,""+A);this.groupSizes=new Uint32Array(c),this.groupSizes.set(I),this.length=c;for(var m=b;m=this.length||this.groupSizes[A]===0)return B;for(var I=this.groupSizes[A],b=this.indexOfGroup(A),c=b+I,m=b;m=Js&&(Js=S+1),tr.set(E,S),rr.set(S,E)},By="style["+As+'][data-styled-version="5.3.6"]',by=new RegExp("^"+As+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Ny=function(E,S,A){for(var B,I=A.split(","),b=0,c=I.length;b=0;a--){var v=t[a];if(v&&v.nodeType===1&&v.hasAttribute(As))return v}}(A),b=I!==void 0?I.nextSibling:null;B.setAttribute(As,"active"),B.setAttribute("data-styled-version","5.3.6");var c=zy();return c&&B.setAttribute("nonce",c),A.insertBefore(B,b),B},Uy=function(){function E(A){var B=this.element=ku(A);B.appendChild(document.createTextNode("")),this.sheet=function(I){if(I.sheet)return I.sheet;for(var b=document.styleSheets,c=0,m=b.length;c=0){var I=document.createTextNode(B),b=this.nodes[A];return this.element.insertBefore(I,b||null),this.length++,!0}return!1},S.deleteRule=function(A){this.element.removeChild(this.nodes[A]),this.length--},S.getRule=function(A){return A0&&(o+=r+",")}),b+=""+a+v+'{content:"'+o+`"}/*!sc*/ -`}}}return b}(this)},E}(),Yy=/(a)(d)/gi,Tu=function(E){return String.fromCharCode(E+(E>25?39:97))};function so(E){var S,A="";for(S=Math.abs(E);S>52;S=S/52|0)A=Tu(S%52)+A;return(Tu(S%52)+A).replace(Yy,"$1-$2")}var Ss=function(E,S){for(var A=S.length;A;)E=33*E^S.charCodeAt(--A);return E},_u=function(E){return Ss(5381,E)};function Hy(E){for(var S=0;S>>0);if(!A.hasNameForId(I,m)){var t=B(c,"."+m,void 0,I);A.insertRules(I,m,t)}b.push(m),this.staticRulesId=m}else{for(var a=this.rules.length,v=Ss(this.baseHash,B.hash),o="",r=0;r>>0);if(!A.hasNameForId(I,h)){var s=B(o,"."+h,void 0,I);A.insertRules(I,h,s)}b.push(h)}}return b.join(" ")},E}(),$y=/^\s*\/\/.*$/gm,Zy=[":","[",".","#"];function Jy(E){var S,A,B,I,b=E===void 0?Ui:E,c=b.options,m=c===void 0?Ui:c,t=b.plugins,a=t===void 0?nr:t,v=new fy(m),o=[],r=function(i){function h(s){if(s)try{i(s+"}")}catch{}}return function(s,l,f,u,d,p,g,y,x,T){switch(s){case 1:if(x===0&&l.charCodeAt(0)===64)return i(l+";"),"";break;case 2:if(y===0)return l+"/*|*/";break;case 3:switch(y){case 102:case 112:return i(f[0]+l),"";default:return l+(T===0?"/*|*/":"")}case-2:l.split("/*|*/}").forEach(h)}}}(function(i){o.push(i)}),n=function(i,h,s){return h===0&&Zy.indexOf(s[A.length])!==-1||s.match(I)?i:"."+S};function e(i,h,s,l){l===void 0&&(l="&");var f=i.replace($y,""),u=h&&s?s+" "+h+" { "+f+" }":f;return S=l,A=h,B=new RegExp("\\"+A+"\\b","g"),I=new RegExp("(\\"+A+"\\b){2,}"),v(s||!h?"":h,u)}return v.use([].concat(a,[function(i,h,s){i===2&&s.length&&s[0].lastIndexOf(A)>0&&(s[0]=s[0].replace(B,n))},r,function(i){if(i===-2){var h=o;return o=[],h}}])),e.hash=a.length?a.reduce(function(i,h){return h.name||an(15),Ss(i,h.name)},5381).toString():"",e}var tf=Rs.createContext();tf.Consumer;var ef=Rs.createContext(),Qy=(ef.Consumer,new qu),no=Jy();function ky(){return pe.useContext(tf)||Qy}function qy(){return pe.useContext(ef)||no}var _y=function(){function E(S,A){var B=this;this.inject=function(I,b){b===void 0&&(b=no);var c=B.name+b.hash;I.hasNameForId(B.id,c)||I.insertRules(B.id,c,b(B.rules,c,"@keyframes"))},this.toString=function(){return an(12,String(B.name))},this.name=S,this.id="sc-keyframes-"+S,this.rules=A}return E.prototype.getName=function(S){return S===void 0&&(S=no),this.name+S.hash},E}(),t1=/([A-Z])/,e1=/([A-Z])/g,i1=/^ms-/,s1=function(E){return"-"+E.toLowerCase()};function Su(E){return t1.test(E)?E.replace(e1,s1).replace(i1,"-ms-"):E}var Cu=function(E){return E==null||E===!1||E===""};function Ms(E,S,A,B){if(Array.isArray(E)){for(var I,b=[],c=0,m=E.length;c1?S-1:0),B=1;B?@[\\\]^`{|}~-]+/g,o1=/(^-|-$)/g;function ja(E){return E.replace(a1,"-").replace(o1,"")}var h1=function(E){return so(_u(E)>>>0)};function kn(E){return typeof E=="string"&&!0}var ro=function(E){return typeof E=="function"||typeof E=="object"&&E!==null&&!Array.isArray(E)},l1=function(E){return E!=="__proto__"&&E!=="constructor"&&E!=="prototype"};function u1(E,S,A){var B=E[A];ro(S)&&ro(B)?sf(B,S):E[A]=S}function sf(E){for(var S=arguments.length,A=new Array(S>1?S-1:0),B=1;B=0||(T[y]=p[y]);return T}(S,["componentId"]),d=f&&f+"-"+(kn(l)?l:ja(xu(l)));return rf(l,Mi({},u,{attrs:r,componentId:d}),A)},Object.defineProperty(e,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(l){this._foldedDefaultProps=B?sf({},E.defaultProps,l):l}}),e.toString=function(){return"."+e.styledComponentId},I&&Fy(e,E,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),e}var ar=function(E){return function S(A,B,I){if(I===void 0&&(I=Ui),!Ku.isValidElementType(B))return an(1,String(B));var b=function(){return A(B,I,n1.apply(void 0,arguments))};return b.withConfig=function(c){return S(A,B,Mi({},I,{},c))},b.attrs=function(c){return S(A,B,Mi({},I,{attrs:Array.prototype.concat(I.attrs,c).filter(Boolean)}))},b}(rf,E)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(E){ar[E]=ar(E)});var af={exports:{}};(function(E,S){(function(B,I){E.exports=I()})(Hx,()=>(()=>{var A={50792:c=>{var m=Object.prototype.hasOwnProperty,t="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(t=!1));function v(e,i,h){this.fn=e,this.context=i,this.once=h||!1}function o(e,i,h,s,l){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new v(h,s||e,l),u=t?t+i:i;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],f]:e._events[u].push(f):(e._events[u]=f,e._eventsCount++),e}function r(e,i){--e._eventsCount===0?e._events=new a:delete e._events[i]}function n(){this._events=new a,this._eventsCount=0}n.prototype.eventNames=function(){var i=[],h,s;if(this._eventsCount===0)return i;for(s in h=this._events)m.call(h,s)&&i.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(h)):i},n.prototype.listeners=function(i){var h=t?t+i:i,s=this._events[h];if(!s)return[];if(s.fn)return[s.fn];for(var l=0,f=s.length,u=new Array(f);l{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(38829),v=function(o,r,n,e){for(var i=o[0],h=1;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"angle",r,n,e,i)};c.exports=v},60757:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){for(var o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){v===void 0&&(v=0);for(var o=v;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){v===void 0&&(v=0);for(var o=t.length-1;o>=v;o--){var r=t[o],n=!0;for(var e in a)r[e]!==a[e]&&(n=!1);if(n)return r}return null};c.exports=m},94420:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(11879),v=t(60461),o=t(95540),r=t(29747),n=t(41481),e=new n({sys:{queueDepthSort:r,events:{once:r}}},0,0,1,1).setOrigin(0,0),i=function(h,s){s===void 0&&(s={});var l=s.hasOwnProperty("width"),f=s.hasOwnProperty("height"),u=o(s,"width",-1),d=o(s,"height",-1),p=o(s,"cellWidth",1),g=o(s,"cellHeight",p),y=o(s,"position",v.TOP_LEFT),x=o(s,"x",0),T=o(s,"y",0),C=0,M=0,w=u*p,L=d*g;e.setPosition(x,T),e.setSize(p,g);for(var F=0;F{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"alpha",r,n,e,i)};c.exports=v},67285:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"x",r,n,e,i)};c.exports=v},9074:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"x",r,e,h,s),a(o,"y",n,i,h,s)};c.exports=v},75222:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"y",r,n,e,i)};c.exports=v},22983:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v===void 0&&(v=0),o===void 0&&(o=6.28);for(var r=v,n=(o-v)/t.length,e=a.x,i=a.y,h=a.radius,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v===void 0&&(v=0),o===void 0&&(o=6.28);for(var r=v,n=(o-v)/t.length,e=a.width/2,i=a.height/2,h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(15258),v=t(26708),o=function(r,n,e){var i;e?i=v(n,e,r.length):i=a(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 a=t(14649),v=t(86003),o=t(49498),r=function(n,e,i){i===void 0&&(i=0);var h=a(e,!1,n.length);i>0?v(h,i):i<0&&o(h,Math.abs(i));for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(84993),v=function(o,r,n){var e=a({x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},n),i=a({x1:r.x2,y1:r.y2,x2:r.x3,y2:r.y3},n),h=a({x1:r.x3,y1:r.y3,x2:r.x1,y2:r.y1},n);e.pop(),i.pop(),h.pop(),e=e.concat(i,h);for(var s=e.length/o.length,l=0,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){for(var o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r,n){o===void 0&&(o=0),r===void 0&&(r=0),n===void 0&&(n=1);var e,i=0,h=t.length;if(n===1)for(e=r;e=0;e--)t[e][a]+=v+i*o,i++;return t};c.exports=m},43967:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r,n){o===void 0&&(o=0),r===void 0&&(r=0),n===void 0&&(n=1);var e,i=0,h=t.length;if(n===1)for(e=r;e=0;e--)t[e][a]=v+i*o,i++;return t};c.exports=m},88926:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(28176),v=function(o,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 a=t(24820),v=function(o,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 a=t(65822),v=function(o,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 a=t(26597),v=function(o,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 a=t(90260),v=function(o,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 a=t(66979),v=function(o,r,n,e,i){return a(o,"rotation",r,n,e,i)};c.exports=v},91051:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(1163),v=t(20339),o=function(r,n,e){for(var i=n.x,h=n.y,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(1163),v=function(o,r,n,e){var i=r.x,h=r.y;if(e===0)return o;for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"scaleX",r,n,e,i)};c.exports=v},94868:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"scaleX",r,e,h,s),a(o,"scaleY",n,i,h,s)};c.exports=v},95532:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66979),v=function(o,r,n,e,i){return a(o,"scaleY",r,n,e,i)};c.exports=v},8689:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"alpha",r,n,e,i)};c.exports=v},2645:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e){return a(o,"blendMode",r,0,n,e)};c.exports=v},32372:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"depth",r,n,e,i)};c.exports=v},85373:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){for(var o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"originX",r,e,h,s),a(o,"originY",n,i,h,s),o.forEach(function(l){l.updateDisplayOrigin()}),o};c.exports=v},79939:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"rotation",r,n,e,i)};c.exports=v},2699:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"scaleX",r,e,h,s),a(o,"scaleY",n,i,h,s)};c.exports=v},98739:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"scaleX",r,n,e,i)};c.exports=v},98476:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"scaleY",r,n,e,i)};c.exports=v},6207:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"scrollFactorX",r,e,h,s),a(o,"scrollFactorY",n,i,h,s)};c.exports=v},6607:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"scrollFactorX",r,n,e,i)};c.exports=v},72248:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"scrollFactorY",r,n,e,i)};c.exports=v},14036:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,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 a=t(43967),v=function(o,r,n,e){return a(o,"visible",r,0,n,e)};c.exports=v},77597:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"x",r,n,e,i)};c.exports=v},83194:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i,h,s){return n==null&&(n=r),a(o,"x",r,e,h,s),a(o,"y",n,i,h,s)};c.exports=v},67678:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43967),v=function(o,r,n,e,i){return a(o,"y",r,n,e,i)};c.exports=v},35850:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i){e===void 0&&(e=0),i===void 0&&(i=new a);var h,s,l=o.length;if(l===1)h=o[0].x,s=o[0].y,o[0].x=r,o[0].y=n;else{var f=1,u=0;e===0&&(u=l-1,f=l-2),h=o[u].x,s=o[u].y,o[u].x=r,o[u].y=n;for(var d=0;d=l||f===-1)){var p=o[f],g=p.x,y=p.y;p.x=h,p.y=s,h=g,s=y,e===0?f--:f++}}return i.x=h,i.y=s,i};c.exports=v},8628:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33680),v=function(o){return a(o)};c.exports=v},21837:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7602),v=function(o,r,n,e,i){i===void 0&&(i=!1);var h=Math.abs(e-n)/o.length,s;if(i)for(s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54261),v=function(o,r,n,e,i){i===void 0&&(i=!1);var h=Math.abs(e-n)/o.length,s;if(i)for(s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){if(r===void 0&&(r=!1),t.length===0)return t;if(t.length===1)return r?t[0][a]+=(o+v)/2:t[0][a]=(o+v)/2,t;var n=Math.abs(o-v)/(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 m=function(t){for(var a=0;a{/** - * @author Richard Davey - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(15994),v=function(o,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} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(74943),r=t(81957),n=t(41138),e=t(35154),i=t(90126),h=new v({initialize:function(l,f,u){this.manager=l,this.key=f,this.type="frame",this.frames=this.getFrames(l.textureManager,e(u,"frames",[]),e(u,"defaultTextureKey",null),e(u,"sortFrames",!0)),this.frameRate=e(u,"frameRate",null),this.duration=e(u,"duration",null),this.msPerFrame,this.skipMissedFrames=e(u,"skipMissedFrames",!0),this.delay=e(u,"delay",0),this.repeat=e(u,"repeat",0),this.repeatDelay=e(u,"repeatDelay",0),this.yoyo=e(u,"yoyo",!1),this.showBeforeDelay=e(u,"showBeforeDelay",!1),this.showOnStart=e(u,"showOnStart",!1),this.hideOnComplete=e(u,"hideOnComplete",!1),this.randomFrame=e(u,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(s,l,f,u){f===null&&u===null?(s.frameRate=24,s.duration=24/l*1e3):f&&u===null?(s.duration=f,s.frameRate=l/(f/1e3)):(s.frameRate=u,s.duration=l/u*1e3),s.msPerFrame=1e3/s.frameRate},addFrame:function(s){return this.addFrameAt(this.frames.length,s)},addFrameAt:function(s,l){var f=this.getFrames(this.manager.textureManager,l);if(f.length>0){if(s===0)this.frames=f.concat(this.frames);else if(s===this.frames.length)this.frames=this.frames.concat(f);else{var u=this.frames.slice(0,s),d=this.frames.slice(s);this.frames=u.concat(f,d)}this.updateFrameSequence()}return this},checkFrame:function(s){return s>=0&&s0){g.isLast=!0,g.nextFrame=d[0],d[0].prevFrame=g;var N=1/(d.length-1);for(x=0;x0?s.inReverse&&s.forward?s.forward=!1:this.repeatAnimation(s):s.complete():this.updateAndGetNextTick(s,l.nextFrame)},handleYoyoFrame:function(s,l){if(l||(l=!1),s.inReverse===!l&&s.repeatCounter>0){(s.repeatDelay===0||s.pendingRepeat)&&(s.forward=l),this.repeatAnimation(s);return}if(s.inReverse!==l&&s.repeatCounter===0){s.complete();return}s.forward=l;var f=l?s.currentFrame.nextFrame:s.currentFrame.prevFrame;this.updateAndGetNextTick(s,f)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(s){var l=s.currentFrame;l.isFirst?s.yoyo?this.handleYoyoFrame(s,!0):s.repeatCounter>0?s.inReverse&&!s.forward?this.repeatAnimation(s):(s.forward=!0,this.repeatAnimation(s)):s.complete():this.updateAndGetNextTick(s,l.prevFrame)},updateAndGetNextTick:function(s,l){s.setCurrentFrame(l),this.getNextTick(s)},removeFrame:function(s){var l=this.frames.indexOf(s);return l!==-1&&this.removeFrameAt(l),this},removeFrameAt:function(s){return this.frames.splice(s,1),this.updateFrameSequence(),this},repeatAnimation:function(s){if(s._pendingStop===2){if(s._pendingStopValue===0)return s.stop();s._pendingStopValue--}s.repeatDelay>0&&!s.pendingRepeat?(s.pendingRepeat=!0,s.accumulator-=s.nextTick,s.nextTick+=s.repeatDelay):(s.repeatCounter--,s.forward?s.setCurrentFrame(s.currentFrame.nextFrame):s.setCurrentFrame(s.currentFrame.prevFrame),s.isPlaying&&(this.getNextTick(s),s.handleRepeat()))},toJSON:function(){var s={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(l){s.frames.push(l.toJSON())}),s},updateFrameSequence:function(){for(var s=this.frames.length,l=1/(s-1),f,u=0;u1?(f.isLast=!0,f.prevFrame=this.frames[s-2],f.nextFrame=this.frames[0]):s>1&&(f.prevFrame=this.frames[u-1],f.nextFrame=this.frames[u+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(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i,h){h===void 0&&(h=!1),this.textureKey=r,this.textureFrame=n,this.index=e,this.frame=i,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}});c.exports=v},60848:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(42099),v=t(83419),o=t(90330),r=t(50792),n=t(74943),e=t(8443),i=t(95540),h=t(35154),s=t(36383),l=t(20283),f=t(41836),u=new v({Extends:r,initialize:function(p){r.call(this),this.game=p,this.textureManager=null,this.globalTimeScale=1,this.anims=new o,this.mixes=new o,this.paused=!1,this.name="AnimationManager",p.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(d,p,g){var y=this.anims,x=this.mixes,T=typeof d=="string"?d:d.key,C=typeof p=="string"?p:p.key;if(y.has(T)&&y.has(C)){var M=x.get(T);M||(M={}),M[C]=g,x.set(T,M)}return this},removeMix:function(d,p){var g=this.mixes,y=typeof d=="string"?d:d.key,x=g.get(y);if(x)if(p){var T=typeof p=="string"?p:p.key;x.hasOwnProperty(T)&&delete x[T]}else p||g.delete(y);return this},getMix:function(d,p){var g=this.mixes,y=typeof d=="string"?d:d.key,x=typeof p=="string"?p:p.key,T=g.get(y);return T&&T.hasOwnProperty(x)?T[x]:0},add:function(d,p){return this.anims.has(d)?(console.warn("Animation key exists: "+d),this):(p.key=d,this.anims.set(d,p),this.emit(n.ADD_ANIMATION,d,p),this)},exists:function(d){return this.anims.has(d)},createFromAseprite:function(d,p,g){var y=[],x=this.game.cache.json.get(d);if(!x)return console.warn("No Aseprite data found for: "+d),y;var T=this,C=h(x,"meta",null),M=h(x,"frames",null);if(C&&M){var w=h(C,"frameTags",[]);w.forEach(function(L){var F=[],O=i(L,"name",null),N=i(L,"from",0),G=i(L,"to",0),V=i(L,"direction","forward");if(O&&(!p||p&&p.indexOf(O)>-1)){for(var j=0,K=N;K<=G;K++){var J=K.toString(),X=M[J];if(X){var Y=i(X,"duration",s.MAX_SAFE_INTEGER);F.push({key:d,frame:J,duration:Y}),j+=Y}}V==="reverse"&&(F=F.reverse());var D={key:O,frames:F,duration:j,yoyo:V==="pingpong"},z;g?g.anims&&(z=g.anims.create(D)):z=T.create(D),z&&y.push(z)}})}return y},create:function(d){var p=d.key,g=!1;return p&&(g=this.get(p),g?console.warn("AnimationManager key already exists: "+p):(g=new a(this,p,d),this.anims.set(p,g),this.emit(n.ADD_ANIMATION,p,g))),g},fromJSON:function(d,p){p===void 0&&(p=!1),p&&this.anims.clear(),typeof d=="string"&&(d=JSON.parse(d));var g=[];if(d.hasOwnProperty("anims")&&Array.isArray(d.anims)){for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(42099),v=t(30976),o=t(83419),r=t(90330),n=t(74943),e=t(95540),i=new o({initialize:function(s){this.parent=s,this.animationManager=s.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 s=this.parent;if(h===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,s;Array.isArray(h)||(h=[h]);for(var l=0;lu&&(g=0),this.randomFrame&&(g=v(0,u-1));var y=f.frames[g];g===0&&!this.forward&&(y=f.getLastFrame()),this.currentFrame=y}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,s){if(!this.isPlaying)this.delayCounter=s,this.play(h,!0);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.nextAnim=h,this._pendingStop=1,this._pendingStopValue=s}return this.parent},playAfterRepeat:function(h,s){if(s===void 0&&(s=1),!this.isPlaying)this.play(h);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.repeatCounter!==-1&&s>this.repeatCounter&&(s=this.repeatCounter),this.nextAnim=h,this._pendingStop=2,this._pendingStopValue=s}return this.parent},play:function(h,s){s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent,u=typeof h=="string"?h:h.key;if(s&&this.isPlaying&&l.key===u)return f;if(l&&this.isPlaying){var d=this.animationManager.getMix(l.key,h);if(d>0)return this.playAfterDelay(h,d)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h)},playReverse:function(h,s){s===void 0&&(s=!1);var l=typeof h=="string"?h:h.key;return s&&this.isPlaying&&this.currentAnim.key===l?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h))},startAnimation:function(h){this.load(h);var s=this.currentAnim,l=this.parent;return s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,s.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)),l},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,s){var l=this.currentAnim;if(l){var f=this.currentFrame,u=this.parent,d=f.textureFrame;u.emit(h,l,f,u,d),s&&u.emit(s+l.key,l,f,u,d)}},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 s=h.progress;return this.inReverse&&(s*=-1),s},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,s){s===void 0&&(s=this.currentAnim),this.isPlaying&&s.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(h,s){h===void 0&&(h=!1),s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent;return l?(s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),l.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(l.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,s){var l=this.currentAnim;if(!(!this.isPlaying||!l||l.paused)){if(this.accumulator+=s*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=s,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?l.nextFrame(this):l.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var f=0;do this.forward?l.nextFrame(this):l.previousFrame(this),f++;while(this.isPlaying&&this.accumulator>this.nextTick&&f<60)}}},setCurrentFrame:function(h){var s=this.parent;return this.currentFrame=h,s.texture=h.frame.texture,s.frame=h.frame,s.isCropped&&s.frame.updateCropUVs(s._crop,s.flipX,s.flipY),h.setAlpha&&(s.alpha=h.alpha),s.setSizeToFrame(),s._originComponent&&(h.frame.customPivot?s.setOrigin(h.frame.pivotX,h.frame.pivotY):s.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(n.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===h&&this.stop()),s},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 s=h.key,l=!1;return s&&(l=this.get(s),l?console.warn("Animation key already exists: "+s):(l=new a(this,s,h),this.anims||(this.anims=new r),this.anims.set(s,l))),l},createFromAseprite:function(h,s){return this.animationManager.createFromAseprite(h,s,this.parent)},generateFrameNames:function(h,s){return this.animationManager.generateFrameNames(h,s)},generateFrameNumbers:function(h,s){return this.animationManager.generateFrameNumbers(h,s)},remove:function(h){var s=this.get(h);return s&&(this.currentAnim===s&&this.stop(),this.anims.delete(h)),s},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}}});c.exports=i},57090:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="add"},25312:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationcomplete"},89580:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationcomplete-"},52860:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationrepeat"},63850:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationrestart"},99085:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationstart"},28087:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationstop"},1794:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="animationupdate"},52562:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pauseall"},57953:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="remove"},68339:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resumeall"},74943:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Animation:t(42099),AnimationFrame:t(41138),AnimationManager:t(60848),AnimationState:t(9674),Events:t(74943)}},2161:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(90330),o=t(50792),r=t(24736),n=new a({initialize:function(){this.entries=new v,this.events=new o},add:function(e,i){return this.entries.set(e,i),this.events.emit(r.ADD,this,e,i),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 i=this.get(e);return i&&(this.entries.delete(e),this.events.emit(r.REMOVE,this,e,i.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});c.exports=n},24047:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2161),v=t(83419),o=t(8443),r=new v({initialize:function(e){this.game=e,this.binary=new a,this.bitmapFont=new a,this.json=new a,this.physics=new a,this.shader=new a,this.audio=new a,this.video=new a,this.text=new a,this.html=new a,this.obj=new a,this.tilemap=new a,this.xml=new a,this.custom={},this.game.events.once(o.DESTROY,this.destroy,this)},addCustom:function(n){return this.custom.hasOwnProperty(n)||(this.custom[n]=new a),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} - */c.exports="add"},59261:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="remove"},24736:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={ADD:t(51464),REMOVE:t(59261)}},83388:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={BaseCache:t(2161),CacheManager:t(24047),Events:t(24736)}},71911:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(39506),r=t(50792),n=t(19715),e=t(87841),i=t(61340),h=t(80333),s=t(26099),l=new a({Extends:r,Mixins:[v.AlphaSingle,v.Visible],initialize:function(u,d,p,g){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=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=u,this._y=d,this._width=p,this._height=g,this._bounds=new e,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new i,this.transparent=!0,this.backgroundColor=h("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new s(p/2,g/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,u){return f===void 0&&(f=.5),u===void 0&&(u=f),this.originX=f,this.originY=u,this},getScroll:function(f,u,d){d===void 0&&(d=new s);var p=this.width*.5,g=this.height*.5;return d.x=f-p,d.y=u-g,this.useBounds&&(d.x=this.clampX(d.x),d.y=this.clampY(d.y)),d},centerOnX:function(f){var u=this.width*.5;return this.midPoint.x=f,this.scrollX=f-u,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(f){var u=this.height*.5;return this.midPoint.y=f,this.scrollY=f-u,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(f,u){return this.centerOnX(f),this.centerOnY(u),this},centerToBounds:function(){if(this.useBounds){var f=this._bounds,u=this.width*.5,d=this.height*.5;this.midPoint.set(f.centerX,f.centerY),this.scrollX=f.centerX-u,this.scrollY=f.centerY-d}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 u=this.matrix.matrix,d=u[0],p=u[1],g=u[2],y=u[3],x=d*y-p*g;if(!x)return f;var T=u[4],C=u[5],M=this.scrollX,w=this.scrollY,L=this.width,F=this.height,O=this.y,N=O+F,G=this.x,V=G+L,j=this.culledObjects,K=f.length;x=1/x,j.length=0;for(var J=0;JG&&HO&&Zg&&(f=g),f},clampY:function(f){var u=this._bounds,d=this.displayHeight,p=u.y+(d-this.height)/2,g=Math.max(p,p+u.height-d);return fg&&(f=g),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=o(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,u,d,p,g){return g===void 0&&(g=!1),this._bounds.setTo(f,u,d,p),this.dirty=!0,this.useBounds=!0,g?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 u=this._bounds;return f.setTo(u.x,u.y,u.width,u.height),f},setName:function(f){return f===void 0&&(f=""),this.name=f,this},setPosition:function(f,u){return u===void 0&&(u=f),this.x=f,this.y=u,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,u){u===void 0&&(u=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=f,this.isSceneCamera=u;var d=f.sys;return this.sceneManager=d.game.scene,this.scaleManager=d.scale,this.cameraManager=d.cameras,this.updateSystem(),this},setScroll:function(f,u){return u===void 0&&(u=f),this.scrollX=f,this.scrollY=u,this},setSize:function(f,u){return u===void 0&&(u=f),this.width=f,this.height=u,this},setViewport:function(f,u,d,p){return this.x=f,this.y=u,this.width=d,this.height=p,this},setZoom:function(f,u){return f===void 0&&(f=1),u===void 0&&(u=f),f===0&&(f=.001),u===0&&(u=.001),this.zoomX=f,this.zoomY=u,this},setMask:function(f,u){return u===void 0&&(u=!0),this.mask=f,this._maskCamera=u?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,u=this.sceneManager;f&&!this._customViewport?u.customViewports++:!f&&this._customViewport&&u.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}}});c.exports=l},38058:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(71911),v=t(67502),o=t(45319),r=t(83419),n=t(31401),e=t(20052),i=t(19715),h=t(28915),s=t(87841),l=t(26099),f=new r({Extends:a,Mixins:[n.PostPipeline],initialize:function(d,p,g,y){a.call(this,d,p,g,y),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 l(1,1),this.followOffset=new l,this.deadzone=null,this._follow=null},setDeadzone:function(u,d){if(u===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=u,this.deadzone.height=d):this.deadzone=new s(0,0,u,d),this._follow){var p=this.width/2,g=this.height/2,y=this._follow.x-this.followOffset.x,x=this._follow.y-this.followOffset.y;this.midPoint.set(y,x),this.scrollX=y-p,this.scrollY=x-g}v(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(u,d,p,g,y,x){return this.fadeEffect.start(!1,u,d,p,g,!0,y,x)},fadeOut:function(u,d,p,g,y,x){return this.fadeEffect.start(!0,u,d,p,g,!0,y,x)},fadeFrom:function(u,d,p,g,y,x,T){return this.fadeEffect.start(!1,u,d,p,g,y,x,T)},fade:function(u,d,p,g,y,x,T){return this.fadeEffect.start(!0,u,d,p,g,y,x,T)},flash:function(u,d,p,g,y,x,T){return this.flashEffect.start(u,d,p,g,y,x,T)},shake:function(u,d,p,g,y){return this.shakeEffect.start(u,d,p,g,y)},pan:function(u,d,p,g,y,x,T){return this.panEffect.start(u,d,p,g,y,x,T)},rotateTo:function(u,d,p,g,y,x,T){return this.rotateToEffect.start(u,d,p,g,y,x,T)},zoomTo:function(u,d,p,g,y,x){return this.zoomEffect.start(u,d,p,g,y,x)},preRender:function(){this.renderList.length=0;var u=this.width,d=this.height,p=u*.5,g=d*.5,y=this.zoom,x=this.matrix,T=u*this.originX,C=d*this.originY,M=this._follow,w=this.deadzone,L=this.scrollX,F=this.scrollY;w&&v(w,this.midPoint.x,this.midPoint.y);var O=!1;if(M&&!this.panEffect.isRunning){var N=this.lerp,G=M.x-this.followOffset.x,V=M.y-this.followOffset.y;w?(Gw.right&&(L=h(L,L+(G-w.right),N.x)),Vw.bottom&&(F=h(F,F+(V-w.bottom),N.y))):(L=h(L,G-T,N.x),F=h(F,V-C,N.y)),O=!0}this.useBounds&&(L=this.clampX(L),F=this.clampY(F)),this.scrollX=L,this.scrollY=F;var j=L+p,K=F+g;this.midPoint.set(j,K);var J=u/y,X=d/y,Y=Math.floor(j-J/2),D=Math.floor(K-X/2);this.worldView.setTo(Y,D,J,X),x.applyITRS(Math.floor(this.x+T),Math.floor(this.y+C),this.rotation,y,y),x.translate(-T,-C),this.shakeEffect.preRender(),O&&this.emit(i.FOLLOW_UPDATE,this,M)},setLerp:function(u,d){return u===void 0&&(u=1),d===void 0&&(d=u),this.lerp.set(u,d),this},setFollowOffset:function(u,d){return u===void 0&&(u=0),d===void 0&&(d=0),this.followOffset.set(u,d),this},startFollow:function(u,d,p,g,y,x){d===void 0&&(d=!1),p===void 0&&(p=1),g===void 0&&(g=p),y===void 0&&(y=0),x===void 0&&(x=y),this._follow=u,this.roundPixels=d,p=o(p,0,1),g=o(g,0,1),this.lerp.set(p,g),this.followOffset.set(y,x);var T=this.width/2,C=this.height/2,M=u.x-y,w=u.y-x;return this.midPoint.set(M,w),this.scrollX=M-T,this.scrollY=w-C,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(u,d){this.visible&&(this.rotateToEffect.update(u,d),this.panEffect.update(u,d),this.zoomEffect.update(u,d),this.shakeEffect.update(u,d),this.flashEffect.update(u,d),this.fadeEffect.update(u,d))},destroy:function(){this.resetFX(),a.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});c.exports=f},32743:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(38058),v=t(83419),o=t(95540),r=t(37277),n=t(37303),e=t(97480),i=t(44594),h=new v({initialize:function(l){this.scene=l,this.systems=l.sys,this.roundPixels=l.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,l.sys.events.once(i.BOOT,this.boot,this),l.sys.events.on(i.START,this.start,this)},boot:function(){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new a(0,0,s.scale.width,s.scale.height).setScene(this.scene),s.game.scale.on(e.RESIZE,this.onResize,this),this.systems.events.once(i.DESTROY,this.destroy,this)},start:function(){if(!this.main){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0]}var l=this.systems.events;l.on(i.UPDATE,this.update,this),l.once(i.SHUTDOWN,this.shutdown,this)},add:function(s,l,f,u,d,p){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),d===void 0&&(d=!1),p===void 0&&(p="");var g=new a(s,l,f,u);return g.setName(p),g.setScene(this.scene),g.setRoundPixels(this.roundPixels),g.id=this.getNextID(),this.cameras.push(g),d&&(this.main=g),g},addExisting:function(s,l){l===void 0&&(l=!1);var f=this.cameras.indexOf(s);return f===-1?(s.id=this.getNextID(),s.setRoundPixels(this.roundPixels),this.cameras.push(s),l&&(this.main=s),s):null},getNextID:function(){for(var s=this.cameras,l=1,f=0;f<32;f++){for(var u=!1,d=0;d0){p.preRender();var g=this.getVisibleChildren(l.getChildren(),p);s.render(f,g,p)}}},getVisibleChildren:function(s,l){return s.filter(function(f){return f.willRender(l)})},resetAll:function(){for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(19715),r=new v({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,i,h,s,l,f,u){if(n===void 0&&(n=!0),e===void 0&&(e=1e3),i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=!1),f===void 0&&(f=null),u===void 0&&(u=this.camera.scene),!l&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=n,this.progress=0,this.red=i,this.green=h,this.blue=s,this.alpha=n?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=f,this._onUpdateScope=u;var d=n?o.FADE_OUT_START:o.FADE_IN_START;return this.camera.emit(d,this.camera,this,e,i,h,s),this.camera},update:function(n,e){this.isRunning&&(this._elapsed+=e,this.progress=a(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 a=t(45319),v=t(83419),o=t(19715),r=new v({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,i,h,s,l,f){return n===void 0&&(n=250),e===void 0&&(e=255),i===void 0&&(i=255),h===void 0&&(h=255),s===void 0&&(s=!1),l===void 0&&(l=null),f===void 0&&(f=this.camera.scene),!s&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=n,this.progress=0,this.red=e,this.green=i,this.blue=h,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=l,this._onUpdateScope=f,this.camera.emit(o.FLASH_START,this.camera,this,n,e,i,h),this.camera)},update:function(n,e){this.isRunning&&(this._elapsed+=e,this.progress=a(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 a=t(45319),v=t(83419),o=t(62640),r=t(19715),n=t(26099),e=new v({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(i,h,s,l,f,u,d){s===void 0&&(s=1e3),l===void 0&&(l=o.Linear),f===void 0&&(f=!1),u===void 0&&(u=null),d===void 0&&(d=this.camera.scene);var p=this.camera;return!f&&this.isRunning||(this.isRunning=!0,this.duration=s,this.progress=0,this.source.set(p.scrollX,p.scrollY),this.destination.set(i,h),p.getScroll(i,h,this.current),typeof l=="string"&&o.hasOwnProperty(l)?this.ease=o[l]:typeof l=="function"&&(this.ease=l),this._elapsed=0,this._onUpdate=u,this._onUpdateScope=d,this.camera.emit(r.PAN_START,this.camera,this,s,i,h)),p},update:function(i,h){if(this.isRunning){this._elapsed+=h;var s=a(this._elapsed/this.duration,0,1);this.progress=s;var l=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 a=t(45319),v=t(83419),o=t(19715),r=t(62640),n=new v({initialize:function(i){this.camera=i,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,i,h,s,l,f,u){h===void 0&&(h=1e3),s===void 0&&(s=r.Linear),l===void 0&&(l=!1),f===void 0&&(f=null),u===void 0&&(u=this.camera.scene),i===void 0&&(i=!1),this.shortestPath=i;var d=e;e<0?(d=-1*e,this.clockwise=!1):this.clockwise=!0;var p=360*Math.PI/180;d=d-Math.floor(d/p)*p;var g=this.camera;if(!l&&this.isRunning)return g;if(this.isRunning=!0,this.duration=h,this.progress=0,this.source=g.rotation,this.destination=d,typeof s=="string"&&r.hasOwnProperty(s)?this.ease=r[s]:typeof s=="function"&&(this.ease=s),this._elapsed=0,this._onUpdate=f,this._onUpdateScope=u,this.shortestPath){var y=0,x=0;this.destination>this.source?y=Math.abs(this.destination-this.source):y=Math.abs(this.destination+p)-this.source,this.source>this.destination?x=Math.abs(this.source-this.destination):x=Math.abs(this.source+p)-this.destination,yx&&(this.clockwise=!1)}return this.camera.emit(o.ROTATE_START,this.camera,this,h,d),g},update:function(e,i){if(this.isRunning){this._elapsed+=i;var h=a(this._elapsed/this.duration,0,1);this.progress=h;var s=this.camera;if(this._elapsed=p?f=Math.abs(d-p):f=Math.abs(d+u)-p;var g=0;this.clockwise?g=s.rotation+f*l:g=s.rotation-f*l,s.rotation=g,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,g)}else s.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(o.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}});c.exports=n},30330:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(19715),r=t(26099),n=new v({initialize:function(i){this.camera=i,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,i,h,s,l){return e===void 0&&(e=100),i===void 0&&(i=.05),h===void 0&&(h=!1),s===void 0&&(s=null),l===void 0&&(l=this.camera.scene),!h&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=e,this.progress=0,typeof i=="number"?this.intensity.set(i):this.intensity.set(i.x,i.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=l,this.camera.emit(o.SHAKE_START,this.camera,this,e,i),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(e,i){if(this.isRunning)if(this._elapsed+=i,this.progress=a(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 a=t(45319),v=t(83419),o=t(62640),r=t(19715),n=new v({initialize:function(i){this.camera=i,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,i,h,s,l,f){i===void 0&&(i=1e3),h===void 0&&(h=o.Linear),s===void 0&&(s=!1),l===void 0&&(l=null),f===void 0&&(f=this.camera.scene);var u=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source=u.zoom,this.destination=e,typeof h=="string"&&o.hasOwnProperty(h)?this.ease=o[h]:typeof h=="function"&&(this.ease=h),this._elapsed=0,this._onUpdate=l,this._onUpdateScope=f,this.camera.emit(r.ZOOM_START,this.camera,this,i,e)),u},update:function(e,i){this.isRunning&&(this._elapsed+=i,this.progress=a(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} - */c.exports={Fade:t(5020),Flash:t(10662),Pan:t(20359),Shake:t(30330),RotateTo:t(34208),Zoom:t(45641)}},16438:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="cameradestroy"},32726:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerafadeincomplete"},87807:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerafadeinstart"},45917:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerafadeoutcomplete"},95666:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerafadeoutstart"},47056:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="cameraflashcomplete"},91261:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="cameraflashstart"},45047:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="followupdate"},81927:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerapancomplete"},74264:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerapanstart"},54419:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="postrender"},79330:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="prerender"},93183:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerarotatecomplete"},80112:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerarotatestart"},62252:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerashakecomplete"},86017:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerashakestart"},539:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerazoomcomplete"},51892:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="camerazoomstart"},19715:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Camera:t(38058),BaseCamera:t(71911),CameraManager:t(32743),Effects:t(20052),Events:t(19715)}},63091:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(35154),o=new a({initialize:function(n){this.camera=v(n,"camera",null),this.left=v(n,"left",null),this.right=v(n,"right",null),this.up=v(n,"up",null),this.down=v(n,"down",null),this.zoomIn=v(n,"zoomIn",null),this.zoomOut=v(n,"zoomOut",null),this.zoomSpeed=v(n,"zoomSpeed",.01),this.minZoom=v(n,"minZoom",.001),this.maxZoom=v(n,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=v(n,"speed",null);typeof e=="number"?(this.speedX=e,this.speedY=e):(this.speedX=v(n,"speed.x",0),this.speedY=v(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}});c.exports=o},58818:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(35154),o=new a({initialize:function(n){this.camera=v(n,"camera",null),this.left=v(n,"left",null),this.right=v(n,"right",null),this.up=v(n,"up",null),this.down=v(n,"down",null),this.zoomIn=v(n,"zoomIn",null),this.zoomOut=v(n,"zoomOut",null),this.zoomSpeed=v(n,"zoomSpeed",.01),this.minZoom=v(n,"minZoom",.001),this.maxZoom=v(n,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=v(n,"acceleration",null);typeof e=="number"?(this.accelX=e,this.accelY=e):(this.accelX=v(n,"acceleration.x",0),this.accelY=v(n,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=v(n,"drag",null);typeof i=="number"?(this.dragX=i,this.dragY=i):(this.dragX=v(n,"drag.x",0),this.dragY=v(n,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var h=v(n,"maxSpeed",null);typeof h=="number"?(this.maxSpeedX=h,this.maxSpeedY=h):(this.maxSpeedX=v(n,"maxSpeed.x",0),this.maxSpeedY=v(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}});c.exports=o},38865:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={FixedKeyControl:t(63091),SmoothedKeyControl:t(58818)}},26638:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Controls:t(38865),Scene2D:t(87969)}},8054:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={VERSION:"3.80.1",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};c.exports=a},69547:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(8054),o=t(42363),r=t(82264),n=t(95540),e=t(35154),i=t(41212),h=t(29747),s=t(75508),l=t(36060),f=t(80333),u=new a({initialize:function(p){p===void 0&&(p={});var g=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],y="#ffffff",x=e(p,"scale",null);this.width=e(x,"width",1024,p),this.height=e(x,"height",768,p),this.zoom=e(x,"zoom",1,p),this.parent=e(x,"parent",void 0,p),this.scaleMode=e(x,x?"mode":"scaleMode",0,p),this.expandParent=e(x,"expandParent",!0,p),this.autoRound=e(x,"autoRound",!1,p),this.autoCenter=e(x,"autoCenter",0,p),this.resizeInterval=e(x,"resizeInterval",500,p),this.fullscreenTarget=e(x,"fullscreenTarget",null,p),this.minWidth=e(x,"min.width",0,p),this.maxWidth=e(x,"max.width",0,p),this.minHeight=e(x,"min.height",0,p),this.maxHeight=e(x,"max.height",0,p),this.snapWidth=e(x,"snap.width",0,p),this.snapHeight=e(x,"snap.height",0,p),this.renderType=e(p,"type",v.AUTO),this.canvas=e(p,"canvas",null),this.context=e(p,"context",null),this.canvasStyle=e(p,"canvasStyle",null),this.customEnvironment=e(p,"customEnvironment",!1),this.sceneConfig=e(p,"scene",null),this.seed=e(p,"seed",[(Date.now()*Math.random()).toString()]),s.RND=new s.RandomDataGenerator(this.seed),this.gameTitle=e(p,"title",""),this.gameURL=e(p,"url","https://phaser.io"),this.gameVersion=e(p,"version",""),this.autoFocus=e(p,"autoFocus",!0),this.stableSort=e(p,"stableSort",-1),this.stableSort===-1&&(this.stableSort=r.browser.es2019?1:0),r.features.stableSort=this.stableSort,this.domCreateContainer=e(p,"dom.createContainer",!1),this.domPointerEvents=e(p,"dom.pointerEvents","none"),this.inputKeyboard=e(p,"input.keyboard",!0),this.inputKeyboardEventTarget=e(p,"input.keyboard.target",window),this.inputKeyboardCapture=e(p,"input.keyboard.capture",[]),this.inputMouse=e(p,"input.mouse",!0),this.inputMouseEventTarget=e(p,"input.mouse.target",null),this.inputMousePreventDefaultDown=e(p,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=e(p,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=e(p,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=e(p,"input.mouse.preventDefaultWheel",!0),this.inputTouch=e(p,"input.touch",r.input.touch),this.inputTouchEventTarget=e(p,"input.touch.target",null),this.inputTouchCapture=e(p,"input.touch.capture",!0),this.inputActivePointers=e(p,"input.activePointers",1),this.inputSmoothFactor=e(p,"input.smoothFactor",0),this.inputWindowEvents=e(p,"input.windowEvents",!0),this.inputGamepad=e(p,"input.gamepad",!1),this.inputGamepadEventTarget=e(p,"input.gamepad.target",window),this.disableContextMenu=e(p,"disableContextMenu",!1),this.audio=e(p,"audio",{}),this.hideBanner=e(p,"banner",null)===!1,this.hidePhaser=e(p,"banner.hidePhaser",!1),this.bannerTextColor=e(p,"banner.text",y),this.bannerBackgroundColor=e(p,"banner.background",g),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=e(p,"fps",null),this.disablePreFX=e(p,"disablePreFX",!1),this.disablePostFX=e(p,"disablePostFX",!1);var T=e(p,"render",null);this.pipeline=e(T,"pipeline",null,p),this.autoMobilePipeline=e(T,"autoMobilePipeline",!0,p),this.defaultPipeline=e(T,"defaultPipeline",l.MULTI_PIPELINE,p),this.antialias=e(T,"antialias",!0,p),this.antialiasGL=e(T,"antialiasGL",!0,p),this.mipmapFilter=e(T,"mipmapFilter","",p),this.desynchronized=e(T,"desynchronized",!1,p),this.roundPixels=e(T,"roundPixels",!0,p),this.pixelArt=e(T,"pixelArt",this.zoom!==1,p),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=e(T,"transparent",!1,p),this.clearBeforeRender=e(T,"clearBeforeRender",!0,p),this.preserveDrawingBuffer=e(T,"preserveDrawingBuffer",!1,p),this.premultipliedAlpha=e(T,"premultipliedAlpha",!0,p),this.failIfMajorPerformanceCaveat=e(T,"failIfMajorPerformanceCaveat",!1,p),this.powerPreference=e(T,"powerPreference","default",p),this.batchSize=e(T,"batchSize",4096,p),this.maxTextures=e(T,"maxTextures",-1,p),this.maxLights=e(T,"maxLights",10,p);var C=e(p,"backgroundColor",0);this.backgroundColor=f(C),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=e(p,"callbacks.preBoot",h),this.postBoot=e(p,"callbacks.postBoot",h),this.physics=e(p,"physics",{}),this.defaultPhysicsSystem=e(this.physics,"default",!1),this.loaderBaseURL=e(p,"loader.baseURL",""),this.loaderPath=e(p,"loader.path",""),this.loaderMaxParallelDownloads=e(p,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=e(p,"loader.crossOrigin",void 0),this.loaderResponseType=e(p,"loader.responseType",""),this.loaderAsync=e(p,"loader.async",!0),this.loaderUser=e(p,"loader.user",""),this.loaderPassword=e(p,"loader.password",""),this.loaderTimeout=e(p,"loader.timeout",0),this.loaderWithCredentials=e(p,"loader.withCredentials",!1),this.loaderImageLoadType=e(p,"loader.imageLoadType","XHR"),this.loaderLocalScheme=e(p,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=e(p,"fx.glow.quality",.1),this.glowFXDistance=e(p,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var M=e(p,"plugins",null),w=o.DefaultScene;M&&(Array.isArray(M)?this.defaultPlugins=M:i(M)&&(this.installGlobalPlugins=n(M,"global",[]),this.installScenePlugins=n(M,"scene",[]),Array.isArray(M.default)?w=M.default:Array.isArray(M.defaultMerge)&&(w=w.concat(M.defaultMerge)))),this.defaultPlugins=w;var L="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=e(p,"images.default",L+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=e(p,"images.missing",L+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=e(p,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=v.WEBGL:window.FORCE_CANVAS&&(this.renderType=v.CANVAS))}});c.exports=u},86054:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20623),v=t(27919),o=t(8054),r=t(89357),n=function(e){var i=e.config;if((i.customEnvironment||i.canvas)&&i.renderType===o.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!i.customEnvironment&&!i.canvas&&i.renderType!==o.HEADLESS)if(i.renderType===o.AUTO&&(i.renderType=r.webGL?o.WEBGL:o.CANVAS),i.renderType===o.WEBGL){if(!r.webGL)throw new Error("Cannot create WebGL context, aborting.")}else if(i.renderType===o.CANVAS){if(!r.canvas)throw new Error("Cannot create Canvas context, aborting.")}else throw new Error("Unknown value for renderer type: "+i.renderType);i.antialias||v.disableSmoothing();var h=e.scale.baseSize,s=h.width,l=h.height;if(i.canvas?(e.canvas=i.canvas,e.canvas.width=s,e.canvas.height=l):e.canvas=v.create(e,s,l,i.renderType),i.canvasStyle&&(e.canvas.style=i.canvasStyle),i.antialias||a.setCrisp(e.canvas),i.renderType!==o.HEADLESS){var f,u;f=t(68627),u=t(74797),i.renderType===o.WEBGL?e.renderer=new u(e):(e.renderer=new f(e),e.context=e.renderer.gameContext)}};c.exports=n},96391:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8054),v=function(o){var r=o.config;if(!r.hideBanner){var n="WebGL";r.renderType===a.CANVAS?n="Canvas":r.renderType===a.HEADLESS&&(n="Headless");var e=r.audio,i=o.device.audio,h;if(i.webAudio&&!e.disableWebAudio?h="Web Audio":e.noAudio||!i.webAudio&&!i.audioData?h="No Audio":h="HTML5 Audio",o.device.browser.ie)window.console&&console.log("Phaser v"+a.VERSION+" / https://phaser.io");else{var s="",l=[s];if(Array.isArray(r.bannerBackgroundColor)){var f;r.bannerBackgroundColor.forEach(function(d){s=s.concat("%c "),l.push("background: "+d),f=d}),l[l.length-1]="color: "+r.bannerTextColor+"; background: "+f}else s=s.concat("%c "),l.push("color: "+r.bannerTextColor+"; background: "+r.bannerBackgroundColor);l.push("background: transparent"),r.gameTitle&&(s=s.concat(r.gameTitle),r.gameVersion&&(s=s.concat(" v"+r.gameVersion)),r.hidePhaser||(s=s.concat(" / ")));var u="";r.hidePhaser||(s=s.concat("Phaser v"+a.VERSION+u+" ("+n+" | "+h+")")),s=s.concat(" %c "+r.gameURL),l[0]=s,console.log.apply(console,l)}}};c.exports=v},50127:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40366),v=t(60848),o=t(24047),r=t(27919),n=t(83419),e=t(69547),i=t(83719),h=t(86054),s=t(45893),l=t(96391),f=t(82264),u=t(57264),d=t(50792),p=t(8443),g=t(7003),y=t(37277),x=t(77332),T=t(76531),C=t(60903),M=t(69442),w=t(17130),L=t(65898),F=t(51085),O=t(14747),N=new n({initialize:function(V){this.config=new e(V),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new d,this.anims=new v(this),this.textures=new w(this),this.cache=new o(this),this.registry=new s(this,new d),this.input=new g(this,this.config),this.scene=new C(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=O.create(this),this.loop=new L(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,u(this.boot.bind(this))},boot:function(){if(!y.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),h(this),i(this),l(this),a(this.canvas,this.config.parent),this.textures.once(M.READY,this.texturesReady,this),this.events.emit(p.BOOT)},texturesReady:function(){this.events.emit(p.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)),F(this);var G=this.events;G.on(p.HIDDEN,this.onHidden,this),G.on(p.VISIBLE,this.onVisible,this),G.on(p.BLUR,this.onBlur,this),G.on(p.FOCUS,this.onFocus,this)},step:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var j=this.events;j.emit(p.PRE_STEP,G,V),j.emit(p.STEP,G,V),this.scene.update(G,V),j.emit(p.POST_STEP,G,V);var K=this.renderer;K.preRender(),j.emit(p.PRE_RENDER,K,G,V),this.scene.render(K),K.postRender(),j.emit(p.POST_RENDER,K,G,V)}},headlessStep:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var j=this.events;j.emit(p.PRE_STEP,G,V),j.emit(p.STEP,G,V),this.scene.update(G,V),j.emit(p.POST_STEP,G,V),this.scene.isProcessing=!1,j.emit(p.PRE_RENDER,null,G,V),j.emit(p.POST_RENDER,null,G,V)}},onHidden:function(){this.loop.pause(),this.events.emit(p.PAUSE)},pause:function(){var G=this.isPaused;this.isPaused=!0,G||this.events.emit(p.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(p.RESUME)},resume:function(){var G=this.isPaused;this.isPaused=!1,G&&this.events.emit(p.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(G,V){V===void 0&&(V=!1),this.pendingDestroy=!0,this.removeCanvas=G,this.noReturn=V},runDestroy:function(){this.scene.destroy(),this.events.emit(p.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}});c.exports=N},65898:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(35154),o=t(29747),r=t(43092),n=new a({initialize:function(i,h){this.game=i,this.raf=new r,this.started=!1,this.running=!1,this.minFps=v(h,"min",5),this.targetFps=v(h,"target",60),this.fpsLimit=v(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=o,this.forceSetTimeOut=v(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=v(h,"deltaHistory",10),this.panicMax=v(h,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=v(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 i=0;i0||!this.inFocus)&&(this._coolDown--,e=Math.min(e,this._target)),e>this._min&&(e=h[i],e=Math.min(e,this._min)),h[i]=e,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var l=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 i=Math.max(0,e-this.lastTime);this.rawDelta=i,this.time+=this.rawDelta,this.smoothStep&&(i=this.smoothDelta(i)),this.delta=i,e>=this.nextFpsUpdate&&this.updateFPS(e),this.framesThisSecond++,this.callback(e,i),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 i=window.performance.now();if(!this.running){e&&(this.startTime+=-this.lastTime+(this.lastTime+i));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=i+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}});c.exports=n},51085:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8443),v=function(o){var r,n=o.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 i=function(h){document.hidden||h.type==="pause"?n.emit(a.HIDDEN):n.emit(a.VISIBLE)};r&&document.addEventListener(r,i,!1),window.onblur=function(){n.emit(a.BLUR)},window.onfocus=function(){n.emit(a.FOCUS)},window.focus&&o.config.autoFocus&&window.focus()};c.exports=v},97217:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="blur"},47548:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="boot"},19814:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="contextlost"},68446:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},41700:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="focus"},25432:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="hidden"},65942:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},59211:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="postrender"},47789:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="poststep"},39066:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="prerender"},460:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="prestep"},16175:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="ready"},42331:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},11966:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="step"},32969:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="systemready"},94830:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="visible"},8443:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Config:t(69547),CreateRenderer:t(86054),DebugHeader:t(96391),Events:t(8443),TimeStep:t(65898),VisibilityHandler:t(51085)}},99584:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(5290),v=t(27919),o=t(35154),r=function(n){var e=o(n,"data",[]),i=o(n,"canvas",null),h=o(n,"palette",a),s=o(n,"pixelWidth",1),l=o(n,"pixelHeight",s),f=o(n,"resizeCanvas",!0),u=o(n,"clearCanvas",!0),d=o(n,"preRender",null),p=o(n,"postRender",null),g=Math.floor(Math.abs(e[0].length*s)),y=Math.floor(Math.abs(e.length*l));i||(i=v.create2D(this,g,y),f=!1,u=!1),f&&(i.width=g,i.height=y);var x=i.getContext("2d",{willReadFrequently:!0});u&&x.clearRect(0,0,g,y),d&&d(i,x);for(var T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={GenerateTexture:t(99584),Palettes:t(57763)}},5290:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={ARNE16:t(5290),C64:t(23816),CGA:t(9866),JMP:t(77552),MSX:t(92259)}},46728:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(36316),o=t(80021),r=t(26099),n=new a({Extends:o,initialize:function(i,h,s,l){o.call(this,"CubicBezierCurve"),Array.isArray(i)&&(l=new r(i[6],i[7]),s=new r(i[4],i[5]),h=new r(i[2],i[3]),i=new r(i[0],i[1])),this.p0=i,this.p1=h,this.p2=s,this.p3=l},getStartPoint:function(e){return e===void 0&&(e=new r),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,i){i===void 0&&(i=new r);var h=this.p0,s=this.p1,l=this.p2,f=this.p3;return i.set(v(e,h.x,s.x,l.x,f.x),v(e,h.y,s.y,l.y,f.y))},draw:function(e,i){i===void 0&&(i=32);var h=this.getPoints(i);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var s=1;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(19217),o=t(87841),r=t(26099),n=new a({initialize:function(i){this.type=i,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,i){return i===void 0&&(i=32),e.strokePoints(this.getPoints(i))},getBounds:function(e,i){e||(e=new o),i===void 0&&(i=16);var h=this.getLength();i>h&&(i=h/2);var s=Math.max(1,Math.round(h/i));return v(this.getSpacedPoints(s),e)},getDistancePoints:function(e){var i=this.getLength(),h=Math.max(1,i/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 i=[],h,s=this.getPoint(0,this._tmpVec2A),l=0;i.push(0);for(var f=1;f<=e;f++)h=this.getPoint(f/e,this._tmpVec2B),l+=h.distance(s),i.push(l),s.copy(h);return this.cacheArcLengths=i,i},getPointAt:function(e,i){var h=this.getUtoTmapping(e);return this.getPoint(h,i)},getPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++)h.push(this.getPoint(s/e));return h},getRandomPoint:function(e){return e===void 0&&(e=new r),this.getPoint(Math.random(),e)},getSpacedPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++){var l=this.getUtoTmapping(s/e,null,e);h.push(this.getPoint(l))}return h},getStartPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(0,e)},getTangent:function(e,i){i===void 0&&(i=new r);var h=1e-4,s=e-h,l=e+h;return s<0&&(s=0),l>1&&(l=1),this.getPoint(s,this._tmpVec2A),this.getPoint(l,i),i.subtract(this._tmpVec2A).normalize()},getTangentAt:function(e,i){var h=this.getUtoTmapping(e);return this.getTangent(h,i)},getTFromDistance:function(e,i){return e<=0?0:this.getUtoTmapping(0,e,i)},getUtoTmapping:function(e,i,h){var s=this.getLengths(h),l=0,f=s.length,u;i?u=Math.min(i,s[f-1]):u=e*s[f-1];for(var d=0,p=f-1,g;d<=p;)if(l=Math.floor(d+(p-d)/2),g=s[l]-u,g<0)d=l+1;else if(g>0)p=l-1;else{p=l;break}if(l=p,s[l]===u)return l/(f-1);var y=s[l],x=s[l+1],T=x-y,C=(u-y)/T;return(l+C)/(f-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});c.exports=n},73825:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(80021),o=t(39506),r=t(35154),n=t(43396),e=t(26099),i=new a({Extends:v,initialize:function(s,l,f,u,d,p,g,y){if(typeof s=="object"){var x=s;s=r(x,"x",0),l=r(x,"y",0),f=r(x,"xRadius",0),u=r(x,"yRadius",f),d=r(x,"startAngle",0),p=r(x,"endAngle",360),g=r(x,"clockwise",!1),y=r(x,"rotation",0)}else u===void 0&&(u=f),d===void 0&&(d=0),p===void 0&&(p=360),g===void 0&&(g=!1),y===void 0&&(y=0);v.call(this,"EllipseCurve"),this.p0=new e(s,l),this._xRadius=f,this._yRadius=u,this._startAngle=o(d),this._endAngle=o(p),this._clockwise=g,this._rotation=o(y)},getStartPoint:function(h){return h===void 0&&(h=new e),this.getPoint(0,h)},getResolution:function(h){return h*2},getPoint:function(h,s){s===void 0&&(s=new e);for(var l=Math.PI*2,f=this._endAngle-this._startAngle,u=Math.abs(f)l;)f-=l;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(80021),o=t(19217),r=t(87841),n=t(26099),e=new a({Extends:v,initialize:function(h,s){v.call(this,"LineCurve"),Array.isArray(h)&&(s=new n(h[2],h[3]),h=new n(h[0],h[1])),this.p0=h,this.p1=s,this.arcLengthDivisions=1},getBounds:function(i){return i===void 0&&(i=new r),o([this.p0,this.p1],i)},getStartPoint:function(i){return i===void 0&&(i=new n),i.copy(this.p0)},getResolution:function(i){return i===void 0&&(i=1),i},getPoint:function(i,h){return h===void 0&&(h=new n),i===1?h.copy(this.p1):(h.copy(this.p1).subtract(this.p0).scale(i).add(this.p0),h)},getPointAt:function(i,h){return this.getPoint(i,h)},getTangent:function(i,h){return h===void 0&&(h=new n),h.copy(this.p1).subtract(this.p0).normalize(),h},getUtoTmapping:function(i,h,s){var l;if(h){var f=this.getLengths(s),u=f[f.length-1],d=Math.min(h,u);l=d/u}else l=i;return l},draw:function(i){return i.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),i},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});e.fromJSON=function(i){var h=i.points,s=new n(h[0],h[1]),l=new n(h[2],h[3]);return new e(s,l)},c.exports=e},14744:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(80021),o=t(32112),r=t(26099),n=new a({Extends:v,initialize:function(i,h,s){v.call(this,"QuadraticBezierCurve"),Array.isArray(i)&&(s=new r(i[4],i[5]),h=new r(i[2],i[3]),i=new r(i[0],i[1])),this.p0=i,this.p1=h,this.p2=s},getStartPoint:function(e){return e===void 0&&(e=new r),e.copy(this.p0)},getResolution:function(e){return e},getPoint:function(e,i){i===void 0&&(i=new r);var h=this.p0,s=this.p1,l=this.p2;return i.set(o(e,h.x,s.x,l.x),o(e,h.y,s.y,l.y))},draw:function(e,i){i===void 0&&(i=32);var h=this.getPoints(i);e.beginPath(),e.moveTo(this.p0.x,this.p0.y);for(var s=1;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87842),v=t(83419),o=t(80021),r=t(26099),n=new v({Extends:o,initialize:function(i){i===void 0&&(i=[]),o.call(this,"SplineCurve"),this.points=[],this.addPoints(i)},addPoints:function(e){for(var i=0;ih.length-2?h.length-1:l+1],g=h[l>h.length-3?h.length-1:l+2];return i.set(a(f,u.x,d.x,p.x,g.x),a(f,u.y,d.y,p.y,g.y))},toJSON:function(){for(var e=[],i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(26099),o=new a({initialize:function(n,e){this.active=!1,this.p0=new v(n,e)},getPoint:function(r,n){return n===void 0&&(n=new v),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]}}});c.exports=o},46669:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(46728),o=t(73825),r=t(39429),n=t(33951),e=t(68618),i=t(14744),h=t(87841),s=t(42534),l=t(26099),f=t(36383),u=new a({initialize:function(p,g){p===void 0&&(p=0),g===void 0&&(g=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new l,this._tmpVec2A=new l,this._tmpVec2B=new l,typeof p=="object"?this.fromJSON(p):this.startPoint.set(p,g)},add:function(d){return this.curves.push(d),this},circleTo:function(d,p,g){return p===void 0&&(p=!1),this.ellipseTo(d,d,0,360,p,g)},closePath:function(){var d=this.curves[0].getPoint(0),p=this.curves[this.curves.length-1].getPoint(1);return d.equals(p)||this.curves.push(new n(p,d)),this},cubicBezierTo:function(d,p,g,y,x,T){var C=this.getEndPoint(),M,w,L;return d instanceof l?(M=d,w=p,L=g):(M=new l(g,y),w=new l(x,T),L=new l(d,p)),this.add(new v(C,M,w,L))},quadraticBezierTo:function(d,p,g,y){var x=this.getEndPoint(),T,C;return d instanceof l?(T=d,C=p):(T=new l(g,y),C=new l(d,p)),this.add(new i(x,T,C))},draw:function(d,p){for(var g=0;g=p)return this.curves[y];y++}return null},getEndPoint:function(d){return d===void 0&&(d=new l),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,d):d.copy(this.startPoint),d},getLength:function(){var d=this.getCurveLengths();return d[d.length-1]},getPoint:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),y=this.getCurveLengths(),x=0;x=g){var T=y[x]-g,C=this.curves[x],M=C.getLength(),w=M===0?0:1-T/M;return C.getPointAt(w,p)}x++}return null},getPoints:function(d,p){!d&&!p&&(d=this.defaultDivisions);for(var g=[],y,x=0;x1&&!g[g.length-1].equals(g[0])&&g.push(g[0]),g},getRandomPoint:function(d){return d===void 0&&(d=new l),this.getPoint(Math.random(),d)},getSpacedPoints:function(d){d===void 0&&(d=40);for(var p=[],g=0;g<=d;g++)p.push(this.getPoint(g/d));return this.autoClose&&p.push(p[0]),p},getStartPoint:function(d){return d===void 0&&(d=new l),d.copy(this.startPoint)},getTangent:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),y=this.getCurveLengths(),x=0;x=g){var T=y[x]-g,C=this.curves[x],M=C.getLength(),w=M===0?0:1-T/M;return C.getTangentAt(w,p)}x++}return null},lineTo:function(d,p){d instanceof l?this._tmpVec2B.copy(d):typeof d=="object"?this._tmpVec2B.setFromObject(d):this._tmpVec2B.set(d,p);var g=this.getEndPoint(this._tmpVec2A);return this.add(new n([g.x,g.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(d){return d.unshift(this.getEndPoint()),this.add(new s(d))},moveTo:function(d,p){return d instanceof l?this.add(new e(d.x,d.y)):this.add(new e(d,p))},toJSON:function(){for(var d=[],p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(24882),o=new a({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(v.DESTROY,this.destroy,this)},get:function(r){var n=this.list;if(Array.isArray(r)){for(var e=[],i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(45893),o=t(37277),r=t(44594),n=new a({Extends:v,initialize:function(i){v.call(this,i,i.sys.events),this.scene=i,this.systems=i.sys,i.sys.events.once(r.BOOT,this.boot,this),i.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(){v.prototype.destroy.call(this),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null}});o.register("DataManagerPlugin",n,"data"),c.exports=n},10700:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="changedata"},93608:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="changedata-"},60883:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},69780:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="removedata"},22166:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="setdata"},24882:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={CHANGE_DATA:t(10700),CHANGE_DATA_KEY:t(93608),DESTROY:t(60883),REMOVE_DATA:t(69780),SET_DATA:t(22166)}},44965:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={DataManager:t(45893),DataManagerPlugin:t(63646),Events:t(24882)}},7098:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(84148),v={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};function o(){if(typeof importScripts=="function")return v;v.audioData=!!window.Audio,v.webAudio=!!(window.AudioContext||window.webkitAudioContext);var r=document.createElement("audio"),n=!!r.canPlayType;try{if(n){var e=function(s,l){var f=r.canPlayType("audio/"+s).replace(/^no$/,"");return l?!!(f||r.canPlayType("audio/"+l).replace(/^no$/,"")):!!f};if(v.ogg=e('ogg; codecs="vorbis"'),v.opus=e('ogg; codecs="opus"',"opus"),v.mp3=e("mpeg"),v.wav=e("wav"),v.m4a=e("x-m4a"),v.aac=e("aac"),v.flac=e("flac","x-flac"),v.webm=e('webm; codecs="vorbis"'),r.canPlayType('audio/mp4; codecs="ec-3"')!==""){if(a.edge)v.dolby=!0;else if(a.safari&&a.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),h=parseInt(RegExp.$2,10);(i===10&&h>=11||i>10)&&(v.dolby=!0)}}}}catch{}return v}c.exports=o()},84148:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25892),v={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 o(){var r=navigator.userAgent;return/Edg\/\d+/.test(r)?(v.edge=!0,v.es2019=!0):/OPR/.test(r)?(v.opera=!0,v.es2019=!0):/Chrome\/(\d+)/.test(r)&&!a.windowsPhone?(v.chrome=!0,v.chromeVersion=parseInt(RegExp.$1,10),v.es2019=v.chromeVersion>69):/Firefox\D+(\d+)/.test(r)?(v.firefox=!0,v.firefoxVersion=parseInt(RegExp.$1,10),v.es2019=v.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(r)&&a.iOS?(v.mobileSafari=!0,v.es2019=!0):/MSIE (\d+\.\d+);/.test(r)?(v.ie=!0,v.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(r)&&!a.windowsPhone?(v.safari=!0,v.safariVersion=parseInt(RegExp.$1,10),v.es2019=v.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(r)&&(v.ie=!0,v.trident=!0,v.tridentVersion=parseInt(RegExp.$1,10),v.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(r)&&(v.silk=!0),v}c.exports=o()},89289:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v={supportInverseAlpha:!1,supportNewBlendModes:!1};function o(){var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",i="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",h=new Image;return h.onload=function(){var s=new Image;s.onload=function(){var l=a.create2D(s,6),f=l.getContext("2d",{willReadFrequently:!0});if(f.globalCompositeOperation="multiply",f.drawImage(h,0,0),f.drawImage(s,2,0),!f.getImageData(2,0,1,1))return!1;var u=f.getImageData(2,0,1,1).data;a.remove(s),v.supportNewBlendModes=u[0]===255&&u[1]===0&&u[2]===0},s.src=e+"/wCKxvRF"+i},h.src=e+"AP804Oa6"+i,!1}function r(){var e=a.create2D(this,2),i=e.getContext("2d",{willReadFrequently:!0});i.fillStyle="rgba(10, 20, 30, 0.5)",i.fillRect(0,0,1,1);var h=i.getImageData(0,0,1,1);if(h===null)return!1;i.putImageData(h,1,0);var s=i.getImageData(1,0,1,1),l=s.data[0]===h.data[0]&&s.data[1]===h.data[1]&&s.data[2]===h.data[2]&&s.data[3]===h.data[3];return a.remove(this),l}function n(){return typeof importScripts!="function"&&document!==void 0&&(v.supportNewBlendModes=o(),v.supportInverseAlpha=r()),v}c.exports=n()},89357:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25892),v=t(84148),o=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 i=new ArrayBuffer(4),h=new Uint8Array(i),s=new Uint32Array(i);return h[0]=161,h[1]=178,h[2]=195,h[3]=212,s[0]===3569595041?!0:s[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 i=!1,h=function(){if(window.WebGLRenderingContext)try{var s=o.createWebGL(this),l=s.getContext("webgl")||s.getContext("experimental-webgl"),f=o.create2D(this),u=f.getContext("2d",{willReadFrequently:!0}),d=u.createImageData(1,1);return i=d.data instanceof Uint8ClampedArray,o.remove(s),o.remove(f),!!l}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,v.firefox&&v.firefoxVersion<21&&(r.getUserMedia=!1),!a.iOS&&(v.ie||v.firefox||v.chrome)&&(r.canvasBitBltShift=!0),(v.safari||v.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&&i,r}c.exports=e()},91639:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={available:!1,cancel:"",keyboard:!1,request:""};function t(){if(typeof importScripts=="function")return m;var a,v="Fullscreen",o="FullScreen",r=["request"+v,"request"+o,"webkitRequest"+v,"webkitRequest"+o,"msRequest"+v,"msRequest"+o,"mozRequest"+o,"mozRequest"+v];for(a=0;a{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(84148),v={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};function o(){return typeof importScripts=="function"||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(v.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(v.mspointer=!0),navigator.getGamepads&&(v.gamepads=!0),"onwheel"in window||a.ie&&"WheelEvent"in window?v.wheelEvent="wheel":"onmousewheel"in window?v.wheelEvent="mousewheel":a.firefox&&"MouseScrollEvent"in window&&(v.wheelEvent="DOMMouseScroll")),v}c.exports=o()},25892:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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 m;var a=navigator.userAgent;/Windows/.test(a)?m.windows=!0:/Mac OS/.test(a)&&!/like Mac OS/.test(a)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(m.iOS=!0,m.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),m.iOSVersion=parseInt(RegExp.$1,10)):m.macOS=!0:/Android/.test(a)?m.android=!0:/Linux/.test(a)?m.linux=!0:/iP[ao]d|iPhone/i.test(a)?(m.iOS=!0,navigator.appVersion.match(/OS (\d+)/),m.iOSVersion=parseInt(RegExp.$1,10),m.iPhone=a.toLowerCase().indexOf("iphone")!==-1,m.iPad=a.toLowerCase().indexOf("ipad")!==-1):/Kindle/.test(a)||/\bKF[A-Z][A-Z]+/.test(a)||/Silk.*Mobile Safari/.test(a)?m.kindle=!0:/CrOS/.test(a)&&(m.chromeOS=!0),(/Windows Phone/i.test(a)||/IEMobile/i.test(a))&&(m.android=!1,m.iOS=!1,m.macOS=!1,m.windows=!0,m.windowsPhone=!0);var v=/Silk/.test(a);return(m.windows||m.macOS||m.linux&&!v||m.chromeOS)&&(m.desktop=!0),(m.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(m.desktop=!1),navigator.standalone&&(m.webApp=!0),typeof importScripts!="function"&&(window.cordova!==void 0&&(m.cordova=!0),window.ejecta!==void 0&&(m.ejecta=!0)),typeof process<"u"&&process.versions&&process.versions.node&&(m.node=!0),m.node&&typeof process.versions=="object"&&(m.nodeWebkit=!!process.versions["node-webkit"],m.electron=!!process.versions.electron),/Crosswalk/.test(a)&&(m.crosswalk=!0),m.pixelRatio=window.devicePixelRatio||1,m}c.exports=t()},43267:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};function o(){if(typeof importScripts=="function")return v;var r=document.createElement("video"),n=!!r.canPlayType,e=/^no$/;try{n&&(r.canPlayType('video/ogg; codecs="theora"').replace(e,"")&&(v.ogg=!0),r.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(e,"")&&(v.h264=!0,v.mp4=!0),r.canPlayType("video/x-m4v").replace(e,"")&&(v.m4v=!0),r.canPlayType('video/webm; codecs="vp8, vorbis"').replace(e,"")&&(v.webm=!0),r.canPlayType('video/webm; codecs="vp9"').replace(e,"")&&(v.vp9=!0),r.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(e,"")&&(v.hls=!0))}catch{}return r.parentNode&&r.parentNode.removeChild(r),v.getVideoURL=function(i){Array.isArray(i)||(i=[i]);for(var h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new Float32Array(20),o=new a({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,i=(e-1)*-.5;return this.multiply([e,i,i,0,0,i,e,i,0,0,i,i,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),i=Math.sin(r),h=.213,s=.715,l=.072;return this.multiply([h+e*(1-h)+i*-h,s+e*-s+i*-s,l+e*-l+i*(1-l),0,0,h+e*-h+i*.143,s+e*(1-s)+i*.14,l+e*-l+i*-.283,0,0,h+e*-h+i*-(1-h),s+e*-s+i*s,l+e*(1-l)+i*l,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(o.BLACK_WHITE,r)},contrast:function(r,n){r===void 0&&(r=0),n===void 0&&(n=!1);var e=r+1,i=-.5*(e-1);return this.multiply([e,0,0,0,i,0,e,0,0,i,0,0,e,0,i,0,0,0,1,0],n)},negative:function(r){return r===void 0&&(r=!1),this.multiply(o.NEGATIVE,r)},desaturateLuminance:function(r){return r===void 0&&(r=!1),this.multiply(o.DESATURATE_LUMINANCE,r)},sepia:function(r){return r===void 0&&(r=!1),this.multiply(o.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(o.LSD,r)},brown:function(r){return r===void 0&&(r=!1),this.multiply(o.BROWN,r)},vintagePinhole:function(r){return r===void 0&&(r=!1),this.multiply(o.VINTAGE,r)},kodachrome:function(r){return r===void 0&&(r=!1),this.multiply(o.KODACHROME,r)},technicolor:function(r){return r===void 0&&(r=!1),this.multiply(o.TECHNICOLOR,r)},polaroid:function(r){return r===void 0&&(r=!1),this.multiply(o.POLAROID,r)},shiftToBGR:function(r){return r===void 0&&(r=!1),this.multiply(o.SHIFT_BGR,r)},multiply:function(r,n){n===void 0&&(n=!1),n||this.reset();var e=this._matrix,i=v;return i.set(e),e.set([i[0]*r[0]+i[1]*r[5]+i[2]*r[10]+i[3]*r[15],i[0]*r[1]+i[1]*r[6]+i[2]*r[11]+i[3]*r[16],i[0]*r[2]+i[1]*r[7]+i[2]*r[12]+i[3]*r[17],i[0]*r[3]+i[1]*r[8]+i[2]*r[13]+i[3]*r[18],i[0]*r[4]+i[1]*r[9]+i[2]*r[14]+i[3]*r[19]+i[4],i[5]*r[0]+i[6]*r[5]+i[7]*r[10]+i[8]*r[15],i[5]*r[1]+i[6]*r[6]+i[7]*r[11]+i[8]*r[16],i[5]*r[2]+i[6]*r[7]+i[7]*r[12]+i[8]*r[17],i[5]*r[3]+i[6]*r[8]+i[7]*r[13]+i[8]*r[18],i[5]*r[4]+i[6]*r[9]+i[7]*r[14]+i[8]*r[19]+i[9],i[10]*r[0]+i[11]*r[5]+i[12]*r[10]+i[13]*r[15],i[10]*r[1]+i[11]*r[6]+i[12]*r[11]+i[13]*r[16],i[10]*r[2]+i[11]*r[7]+i[12]*r[12]+i[13]*r[17],i[10]*r[3]+i[11]*r[8]+i[12]*r[13]+i[13]*r[18],i[10]*r[4]+i[11]*r[9]+i[12]*r[14]+i[13]*r[19]+i[14],i[15]*r[0]+i[16]*r[5]+i[17]*r[10]+i[18]*r[15],i[15]*r[1]+i[16]*r[6]+i[17]*r[11]+i[18]*r[16],i[15]*r[2]+i[16]*r[7]+i[17]*r[12]+i[18]*r[17],i[15]*r[3]+i[16]*r[8]+i[17]*r[13]+i[18]*r[18],i[15]*r[4]+i[16]*r[9]+i[17]*r[14]+i[18]*r[19]+i[19]]),this._dirty=!0,this}});o.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],o.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],o.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],o.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],o.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],o.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],o.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],o.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],o.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],o.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],o.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],c.exports=o},51767:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(29747),o=new a({initialize:function(n,e,i){this._rgb=[0,0,0],this.onChangeCallback=v,this.dirty=!1,this.set(n,e,i)},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 i=this._rgb;return i[0]===r&&i[1]===n&&i[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}});c.exports=o},60461:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},54312:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(35893),o=t(86327),r=t(88417),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)+h),o(e,a(i)+s),e};c.exports=n},46768:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(26541),o=t(86327),r=t(385),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)-h),o(e,a(i)+s),e};c.exports=n},35827:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(54380),o=t(86327),r=t(40136),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)+h),o(e,a(i)+s),e};c.exports=n},46871:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66786),v=t(35893),o=t(7702),r=function(n,e,i,h){return i===void 0&&(i=0),h===void 0&&(h=0),a(n,v(e)+i,o(e)+h),n};c.exports=r},5198:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7702),v=t(26541),o=t(20786),r=t(385),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)-h),o(e,a(i)+s),e};c.exports=n},11879:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(60461),v=[];v[a.BOTTOM_CENTER]=t(54312),v[a.BOTTOM_LEFT]=t(46768),v[a.BOTTOM_RIGHT]=t(35827),v[a.CENTER]=t(46871),v[a.LEFT_CENTER]=t(5198),v[a.RIGHT_CENTER]=t(80503),v[a.TOP_CENTER]=t(89698),v[a.TOP_LEFT]=t(922),v[a.TOP_RIGHT]=t(21373),v[a.LEFT_BOTTOM]=v[a.BOTTOM_LEFT],v[a.LEFT_TOP]=v[a.TOP_LEFT],v[a.RIGHT_BOTTOM]=v[a.BOTTOM_RIGHT],v[a.RIGHT_TOP]=v[a.TOP_RIGHT];var o=function(r,n,e,i,h){return v[e](r,n,i,h)};c.exports=o},80503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7702),v=t(54380),o=t(20786),r=t(40136),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)+h),o(e,a(i)+s),e};c.exports=n},89698:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35893),v=t(17717),o=t(88417),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,a(i)+h),r(e,v(i)-s),e};c.exports=n},922:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26541),v=t(17717),o=t(385),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,a(i)-h),r(e,v(i)-s),e};c.exports=n},21373:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54380),v=t(17717),o=t(40136),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,a(i)+h),r(e,v(i)-s),e};c.exports=n},91660:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(60461),v=t(79291),o={In:t(91660),To:t(16694)};o=v(!1,o,a),c.exports=o},21578:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(35893),o=t(88417),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,v(i)+h),r(e,a(i)+s),e};c.exports=n},10210:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(26541),o=t(385),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,v(i)-h),r(e,a(i)+s),e};c.exports=n},82341:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(54380),o=t(40136),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,v(i)+h),r(e,a(i)+s),e};c.exports=n},87958:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(26541),o=t(86327),r=t(40136),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)-h),o(e,a(i)+s),e};c.exports=n},40080:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7702),v=t(26541),o=t(20786),r=t(40136),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)-h),o(e,a(i)+s),e};c.exports=n},88466:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26541),v=t(17717),o=t(40136),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,a(i)-h),r(e,v(i)-s),e};c.exports=n},38829:(c,m,t)=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(60461),v=[];v[a.BOTTOM_CENTER]=t(21578),v[a.BOTTOM_LEFT]=t(10210),v[a.BOTTOM_RIGHT]=t(82341),v[a.LEFT_BOTTOM]=t(87958),v[a.LEFT_CENTER]=t(40080),v[a.LEFT_TOP]=t(88466),v[a.RIGHT_BOTTOM]=t(19211),v[a.RIGHT_CENTER]=t(34609),v[a.RIGHT_TOP]=t(48741),v[a.TOP_CENTER]=t(49440),v[a.TOP_LEFT]=t(81288),v[a.TOP_RIGHT]=t(61323);var o=function(r,n,e,i,h){return v[e](r,n,i,h)};c.exports=o},19211:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(54380),o=t(86327),r=t(385),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)+h),o(e,a(i)+s),e};c.exports=n},34609:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7702),v=t(54380),o=t(20786),r=t(385),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,v(i)+h),o(e,a(i)+s),e};c.exports=n},48741:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54380),v=t(17717),o=t(385),r=t(66737),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),o(e,a(i)+h),r(e,v(i)-s),e};c.exports=n},49440:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35893),v=t(17717),o=t(86327),r=t(88417),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,a(i)+h),o(e,v(i)-s),e};c.exports=n},81288:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26541),v=t(17717),o=t(86327),r=t(385),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,a(i)-h),o(e,v(i)-s),e};c.exports=n},61323:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54380),v=t(17717),o=t(86327),r=t(40136),n=function(e,i,h,s){return h===void 0&&(h=0),s===void 0&&(s=0),r(e,a(i)+h),o(e,v(i)-s),e};c.exports=n},16694:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(88417),v=t(20786),o=function(r,n,e){return a(r,n),v(r,e)};c.exports=o},62235:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.y+t.height-t.height*t.originY};c.exports=m},72873:(c,m,t)=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62235),v=t(26541),o=t(54380),r=t(17717),n=t(87841),e=function(i,h){h===void 0&&(h=new n);var s=v(i),l=r(i);return h.x=s,h.y=l,h.width=o(i)-s,h.height=a(i)-l,h};c.exports=e},35893:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x-t.width*t.originX+t.width*.5};c.exports=m},7702:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.y-t.height*t.originY+t.height*.5};c.exports=m},26541:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x-t.width*t.originX};c.exports=m},87431:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.width*t.originX};c.exports=m},46928:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.height*t.originY};c.exports=m},54380:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x+t.width-t.width*t.originX};c.exports=m},17717:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.y-t.height*t.originY};c.exports=m},86327:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.y=a-t.height+t.height*t.originY,t};c.exports=m},88417:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.width*t.originX;return t.x=a+v-t.width*.5,t};c.exports=m},20786:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.height*t.originY;return t.y=a+v-t.height*.5,t};c.exports=m},385:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x=a+t.width*t.originX,t};c.exports=m},40136:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x=a-t.width+t.width*t.originX,t};c.exports=m},66737:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.y=a+t.height*t.originY,t};c.exports=m},58724:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setCrisp:function(t){var a=["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"];return a.forEach(function(v){t.style["image-rendering"]=v}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}};c.exports=m},27919:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8054),v=t(68703),o=[],r=!1,n=function(){var e=function(g,y,x,T,C){y===void 0&&(y=1),x===void 0&&(x=1),T===void 0&&(T=a.CANVAS),C===void 0&&(C=!1);var M,w=s(T);return w===null?(w={parent:g,canvas:document.createElement("canvas"),type:T},T===a.CANVAS&&o.push(w),M=w.canvas):(w.parent=g,M=w.canvas),C&&(w.parent=M),M.width=y,M.height=x,r&&T===a.CANVAS&&v.disable(M.getContext("2d",{willReadFrequently:!1})),M},i=function(g,y,x){return e(g,y,x,a.CANVAS)},h=function(g,y,x){return e(g,y,x,a.WEBGL)},s=function(g){if(g===void 0&&(g=a.CANVAS),g===a.WEBGL)return null;for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m="",t=function(){var a=function(n){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a="none"),t.style.msTouchAction=a,t.style["ms-touch-action"]=a,t.style["touch-action"]=a,t};c.exports=m},91610:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a="none");var v=["-webkit-","-khtml-","-moz-","-ms-",""];return v.forEach(function(o){t.style[o+"user-select"]=a}),t.style["-webkit-touch-callout"]=a,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t};c.exports=m},26253:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={CanvasInterpolation:t(20623),CanvasPool:t(27919),Smoothing:t(68703),TouchAction:t(65208),UserSelect:t(91610)}},40987:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(37589),o=t(1e3),r=t(7537),n=t(87837),e=new a({initialize:function(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=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,s,l,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(i,h,s,l,f){return l===void 0&&(l=255),f===void 0&&(f=!0),this._locked=!0,this.red=i,this.green=h,this.blue=s,this.alpha=l,this._locked=!1,this.update(f)},setGLTo:function(i,h,s,l){return l===void 0&&(l=1),this._locked=!0,this.redGL=i,this.greenGL=h,this.blueGL=s,this.alphaGL=l,this._locked=!1,this.update(!0)},setFromRGB:function(i){return this._locked=!0,this.red=i.r,this.green=i.g,this.blue=i.b,i.hasOwnProperty("a")&&(this.alpha=i.a),this._locked=!1,this.update(!0)},setFromHSV:function(i,h,s){return r(i,h,s,this)},update:function(i){if(i===void 0&&(i=!1),this._locked)return this;var h=this.r,s=this.g,l=this.b,f=this.a;return this._color=v(h,s,l),this._color32=o(h,s,l,f),this._rgba="rgba("+h+","+s+","+l+","+f/255+")",i&&n(h,s,l,this),this},updateHSV:function(){var i=this.r,h=this.g,s=this.b;return n(i,h,s,this),this},clone:function(){return new e(this.r,this.g,this.b,this.a)},gray:function(i){return this.setTo(i,i,i)},random:function(i,h){i===void 0&&(i=0),h===void 0&&(h=255);var s=Math.floor(i+Math.random()*(h-i)),l=Math.floor(i+Math.random()*(h-i)),f=Math.floor(i+Math.random()*(h-i));return this.setTo(s,l,f)},randomGray:function(i,h){i===void 0&&(i=0),h===void 0&&(h=255);var s=Math.floor(i+Math.random()*(h-i));return this.setTo(s,s,s)},saturate:function(i){return this.s+=i/100,this},desaturate:function(i){return this.s-=i/100,this},lighten:function(i){return this.v+=i/100,this},darken:function(i){return this.v-=i/100,this},brighten:function(i){var h=this.r,s=this.g,l=this.b;return h=Math.max(0,Math.min(255,h-Math.round(255*-(i/100)))),s=Math.max(0,Math.min(255,s-Math.round(255*-(i/100)))),l=Math.max(0,Math.min(255,l-Math.round(255*-(i/100)))),this.setTo(h,s,l)},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(i){this.gl[0]=Math.min(Math.abs(i),1),this.r=Math.floor(this.gl[0]*255),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(i){this.gl[1]=Math.min(Math.abs(i),1),this.g=Math.floor(this.gl[1]*255),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(i){this.gl[2]=Math.min(Math.abs(i),1),this.b=Math.floor(this.gl[2]*255),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(i){this.gl[3]=Math.min(Math.abs(i),1),this.a=Math.floor(this.gl[3]*255),this.update()}},red:{get:function(){return this.r},set:function(i){i=Math.floor(Math.abs(i)),this.r=Math.min(i,255),this.gl[0]=i/255,this.update(!0)}},green:{get:function(){return this.g},set:function(i){i=Math.floor(Math.abs(i)),this.g=Math.min(i,255),this.gl[1]=i/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(i){i=Math.floor(Math.abs(i)),this.b=Math.min(i,255),this.gl[2]=i/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(i){i=Math.floor(Math.abs(i)),this.a=Math.min(i,255),this.gl[3]=i/255,this.update()}},h:{get:function(){return this._h},set:function(i){this._h=i,r(i,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(i){this._s=i,r(this._h,i,this._v,this)}},v:{get:function(){return this._v},set:function(i){this._v=i,r(this._h,this._s,i,this)}}});c.exports=e},92728:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37589),v=function(o){o===void 0&&(o=1024);var r=[],n=255,e,i=255,h=0,s=0;for(e=0;e<=n;e++)r.push({r:i,g:e,b:s,color:a(i,e,s)});for(h=255,e=n;e>=0;e--)r.push({r:e,g:h,b:s,color:a(e,h,s)});for(i=0,e=0;e<=n;e++,h--)r.push({r:i,g:h,b:e,color:a(i,h,e)});for(h=0,s=255,e=0;e<=n;e++,s--,i++)r.push({r:i,g:h,b:s,color:a(i,h,s)});if(o===1024)return r;var l=[],f=0,u=1024/o;for(e=0;e{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a={r:t>>16&255,g:t>>8&255,b:t&255,a:255};return t>16777215&&(a.a=t>>>24),a};c.exports=m},62957:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=t.toString(16);return a.length===1?"0"+a:a};c.exports=m},37589:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t<<16|a<<8|v};c.exports=m},1e3:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return o<<24|t<<16|a<<8|v};c.exports=m},62183:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987),v=t(89528),o=function(r,n,e){var i=e,h=e,s=e;if(n!==0){var l=e<.5?e*(1+n):e+n-e*n,f=2*e-l;i=v(f,l,r+1/3),h=v(f,l,r),s=v(f,l,r-1/3)}var u=new a;return u.setGLTo(i,h,s,1)};c.exports=o},27939:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7537),v=function(o,r){o===void 0&&(o=1),r===void 0&&(r=1);for(var n=[],e=0;e<=359;e++)n.push(a(e/359,o,r));return n};c.exports=v},7537:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37589);function v(r,n,e,i){var h=(r+n*6)%6,s=Math.min(h,4-h,1);return Math.round(255*(i-i*e*Math.max(0,s)))}var o=function(r,n,e,i){n===void 0&&(n=1),e===void 0&&(e=1);var h=v(5,r,n,e),s=v(3,r,n,e),l=v(1,r,n,e);return i?i.setTo?i.setTo(h,s,l,i.alpha,!0):(i.r=h,i.g=s,i.b=l,i.color=a(h,s,l),i):{r:h,g:s,b:l,color:a(h,s,l)}};c.exports=o},70238:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987),v=function(o){var r=new a;o=o.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(s,l,f,u){return l+l+f+f+u+u});var n=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);if(n){var e=parseInt(n[1],16),i=parseInt(n[2],16),h=parseInt(n[3],16);r.setTo(e,i,h)}return r};c.exports=v},89528:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v<0&&(v+=1),v>1&&(v-=1),v<.16666666666666666?t+(a-t)*6*v:v<.5?a:v<.6666666666666666?t+(a-t)*(.6666666666666666-v)*6:t};c.exports=m},30100:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987),v=t(90664),o=function(r){var n=v(r);return new a(n.r,n.g,n.b,n.a)};c.exports=o},90664:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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}};c.exports=m},13699:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(28915),v=function(n,e,i,h,s,l,f,u){f===void 0&&(f=100),u===void 0&&(u=0);var d=u/f;return{r:a(n,h,d),g:a(e,s,d),b:a(i,l,d)}},o=function(n,e,i,h){return i===void 0&&(i=100),h===void 0&&(h=0),v(n.r,n.g,n.b,e.r,e.g,e.b,i,h)},r=function(n,e,i,h,s,l){return s===void 0&&(s=100),l===void 0&&(l=0),v(n.r,n.g,n.b,e,i,h,s,l)};c.exports={RGBWithRGB:v,ColorWithRGB:r,ColorWithColor:o}},68957:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987),v=function(o){return new a(o.r,o.g,o.b,o.a)};c.exports=v},87388:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987),v=function(o){var r=new a,n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(o.toLowerCase());if(n){var e=parseInt(n[1],10),i=parseInt(n[2],10),h=parseInt(n[3],10),s=n[4]!==void 0?parseFloat(n[4]):1;r.setTo(e,i,h,s*255)}return r};c.exports=v},87837:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){o===void 0&&(o={h:0,s:0,v:0}),t/=255,a/=255,v/=255;var r=Math.min(t,a,v),n=Math.max(t,a,v),e=n-r,i=0,h=n===0?0:e/n,s=n;return n!==r&&(n===t?i=(a-v)/e+(a{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62957),v=function(o,r,n,e,i){return e===void 0&&(e=255),i===void 0&&(i="#"),i==="#"?"#"+((1<<24)+(o<<16)+(r<<8)+n).toString(16).slice(1,7):"0x"+a(e)+a(o)+a(r)+a(n)};c.exports=v},85386:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(30976),v=t(40987),o=function(r,n){return r===void 0&&(r=0),n===void 0&&(n=255),new v(a(r,n),a(r,n),a(r,n))};c.exports=o},80333:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70238),v=t(30100),o=t(68957),r=t(87388),n=function(e){var i=typeof e;switch(i){case"string":return e.substr(0,3).toLowerCase()==="rgb"?r(e):a(e);case"number":return v(e);case"object":return o(e)}};c.exports=n},3956:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40987);a.ColorSpectrum=t(92728),a.ColorToRGBA=t(91588),a.ComponentToHex=t(62957),a.GetColor=t(37589),a.GetColor32=t(1e3),a.HexStringToColor=t(70238),a.HSLToColor=t(62183),a.HSVColorWheel=t(27939),a.HSVToRGB=t(7537),a.HueToComponent=t(89528),a.IntegerToColor=t(30100),a.IntegerToRGB=t(90664),a.Interpolate=t(13699),a.ObjectToColor=t(68957),a.RandomRGB=t(85386),a.RGBStringToColor=t(87388),a.RGBToHSV=t(87837),a.RGBToString=t(75723),a.ValueToColor=t(80333),c.exports=a},27460:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(39429),o=new a({initialize:function(n,e,i,h,s,l){e||(e=n.sys.make.image({x:i,y:h,key:s,frame:l,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}});v.register("bitmapMask",function(r,n,e,i,h){return new o(this.scene,r,n,e,i,h)}),c.exports=o},80661:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n){this.geometryMask=n,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(o){return this.geometryMask=o,this},setInvertAlpha:function(o){return o===void 0&&(o=!0),this.invertAlpha=o,this},preRenderWebGL:function(o,r,n){var e=o.gl;o.flush(),o.maskStack.length===0&&(e.enable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),o.maskCount=0),o.currentCameraMask.mask!==this&&(o.currentMask.mask=this),o.maskStack.push({mask:this,camera:n}),this.applyStencil(o,n,!0),o.maskCount++},applyStencil:function(o,r,n){var e=o.gl,i=this.geometryMask,h=o.maskCount,s=255;e.colorMask(!1,!1,!1,!1),n?(e.stencilFunc(e.EQUAL,h,s),e.stencilOp(e.KEEP,e.KEEP,e.INCR),h++):(e.stencilFunc(e.EQUAL,h+1,s),e.stencilOp(e.KEEP,e.KEEP,e.DECR)),this.level=h,i.renderWebGL(o,i,r),o.flush(),e.colorMask(!0,!0,!0,!0),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),this.invertAlpha?e.stencilFunc(e.NOTEQUAL,h,s):e.stencilFunc(e.EQUAL,h,s)},postRenderWebGL:function(o){var r=o.gl;o.maskStack.pop(),o.maskCount--,o.flush();var n=o.currentMask;if(o.maskStack.length===0)n.mask=null,r.disable(r.STENCIL_TEST);else{var e=o.maskStack[o.maskStack.length-1];e.mask.applyStencil(o,e.camera,!1),o.currentCameraMask.mask!==e.mask?(n.mask=e.mask,n.camera=e.camera):n.mask=null}},preRenderCanvas:function(o,r,n){var e=this.geometryMask;o.currentContext.save(),e.renderCanvas(o,e,n,null,null,!0),o.currentContext.clip()},postRenderCanvas:function(o){o.currentContext.restore()},destroy:function(){this.geometryMask=null}});c.exports=v},69781:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={BitmapMask:t(6858),GeometryMask:t(80661)}},73894:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i){(!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(` -`)),i===void 0&&(i=null),this.key=r,this.fragmentSrc=n,this.vertexSrc=e,this.uniforms=i}});c.exports=v},40366:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v;if(a)typeof a=="string"?v=document.getElementById(a):typeof a=="object"&&a.nodeType===1&&(v=a);else if(t.parentElement||a===null)return t;return v||(v=document.body),v.appendChild(t),t};c.exports=m},83719:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40366),v=function(o){var r=o.config;if(!(!r.parent||!r.domCreateContainer)){var n=document.createElement("div");n.style.cssText=["display: block;","width: "+o.scale.width+"px;","height: "+o.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+r.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),o.domContainer=n,a(n,r.parent)}};c.exports=v},57264:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25892),v=function(o){if(document.readyState==="complete"||document.readyState==="interactive"){o();return}var r=function(){document.removeEventListener("deviceready",r,!0),document.removeEventListener("DOMContentLoaded",r,!0),window.removeEventListener("load",r,!0),o()};document.body?a.cordova?document.addEventListener("deviceready",r,!1):(document.addEventListener("DOMContentLoaded",r,!0),window.addEventListener("load",r,!0)):window.setTimeout(r,20)};c.exports=v},57811:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){if(!t)return window.innerHeight;var a=Math.abs(window.orientation),v={w:0,h:0},o=document.createElement("div");return o.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(o),v.w=a===90?o.offsetHeight:window.innerWidth,v.h=a===90?window.innerWidth:o.offsetHeight,document.documentElement.removeChild(o),o=null,Math.abs(window.orientation)!==90?v.h:v.w};c.exports=m},45818:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13560),v=function(o,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?a.ORIENTATION.PORTRAIT:a.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return a.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return a.ORIENTATION.LANDSCAPE}else return r>o?a.ORIENTATION.PORTRAIT:a.ORIENTATION.LANDSCAPE};c.exports=v},74403:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a;return t!==""&&(typeof t=="string"?a=document.getElementById(t):t&&t.nodeType===1&&(a=t)),a||(a=document.body),a};c.exports=m},56836:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a="";try{if(window.DOMParser){var v=new DOMParser;a=v.parseFromString(t,"text/xml")}else a=new ActiveXObject("Microsoft.XMLDOM"),a.loadXML(t)}catch{a=null}return!a||!a.documentElement||a.getElementsByTagName("parsererror").length?null:a};c.exports=m},35846:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){t.parentNode&&t.parentNode.removeChild(t)};c.exports=m},43092:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(29747),o=new a({initialize:function(){this.isRunning=!1,this.callback=v,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var n=this;this.step=function e(i){n.callback(i),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=v}});c.exports=o},84902:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={AddToDOM:t(40366),DOMContentLoaded:t(57264),GetInnerHeight:t(57811),GetScreenOrientation:t(45818),GetTarget:t(74403),ParseXML:t(56836),RemoveFromDOM:t(35846),RequestAnimationFrame:t(43092)};c.exports=a},47565:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(37277),r=new a({Extends:v,initialize:function(){v.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});o.register("EventEmitter",r,"events"),c.exports=r},93055:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={EventEmitter:t(47565)}},20122:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i){i===void 0&&(i=1),v.call(this,o.BARREL,e),this.amount=i}});c.exports=r},32251:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u){h===void 0&&(h=1),s===void 0&&(s=1),l===void 0&&(l=1),f===void 0&&(f=1),u===void 0&&(u=4),v.call(this,o.BLOOM,e),this.steps=u,this.offsetX=h,this.offsetY=s,this.blurStrength=l,this.strength=f,this.glcolor=[1,1,1],i!=null&&(this.color=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}}});c.exports=r},9047:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u){i===void 0&&(i=0),h===void 0&&(h=2),s===void 0&&(s=2),l===void 0&&(l=1),u===void 0&&(u=4),v.call(this,o.BLUR,e),this.quality=i,this.x=h,this.y=s,this.steps=u,this.strength=l,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}}});c.exports=r},27885:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u,d){i===void 0&&(i=.5),h===void 0&&(h=1),s===void 0&&(s=.2),l===void 0&&(l=!1),f===void 0&&(f=1),u===void 0&&(u=1),d===void 0&&(d=1),v.call(this,o.BOKEH,e),this.radius=i,this.amount=h,this.contrast=s,this.isTiltShift=l,this.strength=d,this.blurX=f,this.blurY=u}});c.exports=r},12578:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f){i===void 0&&(i=8),l===void 0&&(l=1),f===void 0&&(f=.005),v.call(this,o.CIRCLE,e),this.scale=l,this.feather=f,this.thickness=i,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],h!=null&&(this.color=h),s!=null&&(this.backgroundColor=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}},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}}});c.exports=r},15802:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(89422),o=t(14811),r=new a({Extends:v,initialize:function(e){v.call(this),this.type=o.COLOR_MATRIX,this.gameObject=e,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});c.exports=r},72898:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n){this.type=r,this.gameObject=n,this.active=!0},setActive:function(o){return this.active=o,this},destroy:function(){this.gameObject=null,this.active=!1}});c.exports=v},44553:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s){i===void 0&&(i="__WHITE"),h===void 0&&(h=.005),s===void 0&&(s=.005),v.call(this,o.DISPLACEMENT,e),this.x=h,this.y=s,this.glTexture,this.setTexture(i)},setTexture:function(n){var e=this.gameObject.scene.sys.textures.getFrame(n);return e&&(this.glTexture=e.glTexture),this}});c.exports=r},68531:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l){h===void 0&&(h=4),s===void 0&&(s=0),l===void 0&&(l=!1),v.call(this,o.GLOW,e),this.outerStrength=h,this.innerStrength=s,this.knockout=l,this.glcolor=[1,1,1,1],i!==void 0&&(this.color=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}}});c.exports=r},37102:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u,d,p){s===void 0&&(s=.2),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=1),p===void 0&&(p=0),v.call(this,o.GRADIENT,e),this.alpha=s,this.size=p,this.fromX=l,this.fromY=f,this.toX=u,this.toY=d,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],i!=null&&(this.color1=i),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}}});c.exports=r},86886:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i){i===void 0&&(i=1),v.call(this,o.PIXELATE,e),this.amount=i}});c.exports=r},92322:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u,d){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=.1),l===void 0&&(l=1),u===void 0&&(u=6),d===void 0&&(d=1),v.call(this,o.SHADOW,e),this.x=i,this.y=h,this.decay=s,this.power=l,this.glcolor=[0,0,0,1],this.samples=u,this.intensity=d,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}}});c.exports=r},39563:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l){i===void 0&&(i=.5),h===void 0&&(h=.5),s===void 0&&(s=3),l===void 0&&(l=!1),v.call(this,o.SHINE,e),this.speed=i,this.lineWidth=h,this.gradient=s,this.reveal=l}});c.exports=r},56448:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l){i===void 0&&(i=.5),h===void 0&&(h=.5),s===void 0&&(s=.5),l===void 0&&(l=.5),v.call(this,o.VIGNETTE,e),this.x=i,this.y=h,this.radius=s,this.strength=l}});c.exports=r},38433:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72898),o=t(14811),r=new a({Extends:v,initialize:function(e,i,h,s,l){i===void 0&&(i=.1),h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=!1),v.call(this,o.WIPE,e),this.progress=0,this.wipeWidth=i,this.direction=h,this.axis=s,this.reveal=l}});c.exports=r},14811:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},66064:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79291),v=t(14811),o={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)};o=a(!1,o,v),c.exports=o},25305:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(23568),o=function(r,n,e){n.x=v(e,"x",0),n.y=v(e,"y",0),n.depth=v(e,"depth",0),n.flipX=v(e,"flipX",!1),n.flipY=v(e,"flipY",!1);var i=v(e,"scale",null);typeof i=="number"?n.setScale(i):i!==null&&(n.scaleX=v(i,"x",1),n.scaleY=v(i,"y",1));var h=v(e,"scrollFactor",null);typeof h=="number"?n.setScrollFactor(h):h!==null&&(n.scrollFactorX=v(h,"x",1),n.scrollFactorY=v(h,"y",1)),n.rotation=v(e,"rotation",0);var s=v(e,"angle",null);s!==null&&(n.angle=s),n.alpha=v(e,"alpha",1);var l=v(e,"origin",null);if(typeof l=="number")n.setOrigin(l);else if(l!==null){var f=v(l,"x",.5),u=v(l,"y",.5);n.setOrigin(f,u)}n.blendMode=v(e,"blendMode",a.NORMAL),n.visible=v(e,"visible",!0);var d=v(e,"add",!0);return d&&r.sys.displayList.add(n),n.preUpdate&&r.sys.updateList.add(n),n};c.exports=o},13059:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23568),v=function(o,r){var n=a(r,"anims",null);if(n===null)return o;if(typeof n=="string")o.anims.play(n);else if(typeof n=="object"){var e=o.anims,i=a(n,"key",void 0);if(i){var h=a(n,"startFrame",void 0),s=a(n,"delay",0),l=a(n,"repeat",0),f=a(n,"repeatDelay",0),u=a(n,"yoyo",!1),d=a(n,"play",!1),p=a(n,"delayedPlay",0),g={key:i,delay:s,repeat:l,repeatDelay:f,yoyo:u,startFrame:h};d?e.play(g):p>0?e.playAfterDelay(g,p):e.load(g)}}return o};c.exports=v},8050:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(73162),o=t(37277),r=t(51708),n=t(44594),e=t(19186),i=new a({Extends:v,initialize:function(s){v.call(this,s),this.sortChildrenFlag=!1,this.scene=s,this.systems=s.sys,this.events=s.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,s){return h._depth-s._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}});o.register("DisplayList",i,"displayList"),c.exports=i},95643:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(53774),o=t(45893),r=t(50792),n=t(51708),e=t(44594),i=new a({Extends:r,initialize:function(s,l){r.call(this),this.scene=s,this.displayList=null,this.type=l,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),s.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 o(this)),this},setData:function(h,s){return this.data||(this.data=new o(this)),this.data.set(h,s),this},incData:function(h,s){return this.data||(this.data=new o(this)),this.data.inc(h,s),this},toggleData:function(h){return this.data||(this.data=new o(this)),this.data.toggle(h),this},getData:function(h){return this.data||(this.data=new o(this)),this.data.get(h)},setInteractive:function(h,s,l){return this.scene.sys.input.enable(this,h,s,l),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 v(this)},willRender:function(h){var s=this.displayList&&this.displayList.active?this.displayList.willRender(h):!0;return!(!s||i.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&h.id)},getIndexList:function(){for(var h=this,s=this.parentContainer,l=[];s&&(l.unshift(s.getIndex(h)),h=s,s.parentContainer);)s=s.parentContainer;return this.displayList?l.unshift(this.displayList.getIndex(h)):l.unshift(this.scene.sys.displayList.getIndex(h)),l},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)}});i.RENDER_MASK=15,c.exports=i},44603:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(37277),o=t(44594),r=new a({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.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]},v.register("GameObjectCreator",r,"make"),c.exports=r},39429:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(37277),o=t(44594),r=new a({initialize:function(e){this.scene=e,this.systems=e.sys,this.events=e.sys.events,this.displayList,this.updateList,this.events.once(o.BOOT,this.boot,this),this.events.on(o.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.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(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(o.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]},v.register("GameObjectFactory",r,"add"),c.exports=r},91296:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61340),v=new a,o=new a,r=new a,n={camera:v,sprite:o,calc:r},e=function(i,h,s){var l=v,f=o,u=r;return f.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),l.copyFrom(h.matrix),s?(l.multiplyWithOffset(s,-h.scrollX*i.scrollFactorX,-h.scrollY*i.scrollFactorY),f.e=i.x,f.f=i.y):(f.e-=h.scrollX*i.scrollFactorX,f.f-=h.scrollY*i.scrollFactorY),l.multiply(f,u),n};c.exports=e},45027:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(25774),o=t(37277),r=t(44594),n=new a({Extends:v,initialize:function(i){v.call(this),this.checkQueue=!0,this.scene=i,this.systems=i.sys,i.sys.events.once(r.BOOT,this.boot,this),i.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,i){for(var h=this._active,s=h.length,l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r,n,e,i,h,s,l,f,u,d,p){var g=v.x-a.displayOriginX+r,y=v.y-a.displayOriginY+n,x=g+v.w,T=y+v.h,C=e.getXRound(g,y,i),M=e.getYRound(g,y,i),w=e.getXRound(g,T,i),L=e.getYRound(g,T,i),F=e.getXRound(x,T,i),O=e.getYRound(x,T,i),N=e.getXRound(x,y,i),G=e.getYRound(x,y,i);t.batchQuad(a,C,M,w,L,F,O,N,G,o.u0,o.v0,o.u1,o.v1,h,s,l,f,u,d,p)};c.exports=m},53048:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){if(v===void 0&&(v=!1),o===void 0)return o={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},o;var r=t.text,n=r.length,e=t.maxWidth,i=t.wordWrapCharCode,h=Number.MAX_VALUE,s=Number.MAX_VALUE,l=0,f=0,u=t.fontData.chars,d=t.fontData.lineHeight,p=t.letterSpacing,g=t.lineSpacing,y=0,x=0,T=0,C=null,M=t._align,w=0,L=0,F=t.fontSize/t.fontData.size,O=F*t.scaleX,N=F*t.scaleY,G=null,V=0,j=[],K=Number.MAX_VALUE,J=0,X=0,Y=0,D,z=[],W=[],H=null;if(e>0){for(D=0;De||pt>e?(et.push(st.i-1),st.cr?(et.push(st.i+st.word.length),k=0,Q=null):Q=st):st.cr&&(et.push(st.i+st.word.length),k=0,Q=null)}var Pt=function(Zt,le,fe){return Zt.substr(0,le)+fe+Zt.substr(le+1)};for(D=et.length-1;D>=0;D--)r=Pt(r,et[D],` -`);o.wrappedText=r,n=r.length,z=[],H=null}var Ct=0;for(D=0;DJ&&(J=Y),Yw&&(h=w),s>L&&(s=L);var vt=w+C.xAdvance,St=L+d;lJ&&(J=Y),Y0)for(var Mt=0;Mt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(21859),v=function(o,r,n,e,i,h,s){var l=o.sys.textures.get(n),f=l.get(e),u=o.sys.cache.xml.get(i);if(f&&u){var d=a(u,f,h,s,l);return o.sys.cache.bitmapFont.add(r,{data:d,texture:n,frame:e,fromAtlas:!0}),!0}else return!1};c.exports=v},6925:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35154),v=function(o,r){var n=r.width,e=r.height,i=Math.floor(n/2),h=Math.floor(e/2),s=a(r,"chars","");if(s!==""){var l=a(r,"image",""),f=o.sys.textures.getFrame(l),u=f.cutX,d=f.cutY,p=f.source.width,g=f.source.height,y=a(r,"offset.x",0),x=a(r,"offset.y",0),T=a(r,"spacing.x",0),C=a(r,"spacing.y",0),M=a(r,"lineSpacing",0),w=a(r,"charsPerRow",null);w===null&&(w=p/n,w>s.length&&(w=s.length));for(var L=y,F=x,O={retroFont:!0,font:l,size:n,lineHeight:e+M,chars:{}},N=0,G=0;G{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(a,v){return parseInt(a.getAttribute(v),10)}var t=function(a,v,o,r,n){o===void 0&&(o=0),r===void 0&&(r=0);var e=v.cutX,i=v.cutY,h=v.source.width,s=v.source.height,l=v.sourceIndex,f={},u=a.getElementsByTagName("info")[0],d=a.getElementsByTagName("common")[0];f.font=u.getAttribute("face"),f.size=m(u,"size"),f.lineHeight=m(d,"lineHeight")+r,f.chars={};var p=a.getElementsByTagName("char"),g=v!==void 0&&v.trimmed;if(g)var y=v.height,x=v.width;for(var T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87662),v=t(79291),o={Parse:t(6925)};o=v(!1,o,a),c.exports=o},87662:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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`};c.exports=m},2638:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22186),v=t(83419),o=t(12310),r=new v({Extends:a,Mixins:[o],initialize:function(e,i,h,s,l,f,u){a.call(this,e,i,h,s,l,f,u),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}});c.exports=r},86741:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20926),v=function(o,r,n,e){var i=r._text,h=i.length,s=o.currentContext;if(!(h===0||!a(o,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.displayCallback,u=r.callbackData,d=r.fontData.chars,p=r.fontData.lineHeight,g=r._letterSpacing,y=0,x=0,T=0,C=null,M=0,w=0,L=0,F=0,O=0,N=0,G=null,V=0,j=r.frame.source.image,K=l.cutX,J=l.cutY,X=0,Y=0,D=r._fontSize/r.fontData.size,z=r._align,W=0,H=0;r.getTextBounds(!1);var Z=r._bounds.lines;z===1?H=(Z.longest-Z.lengths[0])/2:z===2&&(H=Z.longest-Z.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);var Q=n.roundPixels;r.cropWidth>0&&r.cropHeight>0&&(s.beginPath(),s.rect(0,0,r.cropWidth,r.cropHeight),s.clip());for(var k=0;k{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2638),v=t(25305),o=t(44603),r=t(23568);o.register("dynamicBitmapText",function(n,e){n===void 0&&(n={});var i=r(n,"font",""),h=r(n,"text",""),s=r(n,"size",!1),l=new a(this.scene,0,0,i,h,s);return e!==void 0&&(n.add=e),v(this.scene,l,n),l})},72566:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2638),v=t(39429);v.register("dynamicBitmapText",function(o,r,n,e,i){return this.displayList.add(new a(this.scene,o,r,n,e,i))})},12310:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(73482),o=t(86741),c.exports={renderWebGL:v,renderCanvas:o}},73482:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(61340),o=t(70554),r=new v,n=function(e,i,h,s){var l=i.text,f=l.length;if(f!==0){h.addToRenderList(i);var u=e.pipelines.set(i.pipeline,i),d=a(i,h,s);e.pipelines.preBatch(i);var p=d.sprite,g=d.calc,y=r,x=i.cropWidth>0||i.cropHeight>0;x&&(u.flush(),e.pushScissor(g.tx,g.ty,i.cropWidth*g.scaleX,i.cropHeight*g.scaleY));var T=i.frame,C=T.glTexture,M=i.tintFill,w=o.getTintAppendFloatAlpha(i.tintTopLeft,h.alpha*i._alphaTL),L=o.getTintAppendFloatAlpha(i.tintTopRight,h.alpha*i._alphaTR),F=o.getTintAppendFloatAlpha(i.tintBottomLeft,h.alpha*i._alphaBL),O=o.getTintAppendFloatAlpha(i.tintBottomRight,h.alpha*i._alphaBR),N=u.setGameObject(i),G=0,V=0,j=0,K=0,J=i.letterSpacing,X,Y=0,D=0,z,W=i.scrollX,H=i.scrollY,Z=i.fontData,Q=Z.chars,k=Z.lineHeight,et=i.fontSize/Z.size,st=0,rt=i._align,ot=0,dt=0,at=i.getTextBounds(!1);i.maxWidth>0&&(l=at.wrappedText,f=l.length);var pt=i._bounds.lines;rt===1?dt=(pt.longest-pt.lengths[0])/2:rt===2&&(dt=pt.longest-pt.lengths[0]);for(var Pt=h.roundPixels,Ct=i.displayCallback,Et=i.callbackData,vt=0;vt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(45319),o=t(31401),r=t(95643),n=t(53048),e=t(61327),i=t(21859),h=t(87841),s=t(18658),l=new a({Extends:r,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Texture,o.Tint,o.Transform,o.Visible,s],initialize:function(u,d,p,g,y,x,T){y===void 0&&(y=""),T===void 0&&(T=0),r.call(this,u,"BitmapText"),this.font=g;var C=this.scene.sys.cache.bitmapFont.get(g);C||console.warn("Invalid BitmapText key: "+g),this.fontData=C.data,this._text="",this._fontSize=x||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=T,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=C.fromAtlas,this.setTexture(C.texture,C.frame),this.setPosition(d,p),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(y)},setLeftAlign:function(){return this._align=l.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=l.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=l.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,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=.5),this.dropShadowX=f,this.dropShadowY=u,this.dropShadowColor=d,this.dropShadowAlpha=p,this},setCharacterTint:function(f,u,d,p,g,y,x){f===void 0&&(f=0),u===void 0&&(u=1),d===void 0&&(d=!1),p===void 0&&(p=-1),g===void 0&&(g=p,y=p,x=p);var T=this.text.length;u===-1&&(u=T),f<0&&(f=T+f),f=v(f,0,T-1);for(var C=v(f+u,f,T),M=this.charColors,w=f;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20926),v=function(o,r,n,e){var i=r._text,h=i.length,s=o.currentContext;if(!(h===0||!a(o,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.fontData.chars,u=r.fontData.lineHeight,d=r._letterSpacing,p=r._lineSpacing,g=0,y=0,x=0,T=null,C=0,M=0,w=0,L=0,F=0,O=0,N=null,G=0,V=l.source.image,j=l.cutX,K=l.cutY,J=r._fontSize/r.fontData.size,X=r._align,Y=0,D=0,z=r.getTextBounds(!1);r.maxWidth>0&&(i=z.wrappedText,h=i.length);var W=r._bounds.lines;X===1?D=(W.longest-W.lengths[0])/2:X===2&&(D=W.longest-W.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);for(var H=n.roundPixels,Z=0;Z{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22186),v=t(25305),o=t(44603),r=t(23568),n=t(35154);o.register("bitmapText",function(e,i){e===void 0&&(e={});var h=n(e,"font",""),s=r(e,"text",""),l=r(e,"size",!1),f=n(e,"align",0),u=new a(this.scene,0,0,h,s,l,f);return i!==void 0&&(e.add=i),v(this.scene,u,e),u})},34914:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22186),v=t(39429);v.register("bitmapText",function(o,r,n,e,i,h){return this.displayList.add(new a(this.scene,o,r,n,e,i,h))})},18658:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(33590),o=t(37289),c.exports={renderWebGL:v,renderCanvas:o}},33590:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(3217),v=t(91296),o=t(70554),r=function(n,e,i,h){var s=e._text,l=s.length;if(l!==0){i.addToRenderList(e);var f=n.pipelines.set(e.pipeline,e),u=v(e,i,h).calc;n.pipelines.preBatch(e);var d=i.roundPixels,p=i.alpha,g=e.charColors,y=e.tintFill,x=o.getTintAppendFloatAlpha,T=x(e.tintTopLeft,p*e._alphaTL),C=x(e.tintTopRight,p*e._alphaTR),M=x(e.tintBottomLeft,p*e._alphaBL),w=x(e.tintBottomRight,p*e._alphaBR),L=e.frame.glTexture,F=f.setGameObject(e),O=e.getTextBounds(!1),N,G,V,j=O.characters,K=e.dropShadowX,J=e.dropShadowY,X=K!==0||J!==0;if(X){var Y=e.dropShadowColor,D=e.dropShadowAlpha,z=x(Y,p*D*e._alphaTL),W=x(Y,p*D*e._alphaTR),H=x(Y,p*D*e._alphaBL),Z=x(Y,p*D*e._alphaBR);for(N=0;N{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(48011),v=t(46590),o=t(83419),r=t(31401),n=t(4327),e=t(95643),i=t(73162),h=new o({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,a],initialize:function(l,f,u,d,p){e.call(this,l,"Blitter"),this.setTexture(d,p),this.setPosition(f,u),this.initPipeline(),this.initPostPipeline(),this.children=new i,this.renderList=[],this.dirty=!1},create:function(s,l,f,u,d){u===void 0&&(u=!0),d===void 0&&(d=this.children.length),f===void 0?f=this.frame:f instanceof n||(f=this.texture.get(f));var p=new v(this,s,l,f,u);return this.children.addAt(p,d,!1),this.dirty=!0,p},createFromCallback:function(s,l,f,u){for(var d=this.createMultiple(l,f,u),p=0;p0},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=[]}});c.exports=h},72396:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=a.getRenderList();if(r.length!==0){var n=t.currentContext,e=v.alpha*a.alpha;if(e!==0){v.addToRenderList(a),n.globalCompositeOperation=t.blendModes[a.blendMode],n.imageSmoothingEnabled=!a.frame.source.scaleMode;var i=a.x-v.scrollX*a.scrollFactorX,h=a.y-v.scrollY*a.scrollFactorY;n.save(),o&&o.copyToContext(n);for(var s=v.roundPixels,l=0;l0&&p.height>0&&(n.save(),n.translate(f.x+i,f.y+h),n.scale(x,T),n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g,y,p.width,p.height),n.restore())):(s&&(g=Math.round(g),y=Math.round(y)),p.width>0&&p.height>0&&n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g+f.x+i,y+f.y+h,p.width,p.height)))}n.restore()}}};c.exports=m},9403:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6107),v=t(25305),o=t(44603),r=t(23568);o.register("blitter",function(n,e){n===void 0&&(n={});var i=r(n,"key",null),h=r(n,"frame",null),s=new a(this.scene,0,0,i,h);return e!==void 0&&(n.add=e),v(this.scene,s,n),s})},12709:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6107),v=t(39429);v.register("blitter",function(o,r,n,e){return this.displayList.add(new a(this.scene,o,r,n,e))})},48011:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(99485),o=t(72396),c.exports={renderWebGL:v,renderCanvas:o}},99485:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61340),v=t(70554),o=new a,r=function(n,e,i,h){var s=e.getRenderList(),l=i.alpha*e.alpha;if(!(s.length===0||l===0)){i.addToRenderList(e);var f=n.pipelines.set(this.pipeline,e),u=i.scrollX*e.scrollFactorX,d=i.scrollY*e.scrollFactorY,p=o.copyFrom(i.matrix);h&&(p.multiplyWithOffset(h,-u,-d),u=0,d=0);var g=e.x-u,y=e.y-d,x=-1,T=!1;n.pipelines.preBatch(e);for(var C=0;C{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(4327),o=new a({initialize:function(n,e,i,h,s){this.parent=n,this.x=e,this.y=i,this.frame=h,this.data={},this.tint=16777215,this._visible=s,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 v&&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}}});c.exports=o},16005:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=2,o={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(r,n,e,i){return r===void 0&&(r=1),n===void 0?this.alpha=r:(this._alphaTL=a(r,0,1),this._alphaTR=a(n,0,1),this._alphaBL=a(e,0,1),this._alphaBR=a(i,0,1)),this},alpha:{get:function(){return this._alpha},set:function(r){var n=a(r,0,1);this._alpha=n,this._alphaTL=n,this._alphaTR=n,this._alphaBL=n,this._alphaBR=n,n===0?this.renderFlags&=~v:this.renderFlags|=v}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(r){var n=a(r,0,1);this._alphaTL=n,n!==0&&(this.renderFlags|=v)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(r){var n=a(r,0,1);this._alphaTR=n,n!==0&&(this.renderFlags|=v)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(r){var n=a(r,0,1);this._alphaBL=n,n!==0&&(this.renderFlags|=v)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(r){var n=a(r,0,1);this._alphaBR=n,n!==0&&(this.renderFlags|=v)}}};c.exports=o},88509:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=2,o={_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=a(r,0,1);this._alpha=n,n===0?this.renderFlags&=~v:this.renderFlags|=v}}};c.exports=o},90065:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v={_blendMode:a.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(o){typeof o=="string"&&(o=a[o]),o|=0,o>=-1&&(this._blendMode=o)}},setBlendMode:function(o){return this.blendMode=o,this}};c.exports=v},94215:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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,a){return this.width=t,this.height=a,this},setDisplaySize:function(t,a){return this.displayWidth=t,this.displayHeight=a,this}};c.exports=m},61683:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={texture:null,frame:null,isCropped:!1,setCrop:function(t,a,v,o){if(t===void 0)this.isCropped=!1;else if(this.frame){if(typeof t=="number")this.frame.setCropUVs(this._crop,t,a,v,o,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}}};c.exports=m},89272:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={_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}};c.exports=m},47059:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(66064),o=t(19133),r=new a({initialize:function(e,i){this.gameObject=e,this.isPost=i,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 m={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,a){return this.flipX=t,this.flipY=a,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}};c.exports=m},8004:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=t(11520),o=t(26099),r={prepareBoundsOutput:function(n,e){if(e===void 0&&(e=!1),this.rotation!==0&&v(n,this.x,this.y,this.rotation),e&&this.parentContainer){var i=this.parentContainer.getBoundsTransformMatrix();i.transformPoint(n.x,n.y,n)}return n},getCenter:function(n,e){return n===void 0&&(n=new o),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 o),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 o),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 o),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 o),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 o),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 o),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 o),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 o),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 a);var e,i,h,s,l,f,u,d;if(this.parentContainer){var p=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(n),p.transformPoint(n.x,n.y,n),e=n.x,i=n.y,this.getTopRight(n),p.transformPoint(n.x,n.y,n),h=n.x,s=n.y,this.getBottomLeft(n),p.transformPoint(n.x,n.y,n),l=n.x,f=n.y,this.getBottomRight(n),p.transformPoint(n.x,n.y,n),u=n.x,d=n.y}else this.getTopLeft(n),e=n.x,i=n.y,this.getTopRight(n),h=n.x,s=n.y,this.getBottomLeft(n),l=n.x,f=n.y,this.getBottomRight(n),u=n.x,d=n.y;return n.x=Math.min(e,h,l,u),n.y=Math.min(i,s,f,d),n.width=Math.max(e,h,l,u)-n.x,n.height=Math.max(i,s,f,d)-n.y,n}};c.exports=r},8573:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6858),v=t(80661),o={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,i,h){return r===void 0&&(this.texture||this.shader||this.geom)&&(r=this),new a(this.scene,r,n,e,i,h)},createGeometryMask:function(r){return r===void 0&&(this.type==="Graphics"||this.geom)&&(r=this),new v(this.scene,r)}};c.exports=o},27387:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={_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,a){return t===void 0&&(t=.5),a===void 0&&(a=t),this.originX=t,this.originY=a,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,a){return t===void 0&&(t=0),a===void 0&&(a=t),this.displayOriginX=t,this.displayOriginY=a,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};c.exports=m},37640:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39506),v=t(57355),o=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(i,h){h===void 0&&(h=this.pathConfig);var s=this.pathTween;return s&&s.isPlaying()&&s.stop(),this.path=i,h&&this.startFollow(h),this},setRotateToPath:function(i,h){return h===void 0&&(h=0),this.rotateToPath=i,this.pathRotationOffset=h,this},isFollowing:function(){var i=this.pathTween;return i&&i.isPlaying()},startFollow:function(i,h){i===void 0&&(i={}),h===void 0&&(h=0);var s=this.pathTween;s&&s.isPlaying()&&s.stop(),typeof i=="number"&&(i={duration:i}),i.from=o(i,"from",0),i.to=o(i,"to",1);var l=v(i,"positionOnPath",!1);this.rotateToPath=v(i,"rotateToPath",!1),this.pathRotationOffset=o(i,"rotationOffset",0);var f=o(i,"startAt",h);if(f&&(i.onStart=function(d){var p=d.data[0];p.progress=f,p.elapsed=p.duration*f;var g=p.ease(p.progress);p.current=p.start+(p.end-p.start)*g,p.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(),i.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(i),this.path.getStartPoint(this.pathOffset),l&&(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 u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+a(this.pathRotationOffset)}return this.pathConfig=i,this},pauseFollow:function(){var i=this.pathTween;return i&&i.isPlaying()&&i.pause(),this},resumeFollow:function(){var i=this.pathTween;return i&&i.isPaused()&&i.resume(),this},stopFollow:function(){var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this},pathUpdate:function(){var i=this.pathTween;if(i&&i.data){var h=i.data[0],s=this.pathDelta,l=this.pathVector;if(s.copy(l).negate(),h.state===r.COMPLETE){this.path.getPoint(h.end,l),s.add(l),l.add(this.pathOffset),this.setPosition(l.x,l.y);return}else if(h.state!==r.PLAYING_FORWARD&&h.state!==r.PLAYING_BACKWARD)return;this.path.getPoint(i.getValue(),l),s.add(l),l.add(this.pathOffset);var f=this.x,u=this.y;this.setPosition(l.x,l.y);var d=this.x-f,p=this.y-u;if(d===0&&p===0)return;if(h.state!==this._prevDirection){this._prevDirection=h.state;return}this.rotateToPath&&(this.rotation=Math.atan2(p,d)+a(this.pathRotationOffset))}}};c.exports=e},72699:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62644),v={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(o){this.pipelineData={};var r=this.scene.sys.renderer;if(!r)return!1;var n=r.pipelines;if(n){o===void 0&&(o=n.default);var e=n.get(o);if(e)return this.defaultPipeline=e,this.pipeline=e,!0}return!1},setPipeline:function(o,r,n){var e=this.scene.sys.renderer;if(!e)return this;var i=e.pipelines;if(i){var h=i.get(o);h&&(this.pipeline=h),r&&(this.pipelineData=n?a(r):r)}return this},setPipelineData:function(o,r){var n=this.pipelineData;return r===void 0?delete n[o]:n[o]=r,this},resetPipeline:function(o){return o===void 0&&(o=!1),this.pipeline=this.defaultPipeline,o&&(this.pipelineData={}),this.pipeline!==null},getPipelineName:function(){return this.pipeline.name}};c.exports=v},17581:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62644),v=t(47059),o=t(19133),r={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(n){this.postPipelines=[],this.postPipelineData={},this.postFX=new v(this,!0),n&&(this.preFX=new v(this,!1))},setPostPipeline:function(n,e,i){var h=this.scene.sys.renderer;if(!h)return this;var s=h.pipelines;if(s){Array.isArray(n)||(n=[n]);for(var l=0;l0,this},setPostPipelineData:function(n,e){var i=this.postPipelineData;return e===void 0?delete i[n]:i[n]=e,this},getPostPipeline:function(n){for(var e=typeof n=="string",i=this.postPipelines,h=[],s=0;s=0;h--){var s=i[h];(e&&s.name===n||!e&&s===n)&&(s.destroy(),o(i,h))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};c.exports=r},80227:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,a){return a===void 0&&(a=t),this.scrollFactorX=t,this.scrollFactorY=a,this}};c.exports=m},16736:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={_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 a=this.input;return a&&!a.customHitArea&&(a.hitArea.width=this.width,a.hitArea.height=this.height),this},setSize:function(t,a){return this.width=t,this.height=a,this},setDisplaySize:function(t,a){return this.displayWidth=t,this.displayHeight=a,this}};c.exports=m},37726:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(4327),v=8,o={texture:null,frame:null,isCropped:!1,setTexture:function(r,n,e,i){return this.texture=this.scene.sys.textures.get(r),this.setFrame(n,e,i)},setFrame:function(r,n,e){return n===void 0&&(n=!0),e===void 0&&(e=!0),r instanceof a?(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&=~v:this.renderFlags|=v,this._sizeComponent&&n&&this.setSizeToFrame(),this._originComponent&&e&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};c.exports=o},79812:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(4327),v=8,o={texture:null,frame:null,isCropped:!1,setCrop:function(r,n,e,i){if(r===void 0)this.isCropped=!1;else if(this.frame){if(typeof r=="number")this.frame.setCropUVs(this._crop,r,n,e,i,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 a?(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&=~v:this.renderFlags|=v,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}}};c.exports=o},27472:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,a,v,o){return t===void 0&&(t=16777215),a===void 0&&(a=t,v=t,o=t),this.tintTopLeft=t,this.tintTopRight=a,this.tintBottomLeft=v,this.tintBottomRight=o,this.tintFill=!1,this},setTintFill:function(t,a,v,o){return this.setTint(t,a,v,o),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}}};c.exports=m},53774:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a={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&&(a.textureKey=t.texture.key,a.frameKey=t.frame.name),a};c.exports=m},16901:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(61340),o=t(85955),r=t(86554),n=t(30954),e=t(26099),i=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(s){this._scaleX=s,this._scaleY=s,s===0?this.renderFlags&=~i:this.renderFlags|=i}},scaleX:{get:function(){return this._scaleX},set:function(s){this._scaleX=s,s===0?this.renderFlags&=~i:this._scaleY!==0&&(this.renderFlags|=i)}},scaleY:{get:function(){return this._scaleY},set:function(s){this._scaleY=s,s===0?this.renderFlags&=~i:this._scaleX!==0&&(this.renderFlags|=i)}},angle:{get:function(){return n(this._rotation*a.RAD_TO_DEG)},set:function(s){this.rotation=n(s)*a.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(s){this._rotation=r(s)}},setPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=s),f===void 0&&(f=0),u===void 0&&(u=0),this.x=s,this.y=l,this.z=f,this.w=u,this},copyPosition:function(s){return s.x!==void 0&&(this.x=s.x),s.y!==void 0&&(this.y=s.y),s.z!==void 0&&(this.z=s.z),s.w!==void 0&&(this.w=s.w),this},setRandomPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),this.x=s+Math.random()*f,this.y=l+Math.random()*u,this},setRotation:function(s){return s===void 0&&(s=0),this.rotation=s,this},setAngle:function(s){return s===void 0&&(s=0),this.angle=s,this},setScale:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=s),this.scaleX=s,this.scaleY=l,this},setX:function(s){return s===void 0&&(s=0),this.x=s,this},setY:function(s){return s===void 0&&(s=0),this.y=s,this},setZ:function(s){return s===void 0&&(s=0),this.z=s,this},setW:function(s){return s===void 0&&(s=0),this.w=s,this},getLocalTransformMatrix:function(s){return s===void 0&&(s=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(s,l){s===void 0&&(s=new v);var f=this.parentContainer;if(!f)return this.getLocalTransformMatrix(s);for(l||(l=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);f;)l.applyITRS(f.x,f.y,f._rotation,f._scaleX,f._scaleY),l.multiply(s,s),f=f.parentContainer;return s},getLocalPoint:function(s,l,f,u){f||(f=new e),u||(u=this.scene.sys.cameras.main);var d=u.scrollX,p=u.scrollY,g=s+d*this.scrollFactorX-d,y=l+p*this.scrollFactorY-p;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(g,y,f):o(g,y,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 s=0,l=this.parentContainer;l;)s+=l.rotation,l=l.parentContainer;return s}};c.exports=h},61340:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(36383),o=t(26099),r=new a({initialize:function(e,i,h,s,l,f){e===void 0&&(e=1),i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=1),l===void 0&&(l=0),f===void 0&&(f=0),this.matrix=new Float32Array([e,i,h,s,l,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],i=n[1],h=n[2],s=n[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):h||s?v.TAU-(s>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 i=this.matrix;return i[4]=i[0]*n+i[2]*e+i[4],i[5]=i[1]*n+i[3]*e+i[5],this},scale:function(n,e){var i=this.matrix;return i[0]*=n,i[1]*=n,i[2]*=e,i[3]*=e,this},rotate:function(n){var e=Math.sin(n),i=Math.cos(n),h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3];return h[0]=s*i+f*e,h[1]=l*i+u*e,h[2]=s*-e+f*i,h[3]=l*-e+u*i,this},multiply:function(n,e){var i=this.matrix,h=n.matrix,s=i[0],l=i[1],f=i[2],u=i[3],d=i[4],p=i[5],g=h[0],y=h[1],x=h[2],T=h[3],C=h[4],M=h[5],w=e===void 0?i:e.matrix;return w[0]=g*s+y*f,w[1]=g*l+y*u,w[2]=x*s+T*f,w[3]=x*l+T*u,w[4]=C*s+M*f+d,w[5]=C*l+M*u+p,w},multiplyWithOffset:function(n,e,i){var h=this.matrix,s=n.matrix,l=h[0],f=h[1],u=h[2],d=h[3],p=h[4],g=h[5],y=e*l+i*u+p,x=e*f+i*d+g,T=s[0],C=s[1],M=s[2],w=s[3],L=s[4],F=s[5];return h[0]=T*l+C*u,h[1]=T*f+C*d,h[2]=M*l+w*u,h[3]=M*f+w*d,h[4]=L*l+F*u+y,h[5]=L*f+F*d+x,this},transform:function(n,e,i,h,s,l){var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5];return f[0]=n*u+e*p,f[1]=n*d+e*g,f[2]=i*u+h*p,f[3]=i*d+h*g,f[4]=s*u+l*p+y,f[5]=s*d+l*g+x,this},transformPoint:function(n,e,i){i===void 0&&(i={x:0,y:0});var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5];return i.x=n*s+e*f+d,i.y=n*l+e*u+p,i},invert:function(){var n=this.matrix,e=n[0],i=n[1],h=n[2],s=n[3],l=n[4],f=n[5],u=e*s-i*h;return n[0]=s/u,n[1]=-i/u,n[2]=-h/u,n[3]=e/u,n[4]=(h*f-s*l)/u,n[5]=-(e*f-i*l)/u,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,i,h,s,l){var f=this.matrix;return f[0]=n,f[1]=e,f[2]=i,f[3]=h,f[4]=s,f[5]=l,this},decomposeMatrix:function(){var n=this.decomposedMatrix,e=this.matrix,i=e[0],h=e[1],s=e[2],l=e[3],f=i*l-h*s;if(n.translateX=e[4],n.translateY=e[5],i||h){var u=Math.sqrt(i*i+h*h);n.rotation=h>0?Math.acos(i/u):-Math.acos(i/u),n.scaleX=u,n.scaleY=f/u}else if(s||l){var d=Math.sqrt(s*s+l*l);n.rotation=Math.PI*.5-(l>0?Math.acos(-s/d):-Math.acos(s/d)),n.scaleX=f/d,n.scaleY=d}else n.rotation=0,n.scaleX=0,n.scaleY=0;return n},applyITRS:function(n,e,i,h,s){var l=this.matrix,f=Math.sin(i),u=Math.cos(i);return l[4]=n,l[5]=e,l[0]=u*h,l[1]=f*h,l[2]=-f*s,l[3]=u*s,this},applyInverse:function(n,e,i){i===void 0&&(i=new o);var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5],g=1/(s*u+f*-l);return i.x=u*g*n+-f*g*e+(p*f-d*u)*g,i.y=s*g*e+-l*g*n+(-p*s+d*l)*g,i},setQuad:function(n,e,i,h,s,l){s===void 0&&(s=!1),l===void 0&&(l=this.quad);var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5];return s?(l[0]=Math.round(n*u+e*p+y),l[1]=Math.round(n*d+e*g+x),l[2]=Math.round(n*u+h*p+y),l[3]=Math.round(n*d+h*g+x),l[4]=Math.round(i*u+h*p+y),l[5]=Math.round(i*d+h*g+x),l[6]=Math.round(i*u+e*p+y),l[7]=Math.round(i*d+e*g+x)):(l[0]=n*u+e*p+y,l[1]=n*d+e*g+x,l[2]=n*u+h*p+y,l[3]=n*d+h*g+x,l[4]=i*u+h*p+y,l[5]=i*d+h*g+x,l[6]=i*u+e*p+y,l[7]=i*d+e*g+x),l},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,i){var h=this.getX(n,e);return i&&(h=Math.round(h)),h},getYRound:function(n,e,i){var h=this.getY(n,e);return i&&(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}});c.exports=r},59715:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=1,t={_visible:!0,visible:{get:function(){return this._visible},set:function(a){a?(this._visible=!0,this.renderFlags|=m):(this._visible=!1,this.renderFlags&=~m)}},setVisible:function(a){return this.visible=a,this}};c.exports=t},31401:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37105),v=t(10312),o=t(83419),r=t(31401),n=t(51708),e=t(95643),i=t(87841),h=t(29959),s=t(36899),l=t(26099),f=new o({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.ComputedSize,r.Depth,r.Mask,r.PostPipeline,r.Transform,r.Visible,h],initialize:function(d,p,g,y){e.call(this,d,"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=d.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(p,g),this.setBlendMode(v.SKIP_CHECK),y&&this.add(y)},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(u){return u===void 0&&(u=!0),this.exclusive=u,this},getBounds:function(u){if(u===void 0&&(u=new i),u.setTo(this.x,this.y,0,0),this.parentContainer){var d=this.parentContainer.getBoundsTransformMatrix(),p=d.transformPoint(this.x,this.y);u.setTo(p.x,p.y,0,0)}if(this.list.length>0){var g=this.list,y=new i,x=!1;u.setEmpty();for(var T=0;T-1},setAll:function(u,d,p,g){return a.SetAll(this.list,u,d,p,g),this},each:function(u,d){var p=[null],g,y=this.list.slice(),x=y.length;for(g=2;g0?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(u){a.Remove(this.list,u),this.exclusive&&(u.parentContainer=null,u.removedFromScene())}});c.exports=f},53584:c=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a);var r=a.list;if(r.length!==0){var n=a.localTransform;o?(n.loadIdentity(),n.multiply(o),n.translate(a.x,a.y),n.rotate(a.rotation),n.scale(a.scaleX,a.scaleY)):n.applyITRS(a.x,a.y,a.rotation,a.scaleX,a.scaleY);var e=a.blendMode!==-1;e||t.setBlendMode(0);var i=a._alpha,h=a.scrollFactorX,s=a.scrollFactorY;a.mask&&a.mask.preRenderCanvas(t,null,v);for(var l=0;l{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(31559),o=t(44603),r=t(23568),n=t(95540);o.register("container",function(e,i){e===void 0&&(e={});var h=r(e,"x",0),s=r(e,"y",0),l=n(e,"children",null),f=new v(this.scene,h,s,l);return i!==void 0&&(e.add=i),a(this.scene,f,e),f})},24961:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(31559),v=t(39429);v.register("container",function(o,r,n){return this.displayList.add(new a(this.scene,o,r,n))})},29959:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(72249),o=t(53584),c.exports={renderWebGL:v,renderCanvas:o}},72249:c=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a);var r=a.list,n=r.length;if(n!==0){var e=a.localTransform;o?(e.loadIdentity(),e.multiply(o),e.translate(a.x,a.y),e.rotate(a.rotation),e.scale(a.scaleX,a.scaleY)):e.applyITRS(a.x,a.y,a.rotation,a.scaleX,a.scaleY),t.pipelines.preBatch(a);var i=a.blendMode!==-1;i||t.setBlendMode(0);for(var h=a.alpha,s=a.scrollFactorX,l=a.scrollFactorY,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(441),r=t(95643),n=t(41212),e=t(35846),i=t(44594),h=t(61369),s=new a({Extends:r,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Origin,v.ScrollFactor,v.Transform,v.Visible,o],initialize:function(f,u,d,p,g,y){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(u,d),typeof p=="string"?p[0]==="#"?this.setElement(p.substr(1),g,y):this.createElement(p,g,y):p&&this.setElement(p,g,y),f.sys.events.on(i.SLEEP,this.handleSceneEvent,this),f.sys.events.on(i.WAKE,this.handleSceneEvent,this),f.sys.events.on(i.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(l){var f=this.node,u=f.style;f&&(u.display=l.settings.visible?"block":"none")},setSkew:function(l,f){return l===void 0&&(l=0),f===void 0&&(f=l),this.skewX=l,this.skewY=f,this},setPerspective:function(l){return this.parent.style.perspective=l+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(l){this.parent.style.perspective=l+"px"}},addListener:function(l){if(this.node){l=l.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 a=t(47407),v=t(95643),o=t(61340),r=new o,n=new o,e=new o,i=function(h,s,l,f){if(s.node){var u=s.node.style,d=s.scene.sys.settings;if(!u||!d.visible||v.RENDER_MASK!==s.renderFlags||s.cameraFilter!==0&&s.cameraFilter&l.id||s.parentContainer&&!s.parentContainer.willRender()){u.display="none";return}var p=s.parentContainer,g=l.alpha*s.alpha;p&&(g*=p.alpha);var y=r,x=n,T=e,C=0,M=0,w="0%",L="0%";f?(C=s.width*s.scaleX*s.originX,M=s.height*s.scaleY*s.originY,x.applyITRS(s.x-C,s.y-M,s.rotation,s.scaleX,s.scaleY),y.copyFrom(l.matrix),y.multiplyWithOffset(f,-l.scrollX*s.scrollFactorX,-l.scrollY*s.scrollFactorY),x.e=s.x-C,x.f=s.y-M,y.multiply(x,T)):(C=s.width*s.originX,M=s.height*s.originY,x.applyITRS(s.x-C,s.y-M,s.rotation,s.scaleX,s.scaleY),y.copyFrom(l.matrix),w=100*s.originX+"%",L=100*s.originY+"%",x.e-=l.scrollX*s.scrollFactorX,x.f-=l.scrollY*s.scrollFactorY,y.multiply(x,T)),s.transformOnly||(u.display="block",u.opacity=g,u.zIndex=s._depth,u.pointerEvents=s.pointerEvents,u.mixBlendMode=a[s._blendMode]),u.transform=T.getCSSMatrix()+" skew("+s.skewX+"rad, "+s.skewY+"rad) rotate3d("+s.rotate3d.x+","+s.rotate3d.y+","+s.rotate3d.z+","+s.rotate3d.w+s.rotate3dAngle+")",u.transformOrigin=w+" "+L}};c.exports=i},2611:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(3069),v=t(39429);v.register("dom",function(o,r,n,e,i){var h=new a(this.scene,o,r,n,e,i);return this.displayList.add(h),h})},441:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(49381),o=t(49381),c.exports={renderWebGL:v,renderCanvas:o}},62980:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="addedtoscene"},41337:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},44947:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="removedfromscene"},49358:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},35163:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="created"},97249:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="error"},19483:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="locked"},56059:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="loop"},26772:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="metadata"},64437:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="playing"},83411:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="play"},75780:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="seeked"},67799:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="seeking"},63500:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stalled"},55541:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stop"},53208:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="textureready"},4992:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="unlocked"},12:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="unsupported"},51708:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(64993),n=new a({Extends:o,Mixins:[v.Alpha,v.BlendMode,v.Depth,v.Flip,v.Origin,v.ScrollFactor,v.Size,v.Texture,v.Tint,v.Transform,v.Visible,r],initialize:function(i){o.call(this,i,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});c.exports=n},70217:()=>{},56315:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(42421),v=t(39429);v.register("extern",function(){var o=new a(this.scene);return this.displayList.add(o),o})},64993:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(80287),o=t(70217),c.exports={renderWebGL:v,renderCanvas:o}},80287:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=function(o,r,n,e){o.pipelines.clear();var i=a(r,n,e).calc;r.render.call(r,o,n,i),o.pipelines.rebind()};c.exports=v},85592:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(71911),v=t(83419),o=t(85592),r=t(31401),n=t(8497),e=t(95643),i=t(95540),h=t(35154),s=t(36383),l=t(84503),f=new v({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,l],initialize:function(d,p){var g=h(p,"x",0),y=h(p,"y",0);e.call(this,d,"Graphics"),this.setPosition(g,y),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(p)},setDefaultStyles:function(u){return h(u,"lineStyle",null)&&(this.defaultStrokeWidth=h(u,"lineStyle.width",1),this.defaultStrokeColor=h(u,"lineStyle.color",16777215),this.defaultStrokeAlpha=h(u,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),h(u,"fillStyle",null)&&(this.defaultFillColor=h(u,"fillStyle.color",16777215),this.defaultFillAlpha=h(u,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(u,d,p){return p===void 0&&(p=1),this.commandBuffer.push(o.LINE_STYLE,u,d,p),this._lineWidth=u,this},fillStyle:function(u,d){return d===void 0&&(d=1),this.commandBuffer.push(o.FILL_STYLE,u,d),this},fillGradientStyle:function(u,d,p,g,y,x,T,C){return y===void 0&&(y=1),x===void 0&&(x=y),T===void 0&&(T=y),C===void 0&&(C=y),this.commandBuffer.push(o.GRADIENT_FILL_STYLE,y,x,T,C,u,d,p,g),this},lineGradientStyle:function(u,d,p,g,y,x){return x===void 0&&(x=1),this.commandBuffer.push(o.GRADIENT_LINE_STYLE,u,x,d,p,g,y),this},beginPath:function(){return this.commandBuffer.push(o.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(o.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(o.FILL_PATH),this},fill:function(){return this.commandBuffer.push(o.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(o.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(o.STROKE_PATH),this},fillCircleShape:function(u){return this.fillCircle(u.x,u.y,u.radius)},strokeCircleShape:function(u){return this.strokeCircle(u.x,u.y,u.radius)},fillCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.fillPath(),this},strokeCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.strokePath(),this},fillRectShape:function(u){return this.fillRect(u.x,u.y,u.width,u.height)},strokeRectShape:function(u){return this.strokeRect(u.x,u.y,u.width,u.height)},fillRect:function(u,d,p,g){return this.commandBuffer.push(o.FILL_RECT,u,d,p,g),this},strokeRect:function(u,d,p,g){var y=this._lineWidth/2,x=u-y,T=u+y;return this.beginPath(),this.moveTo(u,d),this.lineTo(u,d+g),this.strokePath(),this.beginPath(),this.moveTo(u+p,d),this.lineTo(u+p,d+g),this.strokePath(),this.beginPath(),this.moveTo(x,d),this.lineTo(T+p,d),this.strokePath(),this.beginPath(),this.moveTo(x,d+g),this.lineTo(T+p,d+g),this.strokePath(),this},fillRoundedRect:function(u,d,p,g,y){y===void 0&&(y=20);var x=y,T=y,C=y,M=y;typeof y!="number"&&(x=i(y,"tl",20),T=i(y,"tr",20),C=i(y,"bl",20),M=i(y,"br",20));var w=x>=0,L=T>=0,F=C>=0,O=M>=0;return x=Math.abs(x),T=Math.abs(T),C=Math.abs(C),M=Math.abs(M),this.beginPath(),this.moveTo(u+x,d),this.lineTo(u+p-T,d),L?this.arc(u+p-T,d+T,T,-s.TAU,0):this.arc(u+p,d,T,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),O?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+C,d+g),F?this.arc(u+C,d+g-C,C,s.TAU,Math.PI):this.arc(u,d+g,C,0,-s.TAU,!0),this.lineTo(u,d+x),w?this.arc(u+x,d+x,x,-Math.PI,-s.TAU):this.arc(u,d,x,s.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(u,d,p,g,y){y===void 0&&(y=20);var x=y,T=y,C=y,M=y,w=Math.min(p,g)/2;typeof y!="number"&&(x=i(y,"tl",20),T=i(y,"tr",20),C=i(y,"bl",20),M=i(y,"br",20));var L=x>=0,F=T>=0,O=C>=0,N=M>=0;return x=Math.min(Math.abs(x),w),T=Math.min(Math.abs(T),w),C=Math.min(Math.abs(C),w),M=Math.min(Math.abs(M),w),this.beginPath(),this.moveTo(u+x,d),this.lineTo(u+p-T,d),this.moveTo(u+p-T,d),F?this.arc(u+p-T,d+T,T,-s.TAU,0):this.arc(u+p,d,T,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),this.moveTo(u+p,d+g-M),N?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+C,d+g),this.moveTo(u+C,d+g),O?this.arc(u+C,d+g-C,C,s.TAU,Math.PI):this.arc(u,d+g,C,0,-s.TAU,!0),this.lineTo(u,d+x),this.moveTo(u,d+x),L?this.arc(u+x,d+x,x,-Math.PI,-s.TAU):this.arc(u,d,x,s.TAU,0,!0),this.strokePath(),this},fillPointShape:function(u,d){return this.fillPoint(u.x,u.y,d)},fillPoint:function(u,d,p){return!p||p<1?p=1:(u-=p/2,d-=p/2),this.commandBuffer.push(o.FILL_RECT,u,d,p,p),this},fillTriangleShape:function(u){return this.fillTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},strokeTriangleShape:function(u){return this.strokeTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},fillTriangle:function(u,d,p,g,y,x){return this.commandBuffer.push(o.FILL_TRIANGLE,u,d,p,g,y,x),this},strokeTriangle:function(u,d,p,g,y,x){return this.commandBuffer.push(o.STROKE_TRIANGLE,u,d,p,g,y,x),this},strokeLineShape:function(u){return this.lineBetween(u.x1,u.y1,u.x2,u.y2)},lineBetween:function(u,d,p,g){return this.beginPath(),this.moveTo(u,d),this.lineTo(p,g),this.strokePath(),this},lineTo:function(u,d){return this.commandBuffer.push(o.LINE_TO,u,d),this},moveTo:function(u,d){return this.commandBuffer.push(o.MOVE_TO,u,d),this},strokePoints:function(u,d,p,g){d===void 0&&(d=!1),p===void 0&&(p=!1),g===void 0&&(g=u.length),this.beginPath(),this.moveTo(u[0].x,u[0].y);for(var y=1;y-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(u,d,p){var g=this.scene.sys,y=g.game.renderer;d===void 0&&(d=g.scale.width),p===void 0&&(p=g.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,d,p),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var x,T,C={willReadFrequently:!0};if(typeof u=="string")if(g.textures.exists(u)){x=g.textures.get(u);var M=x.getSourceImage();M instanceof HTMLCanvasElement&&(T=M.getContext("2d",C))}else x=g.textures.createCanvas(u,d,p),T=x.getSourceImage().getContext("2d",C);else u instanceof HTMLCanvasElement&&(T=u.getContext("2d",C));return T&&(this.renderCanvas(y,this,f.TargetCamera,null,T,!1),x&&x.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new a,c.exports=f},32768:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(85592),v=t(20926),o=function(r,n,e,i,h,s){var l=n.commandBuffer,f=l.length,u=h||r.currentContext;if(!(f===0||!v(r,u,n,e,i))){e.addToRenderList(n);var d=1,p=1,g=0,y=0,x=1,T=0,C=0,M=0;u.beginPath();for(var w=0;w>>16,C=(g&65280)>>>8,M=g&255,u.strokeStyle="rgba("+T+","+C+","+M+","+d+")",u.lineWidth=x,w+=3;break;case a.FILL_STYLE:y=l[w+1],p=l[w+2],T=(y&16711680)>>>16,C=(y&65280)>>>8,M=y&255,u.fillStyle="rgba("+T+","+C+","+M+","+p+")",w+=2;break;case a.BEGIN_PATH:u.beginPath();break;case a.CLOSE_PATH:u.closePath();break;case a.FILL_PATH:s||u.fill();break;case a.STROKE_PATH:s||u.stroke();break;case a.FILL_RECT:s?u.rect(l[w+1],l[w+2],l[w+3],l[w+4]):u.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case a.FILL_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.fill(),w+=6;break;case a.STROKE_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.stroke(),w+=6;break;case a.LINE_TO:u.lineTo(l[w+1],l[w+2]),w+=2;break;case a.MOVE_TO:u.moveTo(l[w+1],l[w+2]),w+=2;break;case a.LINE_FX_TO:u.lineTo(l[w+1],l[w+2]),w+=5;break;case a.MOVE_FX_TO:u.moveTo(l[w+1],l[w+2]),w+=5;break;case a.SAVE:u.save();break;case a.RESTORE:u.restore();break;case a.TRANSLATE:u.translate(l[w+1],l[w+2]),w+=2;break;case a.SCALE:u.scale(l[w+1],l[w+2]),w+=2;break;case a.ROTATE:u.rotate(l[w+1]),w+=1;break;case a.GRADIENT_FILL_STYLE:w+=5;break;case a.GRADIENT_LINE_STYLE:w+=6;break}}u.restore()}};c.exports=o},87079:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(44603),v=t(43831);a.register("graphics",function(o,r){o===void 0&&(o={}),r!==void 0&&(o.add=r);var n=new v(this.scene,o);return o.add&&this.scene.sys.displayList.add(n),n})},1201:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43831),v=t(39429);v.register("graphics",function(o){return this.displayList.add(new a(this.scene,o))})},84503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(77545),o=t(32768),o=t(32768),c.exports={renderWebGL:v,renderCanvas:o}},77545:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(85592),v=t(91296),o=t(61340),r=t(70554),n=function(l,f,u){this.x=l,this.y=f,this.width=u},e=function(l,f,u){this.points=[],this.pointsLength=1,this.points[0]=new n(l,f,u)},i=[],h=new o,s=function(l,f,u,d){if(f.commandBuffer.length!==0){u.addToRenderList(f);var p=l.pipelines.set(f.pipeline,f);l.pipelines.preBatch(f);for(var g=v(f,u,d).calc,y=h.loadIdentity(),x=f.commandBuffer,T=u.alpha*f.alpha,C=1,M=p.fillTint,w=p.strokeTint,L=0,F=0,O=0,N=.01,G=Math.PI*2,V,j=[],K=0,J=!0,X=null,Y=r.getTintAppendFloatAlpha,D=0;D0&&(vt=-G+vt%G):vt>G?vt=G:vt<0&&(vt=G+vt%G),X===null&&(X=new e(pt+Math.cos(Et)*Ct,Pt+Math.sin(Et)*Ct,C),j.push(X),at+=N);at<1+gt;)O=vt*at+Et,L=pt+Math.cos(O)*Ct,F=Pt+Math.sin(O)*Ct,X.points.push(new n(L,F,C)),at+=N;O=vt+Et,L=pt+Math.cos(O)*Ct,F=Pt+Math.sin(O)*Ct,X.points.push(new n(L,F,C));break}case a.FILL_RECT:{p.batchFillRect(x[++D],x[++D],x[++D],x[++D],y,g);break}case a.FILL_TRIANGLE:{p.batchFillTriangle(x[++D],x[++D],x[++D],x[++D],x[++D],x[++D],y,g);break}case a.STROKE_TRIANGLE:{p.batchStrokeTriangle(x[++D],x[++D],x[++D],x[++D],x[++D],x[++D],C,y,g);break}case a.LINE_TO:{X!==null?X.points.push(new n(x[++D],x[++D],C)):(X=new e(x[++D],x[++D],C),j.push(X));break}case a.MOVE_TO:{X=new e(x[++D],x[++D],C),j.push(X);break}case a.SAVE:{i.push(y.copyToArray());break}case a.RESTORE:{y.copyFromArray(i.pop());break}case a.TRANSLATE:{pt=x[++D],Pt=x[++D],y.translate(pt,Pt);break}case a.SCALE:{pt=x[++D],Pt=x[++D],y.scale(pt,Pt);break}case a.ROTATE:{y.rotate(x[++D]);break}}l.pipelines.postBatch(f)}};c.exports=s},26479:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61061),v=t(83419),o=t(51708),r=t(50792),n=t(46710),e=t(95540),i=t(35154),h=t(97022),s=t(41212),l=t(88492),f=t(35072),u=t(68287),d=new v({Extends:r,initialize:function(g,y,x){r.call(this),x?y&&!Array.isArray(y)&&(y=[y]):Array.isArray(y)?s(y[0])&&(x=y,y=null):s(y)&&(x=y,y=null),this.scene=g,this.children=new f,this.isParent=!0,this.type="Group",this.classType=e(x,"classType",u),this.name=e(x,"name",""),this.active=e(x,"active",!0),this.maxSize=e(x,"maxSize",-1),this.defaultKey=e(x,"defaultKey",null),this.defaultFrame=e(x,"defaultFrame",null),this.runChildUpdate=e(x,"runChildUpdate",!1),this.createCallback=e(x,"createCallback",null),this.removeCallback=e(x,"removeCallback",null),this.createMultipleCallback=e(x,"createMultipleCallback",null),this.internalCreateCallback=e(x,"internalCreateCallback",null),this.internalRemoveCallback=e(x,"internalRemoveCallback",null),y&&this.addMultiple(y),x&&this.createMultiple(x),this.on(o.ADDED_TO_SCENE,this.addedToScene,this),this.on(o.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(p,g,y,x,T,C){if(p===void 0&&(p=0),g===void 0&&(g=0),y===void 0&&(y=this.defaultKey),x===void 0&&(x=this.defaultFrame),T===void 0&&(T=!0),C===void 0&&(C=!0),this.isFull())return null;var M=new this.classType(this.scene,p,g,y,x);return M.addToDisplayList(this.scene.sys.displayList),M.addToUpdateList(),M.visible=T,M.setActive(C),this.add(M),M},createMultiple:function(p){if(this.isFull())return[];Array.isArray(p)||(p=[p]);var g=[];if(p[0].key)for(var y=0;y=0;O--)if(F=G[O],F.active===y){if(N++,N===g)break}else F=null;return F?(typeof T=="number"&&(F.x=T),typeof C=="number"&&(F.y=C),F):x?this.create(T,C,M,w,L):null},get:function(p,g,y,x,T){return this.getFirst(!1,!0,p,g,y,x,T)},getFirstAlive:function(p,g,y,x,T,C){return this.getFirst(!0,p,g,y,x,T,C)},getFirstDead:function(p,g,y,x,T,C){return this.getFirst(!1,p,g,y,x,T,C)},playAnimation:function(p,g){return a.PlayAnimation(this.children.entries,p,g),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(p){p===void 0&&(p=!0);for(var g=0,y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(44603),v=t(26479);a.register("group",function(o){return new v(this.scene,null,o)})},3385:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26479),v=t(39429);v.register("group",function(o,r){return this.updateList.add(new a(this.scene,o,r))})},88571:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(59819),n=new a({Extends:o,Mixins:[v.Alpha,v.BlendMode,v.Depth,v.Flip,v.GetBounds,v.Mask,v.Origin,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Size,v.TextureCrop,v.Tint,v.Transform,v.Visible,r],initialize:function(i,h,s,l,f){o.call(this,i,"Image"),this._crop=this.resetCropObject(),this.setTexture(l,f),this.setPosition(h,s),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=n},40652:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a),t.batchSprite(a,a.frame,v,o)};c.exports=m},82459:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(88571);v.register("image",function(n,e){n===void 0&&(n={});var i=o(n,"key",null),h=o(n,"frame",null),s=new r(this.scene,0,0,i,h);return e!==void 0&&(n.add=e),a(this.scene,s,n),s})},2117:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(88571),v=t(39429);v.register("image",function(o,r,n,e){return this.displayList.add(new a(this.scene,o,r,n,e))})},59819:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(99517),o=t(40652),c.exports={renderWebGL:v,renderCanvas:o}},99517:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a),this.pipeline.batchSprite(a,v,o)};c.exports=m},77856:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={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)}};a.Shader=t(20071),a.Mesh=t(4703),a.NineSlice=t(28103),a.PointLight=t(80321),a.Plane=t(33663),a.Factories.Shader=t(74177),a.Factories.Mesh=t(9225),a.Factories.NineSlice=t(47521),a.Factories.PointLight=t(71255),a.Factories.Plane=t(30985),a.Creators.Shader=t(54935),a.Creators.Mesh=t(20527),a.Creators.NineSlice=t(28279),a.Creators.PointLight=t(39829),a.Creators.Plane=t(56015),a.Light=t(41432),a.LightsManager=t(61356),a.LightsPlugin=t(88992),c.exports=a},93595:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(83419),o=t(31401),r=t(53774),n=t(45893),e=t(50792),i=t(51708),h=t(73162),s=t(33963),l=t(44594),f=t(19186),u=new v({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.Depth,o.Mask,o.PostPipeline,o.Visible,e,s],initialize:function(p,g){h.call(this,p),e.call(this),this.scene=p,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=p.sys,this.events=p.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(a.SKIP_CHECK),g&&this.add(g),p.sys.queueDepthSort()},setActive:function(d){return this.active=d,this},setName:function(d){return this.name=d,this},setState:function(d){return this.state=d,this},setDataEnabled:function(){return this.data||(this.data=new n(this)),this},setData:function(d,p){return this.data||(this.data=new n(this)),this.data.set(d,p),this},incData:function(d,p){return this.data||(this.data=new n(this)),this.data.inc(d,p),this},toggleData:function(d){return this.data||(this.data=new n(this)),this.data.toggle(d),this},getData:function(d){return this.data||(this.data=new n(this)),this.data.get(d)},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(d){return!(this.renderFlags!==15||this.list.length===0||this.cameraFilter!==0&&this.cameraFilter&d.id)},getIndexList:function(){for(var d=this,p=this.parentContainer,g=[];p&&(g.unshift(p.getIndex(d)),d=p,p.parentContainer);)p=p.parentContainer;return g.unshift(this.displayList.getIndex(d)),g},addChildCallback:function(d){var p=d.displayList;p&&p!==this&&d.removeFromDisplayList(),d.displayList||(this.queueDepthSort(),d.displayList=this,d.emit(i.ADDED_TO_SCENE,d,this.scene),this.events.emit(l.ADDED_TO_SCENE,d,this.scene))},removeChildCallback:function(d){this.queueDepthSort(),d.displayList=null,d.emit(i.REMOVED_FROM_SCENE,d,this.scene),this.events.emit(l.REMOVED_FROM_SCENE,d,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(d,p){return d._depth-p._depth},getChildren:function(){return this.list},addToDisplayList:function(d){return d===void 0&&(d=this.scene.sys.displayList),this.displayList&&this.displayList!==d&&this.removeFromDisplayList(),d.exists(this)||(this.displayList=d,d.add(this,!0),d.queueDepthSort(),this.emit(i.ADDED_TO_SCENE,this,this.scene),d.events.emit(l.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var d=this.displayList||this.scene.sys.displayList;return d.exists(this)&&(d.remove(this,!0),d.queueDepthSort(),this.displayList=null,this.emit(i.REMOVED_FROM_SCENE,this,this.scene),d.events.emit(l.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(d){if(!(!this.scene||this.ignoreDestroy)){this.emit(i.DESTROY,this);for(var p=this.list;p.length;)p[0].destroy(d);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}}});c.exports=u},2956:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=a.list;if(o.length!==0){a.depthSort();var r=a.blendMode!==-1;r||t.setBlendMode(0);var n=a._alpha;a.mask&&a.mask.preRenderCanvas(t,null,v);for(var e=0;e{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(93595),o=t(44603),r=t(23568);o.register("layer",function(n,e){n===void 0&&(n={});var i=r(n,"children",null),h=new v(this.scene,i);return e!==void 0&&(n.add=e),a(this.scene,h,n),h})},20005:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(93595),v=t(39429);v.register("layer",function(o){return this.displayList.add(new a(this.scene,o))})},33963:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(15869),o=t(2956),c.exports={renderWebGL:v,renderCanvas:o}},15869:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=a.list,r=o.length;if(r!==0){a.depthSort(),t.pipelines.preBatch(a);var n=a.blendMode!==-1;n||t.setBlendMode(0);for(var e=a.alpha,i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(96503),v=t(83419),o=t(31401),r=t(51767),n=t(70554),e=new v({Extends:a,Mixins:[o.Origin,o.ScrollFactor,o.Visible],initialize:function(h,s,l,f,u,d,p){a.call(this,h,s,l),this.color=new r(f,u,d),this.intensity=p,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(l)},displayWidth:{get:function(){return this.diameter},set:function(i){this.diameter=i}},displayHeight:{get:function(){return this.diameter},set:function(i){this.diameter=i}},width:{get:function(){return this.diameter},set:function(i){this.diameter=i}},height:{get:function(){return this.diameter},set:function(i){this.diameter=i}},willRender:function(i){return!(e.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&i.id)},setColor:function(i){var h=n.getFloatsFromUintRGB(i);return this.color.set(h[0],h[1],h[2]),this},setIntensity:function(i){return this.intensity=i,this},setRadius:function(i){return this.radius=i,this}});e.RENDER_MASK=15,c.exports=e},61356:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(81491),v=t(83419),o=t(20339),r=t(41432),n=t(80321),e=t(51767),i=t(19133),h=t(19186),s=t(70554),l=new v({initialize:function(){this.lights=[],this.ambientColor=new e(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(f,u,d,p,g,y){return this.systems.displayList.add(new n(this.scene,f,u,d,p,g,y))},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 u=this.lights,d=f.worldView,p=[],g=0;gthis.maxLights&&(h(p,this.sortByDistance),p=p.slice(0,this.maxLights)),this.visibleLights=p.length,p},sortByDistance:function(f,u){return f.distance>=u.distance},setAmbientColor:function(f){var u=s.getFloatsFromUintRGB(f);return this.ambientColor.set(u[0],u[1],u[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=16777215),g===void 0&&(g=1);var y=s.getFloatsFromUintRGB(p),x=new r(f,u,d,y[0],y[1],y[2],g);return this.lights.push(x),x},removeLight:function(f){var u=this.lights.indexOf(f);return u>=0&&i(this.lights,u),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});c.exports=l},88992:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(61356),o=t(37277),r=t(44594),n=new a({Extends:v,initialize:function(i){this.scene=i,this.systems=i.sys,i.sys.settings.isBooted||i.sys.events.once(r.BOOT,this.boot,this),v.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}});o.register("LightsPlugin",n,"lights"),c.exports=n},4703:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(39506),r=t(83997),n=t(95643),e=t(34684),i=t(92515),h=t(91296),s=t(37867),l=t(29807),f=t(43396),u=t(19186),d=t(25836),p=t(39318),g=new a({Extends:n,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Size,v.Texture,v.Transform,v.Visible,l],initialize:function(x,T,C,M,w,L,F,O,N,G,V,j){T===void 0&&(T=0),C===void 0&&(C=0),M===void 0&&(M="__WHITE"),n.call(this,x,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new d,this.modelScale=new d(1,1,1),this.modelRotation=new d,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new s,this.viewPosition=new d,this.viewMatrix=new s,this.projectionMatrix=new s,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var K=x.sys.renderer;this.setPosition(T,C),this.setTexture(M,w),this.setSize(K.width,K.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(K.width,K.height),L&&this.addVertices(L,F,O,N,G,V,j)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(y){return this.viewPosition.addScale(d.LEFT,y),this.dirtyCache[10]=1,this},panY:function(y){return this.viewPosition.y+=d.DOWN.y*y,this.dirtyCache[10]=1,this},panZ:function(y){return this.viewPosition.z+=y,this.dirtyCache[10]=1,this},setPerspective:function(y,x,T,C,M){return T===void 0&&(T=45),C===void 0&&(C=.01),M===void 0&&(M=1e3),this.fov=T,this.projectionMatrix.perspective(o(T),y/x,C,M),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(y,x,T,C){return y===void 0&&(y=this.scene.sys.renderer.getAspectRatio()),x===void 0&&(x=1),T===void 0&&(T=-1e3),C===void 0&&(C=1e3),this.fov=0,this.projectionMatrix.ortho(-y,y,-x,x,T,C),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(y){y.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(y,x,T,C,M,w,L,F,O){var N=this.scene.sys.cache.obj.get(y),G;return N&&(G=e(N,this,x,T,C,M,w,L,F,O)),(!G||G.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",y),this},sortByDepth:function(y,x){return y.depth-x.depth},depthSort:function(){return u(this.faces,this.sortByDepth),this},addVertex:function(y,x,T,C,M,w,L){var F=new p(y,x,T,C,M,w,L);return this.vertices.push(F),F},addFace:function(y,x,T){var C=new r(y,x,T);return this.faces.push(C),this.dirtyCache[9]=-1,C},addVertices:function(y,x,T,C,M,w,L){var F=i(y,x,T,C,M,w,L);return F?(this.faces=this.faces.concat(F.faces),this.vertices=this.vertices.concat(F.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(y){return this.faces[y]},hasFaceAt:function(y,x,T){T===void 0&&(T=this.scene.sys.cameras.main);for(var C=h(this,T).calc,M=this.faces,w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(){};c.exports=m},20527:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(35154),n=t(4703);v.register("mesh",function(e,i){e===void 0&&(e={});var h=o(e,"key",null),s=o(e,"frame",null),l=r(e,"vertices",[]),f=r(e,"uvs",[]),u=r(e,"indicies",[]),d=r(e,"containsZ",!1),p=r(e,"normals",[]),g=r(e,"colors",16777215),y=r(e,"alphas",1),x=new n(this.scene,0,0,h,s,l,f,u,d,p,g,y);return i!==void 0&&(e.add=i),a(this.scene,x,e),x})},9225:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(4703),v=t(39429);v.register("mesh",function(o,r,n,e,i,h,s,l,f,u,d){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s,l,f,u,d))})},29807:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(48833),o=t(36488),c.exports={renderWebGL:v,renderCanvas:o}},48833:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=function(o,r,n,e){var i=r.faces,h=i.length;if(h!==0){n.addToRenderList(r);var s=o.pipelines.set(r.pipeline,r),l=a(r,n,e).calc;o.pipelines.preBatch(r);for(var f=s.setGameObject(r),u=s.vertexViewF32,d=s.vertexViewU32,p=s.vertexCount*s.currentShader.vertexComponentCount-1,g=r.tintFill,y=[],x=r.debugCallback,T=l.a,C=l.b,M=l.c,w=l.d,L=l.e,F=l.f,O=r.viewPosition.z,N=r.hideCCW,G=n.roundPixels,V=n.alpha*r.alpha,j=0,K=0;K{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(78023),n=t(39318),e=new a({Extends:o,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.GetBounds,v.Mask,v.Origin,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,r],initialize:function(h,s,l,f,u,d,p,g,y,x,T){o.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 C=h.textures.getFrame(f,u);this.is3Slice=!x&&!T,C.scale9&&(this.is3Slice=C.is3Slice);for(var M=this.is3Slice?18:54,w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(35154),n=t(28103);v.register("nineslice",function(e,i){e===void 0&&(e={});var h=o(e,"key",null),s=o(e,"frame",null),l=r(e,"width",256),f=r(e,"height",256),u=r(e,"leftWidth",10),d=r(e,"rightWidth",10),p=r(e,"topHeight",0),g=r(e,"bottomHeight",0),y=new n(this.scene,0,0,h,s,l,f,u,d,p,g);return i!==void 0&&(e.add=i),a(this.scene,y,e),y})},47521:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(28103),v=t(39429);v.register("nineslice",function(o,r,n,e,i,h,s,l,f,u){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s,l,f,u))})},78023:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(52230),c.exports={renderWebGL:v,renderCanvas:o}},52230:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){var h=n.vertices,s=h.length;if(s!==0){e.addToRenderList(n);var l=r.pipelines.set(n.pipeline,n),f=a(n,e,i,!1).calc;r.pipelines.preBatch(n);var u=l.setGameObject(n),d=l.vertexViewF32,p=l.vertexViewU32,g=l.vertexCount*l.currentShader.vertexComponentCount-1,y=e.roundPixels,x=n.tintFill,T=e.alpha*n.alpha,C=v.getTintAppendFloatAlpha(n.tint,T),M=l.vertexAvailable(),w=-1;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(44777),o=t(37589),r=t(6113),n=t(91389),e=t(90664),i=new a({Extends:v,initialize:function(s){v.call(this,s,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,s=h,l=this.defaultEmit,f=this.defaultUpdate;if(this.method===9){this.start=h[0],this.ease=r("Linear"),this.interpolation=n("linear"),l=this.easedValueEmit,f=this.easeValueUpdate,s=h[0],this.active=!0;for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(30976),v=t(45319),o=t(83419),r=t(99472),n=t(6113),e=t(95540),i=t(91389),h=t(77720),s=t(15994),l=new o({initialize:function(u,d,p){p===void 0&&(p=!1),this.propertyKey=u,this.propertyValue=d,this.defaultValue=d,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=p,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(f,u){f===void 0&&(f={}),u&&(this.propertyKey=u),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 u;switch(this.method){case 1:case 3:case 8:u=f;break;case 2:this.propertyValue.indexOf(f)>=0&&(u=f);break;case 4:var d=(this.end-this.start)/this.steps;u=h(f,d),this.counter=u;break;case 5:case 6:case 7:u=v(f,this.start,this.end);break;case 9:u=this.start[0];break}return this.current=u,this},getMethod:function(){var f=this.propertyValue;if(f===null)return 0;var u=typeof f;if(u==="number")return 1;if(Array.isArray(f))return 2;if(u==="function")return 3;if(u==="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,u=f,d=this.defaultEmit,p=this.defaultUpdate;switch(this.method){case 1:d=this.staticValueEmit;break;case 2:d=this.randomStaticValueEmit,u=f[0];break;case 3:this._onEmit=f,d=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,d=this.steppedEmit,u=this.start;break;case 5:this.start=f.start,this.end=f.end;var g=this.has(f,"ease")?f.ease:"Linear";this.ease=n(g,f.easeParams),d=this.has(f,"random")&&f.random?this.randomRangedValueEmit:this.easedValueEmit,p=this.easeValueUpdate,u=this.start;break;case 6:this.start=f.min,this.end=f.max,d=this.has(f,"int")&&f.int?this.randomRangedIntEmit:this.randomRangedValueEmit,u=this.start;break;case 7:var y=f.random;Array.isArray(y)&&(this.start=y[0],this.end=y[1]),d=this.randomRangedIntEmit,u=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,d=this.proxyEmit,p=this.proxyUpdate;break;case 9:this.start=f.values;var x=this.has(f,"ease")?f.ease:"Linear";this.ease=n(x,f.easeParams),this.interpolation=i(f.interpolation),d=this.easedValueEmit,p=this.easeValueUpdate,u=this.start[0];break}return this.onEmit=d,this.onUpdate=p,this.current=u,this},has:function(f,u){return f.hasOwnProperty(u)},hasBoth:function(f,u,d){return f.hasOwnProperty(u)&&f.hasOwnProperty(d)},hasEither:function(f,u,d){return f.hasOwnProperty(u)||f.hasOwnProperty(d)},defaultEmit:function(f,u,d){return d},defaultUpdate:function(f,u,d,p){return p},proxyEmit:function(f,u,d){var p=this._onEmit(f,u,d);return this.current=p,p},proxyUpdate:function(f,u,d,p){var g=this._onUpdate(f,u,d,p);return this.current=g,g},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,u){var d=r(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},randomRangedIntEmit:function(f,u){var d=a(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},steppedEmit:function(){var f=this.counter,u=f,d=(this.end-this.start)/this.steps;if(this.yoyo){var p;this.direction===0?(u+=d,u>=this.end&&(p=u-this.end,u=this.end-p,this.direction=1)):(u-=d,u<=this.start&&(p=this.start-u,u=this.start+p,this.direction=0)),this.counter=u}else this.counter=s(u+d,this.start,this.end);return this.current=f,f},easedValueEmit:function(f,u){if(f&&f.data[u]){var d=f.data[u];d.min=this.start,d.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(f,u,d){var p=f.data[u],g,y=this.ease(d);return this.interpolation?g=this.interpolation(this.start,y):g=(p.max-p.min)*y+p.min,this.current=g,g},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});c.exports=l},24502:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(20286),r=new a({Extends:o,initialize:function(e,i,h,s,l){if(typeof e=="object"){var f=e;e=v(f,"x",0),i=v(f,"y",0),h=v(f,"power",0),s=v(f,"epsilon",100),l=v(f,"gravity",50)}else e===void 0&&(e=0),i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=100),l===void 0&&(l=50);o.call(this,e,i,!0),this._gravity=l,this._power=h*l,this._epsilon=s*s},update:function(n,e){var i=this.x-n.x,h=this.y-n.y,s=i*i+h*h;if(s!==0){var l=Math.sqrt(s);s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(9674),v=t(45319),o=t(83419),r=t(39506),n=t(87841),e=t(11520),i=t(26099),h=new o({initialize:function(l){this.emitter=l,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new i,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=l.scene,this.anims=new a(this),this.bounds=new n},emit:function(s,l,f,u,d,p){return this.emitter.emit(s,l,f,u,d,p)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(s,l){s===void 0&&(s=0),l===void 0&&(l=0),this.x=s,this.y=l},fire:function(s,l){var f=this.emitter,u=f.ops,d=f.getAnim();if(d?this.anims.play(d):(this.frame=f.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(f.getEmitZone(this),s===void 0?this.x+=u.x.onEmit(this,"x"):u.x.steps>0?this.x+=s+u.x.onEmit(this,"x"):this.x+=s,l===void 0?this.y+=u.y.onEmit(this,"y"):u.y.steps>0?this.y+=l+u.y.onEmit(this,"y"):this.y+=l,this.life=u.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=u.delay.onEmit(this,"delay"),this.holdCurrent=u.hold.onEmit(this,"hold"),this.scaleX=u.scaleX.onEmit(this,"scaleX"),this.scaleY=u.scaleY.active?u.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=u.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 p=u.speedX.onEmit(this,"speedX"),g=u.speedY.active?u.speedY.onEmit(this,"speedY"):p;if(f.radial){var y=r(u.angle.onEmit(this,"angle"));this.velocityX=Math.cos(y)*Math.abs(p),this.velocityY=Math.sin(y)*Math.abs(g)}else if(f.moveTo){var x=u.moveToX.onEmit(this,"moveToX"),T=u.moveToY.onEmit(this,"moveToY"),C=this.life/1e3;this.velocityX=(x-this.x)/C,this.velocityY=(T-this.y)/C}else this.velocityX=p,this.velocityY=g;return f.acceleration&&(this.accelerationX=u.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=u.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=u.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=u.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=u.bounce.onEmit(this,"bounce"),this.alpha=u.alpha.onEmit(this,"alpha"),u.color.active?this.tint=u.color.onEmit(this,"tint"):this.tint=u.tint.onEmit(this,"tint"),!0},update:function(s,l,f){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=s,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=s,!1;this.anims.update(0,s);var u=this.emitter,d=u.ops,p=1-this.lifeCurrent/this.life;if(this.lifeT=p,this.x=d.x.onUpdate(this,"x",p,this.x),this.y=d.y.onUpdate(this,"y",p,this.y),u.moveTo){var g=d.moveToX.onUpdate(this,"moveToX",p,u.moveToX),y=d.moveToY.onUpdate(this,"moveToY",p,u.moveToY),x=this.lifeCurrent/1e3;this.velocityX=(g-this.x)/x,this.velocityY=(y-this.y)/x}return this.computeVelocity(u,s,l,f,p),this.scaleX=d.scaleX.onUpdate(this,"scaleX",p,this.scaleX),d.scaleY.active?this.scaleY=d.scaleY.onUpdate(this,"scaleY",p,this.scaleY):this.scaleY=this.scaleX,this.angle=d.rotate.onUpdate(this,"rotate",p,this.angle),this.rotation=r(this.angle),u.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=v(d.alpha.onUpdate(this,"alpha",p,this.alpha),0,1),d.color.active?this.tint=d.color.onUpdate(this,"color",p,this.tint):this.tint=d.tint.onUpdate(this,"tint",p,this.tint),this.lifeCurrent-=s,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(s,l,f,u,d){var p=s.ops,g=this.velocityX,y=this.velocityY,x=p.accelerationX.onUpdate(this,"accelerationX",d,this.accelerationX),T=p.accelerationY.onUpdate(this,"accelerationY",d,this.accelerationY),C=p.maxVelocityX.onUpdate(this,"maxVelocityX",d,this.maxVelocityX),M=p.maxVelocityY.onUpdate(this,"maxVelocityY",d,this.maxVelocityY);this.bounce=p.bounce.onUpdate(this,"bounce",d,this.bounce),g+=s.gravityX*f+x*f,y+=s.gravityY*f+T*f,g=v(g,-C,C),y=v(y,-M,M),this.velocityX=g,this.velocityY=y,this.x+=g*f,this.y+=y*f,s.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(20286),o=t(87841),r=new a({Extends:v,initialize:function(e,i,h,s,l,f,u,d){l===void 0&&(l=!0),f===void 0&&(f=!0),u===void 0&&(u=!0),d===void 0&&(d=!0),v.call(this,e,i,!0),this.bounds=new o(e,i,h,s),this.collideLeft=l,this.collideRight=f,this.collideTop=u,this.collideBottom=d},update:function(n){var e=this.bounds,i=-n.bounce,h=n.worldPosition;h.xe.right&&this.collideRight&&(n.x-=h.x-e.right,n.velocityX*=i),h.ye.bottom&&this.collideBottom&&(n.y-=h.y-e.bottom,n.velocityY*=i)}});c.exports=r},31600:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(53774),r=t(43459),n=t(26388),e=t(19909),i=t(76472),h=t(44777),s=t(20696),l=t(95643),f=t(95540),u=t(26546),d=t(24502),p=t(1985),g=t(97022),y=t(86091),x=t(73162),T=t(20074),C=t(56480),M=t(68875),w=t(87841),L=t(59996),F=t(72905),O=t(90668),N=t(19186),G=t(61340),V=t(26099),j=t(15994),K=t(69601),J=["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"],X=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],Y=new a({Extends:l,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,O],initialize:function(z,W,H,Z,Q){l.call(this,z,"ParticleEmitter"),this.particleClass=C,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 i("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 V,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 G,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new x(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(W,H),this.setTexture(Z),Q&&this.setConfig(Q)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(D){if(!D)return this;var z=0,W="",H=this.ops;for(z=0;z=this.animQuantity&&(this.animCounter=0,this.currentAnim=j(this.currentAnim+1,0,z)),W},setAnim:function(D,z,W){z===void 0&&(z=!0),W===void 0&&(W=1),this.randomAnim=z,this.animQuantity=W,this.currentAnim=0;var H=typeof D;if(this.anims.length=0,Array.isArray(D))this.anims=this.anims.concat(D);else if(H==="string")this.anims.push(D);else if(H==="object"){var Z=D;D=f(Z,"anims",null),D&&(this.anims=this.anims.concat(D));var Q=f(Z,"cycle",!1);this.randomAnim=!Q,this.animQuantity=f(Z,"quantity",W)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(D){return D===void 0&&(D=!0),this.radial=D,this},addParticleBounds:function(D,z,W,H,Z,Q,k,et){if(typeof D=="object"){var st=D;D=st.x,z=st.y,W=g(st,"w")?st.w:st.width,H=g(st,"h")?st.h:st.height}return this.addParticleProcessor(new K(D,z,W,H,Z,Q,k,et))},setParticleSpeed:function(D,z){return z===void 0&&(z=D),this.ops.speedX.onChange(D),D===z?this.ops.speedY.active=!1:this.ops.speedY.onChange(z),this.radial=!0,this},setParticleScale:function(D,z){return D===void 0&&(D=1),z===void 0&&(z=D),this.ops.scaleX.onChange(D),this.ops.scaleY.onChange(z),this},setParticleGravity:function(D,z){return this.gravityX=D,this.gravityY=z,this},setParticleAlpha:function(D){return this.ops.alpha.onChange(D),this},setParticleTint:function(D){return this.ops.tint.onChange(D),this},setEmitterAngle:function(D){return this.ops.angle.onChange(D),this},setParticleLifespan:function(D){return this.ops.lifespan.onChange(D),this},setQuantity:function(D){return this.quantity=D,this},setFrequency:function(D,z){return this.frequency=D,this.flowCounter=D>0?D:0,z&&(this.quantity=z),this},addDeathZone:function(D){Array.isArray(D)||(D=[D]);for(var z,W=[],H=0;H-1&&(this.zoneTotal++,this.zoneTotal===H.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===W&&(this.zoneIndex=0)))}},getDeathZone:function(D){for(var z=this.deathZones,W=0;W=0&&(this.zoneIndex=z),this},addParticleProcessor:function(D){return this.processors.exists(D)||(D.emitter&&D.emitter.removeParticleProcessor(D),this.processors.add(D),D.emitter=this),D},removeParticleProcessor:function(D){return this.processors.exists(D)&&(this.processors.remove(D,!0),D.emitter=null),D},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(D){return this.addParticleProcessor(new d(D))},reserve:function(D){var z=this.dead;if(this.maxParticles>0){var W=this.getParticleCount();W+D>this.maxParticles&&(D=this.maxParticles-(W+D))}for(var H=0;H0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(D,z){return D===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof D=="function"&&(this.emitCallback=D,z&&(this.emitCallbackScope=z)),this},onParticleDeath:function(D,z){return D===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof D=="function"&&(this.deathCallback=D,z&&(this.deathCallbackScope=z)),this},killAll:function(){for(var D=this.dead,z=this.alive;z.length>0;)D.push(z.pop());return this},forEachAlive:function(D,z){for(var W=this.alive,H=W.length,Z=0;Z0&&this.fastForward(D),this.emitting=!0,this.resetCounters(this.frequency,!0),z!==void 0&&(this.duration=Math.abs(z)),this.emit(s.START,this)),this},stop:function(D){return D===void 0&&(D=!1),this.emitting&&(this.emitting=!1,D&&this.killAll(),this.emit(s.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(D,z){return D===void 0&&(D=""),z===void 0&&(z=this.true),this.sortProperty=D,this.sortOrderAsc=z,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(D){return this.sortProperty!==""?D=this.depthSortCallback:D=null,this.sortCallback=D,this},depthSort:function(){return N(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(D,z){var W=this.sortProperty;return this.sortOrderAsc?D[W]-z[W]:z[W]-D[W]},flow:function(D,z,W){return z===void 0&&(z=1),this.emitting=!1,this.frequency=D,this.quantity=z,W!==void 0&&(this.stopAfter=W),this.start()},explode:function(D,z,W){this.frequency=-1,this.resetCounters(-1,!0);var H=this.emitParticle(D,z,W);return this.emit(s.EXPLODE,this,H),H},emitParticleAt:function(D,z,W){return this.emitParticle(W,D,z)},emitParticle:function(D,z,W){if(!this.atLimit()){D===void 0&&(D=this.ops.quantity.onEmit());for(var H=this.dead,Z=this.stopAfter,Q=this.follow?this.follow.x+this.followOffset.x:z,k=this.follow?this.follow.y+this.followOffset.y:W,et=0;et0&&(this.stopCounter++,this.stopCounter>=Z)||this.atLimit())break}return st}},fastForward:function(D,z){z===void 0&&(z=1e3/60);var W=0;for(this.skipping=!0;W0){var ot=this.deathCallback,dt=this.deathCallbackScope;for(k=st-1;k>=0;k--){var at=et[k];Z.splice(at.index,1),Q.push(at.particle),ot&&ot.call(dt,at.particle),at.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&Z.length===0&&(this.completeFlag=0,this.emit(s.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=z;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=z,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(D){for(var z=this.getWorldTransformMatrix(),W=this.alive,H=W.length,Z=[],Q=0;Q0){var rt=0;for(this.skipping=!0;rt0&&y(H,D,D),H},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(D){this.ops.x.onChange(D)}},particleY:{get:function(){return this.ops.y.current},set:function(D){this.ops.y.onChange(D)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(D){this.ops.accelerationX.onChange(D)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(D){this.ops.accelerationY.onChange(D)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(D){this.ops.maxVelocityX.onChange(D)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(D){this.ops.maxVelocityY.onChange(D)}},speed:{get:function(){return this.ops.speedX.current},set:function(D){this.ops.speedX.onChange(D),this.ops.speedY.onChange(D)}},speedX:{get:function(){return this.ops.speedX.current},set:function(D){this.ops.speedX.onChange(D)}},speedY:{get:function(){return this.ops.speedY.current},set:function(D){this.ops.speedY.onChange(D)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(D){this.ops.moveToX.onChange(D)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(D){this.ops.moveToY.onChange(D)}},bounce:{get:function(){return this.ops.bounce.current},set:function(D){this.ops.bounce.onChange(D)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(D){this.ops.scaleX.onChange(D)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(D){this.ops.scaleY.onChange(D)}},particleColor:{get:function(){return this.ops.color.current},set:function(D){this.ops.color.onChange(D)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(D){this.ops.color.setEase(D)}},particleTint:{get:function(){return this.ops.tint.current},set:function(D){this.ops.tint.onChange(D)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(D){this.ops.alpha.onChange(D)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(D){this.ops.lifespan.onChange(D)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(D){this.ops.angle.onChange(D)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(D){this.ops.rotate.onChange(D)}},quantity:{get:function(){return this.ops.quantity.current},set:function(D){this.ops.quantity.onChange(D)}},delay:{get:function(){return this.ops.delay.current},set:function(D){this.ops.delay.onChange(D)}},hold:{get:function(){return this.ops.hold.current},set:function(D){this.ops.hold.onChange(D)}},flowCounter:{get:function(){return this.counters[0]},set:function(D){this.counters[0]=D}},frameCounter:{get:function(){return this.counters[1]},set:function(D){this.counters[1]=D}},animCounter:{get:function(){return this.counters[2]},set:function(D){this.counters[2]=D}},elapsed:{get:function(){return this.counters[3]},set:function(D){this.counters[3]=D}},stopCounter:{get:function(){return this.counters[4]},set:function(D){this.counters[4]=D}},completeFlag:{get:function(){return this.counters[5]},set:function(D){this.counters[5]=D}},zoneIndex:{get:function(){return this.counters[6]},set:function(D){this.counters[6]=D}},zoneTotal:{get:function(){return this.counters[7]},set:function(D){this.counters[7]=D}},currentFrame:{get:function(){return this.counters[8]},set:function(D){this.counters[8]=D}},currentAnim:{get:function(){return this.counters[9]},set:function(D){this.counters[9]=D}},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 D,z=this.ops;for(D=0;D{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(59996),v=t(61340),o=new v,r=new v,n=new v,e=new v,i=function(h,s,l,f){var u=o,d=r,p=n,g=e;f?(g.loadIdentity(),g.multiply(f),g.translate(s.x,s.y),g.rotate(s.rotation),g.scale(s.scaleX,s.scaleY)):g.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY);var y=h.currentContext,x=l.roundPixels,T=l.alpha,C=s.alpha,M=s.alive,w=M.length,L=s.viewBounds;if(!(!s.visible||w===0||L&&!a(L,l.worldView))){s.sortCallback&&s.depthSort(),l.addToRenderList(s);var F=s.scrollFactorX,O=s.scrollFactorY;y.save(),y.globalCompositeOperation=h.blendModes[s.blendMode];for(var N=0;N0&&K.height>0){var J=-j.halfWidth,X=-j.halfHeight;y.globalAlpha=V,y.save(),d.setToContext(y),x&&(J=Math.round(J),X=Math.round(X)),y.imageSmoothingEnabled=!j.source.scaleMode,y.drawImage(j.source.image,K.x,K.y,K.width,K.height,J,X,K.width,K.height),y.restore()}}}y.restore()}};c.exports=i},92730:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(95540),n=t(31600);v.register("particles",function(e,i){e===void 0&&(e={});var h=o(e,"key",null),s=r(e,"config",null),l=new n(this.scene,0,0,h);return i!==void 0&&(e.add=i),a(this.scene,l,e),s&&l.setConfig(s),l})},676:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(31600);a.register("particles",function(o,r,n,e){return o!==void 0&&typeof o=="string"&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new v(this.scene,o,r,n,e))})},90668:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(21188),o=t(9871),c.exports={renderWebGL:v,renderCanvas:o}},21188:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(59996),v=t(61340),o=t(70554),r=new v,n=new v,e=new v,i=new v,h=function(s,l,f,u){var d=s.pipelines.set(l.pipeline),p=r,g=n,y=e,x=i;u?(x.loadIdentity(),x.multiply(u),x.translate(l.x,l.y),x.rotate(l.rotation),x.scale(l.scaleX,l.scaleY)):x.applyITRS(l.x,l.y,l.rotation,l.scaleX,l.scaleY);var T=o.getTintAppendFloatAlpha,C=f.alpha,M=l.alpha;s.pipelines.preBatch(l);var w=l.alive,L=w.length,F=l.viewBounds;if(!(L===0||F&&!a(F,f.worldView))){l.sortCallback&&l.depthSort(),f.addToRenderList(l),p.copyFrom(f.matrix),p.multiplyWithOffset(x,-f.scrollX*l.scrollFactorX,-f.scrollY*l.scrollFactorY),s.setBlendMode(l.blendMode),l.mask&&(l.mask.preRenderWebGL(s,l,f),s.pipelines.set(l.pipeline));for(var O=l.tintFill,N,G,V=0;V{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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}});c.exports=v},9774:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},812:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="deathzone"},30522:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="explode"},96695:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="start"},18677:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stop"},20696:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={COMPLETE:t(9774),DEATH_ZONE:t(812),EXPLODE:t(30522),START:t(96695),STOP:t(18677)}},18404:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n){this.source=r,this.killOnEnter=n},willKill:function(o){var r=o.worldPosition,n=this.source.contains(r.x,r.y);return n&&this.killOnEnter||!n&&!this.killOnEnter}});c.exports=v},19909:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i,h,s){i===void 0&&(i=!1),h===void 0&&(h=!0),s===void 0&&(s=-1),this.source=r,this.points=[],this.quantity=n,this.stepRate=e,this.yoyo=i,this.counter=-1,this.seamless=h,this._length=0,this._direction=0,this.total=s,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var o=this.points[0],r=this.points[this.points.length-1];o.x===r.x&&o.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(o){return this.source=o,this.updateSource()},getPoint:function(o){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&&(o.x=r.x,o.y=r.y)}});c.exports=v},68875:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(26099),o=new a({initialize:function(n){this.source=n,this._tempVec=new v,this.total=-1},getPoint:function(r){var n=this._tempVec;this.source.getRandomPoint(n),r.x=n.x,r.y=n.y}});c.exports=o},21024:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={DeathZone:t(26388),EdgeZone:t(19909),RandomZone:t(68875)}},1159:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(68287),r=new a({Extends:o,Mixins:[v.PathFollower],initialize:function(e,i,h,s,l,f){o.call(this,e,h,s,l,f),this.path=i},preUpdate:function(n,e){this.anims.update(n,e),this.pathUpdate(n)}});c.exports=r},90145:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(1159);a.register("follower",function(o,r,n,e,i){var h=new v(this.scene,o,r,n,e,i);return this.displayList.add(h),this.updateList.add(h),h})},33663:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(9674),v=t(83419),o=t(48803),r=t(90664),n=t(4703),e=t(45650),i=new v({Extends:n,initialize:function(s,l,f,u,d,p,g,y){u||(u="__DEFAULT"),n.call(this,s,l,f,u,d),this.type="Plane",this.anims=new a(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(p,g,y),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(h,s,l){h===void 0&&(h=8),s===void 0&&(s=8),l===void 0&&(l=!1);var f=!1;return l&&(f=!0),this.gridWidth=h,this.gridHeight=s,this.isTiled=l,this.clear(),o({mesh:this,widthSegments:h,heightSegments:s,isOrtho:!1,tile:l,flipY:f}),this},setSizeToFrame:function(h){h===void 0&&(h=!0);var s=this.frame;if(this.setPerspective(this.width/s.width,this.height/s.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!h)return this;var l=this.gridWidth,f=this.gridHeight,u=this.vertices,d=s.u0,p=s.u1,g=s.v0,y=s.v1,x,T,C=0;if(this.isTiled)for(g=s.v1,y=s.v0,T=0;T7&&x>7?g.push(d.r,d.g,d.b,l):g.push(p.r,p.g,p.b,f);var T=this.scene.sys.textures.addUint8Array(e(),new Uint8Array(g),16,16);return this.removeCheckerboard(),this.setTexture(T),this.setSizeToFrame(),this.setViewHeight(u),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(h,s){return this.anims.play(h,s)},playReverse:function(h,s){return this.anims.playReverse(h,s)},playAfterDelay:function(h,s){return this.anims.playAfterDelay(h,s)},playAfterRepeat:function(h,s){return this.anims.playAfterRepeat(h,s)},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,s){n.prototype.preUpdate.call(this,h,s),this.anims.update(h,s)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});c.exports=i},56015:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(13059),o=t(44603),r=t(23568),n=t(35154),e=t(33663);o.register("plane",function(i,h){i===void 0&&(i={});var s=r(i,"key",null),l=r(i,"frame",null),f=n(i,"width",8),u=n(i,"height",8),d=n(i,"tile",!1),p=new e(this.scene,0,0,s,l,f,u,d);h!==void 0&&(i.add=h);var g=n(i,"checkerboard",null);if(g){var y=n(g,"color1",16777215),x=n(g,"color2",255),T=n(g,"alpha1",255),C=n(g,"alpha2",255),M=n(g,"height",128);p.createCheckerboard(y,x,T,C,M)}return a(this.scene,p,i),v(p,i),p})},30985:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33663),v=t(39429);v.register("plane",function(o,r,n,e,i,h,s){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s))})},80321:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(30100),n=t(36060),e=t(67277),i=new a({Extends:o,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Transform,v.Visible,e],initialize:function(s,l,f,u,d,p,g){u===void 0&&(u=16777215),d===void 0&&(d=128),p===void 0&&(p=1),g===void 0&&(g=.1),o.call(this,s,"PointLight"),this.initPipeline(n.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(l,f),this.color=r(u),this.intensity=p,this.attenuation=g,this.width=d*2,this.height=d*2,this._radius=d},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}}});c.exports=i},39829:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(80321);v.register("pointlight",function(n,e){n===void 0&&(n={});var i=o(n,"color",16777215),h=o(n,"radius",128),s=o(n,"intensity",1),l=o(n,"attenuation",.1),f=new r(this.scene,0,0,i,h,s,l);return e!==void 0&&(n.add=e),a(this.scene,f,n),f})},71255:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(80321);a.register("pointlight",function(o,r,n,e,i,h){return this.displayList.add(new v(this.scene,o,r,n,e,i,h))})},67277:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(57787),c.exports={renderWebGL:v,renderCanvas:o}},57787:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=function(o,r,n,e){n.addToRenderList(r);var i=o.pipelines.set(r.pipeline),h=a(r,n,e).calc,s=r.width,l=r.height,f=-r._radius,u=-r._radius,d=f+s,p=u+l,g=h.getX(0,0),y=h.getY(0,0),x=h.getX(f,u),T=h.getY(f,u),C=h.getX(f,p),M=h.getY(f,p),w=h.getX(d,p),L=h.getY(d,p),F=h.getX(d,u),O=h.getY(d,u);o.pipelines.preBatch(r),i.batchPointLight(r,n,x,T,C,M,w,L,F,O,g,y),o.pipelines.postBatch(r)};c.exports=v},591:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(81320),o=t(88571),r=new a({Extends:o,initialize:function(e,i,h,s,l){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=32),l===void 0&&(l=32);var f=new v(e.sys.textures,"",s,l);o.call(this,e,i,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 i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=n,i.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,i,h,s,l){return this.texture.fill(n,e,i,h,s,l),this},clear:function(){return this.texture.clear(),this},stamp:function(n,e,i,h,s){return this.texture.stamp(n,e,i,h,s),this},erase:function(n,e,i){return this.texture.erase(n,e,i),this},draw:function(n,e,i,h,s){return this.texture.draw(n,e,i,h,s),this},drawFrame:function(n,e,i,h,s,l){return this.texture.drawFrame(n,e,i,h,s,l),this},repeat:function(n,e,i,h,s,l,f,u,d){return this.texture.repeat(n,e,i,h,s,l,f,u,d),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(n,e,i,h,s){return this.texture.batchDraw(n,e,i,h,s),this},batchDrawFrame:function(n,e,i,h,s,l){return this.texture.batchDrawFrame(n,e,i,h,s,l),this},endDraw:function(n){return this.texture.endDraw(n),this},snapshotArea:function(n,e,i,h,s,l,f){return this.texture.snapshotArea(n,e,i,h,s,l,f),this},snapshot:function(n,e,i){return this.snapshotArea(0,0,this.width,this.height,n,e,i)},snapshotPixel:function(n,e,i){return this.snapshotArea(n,e,1,1,i,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});c.exports=r},34495:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(591);v.register("renderTexture",function(n,e){n===void 0&&(n={});var i=o(n,"x",0),h=o(n,"y",0),s=o(n,"width",32),l=o(n,"height",32),f=new r(this.scene,i,h,s,l);return e!==void 0&&(n.add=e),a(this.scene,f,n),f})},60505:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(591);a.register("renderTexture",function(o,r,n,e){return this.displayList.add(new v(this.scene,o,r,n,e))})},77757:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(9674),v=t(83419),o=t(31401),r=t(95643),n=t(36060),e=t(38745),i=t(26099),h=new v({Extends:r,Mixins:[o.AlphaSingle,o.BlendMode,o.Depth,o.Flip,o.Mask,o.Pipeline,o.PostPipeline,o.Size,o.Texture,o.Transform,o.Visible,o.ScrollFactor,e],initialize:function(l,f,u,d,p,g,y,x,T){d===void 0&&(d="__DEFAULT"),g===void 0&&(g=2),y===void 0&&(y=!0),r.call(this,l,"Rope"),this.anims=new a(this),this.points=g,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=d==="__DEFAULT",this.dirty=!1,this.horizontal=y,this._flipX=!1,this._flipY=!1,this._perp=new i,this.debugCallback=null,this.debugGraphic=null,this.setTexture(d,p),this.setPosition(f,u),this.setSizeToFrame(),this.initPipeline(n.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(g)&&this.resizeArrays(g.length),this.setPoints(g,x,T),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(s,l){var f=this.anims.currentFrame;this.anims.update(s,l),this.anims.currentFrame!==f&&(this.updateUVs(),this.updateVertices())},play:function(s,l,f){return this.anims.play(s,l,f),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(s,l,f))},setVertical:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(s,l,f)):this},setTintFill:function(s){return s===void 0&&(s=!1),this.tintFill=s,this},setAlphas:function(s,l){var f=this.points.length;if(f<1)return this;var u=this.alphas;s===void 0?s=[1]:!Array.isArray(s)&&l===void 0&&(s=[s]);var d,p=0;if(l!==void 0)for(d=0;dp&&(g=s[p]),u[p]=g,s.length>p+1&&(g=s[p+1]),u[p+1]=g}return this},setColors:function(s){var l=this.points.length;if(l<1)return this;var f=this.colors;s===void 0?s=[16777215]:Array.isArray(s)||(s=[s]);var u,d=0;if(s.length===l)for(u=0;ud&&(p=s[d]),f[d]=p,s.length>d+1&&(p=s[d+1]),f[d+1]=p}return this},setPoints:function(s,l,f){if(s===void 0&&(s=2),typeof s=="number"){var u=s;u<2&&(u=2),s=[];var d,p,g;if(this.horizontal)for(g=-this.frame.halfWidth,p=this.frame.width/(u-1),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(){};c.exports=m},26209:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(35154),n=t(77757);v.register("rope",function(e,i){e===void 0&&(e={});var h=o(e,"key",null),s=o(e,"frame",null),l=o(e,"horizontal",!0),f=r(e,"points",void 0),u=r(e,"colors",void 0),d=r(e,"alphas",void 0),p=new n(this.scene,0,0,h,s,f,l,u,d);return i!==void 0&&(e.add=i),a(this.scene,p,e),p})},96819:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(77757),v=t(39429);v.register("rope",function(o,r,n,e,i,h,s,l){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s,l))})},38745:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(20439),o=t(95262),c.exports={renderWebGL:v,renderCanvas:o}},20439:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline,n),s=a(n,e,i).calc,l=n.vertices,f=n.uv,u=n.colors,d=n.alphas,p=n.alpha,g=v.getTintAppendFloatAlpha,y=e.roundPixels,x=l.length,T=Math.floor(x*.5);h.flush(),r.pipelines.preBatch(n);var C=h.setGameObject(n),M=h.vertexViewF32,w=h.vertexViewU32,L=h.vertexCount*h.currentShader.vertexComponentCount-1,F=0,O=n.tintFill;n.dirty&&n.updateVertices();for(var N=n.debugCallback,G=[],V=0;V{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(95540),n=t(79291),e=t(61622),i=t(25479),h=t(61340),s=t(95428),l=t(92503),f=new a({Extends:o,Mixins:[v.ComputedSize,v.Depth,v.GetBounds,v.Mask,v.Origin,v.ScrollFactor,v.Transform,v.Visible,i],initialize:function(d,p,g,y,x,T,C,M){g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=128),T===void 0&&(T=128),o.call(this,d,"Shader"),this.blendMode=-1,this.shader;var w=d.sys.renderer;this.renderer=w,this.gl=w.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=w.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=w.width,this._rendererHeight=w.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(g,y),this.setSize(x,T),this.setOrigin(.5,.5),this.setShader(p,C,M),this.renderer.on(l.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(u){return this.renderToTexture?!0:!(o.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setRenderToTexture:function(u,d){if(!this.renderToTexture){var p=this.width,g=this.height,y=this.renderer;this.glTexture=y.createTextureFromSource(null,p,g,0),this.framebuffer=y.createFramebuffer(p,g,this.glTexture,!1),this._rendererWidth=p,this._rendererHeight=g,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),u&&(this.texture=this.scene.sys.textures.addGLTexture(u,this.glTexture))}return this.shader&&(y.pipelines.clear(),this.load(),this.flush(),y.pipelines.rebind()),this},setShader:function(u,d,p){if(this.renderer.contextLost)return this._deferSetShader={key:u,textures:d,textureData:p},this;if(d===void 0&&(d=[]),typeof u=="string"){var g=this.scene.sys.cache.shader;if(!g.has(u))return console.warn("Shader missing: "+u),this;this.shader=g.get(u)}else this.shader=u;var y=this.gl,x=this.renderer;this.program&&x.deleteProgram(this.program);var T=x.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);y.uniformMatrix4fv(y.getUniformLocation(T.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),y.uniformMatrix4fv(y.getUniformLocation(T.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),y.uniform2f(y.getUniformLocation(T.webGLProgram,"uResolution"),this.width,this.height),this.program=T;var C=new Date,M={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:[C.getFullYear(),C.getMonth(),C.getDate(),C.getHours()*60*60+C.getMinutes()*60+C.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,M):this.uniforms=M;for(var w=0;w<4;w++)d[w]&&this.setSampler2D("iChannel"+w,d[w],w,p);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(u){return this.pointer=u,this},projOrtho:function(u,d,p,g){if(this.renderer.contextLost){this._deferProjOrtho={left:u,right:d,bottom:p,top:g};return}var y=-1e3,x=1e3,T=1/(u-d),C=1/(p-g),M=1/(y-x),w=this.projectionMatrix;w[0]=-2*T,w[5]=-2*C,w[10]=2*M,w[12]=(u+d)*T,w[13]=(g+p)*C,w[14]=(x+y)*M;var L=this.program,F=this.gl,O=this.renderer;O.setProgram(L),F.uniformMatrix4fv(F.getUniformLocation(L.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=d,this._rendererHeight=p},initUniforms:function(){var u=this.renderer.glFuncMap,d=this.program;this._textureCount=0;for(var p in this.uniforms){var g=this.uniforms[p],y=g.type,x=u[y];g.uniformLocation=this.renderer.createUniformLocation(d,p),y!=="sampler2D"&&(g.glMatrix=x.matrix,g.glValueLength=x.length,g.glFunc=x.func)}},setSampler2DBuffer:function(u,d,p,g,y,x){y===void 0&&(y=0),x===void 0&&(x={});var T=this.uniforms[u];return T.value=d,x.width=p,x.height=g,T.textureData=x,this._textureCount=y,this.initSampler2D(T),this},setSampler2D:function(u,d,p,g){p===void 0&&(p=0);var y=this.scene.sys.textures;if(y.exists(d)){var x=y.getFrame(d);if(x.glTexture&&x.glTexture.isRenderTexture)return this.setSampler2DBuffer(u,x.glTexture,x.width,x.height,p,g);var T=this.uniforms[u],C=x.source;T.textureKey=d,T.source=C.image,T.value=x.glTexture,C.isGLTexture&&(g||(g={}),g.width=C.width,g.height=C.height),g&&(T.textureData=g),this._textureCount=p,this.initSampler2D(T)}return this},setUniform:function(u,d){return e(this.uniforms,u,d),this},getUniform:function(u){return r(this.uniforms,u,null)},setChannel0:function(u,d){return this.setSampler2D("iChannel0",u,0,d)},setChannel1:function(u,d){return this.setSampler2D("iChannel1",u,1,d)},setChannel2:function(u,d){return this.setSampler2D("iChannel2",u,2,d)},setChannel3:function(u,d){return this.setSampler2D("iChannel3",u,3,d)},initSampler2D:function(u){if(u.value){var d=u.textureData;if(d&&!u.value.isRenderTexture){var p=this.gl,g=u.value,y=p[r(d,"magFilter","linear").toUpperCase()],x=p[r(d,"minFilter","linear").toUpperCase()],T=p[r(d,"wrapS","repeat").toUpperCase()],C=p[r(d,"wrapT","repeat").toUpperCase()],M=p[r(d,"format","rgba").toUpperCase()],w=r(d,"flipY",!1),L=r(d,"width",g.width),F=r(d,"height",g.height),O=r(d,"source",g.pixels);d.repeat&&(T=p.REPEAT,C=p.REPEAT),d.width&&(O=null),g.update(O,L,F,w,T,C,x,y,M)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var u=this.gl,d=this.uniforms,p,g,y,x,T,C=0;for(var M in d)p=d[M],y=p.glFunc,g=p.glValueLength,x=p.uniformLocation,T=p.value,T!==null&&(g===1?p.glMatrix?y.call(u,x.webGLUniformLocation,p.transpose,T):y.call(u,x.webGLUniformLocation,T):g===2?y.call(u,x.webGLUniformLocation,T.x,T.y):g===3?y.call(u,x.webGLUniformLocation,T.x,T.y,T.z):g===4?y.call(u,x.webGLUniformLocation,T.x,T.y,T.z,T.w):p.type==="sampler2D"&&(u.activeTexture(u.TEXTURE0+C),u.bindTexture(u.TEXTURE_2D,T.webGLTexture),u.uniform1i(x.webGLUniformLocation,C),C++))},load:function(u){var d=this.gl,p=this.width,g=this.height,y=this.renderer,x=this.program,T=this.viewMatrix;if(!this.renderToTexture){var C=-this._displayOriginX,M=-this._displayOriginY;T[0]=u[0],T[1]=u[1],T[4]=u[2],T[5]=u[3],T[8]=u[4],T[9]=u[5],T[12]=T[0]*C+T[4]*M,T[13]=T[1]*C+T[5]*M}d.useProgram(x.webGLProgram),d.uniformMatrix4fv(d.getUniformLocation(x.webGLProgram,"uViewMatrix"),!1,T),d.uniformMatrix4fv(d.getUniformLocation(x.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),d.uniform2f(d.getUniformLocation(x.webGLProgram,"uResolution"),this.width,this.height);var w=this.uniforms,L=w.resolution;L.value.x=p,L.value.y=g,w.time.value=y.game.loop.getDuration();var F=this.pointer;if(F){var O=w.mouse,N=F.x/p,G=1-F.y/g;O.value.x=N.toFixed(2),O.value.y=G.toFixed(2)}this.syncUniforms()},flush:function(){var u=this.width,d=this.height,p=this.program,g=this.gl,y=this.vertexBuffer,x=this.renderer,T=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(x.setFramebuffer(this.framebuffer),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT)),g.bindBuffer(g.ARRAY_BUFFER,y.webGLBuffer);var C=g.getAttribLocation(p.webGLProgram,"inPosition");C!==-1&&(g.enableVertexAttribArray(C),g.vertexAttribPointer(C,2,g.FLOAT,!1,T,0));var M=this.vertexViewF32;M[3]=d,M[4]=u,M[5]=d,M[8]=u,M[9]=d,M[10]=u;var w=6;g.bufferSubData(g.ARRAY_BUFFER,0,this.bytes.subarray(0,w*T)),g.drawArrays(g.TRIANGLES,0,w),this.renderToTexture&&x.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var u=this._deferSetShader.key,d=this._deferSetShader.textures,p=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(u,d,p)}if(this._deferProjOrtho!==null){var g=this._deferProjOrtho.left,y=this._deferProjOrtho.right,x=this._deferProjOrtho.bottom,T=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(g,y,x,T)}},preDestroy:function(){var u=this.renderer;u.off(l.RESTORE_WEBGL,this.onContextRestored,this),u.deleteProgram(this.program),u.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(u.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),s(this.uniforms,function(d){u.deleteUniformLocation(d.uniformLocation),d.uniformLocation=null})}});c.exports=f},80464:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(){};c.exports=m},54935:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(20071);v.register("shader",function(n,e){n===void 0&&(n={});var i=o(n,"key",null),h=o(n,"x",0),s=o(n,"y",0),l=o(n,"width",128),f=o(n,"height",128),u=new r(this.scene,i,h,s,l,f);return e!==void 0&&(n.add=e),a(this.scene,u,n),u})},74177:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20071),v=t(39429);v.register("shader",function(o,r,n,e,i,h,s){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s))})},25479:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(19257),o=t(80464),c.exports={renderWebGL:v,renderCanvas:o}},19257:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=function(o,r,n,e){if(r.shader){if(n.addToRenderList(r),o.pipelines.clear(),r.renderToTexture)r.load(),r.flush();else{var i=a(r,n,e).calc;(o.width!==r._rendererWidth||o.height!==r._rendererHeight)&&r.projOrtho(0,o.width,o.height,0),r.load(i.matrix),r.flush()}o.pipelines.rebind()}};c.exports=v},10441:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70554),v=function(o,r,n,e,i,h){for(var s=a.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*e),l=n.pathData,f=n.pathIndexes,u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=v||a.fillColor,n=o||a.fillAlpha,e=(r&16711680)>>>16,i=(r&65280)>>>8,h=r&255;t.fillStyle="rgba("+e+","+i+","+h+","+n+")"};c.exports=m},75177:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=v||a.strokeColor,n=o||a.strokeAlpha,e=(r&16711680)>>>16,i=(r&65280)>>>8,h=r&255;t.strokeStyle="rgba("+e+","+i+","+h+","+n+")",t.lineWidth=a.lineWidth};c.exports=m},17803:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(95643),r=t(23031),n=new a({Extends:o,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.GetBounds,v.Mask,v.Origin,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Transform,v.Visible],initialize:function(i,h,s){h===void 0&&(h="Shape"),o.call(this,i,h),this.geom=s,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,i){return i===void 0&&(i=1),e===void 0?this.isFilled=!1:(this.fillColor=e,this.fillAlpha=i,this.isFilled=!0),this},setStrokeStyle:function(e,i,h){return h===void 0&&(h=1),e===void 0?this.isStroked=!1:(this.lineWidth=e,this.strokeColor=i,this.strokeAlpha=h,this.isStroked=!0),this},setClosePath:function(e){return this.closePath=e,this},setSize:function(e,i){return this.width=e,this.height=i,this},setDisplaySize:function(e,i){return this.displayWidth=e,this.displayHeight=i,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}}});c.exports=n},34682:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70554),v=function(o,r,n,e,i){var h=o.strokeTint,s=a.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n);h.TL=s,h.TR=s,h.BL=s,h.BR=s;var l=r.pathData,f=l.length-1,u=r.lineWidth,d=u/2,p=l[0]-e,g=l[1]-i;r.closePath||(f-=2);for(var y=2;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13609),v=t(83419),o=t(39506),r=t(94811),n=t(96503),e=t(36383),i=t(17803),h=new v({Extends:i,Mixins:[a],initialize:function(l,f,u,d,p,g,y,x,T){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=0),g===void 0&&(g=360),y===void 0&&(y=!1),i.call(this,l,"Arc",new n(0,0,d)),this._startAngle=p,this._endAngle=g,this._anticlockwise=y,this._iterations=.01,this.setPosition(f,u);var C=this.geom.radius*2;this.setSize(C,C),x!==void 0&&this.setFillStyle(x,T),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(s){this._iterations=s,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(s){this.geom.radius=s;var l=s*2;this.setSize(l,l),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(s){this._startAngle=s,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(s){this._endAngle=s,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(s){this._anticlockwise=s,this.updateData()}},setRadius:function(s){return this.radius=s,this},setIterations:function(s){return s===void 0&&(s=.01),this.iterations=s,this},setStartAngle:function(s,l){return this._startAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},setEndAngle:function(s,l){return this._endAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},updateData:function(){var s=this._iterations,l=s,f=this.geom.radius,u=o(this._startAngle),d=o(this._endAngle),p=this._anticlockwise,g=f,y=f;d-=u,p?d<-e.PI2?d=-e.PI2:d>0&&(d=-e.PI2+d%e.PI2):d>e.PI2?d=e.PI2:d<0&&(d=e.PI2+d%e.PI2);for(var x=[g+Math.cos(u)*f,y+Math.sin(u)*f],T;l<1;)T=d*l+u,x.push(g+Math.cos(T)*f,y+Math.sin(T)*f),l+=s;return T=d+u,x.push(g+Math.cos(T)*f,y+Math.sin(T)*f),x.push(g+Math.cos(u)*f,y+Math.sin(u)*f),this.pathIndexes=r(x),this.pathData=x,this}});c.exports=h},42542:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39506),v=t(65960),o=t(75177),r=t(20926),n=function(e,i,h,s){h.addToRenderList(i);var l=e.currentContext;if(r(e,l,i,h,s)){var f=i.radius;l.beginPath(),l.arc(f-i.originX*(f*2),f-i.originY*(f*2),f,a(i._startAngle),a(i._endAngle),i.anticlockwise),i.closePath&&l.closePath(),i.isFilled&&(v(l,i),l.fill()),i.isStroked&&(o(l,i),l.stroke()),l.restore()}};c.exports=n},42563:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23629),v=t(39429);v.register("arc",function(o,r,n,e,i,h,s,l){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s,l))}),v.register("circle",function(o,r,n,e,i){return this.displayList.add(new a(this.scene,o,r,n,0,360,!1,e,i))})},13609:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(41447),o=t(42542),c.exports={renderWebGL:v,renderCanvas:o}},41447:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(10441),o=t(34682),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=a(e,i,h),f=s.calcMatrix.copyFrom(l.calc),u=e._displayOriginX,d=e._displayOriginY,p=i.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&v(s,f,e,p,u,d),e.isStroked&&o(s,e,p,u,d),n.pipelines.postBatch(e)};c.exports=r},89:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(33141),o=t(94811),r=t(87841),n=t(17803),e=new a({Extends:n,Mixins:[v],initialize:function(h,s,l,f,u,d){s===void 0&&(s=0),l===void 0&&(l=0),n.call(this,h,"Curve",f),this._smoothness=32,this._curveBounds=new r,this.closePath=!1,this.setPosition(s,l),u!==void 0&&this.setFillStyle(u,d),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(i){this._smoothness=i,this.updateData()}},setSmoothness:function(i){return this._smoothness=i,this.updateData()},updateData:function(){var i=this._curveBounds,h=this._smoothness;this.geom.getBounds(i,h),this.setSize(i.width,i.height),this.updateDisplayOrigin();for(var s=[],l=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 a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX+e._curveBounds.x,f=e._displayOriginY+e._curveBounds.y,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(89);a.register("curve",function(o,r,n,e,i){return this.displayList.add(new v(this.scene,o,r,n,e,i))})},33141:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(53987),o=t(3170),c.exports={renderWebGL:v,renderCanvas:o}},53987:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10441),v=t(91296),o=t(34682),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=v(e,i,h),f=s.calcMatrix.copyFrom(l.calc),u=e._displayOriginX+e._curveBounds.x,d=e._displayOriginY+e._curveBounds.y,p=i.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&a(s,f,e,p,u,d),e.isStroked&&o(s,e,p,u,d),n.pipelines.postBatch(e)};c.exports=r},19921:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(94811),o=t(54205),r=t(8497),n=t(17803),e=new a({Extends:n,Mixins:[o],initialize:function(h,s,l,f,u,d,p){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=128),u===void 0&&(u=128),n.call(this,h,"Ellipse",new r(f/2,u/2,f,u)),this._smoothness=64,this.setPosition(s,l),this.width=f,this.height=u,d!==void 0&&this.setFillStyle(d,p),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(i){this._smoothness=i,this.updateData()}},setSize:function(i,h){return this.width=i,this.height=h,this.geom.setPosition(i/2,h/2),this.geom.setSize(i,h),this.updateData()},setSmoothness:function(i){return this._smoothness=i,this.updateData()},updateData:function(){for(var i=[],h=this.geom.getPoints(this._smoothness),s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19921),v=t(39429);v.register("ellipse",function(o,r,n,e,i,h){return this.displayList.add(new a(this.scene,o,r,n,e,i,h))})},54205:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(19467),o=t(7930),c.exports={renderWebGL:v,renderCanvas:o}},19467:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10441),v=t(91296),o=t(34682),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=v(e,i,h),f=s.calcMatrix.copyFrom(l.calc),u=e._displayOriginX,d=e._displayOriginY,p=i.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&a(s,f,e,p,u,d),e.isStroked&&o(s,e,p,u,d),n.pipelines.postBatch(e)};c.exports=r},30479:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(17803),o=t(26015),r=new a({Extends:v,Mixins:[o],initialize:function(e,i,h,s,l,f,u,d,p,g,y){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=128),l===void 0&&(l=128),f===void 0&&(f=32),u===void 0&&(u=32),v.call(this,e,"Grid",null),this.cellWidth=f,this.cellHeight=u,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(i,h),this.setSize(s,l),this.setFillStyle(d,p),g!==void 0&&this.setOutlineStyle(g,y),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}});c.exports=r},49912:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=-e._displayOriginX,f=-e._displayOriginY,u=i.alpha*e.alpha,d=e.width,p=e.height,g=e.cellWidth,y=e.cellHeight,x=Math.ceil(d/g),T=Math.ceil(p/y),C=g,M=y,w=g-(x*g-d),L=y-(T*y-p),F=e.showCells,O=e.showAltCells,N=e.showOutline,G=0,V=0,j=0,K=0,J=0;if(N&&(C--,M--,w===g&&w--,L===y&&L--),F&&e.fillAlpha>0)for(a(s,e),V=0;V0)for(a(s,e,e.altFillColor,e.altFillAlpha*u),V=0;V0){for(v(s,e,e.outlineFillColor,e.outlineFillAlpha*u),G=1;G{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(30479);a.register("grid",function(o,r,n,e,i,h,s,l,f,u){return this.displayList.add(new v(this.scene,o,r,n,e,i,h,s,l,f,u))})},26015:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(46161),o=t(49912),c.exports={renderWebGL:v,renderCanvas:o}},46161:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=a(n,e,i),l=h.calcMatrix.copyFrom(s.calc);l.translate(-n._displayOriginX,-n._displayOriginY);var f=e.alpha*n.alpha,u=n.width,d=n.height,p=n.cellWidth,g=n.cellHeight,y=Math.ceil(u/p),x=Math.ceil(d/g),T=p,C=g,M=p-(y*p-u),w=g-(x*g-d),L,F,O=n.showCells,N=n.showAltCells,G=n.showOutline,V=0,j=0,K=0,J=0,X=0;if(G&&(T--,C--,M===p&&M--,w===g&&w--),r.pipelines.preBatch(n),O&&n.fillAlpha>0)for(L=h.fillTint,F=v.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*f),L.TL=F,L.TR=F,L.BL=F,L.BR=F,j=0;j0)for(L=h.fillTint,F=v.getTintAppendFloatAlpha(n.altFillColor,n.altFillAlpha*f),L.TL=F,L.TR=F,L.BL=F,L.BR=F,j=0;j0){var Y=h.strokeTint,D=v.getTintAppendFloatAlpha(n.outlineFillColor,n.outlineFillAlpha*f);for(Y.TL=D,Y.TR=D,Y.BL=D,Y.BR=D,V=1;V{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(99651),v=t(83419),o=t(17803),r=new v({Extends:o,Mixins:[a],initialize:function(e,i,h,s,l,f,u,d){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=48),l===void 0&&(l=32),f===void 0&&(f=15658734),u===void 0&&(u=10066329),d===void 0&&(d=13421772),o.call(this,e,"IsoBox",null),this.projection=4,this.fillTop=f,this.fillLeft=u,this.fillRight=d,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(i,h),this.setSize(s,l),this.updateDisplayOrigin()},setProjection:function(n){return this.projection=n,this},setFaces:function(n,e,i){return n===void 0&&(n=!0),e===void 0&&(e=!0),i===void 0&&(i=!0),this.showTop=n,this.showLeft=e,this.showRight=i,this},setFillStyle:function(n,e,i){return this.fillTop=n,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});c.exports=r},11508:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(20926),o=function(r,n,e,i){e.addToRenderList(n);var h=r.currentContext;if(v(r,h,n,e,i)&&n.isFilled){var s=n.width,l=n.height,f=s/2,u=s/n.projection;n.showTop&&(a(h,n,n.fillTop),h.beginPath(),h.moveTo(-f,-l),h.lineTo(0,-u-l),h.lineTo(f,-l),h.lineTo(f,-1),h.lineTo(0,u-1),h.lineTo(-f,-1),h.lineTo(-f,-l),h.fill()),n.showLeft&&(a(h,n,n.fillLeft),h.beginPath(),h.moveTo(-f,0),h.lineTo(0,u),h.lineTo(0,u-l),h.lineTo(-f,-l),h.lineTo(-f,0),h.fill()),n.showRight&&(a(h,n,n.fillRight),h.beginPath(),h.moveTo(f,0),h.lineTo(0,u),h.lineTo(0,u-l),h.lineTo(f,-l),h.lineTo(f,0),h.fill()),h.restore()}};c.exports=o},3933:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(61475);a.register("isobox",function(o,r,n,e,i,h,s){return this.displayList.add(new v(this.scene,o,r,n,e,i,h,s))})},99651:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(68149),o=t(11508),c.exports={renderWebGL:v,renderCanvas:o}},68149:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=a(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=e.alpha*n.alpha;if(n.isFilled){var y,x,T,C,M,w,L,F,O;r.pipelines.preBatch(n),n.showTop&&(y=v.getTintAppendFloatAlpha(n.fillTop,g),x=l.getX(-d,-u),T=l.getY(-d,-u),C=l.getX(0,-p-u),M=l.getY(0,-p-u),w=l.getX(d,-u),L=l.getY(d,-u),F=l.getX(0,p-u),O=l.getY(0,p-u),h.batchQuad(n,x,T,C,M,w,L,F,O,0,0,1,1,y,y,y,y,2)),n.showLeft&&(y=v.getTintAppendFloatAlpha(n.fillLeft,g),x=l.getX(-d,0),T=l.getY(-d,0),C=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),L=l.getY(0,p-u),F=l.getX(-d,-u),O=l.getY(-d,-u),h.batchQuad(n,x,T,C,M,w,L,F,O,0,0,1,1,y,y,y,y,2)),n.showRight&&(y=v.getTintAppendFloatAlpha(n.fillRight,g),x=l.getX(d,0),T=l.getY(d,0),C=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),L=l.getY(0,p-u),F=l.getX(d,-u),O=l.getY(d,-u),h.batchQuad(n,x,T,C,M,w,L,F,O,0,0,1,1,y,y,y,y,2)),r.pipelines.postBatch(n)}};c.exports=o},16933:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(60561),o=t(17803),r=new a({Extends:o,Mixins:[v],initialize:function(e,i,h,s,l,f,u,d,p){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=48),l===void 0&&(l=32),f===void 0&&(f=!1),u===void 0&&(u=15658734),d===void 0&&(d=10066329),p===void 0&&(p=13421772),o.call(this,e,"IsoTriangle",null),this.projection=4,this.fillTop=u,this.fillLeft=d,this.fillRight=p,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=f,this.isFilled=!0,this.setPosition(i,h),this.setSize(s,l),this.updateDisplayOrigin()},setProjection:function(n){return this.projection=n,this},setReversed:function(n){return this.isReversed=n,this},setFaces:function(n,e,i){return n===void 0&&(n=!0),e===void 0&&(e=!0),i===void 0&&(i=!0),this.showTop=n,this.showLeft=e,this.showRight=i,this},setFillStyle:function(n,e,i){return this.fillTop=n,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});c.exports=r},79590:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(20926),o=function(r,n,e,i){e.addToRenderList(n);var h=r.currentContext;if(v(r,h,n,e,i)&&n.isFilled){var s=n.width,l=n.height,f=s/2,u=s/n.projection,d=n.isReversed;n.showTop&&d&&(a(h,n,n.fillTop),h.beginPath(),h.moveTo(-f,-l),h.lineTo(0,-u-l),h.lineTo(f,-l),h.lineTo(0,u-l),h.fill()),n.showLeft&&(a(h,n,n.fillLeft),h.beginPath(),d?(h.moveTo(-f,-l),h.lineTo(0,u),h.lineTo(0,u-l)):(h.moveTo(-f,0),h.lineTo(0,u),h.lineTo(0,u-l)),h.fill()),n.showRight&&(a(h,n,n.fillRight),h.beginPath(),d?(h.moveTo(f,-l),h.lineTo(0,u),h.lineTo(0,u-l)):(h.moveTo(f,0),h.lineTo(0,u),h.lineTo(0,u-l)),h.fill()),h.restore()}};c.exports=o},49803:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(16933);a.register("isotriangle",function(o,r,n,e,i,h,s,l){return this.displayList.add(new v(this.scene,o,r,n,e,i,h,s,l))})},60561:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(51503),o=t(79590),c.exports={renderWebGL:v,renderCanvas:o}},51503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=a(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=n.isReversed,y=e.alpha*n.alpha;if(n.isFilled){r.pipelines.preBatch(n);var x,T,C,M,w,L,F;if(n.showTop&&g){x=v.getTintAppendFloatAlpha(n.fillTop,y),T=l.getX(-d,-u),C=l.getY(-d,-u),M=l.getX(0,-p-u),w=l.getY(0,-p-u),L=l.getX(d,-u),F=l.getY(d,-u);var O=l.getX(0,p-u),N=l.getY(0,p-u);h.batchQuad(n,T,C,M,w,L,F,O,N,0,0,1,1,x,x,x,x,2)}n.showLeft&&(x=v.getTintAppendFloatAlpha(n.fillLeft,y),g?(T=l.getX(-d,-u),C=l.getY(-d,-u),M=l.getX(0,p),w=l.getY(0,p),L=l.getX(0,p-u),F=l.getY(0,p-u)):(T=l.getX(-d,0),C=l.getY(-d,0),M=l.getX(0,p),w=l.getY(0,p),L=l.getX(0,p-u),F=l.getY(0,p-u)),h.batchTri(n,T,C,M,w,L,F,0,0,1,1,x,x,x,2)),n.showRight&&(x=v.getTintAppendFloatAlpha(n.fillRight,y),g?(T=l.getX(d,-u),C=l.getY(d,-u),M=l.getX(0,p),w=l.getY(0,p),L=l.getX(0,p-u),F=l.getY(0,p-u)):(T=l.getX(d,0),C=l.getY(d,0),M=l.getX(0,p),w=l.getY(0,p),L=l.getX(0,p-u),F=l.getY(0,p-u)),h.batchTri(n,T,C,M,w,L,F,0,0,1,1,x,x,x,2)),r.pipelines.postBatch(n)}};c.exports=o},57847:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(17803),o=t(23031),r=t(36823),n=new a({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=128),d===void 0&&(d=0),v.call(this,i,"Line",new o(l,f,u,d));var y=Math.max(1,this.geom.right-this.geom.left),x=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(h,s),this.setSize(y,x),p!==void 0&&this.setStrokeStyle(1,p,g),this.updateDisplayOrigin()},setLineWidth:function(e,i){return i===void 0&&(i=e),this._startWidth=e,this._endWidth=i,this.lineWidth=e,this},setTo:function(e,i,h,s){return this.geom.setTo(e,i,h,s),this}});c.exports=n},17440:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(75177),v=t(20926),o=function(r,n,e,i){e.addToRenderList(n);var h=r.currentContext;if(v(r,h,n,e,i)){var s=n._displayOriginX,l=n._displayOriginY;n.isStroked&&(a(h,n),h.beginPath(),h.moveTo(n.geom.x1-s,n.geom.y1-l),h.lineTo(n.geom.x2-s,n.geom.y2-l),h.stroke()),h.restore()}};c.exports=o},2481:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(57847);a.register("line",function(o,r,n,e,i,h,s,l){return this.displayList.add(new v(this.scene,o,r,n,e,i,h,s,l))})},36823:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(77385),o=t(17440),c.exports={renderWebGL:v,renderCanvas:o}},77385:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(70554),o=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=a(n,e,i);h.calcMatrix.copyFrom(s.calc);var l=n._displayOriginX,f=n._displayOriginY,u=e.alpha*n.alpha;if(r.pipelines.preBatch(n),n.isStroked){var d=h.strokeTint,p=v.getTintAppendFloatAlpha(n.strokeColor,n.strokeAlpha*u);d.TL=p,d.TR=p,d.BL=p,d.BR=p,h.batchLine(n.geom.x1-l,n.geom.y1-f,n.geom.x2-l,n.geom.y2-f,n._startWidth/2,n._endWidth/2,1,0,!1,s.sprite,s.camera)}r.pipelines.postBatch(n)};c.exports=o},24949:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(90273),v=t(83419),o=t(94811),r=t(13829),n=t(25717),e=t(17803),i=t(5469),h=new v({Extends:e,Mixins:[a],initialize:function(l,f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),e.call(this,l,"Polygon",new n(d));var y=r(this.geom);this.setPosition(f,u),this.setSize(y.width,y.height),p!==void 0&&this.setFillStyle(p,g),this.updateDisplayOrigin(),this.updateData()},smooth:function(s){s===void 0&&(s=1);for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(24949);a.register("polygon",function(o,r,n,e,i){return this.displayList.add(new v(this.scene,o,r,n,e,i))})},90273:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(73695),o=t(38710),c.exports={renderWebGL:v,renderCanvas:o}},73695:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10441),v=t(91296),o=t(34682),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=v(e,i,h),f=s.calcMatrix.copyFrom(l.calc),u=e._displayOriginX,d=e._displayOriginY,p=i.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&a(s,f,e,p,u,d),e.isStroked&&o(s,e,p,u,d),n.pipelines.postBatch(e)};c.exports=r},74561:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(87841),o=t(17803),r=t(95597),n=new a({Extends:o,Mixins:[r],initialize:function(i,h,s,l,f,u,d){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=128),f===void 0&&(f=128),o.call(this,i,"Rectangle",new v(0,0,l,f)),this.setPosition(h,s),this.setSize(l,f),u!==void 0&&this.setFillStyle(u,d),this.updateDisplayOrigin(),this.updateData()},setSize:function(e,i){this.width=e,this.height=i,this.geom.setSize(e,i),this.updateData(),this.updateDisplayOrigin();var h=this.input;return h&&!h.customHitArea&&(h.hitArea.width=e,h.hitArea.height=i),this},updateData:function(){var e=[],i=this.geom,h=this._tempLine;return i.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),i.getLineB(h),e.push(h.x2,h.y2),i.getLineC(h),e.push(h.x2,h.y2),i.getLineD(h),e.push(h.x2,h.y2),this.pathData=e,this}});c.exports=n},48682:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY;e.isFilled&&(a(s,e),s.fillRect(-l,-f,e.width,e.height)),e.isStroked&&(v(s,e),s.beginPath(),s.rect(-l,-f,e.width,e.height),s.stroke()),s.restore()}};c.exports=r},87959:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(74561);a.register("rectangle",function(o,r,n,e,i,h){return this.displayList.add(new v(this.scene,o,r,n,e,i,h))})},95597:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(52059),o=t(48682),c.exports={renderWebGL:v,renderCanvas:o}},52059:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(34682),o=t(70554),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=a(e,i,h);s.calcMatrix.copyFrom(l.calc);var f=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var p=s.fillTint,g=o.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d);p.TL=g,p.TR=g,p.BL=g,p.BR=g,s.batchFillRect(-f,-u,e.width,e.height)}e.isStroked&&v(s,e,d,f,u),n.pipelines.postBatch(e)};c.exports=r},55911:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(81991),v=t(83419),o=t(94811),r=t(17803),n=new v({Extends:r,Mixins:[a],initialize:function(i,h,s,l,f,u,d,p){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=5),f===void 0&&(f=32),u===void 0&&(u=64),r.call(this,i,"Star",null),this._points=l,this._innerRadius=f,this._outerRadius=u,this.setPosition(h,s),this.setSize(u*2,u*2),d!==void 0&&this.setFillStyle(d,p),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=[],i=this._points,h=this._innerRadius,s=this._outerRadius,l=Math.PI/2*3,f=Math.PI/i,u=s,d=s;e.push(u,d+-s);for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(55911),v=t(39429);v.register("star",function(o,r,n,e,i,h,s){return this.displayList.add(new a(this.scene,o,r,n,e,i,h,s))})},81991:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(57017),o=t(64272),c.exports={renderWebGL:v,renderCanvas:o}},57017:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10441),v=t(91296),o=t(34682),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=v(e,i,h),f=s.calcMatrix.copyFrom(l.calc),u=e._displayOriginX,d=e._displayOriginY,p=i.alpha*e.alpha;n.pipelines.preBatch(e),e.isFilled&&a(s,f,e,p,u,d),e.isStroked&&o(s,e,p,u,d),n.pipelines.postBatch(e)};c.exports=r},36931:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(17803),o=t(16483),r=t(96195),n=new a({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g,y,x){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=128),u===void 0&&(u=64),d===void 0&&(d=0),p===void 0&&(p=128),g===void 0&&(g=128),v.call(this,i,"Triangle",new o(l,f,u,d,p,g));var T=this.geom.right-this.geom.left,C=this.geom.bottom-this.geom.top;this.setPosition(h,s),this.setSize(T,C),y!==void 0&&this.setFillStyle(y,x),this.updateDisplayOrigin(),this.updateData()},setTo:function(e,i,h,s,l,f){return this.geom.setTo(e,i,h,s,l,f),this.updateData()},updateData:function(){var e=[],i=this.geom,h=this._tempLine;return i.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),i.getLineB(h),e.push(h.x2,h.y2),i.getLineC(h),e.push(h.x2,h.y2),this.pathData=e,this}});c.exports=n},85172:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(65960),v=t(75177),o=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(o(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.geom.x1-l,d=e.geom.y1-f,p=e.geom.x2-l,g=e.geom.y2-f,y=e.geom.x3-l,x=e.geom.y3-f;s.beginPath(),s.moveTo(u,d),s.lineTo(p,g),s.lineTo(y,x),s.closePath(),e.isFilled&&(a(s,e),s.fill()),e.isStroked&&(v(s,e),s.stroke()),s.restore()}};c.exports=r},45245:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(36931);a.register("triangle",function(o,r,n,e,i,h,s,l,f,u){return this.displayList.add(new v(this.scene,o,r,n,e,i,h,s,l,f,u))})},96195:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(83253),o=t(85172),c.exports={renderWebGL:v,renderCanvas:o}},83253:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=t(34682),o=t(70554),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=a(e,i,h);s.calcMatrix.copyFrom(l.calc);var f=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var p=s.fillTint,g=o.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d);p.TL=g,p.TR=g,p.BL=g,p.BR=g;var y=e.geom.x1-f,x=e.geom.y1-u,T=e.geom.x2-f,C=e.geom.y2-u,M=e.geom.x3-f,w=e.geom.y3-u;s.batchFillTriangle(y,x,T,C,M,w,l.sprite,l.camera)}e.isStroked&&v(s,e,d,f,u),n.pipelines.postBatch(e)};c.exports=r},68287:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(9674),v=t(83419),o=t(31401),r=t(95643),n=t(92751),e=new v({Extends:r,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Size,o.TextureCrop,o.Tint,o.Transform,o.Visible,n],initialize:function(h,s,l,f,u){r.call(this,h,"Sprite"),this._crop=this.resetCropObject(),this.anims=new a(this),this.setTexture(f,u),this.setPosition(s,l),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(i,h){this.anims.update(i,h)},play:function(i,h){return this.anims.play(i,h)},playReverse:function(i,h){return this.anims.playReverse(i,h)},playAfterDelay:function(i,h){return this.anims.playAfterDelay(i,h)},playAfterRepeat:function(i,h){return this.anims.playAfterRepeat(i,h)},chain:function(i){return this.anims.chain(i)},stop:function(){return this.anims.stop()},stopAfterDelay:function(i){return this.anims.stopAfterDelay(i)},stopAfterRepeat:function(i){return this.anims.stopAfterRepeat(i)},stopOnFrame:function(i){return this.anims.stopOnFrame(i)},toJSON:function(){return o.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});c.exports=e},76552:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a),t.batchSprite(a,a.frame,v,o)};c.exports=m},15567:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(13059),o=t(44603),r=t(23568),n=t(68287);o.register("sprite",function(e,i){e===void 0&&(e={});var h=r(e,"key",null),s=r(e,"frame",null),l=new n(this.scene,0,0,h,s);return i!==void 0&&(e.add=i),a(this.scene,l,e),v(l,e),l})},46409:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(68287);a.register("sprite",function(o,r,n,e){return this.displayList.add(new v(this.scene,o,r,n,e))})},92751:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(9409),o=t(76552),c.exports={renderWebGL:v,renderCanvas:o}},9409:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v.addToRenderList(a),a.pipeline.batchSprite(a,v,o)};c.exports=m},14220:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=t.canvas,r=t.context,n=t.style,e=[],i=0,h=v.length;n.maxLines>0&&n.maxLines1&&(l+=t.letterSpacing*(v[s].length-1)),n.wordWrap&&(l-=r.measureText(" ").width),e[s]=Math.ceil(l),i=Math.max(i,e[s])}var f=a.fontSize+n.strokeThickness,u=f*h,d=t.lineSpacing;return h>1&&(u+=d*(h-1)),{width:i,height:u,lines:h,lineWidths:e,lineSpacing:d,lineHeight:f}};c.exports=m},79557:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=function(o){var r=a.create(this),n=r.getContext("2d",{willReadFrequently:!0});o.syncFont(r,n);var e=n.measureText(o.testString);if("actualBoundingBoxAscent"in e){var i=e.actualBoundingBoxAscent,h=e.actualBoundingBoxDescent;return a.remove(r),{ascent:i,descent:h,fontSize:i+h}}var s=Math.ceil(e.width*o.baselineX),l=s,f=2*l;l=l*o.baselineY|0,r.width=s,r.height=f,n.fillStyle="#f00",n.fillRect(0,0,s,f),n.font=o._font,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(o.testString,0,l);var u={ascent:0,descent:0,fontSize:0},d=n.getImageData(0,0,s,f);if(!d)return u.ascent=l,u.descent=l+6,u.fontSize=u.ascent+u.descent,a.remove(r),u;var p=d.data,g=p.length,y=s*4,x,T,C=0,M=!1;for(x=0;xl;x--){for(T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(40366),v=t(27919),o=t(83419),r=t(31401),n=t(95643),e=t(14220),i=t(35154),h=t(35846),s=t(61771),l=t(35762),f=t(45650),u=new o({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,s],initialize:function(p,g,y,x,T){g===void 0&&(g=0),y===void 0&&(y=0),n.call(this,p,"Text"),this.renderer=p.sys.renderer,this.setPosition(g,y),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=v.create(this),this.context,this.style=new l(this,T),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=p.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(x),T&&T.padding&&this.setPadding(T.padding),T&&T.lineSpacing&&this.setLineSpacing(T.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",a(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(d){var p=this.style;if(p.wordWrapCallback){var g=p.wordWrapCallback.call(p.wordWrapCallbackScope,d,this);return Array.isArray(g)&&(g=g.join(` -`)),g}else return p.wordWrapWidth?p.wordWrapUseAdvanced?this.advancedWordWrap(d,this.context,this.style.wordWrapWidth):this.basicWordWrap(d,this.context,this.style.wordWrapWidth):d},advancedWordWrap:function(d,p,g){for(var y="",x=d.replace(/ +/gi," ").split(this.splitRegExp),T=x.length,C=0;CF){if(N===0){for(var K=V;K.length&&(K=K.slice(0,-1),j=p.measureText(K).width,!(j<=F)););if(!K.length)throw new Error("wordWrapWidth < a single character");var J=G.substr(K.length);O[N]=J,w+=K}var X=O[N].length?N:N+1,Y=O.slice(X).join(" ").replace(/[ \n]*$/gi,"");x.splice(C+1,0,Y),T=x.length;break}else w+=V,F-=j}y+=w.replace(/[ \n]*$/gi,"")+` -`}return y=y.replace(/[\s|\n]*$/gi,""),y},basicWordWrap:function(d,p,g){for(var y="",x=d.split(this.splitRegExp),T=x.length-1,C=p.measureText(" ").width,M=0;M<=T;M++){for(var w=g,L=x[M].split(" "),F=L.length-1,O=0;O<=F;O++){var N=L[O],G=p.measureText(N).width,V=G;Ow&&O>0&&(y+=` -`,w=g),y+=N,O0&&(G+=M.lineSpacing*V),g.rtl)N=F-N-w.left-w.right;else if(g.align==="right")N+=L-M.lineWidths[V];else if(g.align==="center")N+=(L-M.lineWidths[V])/2;else if(g.align==="justify"){var j=.85;if(M.lineWidths[V]/M.width>=j){var K=M.width-M.lineWidths[V],J=p.measureText(" ").width,X=C[V].trim(),Y=X.split(" ");K+=(C[V].length-X.length)*J;for(var D=Math.floor(K/J),z=0;D>0;)Y[z]+=" ",z=(z+1)%(Y.length-1||1),--D;C[V]=Y.join(" ")}}if(this.autoRound&&(N=Math.round(N),G=Math.round(G)),g.strokeThickness&&(g.syncShadow(p,g.shadowStroke),p.strokeText(C[V],N,G)),g.color){g.syncShadow(p,g.shadowFill);var W=this.letterSpacing;if(W!==0)for(var H=0,Z=C[V].split(""),Q=0;Q{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a.width===0||a.height===0||(v.addToRenderList(a),t.batchSprite(a,a.frame,v,o))};c.exports=m},71259:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(50171);v.register("text",function(n,e){n===void 0&&(n={});var i=o(n,"text",""),h=o(n,"style",null),s=o(n,"padding",null);s!==null&&(h.padding=s);var l=new r(this.scene,0,0,i,h);return e!==void 0&&(n.add=e),a(this.scene,l,n),l.autoRound=o(n,"autoRound",!0),l.resolution=o(n,"resolution",1),l})},68005:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(50171),v=t(39429);v.register("text",function(o,r,n,e){return this.displayList.add(new a(this.scene,o,r,n,e))})},61771:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(34397),o=t(79724),c.exports={renderWebGL:v,renderCanvas:o}},35762:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23568),o=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 a({initialize:function(h,s){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(s,!1,!0)},setStyle:function(i,h,s){h===void 0&&(h=!0),s===void 0&&(s=!1),i&&i.hasOwnProperty("fontSize")&&typeof i.fontSize=="number"&&(i.fontSize=i.fontSize.toString()+"px");for(var l in n){var f=s?n[l][1]:this[l];l==="wordWrapCallback"||l==="wordWrapCallbackScope"?this[l]=o(i,n[l][0],f):this[l]=v(i,n[l][0],f)}var u=o(i,"font",null);u!==null&&this.setFont(u,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var d=o(i,"fill",null);d!==null&&(this.color=d);var p=o(i,"metrics",!1);return p?this.metrics={ascent:o(p,"ascent",0),descent:o(p,"descent",0),fontSize:o(p,"fontSize",0)}:(h||!this.metrics)&&(this.metrics=r(this)),h?this.parent.updateText():this.parent},syncFont:function(i,h){h.font=this._font},syncStyle:function(i,h){h.textBaseline="alphabetic",h.fillStyle=this.color,h.strokeStyle=this.stroke,h.lineWidth=this.strokeThickness,h.lineCap="round",h.lineJoin="round"},syncShadow:function(i,h){h?(i.shadowOffsetX=this.shadowOffsetX,i.shadowOffsetY=this.shadowOffsetY,i.shadowColor=this.shadowColor,i.shadowBlur=this.shadowBlur):(i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowColor=0,i.shadowBlur=0)},update:function(i){return i&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=r(this)),this.parent.updateText()},setFont:function(i,h){h===void 0&&(h=!0);var s=i,l="",f="";if(typeof i!="string")s=o(i,"fontFamily","Courier"),l=o(i,"fontSize","16px"),f=o(i,"fontStyle","");else{var u=i.split(" "),d=0;f=u.length>2?u[d++]:"",l=u[d++]||"16px",s=u[d++]||"Courier"}return(s!==this.fontFamily||l!==this.fontSize||f!==this.fontStyle)&&(this.fontFamily=s,this.fontSize=l,this.fontStyle=f,h&&this.update(!0)),this.parent},setFontFamily:function(i){return this.fontFamily!==i&&(this.fontFamily=i,this.update(!0)),this.parent},setFontStyle:function(i){return this.fontStyle!==i&&(this.fontStyle=i,this.update(!0)),this.parent},setFontSize:function(i){return typeof i=="number"&&(i=i.toString()+"px"),this.fontSize!==i&&(this.fontSize=i,this.update(!0)),this.parent},setTestString:function(i){return this.testString=i,this.update(!0)},setFixedSize:function(i,h){return this.fixedWidth=i,this.fixedHeight=h,i&&(this.parent.width=i),h&&(this.parent.height=h),this.update(!1)},setBackgroundColor:function(i){return this.backgroundColor=i,this.update(!1)},setFill:function(i){return this.color=i,this.update(!1)},setColor:function(i){return this.color=i,this.update(!1)},setResolution:function(i){return this.resolution=i,this.update(!1)},setStroke:function(i,h){return h===void 0&&(h=this.strokeThickness),i===void 0&&this.strokeThickness!==0?(this.strokeThickness=0,this.update(!0)):(this.stroke!==i||this.strokeThickness!==h)&&(this.stroke=i,this.strokeThickness=h,this.update(!0)),this.parent},setShadow:function(i,h,s,l,f,u){return i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s="#000"),l===void 0&&(l=0),f===void 0&&(f=!1),u===void 0&&(u=!0),this.shadowOffsetX=i,this.shadowOffsetY=h,this.shadowColor=s,this.shadowBlur=l,this.shadowStroke=f,this.shadowFill=u,this.update(!1)},setShadowOffset:function(i,h){return i===void 0&&(i=0),h===void 0&&(h=i),this.shadowOffsetX=i,this.shadowOffsetY=h,this.update(!1)},setShadowColor:function(i){return i===void 0&&(i="#000"),this.shadowColor=i,this.update(!1)},setShadowBlur:function(i){return i===void 0&&(i=0),this.shadowBlur=i,this.update(!1)},setShadowStroke:function(i){return this.shadowStroke=i,this.update(!1)},setShadowFill:function(i){return this.shadowFill=i,this.update(!1)},setWordWrapWidth:function(i,h){return h===void 0&&(h=!1),this.wordWrapWidth=i,this.wordWrapUseAdvanced=h,this.update(!1)},setWordWrapCallback:function(i,h){return h===void 0&&(h=null),this.wordWrapCallback=i,this.wordWrapCallbackScope=h,this.update(!1)},setAlign:function(i){return i===void 0&&(i="left"),this.align=i,this.update(!1)},setMaxLines:function(i){return i===void 0&&(i=0),this.maxLines=i,this.update(!1)},getTextMetrics:function(){var i=this.metrics;return{ascent:i.ascent,descent:i.descent,fontSize:i.fontSize}},toJSON:function(){var i={};for(var h in n)i[h]=this[h];return i.metrics=this.getTextMetrics(),i},destroy:function(){this.parent=void 0}});c.exports=e},34397:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70554),v=function(o,r,n,e){if(!(r.width===0||r.height===0)){n.addToRenderList(r);var i=r.frame,h=i.width,s=i.height,l=a.getTintAppendFloatAlpha,f=o.pipelines.set(r.pipeline,r),u=f.setTexture2D(i.glTexture,r);f.batchTexture(r,i.glTexture,h,s,r.x,r.y,h/r.style.resolution,s/r.style.resolution,r.scaleX,r.scaleY,r.rotation,r.flipX,r.flipY,r.scrollFactorX,r.scrollFactorY,r.displayOriginX,r.displayOriginY,0,0,h,s,l(r.tintTopLeft,n.alpha*r._alphaTL),l(r.tintTopRight,n.alpha*r._alphaTR),l(r.tintBottomLeft,n.alpha*r._alphaBL),l(r.tintBottomRight,n.alpha*r._alphaBR),r.tintFill,0,0,n,e,!1,u)}};c.exports=v},20839:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=t(83419),o=t(31401),r=t(95643),n=t(98439),e=t(68703),i=t(56295),h=t(45650),s=t(26099),l=8,f=new v({Extends:r,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,i],initialize:function(d,p,g,y,x,T,C){var M=d.sys.renderer;r.call(this,d,"TileSprite");var w=d.sys.textures.get(T),L=w.get(C);L.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),w=d.sys.textures.get("__MISSING"),L=w.get()),w.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),w=d.sys.textures.get("__MISSING"),L=w.get()),!y||!x?(y=L.width,x=L.height):(y=Math.floor(y),x=Math.floor(x)),this._tilePosition=new s,this._tileScale=new s(1,1),this.dirty=!1,this.renderer=M,this.canvas=a.create(this,y,x),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=w,this.displayFrame=L,this._crop=this.resetCropObject(),this._textureKey=h(),this.texture=d.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=n(L.width),this.potHeight=n(L.height),this.fillCanvas=a.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(p,g),this.setSize(y,x),this.setFrame(C),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(u,d){return this.displayTexture=this.scene.sys.textures.get(u),this.setFrame(d)},setFrame:function(u){var d=this.displayTexture.get(u);return this.potWidth=n(d.width),this.potHeight=n(d.height),this.canvas.width=0,!d.cutWidth||!d.cutHeight?this.renderFlags&=~l:this.renderFlags|=l,this.displayFrame=d,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(u,d){return u!==void 0&&(this.tilePositionX=u),d!==void 0&&(this.tilePositionY=d),this},setTileScale:function(u,d){return u===void 0&&(u=this.tileScaleX),d===void 0&&(d=u),this.tileScaleX=u,this.tileScaleY=d,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var u=this.displayFrame;if(u.source.isRenderTexture||u.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var d=this.fillContext,p=this.fillCanvas,g=this.potWidth,y=this.potHeight;(!this.renderer||!this.renderer.gl)&&(g=u.cutWidth,y=u.cutHeight),d.clearRect(0,0,g,y),p.width=g,p.height=y,d.drawImage(u.source.image,u.cutX,u.cutY,u.cutWidth,u.cutHeight,0,0,g,y),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(p,this.fillPattern):this.fillPattern=d.createPattern(p,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var u=this.canvas;if((u.width!==this.width||u.height!==this.height)&&(u.width=this.width,u.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 d=this.context;this.scene.sys.game.config.antialias||e.disable(d);var p=this._tileScale.x,g=this._tileScale.y,y=this._tilePosition.x,x=this._tilePosition.y;d.clearRect(0,0,this.width,this.height),d.save(),d.scale(p,g),d.translate(-y,-x),d.fillStyle=this.fillPattern,d.fillRect(y,x,this.width/p,this.height/g),d.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),a.remove(this.canvas),a.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var u=this.texture;u&&u.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(u){this._tilePosition.x=u,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(u){this._tilePosition.y=u,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(u){this._tileScale.x=u,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(u){this._tileScale.y=u,this.dirty=!0}}});c.exports=f},46992:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a.updateCanvas(),v.addToRenderList(a),t.batchSprite(a,a.frame,v,o)};c.exports=m},14167:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(20839);v.register("tileSprite",function(n,e){n===void 0&&(n={});var i=o(n,"x",0),h=o(n,"y",0),s=o(n,"width",512),l=o(n,"height",512),f=o(n,"key",""),u=o(n,"frame",""),d=new r(this.scene,i,h,s,l,f,u);return e!==void 0&&(n.add=e),a(this.scene,d,n),d})},91681:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20839),v=t(39429);v.register("tileSprite",function(o,r,n,e,i,h){return this.displayList.add(new a(this.scene,o,r,n,e,i,h))})},56295:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(18553),o=t(46992),c.exports={renderWebGL:v,renderCanvas:o}},18553:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70554),v=function(o,r,n,e){r.updateCanvas();var i=r.width,h=r.height;if(!(i===0||h===0)){n.addToRenderList(r);var s=a.getTintAppendFloatAlpha,l=o.pipelines.set(r.pipeline,r),f=l.setTexture2D(r.fillPattern,r);l.batchTexture(r,r.fillPattern,r.displayFrame.width*r.tileScaleX,r.displayFrame.height*r.tileScaleY,r.x,r.y,i,h,r.scaleX,r.scaleY,r.rotation,r.flipX,r.flipY,r.scrollFactorX,r.scrollFactorY,r.originX*i,r.originY*h,0,0,i,h,s(r.tintTopLeft,n.alpha*r._alphaTL),s(r.tintTopRight,n.alpha*r._alphaTR),s(r.tintBottomLeft,n.alpha*r._alphaBL),s(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)}};c.exports=v},18471:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(31401),r=t(51708),n=t(8443),e=t(95643),i=t(36383),h=t(14463),s=t(45650),l=t(10247),f=new v({Extends:e,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.TextureCrop,o.Tint,o.Transform,o.Visible,l],initialize:function(d,p,g,y){e.call(this,d,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=s(),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 x=d.sys.game;this._device=x.device.video,this.setPosition(p,g),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),x.events.on(n.PAUSE,this.globalPause,this),x.events.on(n.RESUME,this.globalResume,this);var T=d.sys.sound;T&&T.on(h.GLOBAL_MUTE,this.globalMute,this),y&&this.load(y)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(u){var d=this.scene.sys.cache.video.get(u);return d?(this.cacheKey=u,this.loadHandler(d.url,d.noAudio,d.crossOrigin)):console.warn("No video in cache for key: "+u),this},changeSource:function(u,d,p,g,y){d===void 0&&(d=!0),p===void 0&&(p=!1),this.cacheKey!==u&&(this.load(u),d&&this.play(p,g,y))},getVideoKey:function(){return this.cacheKey},loadURL:function(u,d,p){d===void 0&&(d=!1);var g=this._device.getVideoURL(u);return g?(this.cacheKey="",this.loadHandler(g.url,d,p)):console.warn("No supported video format found for "+u),this},loadMediaStream:function(u,d,p){return this.loadHandler(null,d,p,u)},loadHandler:function(u,d,p,g){d||(d=!1);var y=this.video;if(y?(this.removeLoadEventHandlers(),this.stop()):(y=document.createElement("video"),y.controls=!1,y.setAttribute("playsinline","playsinline"),y.setAttribute("preload","auto"),y.setAttribute("disablePictureInPicture","true")),d?(y.muted=!0,y.defaultMuted=!0,y.setAttribute("autoplay","autoplay")):(y.muted=!1,y.defaultMuted=!1,y.removeAttribute("autoplay")),p?y.setAttribute("crossorigin",p):y.removeAttribute("crossorigin"),g)if("srcObject"in y)try{y.srcObject=g}catch(T){if(T.name!=="TypeError")throw T;y.src=URL.createObjectURL(g)}else y.src=URL.createObjectURL(g);else y.src=u;this.retry=0,this.video=y,this._playCalled=!1,y.load(),this.addLoadEventHandlers();var x=this.scene.sys.textures.get(this._key);return this.setTexture(x),this},requestVideoFrame:function(u,d){var p=this.video;if(p){var g=d.width,y=d.height,x=this.videoTexture,T=this.videoTextureSource,C=!x||T.source!==p;C?(this._codePaused=p.paused,this._codeMuted=p.muted,x?(T.source=p,T.width=g,T.height=y,x.get().setSize(g,y)):(x=this.scene.sys.textures.create(this._key,p,g,y),x.add("__BASE",0,0,0,g,y),this.setTexture(x),this.videoTexture=x,this.videoTextureSource=x.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(r.VIDEO_TEXTURE,this,x)),this.setSizeToFrame(),this.updateDisplayOrigin()):T.update(),this.isStalled=!1,this.metadata=d;var M=d.mediaTime;C&&(this._lastUpdate=M,this.emit(r.VIDEO_CREATED,this,g,y),this.frameReady||(this.frameReady=!0,this.emit(r.VIDEO_PLAY,this))),this._playingMarker?M>=this._markerOut&&(p.loop?(p.currentTime=this._markerIn,this.emit(r.VIDEO_LOOP,this)):(this.stop(!1),this.emit(r.VIDEO_COMPLETE,this))):M-1&&p>d&&p=0&&!isNaN(p)&&p>d&&(this.markers[u]=[d,p]),this},playMarker:function(u,d){var p=this.markers[u];return p&&this.play(d,p[0],p[1]),this},removeMarker:function(u){return delete this.markers[u],this},snapshot:function(u,d){return u===void 0&&(u=this.width),d===void 0&&(d=this.height),this.snapshotArea(0,0,this.width,this.height,u,d)},snapshotArea:function(u,d,p,g,y,x){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=this.width),g===void 0&&(g=this.height),y===void 0&&(y=p),x===void 0&&(x=g);var T=this.video,C=this.snapshotTexture;return C?(C.setSize(y,x),T&&C.context.drawImage(T,u,d,p,g,0,0,y,x)):(C=this.scene.sys.textures.createCanvas(s(),y,x),this.snapshotTexture=C,T&&C.context.drawImage(T,u,d,p,g,0,0,y,x)),C.update()},saveSnapshotTexture:function(u){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,u):this.snapshotTexture=this.scene.sys.textures.createCanvas(u,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 u=this.scene.sys.sound;u&&u.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(u){var d=u.name;d==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(r.VIDEO_LOCKED,this)):d==="NotSupportedError"?(this.stop(!1),this.emit(r.VIDEO_UNSUPPORTED,this,u)):(this.stop(!1),this.emit(r.VIDEO_ERROR,this,u))},legacyPlayHandler:function(){var u=this.video;u&&(this.playSuccess(),u.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(r.VIDEO_PLAYING,this)},loadErrorHandler:function(u){this.stop(!1),this.emit(r.VIDEO_ERROR,this,u)},metadataHandler:function(u){this.emit(r.VIDEO_METADATA,this,u)},setSizeToFrame:function(u){u||(u=this.frame),this.width=u.realWidth,this.height=u.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var d=this.input;return d&&!d.customHitArea&&(d.hitArea.width=this.width,d.hitArea.height=this.height),this},stalledHandler:function(u){this.isStalled=!0,this.emit(r.VIDEO_STALLED,this,u)},completeHandler:function(){this._playCalled=!1,this.emit(r.VIDEO_COMPLETE,this)},preUpdate:function(u,d){var p=this.video;!p||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=d,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(u){var d=this.video;if(d){var p=d.duration;if(p!==1/0&&!isNaN(p)){var g=p*u;this.setCurrentTime(g)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(u){var d=this.video;if(d){if(typeof u=="string"){var p=u[0],g=parseFloat(u.substr(1));p==="+"?u=d.currentTime+g:p==="-"&&(u=d.currentTime-g)}d.currentTime=u}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 u=this.video;if(u){var d=u.duration;if(d!==1/0&&!isNaN(d))return u.currentTime/d}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(u){u===void 0&&(u=!0),this._codeMuted=u;var d=this.video;return d&&(d.muted=this._systemMuted?!0:u),this},isMuted:function(){return this._codeMuted},globalMute:function(u,d){this._systemMuted=d;var p=this.video;p&&(p.muted=this._codeMuted?!0:d)},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(u){u===void 0&&(u=!0);var d=this.video;return this._codePaused=u,d&&!d.ended&&(u?d.paused||(this.removeEventHandlers(),d.pause()):u||(this._playCalled?d.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(u){return u===void 0&&(u=1),this.video&&(this.video.volume=a(u,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(u){return this.video&&(this.video.playbackRate=u),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(u){return u===void 0&&(u=!0),this.video&&(this.video.loop=u),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(u,d){return d===void 0&&(d=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,u),this.videoTextureSource.setFlipY(d)),this._key=u,this.flipY=d,!!this.videoTexture},stop:function(u){u===void 0&&(u=!0);var d=this.video;return d&&(this.removeEventHandlers(),d.cancelVideoFrameCallback(this._rfvCallbackId),d.pause()),this.retry=0,this._playCalled=!1,u&&this.emit(r.VIDEO_STOP,this),this},removeVideoElement:function(){var u=this.video;if(u){for(u.parentNode&&u.parentNode.removeChild(u);u.hasChildNodes();)u.removeChild(u.firstChild);u.removeAttribute("autoplay"),u.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var u=this.scene.sys.game.events;u.off(n.PAUSE,this.globalPause,this),u.off(n.RESUME,this.globalResume,this);var d=this.scene.sys.sound;d&&d.off(h.GLOBAL_MUTE,this.globalMute,this)}});c.exports=f},58352:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a.videoTexture&&(v.addToRenderList(a),t.batchSprite(a,a.frame,v,o))};c.exports=m},11511:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25305),v=t(44603),o=t(23568),r=t(18471);v.register("video",function(n,e){n===void 0&&(n={});var i=o(n,"key",null),h=new r(this.scene,0,0,i);return e!==void 0&&(n.add=e),a(this.scene,h,n),h})},89025:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(18471),v=t(39429);v.register("video",function(o,r,n){return this.displayList.add(new a(this.scene,o,r,n))})},10247:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(29849),o=t(58352),c.exports={renderWebGL:v,renderCanvas:o}},29849:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a.videoTexture&&(v.addToRenderList(a),a.pipeline.batchSprite(a,v,o))};c.exports=m},41481:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(96503),o=t(87902),r=t(83419),n=t(31401),e=t(95643),i=t(87841),h=t(37303),s=new r({Extends:e,Mixins:[n.Depth,n.GetBounds,n.Origin,n.Transform,n.ScrollFactor,n.Visible],initialize:function(f,u,d,p,g){p===void 0&&(p=1),g===void 0&&(g=p),e.call(this,f,"Zone"),this.setPosition(u,d),this.width=p,this.height=g,this.blendMode=a.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(l){this.scaleX=l/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(l){this.scaleY=l/this.height}},setSize:function(l,f,u){u===void 0&&(u=!0),this.width=l,this.height=f,this.updateDisplayOrigin();var d=this.input;return u&&d&&!d.customHitArea&&(d.hitArea.width=l,d.hitArea.height=f),this},setDisplaySize:function(l,f){return this.displayWidth=l,this.displayHeight=f,this},setCircleDropZone:function(l){return this.setDropZone(new v(0,0,l),o)},setRectangleDropZone:function(l,f){return this.setDropZone(new i(0,0,l,f),h)},setDropZone:function(l,f){return this.input||this.setInteractive(l,f,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(l,f,u){u.addToRenderList(f)},renderWebGL:function(l,f,u){u.addToRenderList(f)}});c.exports=s},95261:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(44603),v=t(23568),o=t(41481);a.register("zone",function(r){var n=v(r,"x",0),e=v(r,"y",0),i=v(r,"width",1),h=v(r,"height",i);return new o(this.scene,n,e,i,h)})},84175:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41481),v=t(39429);v.register("zone",function(o,r,n,e){return this.displayList.add(new a(this.scene,o,r,n,e))})},95166:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0};c.exports=m},96503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(87902),o=t(26241),r=t(79124),n=t(23777),e=t(28176),i=new a({initialize:function(s,l,f){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),this.type=n.CIRCLE,this.x=s,this.y=l,this._radius=f,this._diameter=f*2},contains:function(h,s){return v(this,h,s)},getPoint:function(h,s){return o(this,h,s)},getPoints:function(h,s,l){return r(this,h,s,l)},getRandomPoint:function(h){return e(this,h)},setTo:function(h,s,l){return this.x=h,this.y=s,this._radius=l,this._diameter=l*2,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(h,s){return s===void 0&&(s=h),this.x=h,this.y=s,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}}});c.exports=i},71562:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return 2*(Math.PI*t.radius)};c.exports=m},92110:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n){return n===void 0&&(n=new a),n.x=o.x+o.radius*Math.cos(r),n.y=o.y+o.radius*Math.sin(r),n};c.exports=v},42250:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(96503),v=function(o){return new a(o.x,o.y,o.radius)};c.exports=v},87902:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(t.radius>0&&a>=t.left&&a<=t.right&&v>=t.top&&v<=t.bottom){var o=(t.x-a)*(t.x-a),r=(t.y-v)*(t.y-v);return o+r<=t.radius*t.radius}else return!1};c.exports=m},5698:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87902),v=function(o,r){return a(o,r.x,r.y)};c.exports=v},70588:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87902),v=function(o,r){return a(o,r.x,r.y)&&a(o,r.right,r.y)&&a(o,r.x,r.bottom)&&a(o,r.right,r.bottom)};c.exports=v},26394:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x,t.y,t.radius)};c.exports=m},76278:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x===a.x&&t.y===a.y&&t.radius===a.radius};c.exports=m},2074:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r){return r===void 0&&(r=new a),r.x=o.left,r.y=o.top,r.width=o.diameter,r.height=o.diameter,r};c.exports=v},26241:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(92110),v=t(62945),o=t(36383),r=t(2141),n=function(e,i,h){h===void 0&&(h=new r);var s=v(i,0,o.PI2);return a(e,s,h)};c.exports=n},79124:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(71562),v=t(92110),o=t(62945),r=t(36383),n=function(e,i,h,s){s===void 0&&(s=[]),!i&&h>0&&(i=a(e)/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 m=function(t,a,v){return t.x+=a,t.y+=v,t};c.exports=m},39212:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x+=a.x,t.y+=a.y,t};c.exports=m},28176:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){r===void 0&&(r=new a);var n=2*Math.PI*Math.random(),e=Math.random()+Math.random(),i=e>1?2-e:e,h=i*Math.cos(n),s=i*Math.sin(n);return r.x=o.x+h*o.radius,r.y=o.y+s*o.radius,r};c.exports=v},88911:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(96503);a.Area=t(95166),a.Circumference=t(71562),a.CircumferencePoint=t(92110),a.Clone=t(42250),a.Contains=t(87902),a.ContainsPoint=t(5698),a.ContainsRect=t(70588),a.CopyFrom=t(26394),a.Equals=t(76278),a.GetBounds=t(2074),a.GetPoint=t(26241),a.GetPoints=t(79124),a.Offset=t(50884),a.OffsetPoint=t(39212),a.Random=t(28176),c.exports=a},23777:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6};c.exports=m},78874:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI};c.exports=m},92990:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=t.width/2,v=t.height/2,o=Math.pow(a-v,2)/Math.pow(a+v,2);return Math.PI*(a+v)*(1+3*o/(10+Math.sqrt(4-3*o)))};c.exports=m},79522:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n){n===void 0&&(n=new a);var e=o.width/2,i=o.height/2;return n.x=o.x+e*Math.cos(r),n.y=o.y+i*Math.sin(r),n};c.exports=v},58102:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8497),v=function(o){return new a(o.x,o.y,o.width,o.height)};c.exports=v},81154:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(t.width<=0||t.height<=0)return!1;var o=(a-t.x)/t.width,r=(v-t.y)/t.height;return o*=o,r*=r,o+r<.25};c.exports=m},46662:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(81154),v=function(o,r){return a(o,r.x,r.y)};c.exports=v},1632:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(81154),v=function(o,r){return a(o,r.x,r.y)&&a(o,r.right,r.y)&&a(o,r.x,r.bottom)&&a(o,r.right,r.bottom)};c.exports=v},65534:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x,t.y,t.width,t.height)};c.exports=m},8497:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(81154),o=t(90549),r=t(48320),n=t(23777),e=t(24820),i=new a({initialize:function(s,l,f,u){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),this.type=n.ELLIPSE,this.x=s,this.y=l,this.width=f,this.height=u},contains:function(h,s){return v(this,h,s)},getPoint:function(h,s){return o(this,h,s)},getPoints:function(h,s,l){return r(this,h,s,l)},getRandomPoint:function(h){return e(this,h)},setTo:function(h,s,l,f){return this.x=h,this.y=s,this.width=l,this.height=f,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(h,s){return s===void 0&&(s=h),this.x=h,this.y=s,this},setSize:function(h,s){return s===void 0&&(s=h),this.width=h,this.height=s,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}}});c.exports=i},36146:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height};c.exports=m},23694:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r){return r===void 0&&(r=new a),r.x=o.left,r.y=o.top,r.width=o.width,r.height=o.height,r};c.exports=v},90549:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79522),v=t(62945),o=t(36383),r=t(2141),n=function(e,i,h){h===void 0&&(h=new r);var s=v(i,0,o.PI2);return a(e,s,h)};c.exports=n},48320:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(92990),v=t(79522),o=t(62945),r=t(36383),n=function(e,i,h,s){s===void 0&&(s=[]),!i&&h>0&&(i=a(e)/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 m=function(t,a,v){return t.x+=a,t.y+=v,t};c.exports=m},44808:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x+=a.x,t.y+=a.y,t};c.exports=m},24820:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){r===void 0&&(r=new a);var n=Math.random()*Math.PI*2,e=Math.sqrt(Math.random());return r.x=o.x+e*Math.cos(n)*o.width/2,r.y=o.y+e*Math.sin(n)*o.height/2,r};c.exports=v},49203:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8497);a.Area=t(78874),a.Circumference=t(92990),a.CircumferencePoint=t(79522),a.Clone=t(58102),a.Contains=t(81154),a.ContainsPoint=t(46662),a.ContainsRect=t(1632),a.CopyFrom=t(65534),a.Equals=t(36146),a.GetBounds=t(23694),a.GetPoint=t(90549),a.GetPoints=t(48320),a.Offset=t(73424),a.OffsetPoint=t(44808),a.Random=t(24820),c.exports=a},55738:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23777),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},2044:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20339),v=function(o,r){return a(o.x,o.y,r.x,r.y)<=o.radius+r.radius};c.exports=v},81491:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=a.width/2,o=a.height/2,r=Math.abs(t.x-a.x-v),n=Math.abs(t.y-a.y-o),e=v+t.radius,i=o+t.radius;if(r>e||n>i)return!1;if(r<=v||n<=o)return!0;var h=r-v,s=n-o,l=h*h,f=s*s,u=t.radius*t.radius;return l+f<=u};c.exports=m},63376:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(2044),o=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x,h=r.y,s=r.radius,l=n.x,f=n.y,u=n.radius,d,p,g,y,x;if(h===f)x=(u*u-s*s-l*l+i*i)/(2*(i-l)),d=1,p=-2*f,g=l*l+x*x-2*l*x+f*f-u*u,y=p*p-4*d*g,y===0?e.push(new a(x,-p/(2*d))):y>0&&(e.push(new a(x,(-p+Math.sqrt(y))/(2*d))),e.push(new a(x,(-p-Math.sqrt(y))/(2*d))));else{var T=(i-l)/(h-f),C=(u*u-s*s-l*l+i*i-f*f+h*h)/(2*(h-f));d=T*T+1,p=2*h*T-2*C*T-2*i,g=i*i+h*h+C*C-s*s-2*h*C,y=p*p-4*d*g,y===0?(x=-p/(2*d),e.push(new a(x,C-x*T))):y>0&&(x=(-p+Math.sqrt(y))/(2*d),e.push(new a(x,C-x*T)),x=(-p-Math.sqrt(y))/(2*d),e.push(new a(x,C-x*T)))}}return e};c.exports=o},97439:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(4042),v=t(81491),o=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=n.getLineA(),h=n.getLineB(),s=n.getLineC(),l=n.getLineD();a(i,r,e),a(h,r,e),a(s,r,e),a(l,r,e)}return e};c.exports=o},4042:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(80462),o=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x1,h=r.y1,s=r.x2,l=r.y2,f=n.x,u=n.y,d=n.radius,p=s-i,g=l-h,y=i-f,x=h-u,T=p*p+g*g,C=2*(p*y+g*x),M=y*y+x*x-d*d,w=C*C-4*T*M,L,F;if(w===0){var O=-C/(2*T);L=i+O*p,F=h+O*g,O>=0&&O<=1&&e.push(new a(L,F))}else if(w>0){var N=(-C-Math.sqrt(w))/(2*T);L=i+N*p,F=h+N*g,N>=0&&N<=1&&e.push(new a(L,F));var G=(-C+Math.sqrt(w))/(2*T);L=i+G*p,F=h+G*g,G>=0&&G<=1&&e.push(new a(L,F))}}return e};c.exports=o},36100:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25836),v=function(o,r,n,e){n===void 0&&(n=!1);var i=o.x1,h=o.y1,s=o.x2,l=o.y2,f=r.x1,u=r.y1,d=r.x2,p=r.y2,g=s-i,y=l-h,x=d-f,T=p-u,C=g*T-y*x;if(C===0)return null;var M,w,L;if(n){if(M=(g*(u-h)+y*(i-f))/(x*y-T*g),w=(f+x*M-i)/g,w<0||M<0||M>1)return null;L=w}else{if(M=((f-i)*T-(u-h)*x)/C,w=((h-u)*g-(i-f)*y)/C,M<0||M>1||w<0||w>1)return null;L=M}return e===void 0&&(e=new a),e.set(i+g*L,h+y*L,L)};c.exports=v},3073:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36100),v=t(23031),o=t(25836),r=new v,n=new o,e=function(i,h,s,l){s===void 0&&(s=!1),l===void 0&&(l=new o);var f=!1;l.set(),n.set();for(var u=h[h.length-1],d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25836),v=t(61369),o=t(3073),r=new a,n=function(e,i,h,s){s===void 0&&(s=new v),Array.isArray(i)||(i=[i]);var l=!1;s.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 a=t(2141),v=t(76112),o=t(92773),r=function(n,e,i){if(i===void 0&&(i=[]),o(n,e))for(var h=e.getLineA(),s=e.getLineB(),l=e.getLineC(),f=e.getLineD(),u=[new a,new a,new a,new a],d=[v(h,n,u[0]),v(s,n,u[1]),v(l,n,u[2]),v(f,n,u[3])],p=0;p<4;p++)d[p]&&i.push(u[p]);return i};c.exports=r},71147:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61369),v=t(56362),o=t(23031),r=new o;function n(h,s,l,f,u){var d=Math.cos(h),p=Math.sin(h);r.setTo(s,l,s+d,l+p);var g=v(r,f,!0);g&&u.push(new a(g.x,g.y,h,g.w))}function e(h,s){return h.z-s.z}var i=function(h,s,l){Array.isArray(l)||(l=[l]);for(var f=[],u=[],d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=t(59996),o=function(r,n,e){return e===void 0&&(e=new a),v(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};c.exports=o},52784:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(60646),v=t(59996),o=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.getLineA(),h=r.getLineB(),s=r.getLineC(),l=r.getLineD();a(i,n,e),a(h,n,e),a(s,n,e),a(l,n,e)}return e};c.exports=o},26341:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(89265),v=t(60646),o=function(r,n,e){if(e===void 0&&(e=[]),a(r,n)){var i=n.getLineA(),h=n.getLineB(),s=n.getLineC();v(i,r,e),v(h,r,e),v(s,r,e)}return e};c.exports=o},38720:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(4042),v=t(67636),o=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.getLineA(),h=r.getLineB(),s=r.getLineC();a(i,n,e),a(h,n,e),a(s,n,e)}return e};c.exports=o},13882:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(2822),o=t(76112),r=function(n,e,i){if(i===void 0&&(i=[]),v(n,e))for(var h=n.getLineA(),s=n.getLineB(),l=n.getLineC(),f=[new a,new a,new a],u=[o(h,e,f[0]),o(s,e,f[1]),o(l,e,f[2])],d=0;d<3;d++)u[d]&&i.push(f[d]);return i};c.exports=r},75636:(c,m,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82944),v=t(13882),o=function(r,n,e){if(e===void 0&&(e=[]),a(r,n)){var i=n.getLineA(),h=n.getLineB(),s=n.getLineC();v(r,i,e),v(r,h,e),v(r,s,e)}return e};c.exports=o},80462:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87902),v=t(2141),o=new v,r=function(n,e,i){if(i===void 0&&(i=o),a(e,n.x1,n.y1))return i.x=n.x1,i.y=n.y1,!0;if(a(e,n.x2,n.y2))return i.x=n.x2,i.y=n.y2,!0;var h=n.x2-n.x1,s=n.y2-n.y1,l=e.x-n.x1,f=e.y-n.y1,u=h*h+s*s,d=h,p=s;if(u>0){var g=(l*h+f*s)/u;d*=g,p*=g}i.x=n.x1+d,i.y=n.y1+p;var y=d*d+p*p;return y<=u&&d*h+p*s>=0&&a(e,i.x,i.y)};c.exports=r},76112:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=t.x1,r=t.y1,n=t.x2,e=t.y2,i=a.x1,h=a.y1,s=a.x2,l=a.y2;if(o===n&&r===e||i===s&&h===l)return!1;var f=(l-h)*(n-o)-(s-i)*(e-r);if(f===0)return!1;var u=((s-i)*(r-h)-(l-h)*(o-i))/f,d=((n-o)*(r-h)-(e-r)*(o-i))/f;return u<0||u>1||d<0||d>1?!1:(v&&(v.x=o+u*(n-o),v.y=r+u*(e-r)),!0)};c.exports=m},92773:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.x1,o=t.y1,r=t.x2,n=t.y2,e=a.x,i=a.y,h=a.right,s=a.bottom,l=0;if(v>=e&&v<=h&&o>=i&&o<=s||r>=e&&r<=h&&n>=i&&n<=s)return!0;if(v=e){if(l=o+(n-o)*(e-v)/(r-v),l>i&&l<=s)return!0}else if(v>h&&r<=h&&(l=o+(n-o)*(h-v)/(r-v),l>=i&&l<=s))return!0;if(o=i){if(l=v+(r-v)*(i-o)/(n-o),l>=e&&l<=h)return!0}else if(o>s&&n<=s&&(l=v+(r-v)*(s-o)/(n-o),l>=e&&l<=h))return!0;return!1};c.exports=m},16204:c=>{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){v===void 0&&(v=1);var o=a.x1,r=a.y1,n=a.x2,e=a.y2,i=t.x,h=t.y,s=(n-o)*(n-o)+(e-r)*(e-r);if(s===0)return!1;var l=((i-o)*(n-o)+(h-r)*(e-r))/s;if(l<0)return Math.sqrt((o-i)*(o-i)+(r-h)*(r-h))<=v;if(l>=0&&l<=1){var f=((r-h)*(n-o)-(o-i)*(e-r))/s;return Math.abs(f)*Math.sqrt(s)<=v}else return Math.sqrt((n-i)*(n-i)+(e-h)*(e-h))<=v};c.exports=m},14199:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(16204),v=function(o,r){if(!a(o,r))return!1;var n=Math.min(r.x1,r.x2),e=Math.max(r.x1,r.x2),i=Math.min(r.y1,r.y2),h=Math.max(r.y1,r.y2);return o.x>=n&&o.x<=e&&o.y>=i&&o.y<=h};c.exports=v},59996:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.width<=0||t.height<=0||a.width<=0||a.height<=0?!1:!(t.righta.right||t.y>a.bottom)};c.exports=m},89265:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(76112),v=t(37303),o=t(48653),r=t(77493),n=function(e,i){if(i.left>e.right||i.righte.bottom||i.bottom0};c.exports=n},84411:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r,n){return n===void 0&&(n=0),!(a>t.right+n||vt.bottom+n||r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(80462),v=t(10690),o=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 a=t(76112),v=function(o,r){return!!(o.contains(r.x1,r.y1)||o.contains(r.x2,r.y2)||a(o.getLineA(),r)||a(o.getLineB(),r)||a(o.getLineC(),r))};c.exports=v},82944:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(48653),v=t(71694),o=t(76112),r=function(n,e){if(n.left>e.right||n.righte.bottom||n.bottom0||(d=v(e),p=a(n,d,!0),p.length>0)};c.exports=r},91865:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)};c.exports=m},84993:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){a===void 0&&(a=1),v===void 0&&(v=[]);var o=Math.round(t.x1),r=Math.round(t.y1),n=Math.round(t.x2),e=Math.round(t.y2),i=Math.abs(n-o),h=Math.abs(e-r),s=o-h&&(f-=h,o+=s),d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=a-(t.x1+t.x2)/2,r=v-(t.y1+t.y2)/2;return t.x1+=o,t.y1+=r,t.x2+=o,t.y2+=r,t};c.exports=m},31116:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23031),v=function(o){return new a(o.x1,o.y1,o.x2,o.y2)};c.exports=v},59944:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x1,t.y1,t.x2,t.y2)};c.exports=m},59220:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x1===a.x1&&t.y1===a.y1&&t.x2===a.x2&&t.y2===a.y2};c.exports=m},78177:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=function(o,r,n){n===void 0&&(n=r);var e=a(o),i=o.x2-o.x1,h=o.y2-o.y1;return r&&(o.x1=o.x1-i/e*r,o.y1=o.y1-h/e*r),n&&(o.x2=o.x2+i/e*n,o.y2=o.y2+h/e*n),o};c.exports=v},26708:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(52816),v=t(6113),o=t(2141),r=function(n,e,i,h,s){h===void 0&&(h=0),s===void 0&&(s=[]);var l=[],f=n.x1,u=n.y1,d=n.x2-f,p=n.y2-u,g=v(e,s),y,x,T=i-1;for(y=0;y0){var C=l[0],M=[C];for(y=1;y=h&&(M.push(w),C=w)}var L=l[l.length-1];return a(C,L){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.x=(o.x1+o.x2)/2,r.y=(o.y1+o.y2)/2,r};c.exports=v},99569:(c,m,t)=>{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n){n===void 0&&(n=new a);var e=o.x1,i=o.y1,h=o.x2,s=o.y2,l=(h-e)*(h-e)+(s-i)*(s-i);if(l===0)return n;var f=((r.x-e)*(h-e)+(r.y-i)*(s-i))/l;return n.x=e+f*(h-e),n.y=i+f*(s-i),n};c.exports=v},34638:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(91938),o=t(2141),r=function(n,e){e===void 0&&(e=new o);var i=v(n)-a.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e};c.exports=r},13151:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n){return n===void 0&&(n=new a),n.x=o.x1+(o.x2-o.x1)*r,n.y=o.y1+(o.y2-o.y1)*r,n};c.exports=v},15258:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=t(2141),o=function(r,n,e,i){i===void 0&&(i=[]),!n&&e>0&&(n=a(r)/e);for(var h=r.x1,s=r.y1,l=r.x2,f=r.y2,u=0;u{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.x1,o=t.y1,r=t.x2,n=t.y2,e=(r-v)*(r-v)+(n-o)*(n-o);if(e===0)return!1;var i=((o-a.y)*(r-v)-(v-a.x)*(n-o))/e;return Math.abs(i)*Math.sqrt(e)};c.exports=m},98770:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.abs(t.y1-t.y2)};c.exports=m},35001:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))};c.exports=m},23031:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(13151),o=t(15258),r=t(23777),n=t(65822),e=t(26099),i=new a({initialize:function(s,l,f,u){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),this.type=r.LINE,this.x1=s,this.y1=l,this.x2=f,this.y2=u},getPoint:function(h,s){return v(this,h,s)},getPoints:function(h,s,l){return o(this,h,s,l)},getRandomPoint:function(h){return n(this,h)},setTo:function(h,s,l,f){return h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),this.x1=h,this.y1=s,this.x2=l,this.y2=f,this},setFromObjects:function(h,s){return this.x1=h.x,this.y1=h.y,this.x2=s.x,this.y2=s.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}}});c.exports=i},64795:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(15994),o=t(91938),r=function(n){var e=o(n)-a.TAU;return v(e,-Math.PI,Math.PI)};c.exports=r},52616:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(91938),o=function(r){return Math.cos(v(r)-a.TAU)};c.exports=o},87231:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(91938),o=function(r){return Math.sin(v(r)-a.TAU)};c.exports=o},89662:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t.x1+=a,t.y1+=v,t.x2+=a,t.y2+=v,t};c.exports=m},71165:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return-((t.x2-t.x1)/(t.y2-t.y1))};c.exports=m},65822:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){r===void 0&&(r=new a);var n=Math.random();return r.x=o.x1+n*(o.x2-o.x1),r.y=o.y1+n*(o.y2-o.y1),r};c.exports=v},69777:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91938),v=t(64795),o=function(r,n){return 2*v(n)-Math.PI-a(r)};c.exports=o},39706:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(64400),v=function(o,r){var n=(o.x1+o.x2)/2,e=(o.y1+o.y2)/2;return a(o,n,e,r)};c.exports=v},82585:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(64400),v=function(o,r,n){return a(o,r.x,r.y,n)};c.exports=v},64400:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=Math.cos(o),n=Math.sin(o),e=t.x1-a,i=t.y1-v;return t.x1=e*r-i*n+a,t.y1=e*n+i*r+v,e=t.x2-a,i=t.y2-v,t.x2=e*r-i*n+a,t.y2=e*n+i*r+v,t};c.exports=m},62377:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){return t.x1=a,t.y1=v,t.x2=a+Math.cos(o)*r,t.y2=v+Math.sin(o)*r,t};c.exports=m},71366:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t.y2-t.y1)/(t.x2-t.x1)};c.exports=m},10809:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.abs(t.x1-t.x2)};c.exports=m},2529:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23031);a.Angle=t(91938),a.BresenhamPoints=t(84993),a.CenterOn=t(36469),a.Clone=t(31116),a.CopyFrom=t(59944),a.Equals=t(59220),a.Extend=t(78177),a.GetEasedPoints=t(26708),a.GetMidPoint=t(32125),a.GetNearestPoint=t(99569),a.GetNormal=t(34638),a.GetPoint=t(13151),a.GetPoints=t(15258),a.GetShortestDistance=t(26408),a.Height=t(98770),a.Length=t(35001),a.NormalAngle=t(64795),a.NormalX=t(52616),a.NormalY=t(87231),a.Offset=t(89662),a.PerpSlope=t(71165),a.Random=t(65822),a.ReflectAngle=t(69777),a.Rotate=t(39706),a.RotateAroundPoint=t(82585),a.RotateAroundXY=t(64400),a.SetToAngle=t(62377),a.Slope=t(71366),a.Width=t(10809),c.exports=a},83997:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(87841),o=t(26099);function r(e,i,h,s){var l=e-h,f=i-s,u=l*l+f*f;return Math.sqrt(u)}var n=new a({initialize:function(i,h,s){this.vertex1=i,this.vertex2=h,this.vertex3=s,this.bounds=new v,this._inCenter=new o},getInCenter:function(e){e===void 0&&(e=!0);var i=this.vertex1,h=this.vertex2,s=this.vertex3,l,f,u,d,p,g;e?(l=i.x,f=i.y,u=h.x,d=h.y,p=s.x,g=s.y):(l=i.vx,f=i.vy,u=h.vx,d=h.vy,p=s.vx,g=s.vy);var y=r(p,g,u,d),x=r(l,f,p,g),T=r(u,d,l,f),C=y+x+T;return this._inCenter.set((l*y+u*x+p*T)/C,(f*y+d*x+g*T)/C)},contains:function(e,i,h){var s=this.vertex1,l=this.vertex2,f=this.vertex3,u=s.vx,d=s.vy,p=l.vx,g=l.vy,y=f.vx,x=f.vy;if(h){var T=h.a,C=h.b,M=h.c,w=h.d,L=h.e,F=h.f;u=s.vx*T+s.vy*M+L,d=s.vx*C+s.vy*w+F,p=l.vx*T+l.vy*M+L,g=l.vx*C+l.vy*w+F,y=f.vx*T+f.vy*M+L,x=f.vx*C+f.vy*w+F}var O=y-u,N=x-d,G=p-u,V=g-d,j=e-u,K=i-d,J=O*O+N*N,X=O*G+N*V,Y=O*j+N*K,D=G*G+V*V,z=G*j+V*K,W=J*D-X*X,H=W===0?0:1/W,Z=(D*Y-X*z)*H,Q=(J*z-X*Y)*H;return Z>=0&&Q>=0&&Z+Q<1},isCounterClockwise:function(e){var i=this.vertex1,h=this.vertex2,s=this.vertex3,l=(h.vx-i.vx)*(s.vy-i.vy)-(h.vy-i.vy)*(s.vx-i.vx);return e<=0?l>=0:l<0},load:function(e,i,h,s,l){return h=this.vertex1.load(e,i,h,s,l),h=this.vertex2.load(e,i,h,s,l),h=this.vertex3.load(e,i,h,s,l),h},transformCoordinatesLocal:function(e,i,h,s){return this.vertex1.transformCoordinatesLocal(e,i,h,s),this.vertex2.transformCoordinatesLocal(e,i,h,s),this.vertex3.transformCoordinatesLocal(e,i,h,s),this},updateBounds:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3,s=this.bounds;return s.x=Math.min(e.vx,i.vx,h.vx),s.y=Math.min(e.vy,i.vy,h.vy),s.width=Math.max(e.vx,i.vx,h.vx)-s.x,s.height=Math.max(e.vy,i.vy,h.vy)-s.y,this},isInView:function(e,i,h,s,l,f,u,d,p,g,y){this.update(s,l,f,u,d,p,g,y);var x=this.vertex1,T=this.vertex2,C=this.vertex3;if(x.ta<=0&&T.ta<=0&&C.ta<=0||i&&!this.isCounterClockwise(h))return!1;var M=this.bounds;M.x=Math.min(x.tx,T.tx,C.tx),M.y=Math.min(x.ty,T.ty,C.ty),M.width=Math.max(x.tx,T.tx,C.tx)-M.x,M.height=Math.max(x.ty,T.ty,C.ty)-M.y;var w=e.x+e.width,L=e.y+e.height;return M.width<=0||M.height<=0||e.width<=0||e.height<=0?!1:!(M.rightw||M.y>L)},scrollUV:function(e,i){return this.vertex1.scrollUV(e,i),this.vertex2.scrollUV(e,i),this.vertex3.scrollUV(e,i),this},scaleUV:function(e,i){return this.vertex1.scaleUV(e,i),this.vertex2.scaleUV(e,i),this.vertex3.scaleUV(e,i),this},setColor:function(e){return this.vertex1.color=e,this.vertex2.color=e,this.vertex3.color=e,this},update:function(e,i,h,s,l,f,u,d){return this.vertex1.update(i,h,s,l,f,u,d,e),this.vertex2.update(i,h,s,l,f,u,d,e),this.vertex3.update(i,h,s,l,f,u,d,e),this},translate:function(e,i){i===void 0&&(i=0);var h=this.vertex1,s=this.vertex2,l=this.vertex3;return h.x+=e,h.y+=i,s.x+=e,s.y+=i,l.x+=e,l.y+=i,this},x:{get:function(){return this.getInCenter().x},set:function(e){var i=this.getInCenter();this.translate(e-i.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(e){var i=this.getInCenter();this.translate(0,e-i.y)}},alpha:{get:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3;return(e.alpha+i.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,i=this.vertex2,h=this.vertex3;return(e.vz+i.vz+h.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});c.exports=n},48803:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83997),v=t(95540),o=t(37867),r=t(25836),n=t(39318),e=new r,i=new r,h=new o,s=function(l){var f=v(l,"mesh"),u=v(l,"texture",null),d=v(l,"frame"),p=v(l,"width",1),g=v(l,"height",p),y=v(l,"widthSegments",1),x=v(l,"heightSegments",y),T=v(l,"x",0),C=v(l,"y",0),M=v(l,"z",0),w=v(l,"rotateX",0),L=v(l,"rotateY",0),F=v(l,"rotateZ",0),O=v(l,"zIsUp",!0),N=v(l,"isOrtho",f?f.dirtyCache[11]:!1),G=v(l,"colors",[16777215]),V=v(l,"alphas",[1]),j=v(l,"tile",!1),K=v(l,"flipY",!1),J=v(l,"width",null),X={faces:[],verts:[]};e.set(T,C,M),i.set(w,L,F),h.fromRotationXYTranslation(i,e,O);var Y;if(!u&&f)u=f.texture,d||(Y=f.frame);else if(f&&typeof u=="string")u=f.scene.sys.textures.get(u);else if(!u)return X;Y||(Y=u.get(d)),!J&&N&&u&&f&&(p=Y.width/f.height,g=Y.height/f.height);var D=p/2,z=g/2,W=Math.floor(y),H=Math.floor(x),Z=W+1,Q=H+1,k=p/W,et=g/H,st=[],rt=[],ot,dt,at=0,pt=1,Pt=0,Ct=1;Y&&(at=Y.u0,pt=Y.u1,K?(Pt=Y.v1,Ct=Y.v0):(Pt=Y.v0,Ct=Y.v1));var Et=pt-at,vt=Ct-Pt;for(dt=0;dt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83997),v=t(37867),o=t(25836),r=t(39318),n=new o,e=new o,i=new v,h=function(s,l,f,u,d,p,g,y,x,T){f===void 0&&(f=1),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=0),T===void 0&&(T=!0);var C={faces:[],verts:[]},M=s.materials;n.set(u,d,p),e.set(g,y,x),i.fromRotationXYTranslation(e,n,T);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83997),v=t(39318),o=function(r,n,e,i,h,s,l,f){if(i===void 0&&(i=!1),s===void 0&&(s=16777215),l===void 0&&(l=1),f===void 0&&(f=!1),r.length!==n.length&&!i){console.warn("GenerateVerts: vertices and uvs count not equal");return}var u={faces:[],vertices:[]},d,p,g,y,x,T,C,M,w,L,F,O=i?3:2,N=Array.isArray(s),G=Array.isArray(l);if(Array.isArray(e)&&e.length>0)for(d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=!0,t="untitled",a="",v="";function o(p){var g=p.indexOf("#");return g>-1?p.substring(0,g):p}function r(p){return p.models.length===0&&p.models.push({faces:[],name:t,textureCoords:[],vertexNormals:[],vertices:[]}),a="",p.models[p.models.length-1]}function n(p,g){var y=p.length>=2?p[1]:t;g.models.push({faces:[],name:y,textureCoords:[],vertexNormals:[],vertices:[]}),a=""}function e(p){p.length===2&&(a=p[1])}function i(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,T=y>=3?parseFloat(p[2]):0,C=y>=4?parseFloat(p[3]):0;r(g).vertices.push({x,y:T,z:C})}function h(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,T=y>=3?parseFloat(p[2]):0,C=y>=4?parseFloat(p[3]):0;isNaN(x)&&(x=0),isNaN(T)&&(T=0),isNaN(C)&&(C=0),m&&(T=1-T),r(g).textureCoords.push({u:x,v:T,w:C})}function s(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,T=y>=3?parseFloat(p[2]):0,C=y>=4?parseFloat(p[3]):0;r(g).vertexNormals.push({x,y:T,z:C})}function l(p,g){var y=p.length-1;if(!(y<3)){for(var x={group:a,material:v,vertices:[]},T=0;T3)){var L=0,F=0,O=0;L=parseInt(M[0],10),w>1&&M[1]!==""&&(F=parseInt(M[1],10)),w>2&&(O=parseInt(M[2],10)),L!==0&&(L<0&&(L=r(g).vertices.length+1+L),F-=1,L-=1,O-=1,x.vertices.push({textureCoordsIndex:F,vertexIndex:L,vertexNormalIndex:O}))}}r(g).faces.push(x)}}function f(p,g){p.length>=2&&g.materialLibraries.push(p[1])}function u(p){p.length>=2&&(v=p[1])}var d=function(p,g){g===void 0&&(g=!0),m=g;var y={materials:{},materialLibraries:[],models:[]};a="",v="";for(var x=p.split(` -`),T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37589),v=function(o){for(var r={},n=o.split(` -`),e="",i=0;i=2?Math.floor(s[2]*255):l,u=s.length>=3?Math.floor(s[3]*255):l;r[e]=a(l,f,u);break}}}}return r};c.exports=v},92570:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r,n;if(v===void 0&&o===void 0){var e=t.getInCenter();r=e.x,n=e.y}var i=Math.cos(a),h=Math.sin(a),s=t.vertex1,l=t.vertex2,f=t.vertex3,u=s.x-r,d=s.y-n;s.set(u*i-d*h+r,u*h+d*i+n),u=l.x-r,d=l.y-n,l.set(u*i-d*h+r,u*h+d*i+n),u=f.x-r,d=f.y-n,f.set(u*i-d*h+r,u*h+d*i+n)};c.exports=m},39318:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(70554),o=t(25836),r=new a({Extends:o,initialize:function(e,i,h,s,l,f,u,d,p,g){f===void 0&&(f=16777215),u===void 0&&(u=1),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),o.call(this,e,i,h),this.vx=0,this.vy=0,this.vz=0,this.nx=d,this.ny=p,this.nz=g,this.u=s,this.v=l,this.color=f,this.alpha=u,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=l},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,i,h){var s=this.x,l=this.y,f=this.z,u=n.val,d=s*u[0]+l*u[4]+f*u[8]+u[12],p=s*u[1]+l*u[5]+f*u[9]+u[13],g=s*u[2]+l*u[6]+f*u[10]+u[14],y=s*u[3]+l*u[7]+f*u[11]+u[15];this.vx=d/y*e,this.vy=-(p/y)*i,h<=0?this.vz=g/y:this.vz=-(g/y)},resize:function(n,e,i,h,s,l){return this.x=n,this.y=e,this.vx=this.x*i,this.vy=-this.y*h,this.vz=0,s<.5?this.vx+=i*(.5-s):s>.5&&(this.vx-=i*(s-.5)),l<.5?this.vy+=h*(.5-l):l>.5&&(this.vy-=h*(l-.5)),this},update:function(n,e,i,h,s,l,f,u){var d=this.vx*n+this.vy*i+s,p=this.vx*e+this.vy*h+l;return f&&(d=Math.round(d),p=Math.round(p)),this.tx=d,this.ty=p,this.ta=this.alpha*u,this},load:function(n,e,i,h,s){return n[++i]=this.tx,n[++i]=this.ty,n[++i]=this.tu,n[++i]=this.tv,n[++i]=h,n[++i]=s,e[++i]=v.getTintAppendFloatAlpha(this.color,this.ta),i}});c.exports=r},73090:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={Face:t(83997),GenerateGridVerts:t(48803),GenerateObjVerts:t(34684),GenerateVerts:t(92515),ParseObj:t(85048),ParseObjMaterial:t(61485),RotateFace:t(92570),Vertex:t(39318)};c.exports=a},96550:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))};c.exports=m},99706:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o){return new a(o.x,o.y)};c.exports=v},68010:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x,t.y)};c.exports=m},27814:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x===a.x&&t.y===a.y};c.exports=m},73565:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))};c.exports=m},87555:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){if(r===void 0&&(r=new a),!Array.isArray(o))throw new Error("GetCentroid points argument must be an array");var n=o.length;if(n<1)throw new Error("GetCentroid points array must not be empty");if(n===1)r.x=o[0].x,r.y=o[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 m=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)};c.exports=m},44405:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x*t.x+t.y*t.y};c.exports=m},20873:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r){r===void 0&&(r=new a);for(var n=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,s=0;sn&&(n=l.x),l.xi&&(i=l.y),l.y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n,e){return n===void 0&&(n=0),e===void 0&&(e=new a),e.x=o.x+(r.x-o.x)*n,e.y=o.y+(r.y-o.y)*n,e};c.exports=v},55767:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.setTo(t.y,t.x)};c.exports=m},79432:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.setTo(-o.x,-o.y)};c.exports=v},2141:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23777),o=new a({initialize:function(n,e){n===void 0&&(n=0),e===void 0&&(e=n),this.type=v.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}});c.exports=o},72930:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(44405),o=function(r,n,e){e===void 0&&(e=new a);var i=r.x*n.x+r.y*n.y,h=i/v(n);return h!==0&&(e.x=h*n.x,e.y=h*n.y),e};c.exports=o},62880:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r,n){n===void 0&&(n=new a);var e=o.x*r.x+o.y*r.y;return e!==0&&(n.x=e*r.x,n.y=e*r.y),n};c.exports=v},15093:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(28793),v=function(o,r){if(o.x!==0||o.y!==0){var n=a(o);o.x/=n,o.y/=n}return o.x*=r,o.y*=r,o};c.exports=v},43711:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141);a.Ceil=t(96550),a.Clone=t(99706),a.CopyFrom=t(68010),a.Equals=t(27814),a.Floor=t(73565),a.GetCentroid=t(87555),a.GetMagnitude=t(28793),a.GetMagnitudeSq=t(44405),a.GetRectangleFromPoints=t(20873),a.Interpolate=t(26152),a.Invert=t(55767),a.Negative=t(79432),a.Project=t(72930),a.ProjectUnit=t(62880),a.SetMagnitude=t(15093),c.exports=a},12306:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25717),v=function(o){return new a(o.points)};c.exports=v},63814:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){for(var o=!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 a=t(63814),v=function(o,r){return a(o,r.x,r.y)};c.exports=v},94811:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(X,Y,D){D=D||2;var z=Y&&Y.length,W=z?Y[0]*D:X.length,H=t(X,0,W,D,!0),Z=[];if(!H||H.next===H.prev)return Z;var Q,k,et,st,rt,ot,dt;if(z&&(H=i(X,Y,H,D)),X.length>80*D){Q=et=X[0],k=st=X[1];for(var at=D;atet&&(et=rt),ot>st&&(st=ot);dt=Math.max(et-Q,st-k),dt=dt!==0?32767/dt:0}return v(H,Z,D,Q,k,dt,0),Z}function t(X,Y,D,z,W){var H,Z;if(W===J(X,Y,D,z)>0)for(H=Y;H=Y;H-=z)Z=V(H,X[H],X[H+1],Z);return Z&&C(Z,Z.next)&&(j(Z),Z=Z.next),Z}function a(X,Y){if(!X)return X;Y||(Y=X);var D=X,z;do if(z=!1,!D.steiner&&(C(D,D.next)||T(D.prev,D,D.next)===0)){if(j(D),D=Y=D.prev,D===D.next)break;z=!0}else D=D.next;while(z||D!==Y);return Y}function v(X,Y,D,z,W,H,Z){if(X){!Z&&H&&u(X,z,W,H);for(var Q=X,k,et;X.prev!==X.next;){if(k=X.prev,et=X.next,H?r(X,z,W,H):o(X)){Y.push(k.i/D|0),Y.push(X.i/D|0),Y.push(et.i/D|0),j(X),X=et.next,Q=et.next;continue}if(X=et,X===Q){Z?Z===1?(X=n(a(X),Y,D),v(X,Y,D,z,W,H,2)):Z===2&&e(X,Y,D,z,W,H):v(a(X),Y,D,z,W,H,1);break}}}}function o(X){var Y=X.prev,D=X,z=X.next;if(T(Y,D,z)>=0)return!1;for(var W=Y.x,H=D.x,Z=z.x,Q=Y.y,k=D.y,et=z.y,st=WH?W>Z?W:Z:H>Z?H:Z,dt=Q>k?Q>et?Q:et:k>et?k:et,at=z.next;at!==Y;){if(at.x>=st&&at.x<=ot&&at.y>=rt&&at.y<=dt&&y(W,Q,H,k,Z,et,at.x,at.y)&&T(at.prev,at,at.next)>=0)return!1;at=at.next}return!0}function r(X,Y,D,z){var W=X.prev,H=X,Z=X.next;if(T(W,H,Z)>=0)return!1;for(var Q=W.x,k=H.x,et=Z.x,st=W.y,rt=H.y,ot=Z.y,dt=Qk?Q>et?Q:et:k>et?k:et,Pt=st>rt?st>ot?st:ot:rt>ot?rt:ot,Ct=p(dt,at,Y,D,z),Et=p(pt,Pt,Y,D,z),vt=X.prevZ,St=X.nextZ;vt&&vt.z>=Ct&&St&&St.z<=Et;){if(vt.x>=dt&&vt.x<=pt&&vt.y>=at&&vt.y<=Pt&&vt!==W&&vt!==Z&&y(Q,st,k,rt,et,ot,vt.x,vt.y)&&T(vt.prev,vt,vt.next)>=0||(vt=vt.prevZ,St.x>=dt&&St.x<=pt&&St.y>=at&&St.y<=Pt&&St!==W&&St!==Z&&y(Q,st,k,rt,et,ot,St.x,St.y)&&T(St.prev,St,St.next)>=0))return!1;St=St.nextZ}for(;vt&&vt.z>=Ct;){if(vt.x>=dt&&vt.x<=pt&&vt.y>=at&&vt.y<=Pt&&vt!==W&&vt!==Z&&y(Q,st,k,rt,et,ot,vt.x,vt.y)&&T(vt.prev,vt,vt.next)>=0)return!1;vt=vt.prevZ}for(;St&&St.z<=Et;){if(St.x>=dt&&St.x<=pt&&St.y>=at&&St.y<=Pt&&St!==W&&St!==Z&&y(Q,st,k,rt,et,ot,St.x,St.y)&&T(St.prev,St,St.next)>=0)return!1;St=St.nextZ}return!0}function n(X,Y,D){var z=X;do{var W=z.prev,H=z.next.next;!C(W,H)&&M(W,z,z.next,H)&&O(W,H)&&O(H,W)&&(Y.push(W.i/D|0),Y.push(z.i/D|0),Y.push(H.i/D|0),j(z),j(z.next),z=X=H),z=z.next}while(z!==X);return a(z)}function e(X,Y,D,z,W,H){var Z=X;do{for(var Q=Z.next.next;Q!==Z.prev;){if(Z.i!==Q.i&&x(Z,Q)){var k=G(Z,Q);Z=a(Z,Z.next),k=a(k,k.next),v(Z,Y,D,z,W,H,0),v(k,Y,D,z,W,H,0);return}Q=Q.next}Z=Z.next}while(Z!==X)}function i(X,Y,D,z){var W=[],H,Z,Q,k,et;for(H=0,Z=Y.length;H=D.next.y&&D.next.y!==D.y){var Q=D.x+(W-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(Q<=z&&Q>H&&(H=Q,Z=D.x=D.x&&D.x>=et&&z!==D.x&&y(WZ.x||D.x===Z.x&&f(Z,D)))&&(Z=D,rt=ot)),D=D.next;while(D!==k);return Z}function f(X,Y){return T(X.prev,X,Y.prev)<0&&T(Y.next,X,X.next)<0}function u(X,Y,D,z){var W=X;do W.z===0&&(W.z=p(W.x,W.y,Y,D,z)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==X);W.prevZ.nextZ=null,W.prevZ=null,d(W)}function d(X){var Y,D,z,W,H,Z,Q,k,et=1;do{for(D=X,X=null,H=null,Z=0;D;){for(Z++,z=D,Q=0,Y=0;Y0||k>0&&z;)Q!==0&&(k===0||!z||D.z<=z.z)?(W=D,D=D.nextZ,Q--):(W=z,z=z.nextZ,k--),H?H.nextZ=W:X=W,W.prevZ=H,H=W;D=z}H.nextZ=null,et*=2}while(Z>1);return X}function p(X,Y,D,z,W){return X=(X-D)*W|0,Y=(Y-z)*W|0,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,X|Y<<1}function g(X){var Y=X,D=X;do(Y.x=(X-Z)*(H-Q)&&(X-Z)*(z-Q)>=(D-Z)*(Y-Q)&&(D-Z)*(H-Q)>=(W-Z)*(z-Q)}function x(X,Y){return X.next.i!==Y.i&&X.prev.i!==Y.i&&!F(X,Y)&&(O(X,Y)&&O(Y,X)&&N(X,Y)&&(T(X.prev,X,Y.prev)||T(X,Y.prev,Y))||C(X,Y)&&T(X.prev,X,X.next)>0&&T(Y.prev,Y,Y.next)>0)}function T(X,Y,D){return(Y.y-X.y)*(D.x-Y.x)-(Y.x-X.x)*(D.y-Y.y)}function C(X,Y){return X.x===Y.x&&X.y===Y.y}function M(X,Y,D,z){var W=L(T(X,Y,D)),H=L(T(X,Y,z)),Z=L(T(D,z,X)),Q=L(T(D,z,Y));return!!(W!==H&&Z!==Q||W===0&&w(X,D,Y)||H===0&&w(X,z,Y)||Z===0&&w(D,X,z)||Q===0&&w(D,Y,z))}function w(X,Y,D){return Y.x<=Math.max(X.x,D.x)&&Y.x>=Math.min(X.x,D.x)&&Y.y<=Math.max(X.y,D.y)&&Y.y>=Math.min(X.y,D.y)}function L(X){return X>0?1:X<0?-1:0}function F(X,Y){var D=X;do{if(D.i!==X.i&&D.next.i!==X.i&&D.i!==Y.i&&D.next.i!==Y.i&&M(D,D.next,X,Y))return!0;D=D.next}while(D!==X);return!1}function O(X,Y){return T(X.prev,X,X.next)<0?T(X,Y,X.next)>=0&&T(X,X.prev,Y)>=0:T(X,Y,X.prev)<0||T(X,X.next,Y)<0}function N(X,Y){var D=X,z=!1,W=(X.x+Y.x)/2,H=(X.y+Y.y)/2;do D.y>H!=D.next.y>H&&D.next.y!==D.y&&W<(D.next.x-D.x)*(H-D.y)/(D.next.y-D.y)+D.x&&(z=!z),D=D.next;while(D!==X);return z}function G(X,Y){var D=new K(X.i,X.x,X.y),z=new K(Y.i,Y.x,Y.y),W=X.next,H=Y.prev;return X.next=Y,Y.prev=X,D.next=W,W.prev=D,z.next=D,D.prev=z,H.next=z,z.prev=H,z}function V(X,Y,D,z){var W=new K(X,Y,D);return z?(W.next=z.next,W.prev=z,z.next.prev=W,z.next=W):(W.prev=W,W.next=W),W}function j(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function K(X,Y,D){this.i=X,this.x=Y,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}m.deviation=function(X,Y,D,z){var W=Y&&Y.length,H=W?Y[0]*D:X.length,Z=Math.abs(J(X,0,H,D));if(W)for(var Q=0,k=Y.length;Q0&&(z+=X[W-1].length,D.holes.push(z))}return D},c.exports=m},13829:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r){r===void 0&&(r=new a);for(var n=1/0,e=1/0,i=-n,h=-e,s,l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=[]);for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=t(23031),o=t(30052),r=function(n,e,i,h){h===void 0&&(h=[]);var s=n.points,l=o(n);!e&&i>0&&(e=l/i);for(var f=0;fd+T){d+=T;continue}var C=x.getPoint((u-d)/T);h.push(C);break}return h};c.exports=r},30052:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=t(23031),o=function(r){for(var n=r.points,e=0,i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(63814),o=t(9564),r=t(23777),n=new a({initialize:function(i){this.type=r.POLYGON,this.area=0,this.points=[],i&&this.setTo(i)},contains:function(e,i){return v(this,e,i)},setTo:function(e){if(this.area=0,this.points=[],typeof e=="string"&&(e=e.split(" ")),!Array.isArray(e))return this;for(var i,h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.points.reverse(),t};c.exports=m},29524:c=>{function m(n,e){var i=n.x-e.x,h=n.y-e.y;return i*i+h*h}function t(n,e,i){var h=e.x,s=e.y,l=i.x-h,f=i.y-s;if(l!==0||f!==0){var u=((n.x-h)*l+(n.y-s)*f)/(l*l+f*f);u>1?(h=i.x,s=i.y):u>0&&(h+=l*u,s+=f*u)}return l=n.x-h,f=n.y-s,l*l+f*f}function a(n,e){for(var i=n[0],h=[i],s,l=1,f=n.length;le&&(h.push(s),i=s);return i!==s&&h.push(s),h}function v(n,e,i,h,s){for(var l=h,f,u=e+1;ul&&(f=u,l=d)}l>h&&(f-e>1&&v(n,e,f,h,s),s.push(n[f]),i-f>1&&v(n,f,i,h,s))}function o(n,e){var i=n.length-1,h=[n[0]];return v(n,0,i,e,h),h.push(n[i]),h}var r=function(n,e,i){e===void 0&&(e=1),i===void 0&&(i=!1);var h=n.points;if(h.length>2){var s=e*e;i||(h=a(h,s)),n.setTo(o(h,s))}return n};c.exports=r},5469:c=>{/** - * @author Richard Davey - * @author Igor Ognichenko - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(a,v){return a[0]=v[0],a[1]=v[1],a},t=function(a){var v,o=[],r=a.points;for(v=0;v0&&n.push(m([0,0],o[0])),v=0;v1&&n.push(m([0,0],o[o.length-1])),a.setTo(n)};c.exports=t},24709:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){for(var o=t.points,r=0;r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25717);a.Clone=t(12306),a.Contains=t(63814),a.ContainsPoint=t(99338),a.Earcut=t(94811),a.GetAABB=t(13829),a.GetNumberArray=t(26173),a.GetPoints=t(9564),a.Perimeter=t(30052),a.Reverse=t(8133),a.Simplify=t(29524),a.Smooth=t(5469),a.Translate=t(24709),c.exports=a},62224:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.width*t.height};c.exports=m},98615:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t};c.exports=m},31688:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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};c.exports=m},67502:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t.x=a-t.width/2,t.y=v-t.height/2,t};c.exports=m},65085:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o){return new a(o.x,o.y,o.width,o.height)};c.exports=v},37303:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t.width<=0||t.height<=0?!1:t.x<=a&&t.x+t.width>=a&&t.y<=v&&t.y+t.height>=v};c.exports=m},96553:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37303),v=function(o,r){return a(o,r.x,r.y)};c.exports=v},70273:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.width*a.height>t.width*t.height?!1:a.x>t.x&&a.xt.x&&a.rightt.y&&a.yt.y&&a.bottom{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x,t.y,t.width,t.height)};c.exports=m},77493:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=[]),a.push({x:t.x,y:t.y}),a.push({x:t.right,y:t.y}),a.push({x:t.right,y:t.bottom}),a.push({x:t.x,y:t.bottom}),a};c.exports=m},9219:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height};c.exports=m},53751:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8249),v=function(o,r){var n=a(o);return n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(8249),v=function(o,r){var n=a(o);return n>a(r)?o.setSize(r.height*n,r.height):o.setSize(r.width,r.width/n),o.setPosition(r.centerX-o.width/2,r.centerY-o.height/2)};c.exports=v},80774:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t};c.exports=m},83859:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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};c.exports=m},19217:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=t(36383),o=function(r,n){if(n===void 0&&(n=new a),r.length===0)return n;for(var e=Number.MAX_VALUE,i=Number.MAX_VALUE,h=v.MIN_SAFE_INTEGER,s=v.MIN_SAFE_INTEGER,l,f,u,d=0;d{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r,n,e,i){return i===void 0&&(i=new a),i.setTo(Math.min(o,n),Math.min(r,e),Math.abs(o-n),Math.abs(r-e))};c.exports=v},8249:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.height===0?NaN:t.width/t.height};c.exports=m},27165:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.x=o.centerX,r.y=o.centerY,r};c.exports=v},20812:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13019),v=t(2141),o=function(r,n,e){if(e===void 0&&(e=new v),n<=0||n>=1)return e.x=r.x,e.y=r.y,e;var i=a(r)*n;return n>.5?(i-=r.width+r.height,i<=r.width?(e.x=r.right-i,e.y=r.bottom):(e.x=r.x,e.y=r.bottom-(i-r.width))):i<=r.width?(e.x=r.x+i,e.y=r.y):(e.x=r.right,e.y=r.y+(i-r.width)),e};c.exports=o},34819:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20812),v=t(13019),o=function(r,n,e,i){i===void 0&&(i=[]),!n&&e>0&&(n=v(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 a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.x=o.width,r.y=o.height,r};c.exports=v},86091:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(67502),v=function(o,r,n){var e=o.centerX,i=o.centerY;return o.setSize(o.width+r*2,o.height+n*2),a(o,e,i)};c.exports=v},53951:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=t(59996),o=function(r,n,e){return e===void 0&&(e=new a),v(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};c.exports=o},14649:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13019),v=t(2141),o=function(r,n,e,i){if(i===void 0&&(i=[]),!n&&!e)return i;n?e=Math.round(a(r)/n):n=a(r)/e;for(var h=r.x,s=r.y,l=0,f=0;f=r.right&&(l=1,s+=h-r.right,h=r.right);break;case 1:s+=n,s>=r.bottom&&(l=2,h-=s-r.bottom,s=r.bottom);break;case 2:h-=n,h<=r.left&&(l=3,s-=r.left-h,h=r.left);break;case 3:s-=n,s<=r.top&&(l=0,s=r.top);break}return i};c.exports=o},33595:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){for(var v=t.x,o=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 m=function(t,a){var v=Math.min(t.x,a.x),o=Math.max(t.right,a.right);t.x=v,t.width=o-v;var r=Math.min(t.y,a.y),n=Math.max(t.bottom,a.bottom);return t.y=r,t.height=n-r,t};c.exports=m},92171:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=Math.min(t.x,a),r=Math.max(t.right,a);t.x=o,t.width=r-o;var n=Math.min(t.y,v),e=Math.max(t.bottom,v);return t.y=n,t.height=e-n,t};c.exports=m},42981:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t.x+=a,t.y+=v,t};c.exports=m},46907:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x+=a.x,t.y+=a.y,t};c.exports=m},60170:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.xa.x&&t.ya.y};c.exports=m},13019:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return 2*(t.width+t.height)};c.exports=m},85133:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(39506),o=function(r,n,e){e===void 0&&(e=new a),n=v(n);var i=Math.sin(n),h=Math.cos(n),s=h>0?r.width/2:r.width/-2,l=i>0?r.height/2:r.height/-2;return Math.abs(s*i){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.x=o.x+Math.random()*o.width,r.y=o.y+Math.random()*o.height,r};c.exports=v},86470:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(30976),v=t(70273),o=t(2141),r=function(n,e,i){if(i===void 0&&(i=new o),v(n,e))switch(a(0,3)){case 0:i.x=n.x+Math.random()*(e.right-n.x),i.y=n.y+Math.random()*(e.top-n.y);break;case 1:i.x=e.x+Math.random()*(n.right-e.x),i.y=e.bottom+Math.random()*(n.bottom-e.bottom);break;case 2:i.x=n.x+Math.random()*(e.x-n.x),i.y=e.y+Math.random()*(n.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(n.right-e.right),i.y=n.y+Math.random()*(e.bottom-n.y);break}return i};c.exports=r},87841:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(37303),o=t(20812),r=t(34819),n=t(23777),e=t(23031),i=t(26597),h=new a({initialize:function(l,f,u,d){l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),this.type=n.RECTANGLE,this.x=l,this.y=f,this.width=u,this.height=d},contains:function(s,l){return v(this,s,l)},getPoint:function(s,l){return o(this,s,l)},getPoints:function(s,l,f){return r(this,s,l,f)},getRandomPoint:function(s){return i(this,s)},setTo:function(s,l,f,u){return this.x=s,this.y=l,this.width=f,this.height=u,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(s,l){return l===void 0&&(l=s),this.x=s,this.y=l,this},setSize:function(s,l){return l===void 0&&(l=s),this.width=s,this.height=l,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(s){return s===void 0&&(s=new e),s.setTo(this.x,this.y,this.right,this.y),s},getLineB:function(s){return s===void 0&&(s=new e),s.setTo(this.right,this.y,this.right,this.bottom),s},getLineC:function(s){return s===void 0&&(s=new e),s.setTo(this.right,this.bottom,this.x,this.bottom),s},getLineD:function(s){return s===void 0&&(s=new e),s.setTo(this.x,this.bottom,this.x,this.y),s},left:{get:function(){return this.x},set:function(s){s>=this.right?this.width=0:this.width=this.right-s,this.x=s}},right:{get:function(){return this.x+this.width},set:function(s){s<=this.x?this.width=0:this.width=s-this.x}},top:{get:function(){return this.y},set:function(s){s>=this.bottom?this.height=0:this.height=this.bottom-s,this.y=s}},bottom:{get:function(){return this.y+this.height},set:function(s){s<=this.y?this.height=0:this.height=s-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(s){this.x=s-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(s){this.y=s-this.height/2}}});c.exports=h},94845:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.width===a.width&&t.height===a.height};c.exports=m},31730:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v===void 0&&(v=a),t.width*=a,t.height*=v,t};c.exports=m},36899:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=function(o,r,n){n===void 0&&(n=new a);var e=Math.min(o.x,r.x),i=Math.min(o.y,r.y),h=Math.max(o.right,r.right)-e,s=Math.max(o.bottom,r.bottom)-i;return n.setTo(e,i,h,s)};c.exports=v},93232:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841);a.Area=t(62224),a.Ceil=t(98615),a.CeilAll=t(31688),a.CenterOn=t(67502),a.Clone=t(65085),a.Contains=t(37303),a.ContainsPoint=t(96553),a.ContainsRect=t(70273),a.CopyFrom=t(43459),a.Decompose=t(77493),a.Equals=t(9219),a.FitInside=t(53751),a.FitOutside=t(16088),a.Floor=t(80774),a.FloorAll=t(83859),a.FromPoints=t(19217),a.FromXY=t(9477),a.GetAspectRatio=t(8249),a.GetCenter=t(27165),a.GetPoint=t(20812),a.GetPoints=t(34819),a.GetSize=t(51313),a.Inflate=t(86091),a.Intersection=t(53951),a.MarchingAnts=t(14649),a.MergePoints=t(33595),a.MergeRect=t(20074),a.MergeXY=t(92171),a.Offset=t(42981),a.OffsetPoint=t(46907),a.Overlaps=t(60170),a.Perimeter=t(13019),a.PerimeterPoint=t(85133),a.Random=t(26597),a.RandomOutside=t(86470),a.SameDimensions=t(94845),a.Scale=t(31730),a.Union=t(36899),c.exports=a},41658:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=t.x1,v=t.y1,o=t.x2,r=t.y2,n=t.x3,e=t.y3;return Math.abs(((n-a)*(r-v)-(o-a)*(e-v))/2)};c.exports=m},39208:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(16483),v=function(o,r,n){var e=n*(Math.sqrt(3)/2),i=o,h=r,s=o+n/2,l=r+e,f=o-n/2,u=r+e;return new a(i,h,s,l,f,u)};c.exports=v},39545:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(94811),v=t(16483),o=function(r,n,e,i,h){n===void 0&&(n=null),e===void 0&&(e=1),i===void 0&&(i=1),h===void 0&&(h=[]);for(var s=a(r,n),l,f,u,d,p,g,y,x,T,C=0;C{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(16483),v=function(o,r,n,e){e===void 0&&(e=n);var i=o,h=r,s=o,l=r-e,f=o+n,u=r;return new a(i,h,s,l,f,u)};c.exports=v},23707:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(97523),v=t(13584),o=function(r,n,e,i){i===void 0&&(i=a);var h=i(r),s=n-h.x,l=e-h.y;return v(r,s,l)};c.exports=o},97523:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){return r===void 0&&(r=new a),r.x=(o.x1+o.x2+o.x3)/3,r.y=(o.y1+o.y2+o.y3)/3,r};c.exports=v},24951:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099);function v(r,n,e,i){return r*i-n*e}var o=function(r,n){n===void 0&&(n=new a);var e=r.x3,i=r.y3,h=r.x1-e,s=r.y1-i,l=r.x2-e,f=r.y2-i,u=2*v(h,s,l,f),d=v(s,h*h+s*s,f,l*l+f*f),p=v(h,h*h+s*s,l,l*l+f*f);return n.x=e-d/u,n.y=i+p/u,n};c.exports=o},85614:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(96503),v=function(o,r){r===void 0&&(r=new a);var n=o.x1,e=o.y1,i=o.x2,h=o.y2,s=o.x3,l=o.y3,f=i-n,u=h-e,d=s-n,p=l-e,g=f*(n+i)+u*(e+h),y=d*(n+s)+p*(e+l),x=2*(f*(l-h)-u*(s-i)),T,C;if(Math.abs(x)<1e-6){var M=Math.min(n,i,s),w=Math.min(e,h,l);T=(Math.max(n,i,s)-M)*.5,C=(Math.max(e,h,l)-w)*.5,r.x=M+T,r.y=w+C,r.radius=Math.sqrt(T*T+C*C)}else r.x=(p*g-u*y)/x,r.y=(f*y-d*g)/x,T=r.x-n,C=r.y-e,r.radius=Math.sqrt(T*T+C*C);return r};c.exports=v},74422:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(16483),v=function(o){return new a(o.x1,o.y1,o.x2,o.y2,o.x3,o.y3)};c.exports=v},10690:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=t.x3-t.x1,r=t.y3-t.y1,n=t.x2-t.x1,e=t.y2-t.y1,i=a-t.x1,h=v-t.y1,s=o*o+r*r,l=o*n+r*e,f=o*i+r*h,u=n*n+e*e,d=n*i+e*h,p=s*u-l*l,g=p===0?0:1/p,y=(u*f-l*d)*g,x=(s*d-l*f)*g;return y>=0&&x>=0&&y+x<1};c.exports=m},48653:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v===void 0&&(v=!1),o===void 0&&(o=[]);for(var r=t.x3-t.x1,n=t.y3-t.y1,e=t.x2-t.x1,i=t.y2-t.y1,h=r*r+n*n,s=r*e+n*i,l=e*e+i*i,f=h*l-s*s,u=f===0?0:1/f,d,p,g,y,x,T,C=t.x1,M=t.y1,w=0;w=0&&p>=0&&d+p<1&&(o.push({x:a[w].x,y:a[w].y}),v)));w++);return o};c.exports=m},96006:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10690),v=function(o,r){return a(o,r.x,r.y)};c.exports=v},71326:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)};c.exports=m},71694:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=[]),a.push({x:t.x1,y:t.y1}),a.push({x:t.x2,y:t.y2}),a.push({x:t.x3,y:t.y3}),a};c.exports=m},33522:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.x1===a.x1&&t.y1===a.y1&&t.x2===a.x2&&t.y2===a.y2&&t.x3===a.x3&&t.y3===a.y3};c.exports=m},20437:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=t(35001),o=function(r,n,e){e===void 0&&(e=new a);var i=r.getLineA(),h=r.getLineB(),s=r.getLineC();if(n<=0||n>=1)return e.x=i.x1,e.y=i.y1,e;var l=v(i),f=v(h),u=v(s),d=l+f+u,p=d*n,g=0;return pl+f?(p-=l+f,g=p/u,e.x=s.x1+(s.x2-s.x1)*g,e.y=s.y1+(s.y2-s.y1)*g):(p-=l,g=p/f,e.x=h.x1+(h.x2-h.x1)*g,e.y=h.y1+(h.y2-h.y1)*g),e};c.exports=o},80672:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=t(2141),o=function(r,n,e,i){i===void 0&&(i=[]);var h=r.getLineA(),s=r.getLineB(),l=r.getLineC(),f=a(h),u=a(s),d=a(l),p=f+u+d;!n&&e>0&&(n=p/e);for(var g=0;gf+u?(y-=f+u,x=y/d,T.x=l.x1+(l.x2-l.x1)*x,T.y=l.y1+(l.y2-l.y1)*x):(y-=f,x=y/u,T.x=s.x1+(s.x2-s.x1)*x,T.y=s.y1+(s.y2-s.y1)*x),i.push(T)}return i};c.exports=o},39757:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141);function v(r,n,e,i){var h=r-e,s=n-i,l=h*h+s*s;return Math.sqrt(l)}var o=function(r,n){n===void 0&&(n=new a);var e=r.x1,i=r.y1,h=r.x2,s=r.y2,l=r.x3,f=r.y3,u=v(l,f,h,s),d=v(e,i,l,f),p=v(h,s,e,i),g=u+d+p;return n.x=(e*u+h*d+l*p)/g,n.y=(i*u+s*d+f*p)/g,n};c.exports=o},13584:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t.x1+=a,t.y1+=v,t.x2+=a,t.y2+=v,t.x3+=a,t.y3+=v,t};c.exports=m},1376:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35001),v=function(o){var r=o.getLineA(),n=o.getLineB(),e=o.getLineC();return a(r)+a(n)+a(e)};c.exports=v},90260:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2141),v=function(o,r){r===void 0&&(r=new a);var n=o.x2-o.x1,e=o.y2-o.y1,i=o.x3-o.x1,h=o.y3-o.y1,s=Math.random(),l=Math.random();return s+l>=1&&(s=1-s,l=1-l),r.x=o.x1+(n*s+i*l),r.y=o.y1+(e*s+h*l),r};c.exports=v},52172:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(99614),v=t(39757),o=function(r,n){var e=v(r);return a(r,e.x,e.y,n)};c.exports=o},49907:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(99614),v=function(o,r,n){return a(o,r.x,r.y,n)};c.exports=v},99614:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=Math.cos(o),n=Math.sin(o),e=t.x1-a,i=t.y1-v;return t.x1=e*r-i*n+a,t.y1=e*n+i*r+v,e=t.x2-a,i=t.y2-v,t.x2=e*r-i*n+a,t.y2=e*n+i*r+v,e=t.x3-a,i=t.y3-v,t.x3=e*r-i*n+a,t.y3=e*n+i*r+v,t};c.exports=m},16483:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(10690),o=t(20437),r=t(80672),n=t(23777),e=t(23031),i=t(90260),h=new a({initialize:function(l,f,u,d,p,g){l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),this.type=n.TRIANGLE,this.x1=l,this.y1=f,this.x2=u,this.y2=d,this.x3=p,this.y3=g},contains:function(s,l){return v(this,s,l)},getPoint:function(s,l){return o(this,s,l)},getPoints:function(s,l,f){return r(this,s,l,f)},getRandomPoint:function(s){return i(this,s)},setTo:function(s,l,f,u,d,p){return s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),this.x1=s,this.y1=l,this.x2=f,this.y2=u,this.x3=d,this.y3=p,this},getLineA:function(s){return s===void 0&&(s=new e),s.setTo(this.x1,this.y1,this.x2,this.y2),s},getLineB:function(s){return s===void 0&&(s=new e),s.setTo(this.x2,this.y2,this.x3,this.y3),s},getLineC:function(s){return s===void 0&&(s=new e),s.setTo(this.x3,this.y3,this.x1,this.y1),s},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(s){var l=0;this.x1<=this.x2&&this.x1<=this.x3?l=this.x1-s:this.x2<=this.x1&&this.x2<=this.x3?l=this.x2-s:l=this.x3-s,this.x1-=l,this.x2-=l,this.x3-=l}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(s){var l=0;this.x1>=this.x2&&this.x1>=this.x3?l=this.x1-s:this.x2>=this.x1&&this.x2>=this.x3?l=this.x2-s:l=this.x3-s,this.x1-=l,this.x2-=l,this.x3-=l}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(s){var l=0;this.y1<=this.y2&&this.y1<=this.y3?l=this.y1-s:this.y2<=this.y1&&this.y2<=this.y3?l=this.y2-s:l=this.y3-s,this.y1-=l,this.y2-=l,this.y3-=l}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(s){var l=0;this.y1>=this.y2&&this.y1>=this.y3?l=this.y1-s:this.y2>=this.y1&&this.y2>=this.y3?l=this.y2-s:l=this.y3-s,this.y1-=l,this.y2-=l,this.y3-=l}}});c.exports=h},84435:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(16483);a.Area=t(41658),a.BuildEquilateral=t(39208),a.BuildFromPolygon=t(39545),a.BuildRight=t(90301),a.CenterOn=t(23707),a.Centroid=t(97523),a.CircumCenter=t(24951),a.CircumCircle=t(85614),a.Clone=t(74422),a.Contains=t(10690),a.ContainsArray=t(48653),a.ContainsPoint=t(96006),a.CopyFrom=t(71326),a.Decompose=t(71694),a.Equals=t(33522),a.GetPoint=t(20437),a.GetPoints=t(80672),a.InCenter=t(39757),a.Perimeter=t(1376),a.Offset=t(13584),a.Random=t(90260),a.Rotate=t(52172),a.RotateAroundPoint=t(49907),a.RotateAroundXY=t(99614),c.exports=a},74457:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:a,hitAreaCallback:v,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}};c.exports=m},84409:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return function(v,o,r,n){var e=t.getPixelAlpha(o,r,n.texture.key,n.frame.name);return e&&e>=a}};c.exports=m},7003:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(93301),o=t(50792),r=t(8214),n=t(8443),e=t(78970),i=t(85098),h=t(42515),s=t(36210),l=t(61340),f=t(85955),u=new a({initialize:function(p,g){this.game=p,this.scaleManager,this.canvas,this.config=g,this.enabled=!0,this.events=new o,this.isOver=!0,this.defaultCursor="",this.keyboard=g.inputKeyboard?new e(this):null,this.mouse=g.inputMouse?new i(this):null,this.touch=g.inputTouch?new s(this):null,this.pointers=[],this.pointersTotal=g.inputActivePointers,g.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var y=0;y<=this.pointersTotal;y++){var x=new h(this,y);x.smoothFactor=g.inputSmoothFactor,this.pointers.push(x)}this.mousePointer=g.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 l,this._tempMatrix2=new l,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],p.events.once(n.BOOT,this.boot,this)},boot:function(){var d=this.game,p=d.events;this.canvas=d.canvas,this.scaleManager=d.scale,this.events.emit(r.MANAGER_BOOT),p.on(n.PRE_RENDER,this.preRender,this),p.once(n.DESTROY,this.destroy,this)},setCanvasOver:function(d){this.isOver=!0,this.events.emit(r.GAME_OVER,d)},setCanvasOut:function(d){this.isOver=!1,this.events.emit(r.GAME_OUT,d)},preRender:function(){var d=this.game.loop.now,p=this.game.loop.delta,g=this.game.scene.getScenes(!0,!0);this.time=d,this.events.emit(r.MANAGER_UPDATE);for(var y=0;y10&&(d=10-this.pointersTotal);for(var g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(96503),v=t(87902),o=t(83419),r=t(93301),n=t(74457),e=t(84409),i=t(20339),h=t(8497),s=t(81154),l=t(8214),f=t(50792),u=t(95540),d=t(23777),p=t(89639),g=t(41212),y=t(37277),x=t(87841),T=t(37303),C=t(44594),M=t(16483),w=t(10690),L=new o({Extends:f,initialize:function(O){f.call(this),this.scene=O,this.systems=O.sys,this.settings=O.sys.settings,this.manager=O.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,p.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var N={cancelled:!1};this._eventContainer={stopPropagation:function(){N.cancelled=!0}},this._eventData=N,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,O.sys.events.once(C.BOOT,this.boot,this),O.sys.events.on(C.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(C.DESTROY,this.destroy,this),this.pluginEvents.emit(l.BOOT)},start:function(){var F=this.systems.events;F.on(C.TRANSITION_START,this.transitionIn,this),F.on(C.TRANSITION_OUT,this.transitionOut,this),F.on(C.TRANSITION_COMPLETE,this.transitionComplete,this),F.on(C.PRE_UPDATE,this.preUpdate,this),F.once(C.SHUTDOWN,this.shutdown,this),this.manager.events.on(l.GAME_OUT,this.onGameOut,this),this.manager.events.on(l.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(l.START)},onGameOver:function(F){this.isActive()&&this.emit(l.GAME_OVER,F.timeStamp,F)},onGameOut:function(F){this.isActive()&&this.emit(l.GAME_OUT,F.timeStamp,F)},preUpdate:function(){this.pluginEvents.emit(l.PRE_UPDATE);var F=this._pendingRemoval,O=this._pendingInsertion,N=F.length,G=O.length;if(!(N===0&&G===0)){for(var V=this._list,j=0;j-1&&(V.splice(J,1),this.clear(K,!0))}this._pendingRemoval.length=0,this._list=V.concat(O.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(F,O){if(!this.isActive())return!1;if(this.pluginEvents.emit(l.UPDATE,F,O),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var N,G=this.manager,V=G.pointers,j=G.pointersTotal;for(N=0;N0)if(this._pollTimer-=O,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var J=!1;for(N=0;N0&&(J=!0)}return J},update:function(F,O){if(!this.isActive())return!1;for(var N=O.length,G=!1,V=0;V0&&(G=!0)}return this._updatedThisFrame=!0,G},clear:function(F,O){O===void 0&&(O=!1),this.disable(F);var N=F.input;N&&(this.removeDebug(F),this.manager.resetCursor(N),N.gameObject=void 0,N.target=void 0,N.hitArea=void 0,N.hitAreaCallback=void 0,N.callbackContext=void 0,F.input=null),O||this.queueForRemoval(F);var G=this._draggable.indexOf(F);return G>-1&&this._draggable.splice(G,1),F},disable:function(F){var O=F.input;O&&(O.enabled=!1,O.dragState=0);for(var N=this._drag,G=this._over,V=this.manager,j=0,K;j-1&&N[j].splice(K,1),K=G[j].indexOf(F),K>-1&&G[j].splice(K,1);return this},enable:function(F,O,N,G){return G===void 0&&(G=!1),F.input?F.input.enabled=!0:this.setHitArea(F,O,N),F.input&&G&&!F.input.dropZone&&(F.input.dropZone=G),this},hitTestPointer:function(F){for(var O=this.cameras.getCamerasBelowPointer(F),N=0;N0)return F.camera=G,V}return F.camera=O[0],[]},processDownEvents:function(F){var O=0,N=this._temp,G=this._eventData,V=this._eventContainer;G.cancelled=!1;for(var j=!1,K=0;K0&&i(F.x,F.y,F.downX,F.downY)>=V||G>0&&O>=F.downTime+G)&&(N=!0),N)return this.setDragState(F,3),this.processDragStartList(F)},processDragStartList:function(F){if(this.getDragState(F)!==3)return 0;for(var O=this._drag[F.id],N=0;N1&&(this.sortGameObjects(N,F),this.topOnly&&N.splice(1)),this._drag[F.id]=N,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(F,3),this.processDragStartList(F)):(this.setDragState(F,2),0))},processDragMoveEvent:function(F){if(this.getDragState(F)===2&&this.processDragThresholdEvent(F,this.manager.game.loop.now),this.getDragState(F)!==4)return 0;for(var O=this._tempZones,N=this._drag[F.id],G=0;G0?(V.emit(l.GAMEOBJECT_DRAG_LEAVE,F,K),this.emit(l.DRAG_LEAVE,F,V,K),j.target=O[0],K=j.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,F,K),this.emit(l.DRAG_ENTER,F,V,K)):(V.emit(l.GAMEOBJECT_DRAG_LEAVE,F,K),this.emit(l.DRAG_LEAVE,F,V,K),O[0]?(j.target=O[0],K=j.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,F,K),this.emit(l.DRAG_ENTER,F,V,K)):j.target=null)}else!K&&O[0]&&(j.target=O[0],K=j.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,F,K),this.emit(l.DRAG_ENTER,F,V,K));var X,Y;if(!V.parentContainer)X=F.worldX-j.dragX,Y=F.worldY-j.dragY;else{var D=F.worldX-j.dragStartXGlobal,z=F.worldY-j.dragStartYGlobal,W=V.getParentRotation(),H=D*Math.cos(W)+z*Math.sin(W),Z=z*Math.cos(W)-D*Math.sin(W);H*=1/V.parentContainer.scaleX,Z*=1/V.parentContainer.scaleY,X=H+j.dragStartX,Y=Z+j.dragStartY}V.emit(l.GAMEOBJECT_DRAG,F,X,Y),this.emit(l.DRAG,F,V,X,Y)}return N.length},processDragUpEvent:function(F){for(var O=this._drag[F.id],N=0;N0){var j=this.manager,K=this._eventData,J=this._eventContainer;K.cancelled=!1;for(var X=!1,Y=0;Y0){var V=this.manager,j=this._eventData,K=this._eventContainer;j.cancelled=!1;var J=!1;this.sortGameObjects(O,F);for(var X=0;X0){for(this.sortGameObjects(V,F),N=0;N0){for(this.sortGameObjects(j,F),N=0;N-1&&this._draggable.splice(V,1)}return this},makePixelPerfect:function(F){F===void 0&&(F=1);var O=this.systems.textures;return e(O,F)},setHitArea:function(F,O,N){if(O===void 0)return this.setHitAreaFromTexture(F);Array.isArray(F)||(F=[F]);var G=!1,V=!1,j=!1,K=!1,J=!1,X=!0;if(g(O)&&Object.keys(O).length){var Y=O,D=F.some(function(Q){return Q.hasOwnProperty("faces")});if(!D){O=u(Y,"hitArea",null),N=u(Y,"hitAreaCallback",null),J=u(Y,"pixelPerfect",!1);var z=u(Y,"alphaTolerance",1);J&&(O={},N=this.makePixelPerfect(z))}G=u(Y,"draggable",!1),V=u(Y,"dropZone",!1),j=u(Y,"cursor",!1),K=u(Y,"useHandCursor",!1),(!O||!N)&&(this.setHitAreaFromTexture(F),X=!1)}else typeof O=="function"&&!N&&(N=O,O={});for(var W=0;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35154),v={},o={};o.register=function(r,n,e,i,h){v[r]={plugin:n,mapping:e,settingsKey:i,configKey:h}},o.getPlugin=function(r){return v[r]},o.install=function(r){var n=r.scene.sys,e=n.settings.input,i=n.game.config;for(var h in v){var s=v[h].plugin,l=v[h].mapping,f=v[h].settingsKey,u=v[h].configKey;a(e,f,i[u])&&(r[l]=new s(r))}},o.remove=function(r){v.hasOwnProperty(r)&&delete v[r]},c.exports=o},42515:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(31040),v=t(83419),o=t(20339),r=t(43855),n=t(47235),e=t(26099),i=t(25892),h=new v({initialize:function(l,f){this.manager=l,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(s){var l=s.getWorldPoint(this.x,this.y);return this.worldX=l.x,this.worldY=l.y,this},positionToCamera:function(s,l){return s.getWorldPoint(this.x,this.y,l)},updateMotion:function(){var s=this.position.x,l=this.position.y,f=this.midPoint.x,u=this.midPoint.y;if(!(s===f&&l===u)){var d=n(this.motionFactor,f,s),p=n(this.motionFactor,u,l);r(d,s,.1)&&(d=s),r(p,l,.1)&&(p=l),this.midPoint.set(d,p);var g=s-d,y=l-p;this.velocity.set(g,y),this.angle=a(d,p,s,l),this.distance=Math.sqrt(g*g+y*y)}},up:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=s.timeStamp,this.wasTouch=!1)},down:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),i.macOS&&s.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=s.timeStamp),this.wasTouch=!1},move:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.locked&&(this.movementX=s.movementX||s.mozMovementX||s.webkitMovementX||0,this.movementY=s.movementY||s.mozMovementY||s.webkitMovementY||0),this.moveTime=s.timeStamp,this.wasTouch=!1},wheel:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.deltaX=s.deltaX,this.deltaY=s.deltaY,this.deltaZ=s.deltaZ,this.wasTouch=!1},touchstart:function(s,l){s.pointerId&&(this.pointerId=s.pointerId),this.identifier=s.identifier,this.target=s.target,this.active=!0,this.buttons=1,this.event=l,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=l.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(s,l){this.event=l,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.moveTime=l.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.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?o(this.downX,this.downY,this.x,this.y):o(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?a(this.downX,this.downY,this.x,this.y):a(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(s,l){s===void 0&&(s=10),l===void 0&&(l=[]);for(var f=this.prevPosition.x,u=this.prevPosition.y,d=this.position.x,p=this.position.y,g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},7179:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="boot"},85375:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},39843:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragend"},23388:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragenter"},16133:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="drag"},27829:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragleave"},53904:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragover"},56058:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragstart"},2642:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="drop"},88171:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectdown"},36147:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragend"},71692:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragenter"},96149:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="drag"},81285:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragleave"},74048:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragover"},21322:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragstart"},49378:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="drop"},86754:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectmove"},86433:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectout"},60709:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectover"},24081:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerdown"},11172:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointermove"},18907:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerout"},95579:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerover"},35368:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerup"},26972:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="wheel"},47078:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectup"},73802:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameobjectwheel"},56718:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameout"},25936:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="gameover"},27503:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="boot"},50852:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="process"},96438:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="update"},59152:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerlockchange"},47777:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerdown"},27957:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerdownoutside"},19444:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointermove"},54251:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerout"},18667:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerover"},27192:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerup"},24652:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pointerupoutside"},45132:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="wheel"},44512:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="preupdate"},15757:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="shutdown"},41637:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="start"},93802:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="update"},8214:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n){this.pad=r,this.events=r.events,this.index=n,this.value=0,this.threshold=.1},update:function(o){this.value=o},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 a=t(83419),v=t(92734),o=new a({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(v.BUTTON_DOWN,n,this,r),this.pad.emit(v.GAMEPAD_BUTTON_DOWN,e,r,this)):this.pressed&&(this.pressed=!1,this.events.emit(v.BUTTON_UP,n,this,r),this.pad.emit(v.GAMEPAD_BUTTON_UP,e,r,this))},destroy:function(){this.pad=null,this.events=null}});c.exports=o},99125:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(97421),v=t(28884),o=t(83419),r=t(50792),n=t(26099),e=new o({Extends:r,initialize:function(h,s){r.call(this),this.manager=h,this.pad=s,this.id=s.id,this.index=s.index;for(var l=[],f=0;f=2&&(this.leftStick.set(u[0].getValue(),u[1].getValue()),f>=4&&this.rightStick.set(u[2].getValue(),u[3].getValue()))}},destroy:function(){this.removeAllListeners(),this.manager=null,this.pad=null;var i;for(i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(92734),r=t(99125),n=t(35154),e=t(89639),i=t(8214),h=new a({Extends:v,initialize:function(l){v.call(this),this.scene=l.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=l,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,l.pluginEvents.once(i.BOOT,this.boot,this),l.pluginEvents.on(i.START,this.start,this)},boot:function(){var s=this.scene.sys.game,l=this.settings.input,f=s.config;this.enabled=n(l,"gamepad",f.inputGamepad)&&s.device.input.gamepads,this.target=n(l,"gamepad.target",f.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(i.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(i.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var s=this,l=this.target,f=function(u){u.defaultPrevented||!s.isActive()||(s.refreshPads(),s.queue.push(u))};this.onGamepadHandler=f,l.addEventListener("gamepadconnected",f,!1),l.addEventListener("gamepaddisconnected",f,!1),this.sceneInputPlugin.pluginEvents.on(i.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(i.UPDATE,this.update);for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={DUALSHOCK_4:t(65294),SNES_USB:t(89651),XBOX_360:t(90089)}},46008:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="down"},7629:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="up"},42206:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="connected"},86544:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="disconnected"},94784:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="down"},14325:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="up"},92734:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Axis:t(97421),Button:t(28884),Events:t(92734),Gamepad:t(99125),GamepadPlugin:t(56654),Configs:t(64894)}},14350:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(93301),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},78970:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(72905),v=t(83419),o=t(8443),r=t(8214),n=t(46032),e=t(29747),i=new v({initialize:function(s){this.manager=s,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=e,this.onKeyUp=e,s.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(o.POST_STEP,this.postUpdate,this)},startListeners:function(){var h=this;this.onKeyDown=function(l){if(!(l.defaultPrevented||!h.enabled||!h.manager)){h.queue.push(l),h.manager.events.emit(r.MANAGER_PROCESS);var f=l.altKey||l.ctrlKey||l.shiftKey||l.metaKey;h.preventDefault&&!f&&h.captures.indexOf(l.keyCode)>-1&&l.preventDefault()}},this.onKeyUp=function(l){if(!(l.defaultPrevented||!h.enabled||!h.manager)){h.queue.push(l),h.manager.events.emit(r.MANAGER_PROCESS);var f=l.altKey||l.ctrlKey||l.shiftKey||l.metaKey;h.preventDefault&&!f&&h.captures.indexOf(l.keyCode)>-1&&l.preventDefault()}};var s=this.target;s&&(s.addEventListener("keydown",this.onKeyDown,!1),s.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 s=this.captures,l=0;l0},removeCapture:function(h){typeof h=="string"&&(h=h.split(",")),Array.isArray(h)||(h=[h]);for(var s=this.captures,l=0;l0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(o.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});c.exports=i},28846:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(95922),r=t(8443),n=t(35154),e=t(8214),i=t(89639),h=t(30472),s=t(46032),l=t(87960),f=t(74600),u=t(44594),d=t(56583),p=new a({Extends:v,initialize:function(y){v.call(this),this.game=y.systems.game,this.scene=y.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=y,this.manager=y.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,y.pluginEvents.once(e.BOOT,this.boot,this),y.pluginEvents.on(e.START,this.start,this)},boot:function(){var g=this.settings.input;this.enabled=n(g,"keyboard",!0);var y=n(g,"keyboard.capture",null);y&&this.addCaptures(y),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(u.PAUSE,this.resetKeys,this),this.scene.sys.events.on(u.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(g){return this.manager.addCapture(g),this},removeCapture:function(g){return this.manager.removeCapture(g),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:s.UP,down:s.DOWN,left:s.LEFT,right:s.RIGHT,space:s.SPACE,shift:s.SHIFT})},addKeys:function(g,y,x){y===void 0&&(y=!0),x===void 0&&(x=!1);var T={};if(typeof g=="string"){g=g.split(",");for(var C=0;C-1?T[C]=g:T[g.keyCode]=g,y&&this.addCapture(g.keyCode),g.setEmitOnRepeat(x),g}return typeof g=="string"&&(g=s[g.toUpperCase()]),T[g]||(T[g]=new h(this,g),y&&this.addCapture(g),T[g].setEmitOnRepeat(x)),T[g]},removeKey:function(g,y,x){y===void 0&&(y=!1),x===void 0&&(x=!1);var T=this.keys,C;if(g instanceof h){var M=T.indexOf(g);M>-1&&(C=this.keys[M],this.keys[M]=void 0)}else typeof g=="string"&&(g=s[g.toUpperCase()]);return T[g]&&(C=T[g],T[g]=void 0),C&&(C.plugin=null,x&&this.removeCapture(C.keyCode),y&&C.destroy()),this},removeAllKeys:function(g,y){g===void 0&&(g=!1),y===void 0&&(y=!1);for(var x=this.keys,T=0;Tg._tick)return g._tick=x,!0}return!1},update:function(){var g=this.manager.queue,y=g.length;if(!(!this.isActive()||y===0))for(var x=this.keys,T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a.timeLastMatched=t.timeStamp,a.index++,a.index===a.size?!0:(a.current=a.keyCodes[a.index],!1)};c.exports=m},87960:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95922),o=t(95540),r=t(68769),n=t(92803),e=new a({initialize:function(h,s,l){if(l===void 0&&(l={}),s.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 a=t(66970),v=function(o,r){if(r.matched)return!0;var n=!1,e=!1;if(o.keyCode===r.current)if(r.index>0&&r.maxKeyDelay>0){var i=r.timeLastMatched+r.maxKeyDelay;o.timeStamp<=i&&(e=!0,n=a(o,r))}else e=!0,n=a(o,r);return!e&&r.resetOnWrongKey&&(r.index=0,r.current=r.keyCodes[0]),n&&(r.timeLastMatched=o.timeStamp,r.matched=!0,r.timeMatched=o.timeStamp),n};c.exports=v},92803:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t};c.exports=m},92612:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="keydown"},23345:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="keyup"},21957:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="keycombomatch"},44743:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="down"},3771:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="keydown-"},46358:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="keyup-"},75674:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="up"},95922:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=50);var v=t.plugin.game.loop.time-t.timeDown;return t.isDown&&v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t._justDown?(t._justDown=!1,!0):!1};c.exports=m},38796:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t._justUp?(t._justUp=!1,!0):!1};c.exports=m},30472:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(95922),r=new a({Extends:v,initialize:function(e,i){v.call(this),this.plugin=e,this.keyCode=i,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(o.DOWN,this,n):(this.isDown=!0,this.isUp=!1,this.timeDown=n.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(o.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(o.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}});c.exports=r},46032:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},74600:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(46032),v={};for(var o in a)v[a[o]]=o;c.exports=v},41170:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=50);var v=t.plugin.game.loop.time-t.timeUp;return t.isUp&&v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(89357),o=t(8214),r=t(29747),n=new a({initialize:function(i){this.manager=i,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,i.events.once(o.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(v.pointerLock){var e=this.target;e.requestPointerLock=e.requestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock()}},releasePointerLock:function(){v.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var e=this.target;if(e){var i=this,h=this.manager,s=h.canvas,l=window&&window.focus&&h.game.config.autoFocus;this.onMouseMove=function(u){!u.defaultPrevented&&i.enabled&&h&&h.enabled&&(h.onMouseMove(u),i.preventDefaultMove&&u.preventDefault())},this.onMouseDown=function(u){l&&window.focus(),!u.defaultPrevented&&i.enabled&&h&&h.enabled&&(h.onMouseDown(u),i.preventDefaultDown&&u.target===s&&u.preventDefault())},this.onMouseDownWindow=function(u){u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents||!u.defaultPrevented&&i.enabled&&h&&h.enabled&&u.target!==s&&h.onMouseDown(u)},this.onMouseUp=function(u){!u.defaultPrevented&&i.enabled&&h&&h.enabled&&(h.onMouseUp(u),i.preventDefaultUp&&u.target===s&&u.preventDefault())},this.onMouseUpWindow=function(u){u.sourceCapabilities&&u.sourceCapabilities.firesTouchEvents||!u.defaultPrevented&&i.enabled&&h&&h.enabled&&u.target!==s&&h.onMouseUp(u)},this.onMouseOver=function(u){!u.defaultPrevented&&i.enabled&&h&&h.enabled&&h.setCanvasOver(u)},this.onMouseOut=function(u){!u.defaultPrevented&&i.enabled&&h&&h.enabled&&h.setCanvasOut(u)},this.onMouseWheel=function(u){!u.defaultPrevented&&i.enabled&&h&&h.enabled&&h.onMouseWheel(u),i.preventDefaultWheel&&u.target===s&&u.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}v.pointerLock&&(this.pointerLockChange=function(u){var d=i.target;i.locked=document.pointerLockElement===d||document.mozPointerLockElement===d||document.webkitPointerLockElement===d,h.onPointerLockChange(u)},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)),v.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}});c.exports=n},87078:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={MouseManager:t(85098)}},36210:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(8214),o=t(29747),r=new a({initialize:function(e){this.manager=e,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=o,this.onTouchStartWindow=o,this.onTouchMove=o,this.onTouchEnd=o,this.onTouchEndWindow=o,this.onTouchCancel=o,this.onTouchCancelWindow=o,this.isTop=!0,e.events.once(v.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,i=this.manager,h=i.canvas,s=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(d),e.capture&&d.cancelable&&d.preventDefault())},this.onTouchStart=function(d){s&&window.focus(),!d.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(d),e.capture&&d.cancelable&&d.target===h&&d.preventDefault())},this.onTouchStartWindow=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&d.target!==h&&i.onTouchStart(d)},this.onTouchEnd=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(d),e.capture&&d.cancelable&&d.target===h&&d.preventDefault())},this.onTouchEndWindow=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&d.target!==h&&i.onTouchEnd(d)},this.onTouchCancel=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(d),e.capture&&d.preventDefault())},this.onTouchCancelWindow=function(d){!d.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(d)};var l=this.capture,f={passive:!0},u={passive:!1};if(n.addEventListener("touchstart",this.onTouchStart,l?u:f),n.addEventListener("touchmove",this.onTouchMove,l?u:f),n.addEventListener("touchend",this.onTouchEnd,l?u:f),n.addEventListener("touchcancel",this.onTouchCancel,l?u:f),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,u),window.top.addEventListener("touchend",this.onTouchEndWindow,u),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,u)}catch{window.addEventListener("touchstart",this.onTouchStartWindow,u),window.addEventListener("touchend",this.onTouchEndWindow,u),window.addEventListener("touchcancel",this.onTouchCancelWindow,u),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}});c.exports=r},95618:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={TouchManager:t(36210)}},41299:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(54899),r=t(95540),n=t(98356),e=t(3374),i=t(84376),h=t(92638),s=new a({initialize:function(f,u){if(this.loader=f,this.cache=r(u,"cache",!1),this.type=r(u,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=r(u,"key",!1);var d=this.key;if(f.prefix&&f.prefix!==""&&(this.key=f.prefix+d),!this.key)throw new Error("Invalid File key: "+this.key);var p=r(u,"url");p===void 0?p=f.path+d+"."+r(u,"extension",""):typeof p=="string"&&!p.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)&&(p=f.path+p),this.url=p,this.src="",this.xhrSettings=h(r(u,"responseType",void 0)),r(u,"xhrSettings",!1)&&(this.xhrSettings=e(this.xhrSettings,r(u,"xhrSettings",{}))),this.xhrLoader=null,this.state=typeof this.url=="function"?v.FILE_POPULATED:v.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=r(u,"config",{}),this.multiFile,this.linkFile,this.base64=typeof p=="string"&&p.indexOf("data:")===0},setLink:function(l){this.linkFile=l,l.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===v.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=v.FILE_LOADING,this.src=n(this,this.loader.baseURL),this.src.indexOf("data:")===0&&(this.base64=!0),this.xhrLoader=i(this,this.loader.xhr))},onLoad:function(l,f){var u=l.responseURL&&this.loader.localSchemes.some(function(g){return l.responseURL.indexOf(g)===0}),d=u&&f.target.status===0,p=!(f.target&&f.target.status!==200)||d;l.readyState===4&&l.status>=400&&l.status<=599&&(p=!1),this.state=v.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,p)},onBase64Load:function(l){this.xhrLoader=l,this.state=v.FILE_LOADED,this.percentComplete=1,this.loader.emit(o.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(l){l.lengthComputable&&(this.bytesLoaded=l.loaded,this.bytesTotal=l.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(o.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=v.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=v.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=v.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(l){if(this.state!==v.FILE_PENDING_DESTROY){l===void 0&&(l=this.data);var f=this.key,u=this.type;this.loader.emit(o.FILE_COMPLETE,f,u,l),this.loader.emit(o.FILE_KEY_COMPLETE+u+"-"+f,f,u,l),this.loader.flagForRemoval(this),this.state=v.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});s.createObjectURL=function(l,f,u){if(typeof URL=="function")l.src=URL.createObjectURL(f);else{var d=new FileReader;d.onload=function(){l.removeAttribute("crossOrigin"),l.src="data:"+(f.type||u)+";base64,"+d.result.split(",")[1]},d.onerror=l.onerror,d.readAsDataURL(f)}},s.revokeObjectURL=function(l){typeof URL=="function"&&URL.revokeObjectURL(l.src)},c.exports=s},74099:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={},t={install:function(a){for(var v in m)a[v]=m[v]},register:function(a,v){m[a]=v},destroy:function(){m={}}};c.exports=t},98356:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.url?t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:a+t.url:!1};c.exports=m},74261:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(35072),r=t(50792),n=t(54899),e=t(74099),i=t(95540),h=t(35154),s=t(37277),l=t(44594),f=t(92638),u=new a({Extends:r,initialize:function(p){r.call(this);var g=p.sys.game.config,y=p.sys.settings.loader;this.scene=p,this.systems=p.sys,this.cacheManager=p.sys.cache,this.textureManager=p.sys.textures,this.sceneManager=p.sys.game.scene,e.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(i(y,"baseURL",g.loaderBaseURL)),this.setPath(i(y,"path",g.loaderPath)),this.setPrefix(i(y,"prefix",g.loaderPrefix)),this.maxParallelDownloads=i(y,"maxParallelDownloads",g.loaderMaxParallelDownloads),this.xhr=f(i(y,"responseType",g.loaderResponseType),i(y,"async",g.loaderAsync),i(y,"user",g.loaderUser),i(y,"password",g.loaderPassword),i(y,"timeout",g.loaderTimeout),i(y,"withCredentials",g.loaderWithCredentials)),this.crossOrigin=i(y,"crossOrigin",g.loaderCrossOrigin),this.imageLoadType=i(y,"imageLoadType",g.loaderImageLoadType),this.localSchemes=i(y,"localScheme",g.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new o,this.inflight=new o,this.queue=new o,this._deleteQueue=new o,this.totalFailed=0,this.totalComplete=0,this.state=v.LOADER_IDLE,this.multiKeyIndex=0,p.sys.events.once(l.BOOT,this.boot,this),p.sys.events.on(l.START,this.pluginStart,this)},boot:function(){this.systems.events.once(l.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(l.SHUTDOWN,this.shutdown,this)},setBaseURL:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.baseURL=d,this},setPath:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.path=d,this},setPrefix:function(d){return d===void 0&&(d=""),this.prefix=d,this},setCORS:function(d){return this.crossOrigin=d,this},addFile:function(d){Array.isArray(d)||(d=[d]);for(var p=0;p0},isLoading:function(){return this.state===v.LOADER_LOADING||this.state===v.LOADER_PROCESSING},isReady:function(){return this.state===v.LOADER_IDLE||this.state===v.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=v.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(l.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===v.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 a=t(79291),v=t(92638),o=function(r,n){var e=r===void 0?v():a({},r);if(n)for(var i in n)n[i]!==void 0&&(e[i]=n[i]);return e};c.exports=o},26430:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(54899),r=new a({initialize:function(e,i,h,s){var l=[];s.forEach(function(d){d&&l.push(d)}),this.loader=e,this.type=i,this.key=h;var f=this.key;e.prefix&&e.prefix!==""&&(this.key=e.prefix+f),this.multiKeyIndex=e.multiKeyIndex++,this.files=l,this.state=v.FILE_PENDING,this.complete=!1,this.pending=l.length,this.failed=0,this.config={},this.baseURL=e.baseURL,this.path=e.path,this.prefix=e.prefix;for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(3374),v=function(o,r){var n=a(r,o.xhrSettings);if(o.base64){var e=o.url.split(";base64,").pop()||o.url.split(",").pop(),i={responseText:atob(e)};o.onBase64Load(i);return}var h=new XMLHttpRequest;if(h.open("GET",o.src,n.async,n.user,n.password),h.responseType=o.xhrSettings.responseType,h.timeout=n.timeout,n.headers)for(var s in n.headers)h.setRequestHeader(s,n.headers[s]);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=o.onLoad.bind(o,h),h.onerror=o.onError.bind(o,h),h.onprogress=o.onProgress.bind(o),h.ontimeout=o.onError.bind(o,h),h.send(),h};c.exports=v},92638:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r,n){return t===void 0&&(t=""),a===void 0&&(a=!0),v===void 0&&(v=""),o===void 0&&(o=""),r===void 0&&(r=0),n===void 0&&(n=!1),{responseType:t,async:a,user:v,password:o,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:n}};c.exports=m},23906:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},42155:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="addfile"},38991:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},27540:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="filecomplete"},87464:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="filecomplete-"},94486:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="loaderror"},13035:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="load"},38144:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="fileprogress"},97520:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="postprocess"},85595:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="progress"},55680:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="start"},54899:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(518),r=t(54899),n=new a({Extends:o,initialize:function(i,h,s,l,f){o.call(this,i,h,s,l,f),this.type="animationJSON"},onProcess:function(){this.loader.once(r.POST_PROCESS,this.onLoadComplete,this),o.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});v.register("animation",function(e,i,h,s){if(Array.isArray(e))for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new a({Extends:i,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var T=f;f=o(T,"key"),y=new r(l,{key:f,url:o(T,"textureURL"),extension:o(T,"textureExtension","png"),normalMap:o(T,"normalMap"),xhrSettings:o(T,"textureXhrSettings")}),x=new e(l,{key:f,url:o(T,"atlasURL"),extension:o(T,"atlasExtension","json"),xhrSettings:o(T,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new e(l,f,d,g);y.linkFile?i.call(this,l,"atlasjson",f,[y,x,y.linkFile]):i.call(this,l,"atlasjson",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),l.addToCache(),this.complete=!0}}});v.register("aseprite",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new a({Extends:i,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var T=f;f=o(T,"key"),y=new r(l,{key:f,url:o(T,"textureURL"),extension:o(T,"textureExtension","png"),normalMap:o(T,"normalMap"),xhrSettings:o(T,"textureXhrSettings")}),x=new e(l,{key:f,url:o(T,"atlasURL"),extension:o(T,"atlasExtension","json"),xhrSettings:o(T,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new e(l,f,d,g);y.linkFile?i.call(this,l,"atlasjson",f,[y,x,y.linkFile]):i.call(this,l,"atlasjson",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(57318),h=new a({Extends:e,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var T=f;f=o(T,"key"),y=new r(l,{key:f,url:o(T,"textureURL"),extension:o(T,"textureExtension","png"),normalMap:o(T,"normalMap"),xhrSettings:o(T,"textureXhrSettings")}),x=new i(l,{key:f,url:o(T,"atlasURL"),extension:o(T,"atlasExtension","xml"),xhrSettings:o(T,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new i(l,f,d,g);y.linkFile?e.call(this,l,"atlasxml",f,[y,x,y.linkFile]):e.call(this,l,"atlasxml",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlasXML",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(89749),i=t(41212),h=new a({Extends:o,initialize:function(l,f,u,d,p){if(i(f)){var g=f;f=n(g,"key"),d=n(g,"xhrSettings"),p=n(g,"context",p)}var y={type:"audio",cache:l.cacheManager.audio,extension:u.type,responseType:"arraybuffer",key:f,url:u.url,xhrSettings:d,config:{context:p}};o.call(this,l,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var s=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(l){s.data=l,s.onProcessComplete()},function(l){console.error("Error decoding audio: "+s.key+" - ",l?l.message:null),s.onProcessError()}),this.config.context=null}});h.create=function(s,l,f,u,d){var p=s.systems.game,g=p.config.audio,y=p.device.audio;i(l)&&(f=n(l,"url",[]),u=n(l,"config",{}));var x=h.getAudioURL(p,f);return x?y.webAudio&&!g.disableWebAudio?new h(s,l,x,d,p.sound.context):new e(s,l,x,u):(console.warn('No audio URLs for "%s" matched this device',l),null)},h.getAudioURL=function(s,l){Array.isArray(l)||(l=[l]);for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(21097),v=t(83419),o=t(74099),r=t(95540),n=t(41212),e=t(518),i=t(26430),h=new v({Extends:i,initialize:function(l,f,u,d,p,g,y){if(n(f)){var x=f;f=r(x,"key"),u=r(x,"jsonURL"),d=r(x,"audioURL"),p=r(x,"audioConfig"),g=r(x,"audioXhrSettings"),y=r(x,"jsonXhrSettings")}var T;if(!d)T=new e(l,f,u,y),i.call(this,l,"audiosprite",f,[T]),this.config.resourceLoad=!0,this.config.audioConfig=p,this.config.audioXhrSettings=g;else{var C=a.create(l,f,d,p,g);C&&(T=new e(l,f,u,y),i.call(this,l,"audiosprite",f,[C,T]),this.config.resourceLoad=!1)}},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,this.config.resourceLoad&&s.type==="json"&&s.data.hasOwnProperty("resources"))){var f=s.data.resources,u=r(this.config,"audioConfig"),d=r(this.config,"audioXhrSettings"),p=a.create(this.loader,s.key,f,u,d);p&&(this.addToMultiFile(p),this.loader.addFile(p))}},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1];s.addToCache(),l.addToCache(),this.complete=!0}}});o.register("audioSprite",function(s,l,f,u,d,p){var g=this.systems.game,y=g.config.audio,x=g.device.audio;if(y&&y.noAudio||!x.webAudio&&!x.audioData)return this;var T;if(Array.isArray(s))for(var C=0;C{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d){var p="bin";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"xhrSettings"),p=n(g,"extension",p),d=n(g,"dataType",d)}var y={type:"binary",cache:s.cacheManager.binary,extension:p,responseType:"arraybuffer",key:l,url:f,xhrSettings:u,config:{dataType:d}};o.call(this,s,y)},onProcess:function(){this.state=v.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,s,l,f){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 a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(21859),h=t(57318),s=new a({Extends:e,initialize:function(f,u,d,p,g,y){var x,T;if(n(u)){var C=u;u=o(C,"key"),x=new r(f,{key:u,url:o(C,"textureURL"),extension:o(C,"textureExtension","png"),normalMap:o(C,"normalMap"),xhrSettings:o(C,"textureXhrSettings")}),T=new h(f,{key:u,url:o(C,"fontDataURL"),extension:o(C,"fontDataExtension","xml"),xhrSettings:o(C,"fontDataXhrSettings")})}else x=new r(f,u,d,g),T=new h(f,u,p,y);x.linkFile?e.call(this,f,"bitmapfont",u,[x,T,x.linkFile]):e.call(this,f,"bitmapfont",u,[x,T])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1];l.addToCache();var u=l.cache.get(l.key),d=i(f.data,l.cache.getFrame(l.key),0,0,u);this.loader.cacheManager.bitmapFont.add(l.key,{data:d,texture:l.key,frame:null}),this.complete=!0}}});v.register("bitmapFont",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u){var d="css";if(e(l)){var p=l;l=n(p,"key"),f=n(p,"url"),u=n(p,"xhrSettings"),d=n(p,"extension",d)}var g={type:"script",cache:!1,extension:d,responseType:"text",key:l,url:f,xhrSettings:u};o.call(this,s,g)},onProcess:function(){this.state=v.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,s,l){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 a=t(38734),v=t(85722),o=t(83419),r=t(74099),n=t(95540),e=t(19550),i=t(41212),h=t(518),s=t(31403),l=t(46975),f=t(59327),u=t(26430),d=t(82038),p=t(55222),g=new o({Extends:u,initialize:function(x,T,C,M){if(C.multiAtlasURL){var w=new h(x,{key:T,url:C.multiAtlasURL,xhrSettings:M,config:C});u.call(this,x,"texture",T,[w])}else{var L=C.textureURL.substr(C.textureURL.length-3);C.type||(C.type=L.toLowerCase()==="ktx"?"KTX":"PVR");var F=new v(x,{key:T,url:C.textureURL,extension:L,xhrSettings:M,config:C});if(C.atlasURL){var O=new h(x,{key:T,url:C.atlasURL,xhrSettings:M,config:C});u.call(this,x,"texture",T,[F,O])}else u.call(this,x,"texture",T,[F])}this.config=C},onFileComplete:function(y){var x=this.files.indexOf(y);if(x!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(y.type==="json"&&y.data.hasOwnProperty("textures")){var T=y.data.textures,C=this.config,M=this.loader,w=M.baseURL,L=M.path,F=M.prefix,O=n(C,"multiBaseURL",this.baseURL),N=n(C,"multiPath",this.path),G=n(C,"prefix",this.prefix),V=n(C,"textureXhrSettings");O&&M.setBaseURL(O),N&&M.setPath(N),G&&M.setPrefix(G);for(var j=0;j{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(73894),h=new a({Extends:o,initialize:function(l,f,u,d,p){var g="glsl";if(e(f)){var y=f;f=n(y,"key"),u=n(y,"url"),d=n(y,"shaderType","fragment"),p=n(y,"xhrSettings"),g=n(y,"extension",g)}else d===void 0&&(d="fragment");var x={type:"glsl",cache:l.cacheManager.shader,extension:g,responseType:"text",key:f,url:u,config:{shaderType:d},xhrSettings:p};o.call(this,l,x)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s=this.data.split(` -`),l=this.extractBlock(s,0);if(l)for(;l;){var f=this.getShaderName(l.header),u=this.getShaderType(l.header),d=this.getShaderUniforms(l.header),p=l.shader;if(this.cache.has(f)){var g=this.cache.get(f);u==="fragment"?g.fragmentSrc=p:g.vertexSrc=p,g.uniforms||(g.uniforms=d)}else u==="fragment"?this.cache.add(f,new i(f,p,"",d)):this.cache.add(f,new i(f,"",p,d));l=this.extractBlock(s,l.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new i(this.key,this.data)):this.cache.add(this.key,new i(this.key,"",this.data))},getShaderName:function(s){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(54899),o=t(41299),r=t(95540),n=t(98356),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u){if(e(l)){var d=l;l=r(d,"key"),u=r(d,"config",u)}var p={type:"audio",cache:s.cacheManager.audio,extension:f.type,key:l,url:f.url,config:u};o.call(this,s,p),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 a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u){var d="html";if(e(l)){var p=l;l=n(p,"key"),f=n(p,"url"),u=n(p,"xhrSettings"),d=n(p,"extension",d)}var g={type:"text",cache:s.cacheManager.html,extension:d,responseType:"text",key:l,url:f,xhrSettings:u};o.call(this,s,g)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("html",function(h,s,l){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 a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d,p){u===void 0&&(u=512),d===void 0&&(d=512);var g="html";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"width",u),d=n(y,"height",d)}var x={type:"html",cache:s.textureManager,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{width:u,height:d}};o.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.config.width,s=this.config.height,l=[];l.push(''),l.push(''),l.push(''),l.push(this.xhrLoader.responseText),l.push(""),l.push(""),l.push("");var f=[l.join(` -`)],u=this;try{var d=new window.Blob(f,{type:"image/svg+xml;charset=utf-8"})}catch{u.state=v.FILE_ERRORED,u.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){o.revokeObjectURL(u.data),u.onProcessComplete()},this.data.onerror=function(){o.revokeObjectURL(u.data),u.onProcessError()},o.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("htmlTexture",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(98356),h=new a({Extends:o,initialize:function s(l,f,u,d,p){var g="png",y;if(e(f)){var x=f;f=n(x,"key"),u=n(x,"url"),y=n(x,"normalMap"),d=n(x,"xhrSettings"),g=n(x,"extension",g),p=n(x,"frameConfig")}Array.isArray(u)&&(y=u[1],u=u[0]);var T={type:"image",cache:l.textureManager,extension:g,responseType:"blob",key:f,url:u,xhrSettings:d,config:p};if(o.call(this,l,T),y){var C=new s(l,this.key,y,d,p);C.type="normalMap",this.setLink(C),l.addFile(C)}this.useImageElementLoad=l.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){o.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){o.revokeObjectURL(s.data),s.onProcessError()},o.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var s=this.state;this.state=v.FILE_PROCESSING,s===v.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=v.FILE_LOADING,this.src=i(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){s.state=v.FILE_LOADED,s.loader.nextFile(s,!0)},this.data.onerror=function(){s.loader.nextFile(s,!1)},this.data.src=this.src},addToCache:function(){var s=this.linkFile;s?s.state>=v.FILE_COMPLETE&&(s.type==="spritesheet"?s.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,s.data,this.data):this.cache.addImage(this.key,this.data,s.data)):this.cache.addImage(this.key,this.data)}});r.register("image",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(35154),i=t(41212),h=new a({Extends:o,initialize:function(l,f,u,d,p){var g="json";if(i(f)){var y=f;f=n(y,"key"),u=n(y,"url"),d=n(y,"xhrSettings"),g=n(y,"extension",g),p=n(y,"dataKey",p)}var x={type:"json",cache:l.cacheManager.json,extension:g,responseType:"text",key:f,url:u,xhrSettings:d,config:p};o.call(this,l,x),i(u)&&(p?this.data=e(u,p):this.data=u,this.state=v.FILE_POPULATED)},onProcess:function(){if(this.state!==v.FILE_POPULATED){this.state=v.FILE_PROCESSING;try{var s=JSON.parse(this.xhrLoader.responseText)}catch(f){throw this.onProcessError(),f}var l=this.config;typeof l=="string"?this.data=e(s,l,s):this.data=s}this.onProcessComplete()}});r.register("json",function(s,l,f,u){if(Array.isArray(s))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new a({Extends:i,initialize:function(l,f,u,d,p,g,y){if(n(f)){var x=f;f=o(x,"key"),o(x,"url",!1)?u=o(x,"url"):u=o(x,"atlasURL"),g=o(x,"xhrSettings"),d=o(x,"path"),p=o(x,"baseURL"),y=o(x,"textureXhrSettings")}var T=new e(l,f,u,g);i.call(this,l,"multiatlas",f,[T]),this.config.path=d,this.config.baseURL=p,this.config.textureXhrSettings=y},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,s.type==="json"&&s.data.hasOwnProperty("textures"))){var f=s.data.textures,u=this.config,d=this.loader,p=d.baseURL,g=d.path,y=d.prefix,x=o(u,"baseURL",this.baseURL),T=o(u,"path",this.path),C=o(u,"prefix",this.prefix),M=o(u,"textureXhrSettings");d.setBaseURL(x),d.setPath(T),d.setPrefix(C);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(41212),n=t(26430),e=t(34328),i=new a({Extends:n,initialize:function(s,l,f,u){var d="js",p=[];if(r(l)){var g=l;l=o(g,"key"),f=o(g,"url"),u=o(g,"xhrSettings"),d=o(g,"extension",d)}Array.isArray(f)||(f=[f]);for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(95540),r=t(41212),n=t(26430),e=t(85048),i=t(61485),h=t(78776),s=new a({Extends:n,initialize:function(f,u,d,p,g,y){var x,T,C=f.cacheManager.obj;if(r(u)){var M=u;u=o(M,"key"),x=new h(f,{key:u,type:"obj",cache:C,url:o(M,"url"),extension:o(M,"extension","obj"),xhrSettings:o(M,"xhrSettings"),config:{flipUV:o(M,"flipUV",g)}}),p=o(M,"matURL"),p&&(T=new h(f,{key:u,type:"mat",cache:C,url:p,extension:o(M,"matExtension","mat"),xhrSettings:o(M,"xhrSettings")}))}else x=new h(f,{key:u,url:d,type:"obj",cache:C,extension:"obj",xhrSettings:y,config:{flipUV:g}}),p&&(T=new h(f,{key:u,url:p,type:"mat",cache:C,extension:"mat",xhrSettings:y}));n.call(this,f,"obj",u,[x,T])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1],u=e(l.data,l.config.flipUV);f&&(u.materials=i(f.data)),l.cache.add(l.key,u),this.complete=!0}}});v.register("obj",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(74099),r=t(518),n=new a({Extends:r,initialize:function(i,h,s,l,f){r.call(this,i,h,s,l,f),this.type="packfile"},onProcess:function(){if(this.state!==v.FILE_POPULATED&&(this.state=v.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()}});o.register("pack",function(e,i,h,s){if(Array.isArray(e))for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"start"),d=n(y,"mapping")}var x={type:"plugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{start:u,mapping:d}};o.call(this,s,x),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=n(s,"start",!1),f=n(s,"mapping",null);if(this.state===v.FILE_POPULATED)h.install(this.key,this.data,l,f);else{this.state=v.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 u=h.install(this.key,window[this.key],l,f);(l||f)&&(this.loader.systems[f]=u,this.loader.scene[f]=u)}this.onProcessComplete()}});r.register("plugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d){var p="svg";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"svgConfig",{}),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"svg",cache:s.textureManager,extension:p,responseType:"text",key:l,url:f,xhrSettings:d,config:{width:n(u,"width"),height:n(u,"height"),scale:n(u,"scale")}};o.call(this,s,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.xhrLoader.responseText,s=[h],l=this.config.width,f=this.config.height,u=this.config.scale;t:if(l&&f||u){var d=null,p=new DOMParser;d=p.parseFromString(h,"text/xml");var g=d.getElementsByTagName("svg")[0],y=g.hasAttribute("viewBox"),x=parseFloat(g.getAttribute("width")),T=parseFloat(g.getAttribute("height"));if(!y&&x&&T)g.setAttribute("viewBox","0 0 "+x+" "+T);else if(y&&!x&&!T){var C=g.getAttribute("viewBox").split(/\s+|,/);x=C[2],T=C[3]}if(u)if(x&&T)l=x*u,f=T*u;else break t;g.setAttribute("width",l.toString()+"px"),g.setAttribute("height",f.toString()+"px"),s=[new XMLSerializer().serializeToString(g)]}try{var M=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var w=this,L=!1;this.data.onload=function(){L||o.revokeObjectURL(w.data),w.onProcessComplete()},this.data.onerror=function(){L?w.onProcessError():(L=!0,o.revokeObjectURL(w.data),w.data.src="data:image/svg+xml,"+encodeURIComponent(s.join("")))},o.createObjectURL(this.data,M,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("svg",function(h,s,l,f){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 a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u){var d="js";if(e(l)){var p=l;l=n(p,"key"),f=n(p,"url"),u=n(p,"xhrSettings"),d=n(p,"extension",d)}var g={type:"text",extension:d,responseType:"text",key:l,url:f,xhrSettings:u};o.call(this,s,g)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var h=this.data.concat(`(function(){ -return new `+this.key+`(); -}).call(this);`),s=eval;this.loader.sceneManager.add(this.key,s(h)),this.complete=!0}});r.register("sceneFile",function(h,s,l){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 a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"systemKey"),d=n(y,"sceneKey")}var x={type:"scenePlugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{systemKey:u,sceneKey:d}};o.call(this,s,x),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=this.key,f=n(s,"systemKey",l),u=n(s,"sceneKey",l);this.state===v.FILE_POPULATED?h.installScenePlugin(f,this.data,u,this.loader.scene,!0):(this.state=v.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],u,this.loader.scene,!0)),this.onProcessComplete()}});r.register("scenePlugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u,d){var p="js";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"type","script"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}else u===void 0&&(u="script");var y={type:u,cache:!1,extension:p,responseType:"text",key:l,url:f,xhrSettings:d};o.call(this,s,y)},onProcess:function(){this.state=v.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,s,l,f){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 a=t(83419),v=t(23906),o=t(74099),r=t(19550),n=new a({Extends:r,initialize:function(i,h,s,l,f){r.call(this,i,h,s,f,l),this.type="spritesheet"},addToCache:function(){var e=this.linkFile;e?e.state>=v.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)}});o.register("spritesheet",function(e,i,h,s){if(Array.isArray(e))for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new a({Extends:o,initialize:function(s,l,f,u){var d="text",p="txt",g=s.cacheManager.text;if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),u=n(y,"xhrSettings"),p=n(y,"extension",p),d=n(y,"type",d),g=n(y,"cache",g)}var x={type:d,cache:g,extension:p,responseType:"text",key:l,url:f,xhrSettings:u};o.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(h,s,l){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 a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(80341),h=new a({Extends:o,initialize:function(l,f,u,d){var p="csv";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"tilemapCSV",cache:l.cacheManager.tilemap,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};o.call(this,l,y),this.tilemapFormat=i.CSV},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,s)}});r.register("tilemapCSV",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(74099),o=t(518),r=t(80341),n=new a({Extends:o,initialize:function(i,h,s,l){o.call(this,i,h,s,l),this.type="tilemapJSON",this.cache=i.cacheManager.tilemap},addToCache:function(){var e={format:r.WELTMEISTER,data:this.data};this.cache.add(this.key,e)}});v.register("tilemapImpact",function(e,i,h){if(Array.isArray(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 a=t(83419),v=t(74099),o=t(518),r=t(80341),n=new a({Extends:o,initialize:function(i,h,s,l){o.call(this,i,h,s,l),this.type="tilemapJSON",this.cache=i.cacheManager.tilemap},addToCache:function(){var e={format:r.TILED_JSON,data:this.data};this.cache.add(this.key,e)}});v.register("tilemapTiledJSON",function(e,i,h){if(Array.isArray(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 a=t(83419),v=t(74099),o=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(78776),h=new a({Extends:e,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var T=f;f=o(T,"key"),y=new r(l,{key:f,url:o(T,"textureURL"),extension:o(T,"textureExtension","png"),normalMap:o(T,"normalMap"),xhrSettings:o(T,"textureXhrSettings")}),x=new i(l,{key:f,url:o(T,"atlasURL"),extension:o(T,"atlasExtension","txt"),xhrSettings:o(T,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new i(l,f,d,g);y.linkFile?e.call(this,l,"unityatlas",f,[y,x,y.linkFile]):e.call(this,l,"unityatlas",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("unityAtlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(98356),e=t(95540),i=t(41212),h=new a({Extends:o,initialize:function(l,f,u,d){if(d===void 0&&(d=!1),i(f)){var p=f;f=e(p,"key"),u=e(p,"url",[]),d=e(p,"noAudio",!1)}var g=l.systems.game.device.video.getVideoURL(u);g||console.warn("VideoFile: No supported format for "+f);var y={type:"video",cache:l.cacheManager.video,extension:g.type,key:f,url:g.url,config:{noAudio:d}};o.call(this,l,y)},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=v.FILE_LOADED,this.loader.nextFile(this,!0)}});r.register("video",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(23906),o=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(56836),h=new a({Extends:o,initialize:function(l,f,u,d){var p="xml";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"xml",cache:l.cacheManager.xml,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};o.call(this,l,y)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=i(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});r.register("xml",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23906),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},53307:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){for(var a=0,v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6411),v=function(o,r){return a(o)/a(r)/a(o-r)};c.exports=v},30976:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return Math.floor(Math.random()*(a-t+1)+t)};c.exports=m},87842:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){var n=(o-a)*.5,e=(r-v)*.5,i=t*t,h=t*i;return(2*v-2*o+n+e)*h+(-3*v+3*o-2*n-e)*i+n*t+v};c.exports=m},26302:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){a===void 0&&(a=0),v===void 0&&(v=10);var o=Math.pow(v,-a);return Math.ceil(t*o)/o};c.exports=m},45319:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return Math.max(a,Math.min(v,t))};c.exports=m},39506:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=function(o){return o*a.DEG_TO_RAD};c.exports=v},61241:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return Math.abs(t-a)};c.exports=m},38857:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(37867),r=t(29747),n=new o,e=new v({initialize:function i(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=i.DefaultOrder),this._x=h,this._y=s,this._z=l,this._order=f,this.onChangeCallback=r},x:{get:function(){return this._x},set:function(i){this._x=i,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(i){this._y=i,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(i){this._z=i,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(i){this._order=i,this.onChangeCallback(this)}},set:function(i,h,s,l){return l===void 0&&(l=this._order),this._x=i,this._y=h,this._z=s,this._order=l,this.onChangeCallback(this),this},copy:function(i){return this.set(i.x,i.y,i.z,i.order)},setFromQuaternion:function(i,h,s){return h===void 0&&(h=this._order),s===void 0&&(s=!1),n.fromQuat(i),this.setFromRotationMatrix(n,h,s)},setFromRotationMatrix:function(i,h,s){h===void 0&&(h=this._order),s===void 0&&(s=!1);var l=i.val,f=l[0],u=l[4],d=l[8],p=l[1],g=l[5],y=l[9],x=l[2],T=l[6],C=l[10],M=0,w=0,L=0,F=.99999;switch(h){case"XYZ":{w=Math.asin(a(d,-1,1)),Math.abs(d){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){if(t===0)return 1;for(var a=t;--t;)a*=t;return a};c.exports=m},99472:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return Math.random()*(a-t)+t};c.exports=m},77623:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){a===void 0&&(a=0),v===void 0&&(v=10);var o=Math.pow(v,-a);return Math.floor(t*o)/o};c.exports=m},62945:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=function(o,r,n){return o=a(o,0,1),(n-r)*o+r};c.exports=v},38265:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t/a/1e3};c.exports=m},78702:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t==parseFloat(t)?!(t%2):void 0};c.exports=m},94883:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t===parseFloat(t)?!(t%2):void 0};c.exports=m},28915:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return(a-t)*v+t};c.exports=m},94908:c=>{/** - * @author Greg McLean - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v===void 0&&(v=0),t.clone().lerp(a,v)};c.exports=m},94434:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r){this.val=new Float32Array(9),r?this.copy(r):this.identity()},clone:function(){return new v(this)},set:function(o){return this.copy(o)},copy:function(o){var r=this.val,n=o.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(o){var r=o.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(o){var r=this.val;return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[8]=o[8],this},identity:function(){var o=this.val;return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=0,o[8]=1,this},transpose:function(){var o=this.val,r=o[1],n=o[2],e=o[5];return o[1]=o[3],o[2]=o[6],o[3]=r,o[5]=o[7],o[6]=n,o[7]=e,this},invert:function(){var o=this.val,r=o[0],n=o[1],e=o[2],i=o[3],h=o[4],s=o[5],l=o[6],f=o[7],u=o[8],d=u*h-s*f,p=-u*i+s*l,g=f*i-h*l,y=r*d+n*p+e*g;return y?(y=1/y,o[0]=d*y,o[1]=(-u*n+e*f)*y,o[2]=(s*n-e*h)*y,o[3]=p*y,o[4]=(u*r-e*l)*y,o[5]=(-s*r+e*i)*y,o[6]=g*y,o[7]=(-f*r+n*l)*y,o[8]=(h*r-n*i)*y,this):null},adjoint:function(){var o=this.val,r=o[0],n=o[1],e=o[2],i=o[3],h=o[4],s=o[5],l=o[6],f=o[7],u=o[8];return o[0]=h*u-s*f,o[1]=e*f-n*u,o[2]=n*s-e*h,o[3]=s*l-i*u,o[4]=r*u-e*l,o[5]=e*i-r*s,o[6]=i*f-h*l,o[7]=n*l-r*f,o[8]=r*h-n*i,this},determinant:function(){var o=this.val,r=o[0],n=o[1],e=o[2],i=o[3],h=o[4],s=o[5],l=o[6],f=o[7],u=o[8];return r*(u*h-s*f)+n*(-u*i+s*l)+e*(f*i-h*l)},multiply:function(o){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=r[6],u=r[7],d=r[8],p=o.val,g=p[0],y=p[1],x=p[2],T=p[3],C=p[4],M=p[5],w=p[6],L=p[7],F=p[8];return r[0]=g*n+y*h+x*f,r[1]=g*e+y*s+x*u,r[2]=g*i+y*l+x*d,r[3]=T*n+C*h+M*f,r[4]=T*e+C*s+M*u,r[5]=T*i+C*l+M*d,r[6]=w*n+L*h+F*f,r[7]=w*e+L*s+F*u,r[8]=w*i+L*l+F*d,this},translate:function(o){var r=this.val,n=o.x,e=o.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(o){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=Math.sin(o),u=Math.cos(o);return r[0]=u*n+f*h,r[1]=u*e+f*s,r[2]=u*i+f*l,r[3]=u*h-f*n,r[4]=u*s-f*e,r[5]=u*l-f*i,this},scale:function(o){var r=this.val,n=o.x,e=o.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(o){var r=o.x,n=o.y,e=o.z,i=o.w,h=r+r,s=n+n,l=e+e,f=r*h,u=r*s,d=r*l,p=n*s,g=n*l,y=e*l,x=i*h,T=i*s,C=i*l,M=this.val;return M[0]=1-(p+y),M[3]=u+C,M[6]=d-T,M[1]=u-C,M[4]=1-(f+y),M[7]=g+x,M[2]=d+T,M[5]=g-x,M[8]=1-(f+p),this},normalFromMat4:function(o){var r=o.val,n=this.val,e=r[0],i=r[1],h=r[2],s=r[3],l=r[4],f=r[5],u=r[6],d=r[7],p=r[8],g=r[9],y=r[10],x=r[11],T=r[12],C=r[13],M=r[14],w=r[15],L=e*f-i*l,F=e*u-h*l,O=e*d-s*l,N=i*u-h*f,G=i*d-s*f,V=h*d-s*u,j=p*C-g*T,K=p*M-y*T,J=p*w-x*T,X=g*M-y*C,Y=g*w-x*C,D=y*w-x*M,z=L*D-F*Y+O*X+N*J-G*K+V*j;return z?(z=1/z,n[0]=(f*D-u*Y+d*X)*z,n[1]=(u*J-l*D-d*K)*z,n[2]=(l*Y-f*J+d*j)*z,n[3]=(h*Y-i*D-s*X)*z,n[4]=(e*D-h*J+s*K)*z,n[5]=(i*J-e*Y-s*j)*z,n[6]=(C*V-M*G+w*N)*z,n[7]=(M*O-T*V-w*F)*z,n[8]=(T*G-C*O+w*L)*z,this):null}});c.exports=v},37867:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(25836),o=1e-6,r=new a({initialize:function(f){this.val=new Float32Array(16),f?this.copy(f):this.identity()},clone:function(){return new r(this)},set:function(l){return this.copy(l)},setValues:function(l,f,u,d,p,g,y,x,T,C,M,w,L,F,O,N){var G=this.val;return G[0]=l,G[1]=f,G[2]=u,G[3]=d,G[4]=p,G[5]=g,G[6]=y,G[7]=x,G[8]=T,G[9]=C,G[10]=M,G[11]=w,G[12]=L,G[13]=F,G[14]=O,G[15]=N,this},copy:function(l){var f=l.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(l){return this.setValues(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(l,f,u){var d=n.fromQuat(u),p=d.val,g=f.x,y=f.y,x=f.z;return this.setValues(p[0]*g,p[1]*g,p[2]*g,0,p[4]*y,p[5]*y,p[6]*y,0,p[8]*x,p[9]*x,p[10]*x,0,l.x,l.y,l.z,1)},xyz:function(l,f,u){this.identity();var d=this.val;return d[12]=l,d[13]=f,d[14]=u,this},scaling:function(l,f,u){this.zero();var d=this.val;return d[0]=l,d[5]=f,d[10]=u,d[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 l=this.val,f=l[1],u=l[2],d=l[3],p=l[6],g=l[7],y=l[11];return l[1]=l[4],l[2]=l[8],l[3]=l[12],l[4]=f,l[6]=l[9],l[7]=l[13],l[8]=u,l[9]=p,l[11]=l[14],l[12]=d,l[13]=g,l[14]=y,this},getInverse:function(l){return this.copy(l),this.invert()},invert:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],T=l[7],C=l[8],M=l[9],w=l[10],L=l[11],F=l[12],O=l[13],N=l[14],G=l[15],V=f*y-u*g,j=f*x-d*g,K=f*T-p*g,J=u*x-d*y,X=u*T-p*y,Y=d*T-p*x,D=C*O-M*F,z=C*N-w*F,W=C*G-L*F,H=M*N-w*O,Z=M*G-L*O,Q=w*G-L*N,k=V*Q-j*Z+K*H+J*W-X*z+Y*D;return k?(k=1/k,this.setValues((y*Q-x*Z+T*H)*k,(d*Z-u*Q-p*H)*k,(O*Y-N*X+G*J)*k,(w*X-M*Y-L*J)*k,(x*W-g*Q-T*z)*k,(f*Q-d*W+p*z)*k,(N*K-F*Y-G*j)*k,(C*Y-w*K+L*j)*k,(g*Z-y*W+T*D)*k,(u*W-f*Z-p*D)*k,(F*X-O*K+G*V)*k,(M*K-C*X-L*V)*k,(y*z-g*H-x*D)*k,(f*H-u*z+d*D)*k,(O*j-F*J-N*V)*k,(C*J-M*j+w*V)*k)):this},adjoint:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],T=l[7],C=l[8],M=l[9],w=l[10],L=l[11],F=l[12],O=l[13],N=l[14],G=l[15];return this.setValues(y*(w*G-L*N)-M*(x*G-T*N)+O*(x*L-T*w),-(u*(w*G-L*N)-M*(d*G-p*N)+O*(d*L-p*w)),u*(x*G-T*N)-y*(d*G-p*N)+O*(d*T-p*x),-(u*(x*L-T*w)-y*(d*L-p*w)+M*(d*T-p*x)),-(g*(w*G-L*N)-C*(x*G-T*N)+F*(x*L-T*w)),f*(w*G-L*N)-C*(d*G-p*N)+F*(d*L-p*w),-(f*(x*G-T*N)-g*(d*G-p*N)+F*(d*T-p*x)),f*(x*L-T*w)-g*(d*L-p*w)+C*(d*T-p*x),g*(M*G-L*O)-C*(y*G-T*O)+F*(y*L-T*M),-(f*(M*G-L*O)-C*(u*G-p*O)+F*(u*L-p*M)),f*(y*G-T*O)-g*(u*G-p*O)+F*(u*T-p*y),-(f*(y*L-T*M)-g*(u*L-p*M)+C*(u*T-p*y)),-(g*(M*N-w*O)-C*(y*N-x*O)+F*(y*w-x*M)),f*(M*N-w*O)-C*(u*N-d*O)+F*(u*w-d*M),-(f*(y*N-x*O)-g*(u*N-d*O)+F*(u*x-d*y)),f*(y*w-x*M)-g*(u*w-d*M)+C*(u*x-d*y))},determinant:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],T=l[7],C=l[8],M=l[9],w=l[10],L=l[11],F=l[12],O=l[13],N=l[14],G=l[15],V=f*y-u*g,j=f*x-d*g,K=f*T-p*g,J=u*x-d*y,X=u*T-p*y,Y=d*T-p*x,D=C*O-M*F,z=C*N-w*F,W=C*G-L*F,H=M*N-w*O,Z=M*G-L*O,Q=w*G-L*N;return V*Q-j*Z+K*H+J*W-X*z+Y*D},multiply:function(l){var f=this.val,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5],T=f[6],C=f[7],M=f[8],w=f[9],L=f[10],F=f[11],O=f[12],N=f[13],G=f[14],V=f[15],j=l.val,K=j[0],J=j[1],X=j[2],Y=j[3];return f[0]=K*u+J*y+X*M+Y*O,f[1]=K*d+J*x+X*w+Y*N,f[2]=K*p+J*T+X*L+Y*G,f[3]=K*g+J*C+X*F+Y*V,K=j[4],J=j[5],X=j[6],Y=j[7],f[4]=K*u+J*y+X*M+Y*O,f[5]=K*d+J*x+X*w+Y*N,f[6]=K*p+J*T+X*L+Y*G,f[7]=K*g+J*C+X*F+Y*V,K=j[8],J=j[9],X=j[10],Y=j[11],f[8]=K*u+J*y+X*M+Y*O,f[9]=K*d+J*x+X*w+Y*N,f[10]=K*p+J*T+X*L+Y*G,f[11]=K*g+J*C+X*F+Y*V,K=j[12],J=j[13],X=j[14],Y=j[15],f[12]=K*u+J*y+X*M+Y*O,f[13]=K*d+J*x+X*w+Y*N,f[14]=K*p+J*T+X*L+Y*G,f[15]=K*g+J*C+X*F+Y*V,this},multiplyLocal:function(l){var f=this.val,u=l.val;return this.setValues(f[0]*u[0]+f[1]*u[4]+f[2]*u[8]+f[3]*u[12],f[0]*u[1]+f[1]*u[5]+f[2]*u[9]+f[3]*u[13],f[0]*u[2]+f[1]*u[6]+f[2]*u[10]+f[3]*u[14],f[0]*u[3]+f[1]*u[7]+f[2]*u[11]+f[3]*u[15],f[4]*u[0]+f[5]*u[4]+f[6]*u[8]+f[7]*u[12],f[4]*u[1]+f[5]*u[5]+f[6]*u[9]+f[7]*u[13],f[4]*u[2]+f[5]*u[6]+f[6]*u[10]+f[7]*u[14],f[4]*u[3]+f[5]*u[7]+f[6]*u[11]+f[7]*u[15],f[8]*u[0]+f[9]*u[4]+f[10]*u[8]+f[11]*u[12],f[8]*u[1]+f[9]*u[5]+f[10]*u[9]+f[11]*u[13],f[8]*u[2]+f[9]*u[6]+f[10]*u[10]+f[11]*u[14],f[8]*u[3]+f[9]*u[7]+f[10]*u[11]+f[11]*u[15],f[12]*u[0]+f[13]*u[4]+f[14]*u[8]+f[15]*u[12],f[12]*u[1]+f[13]*u[5]+f[14]*u[9]+f[15]*u[13],f[12]*u[2]+f[13]*u[6]+f[14]*u[10]+f[15]*u[14],f[12]*u[3]+f[13]*u[7]+f[14]*u[11]+f[15]*u[15])},premultiply:function(l){return this.multiplyMatrices(l,this)},multiplyMatrices:function(l,f){var u=l.val,d=f.val,p=u[0],g=u[4],y=u[8],x=u[12],T=u[1],C=u[5],M=u[9],w=u[13],L=u[2],F=u[6],O=u[10],N=u[14],G=u[3],V=u[7],j=u[11],K=u[15],J=d[0],X=d[4],Y=d[8],D=d[12],z=d[1],W=d[5],H=d[9],Z=d[13],Q=d[2],k=d[6],et=d[10],st=d[14],rt=d[3],ot=d[7],dt=d[11],at=d[15];return this.setValues(p*J+g*z+y*Q+x*rt,T*J+C*z+M*Q+w*rt,L*J+F*z+O*Q+N*rt,G*J+V*z+j*Q+K*rt,p*X+g*W+y*k+x*ot,T*X+C*W+M*k+w*ot,L*X+F*W+O*k+N*ot,G*X+V*W+j*k+K*ot,p*Y+g*H+y*et+x*dt,T*Y+C*H+M*et+w*dt,L*Y+F*H+O*et+N*dt,G*Y+V*H+j*et+K*dt,p*D+g*Z+y*st+x*at,T*D+C*Z+M*st+w*at,L*D+F*Z+O*st+N*at,G*D+V*Z+j*st+K*at)},translate:function(l){return this.translateXYZ(l.x,l.y,l.z)},translateXYZ:function(l,f,u){var d=this.val;return d[12]=d[0]*l+d[4]*f+d[8]*u+d[12],d[13]=d[1]*l+d[5]*f+d[9]*u+d[13],d[14]=d[2]*l+d[6]*f+d[10]*u+d[14],d[15]=d[3]*l+d[7]*f+d[11]*u+d[15],this},scale:function(l){return this.scaleXYZ(l.x,l.y,l.z)},scaleXYZ:function(l,f,u){var d=this.val;return d[0]=d[0]*l,d[1]=d[1]*l,d[2]=d[2]*l,d[3]=d[3]*l,d[4]=d[4]*f,d[5]=d[5]*f,d[6]=d[6]*f,d[7]=d[7]*f,d[8]=d[8]*u,d[9]=d[9]*u,d[10]=d[10]*u,d[11]=d[11]*u,this},makeRotationAxis:function(l,f){var u=Math.cos(f),d=Math.sin(f),p=1-u,g=l.x,y=l.y,x=l.z,T=p*g,C=p*y;return this.setValues(T*g+u,T*y-d*x,T*x+d*y,0,T*y+d*x,C*y+u,C*x-d*g,0,T*x-d*y,C*x+d*g,p*x*x+u,0,0,0,0,1)},rotate:function(l,f){var u=this.val,d=f.x,p=f.y,g=f.z,y=Math.sqrt(d*d+p*p+g*g);if(Math.abs(y){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return Math.min(t+a,v)};c.exports=m},50040:c=>{/** - * @author Vladislav Forsh - * @copyright 2021 RoboWhale - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=t.length;if(a===0)return 0;t.sort(function(o,r){return o-r});var v=Math.floor(a/2);return a%2===0?(t[v]+t[v-1])/2:t[v]};c.exports=m},37204:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return Math.max(t-a,v)};c.exports=m},65201:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){v===void 0&&(v=a+1);var r=(t-a)/(v-a);return r>1?o!==void 0?(r=(o-t)/(o-v),r<0&&(r=0)):r=1:r<0&&(r=0),r};c.exports=m},15746:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(94434),o=t(29747),r=t(25836),n=1e-6,e=new Int8Array([1,2,0]),i=new Float32Array([0,0,0]),h=new r(1,0,0),s=new r(0,1,0),l=new r,f=new v,u=new a({initialize:function(p,g,y,x){this.onChangeCallback=o,this.set(p,g,y,x)},x:{get:function(){return this._x},set:function(d){this._x=d,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(d){this._y=d,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(d){this._z=d,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(d){this._w=d,this.onChangeCallback(this)}},copy:function(d){return this.set(d)},set:function(d,p,g,y,x){return x===void 0&&(x=!0),typeof d=="object"?(this._x=d.x||0,this._y=d.y||0,this._z=d.z||0,this._w=d.w||0):(this._x=d||0,this._y=p||0,this._z=g||0,this._w=y||0),x&&this.onChangeCallback(this),this},add:function(d){return this._x+=d.x,this._y+=d.y,this._z+=d.z,this._w+=d.w,this.onChangeCallback(this),this},subtract:function(d){return this._x-=d.x,this._y-=d.y,this._z-=d.z,this._w-=d.w,this.onChangeCallback(this),this},scale:function(d){return this._x*=d,this._y*=d,this._z*=d,this._w*=d,this.onChangeCallback(this),this},length:function(){var d=this.x,p=this.y,g=this.z,y=this.w;return Math.sqrt(d*d+p*p+g*g+y*y)},lengthSq:function(){var d=this.x,p=this.y,g=this.z,y=this.w;return d*d+p*p+g*g+y*y},normalize:function(){var d=this.x,p=this.y,g=this.z,y=this.w,x=d*d+p*p+g*g+y*y;return x>0&&(x=1/Math.sqrt(x),this._x=d*x,this._y=p*x,this._z=g*x,this._w=y*x),this.onChangeCallback(this),this},dot:function(d){return this.x*d.x+this.y*d.y+this.z*d.z+this.w*d.w},lerp:function(d,p){p===void 0&&(p=0);var g=this.x,y=this.y,x=this.z,T=this.w;return this.set(g+p*(d.x-g),y+p*(d.y-y),x+p*(d.z-x),T+p*(d.w-T))},rotationTo:function(d,p){var g=d.x*p.x+d.y*p.y+d.z*p.z;return g<-.999999?(l.copy(h).cross(d).length().999999?this.set(0,0,0,1):(l.copy(d).cross(p),this._x=l.x,this._y=l.y,this._z=l.z,this._w=1+g,this.normalize())},setAxes:function(d,p,g){var y=f.val;return y[0]=p.x,y[3]=p.y,y[6]=p.z,y[1]=g.x,y[4]=g.y,y[7]=g.z,y[2]=-d.x,y[5]=-d.y,y[8]=-d.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(d,p){p=p*.5;var g=Math.sin(p);return this.set(g*d.x,g*d.y,g*d.z,Math.cos(p))},multiply:function(d){var p=this.x,g=this.y,y=this.z,x=this.w,T=d.x,C=d.y,M=d.z,w=d.w;return this.set(p*w+x*T+g*M-y*C,g*w+x*C+y*T-p*M,y*w+x*M+p*C-g*T,x*w-p*T-g*C-y*M)},slerp:function(d,p){var g=this.x,y=this.y,x=this.z,T=this.w,C=d.x,M=d.y,w=d.z,L=d.w,F=g*C+y*M+x*w+T*L;F<0&&(F=-F,C=-C,M=-M,w=-w,L=-L);var O=1-p,N=p;if(1-F>n){var G=Math.acos(F),V=Math.sin(G);O=Math.sin((1-p)*G)/V,N=Math.sin(p*G)/V}return this.set(O*g+N*C,O*y+N*M,O*x+N*w,O*T+N*L)},invert:function(){var d=this.x,p=this.y,g=this.z,y=this.w,x=d*d+p*p+g*g+y*y,T=x?1/x:0;return this.set(-d*T,-p*T,-g*T,y*T)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,T=Math.sin(d),C=Math.cos(d);return this.set(p*C+x*T,g*C+y*T,y*C-g*T,x*C-p*T)},rotateY:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,T=Math.sin(d),C=Math.cos(d);return this.set(p*C-y*T,g*C+x*T,y*C+p*T,x*C-g*T)},rotateZ:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,T=Math.sin(d),C=Math.cos(d);return this.set(p*C+g*T,g*C-p*T,y*C+x*T,x*C-y*T)},calculateW:function(){var d=this.x,p=this.y,g=this.z;return this.w=-Math.sqrt(1-d*d-p*p-g*g),this},setFromEuler:function(d,p){var g=d.x/2,y=d.y/2,x=d.z/2,T=Math.cos(g),C=Math.cos(y),M=Math.cos(x),w=Math.sin(g),L=Math.sin(y),F=Math.sin(x);switch(d.order){case"XYZ":{this.set(w*C*M+T*L*F,T*L*M-w*C*F,T*C*F+w*L*M,T*C*M-w*L*F,p);break}case"YXZ":{this.set(w*C*M+T*L*F,T*L*M-w*C*F,T*C*F-w*L*M,T*C*M+w*L*F,p);break}case"ZXY":{this.set(w*C*M-T*L*F,T*L*M+w*C*F,T*C*F+w*L*M,T*C*M-w*L*F,p);break}case"ZYX":{this.set(w*C*M-T*L*F,T*L*M+w*C*F,T*C*F-w*L*M,T*C*M+w*L*F,p);break}case"YZX":{this.set(w*C*M+T*L*F,T*L*M+w*C*F,T*C*F-w*L*M,T*C*M-w*L*F,p);break}case"XZY":{this.set(w*C*M-T*L*F,T*L*M-w*C*F,T*C*F+w*L*M,T*C*M+w*L*F,p);break}}return this},setFromRotationMatrix:function(d){var p=d.val,g=p[0],y=p[4],x=p[8],T=p[1],C=p[5],M=p[9],w=p[2],L=p[6],F=p[10],O=g+C+F,N;return O>0?(N=.5/Math.sqrt(O+1),this.set((L-M)*N,(x-w)*N,(T-y)*N,.25/N)):g>C&&g>F?(N=2*Math.sqrt(1+g-C-F),this.set(.25*N,(y+T)/N,(x+w)/N,(L-M)/N)):C>F?(N=2*Math.sqrt(1+C-g-F),this.set((y+T)/N,.25*N,(M+L)/N,(x-w)/N)):(N=2*Math.sqrt(1+F-g-C),this.set((x+w)/N,(M+L)/N,.25*N,(T-y)/N)),this},fromMat3:function(d){var p=d.val,g=p[0]+p[4]+p[8],y;if(g>0)y=Math.sqrt(g+1),this.w=.5*y,y=.5/y,this._x=(p[7]-p[5])*y,this._y=(p[2]-p[6])*y,this._z=(p[3]-p[1])*y;else{var x=0;p[4]>p[0]&&(x=1),p[8]>p[x*3+x]&&(x=2);var T=e[x],C=e[T];y=Math.sqrt(p[x*3+x]-p[T*3+T]-p[C*3+C]+1),i[x]=.5*y,y=.5/y,i[T]=(p[T*3+x]+p[x*3+T])*y,i[C]=(p[C*3+x]+p[x*3+C])*y,this._x=i[0],this._y=i[1],this._z=i[2],this._w=(p[C*3+T]-p[T*3+C])*y}return this.onChangeCallback(this),this}});c.exports=u},43396:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=function(o){return o*a.RAD_TO_DEG};c.exports=v},74362:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=1);var v=Math.random()*2*Math.PI;return t.x=Math.cos(v)*a,t.y=Math.sin(v)*a,t};c.exports=m},60706:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=1);var v=Math.random()*2*Math.PI,o=Math.random()*2-1,r=Math.sqrt(1-o*o)*a;return t.x=Math.cos(v)*r,t.y=Math.sin(v)*r,t.z=o*a,t};c.exports=m},67421:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1),t.x=(Math.random()*2-1)*a,t.y=(Math.random()*2-1)*a,t.z=(Math.random()*2-1)*a,t.w=(Math.random()*2-1)*a,t};c.exports=m},36305:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.x,o=t.y;return t.x=v*Math.cos(a)-o*Math.sin(a),t.y=v*Math.sin(a)+o*Math.cos(a),t};c.exports=m},11520:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=Math.cos(o),n=Math.sin(o),e=t.x-a,i=t.y-v;return t.x=e*r-i*n+a,t.y=e*n+i*r+v,t};c.exports=m},1163:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){var n=o+Math.atan2(t.y-v,t.x-a);return t.x=a+r*Math.cos(n),t.y=v+r*Math.sin(n),t};c.exports=m},70336:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){return t.x=a+r*Math.cos(o),t.y=v+r*Math.sin(o),t};c.exports=m},72678:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(25836),v=t(37867),o=t(15746),r=new v,n=new o,e=new a,i=function(h,s,l){return n.setAxisAngle(s,l),r.fromRotationTranslation(n,e.set(0,0,0)),h.transformMat4(r)};c.exports=i},2284:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t>0?Math.ceil(t):Math.floor(t)};c.exports=m},41013:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){a===void 0&&(a=0),v===void 0&&(v=10);var o=Math.pow(v,-a);return Math.round(t*o)/o};c.exports=m},16922:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a===void 0&&(a=1),v===void 0&&(v=1),o===void 0&&(o=1),o*=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 m=function(t,a,v){return t<=a?0:t>=v?1:(t=(t-a)/(v-a),t*t*(3-2*t))};c.exports=m},54261:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t=Math.max(0,Math.min(1,(t-a)/(v-a))),t*t*t*(t*(t*6-15)+10)};c.exports=m},44408:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e){e===void 0&&(e=new a);var i=0,h=0,s=r*n;return o>0&&o<=s&&(o>r-1?(h=Math.floor(o/r),i=o-h*r):i=o),e.set(i,h)};c.exports=v},85955:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i,h,s,l){l===void 0&&(l=new a);var f=Math.sin(i),u=Math.cos(i),d=u*h,p=f*h,g=-f*s,y=u*s,x=1/(d*y+g*-p);return l.x=y*x*o+-g*x*r+(e*g-n*y)*x,l.y=d*x*r+-p*x*o+(-e*d+n*p)*x,l};c.exports=v},26099:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(43855),o=new a({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 o(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 v(this.x,r.x,n)&&v(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,i=this.y;return this.x=e+n*(r.x-e),this.y=i+n*(r.y-i),this},transformMat3:function(r){var n=this.x,e=this.y,i=r.val;return this.x=i[0]*n+i[3]*e+i[6],this.y=i[1]*n+i[4]*e+i[7],this},transformMat4:function(r){var n=this.x,e=this.y,i=r.val;return this.x=i[0]*n+i[4]*e+i[12],this.y=i[1]*n+i[5]*e+i[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)}});o.ZERO=new o,o.RIGHT=new o(1,0),o.LEFT=new o(-1,0),o.UP=new o(0,-1),o.DOWN=new o(0,1),o.ONE=new o(1,1),c.exports=o},25836:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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(o){return this.x=Math.min(this.x,o.x),this.y=Math.min(this.y,o.y),this.z=Math.min(this.z,o.z),this},max:function(o){return this.x=Math.max(this.x,o.x),this.y=Math.max(this.y,o.y),this.z=Math.max(this.z,o.z),this},clone:function(){return new v(this.x,this.y,this.z)},addVectors:function(o,r){return this.x=o.x+r.x,this.y=o.y+r.y,this.z=o.z+r.z,this},crossVectors:function(o,r){var n=o.x,e=o.y,i=o.z,h=r.x,s=r.y,l=r.z;return this.x=e*l-i*s,this.y=i*h-n*l,this.z=n*s-e*h,this},equals:function(o){return this.x===o.x&&this.y===o.y&&this.z===o.z},copy:function(o){return this.x=o.x,this.y=o.y,this.z=o.z||0,this},set:function(o,r,n){return typeof o=="object"?(this.x=o.x||0,this.y=o.y||0,this.z=o.z||0):(this.x=o||0,this.y=r||0,this.z=n||0),this},setFromMatrixPosition:function(o){return this.fromArray(o.val,12)},setFromMatrixColumn:function(o,r){return this.fromArray(o.val,r*4)},fromArray:function(o,r){return r===void 0&&(r=0),this.x=o[r],this.y=o[r+1],this.z=o[r+2],this},add:function(o){return this.x+=o.x,this.y+=o.y,this.z+=o.z||0,this},addScalar:function(o){return this.x+=o,this.y+=o,this.z+=o,this},addScale:function(o,r){return this.x+=o.x*r,this.y+=o.y*r,this.z+=o.z*r||0,this},subtract:function(o){return this.x-=o.x,this.y-=o.y,this.z-=o.z||0,this},multiply:function(o){return this.x*=o.x,this.y*=o.y,this.z*=o.z||1,this},scale:function(o){return isFinite(o)?(this.x*=o,this.y*=o,this.z*=o):(this.x=0,this.y=0,this.z=0),this},divide:function(o){return this.x/=o.x,this.y/=o.y,this.z/=o.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(o){var r=o.x-this.x,n=o.y-this.y,e=o.z-this.z||0;return Math.sqrt(r*r+n*n+e*e)},distanceSq:function(o){var r=o.x-this.x,n=o.y-this.y,e=o.z-this.z||0;return r*r+n*n+e*e},length:function(){var o=this.x,r=this.y,n=this.z;return Math.sqrt(o*o+r*r+n*n)},lengthSq:function(){var o=this.x,r=this.y,n=this.z;return o*o+r*r+n*n},normalize:function(){var o=this.x,r=this.y,n=this.z,e=o*o+r*r+n*n;return e>0&&(e=1/Math.sqrt(e),this.x=o*e,this.y=r*e,this.z=n*e),this},dot:function(o){return this.x*o.x+this.y*o.y+this.z*o.z},cross:function(o){var r=this.x,n=this.y,e=this.z,i=o.x,h=o.y,s=o.z;return this.x=n*s-e*h,this.y=e*i-r*s,this.z=r*h-n*i,this},lerp:function(o,r){r===void 0&&(r=0);var n=this.x,e=this.y,i=this.z;return this.x=n+r*(o.x-n),this.y=e+r*(o.y-e),this.z=i+r*(o.z-i),this},applyMatrix3:function(o){var r=this.x,n=this.y,e=this.z,i=o.val;return this.x=i[0]*r+i[3]*n+i[6]*e,this.y=i[1]*r+i[4]*n+i[7]*e,this.z=i[2]*r+i[5]*n+i[8]*e,this},applyMatrix4:function(o){var r=this.x,n=this.y,e=this.z,i=o.val,h=1/(i[3]*r+i[7]*n+i[11]*e+i[15]);return this.x=(i[0]*r+i[4]*n+i[8]*e+i[12])*h,this.y=(i[1]*r+i[5]*n+i[9]*e+i[13])*h,this.z=(i[2]*r+i[6]*n+i[10]*e+i[14])*h,this},transformMat3:function(o){var r=this.x,n=this.y,e=this.z,i=o.val;return this.x=r*i[0]+n*i[3]+e*i[6],this.y=r*i[1]+n*i[4]+e*i[7],this.z=r*i[2]+n*i[5]+e*i[8],this},transformMat4:function(o){var r=this.x,n=this.y,e=this.z,i=o.val;return this.x=i[0]*r+i[4]*n+i[8]*e+i[12],this.y=i[1]*r+i[5]*n+i[9]*e+i[13],this.z=i[2]*r+i[6]*n+i[10]*e+i[14],this},transformCoordinates:function(o){var r=this.x,n=this.y,e=this.z,i=o.val,h=r*i[0]+n*i[4]+e*i[8]+i[12],s=r*i[1]+n*i[5]+e*i[9]+i[13],l=r*i[2]+n*i[6]+e*i[10]+i[14],f=r*i[3]+n*i[7]+e*i[11]+i[15];return this.x=h/f,this.y=s/f,this.z=l/f,this},transformQuat:function(o){var r=this.x,n=this.y,e=this.z,i=o.x,h=o.y,s=o.z,l=o.w,f=l*r+h*e-s*n,u=l*n+s*r-i*e,d=l*e+i*n-h*r,p=-i*r-h*n-s*e;return this.x=f*l+p*-i+u*-s-d*-h,this.y=u*l+p*-h+d*-i-f*-s,this.z=d*l+p*-s+f*-h-u*-i,this},project:function(o){var r=this.x,n=this.y,e=this.z,i=o.val,h=i[0],s=i[1],l=i[2],f=i[3],u=i[4],d=i[5],p=i[6],g=i[7],y=i[8],x=i[9],T=i[10],C=i[11],M=i[12],w=i[13],L=i[14],F=i[15],O=1/(r*f+n*g+e*C+F);return this.x=(r*h+n*u+e*y+M)*O,this.y=(r*s+n*d+e*x+w)*O,this.z=(r*l+n*p+e*T+L)*O,this},projectViewMatrix:function(o,r){return this.applyMatrix4(o).applyMatrix4(r)},unprojectViewMatrix:function(o,r){return this.applyMatrix4(o).applyMatrix4(r)},unproject:function(o,r){var n=o.x,e=o.y,i=o.z,h=o.w,s=this.x-n,l=h-this.y-1-e,f=this.z;return this.x=2*s/i-1,this.y=2*l/h-1,this.z=2*f-1,this.project(r)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});v.ZERO=new v,v.RIGHT=new v(1,0,0),v.LEFT=new v(-1,0,0),v.UP=new v(0,-1,0),v.DOWN=new v(0,1,0),v.FORWARD=new v(0,0,1),v.BACK=new v(0,0,-1),v.ONE=new v(1,1,1),c.exports=v},61369:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i){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=i||0)},clone:function(){return new v(this.x,this.y,this.z,this.w)},copy:function(o){return this.x=o.x,this.y=o.y,this.z=o.z||0,this.w=o.w||0,this},equals:function(o){return this.x===o.x&&this.y===o.y&&this.z===o.z&&this.w===o.w},set:function(o,r,n,e){return typeof o=="object"?(this.x=o.x||0,this.y=o.y||0,this.z=o.z||0,this.w=o.w||0):(this.x=o||0,this.y=r||0,this.z=n||0,this.w=e||0),this},add:function(o){return this.x+=o.x,this.y+=o.y,this.z+=o.z||0,this.w+=o.w||0,this},subtract:function(o){return this.x-=o.x,this.y-=o.y,this.z-=o.z||0,this.w-=o.w||0,this},scale:function(o){return this.x*=o,this.y*=o,this.z*=o,this.w*=o,this},length:function(){var o=this.x,r=this.y,n=this.z,e=this.w;return Math.sqrt(o*o+r*r+n*n+e*e)},lengthSq:function(){var o=this.x,r=this.y,n=this.z,e=this.w;return o*o+r*r+n*n+e*e},normalize:function(){var o=this.x,r=this.y,n=this.z,e=this.w,i=o*o+r*r+n*n+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=o*i,this.y=r*i,this.z=n*i,this.w=e*i),this},dot:function(o){return this.x*o.x+this.y*o.y+this.z*o.z+this.w*o.w},lerp:function(o,r){r===void 0&&(r=0);var n=this.x,e=this.y,i=this.z,h=this.w;return this.x=n+r*(o.x-n),this.y=e+r*(o.y-e),this.z=i+r*(o.z-i),this.w=h+r*(o.w-h),this},multiply:function(o){return this.x*=o.x,this.y*=o.y,this.z*=o.z||1,this.w*=o.w||1,this},divide:function(o){return this.x/=o.x,this.y/=o.y,this.z/=o.z||1,this.w/=o.w||1,this},distance:function(o){var r=o.x-this.x,n=o.y-this.y,e=o.z-this.z||0,i=o.w-this.w||0;return Math.sqrt(r*r+n*n+e*e+i*i)},distanceSq:function(o){var r=o.x-this.x,n=o.y-this.y,e=o.z-this.z||0,i=o.w-this.w||0;return r*r+n*n+e*e+i*i},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(o){var r=this.x,n=this.y,e=this.z,i=this.w,h=o.val;return this.x=h[0]*r+h[4]*n+h[8]*e+h[12]*i,this.y=h[1]*r+h[5]*n+h[9]*e+h[13]*i,this.z=h[2]*r+h[6]*n+h[10]*e+h[14]*i,this.w=h[3]*r+h[7]*n+h[11]*e+h[15]*i,this},transformQuat:function(o){var r=this.x,n=this.y,e=this.z,i=o.x,h=o.y,s=o.z,l=o.w,f=l*r+h*e-s*n,u=l*n+s*r-i*e,d=l*e+i*n-h*r,p=-i*r-h*n-s*e;return this.x=f*l+p*-i+u*-s-d*-h,this.y=u*l+p*-h+d*-i-f*-s,this.z=d*l+p*-s+f*-h-u*-i,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});v.prototype.sub=v.prototype.subtract,v.prototype.mul=v.prototype.multiply,v.prototype.div=v.prototype.divide,v.prototype.dist=v.prototype.distance,v.prototype.distSq=v.prototype.distanceSq,v.prototype.len=v.prototype.length,v.prototype.lenSq=v.prototype.lengthSq,c.exports=v},60417:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return Math.abs(t-a)<=v};c.exports=m},15994:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=v-a;return a+((t-a)%o+o)%o};c.exports=m},31040:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return Math.atan2(o-a,v-t)};c.exports=m},55495:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return Math.atan2(a.y-t.y,a.x-t.x)};c.exports=m},128:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return Math.atan2(a.x-t.x,a.y-t.y)};c.exports=m},41273:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return Math.atan2(v-t,o-a)};c.exports=m},1432:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=function(o){return o>Math.PI&&(o-=a.PI2),Math.abs(((o+a.TAU)%a.PI2-a.PI2)%a.PI2)};c.exports=v},12407:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t=t%(2*Math.PI),t>=0?t:t+2*Math.PI};c.exports=m},53993:(c,m,t)=>{/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(99472),v=function(){return a(-Math.PI,Math.PI)};c.exports=v},86564:(c,m,t)=>{/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(99472),v=function(){return a(-180,180)};c.exports=v},90154:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(12407),v=function(o){return a(o+Math.PI)};c.exports=v},48736:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=function(o,r,n){return n===void 0&&(n=.05),o===r||(Math.abs(r-o)<=n||Math.abs(r-o)>=a.PI2-n?o=r:(Math.abs(r-o)>Math.PI&&(ro?o+=n:r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=a-t;if(v===0)return 0;var o=Math.floor((v- -180)/360);return v-o*360};c.exports=m},86554:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(15994),v=function(o){return a(o,-Math.PI,Math.PI)};c.exports=v},30954:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(15994),v=function(o){return a(o,-180,180)};c.exports=v},25588:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},20339:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=t-v,n=a-o;return Math.sqrt(r*r+n*n)};c.exports=m},52816:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.x-a.x,o=t.y-a.y;return Math.sqrt(v*v+o*o)};c.exports=m},64559:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.x-a.x,o=t.y-a.y;return v*v+o*o};c.exports=m},82340:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return Math.max(Math.abs(t-v),Math.abs(a-o))};c.exports=m},14390:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){return r===void 0&&(r=2),Math.sqrt(Math.pow(v-t,r)+Math.pow(o-a,r))};c.exports=m},2243:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return Math.abs(t-v)+Math.abs(a-o)};c.exports=m},89774:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=t-v,n=a-o;return r*r+n*n};c.exports=m},50994:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Between:t(20339),BetweenPoints:t(52816),BetweenPointsSquared:t(64559),Chebyshev:t(82340),Power:t(14390),Snake:t(2243),Squared:t(89774)}},62640:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54178),v=t(41521),o=t(79980),r=t(85433),n=t(99140),e=t(48857),i=t(81596),h=t(59133),s=t(98516),l=t(35248),f=t(82500),u=t(49752);c.exports={Power0:i,Power1:h.Out,Power2:r.Out,Power3:s.Out,Power4:l.Out,Linear:i,Quad:h.Out,Cubic:r.Out,Quart:s.Out,Quint:l.Out,Sine:f.Out,Expo:e.Out,Circ:o.Out,Elastic:n.Out,Back:a.Out,Bounce:v.Out,Stepped:u,"Quad.easeIn":h.In,"Cubic.easeIn":r.In,"Quart.easeIn":s.In,"Quint.easeIn":l.In,"Sine.easeIn":f.In,"Expo.easeIn":e.In,"Circ.easeIn":o.In,"Elastic.easeIn":n.In,"Back.easeIn":a.In,"Bounce.easeIn":v.In,"Quad.easeOut":h.Out,"Cubic.easeOut":r.Out,"Quart.easeOut":s.Out,"Quint.easeOut":l.Out,"Sine.easeOut":f.Out,"Expo.easeOut":e.Out,"Circ.easeOut":o.Out,"Elastic.easeOut":n.Out,"Back.easeOut":a.Out,"Bounce.easeOut":v.Out,"Quad.easeInOut":h.InOut,"Cubic.easeInOut":r.InOut,"Quart.easeInOut":s.InOut,"Quint.easeInOut":l.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":e.InOut,"Circ.easeInOut":o.InOut,"Elastic.easeInOut":n.InOut,"Back.easeInOut":a.InOut,"Bounce.easeInOut":v.InOut}},1639:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1.70158),t*t*((a+1)*t-a)};c.exports=m},50099:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=1.70158);var v=a*1.525;return(t*=2)<1?.5*(t*t*((v+1)*t-v)):.5*((t-=2)*t*((v+1)*t+v)+2)};c.exports=m},41286:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1.70158),--t*t*((a+1)*t+a)+1};c.exports=m},54178:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(1639),Out:t(41286),InOut:t(50099)}},59590:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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)};c.exports=m},41788:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=!1;return t<.5?(t=1-t*2,a=!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,a?(1-t)*.5:t*.5+.5};c.exports=m},69905:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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};c.exports=m},41521:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(59590),Out:t(69905),InOut:t(41788)}},91861:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return 1-Math.sqrt(1-t*t)};c.exports=m},4177:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};c.exports=m},57512:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.sqrt(1- --t*t)};c.exports=m},79980:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(91861),Out:t(57512),InOut:t(4177)}},51150:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t*t*t};c.exports=m},82820:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};c.exports=m},35033:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return--t*t*t+1};c.exports=m},85433:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(51150),Out:t(35033),InOut:t(82820)}},69965:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===void 0&&(a=.1),v===void 0&&(v=.1),t===0)return 0;if(t===1)return 1;var o=v/4;return a<1?a=1:o=v*Math.asin(1/a)/(2*Math.PI),-(a*Math.pow(2,10*(t-=1))*Math.sin((t-o)*(2*Math.PI)/v))};c.exports=m},50665:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===void 0&&(a=.1),v===void 0&&(v=.1),t===0)return 0;if(t===1)return 1;var o=v/4;return a<1?a=1:o=v*Math.asin(1/a)/(2*Math.PI),(t*=2)<1?-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t-o)*(2*Math.PI)/v)):a*Math.pow(2,-10*(t-=1))*Math.sin((t-o)*(2*Math.PI)/v)*.5+1};c.exports=m},7744:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===void 0&&(a=.1),v===void 0&&(v=.1),t===0)return 0;if(t===1)return 1;var o=v/4;return a<1?a=1:o=v*Math.asin(1/a)/(2*Math.PI),a*Math.pow(2,-10*t)*Math.sin((t-o)*(2*Math.PI)/v)+1};c.exports=m},99140:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(69965),Out:t(7744),InOut:t(50665)}},24590:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return Math.pow(2,10*(t-1))-.001};c.exports=m},87844:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))};c.exports=m},89433:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return 1-Math.pow(2,-10*t)};c.exports=m},48857:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(24590),Out:t(89433),InOut:t(87844)}},48820:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t};c.exports=m},81596:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports=t(7147)},34826:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t*t};c.exports=m},20544:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)};c.exports=m},92029:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t*(2-t)};c.exports=m},59133:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(34826),Out:t(92029),InOut:t(20544)}},64413:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t*t*t*t};c.exports=m},78137:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)};c.exports=m},45840:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return 1- --t*t*t*t};c.exports=m},98516:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(64413),Out:t(45840),InOut:t(78137)}},87745:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t*t*t*t*t};c.exports=m},16509:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)};c.exports=m},17868:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return--t*t*t*t*t+1};c.exports=m},35248:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(87745),Out:t(17868),InOut:t(16509)}},80461:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t===0?0:t===1?1:1-Math.cos(t*Math.PI/2)};c.exports=m},34025:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t===0?0:t===1?1:.5*(1-Math.cos(Math.PI*t))};c.exports=m},52768:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t===0?0:t===1?1:Math.sin(t*Math.PI/2)};c.exports=m},82500:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={In:t(80461),Out:t(52768),InOut:t(34025)}},72251:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1),t<=0?0:t>=1?1:((a*t|0)+1)*(1/a)};c.exports=m},49752:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports=t(72251)},75698:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1e-4),Math.ceil(t-a)};c.exports=m},43855:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v===void 0&&(v=1e-4),Math.abs(t-a){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a=1e-4),Math.floor(t+a)};c.exports=m},5470:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v===void 0&&(v=1e-4),t>a-v};c.exports=m},94977:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return v===void 0&&(v=1e-4),t{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Ceil:t(75698),Equal:t(43855),Floor:t(25777),GreaterThan:t(5470),LessThan:t(94977)}},75508:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36383),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},89318:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(85710),v=function(o,r){for(var n=0,e=o.length-1,i=0;i<=e;i++)n+=Math.pow(1-r,e-i)*Math.pow(r,i)*o[i]*a(e,i);return n};c.exports=v},77259:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87842),v=function(o,r){var n=o.length-1,e=n*r,i=Math.floor(e);return o[0]===o[n]?(r<0&&(i=Math.floor(e=n*(1+r))),a(e-i,o[(i-1+n)%n],o[i],o[(i+1)%n],o[(i+2)%n])):r<0?o[0]-(a(-e,o[0],o[0],o[1],o[1])-o[0]):r>1?o[n]-(a(e-n,o[n],o[n],o[n-1],o[n-1])-o[n]):a(e-i,o[i?i-1:0],o[i],o[n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(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 a(r,n){return 3*(1-r)*r*r*n}function v(r,n){return r*r*r*n}var o=function(r,n,e,i,h){return m(r,n)+t(r,e)+a(r,i)+v(r,h)};c.exports=o},28392:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(28915),v=function(o,r){var n=o.length-1,e=n*r,i=Math.floor(e);return r<0?a(o[0],o[1],e):r>1?a(o[n],o[n-1],n-e):a(o[i],o[i+1>n?n:i+1],e-i)};c.exports=v},32112:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(o,r){var n=1-o;return n*n*r}function t(o,r){return 2*(1-o)*o*r}function a(o,r){return o*o*r}var v=function(o,r,n,e){return m(o,r)+t(o,n)+a(o,e)};c.exports=v},47235:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7602),v=function(o,r,n){return r+(n-r)*a(o,0,1)};c.exports=v},50178:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(54261),v=function(o,r,n){return r+(n-r)*a(o,0,1)};c.exports=v},38289:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Bezier:t(89318),CatmullRom:t(77259),CubicBezier:t(36316),Linear:t(28392),QuadraticBezier:t(32112),SmoothStep:t(47235),SmootherStep:t(50178)}},98439:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=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 m=function(t,a){return t>0&&(t&t-1)===0&&a>0&&(a&a-1)===0};c.exports=m},81230:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t>0&&(t&t-1)===0};c.exports=m},49001:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={GetNext:t(98439),IsSize:t(50030),IsValue:t(81230)}},28453:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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 o=2091639*this.s0+this.c*23283064365386963e-26;return this.c=o|0,this.s0=this.s1,this.s1=this.s2,this.s2=o-this.c,this.s2},hash:function(o){var r,n=this.n;o=o.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(o){typeof o=="string"?this.state(o):this.sow(o)},sow:function(o){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,!!o)for(var r=0;r0;n--){var e=Math.floor(this.frac()*(n+1)),i=o[e];o[e]=o[n],o[n]=i}return o}});c.exports=v},63448:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return v===void 0&&(v=0),a===0?t:(t-=v,t=a*Math.ceil(t/a),o?(v+t)/a:v+t)};c.exports=m},56583:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return v===void 0&&(v=0),a===0?t:(t-=v,t=a*Math.floor(t/a),o?(v+t)/a:v+t)};c.exports=m},77720:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){return v===void 0&&(v=0),a===0?t:(t-=v,t=a*Math.round(t/a),o?(v+t)/a:v+t)};c.exports=m},73697:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Ceil:t(63448),Floor:t(56583),To:t(77720)}},85454:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */t(63595);var a=t(8054),v=t(79291),o={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)};o.Sound=t(23717),o=v(!1,o,a),c.exports=o,t.g.Phaser=o},71289:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(92209),o=t(88571),r=new a({Extends:o,Mixins:[v.Acceleration,v.Angular,v.Bounce,v.Collision,v.Debug,v.Drag,v.Enable,v.Friction,v.Gravity,v.Immovable,v.Mass,v.Pushable,v.Size,v.Velocity],initialize:function(e,i,h,s,l){o.call(this,e,i,h,s,l),this.body=null}});c.exports=r},86689:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(39506),o=t(20339),r=t(89774),n=t(66022),e=t(95540),i=t(46975),h=t(72441),s=t(47956),l=t(37277),f=t(44594),u=t(26099),d=t(82248),p=new a({initialize:function(y){this.scene=y,this.systems=y.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,y.sys.events.once(f.BOOT,this.boot,this),y.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new d(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 d(this.scene,this.config),this.add=new n(this.world));var g=this.systems.events;e(this.config,"customUpdate",!1)||g.on(f.UPDATE,this.world.update,this.world),g.on(f.POST_UPDATE,this.world.postUpdate,this.world),g.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 g=this.systems.game.config.physics,y=this.systems.settings.physics,x=i(e(y,"arcade",{}),e(g,"arcade",{}));return x},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(g,y,x,T,C){return x===void 0&&(x=null),T===void 0&&(T=null),C===void 0&&(C=x),this.world.collideObjects(g,y,x,T,C,!0)},collide:function(g,y,x,T,C){return x===void 0&&(x=null),T===void 0&&(T=null),C===void 0&&(C=x),this.world.collideObjects(g,y,x,T,C,!1)},collideTiles:function(g,y,x,T,C){return this.world.collideTiles(g,y,x,T,C)},overlapTiles:function(g,y,x,T,C){return this.world.overlapTiles(g,y,x,T,C)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(g,y,x,T,C,M){T===void 0&&(T=60);var w=Math.atan2(x-g.y,y-g.x);return g.body.acceleration.setToPolar(w,T),C!==void 0&&M!==void 0&&g.body.maxVelocity.set(C,M),w},accelerateToObject:function(g,y,x,T,C){return this.accelerateTo(g,y.x,y.y,x,T,C)},closest:function(g,y){y||(y=this.world.bodies.entries);for(var x=Number.MAX_VALUE,T=null,C=g.x,M=g.y,w=y.length,L=0;Lx&&(T=F,x=N)}}return T},moveTo:function(g,y,x,T,C){T===void 0&&(T=60),C===void 0&&(C=0);var M=Math.atan2(x-g.y,y-g.x);return C>0&&(T=o(g.x,g.y,y,x)/(C/1e3)),g.body.velocity.setToPolar(M,T),M},moveToObject:function(g,y,x,T){return this.moveTo(g,y.x,y.y,x,T)},velocityFromAngle:function(g,y,x){return y===void 0&&(y=60),x===void 0&&(x=new u),x.setToPolar(v(g),y)},velocityFromRotation:function(g,y,x){return y===void 0&&(y=60),x===void 0&&(x=new u),x.setToPolar(g,y)},overlapRect:function(g,y,x,T,C,M){return s(this.world,g,y,x,T,C,M)},overlapCirc:function(g,y,x,T,C){return h(this.world,g,y,x,T,C)},shutdown:function(){if(this.world){var g=this.systems.events;g.off(f.UPDATE,this.world.update,this.world),g.off(f.POST_UPDATE,this.world.postUpdate,this.world),g.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}});l.register("ArcadePhysics",p,"arcadePhysics"),c.exports=p},13759:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(92209),o=t(68287),r=new a({Extends:o,Mixins:[v.Acceleration,v.Angular,v.Bounce,v.Collision,v.Debug,v.Drag,v.Enable,v.Friction,v.Gravity,v.Immovable,v.Mass,v.Pushable,v.Size,v.Velocity],initialize:function(e,i,h,s,l){o.call(this,e,i,h,s,l),this.body=null}});c.exports=r},37742:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(78389),o=t(37747),r=t(63012),n=t(43396),e=t(87841),i=t(37303),h=t(95829),s=t(26099),l=new a({Mixins:[v],initialize:function(u,d){var p=64,g=64,y={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},x=d!==void 0;x&&d.displayWidth&&(p=d.displayWidth,g=d.displayHeight),x||(d=y),this.world=u,this.gameObject=x?d:void 0,this.isBody=!0,this.transform={x:d.x,y:d.y,rotation:d.angle,scaleX:d.scaleX,scaleY:d.scaleY,displayOriginX:d.displayOriginX,displayOriginY:d.displayOriginY},this.debugShowBody=u.defaults.debugShowBody,this.debugShowVelocity=u.defaults.debugShowVelocity,this.debugBodyColor=u.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new s,this.position=new s(d.x-d.scaleX*d.displayOriginX,d.y-d.scaleY*d.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=d.angle,this.preRotation=d.angle,this.width=p,this.height=g,this.sourceWidth=p,this.sourceHeight=g,d.frame&&(this.sourceWidth=d.frame.realWidth,this.sourceHeight=d.frame.realHeight),this.halfWidth=Math.abs(p/2),this.halfHeight=Math.abs(g/2),this.center=new s(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new s,this.newVelocity=new s,this.deltaMax=new s,this.acceleration=new s,this.allowDrag=!0,this.drag=new s,this.allowGravity=!0,this.gravity=new s,this.bounce=new s,this.worldBounce=null,this.customBoundsRectangle=u.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new s(1e4,1e4),this.maxSpeed=-1,this.friction=new s(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=o.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new s(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=o.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=d.scaleX,this._sy=d.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,u=this.transform;if(f.parentContainer){var d=f.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);u.x=d.tx,u.y=d.ty,u.rotation=n(d.rotation),u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY}else u.x=f.x,u.y=f.y,u.rotation=f.angle,u.scaleX=f.scaleX,u.scaleY=f.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY;var p=!1;if(this.syncBounds){var g=f.getBounds(this._bounds);this.width=g.width,this.height=g.height,p=!0}else{var y=Math.abs(u.scaleX),x=Math.abs(u.scaleY);(this._sx!==y||this._sy!==x)&&(this.width=this.sourceWidth*y,this.height=this.sourceHeight*x,this._sx=y,this._sy=x,p=!0)}p&&(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 u=this.wasTouching,d=this.touching,p=this.blocked;f?h(!0,u):(u.none=d.none,u.up=d.up,u.down=d.down,u.left=d.left,u.right=d.right),h(!0,d),h(!0,p),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(f,u){if(f&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var d=this.position;this.prev.x=d.x,this.prev.y=d.y,this.prevFrame.x=d.x,this.prevFrame.y=d.y}f&&this.update(u)},update:function(f){var u=this.prev,d=this.position,p=this.velocity;if(u.set(d.x,d.y),!this.moves){this._dx=d.x-u.x,this._dy=d.y-u.y;return}if(this.directControl){var g=this.autoFrame;p.set((d.x-g.x)/f,(d.y-g.y)/f),this.world.updateMotion(this,f),this._dx=d.x-g.x,this._dy=d.y-g.y}else this.world.updateMotion(this,f),this.newVelocity.set(p.x*f,p.y*f),d.add(this.newVelocity),this._dx=d.x-u.x,this._dy=d.y-u.y;var y=p.x,x=p.y;if(this.updateCenter(),this.angle=Math.atan2(x,y),this.speed=Math.sqrt(y*y+x*x),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var T=this.blocked;this.world.emit(r.WORLD_BOUNDS,this,T.up,T.down,T.left,T.right)}},postUpdate:function(){var f=this.position,u=f.x-this.prevFrame.x,d=f.y-this.prevFrame.y,p=this.gameObject;if(this.moves){var g=this.deltaMax.x,y=this.deltaMax.y;g!==0&&u!==0&&(u<0&&u<-g?u=-g:u>0&&u>g&&(u=g)),y!==0&&d!==0&&(d<0&&d<-y?d=-y:d>0&&d>y&&(d=y)),p&&(p.x+=u,p.y+=d)}u<0?this.facing=o.FACING_LEFT:u>0&&(this.facing=o.FACING_RIGHT),d<0?this.facing=o.FACING_UP:d>0&&(this.facing=o.FACING_DOWN),this.allowRotation&&p&&(p.angle+=this.deltaZ()),this._tx=u,this._ty=d,this.autoFrame.set(f.x,f.y)},setBoundsRectangle:function(f){return this.customBoundsRectangle=f||this.world.bounds,this},checkWorldBounds:function(){var f=this.position,u=this.velocity,d=this.blocked,p=this.customBoundsRectangle,g=this.world.checkCollision,y=this.worldBounce?-this.worldBounce.x:-this.bounce.x,x=this.worldBounce?-this.worldBounce.y:-this.bounce.y,T=!1;return f.xp.right&&g.right&&(f.x=p.right-this.width,u.x*=y,d.right=!0,T=!0),f.yp.bottom&&g.down&&(f.y=p.bottom-this.height,u.y*=x,d.down=!0,T=!0),T&&(this.blocked.none=!1,this.updateCenter()),T},setOffset:function(f,u){return u===void 0&&(u=f),this.offset.set(f,u),this},setGameObject:function(f,u){return u===void 0&&(u=!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=u,this},setSize:function(f,u,d){d===void 0&&(d=!0);var p=this.gameObject;if(p&&(!f&&p.frame&&(f=p.frame.realWidth),!u&&p.frame&&(u=p.frame.realHeight)),this.sourceWidth=f,this.sourceHeight=u,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(),d&&p&&p.getCenter){var g=(p.width-f)/2,y=(p.height-u)/2;this.offset.set(g,y)}return this.isCircle=!1,this.radius=0,this},setCircle:function(f,u,d){return u===void 0&&(u=this.offset.x),d===void 0&&(d=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(u,d),this.updateCenter()):this.isCircle=!1,this},reset:function(f,u){this.stop();var d=this.gameObject;d&&(d.setPosition(f,u),this.rotation=d.angle,this.preRotation=d.angle);var p=this.position;d&&d.getTopLeft?d.getTopLeft(p):p.set(f,u),this.prev.copy(p),this.prevFrame.copy(p),this.autoFrame.copy(p),d&&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,u){if(!this.isCircle)return i(this,f,u);if(this.radius>0&&f>=this.left&&f<=this.right&&u>=this.top&&u<=this.bottom){var d=(this.center.x-f)*(this.center.x-f),p=(this.center.y-u)*(this.center.y-u);return d+p<=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 u=this.position,d=u.x+this.halfWidth,p=u.y+this.halfHeight;this.debugShowBody&&(f.lineStyle(f.defaultStrokeWidth,this.debugBodyColor),this.isCircle?f.strokeCircle(d,p,this.width/2):(this.checkCollision.up&&f.lineBetween(u.x,u.y,u.x+this.width,u.y),this.checkCollision.right&&f.lineBetween(u.x+this.width,u.y,u.x+this.width,u.y+this.height),this.checkCollision.down&&f.lineBetween(u.x,u.y+this.height,u.x+this.width,u.y+this.height),this.checkCollision.left&&f.lineBetween(u.x,u.y,u.x,u.y+this.height))),this.debugShowVelocity&&(f.lineStyle(f.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),f.lineBetween(d,p,d+this.velocity.x/2,p+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,u,d,p){f===void 0&&(f=!0),this.collideWorldBounds=f;var g=u!==void 0,y=d!==void 0;return(g||y)&&(this.worldBounce||(this.worldBounce=new s),g&&(this.worldBounce.x=u),y&&(this.worldBounce.y=d)),p!==void 0&&(this.onWorldBounds=p),this},setVelocity:function(f,u){return this.velocity.set(f,u),f=this.velocity.x,u=this.velocity.y,this.speed=Math.sqrt(f*f+u*u),this},setVelocityX:function(f){return this.setVelocity(f,this.velocity.y)},setVelocityY:function(f){return this.setVelocity(this.velocity.x,f)},setMaxVelocity:function(f,u){return this.maxVelocity.set(f,u),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,u){return this.slideFactor.set(f,u),this},setBounce:function(f,u){return this.bounce.set(f,u),this},setBounceX:function(f){return this.bounce.x=f,this},setBounceY:function(f){return this.bounce.y=f,this},setAcceleration:function(f,u){return this.acceleration.set(f,u),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,u){return this.drag.set(f,u),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,u){return this.gravity.set(f,u),this},setGravityX:function(f){return this.gravity.x=f,this},setGravityY:function(f){return this.gravity.y=f,this},setFriction:function(f,u){return this.friction.set(f,u),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,u,d,p){this.x+=f,this.updateCenter(),u!==null&&(this.velocity.x=u*this.slideFactor.x);var g=this.blocked;d&&(g.left=!0,g.none=!1),p&&(g.right=!0,g.none=!1)},processY:function(f,u,d,p){this.y+=f,this.updateCenter(),u!==null&&(this.velocity.y=u*this.slideFactor.y);var g=this.blocked;d&&(g.up=!0,g.none=!1),p&&(g.down=!0,g.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}}});c.exports=l},79342:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i,h,s,l){this.world=r,this.name="",this.active=!0,this.overlapOnly=n,this.object1=e,this.object2=i,this.collideCallback=h,this.processCallback=s,this.callbackContext=l},setName:function(o){return this.name=o,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}});c.exports=v},66022:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(71289),v=t(13759),o=t(37742),r=t(83419),n=t(37747),e=t(60758),i=t(72624),h=t(71464),s=new r({initialize:function(f){this.world=f,this.scene=f.scene,this.sys=f.scene.sys},collider:function(l,f,u,d,p){return this.world.addCollider(l,f,u,d,p)},overlap:function(l,f,u,d,p){return this.world.addOverlap(l,f,u,d,p)},existing:function(l,f){var u=f?n.STATIC_BODY:n.DYNAMIC_BODY;return this.world.enableBody(l,u),l},staticImage:function(l,f,u,d){var p=new a(this.scene,l,f,u,d);return this.sys.displayList.add(p),this.world.enableBody(p,n.STATIC_BODY),p},image:function(l,f,u,d){var p=new a(this.scene,l,f,u,d);return this.sys.displayList.add(p),this.world.enableBody(p,n.DYNAMIC_BODY),p},staticSprite:function(l,f,u,d){var p=new v(this.scene,l,f,u,d);return this.sys.displayList.add(p),this.sys.updateList.add(p),this.world.enableBody(p,n.STATIC_BODY),p},sprite:function(l,f,u,d){var p=new v(this.scene,l,f,u,d);return this.sys.displayList.add(p),this.sys.updateList.add(p),this.world.enableBody(p,n.DYNAMIC_BODY),p},staticGroup:function(l,f){return this.sys.updateList.add(new h(this.world,this.world.scene,l,f))},group:function(l,f){return this.sys.updateList.add(new e(this.world,this.world.scene,l,f))},body:function(l,f,u,d){var p=new o(this.world);return p.position.set(l,f),u&&d&&p.setSize(u,d),this.world.add(p,n.DYNAMIC_BODY),p},staticBody:function(l,f,u,d){var p=new i(this.world);return p.position.set(l,f),u&&d&&p.setSize(u,d),this.world.add(p,n.STATIC_BODY),p},destroy:function(){this.world=null,this.scene=null,this.sys=null}});c.exports=s},79599:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=0;if(!Array.isArray(t))a=t;else for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37747),v=function(o,r,n,e){var i=0,h=o.deltaAbsX()+r.deltaAbsX()+e;return o._dx===0&&r._dx===0?(o.embedded=!0,r.embedded=!0):o._dx>r._dx?(i=o.right-r.x,i>h&&!n||o.checkCollision.right===!1||r.checkCollision.left===!1?i=0:(o.touching.none=!1,o.touching.right=!0,r.touching.none=!1,r.touching.left=!0,r.physicsType===a.STATIC_BODY&&!n&&(o.blocked.none=!1,o.blocked.right=!0),o.physicsType===a.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.left=!0))):o._dxh&&!n||o.checkCollision.left===!1||r.checkCollision.right===!1?i=0:(o.touching.none=!1,o.touching.left=!0,r.touching.none=!1,r.touching.right=!0,r.physicsType===a.STATIC_BODY&&!n&&(o.blocked.none=!1,o.blocked.left=!0),o.physicsType===a.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.right=!0))),o.overlapX=i,r.overlapX=i,i};c.exports=v},45170:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37747),v=function(o,r,n,e){var i=0,h=o.deltaAbsY()+r.deltaAbsY()+e;return o._dy===0&&r._dy===0?(o.embedded=!0,r.embedded=!0):o._dy>r._dy?(i=o.bottom-r.y,i>h&&!n||o.checkCollision.down===!1||r.checkCollision.up===!1?i=0:(o.touching.none=!1,o.touching.down=!0,r.touching.none=!1,r.touching.up=!0,r.physicsType===a.STATIC_BODY&&!n&&(o.blocked.none=!1,o.blocked.down=!0),o.physicsType===a.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.up=!0))):o._dyh&&!n||o.checkCollision.up===!1||r.checkCollision.down===!1?i=0:(o.touching.none=!1,o.touching.up=!0,r.touching.none=!1,r.touching.down=!0,r.physicsType===a.STATIC_BODY&&!n&&(o.blocked.none=!1,o.blocked.up=!0),o.physicsType===a.STATIC_BODY&&!n&&(r.blocked.none=!1,r.blocked.down=!0))),o.overlapY=i,r.overlapY=i,i};c.exports=v},60758:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13759),v=t(83419),o=t(78389),r=t(37747),n=t(95540),e=t(26479),i=t(41212),h=new v({Extends:e,Mixins:[o],initialize:function(l,f,u,d){if(!u&&!d)d={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else if(i(u))d=u,u=null,d.internalCreateCallback=this.createCallbackHandler,d.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(u)&&i(u[0])){var p=this;u.forEach(function(g){g.internalCreateCallback=p.createCallbackHandler,g.internalRemoveCallback=p.removeCallbackHandler,g.classType=n(g,"classType",a)}),d=null}else d={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=l,d&&(d.classType=n(d,"classType",a)),this.physicsType=r.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:n(d,"collideWorldBounds",!1),setBoundsRectangle:n(d,"customBoundsRectangle",null),setAccelerationX:n(d,"accelerationX",0),setAccelerationY:n(d,"accelerationY",0),setAllowDrag:n(d,"allowDrag",!0),setAllowGravity:n(d,"allowGravity",!0),setAllowRotation:n(d,"allowRotation",!0),setDamping:n(d,"useDamping",!1),setBounceX:n(d,"bounceX",0),setBounceY:n(d,"bounceY",0),setDragX:n(d,"dragX",0),setDragY:n(d,"dragY",0),setEnable:n(d,"enable",!0),setGravityX:n(d,"gravityX",0),setGravityY:n(d,"gravityY",0),setFrictionX:n(d,"frictionX",0),setFrictionY:n(d,"frictionY",0),setMaxSpeed:n(d,"maxSpeed",-1),setMaxVelocityX:n(d,"maxVelocityX",1e4),setMaxVelocityY:n(d,"maxVelocityY",1e4),setVelocityX:n(d,"velocityX",0),setVelocityY:n(d,"velocityY",0),setAngularVelocity:n(d,"angularVelocity",0),setAngularAcceleration:n(d,"angularAcceleration",0),setAngularDrag:n(d,"angularDrag",0),setMass:n(d,"mass",1),setImmovable:n(d,"immovable",!1)},e.call(this,f,u,d),this.type="PhysicsGroup"},createCallbackHandler:function(s){s.body||this.world.enableBody(s,r.DYNAMIC_BODY);var l=s.body;for(var f in this.defaults)l[f](this.defaults[f])},removeCallbackHandler:function(s){s.body&&this.world.disableBody(s)},setVelocity:function(s,l,f){f===void 0&&(f=0);for(var u=this.getChildren(),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m,t,a,v,o,r,n,e,i,h,s,l,f,u,d,p,g,y=function(L,F,O){m=L,t=F;var N=m.velocity.x,G=t.velocity.x;return a=m.pushable,i=m._dx<0,h=m._dx>0,s=m._dx===0,d=Math.abs(m.right-t.x)<=Math.abs(t.right-m.x),n=G-N*m.bounce.x,v=t.pushable,l=t._dx<0,f=t._dx>0,u=t._dx===0,p=!d,e=N-G*t.bounce.x,g=Math.abs(O),x()},x=function(){return h&&d&&t.blocked.right?(m.processX(-g,n,!1,!0),1):i&&p&&t.blocked.left?(m.processX(g,n,!0),1):f&&p&&m.blocked.right?(t.processX(-g,e,!1,!0),2):l&&d&&m.blocked.left?(t.processX(g,e,!0),2):0},T=function(){var L=m.velocity.x,F=t.velocity.x,O=Math.sqrt(F*F*t.mass/m.mass)*(F>0?1:-1),N=Math.sqrt(L*L*m.mass/t.mass)*(L>0?1:-1),G=(O+N)*.5;return O-=G,N-=G,o=G+O*m.bounce.x,r=G+N*t.bounce.x,i&&p?C(0):l&&d?C(1):h&&d?C(2):f&&p?C(3):!1},C=function(L){if(a&&v)g*=.5,L===0||L===3?(m.processX(g,o),t.processX(-g,r)):(m.processX(-g,o),t.processX(g,r));else if(a&&!v)L===0||L===3?m.processX(g,n,!0):m.processX(-g,n,!1,!0);else if(!a&&v)L===0||L===3?t.processX(-g,e,!1,!0):t.processX(g,e,!0);else{var F=g*.5;L===0?u?(m.processX(g,0,!0),t.processX(0,null,!1,!0)):f?(m.processX(F,0,!0),t.processX(-F,0,!1,!0)):(m.processX(F,t.velocity.x,!0),t.processX(-F,null,!1,!0)):L===1?s?(m.processX(0,null,!1,!0),t.processX(g,0,!0)):h?(m.processX(-F,0,!1,!0),t.processX(F,0,!0)):(m.processX(-F,null,!1,!0),t.processX(F,m.velocity.x,!0)):L===2?u?(m.processX(-g,0,!1,!0),t.processX(0,null,!0)):l?(m.processX(-F,0,!1,!0),t.processX(F,0,!0)):(m.processX(-F,t.velocity.x,!1,!0),t.processX(F,null,!0)):L===3&&(s?(m.processX(0,null,!0),t.processX(-g,0,!1,!0)):i?(m.processX(F,0,!0),t.processX(-F,0,!1,!0)):(m.processX(F,t.velocity.y,!0),t.processX(-F,null,!1,!0)))}return!0},M=function(L){L===1?t.velocity.x=0:d?t.processX(g,e,!0):t.processX(-g,e,!1,!0),m.moves&&(t.y+=(m.y-m.prev.y)*m.friction.y,t._dy=t.y-t.prev.y)},w=function(L){L===2?m.velocity.x=0:p?m.processX(g,n,!0):m.processX(-g,n,!1,!0),t.moves&&(m.y+=(t.y-t.prev.y)*t.friction.y,m._dy=m.y-m.prev.y)};c.exports={BlockCheck:x,Check:T,Set:y,Run:C,RunImmovableBody1:M,RunImmovableBody2:w}},47962:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m,t,a,v,o,r,n,e,i,h,s,l,f,u,d,p,g,y=function(L,F,O){m=L,t=F;var N=m.velocity.y,G=t.velocity.y;return a=m.pushable,i=m._dy<0,h=m._dy>0,s=m._dy===0,d=Math.abs(m.bottom-t.y)<=Math.abs(t.bottom-m.y),n=G-N*m.bounce.y,v=t.pushable,l=t._dy<0,f=t._dy>0,u=t._dy===0,p=!d,e=N-G*t.bounce.y,g=Math.abs(O),x()},x=function(){return h&&d&&t.blocked.down?(m.processY(-g,n,!1,!0),1):i&&p&&t.blocked.up?(m.processY(g,n,!0),1):f&&p&&m.blocked.down?(t.processY(-g,e,!1,!0),2):l&&d&&m.blocked.up?(t.processY(g,e,!0),2):0},T=function(){var L=m.velocity.y,F=t.velocity.y,O=Math.sqrt(F*F*t.mass/m.mass)*(F>0?1:-1),N=Math.sqrt(L*L*m.mass/t.mass)*(L>0?1:-1),G=(O+N)*.5;return O-=G,N-=G,o=G+O*m.bounce.y,r=G+N*t.bounce.y,i&&p?C(0):l&&d?C(1):h&&d?C(2):f&&p?C(3):!1},C=function(L){if(a&&v)g*=.5,L===0||L===3?(m.processY(g,o),t.processY(-g,r)):(m.processY(-g,o),t.processY(g,r));else if(a&&!v)L===0||L===3?m.processY(g,n,!0):m.processY(-g,n,!1,!0);else if(!a&&v)L===0||L===3?t.processY(-g,e,!1,!0):t.processY(g,e,!0);else{var F=g*.5;L===0?u?(m.processY(g,0,!0),t.processY(0,null,!1,!0)):f?(m.processY(F,0,!0),t.processY(-F,0,!1,!0)):(m.processY(F,t.velocity.y,!0),t.processY(-F,null,!1,!0)):L===1?s?(m.processY(0,null,!1,!0),t.processY(g,0,!0)):h?(m.processY(-F,0,!1,!0),t.processY(F,0,!0)):(m.processY(-F,null,!1,!0),t.processY(F,m.velocity.y,!0)):L===2?u?(m.processY(-g,0,!1,!0),t.processY(0,null,!0)):l?(m.processY(-F,0,!1,!0),t.processY(F,0,!0)):(m.processY(-F,t.velocity.y,!1,!0),t.processY(F,null,!0)):L===3&&(s?(m.processY(0,null,!0),t.processY(-g,0,!1,!0)):i?(m.processY(F,0,!0),t.processY(-F,0,!1,!0)):(m.processY(F,t.velocity.y,!0),t.processY(-F,null,!1,!0)))}return!0},M=function(L){L===1?t.velocity.y=0:d?t.processY(g,e,!0):t.processY(-g,e,!1,!0),m.moves&&(t.x+=(m.x-m.prev.x)*m.friction.x,t._dx=t.x-t.prev.x)},w=function(L){L===2?m.velocity.y=0:p?m.processY(g,n,!0):m.processY(-g,n,!1,!0),t.moves&&(m.x+=(t.x-t.prev.x)*t.friction.x,m._dx=m.x-m.prev.x)};c.exports={BlockCheck:x,Check:T,Set:y,Run:C,RunImmovableBody1:M,RunImmovableBody2:w}},14087:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(64897),v=t(3017),o=function(r,n,e,i,h){h===void 0&&(h=a(r,n,e,i));var s=r.immovable,l=n.immovable;if(e||h===0||s&&l||r.customSeparateX||n.customSeparateX)return h!==0||r.embedded&&n.embedded;var f=v.Set(r,n,h);return!s&&!l?f>0?!0:v.Check():(s?v.RunImmovableBody1(f):l&&v.RunImmovableBody2(f),!0)};c.exports=o},89936:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45170),v=t(47962),o=function(r,n,e,i,h){h===void 0&&(h=a(r,n,e,i));var s=r.immovable,l=n.immovable;if(e||h===0||s&&l||r.customSeparateY||n.customSeparateY)return h!==0||r.embedded&&n.embedded;var f=v.Set(r,n,h);return!s&&!l?f>0?!0:v.Check():(s?v.RunImmovableBody1(f):l&&v.RunImmovableBody2(f),!0)};c.exports=o},95829:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===void 0&&(a={}),a.none=t,a.up=!1,a.down=!1,a.left=!1,a.right=!1,t||(a.up=!0,a.down=!0,a.left=!0,a.right=!0),a};c.exports=m},72624:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87902),v=t(83419),o=t(78389),r=t(37747),n=t(37303),e=t(95829),i=t(26099),h=new v({Mixins:[o],initialize:function(l,f){var u=64,d=64,p={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},g=f!==void 0;g&&f.displayWidth&&(u=f.displayWidth,d=f.displayHeight),g||(f=p),this.world=l,this.gameObject=g?f:void 0,this.isBody=!0,this.debugShowBody=l.defaults.debugShowStaticBody,this.debugBodyColor=l.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new i,this.position=new i(f.x-u*f.originX,f.y-d*f.originY),this.width=u,this.height=d,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new i(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=i.ZERO,this.allowGravity=!1,this.gravity=i.ZERO,this.bounce=i.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(s,l){return s&&s!==this.gameObject&&(this.gameObject.body=null,s.body=this,this.gameObject=s),l&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var s=this.gameObject;return s.getTopLeft(this.position),this.width=s.displayWidth,this.height=s.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(s,l){return l===void 0&&(l=s),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s,l),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(s,l,f){f===void 0&&(f=!0);var u=this.gameObject;if(u&&u.frame&&(s||(s=u.frame.realWidth),l||(l=u.frame.realHeight)),this.world.staticTree.remove(this),this.width=s,this.height=l,this.halfWidth=Math.floor(s/2),this.halfHeight=Math.floor(l/2),f&&u&&u.getCenter){var d=u.displayWidth/2,p=u.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(d-this.halfWidth,p-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(s,l,f){return l===void 0&&(l=this.offset.x),f===void 0&&(f=this.offset.y),s>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=s,this.width=s*2,this.height=s*2,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(l,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(s,l){var f=this.gameObject;s===void 0&&(s=f.x),l===void 0&&(l=f.y),this.world.staticTree.remove(this),f.setPosition(s,l),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(s){return s.x=this.x,s.y=this.y,s.right=this.right,s.bottom=this.bottom,s},hitTest:function(s,l){return this.isCircle?a(this,s,l):n(this,s,l)},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(s){var l=this.position,f=l.x+this.halfWidth,u=l.y+this.halfHeight;this.debugShowBody&&(s.lineStyle(s.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?s.strokeCircle(f,u,this.width/2):s.strokeRect(l.x,l.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(s){return s<=0&&(s=.1),this.mass=s,this},x:{get:function(){return this.position.x},set:function(s){this.world.staticTree.remove(this),this.position.x=s,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(s){this.world.staticTree.remove(this),this.position.y=s,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}}});c.exports=h},71464:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13759),v=t(83419),o=t(78389),r=t(37747),n=t(95540),e=t(26479),i=t(41212),h=new v({Extends:e,Mixins:[o],initialize:function(l,f,u,d){!u&&!d?d={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:a}:i(u)?(d=u,u=null,d.internalCreateCallback=this.createCallbackHandler,d.internalRemoveCallback=this.removeCallbackHandler,d.createMultipleCallback=this.createMultipleCallbackHandler,d.classType=n(d,"classType",a)):Array.isArray(u)&&i(u[0])?(d=u,u=null,d.forEach(function(p){p.internalCreateCallback=this.createCallbackHandler,p.internalRemoveCallback=this.removeCallbackHandler,p.createMultipleCallback=this.createMultipleCallbackHandler,p.classType=n(p,"classType",a)})):d={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler},this.world=l,this.physicsType=r.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,e.call(this,f,u,d),this.type="StaticPhysicsGroup"},createCallbackHandler:function(s){s.body||this.world.enableBody(s,r.STATIC_BODY)},removeCallbackHandler:function(s){s.body&&this.world.disableBody(s)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var s=this.children.entries,l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(55495),v=t(37742),o=t(45319),r=t(83419),n=t(79342),e=t(37747),i=t(20339),h=t(52816),s=t(50792),l=t(63012),f=t(43855),u=t(5470),d=t(94977),p=t(64897),g=t(45170),y=t(96523),x=t(35154),T=t(36383),C=t(25774),M=t(96602),w=t(87841),L=t(59542),F=t(40012),O=t(14087),N=t(89936),G=t(35072),V=t(72624),j=t(2483),K=t(61340),J=t(26099),X=t(15994),Y=new r({Extends:s,initialize:function(z,W){s.call(this),this.scene=z,this.bodies=new G,this.staticBodies=new G,this.pendingDestroy=new G,this.colliders=new C,this.gravity=new J(x(W,"gravity.x",0),x(W,"gravity.y",0)),this.bounds=new w(x(W,"x",0),x(W,"y",0),x(W,"width",z.sys.scale.width),x(W,"height",z.sys.scale.height)),this.checkCollision={up:x(W,"checkCollision.up",!0),down:x(W,"checkCollision.down",!0),left:x(W,"checkCollision.left",!0),right:x(W,"checkCollision.right",!0)},this.fps=x(W,"fps",60),this.fixedStep=x(W,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(W,"timeScale",1),this.OVERLAP_BIAS=x(W,"overlapBias",4),this.TILE_BIAS=x(W,"tileBias",16),this.forceX=x(W,"forceX",!1),this.isPaused=x(W,"isPaused",!1),this._total=0,this.drawDebug=x(W,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(W,"debugShowBody",!0),debugShowStaticBody:x(W,"debugShowStaticBody",!0),debugShowVelocity:x(W,"debugShowVelocity",!0),bodyDebugColor:x(W,"debugBodyColor",16711935),staticBodyDebugColor:x(W,"debugStaticBodyColor",255),velocityDebugColor:x(W,"debugVelocityColor",65280)},this.maxEntries=x(W,"maxEntries",16),this.useTree=x(W,"useTree",!0),this.tree=new L(this.maxEntries),this.staticTree=new L(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new K,this._tempMatrix2=new K,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(D,z){z===void 0&&(z=e.DYNAMIC_BODY),Array.isArray(D)||(D=[D]);for(var W=0;W=Z;for(this.fixedStep||(H=z*.001,et=!0,this._elapsed=0),W=0;W=Z;)this._elapsed-=Z,this.step(H)}},step:function(D){var z,W,H=this.bodies.entries,Z=H.length;for(z=0;z0){var st=this.tree,rt=this.staticTree;for(W=et.entries,H=W.length,D=0;D-1&&D.velocity.length()>dt&&(D.velocity.normalize().scale(dt),ot=dt),D.speed=ot},separate:function(D,z,W,H,Z){var Q,k,et=!1,st=!0;if(!D.enable||!z.enable||D.checkCollision.none||z.checkCollision.none||!this.intersects(D,z)||W&&W.call(H,D.gameObject,z.gameObject)===!1)return et;if(D.isCircle||z.isCircle){var rt=this.separateCircle(D,z,Z);rt.result?(et=!0,st=!1):(Q=rt.x,k=rt.y,st=!0)}if(st){var ot=!1,dt=!1,at=this.OVERLAP_BIAS;Z?(ot=O(D,z,Z,at,Q),dt=N(D,z,Z,at,k)):this.forceX||Math.abs(this.gravity.y+D.gravity.y)St&&(dt=i(pt,Pt,St,vt)-Ct):Pt>gt&&(ptSt&&(dt=i(pt,Pt,St,gt)-Ct)),dt*=-1}else dt=D.halfWidth+z.halfWidth-h(Q,k);D.overlapR=dt,z.overlapR=dt;var Mt=a(Q,k),It=(dt+T.EPSILON)*Math.cos(Mt),Kt=(dt+T.EPSILON)*Math.sin(Mt),Gt={overlap:dt,result:!1,x:It,y:Kt};if(W&&(!at||at&&dt!==0))return Gt.result=!0,Gt;if(!at&&dt===0||et&&st||D.customSeparateX||z.customSeparateX)return Gt.x=void 0,Gt.y=void 0,Gt;var Wt=!D.pushable&&!z.pushable;if(at){var Bt=Q.x-k.x,ie=Q.y-k.y,Zt=Math.sqrt(Math.pow(Bt,2)+Math.pow(ie,2)),le=(k.x-Q.x)/Zt||0,fe=(k.y-Q.y)/Zt||0,Ce=2*(rt.x*le+rt.y*fe-ot.x*le-ot.y*fe)/(D.mass+z.mass);(et||st)&&(Ce*=2),et||(rt.x=rt.x-Ce/D.mass*le,rt.y=rt.y-Ce/D.mass*fe,rt.multiply(D.bounce)),st||(ot.x=ot.x+Ce/z.mass*le,ot.y=ot.y+Ce/z.mass*fe,ot.multiply(z.bounce)),!et&&!st&&(It*=.5,Kt*=.5),et||(D.x-=It,D.y-=Kt,D.updateCenter()),st||(z.x+=It,z.y+=Kt,z.updateCenter()),Gt.result=!0}else!et||D.pushable||Wt?(D.x-=It,D.y-=Kt,D.updateCenter()):(!st||z.pushable||Wt)&&(z.x+=It,z.y+=Kt,z.updateCenter()),Gt.x=void 0,Gt.y=void 0;return Gt},intersects:function(D,z){return D===z?!1:!D.isCircle&&!z.isCircle?!(D.right<=z.left||D.bottom<=z.top||D.left>=z.right||D.top>=z.bottom):D.isCircle?z.isCircle?h(D.center,z.center)<=D.halfWidth+z.halfWidth:this.circleBodyIntersects(D,z):this.circleBodyIntersects(z,D)},circleBodyIntersects:function(D,z){var W=o(D.center.x,z.left,z.right),H=o(D.center.y,z.top,z.bottom),Z=(D.center.x-W)*(D.center.x-W),Q=(D.center.y-H)*(D.center.y-H);return Z+Q<=D.halfWidth*D.halfWidth},overlap:function(D,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(D,z,W,H,Z,!0)},collide:function(D,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(D,z,W,H,Z,!1)},collideObjects:function(D,z,W,H,Z,Q){var k,et;D.isParent&&(D.physicsType===void 0||z===void 0||D===z)&&(D=D.children.entries),z&&z.isParent&&z.physicsType===void 0&&(z=z.children.entries);var st=Array.isArray(D),rt=Array.isArray(z);if(this._total=0,!st&&!rt)this.collideHandler(D,z,W,H,Z,Q);else if(!st&&rt)for(k=0;k0},collideHandler:function(D,z,W,H,Z,Q){if(z===void 0&&D.isParent)return this.collideGroupVsGroup(D,D,W,H,Z,Q);if(!D||!z)return!1;if(D.body||D.isBody){if(z.body||z.isBody)return this.collideSpriteVsSprite(D,z,W,H,Z,Q);if(z.isParent)return this.collideSpriteVsGroup(D,z,W,H,Z,Q);if(z.isTilemap)return this.collideSpriteVsTilemapLayer(D,z,W,H,Z,Q)}else if(D.isParent){if(z.body||z.isBody)return this.collideSpriteVsGroup(z,D,W,H,Z,Q);if(z.isParent)return this.collideGroupVsGroup(D,z,W,H,Z,Q);if(z.isTilemap)return this.collideGroupVsTilemapLayer(D,z,W,H,Z,Q)}else if(D.isTilemap){if(z.body||z.isBody)return this.collideSpriteVsTilemapLayer(z,D,W,H,Z,Q);if(z.isParent)return this.collideGroupVsTilemapLayer(z,D,W,H,Z,Q)}},canCollide:function(D,z){return D&&z&&(D.collisionMask&z.collisionCategory)!==0&&(z.collisionMask&D.collisionCategory)!==0},collideSpriteVsSprite:function(D,z,W,H,Z,Q){var k=D.isBody?D:D.body,et=z.isBody?z:z.body;return this.canCollide(k,et)?(this.separate(k,et,H,Z,Q)&&(W&&W.call(Z,D,z),this._total++),!0):!1},collideSpriteVsGroup:function(D,z,W,H,Z,Q){var k=D.isBody?D:D.body;if(!(z.length===0||!k||!k.enable||k.checkCollision.none||!this.canCollide(k,z))){var et,st,rt;if(this.useTree||z.physicsType===e.STATIC_BODY){var ot=this.treeMinMax;ot.minX=k.left,ot.minY=k.top,ot.maxX=k.right,ot.maxY=k.bottom;var dt=z.physicsType===e.DYNAMIC_BODY?this.tree.search(ot):this.staticTree.search(ot);for(st=dt.length,et=0;et{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setAcceleration:function(t,a){return this.body.acceleration.set(t,a),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}};c.exports=m},59023:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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}};c.exports=m},62069:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setBounce:function(t,a){return this.body.bounce.set(t,a),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,a,v,o){return this.body.setCollideWorldBounds(t,a,v,o),this}};c.exports=m},78389:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79599),v={setCollisionCategory:function(o){var r=this.body?this.body:this;return r.collisionCategory=o,this},willCollideWith:function(o){var r=this.body?this.body:this;return(r.collisionMask&o)!==0},addCollidesWith:function(o){var r=this.body?this.body:this;return r.collisionMask=r.collisionMask|o,this},removeCollidesWith:function(o){var r=this.body?this.body:this;return r.collisionMask=r.collisionMask&~o,this},setCollidesWith:function(o){var r=this.body?this.body:this;return r.collisionMask=a(o),this},resetCollisionCategory:function(){var o=this.body?this.body:this;return o.collisionCategory=1,o.collisionMask=1,this}};c.exports=v},87118:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setDebug:function(t,a,v){return this.debugShowBody=t,this.debugShowVelocity=a,this.debugBodyColor=v,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}}};c.exports=m},52819:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setDrag:function(t,a){return this.body.drag.set(t,a),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}};c.exports=m},4074:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,a,v,o,r){return t&&this.body.reset(a,v),o&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,a){return t===void 0&&(t=!1),a===void 0&&(a=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),a&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};c.exports=m},40831:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setFriction:function(t,a){return this.body.friction.set(t,a),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}};c.exports=m},26775:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setGravity:function(t,a){return this.body.gravity.set(t,a),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}};c.exports=m},9437:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setImmovable:function(t){return t===void 0&&(t=!0),this.body.immovable=t,this}};c.exports=m},30621:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setMass:function(t){return this.body.mass=t,this}};c.exports=m},72441:(c,m,t)=>{var a=t(47956),v=t(96503),o=t(2044),r=t(81491),n=function(e,i,h,s,l,f){var u=a(e,i-s,h-s,2*s,2*s,l,f);if(u.length===0)return u;for(var d=new v(i,h,s),p=new v,g=[],y=0;y{var m=function(t,a,v,o,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var i=[],h=[],s=t.treeMinMax;if(s.minX=a,s.minY=v,s.maxX=a+o,s.maxY=v+r,e&&(h=t.staticTree.search(s)),n&&t.useTree)i=t.tree.search(s);else if(n){var l=t.bodies,f={position:{x:a,y:v},left:a,top:v,right:a+o,bottom:v+r,isCircle:!1},u=t.intersects;l.iterate(function(d){u(d,f)&&i.push(d)})}return h.concat(i)};c.exports=m},62121:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setPushable:function(t){return t===void 0&&(t=!0),this.body.pushable=t,this}};c.exports=m},29384:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setOffset:function(t,a){return this.body.setOffset(t,a),this},setSize:function(t,a,v){return this.body.setSize(t,a,v),this},setBodySize:function(t,a,v){return this.body.setSize(t,a,v),this},setCircle:function(t,a,v){return this.body.setCircle(t,a,v),this}};c.exports=m},15098:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setVelocity:function(t,a){return this.body.setVelocity(t,a),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,a){return this.body.maxVelocity.set(t,a),this}};c.exports=m},92209:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},20009:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="collide"},36768:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="overlap"},60473:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},89954:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},61804:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="tilecollide"},7161:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="tileoverlap"},34689:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="worldbounds"},16006:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="worldstep"},63012:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37747),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},96602:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,a,t):t.layer.callbacks[t.index]?!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,a,t):!0};c.exports=m},36294:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a<0?(t.blocked.none=!1,t.blocked.left=!0):a>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=a,t.updateCenter(),t.bounce.x===0?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x};c.exports=m},67013:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a<0?(t.blocked.none=!1,t.blocked.up=!0):a>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=a,t.updateCenter(),t.bounce.y===0?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y};c.exports=m},40012:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(21329),v=t(53442),o=t(2483),r=function(n,e,i,h,s,l,f){var u=h.left,d=h.top,p=h.right,g=h.bottom,y=i.faceLeft||i.faceRight,x=i.faceTop||i.faceBottom;if(f||(y=!0,x=!0),!y&&!x)return!1;var T=0,C=0,M=0,w=1;if(e.deltaAbsX()>e.deltaAbsY()?M=-1:e.deltaAbsX(){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36294),v=function(o,r,n,e,i,h){var s=0,l=r.faceLeft,f=r.faceRight,u=r.collideLeft,d=r.collideRight;return h||(l=!0,f=!0,u=!0,d=!0),o.deltaX()<0&&d&&o.checkCollision.left?f&&o.x0&&u&&o.checkCollision.right&&l&&o.right>n&&(s=o.right-n,s>i&&(s=0)),s!==0&&(o.customSeparateX?o.overlapX=s:a(o,s)),s};c.exports=v},53442:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(67013),v=function(o,r,n,e,i,h){var s=0,l=r.faceTop,f=r.faceBottom,u=r.collideUp,d=r.collideDown;return h||(l=!0,f=!0,u=!0,d=!0),o.deltaY()<0&&d&&o.checkCollision.up?f&&o.y0&&u&&o.checkCollision.down&&l&&o.bottom>n&&(s=o.bottom-n,s>i&&(s=0)),s!==0&&(o.customSeparateY?o.overlapY=s:a(o,s)),s};c.exports=v},2483:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return!(a.right<=t.left||a.bottom<=t.top||a.position.x>=t.right||a.position.y>=t.bottom)};c.exports=m},55173:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={ProcessTileCallbacks:t(96602),ProcessTileSeparationX:t(36294),ProcessTileSeparationY:t(67013),SeparateTile:t(40012),TileCheckX:t(21329),TileCheckY:t(53442),TileIntersectsBody:t(2483)};c.exports=a},44563:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Arcade:t(27064),Matter:t(3875)}},68174:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(26099),o=new a({initialize:function(){this.boundsCenter=new v,this.centerDiff=new v},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,i=r.bounds.max.x-r.bounds.min.x,h=r.bounds.max.y-r.bounds.min.y,s=i*r.centerOfMass.x,l=h*r.centerOfMass.y;return n.set(i/2,h/2),e.set(s-n.x,l-n.y),!0},getTopLeft:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var i=this.boundsCenter,h=this.centerDiff;return new v(n+i.x+h.x,e+i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n+h.x,e+i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n-(i.x-h.x),e+i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n+i.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 i=this.centerDiff;return new v(n+i.x,e+i.y)}return!1},getRightCenter:function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),this.parseBody(r)){var i=this.boundsCenter,h=this.centerDiff;return new v(n-(i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n+i.x+h.x,e-(i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n+h.x,e-(i.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 i=this.boundsCenter,h=this.centerDiff;return new v(n-(i.x-h.x),e-(i.y-h.y))}return!1}});c.exports=o},19933:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6790);a.Body=t(22562),a.Composite=t(69351),a.World=t(4372),a.Collision=t(52284),a.Detector=t(81388),a.Pairs=t(99561),a.Pair=t(4506),a.Query=t(73296),a.Resolver=t(66272),a.Constraint=t(48140),a.Common=t(53402),a.Engine=t(48413),a.Events=t(35810),a.Sleeping=t(53614),a.Plugin=t(73832),a.Bodies=t(66280),a.Composites=t(74116),a.Axes=t(66615),a.Bounds=t(15647),a.Svg=t(74058),a.Vector=t(31725),a.Vertices=t(41598),a.World.add=a.Composite.add,a.World.remove=a.Composite.remove,a.World.addComposite=a.Composite.addComposite,a.World.addBody=a.Composite.addBody,a.World.addConstraint=a.Composite.addConstraint,a.World.clear=a.Composite.clear,c.exports=a},28137:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66280),v=t(83419),o=t(74116),r=t(48140),n=t(74058),e=t(75803),i=t(23181),h=t(34803),s=t(73834),l=t(19496),f=t(85791),u=t(98713),d=t(41598),p=new v({initialize:function(y){this.world=y,this.scene=y.scene,this.sys=y.scene.sys},rectangle:function(g,y,x,T,C){var M=a.rectangle(g,y,x,T,C);return this.world.add(M),M},trapezoid:function(g,y,x,T,C,M){var w=a.trapezoid(g,y,x,T,C,M);return this.world.add(w),w},circle:function(g,y,x,T,C){var M=a.circle(g,y,x,T,C);return this.world.add(M),M},polygon:function(g,y,x,T,C){var M=a.polygon(g,y,x,T,C);return this.world.add(M),M},fromVertices:function(g,y,x,T,C,M,w){typeof x=="string"&&(x=d.fromPath(x));var L=a.fromVertices(g,y,x,T,C,M,w);return this.world.add(L),L},fromPhysicsEditor:function(g,y,x,T,C){C===void 0&&(C=!0);var M=l.parseBody(g,y,x,T);return C&&!this.world.has(M)&&this.world.add(M),M},fromSVG:function(g,y,x,T,C,M){T===void 0&&(T=1),C===void 0&&(C={}),M===void 0&&(M=!0);for(var w=x.getElementsByTagName("path"),L=[],F=0;F{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(31884),v=t(95540),o=t(26099);function r(e){return!!e.get&&typeof e.get=="function"||!!e.set&&typeof e.set=="function"}var n=function(e,i,h,s){h===void 0&&(h={}),s===void 0&&(s=!0);var l=i.x,f=i.y;i.body={temp:!0,position:{x:l,y:f}};var u=[a.Bounce,a.Collision,a.Force,a.Friction,a.Gravity,a.Mass,a.Sensor,a.SetBody,a.Sleep,a.Static,a.Transform,a.Velocity];if(u.forEach(function(p){for(var g in p)r(p[g])?Object.defineProperty(i,g,{get:p[g].get,set:p[g].set}):Object.defineProperty(i,g,{value:p[g]})}),i.world=e,i._tempVec2=new o(l,f),h.hasOwnProperty("type")&&h.type==="body")i.setExistingBody(h,s);else{var d=v(h,"shape",null);d||(d="rectangle"),h.addToWorld=s,i.setBody(d,h)}return i};c.exports=n},23181:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31884),o=t(95643),r=t(95540),n=t(88571),e=t(72699),i=t(26099),h=new a({Extends:n,Mixins:[v.Bounce,v.Collision,v.Force,v.Friction,v.Gravity,v.Mass,v.Sensor,v.SetBody,v.Sleep,v.Static,v.Transform,v.Velocity,e],initialize:function(l,f,u,d,p,g){o.call(this,l.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(d,p),this.setSizeToFrame(),this.setOrigin(),this.world=l,this._tempVec2=new i(f,u);var y=r(g,"shape",null);y?this.setBody(y,g):this.setRectangle(this.width,this.height,g),this.setPosition(f,u),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=h},42045:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(60461),v=t(66615),o=t(66280),r=t(22562),n=t(68174),e=t(15647),i=t(83419),h=t(52284),s=t(53402),l=t(69351),f=t(74116),u=t(48140),d=t(81388),p=t(20339),g=t(28137),y=t(95540),x=t(35154),T=t(18210),C=t(40178),M=t(6790),w=t(74507),L=t(46975),F=t(4506),O=t(99561),N=t(73832),G=t(37277),V=t(73296),j=t(66272),K=t(44594),J=t(74058),X=t(31725),Y=t(41598),D=t(68243);s.setDecomp(t(55973));var z=new i({initialize:function(H){this.scene=H,this.systems=H.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=r,this.composite=l,this.collision=h,this.detector=d,this.pair=F,this.pairs=O,this.query=V,this.resolver=j,this.constraint=u,this.bodies=o,this.composites=f,this.axes=v,this.bounds=e,this.svg=J,this.vector=X,this.vertices=Y,this.verts=Y,this._tempVec2=X.create(),x(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),x(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),x(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),j._restingThresh=x(this.config,"restingThresh",4),j._restingThreshTangent=x(this.config,"restingThreshTangent",6),j._positionDampen=x(this.config,"positionDampen",.9),j._positionWarming=x(this.config,"positionWarming",.8),j._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),H.sys.events.once(K.BOOT,this.boot,this),H.sys.events.on(K.START,this.start,this)},boot:function(){this.world=new D(this.scene,this.config),this.add=new g(this.world),this.bodyBounds=new n,this.systems.events.once(K.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new D(this.scene,this.config),this.add=new g(this.world));var W=this.systems.events;W.on(K.UPDATE,this.world.update,this.world),W.on(K.POST_UPDATE,this.world.postUpdate,this.world),W.once(K.SHUTDOWN,this.shutdown,this)},getConfig:function(){var W=this.systems.game.config.physics,H=this.systems.settings.physics,Z=L(y(H,"matter",{}),y(W,"matter",{}));return Z},enableAttractorPlugin:function(){return N.register(T),N.use(M,T),this},enableWrapPlugin:function(){return N.register(w),N.use(M,w),this},enableCollisionEventsPlugin:function(){return N.register(C),N.use(M,C),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(W,H){this.world.step(W,H)},containsPoint:function(W,H,Z){W=this.getMatterBodies(W);var Q=X.create(H,Z),k=V.point(W,Q);return k.length>0},intersectPoint:function(W,H,Z){Z=this.getMatterBodies(Z);var Q=X.create(W,H),k=[],et=V.point(Z,Q);return et.forEach(function(st){k.indexOf(st)===-1&&k.push(st)}),k},intersectRect:function(W,H,Z,Q,k,et){k===void 0&&(k=!1),et=this.getMatterBodies(et);var st={min:{x:W,y:H},max:{x:W+Z,y:H+Q}},rt=[],ot=V.region(et,st,k);return ot.forEach(function(dt){rt.indexOf(dt)===-1&&rt.push(dt)}),rt},intersectRay:function(W,H,Z,Q,k,et){k===void 0&&(k=1),et=this.getMatterBodies(et);for(var st=[],rt=V.ray(et,X.create(W,H),X.create(Z,Q),k),ot=0;ot{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(9674),v=t(83419),o=t(31884),r=t(95643),n=t(95540),e=t(72699),i=t(68287),h=t(26099),s=new v({Extends:i,Mixins:[o.Bounce,o.Collision,o.Force,o.Friction,o.Gravity,o.Mass,o.Sensor,o.SetBody,o.Sleep,o.Static,o.Transform,o.Velocity,e],initialize:function(f,u,d,p,g,y){r.call(this,f.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new a(this),this.setTexture(p,g),this.setSizeToFrame(),this.setOrigin(),this.world=f,this._tempVec2=new h(u,d);var x=n(y,"shape",null);x?this.setBody(x,y):this.setRectangle(this.width,this.height,y),this.setPosition(u,d),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=s},73834:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66280),v=t(22562),o=t(83419),r=t(31884),n=t(62644),e=t(50792),i=t(95540),h=t(97022),s=t(41598),l=new o({Extends:e,Mixins:[r.Bounce,r.Collision,r.Friction,r.Gravity,r.Mass,r.Sensor,r.Sleep,r.Static],initialize:function(u,d,p){e.call(this),this.tile=d,this.world=u,d.physics.matterBody&&d.physics.matterBody.destroy(),d.physics.matterBody=this;var g=i(p,"body",null),y=i(p,"addToWorld",!0);if(g)this.setBody(g,y);else{var x=d.getCollisionGroup(),T=i(x,"objects",[]);T.length>0?this.setFromTileCollision(p):this.setFromTileRectangle(p)}if(d.flipX||d.flipY){var C={x:d.getCenterX(),y:d.getCenterY()},M=d.flipX?-1:1,w=d.flipY?-1:1;v.scale(g,M,w,C)}},setFromTileRectangle:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);var u=this.tile.getBounds(),d=u.x+u.width/2,p=u.y+u.height/2,g=a.rectangle(d,p,u.width,u.height,f);return this.setBody(g,f.addToWorld),this},setFromTileCollision:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);for(var u=this.tile.tilemapLayer.scaleX,d=this.tile.tilemapLayer.scaleY,p=this.tile.getLeft(),g=this.tile.getTop(),y=this.tile.getCollisionGroup(),x=i(y,"objects",[]),T=[],C=0;C1){var J=n(f);J.parts=T,this.setBody(v.create(J),J.addToWorld)}return this},setBody:function(f,u){return u===void 0&&(u=!0),this.body&&this.removeBody(),this.body=f,this.body.gameObject=this,u&&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()}});c.exports=l},19496:(c,m,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 a=t(66280),v=t(22562),o=t(53402),r=t(95540),n=t(41598),e={parseBody:function(i,h,s,l){l===void 0&&(l={});for(var f=r(s,"fixtures",[]),u=[],d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66280),v=t(22562),o={parseBody:function(r,n,e,i){i===void 0&&(i={});var h,s=e.vertices;if(s.length===1)i.vertices=s[0],h=v.create(i),a.flagCoincidentParts(h.parts);else{for(var l=[],f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(15647),v=t(83419),o=t(69351),r=t(48140),n=t(81388),e=t(1121),i=t(8214),h=t(46975),s=t(53614),l=t(26099),f=t(41598),u=new v({initialize:function(p,g,y){y===void 0&&(y={});var x={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=p,this.world=g,this.camera=null,this.pointer=null,this.active=!0,this.position=new l,this.body=null,this.part=null,this.constraint=r.create(h(y,x)),this.world.on(e.BEFORE_UPDATE,this.update,this),p.sys.input.on(i.POINTER_DOWN,this.onDown,this),p.sys.input.on(i.POINTER_UP,this.onUp,this)},onDown:function(d){this.pointer||(this.pointer=d,this.camera=d.camera)},onUp:function(d){d===this.pointer&&(this.pointer=null)},getBody:function(d){var p=this.position,g=this.constraint;this.camera.getWorldPoint(d.x,d.y,p);for(var y=o.allBodies(this.world.localWorld),x=0;x1?1:0,T=x;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66280),v=t(22562),o=t(83419),r=t(53402),n=t(69351),e=t(48413),i=t(50792),h=t(1121),s=t(95540),l=t(35154),f=t(22562),u=t(35810),d=t(73834),p=t(4372),g=t(31725),y=new o({Extends:i,initialize:function(T,C){i.call(this),this.scene=T,this.engine=e.create(C),this.localWorld=this.engine.world;var M=l(C,"gravity",null);M?this.setGravity(M.x,M.y,M.scale):M===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=l(C,"enabled",!0),this.getDelta=l(C,"getDelta",this.update60Hz);var w=s(C,"runner",{}),L=s(w,"fps",!1),F=s(w,"fps",60),O=s(w,"delta",1e3/F),N=s(w,"deltaMin",1e3/F),G=s(w,"deltaMax",1e3/(F*.5));L||(F=1e3/O),this.runner={fps:F,deltaSampleSize:s(w,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:s(w,"isFixed",!1),delta:O,deltaMin:N,deltaMax:G},this.autoUpdate=l(C,"autoUpdate",!0);var V=l(C,"debug",!1);if(this.drawDebug=typeof V=="object"?!0:V,this.debugGraphic,this.debugConfig={showAxes:s(V,"showAxes",!1),showAngleIndicator:s(V,"showAngleIndicator",!1),angleColor:s(V,"angleColor",15208787),showBroadphase:s(V,"showBroadphase",!1),broadphaseColor:s(V,"broadphaseColor",16757760),showBounds:s(V,"showBounds",!1),boundsColor:s(V,"boundsColor",16777215),showVelocity:s(V,"showVelocity",!1),velocityColor:s(V,"velocityColor",44783),showCollisions:s(V,"showCollisions",!1),collisionColor:s(V,"collisionColor",16094476),showSeparations:s(V,"showSeparations",!1),separationColor:s(V,"separationColor",16753920),showBody:s(V,"showBody",!0),showStaticBody:s(V,"showStaticBody",!0),showInternalEdges:s(V,"showInternalEdges",!1),renderFill:s(V,"renderFill",!1),renderLine:s(V,"renderLine",!0),fillColor:s(V,"fillColor",1075465),fillOpacity:s(V,"fillOpacity",1),lineColor:s(V,"lineColor",2678297),lineOpacity:s(V,"lineOpacity",1),lineThickness:s(V,"lineThickness",1),staticFillColor:s(V,"staticFillColor",857979),staticLineColor:s(V,"staticLineColor",1255396),showSleeping:s(V,"showSleeping",!1),staticBodySleepOpacity:s(V,"staticBodySleepOpacity",.7),sleepFillColor:s(V,"sleepFillColor",4605510),sleepLineColor:s(V,"sleepLineColor",10066585),showSensors:s(V,"showSensors",!0),sensorFillColor:s(V,"sensorFillColor",857979),sensorLineColor:s(V,"sensorLineColor",1255396),showPositions:s(V,"showPositions",!0),positionSize:s(V,"positionSize",4),positionColor:s(V,"positionColor",14697178),showJoint:s(V,"showJoint",!0),jointColor:s(V,"jointColor",14737474),jointLineOpacity:s(V,"jointLineOpacity",1),jointLineThickness:s(V,"jointLineThickness",2),pinSize:s(V,"pinSize",4),pinColor:s(V,"pinColor",4382944),springColor:s(V,"springColor",14697184),anchorColor:s(V,"anchorColor",15724527),anchorSize:s(V,"anchorSize",4),showConvexHulls:s(V,"showConvexHulls",!1),hullColor:s(V,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),s(C,"setBounds",!1)){var j=C.setBounds;if(typeof j=="boolean")this.setBounds();else{var K=s(j,"x",0),J=s(j,"y",0),X=s(j,"width",T.sys.scale.width),Y=s(j,"height",T.sys.scale.height),D=s(j,"thickness",64),z=s(j,"left",!0),W=s(j,"right",!0),H=s(j,"top",!0),Z=s(j,"bottom",!0);this.setBounds(K,J,X,Y,D,z,W,H,Z)}}},setCompositeRenderStyle:function(x){var T=x.bodies,C=x.constraints,M=x.composites,w,L,F;for(w=0;w0&&(L=w[0].bodyA,F=w[0].bodyB),x.emit(h.COLLISION_START,M,L,F)}),u.on(T,"collisionActive",function(M){var w=M.pairs,L,F;w.length>0&&(L=w[0].bodyA,F=w[0].bodyB),x.emit(h.COLLISION_ACTIVE,M,L,F)}),u.on(T,"collisionEnd",function(M){var w=M.pairs,L,F;w.length>0&&(L=w[0].bodyA,F=w[0].bodyB),x.emit(h.COLLISION_END,M,L,F)})},setBounds:function(x,T,C,M,w,L,F,O,N){return x===void 0&&(x=0),T===void 0&&(T=0),C===void 0&&(C=this.scene.sys.scale.width),M===void 0&&(M=this.scene.sys.scale.height),w===void 0&&(w=64),L===void 0&&(L=!0),F===void 0&&(F=!0),O===void 0&&(O=!0),N===void 0&&(N=!0),this.updateWall(L,"left",x-w,T-w,w,M+w*2),this.updateWall(F,"right",x+C,T-w,w,M+w*2),this.updateWall(O,"top",x,T-w,C,w),this.updateWall(N,"bottom",x,T+M,C,w),this},updateWall:function(x,T,C,M,w,L){var F=this.walls[T];x?(F&&p.remove(this.localWorld,F),C+=w/2,M+=L/2,this.walls[T]=this.create(C,M,w,L,{isStatic:!0,friction:0,frictionStatic:0})):(F&&p.remove(this.localWorld,F),this.walls[T]=null)},createDebugGraphic:function(){var x=this.scene.sys.add.graphics({x:0,y:0});return x.setDepth(Number.MAX_VALUE),this.debugGraphic=x,this.drawDebug=!0,x},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(x,T,C){return x===void 0&&(x=0),T===void 0&&(T=1),C===void 0&&(C=.001),this.localWorld.gravity.x=x,this.localWorld.gravity.y=T,this.localWorld.gravity.scale=C,this},create:function(x,T,C,M,w){var L=a.rectangle(x,T,C,M,w);return p.add(this.localWorld,L),L},add:function(x){return p.add(this.localWorld,x),this},remove:function(x,T){Array.isArray(x)||(x=[x]);for(var C=0;CM.deltaMax?M.deltaMax:T,M.delta=T),M.timeScalePrev=w.timeScale,M.frameCounter+=1,x-M.counterTimestamp>=1e3&&(M.fps=M.frameCounter*((x-M.counterTimestamp)/1e3),M.counterTimestamp=x,M.frameCounter=0),e.update(C,T)}},step:function(x){e.update(this.engine,x)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(x){var T=x.hasOwnProperty("body")?x.body:x;return n.get(this.localWorld,T.id,T.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 x=this.debugConfig,T=this.engine,C=this.debugGraphic,M=n.allBodies(this.localWorld);this.debugGraphic.clear(),x.showBroadphase&&T.broadphase.controller&&this.renderGrid(T.broadphase,C,x.broadphaseColor,.5),x.showBounds&&this.renderBodyBounds(M,C,x.boundsColor,.5),(x.showBody||x.showStaticBody)&&this.renderBodies(M),x.showJoint&&this.renderJoints(),(x.showAxes||x.showAngleIndicator)&&this.renderBodyAxes(M,C,x.showAxes,x.angleColor,.5),x.showVelocity&&this.renderBodyVelocity(M,C,x.velocityColor,1,2),x.showSeparations&&this.renderSeparations(T.pairs.list,C,x.separationColor),x.showCollisions&&this.renderCollisions(T.pairs.list,C,x.collisionColor)}},renderGrid:function(x,T,C,M){T.lineStyle(1,C,M);for(var w=r.keys(x.buckets),L=0;L0){var V=G[0].vertex.x,j=G[0].vertex.y;G.length===2&&(V=(G[0].vertex.x+G[1].vertex.x)/2,j=(G[0].vertex.y+G[1].vertex.y)/2),N.bodyB===N.supports[0].body||N.bodyA.isStatic?T.lineBetween(V-N.normal.x*8,j-N.normal.y*8,V,j):T.lineBetween(V+N.normal.x*8,j+N.normal.y*8,V,j)}}return this},renderBodyBounds:function(x,T,C,M){T.lineStyle(1,C,M);for(var w=0;w1?1:0;N1?1:0;G1?1:0;G1&&this.renderConvexHull(Y,T,J,W)}}},renderBody:function(x,T,C,M,w,L,F,O){M===void 0&&(M=null),w===void 0&&(w=null),L===void 0&&(L=1),F===void 0&&(F=null),O===void 0&&(O=null);for(var N=this.debugConfig,G=N.sensorFillColor,V=N.sensorLineColor,j=x.parts,K=j.length,J=K>1?1:0;J1){var F=x.vertices;T.lineStyle(M,C),T.beginPath(),T.moveTo(F[0].x,F[0].y);for(var O=1;O0&&(T.fillStyle(F),T.fillCircle(j.x,j.y,O),T.fillCircle(K.x,K.y,O)),this},resetCollisionIDs:function(){return v._nextCollidingGroupId=1,v._nextNonCollidingGroupId=-1,v._nextCategory=1,this},shutdown:function(){u.off(this.engine),this.removeAllListeners(),p.clear(this.localWorld,!1),e.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});c.exports=y},70410:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setBounce:function(t){return this.body.restitution=t,this}};c.exports=m},66968:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var a=0;if(!Array.isArray(t))a=t;else for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22562),v={applyForce:function(o){return this._tempVec2.set(this.body.position.x,this.body.position.y),a.applyForce(this.body,this._tempVec2,o),this},applyForceFrom:function(o,r){return a.applyForce(this.body,o,r),this},thrust:function(o){var r=this.body.angle;return this._tempVec2.set(o*Math.cos(r),o*Math.sin(r)),a.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(o){var r=this.body.angle-Math.PI/2;return this._tempVec2.set(o*Math.cos(r),o*Math.sin(r)),a.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(o){var r=this.body.angle+Math.PI/2;return this._tempVec2.set(o*Math.cos(r),o*Math.sin(r)),a.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(o){var r=this.body.angle-Math.PI;return this._tempVec2.set(o*Math.cos(r),o*Math.sin(r)),a.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};c.exports=v},5436:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setFriction:function(t,a,v){return this.body.friction=t,a!==void 0&&(this.body.frictionAir=a),v!==void 0&&(this.body.frictionStatic=v),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};c.exports=m},39858:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}};c.exports=m},37302:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22562),v=t(26099),o={setMass:function(r){return a.setMass(this.body,r),this},setDensity:function(r){return a.setDensity(this.body,r),this},centerOfMass:{get:function(){return new v(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};c.exports=o},39132:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}};c.exports=m},57772:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(66280),v=t(22562),o=t(43855),r=t(95540),n=t(19496),e=t(85791),i=t(41598),h={setRectangle:function(s,l,f){return this.setBody({type:"rectangle",width:s,height:l},f)},setCircle:function(s,l){return this.setBody({type:"circle",radius:s},l)},setPolygon:function(s,l,f){return this.setBody({type:"polygon",sides:l,radius:s},f)},setTrapezoid:function(s,l,f,u){return this.setBody({type:"trapezoid",width:s,height:l,slope:f},u)},setExistingBody:function(s,l){l===void 0&&(l=!0),this.body&&this.world.remove(this.body,!0),this.body=s;for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(1121),v=t(53614),o=t(35810),r={setToSleep:function(){return v.set(this.body,!0),this},setAwake:function(){return v.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;o.on(this.body,"sleepStart",function(i){e.emit(a.SLEEP_START,i,this)})}else o.off(this.body,"sleepStart");return this},setSleepEndEvent:function(n){if(n){var e=this.world;o.on(this.body,"sleepEnd",function(i){e.emit(a.SLEEP_END,i,this)})}else o.off(this.body,"sleepEnd");return this}};c.exports=r},90556:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22562),v={setStatic:function(o){return a.setStatic(this.body,o),this},isStatic:function(){return this.body.isStatic}};c.exports=v},85436:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22562),v=t(36383),o=t(86554),r=t(30954),n=4,e={x:{get:function(){return this.body.position.x},set:function(i){this._tempVec2.set(i,this.y),a.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(i){this._tempVec2.set(this.x,i),a.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(i){var h=1/this._scaleX,s=1/this._scaleY;this._scaleX=i,this._scaleX===0?this.renderFlags&=~n:this.renderFlags|=n,a.scale(this.body,h,s),a.scale(this.body,i,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(i){var h=1/this._scaleX,s=1/this._scaleY;this._scaleY=i,this._scaleY===0?this.renderFlags&=~n:this.renderFlags|=n,a.scale(this.body,h,s),a.scale(this.body,this._scaleX,i)}},angle:{get:function(){return r(this.body.angle*v.RAD_TO_DEG)},set:function(i){this.rotation=r(i)*v.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(i){this._rotation=o(i),a.setAngle(this.body,this._rotation)}},setPosition:function(i,h){return i===void 0&&(i=0),h===void 0&&(h=i),this._tempVec2.set(i,h),a.setPosition(this.body,this._tempVec2),this},setRotation:function(i){return i===void 0&&(i=0),this._rotation=o(i),a.setAngle(this.body,i),this},setFixedRotation:function(){return a.setInertia(this.body,1/0),this},setAngle:function(i){return i===void 0&&(i=0),this.angle=i,a.setAngle(this.body,this.rotation),this},setScale:function(i,h,s){i===void 0&&(i=1),h===void 0&&(h=i);var l=1/this._scaleX,f=1/this._scaleY;return this._scaleX=i,this._scaleY=h,a.scale(this.body,l,f,s),a.scale(this.body,i,h,s),this}};c.exports=e},42081:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(22562),v={setVelocityX:function(o){return this._tempVec2.set(o,this.body.velocity.y),a.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(o){return this._tempVec2.set(this.body.velocity.x,o),a.setVelocity(this.body,this._tempVec2),this},setVelocity:function(o,r){return this._tempVec2.set(o,r),a.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return a.getVelocity(this.body)},setAngularVelocity:function(o){return a.setAngularVelocity(this.body,o),this},getAngularVelocity:function(){return a.getAngularVelocity(this.body)},setAngularSpeed:function(o){return a.setAngularSpeed(this.body,o),this},getAngularSpeed:function(){return a.getAngularSpeed(this.body)}};c.exports=v},31884:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="afteradd"},1213:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="afterremove"},25968:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="afterupdate"},67205:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="beforeadd"},39438:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="beforeremove"},44823:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="beforeupdate"},92593:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="collisionactive"},60128:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="collisionend"},76861:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="collisionstart"},92362:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragend"},76408:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="drag"},93971:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="dragstart"},5656:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},47861:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},79099:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="sleepend"},35906:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="sleepstart"},1121:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{var a={};c.exports=a;var v=t(41598),o=t(31725),r=t(53614),n=t(53402),e=t(15647),i=t(66615);(function(){a._timeCorrection=!0,a._inertiaScale=4,a._nextCollidingGroupId=1,a._nextNonCollidingGroupId=-1,a._nextCategory=1,a._baseDelta=16.666666666666668,a.create=function(s){var l={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:{}};!s.hasOwnProperty("position")&&s.hasOwnProperty("vertices")?s.position=v.centre(s.vertices):s.hasOwnProperty("vertices")||(l.vertices=v.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var f=n.extend(l,s);return h(f,s),f.setOnCollideWith=function(u,d){return d?this.onCollideWith[u.id]=d:delete this.onCollideWith[u.id],this},f},a.nextGroup=function(s){return s?a._nextNonCollidingGroupId--:a._nextCollidingGroupId++},a.nextCategory=function(){return a._nextCategory=a._nextCategory<<1,a._nextCategory};var h=function(s,l){if(l=l||{},a.set(s,{bounds:s.bounds||e.create(s.vertices),positionPrev:s.positionPrev||o.clone(s.position),anglePrev:s.anglePrev||s.angle,vertices:s.vertices,parts:s.parts||[s],isStatic:s.isStatic,isSleeping:s.isSleeping,parent:s.parent||s}),v.rotate(s.vertices,s.angle,s.position),i.rotate(s.axes,s.angle),e.update(s.bounds,s.vertices,s.velocity),a.set(s,{axes:l.axes||s.axes,area:l.area||s.area,mass:l.mass||s.mass,inertia:l.inertia||s.inertia}),s.parts.length===1){var f=s.bounds,u=s.centerOfMass,d=s.centerOffset,p=f.max.x-f.min.x,g=f.max.y-f.min.y;u.x=-(f.min.x-s.position.x)/p,u.y=-(f.min.y-s.position.y)/g,d.x=p*u.x,d.y=g*u.y}};a.set=function(s,l,f){var u;typeof l=="string"&&(u=l,l={},l[u]=f);for(u in l)if(Object.prototype.hasOwnProperty.call(l,u))switch(f=l[u],u){case"isStatic":a.setStatic(s,f);break;case"isSleeping":r.set(s,f);break;case"mass":a.setMass(s,f);break;case"density":a.setDensity(s,f);break;case"inertia":a.setInertia(s,f);break;case"vertices":a.setVertices(s,f);break;case"position":a.setPosition(s,f);break;case"angle":a.setAngle(s,f);break;case"velocity":a.setVelocity(s,f);break;case"angularVelocity":a.setAngularVelocity(s,f);break;case"speed":a.setSpeed(s,f);break;case"angularSpeed":a.setAngularSpeed(s,f);break;case"parts":a.setParts(s,f);break;case"centre":a.setCentre(s,f);break;default:s[u]=f}},a.setStatic=function(s,l){for(var f=0;f0&&o.rotateAbout(p.position,u,s.position,p.position)}},a.setVelocity=function(s,l){var f=s.deltaTime/a._baseDelta;s.positionPrev.x=s.position.x-l.x*f,s.positionPrev.y=s.position.y-l.y*f,s.velocity.x=(s.position.x-s.positionPrev.x)/f,s.velocity.y=(s.position.y-s.positionPrev.y)/f,s.speed=o.magnitude(s.velocity)},a.getVelocity=function(s){var l=a._baseDelta/s.deltaTime;return{x:(s.position.x-s.positionPrev.x)*l,y:(s.position.y-s.positionPrev.y)*l}},a.getSpeed=function(s){return o.magnitude(a.getVelocity(s))},a.setSpeed=function(s,l){a.setVelocity(s,o.mult(o.normalise(a.getVelocity(s)),l))},a.setAngularVelocity=function(s,l){var f=s.deltaTime/a._baseDelta;s.anglePrev=s.angle-l*f,s.angularVelocity=(s.angle-s.anglePrev)/f,s.angularSpeed=Math.abs(s.angularVelocity)},a.getAngularVelocity=function(s){return(s.angle-s.anglePrev)*a._baseDelta/s.deltaTime},a.getAngularSpeed=function(s){return Math.abs(a.getAngularVelocity(s))},a.setAngularSpeed=function(s,l){a.setAngularVelocity(s,n.sign(a.getAngularVelocity(s))*l)},a.translate=function(s,l,f){a.setPosition(s,o.add(s.position,l),f)},a.rotate=function(s,l,f,u){if(!f)a.setAngle(s,s.angle+l,u);else{var d=Math.cos(l),p=Math.sin(l),g=s.position.x-f.x,y=s.position.y-f.y;a.setPosition(s,{x:f.x+(g*d-y*p),y:f.y+(g*p+y*d)},u),a.setAngle(s,s.angle+l,u)}},a.scale=function(s,l,f,u){var d=0,p=0;u=u||s.position;for(var g=s.inertia===1/0,y=0;y0&&(d+=x.area,p+=x.inertia),x.position.x=u.x+(x.position.x-u.x)*l,x.position.y=u.y+(x.position.y-u.y)*f,e.update(x.bounds,x.vertices,s.velocity)}s.parts.length>1&&(s.area=d,s.isStatic||(a.setMass(s,s.density*d),a.setInertia(s,p))),s.circleRadius&&(l===f?s.circleRadius*=l:s.circleRadius=null),g&&a.setInertia(s,1/0)},a.update=function(s,l){l=(typeof l<"u"?l:16.666666666666668)*s.timeScale;var f=l*l,u=a._timeCorrection?l/(s.deltaTime||l):1,d=1-s.frictionAir*(l/n._baseDelta),p=(s.position.x-s.positionPrev.x)*u,g=(s.position.y-s.positionPrev.y)*u;s.velocity.x=p*d+s.force.x/s.mass*f,s.velocity.y=g*d+s.force.y/s.mass*f,s.positionPrev.x=s.position.x,s.positionPrev.y=s.position.y,s.position.x+=s.velocity.x,s.position.y+=s.velocity.y,s.deltaTime=l,s.angularVelocity=(s.angle-s.anglePrev)*d*u+s.torque/s.inertia*f,s.anglePrev=s.angle,s.angle+=s.angularVelocity,s.speed=o.magnitude(s.velocity),s.angularSpeed=Math.abs(s.angularVelocity);for(var y=0;y0&&(x.position.x+=s.velocity.x,x.position.y+=s.velocity.y),s.angularVelocity!==0&&(v.rotate(x.vertices,s.angularVelocity,s.position),i.rotate(x.axes,s.angularVelocity),y>0&&o.rotateAbout(x.position,s.angularVelocity,s.position,x.position)),e.update(x.bounds,x.vertices,s.velocity)}},a.updateVelocities=function(s){var l=a._baseDelta/s.deltaTime,f=s.velocity;f.x=(s.position.x-s.positionPrev.x)*l,f.y=(s.position.y-s.positionPrev.y)*l,s.speed=Math.sqrt(f.x*f.x+f.y*f.y),s.angularVelocity=(s.angle-s.anglePrev)*l,s.angularSpeed=Math.abs(s.angularVelocity)},a.applyForce=function(s,l,f){var u={x:l.x-s.position.x,y:l.y-s.position.y};s.force.x+=f.x,s.force.y+=f.y,s.torque+=u.x*f.y-u.y*f.x},a._totalProperties=function(s){for(var l={mass:0,area:0,inertia:0,centre:{x:0,y:0}},f=s.parts.length===1?0:1;f{var a={};c.exports=a;var v=t(35810),o=t(53402),r=t(15647),n=t(22562);(function(){a.create=function(e){return o.extend({id:o.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},e)},a.setModified=function(e,i,h,s){if(v.trigger(e,"compositeModified",e),e.isModified=i,i&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),h&&e.parent&&a.setModified(e.parent,i,h,s),s)for(var l=0;l{var a={};c.exports=a;var v=t(69351);(function(){a.create=v.create,a.add=v.add,a.remove=v.remove,a.clear=v.clear,a.addComposite=v.addComposite,a.addBody=v.addBody,a.addConstraint=v.addConstraint})()},52284:(c,m,t)=>{var a={};c.exports=a;var v=t(41598),o=t(4506);(function(){var r=[],n={overlap:0,axis:null},e={overlap:0,axis:null};a.create=function(i,h){return{pair:null,collided:!1,bodyA:i,bodyB:h,parentA:i.parent,parentB:h.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},a.collides=function(i,h,s){if(a._overlapAxes(n,i.vertices,h.vertices,i.axes),n.overlap<=0||(a._overlapAxes(e,h.vertices,i.vertices,h.axes),e.overlap<=0))return null;var l=s&&s.table[o.id(i,h)],f;l?f=l.collision:(f=a.create(i,h),f.collided=!0,f.bodyA=i.idX?X=F:FY?Y=F:Ff?f=d:d{var m={};c.exports=m,function(){m.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}}()},81388:(c,m,t)=>{var a={};c.exports=a;var v=t(53402),o=t(52284);(function(){a.create=function(r){var n={bodies:[],pairs:null};return v.extend(n,r)},a.setBodies=function(r,n){r.bodies=n.slice(0)},a.clear=function(r){r.bodies=[]},a.collisions=function(r){var n=[],e=r.pairs,i=r.bodies,h=i.length,s=a.canCollide,l=o.collides,f,u;for(i.sort(a._compareBoundsX),f=0;fg)break;if(!(yL.max.y)&&!(T&&(w.isStatic||w.isSleeping))&&s(d.collisionFilter,w.collisionFilter)){var F=w.parts.length;if(M&&F===1){var O=l(d,w,e);O&&n.push(O)}else for(var N=C>1?1:0,G=F>1?1:0,V=N;VL.max.x||p.max.xL.max.y)){var O=l(j,J,e);O&&n.push(O)}}}}}return n},a.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},a._compareBoundsX=function(r,n){return r.bounds.min.x-n.bounds.min.x}})()},4506:(c,m,t)=>{var a={};c.exports=a;var v=t(43424);(function(){a.create=function(o,r){var n=o.bodyA,e=o.bodyB,i={id:a.id(n,e),bodyA:n,bodyB:e,collision:o,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 a.update(i,o,r),i},a.update=function(o,r,n){var e=o.contacts,i=r.supports,h=o.activeContacts,s=r.parentA,l=r.parentB,f=s.vertices.length;o.isActive=!0,o.timeUpdated=n,o.collision=r,o.separation=r.depth,o.inverseMass=s.inverseMass+l.inverseMass,o.friction=s.frictionl.frictionStatic?s.frictionStatic:l.frictionStatic,o.restitution=s.restitution>l.restitution?s.restitution:l.restitution,o.slop=s.slop>l.slop?s.slop:l.slop,r.pair=o,h.length=0;for(var u=0;u{var a={};c.exports=a;var v=t(4506),o=t(53402);(function(){a.create=function(r){return o.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},r)},a.update=function(r,n,e){var i=r.list,h=i.length,s=r.table,l=n.length,f=r.collisionStart,u=r.collisionEnd,d=r.collisionActive,p,g,y,x;for(f.length=0,u.length=0,d.length=0,x=0;x{var a={};c.exports=a;var v=t(31725),o=t(52284),r=t(15647),n=t(66280),e=t(41598);(function(){a.collides=function(i,h){for(var s=[],l=h.length,f=i.bounds,u=o.collides,d=r.overlaps,p=0;p{var a={};c.exports=a;var v=t(41598),o=t(53402),r=t(15647);(function(){a._restingThresh=2,a._restingThreshTangent=Math.sqrt(6),a._positionDampen=.9,a._positionWarming=.8,a._frictionNormalMultiplier=5,a._frictionMaxStatic=Number.MAX_VALUE,a.preSolvePosition=function(n){var e,i,h,s=n.length;for(e=0;evt?(y=Pt>0?Pt:-Pt,g=C.friction*(Pt>0?1:-1)*s,g<-y?g=-y:g>y&&(g=y)):(g=Pt,y=d);var St=H*G-Z*N,gt=Q*G-k*N,Mt=X/(Y+w.inverseInertia*St*St+L.inverseInertia*gt*gt),It=(1+C.restitution)*pt*Mt;if(g*=Mt,pt0&&(z.normalImpulse=0),It=z.normalImpulse-Kt}if(Pt<-f||Pt>f)z.tangentImpulse=0;else{var Gt=z.tangentImpulse;z.tangentImpulse+=g,z.tangentImpulse<-y&&(z.tangentImpulse=-y),z.tangentImpulse>y&&(z.tangentImpulse=y),g=z.tangentImpulse-Gt}var Wt=N*It+V*g,Bt=G*It+j*g;w.isStatic||w.isSleeping||(w.positionPrev.x+=Wt*w.inverseMass,w.positionPrev.y+=Bt*w.inverseMass,w.anglePrev+=(H*Bt-Z*Wt)*w.inverseInertia),L.isStatic||L.isSleeping||(L.positionPrev.x-=Wt*L.inverseMass,L.positionPrev.y-=Bt*L.inverseMass,L.anglePrev-=(Q*Bt-k*Wt)*L.inverseInertia)}}}}})()},48140:(c,m,t)=>{var a={};c.exports=a;var v=t(41598),o=t(31725),r=t(53614),n=t(15647),e=t(66615),i=t(53402);(function(){a._warming=.4,a._torqueDampen=1,a._minLength=1e-6,a.create=function(h){var s=h;s.bodyA&&!s.pointA&&(s.pointA={x:0,y:0}),s.bodyB&&!s.pointB&&(s.pointB={x:0,y:0});var l=s.bodyA?o.add(s.bodyA.position,s.pointA):s.pointA,f=s.bodyB?o.add(s.bodyB.position,s.pointB):s.pointB,u=o.magnitude(o.sub(l,f));s.length=typeof s.length<"u"?s.length:u,s.id=s.id||i.nextId(),s.label=s.label||"Constraint",s.type="constraint",s.stiffness=s.stiffness||(s.length>0?1:.7),s.damping=s.damping||0,s.angularStiffness=s.angularStiffness||0,s.angleA=s.bodyA?s.bodyA.angle:s.angleA,s.angleB=s.bodyB?s.bodyB.angle:s.angleB,s.plugin={};var d={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return s.length===0&&s.stiffness>.1?(d.type="pin",d.anchors=!1):s.stiffness<.9&&(d.type="spring"),s.render=i.extend(d,s.render),s},a.preSolveAll=function(h){for(var s=0;s=1||h.length===0,M=C?h.stiffness*s:h.stiffness*s*s,w=h.damping*s,L=o.mult(y,T*M),F=(l?l.inverseMass:0)+(f?f.inverseMass:0),O=(l?l.inverseInertia:0)+(f?f.inverseInertia:0),N=F+O,G,V,j,K,J;if(w>0){var X=o.create();j=o.div(y,x),J=o.sub(f&&o.sub(f.position,f.positionPrev)||X,l&&o.sub(l.position,l.positionPrev)||X),K=o.dot(j,J)}l&&!l.isStatic&&(V=l.inverseMass/F,l.constraintImpulse.x-=L.x*V,l.constraintImpulse.y-=L.y*V,l.position.x-=L.x*V,l.position.y-=L.y*V,w>0&&(l.positionPrev.x-=w*j.x*K*V,l.positionPrev.y-=w*j.y*K*V),G=o.cross(u,L)/N*a._torqueDampen*l.inverseInertia*(1-h.angularStiffness),l.constraintImpulse.angle-=G,l.angle-=G),f&&!f.isStatic&&(V=f.inverseMass/F,f.constraintImpulse.x+=L.x*V,f.constraintImpulse.y+=L.y*V,f.position.x+=L.x*V,f.position.y+=L.y*V,w>0&&(f.positionPrev.x+=w*j.x*K*V,f.positionPrev.y+=w*j.y*K*V),G=o.cross(d,L)/N*a._torqueDampen*f.inverseInertia*(1-h.angularStiffness),f.constraintImpulse.angle+=G,f.angle+=G)}}},a.postSolveAll=function(h){for(var s=0;s0&&(d.position.x+=f.x,d.position.y+=f.y),f.angle!==0&&(v.rotate(d.vertices,f.angle,l.position),e.rotate(d.axes,f.angle),u>0&&o.rotateAbout(d.position,f.angle,l.position,d.position)),n.update(d.bounds,d.vertices,l.velocity)}f.angle*=a._warming,f.x*=a._warming,f.y*=a._warming}}},a.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)}},a.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)}},a.currentLength=function(h){var s=(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),l=(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),u=(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0),d=s-f,p=l-u;return Math.sqrt(d*d+p*p)}})()},53402:(c,m,t)=>{var a={};c.exports=a,function(){a._baseDelta=16.666666666666668,a._nextId=0,a._seed=0,a._nowStartTime=+new Date,a._warnedOnce={},a._decomp=null,a.extend=function(o,r){var n,e;typeof r=="boolean"?(n=2,e=r):(n=1,e=!0);for(var i=n;i0;r--){var n=Math.floor(a.random()*(r+1)),e=o[r];o[r]=o[n],o[n]=e}return o},a.choose=function(o){return o[Math.floor(a.random()*o.length)]},a.isElement=function(o){return typeof HTMLElement<"u"?o instanceof HTMLElement:!!(o&&o.nodeType&&o.nodeName)},a.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"},a.isFunction=function(o){return typeof o=="function"},a.isPlainObject=function(o){return typeof o=="object"&&o.constructor===Object},a.isString=function(o){return toString.call(o)==="[object String]"},a.clamp=function(o,r,n){return on?n:o},a.sign=function(o){return o<0?-1:1},a.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-a._nowStartTime},a.random=function(o,r){return o=typeof o<"u"?o:0,r=typeof r<"u"?r:1,o+v()*(r-o)};var v=function(){return a._seed=(a._seed*9301+49297)%233280,a._seed/233280};a.colorToNumber=function(o){return o=o.replace("#",""),o.length==3&&(o=o.charAt(0)+o.charAt(0)+o.charAt(1)+o.charAt(1)+o.charAt(2)+o.charAt(2)),parseInt(o,16)},a.logLevel=1,a.log=function(){console&&a.logLevel>0&&a.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.info=function(){console&&a.logLevel>0&&a.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.warn=function(){console&&a.logLevel>0&&a.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.warnOnce=function(){var o=Array.prototype.slice.call(arguments).join(" ");a._warnedOnce[o]||(a.warn(o),a._warnedOnce[o]=!0)},a.deprecated=function(o,r,n){o[r]=a.chain(function(){a.warnOnce("🔅 deprecated 🔅",n)},o[r])},a.nextId=function(){return a._nextId++},a.indexOf=function(o,r){if(o.indexOf)return o.indexOf(r);for(var n=0;n{var a={};c.exports=a;var v=t(53614),o=t(66272),r=t(81388),n=t(99561),e=t(35810),i=t(69351),h=t(48140),s=t(53402),l=t(22562);(function(){a.create=function(f){f=f||{};var u={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}},d=s.extend(u,f);return d.world=f.world||i.create({label:"World"}),d.pairs=f.pairs||n.create(),d.detector=f.detector||r.create(),d.grid={buckets:[]},d.world.gravity=d.gravity,d.broadphase=d.grid,d.metrics={},d},a.update=function(f,u){var d=s.now(),p=f.world,g=f.detector,y=f.pairs,x=f.timing,T=x.timestamp,C;u=typeof u<"u"?u:s._baseDelta,u*=x.timeScale,x.timestamp+=u,x.lastDelta=u;var M={timestamp:x.timestamp,delta:u};e.trigger(f,"beforeUpdate",M);var w=i.allBodies(p),L=i.allConstraints(p);for(p.isModified&&(r.setBodies(g,w),i.setModified(p,!1,!1,!0)),f.enableSleeping&&v.update(w,u),a._bodiesApplyGravity(w,f.gravity),u>0&&a._bodiesUpdate(w,u),e.trigger(f,"beforeSolve",M),h.preSolveAll(w),C=0;C0&&e.trigger(f,"collisionStart",{pairs:y.collisionStart,timestamp:x.timestamp,delta:u});var O=s.clamp(20/f.positionIterations,0,1);for(o.preSolvePosition(y.list),C=0;C0&&e.trigger(f,"collisionActive",{pairs:y.collisionActive,timestamp:x.timestamp,delta:u}),y.collisionEnd.length>0&&e.trigger(f,"collisionEnd",{pairs:y.collisionEnd,timestamp:x.timestamp,delta:u}),a._bodiesClearForces(w),e.trigger(f,"afterUpdate",M),f.timing.lastElapsed=s.now()-d,f},a.merge=function(f,u){if(s.extend(f,u),u.world){f.world=u.world,a.clear(f);for(var d=i.allBodies(f.world),p=0;p{var a={};c.exports=a;var v=t(53402);(function(){a.on=function(o,r,n){for(var e=r.split(" "),i,h=0;h0){n||(n={}),e=r.split(" ");for(var f=0;f{var a={};c.exports=a;var v=t(73832),o=t(53402);(function(){a.name="matter-js",a.version="0.19.0",a.uses=[],a.used=[],a.use=function(){v.use(a,Array.prototype.slice.call(arguments))},a.before=function(r,n){return r=r.replace(/^Matter./,""),o.chainPathBefore(a,r,n)},a.after=function(r,n){return r=r.replace(/^Matter./,""),o.chainPathAfter(a,r,n)}})()},73832:(c,m,t)=>{var a={};c.exports=a;var v=t(53402);(function(){a._registry={},a.register=function(o){if(a.isPlugin(o)||v.warn("Plugin.register:",a.toString(o),"does not implement all required fields."),o.name in a._registry){var r=a._registry[o.name],n=a.versionParse(o.version).number,e=a.versionParse(r.version).number;n>e?(v.warn("Plugin.register:",a.toString(r),"was upgraded to",a.toString(o)),a._registry[o.name]=o):n-1},a.isFor=function(o,r){var n=o.for&&a.dependencyParse(o.for);return!o.for||r.name===n.name&&a.versionSatisfies(r.version,n.range)},a.use=function(o,r){if(o.uses=(o.uses||[]).concat(r||[]),o.uses.length===0){v.warn("Plugin.use:",a.toString(o),"does not specify any dependencies to install.");return}for(var n=a.dependencies(o),e=v.topologicalSort(n),i=[],h=0;h0&&!s.silent&&v.info(i.join(" "))},a.dependencies=function(o,r){var n=a.dependencyParse(o),e=n.name;if(r=r||{},!(e in r)){o=a.resolve(o)||o,r[e]=v.map(o.uses||[],function(h){a.isPlugin(h)&&a.register(h);var s=a.dependencyParse(h),l=a.resolve(h);return l&&!a.versionSatisfies(l.version,s.range)?(v.warn("Plugin.dependencies:",a.toString(l),"does not satisfy",a.toString(s),"used by",a.toString(n)+"."),l._warned=!0,o._warned=!0):l||(v.warn("Plugin.dependencies:",a.toString(h),"used by",a.toString(n),"could not be resolved."),o._warned=!0),s.name});for(var i=0;i=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;r.test(o)||v.warn("Plugin.versionParse:",o,"is not a valid version or range.");var n=r.exec(o),e=Number(n[4]),i=Number(n[5]),h=Number(n[6]);return{isRange:!!(n[1]||n[2]),version:n[3],range:o,operator:n[1]||n[2]||"",major:e,minor:i,patch:h,parts:[e,i,h],prerelease:n[7],number:e*1e8+i*1e4+h}},a.versionSatisfies=function(o,r){r=r||"*";var n=a.versionParse(r),e=a.versionParse(o);if(n.isRange){if(n.operator==="*"||o==="*")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 o===r||o==="*"}})()},53614:(c,m,t)=>{var a={};c.exports=a;var v=t(22562),o=t(35810),r=t(53402);(function(){a._motionWakeThreshold=.18,a._motionSleepThreshold=.08,a._minBias=.9,a.update=function(n,e){for(var i=e/r._baseDelta,h=a._motionSleepThreshold,s=0;s0&&l.motion=l.sleepThreshold/i&&a.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}},a.afterCollisions=function(n){for(var e=a._motionSleepThreshold,i=0;ie&&a.set(u,!1)}}}},a.set=function(n,e){var i=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,i||o.trigger(n,"sleepStart")):(n.isSleeping=!1,n.sleepCounter=0,i&&o.trigger(n,"sleepEnd"))}})()},66280:(c,m,t)=>{var a={};c.exports=a;var v=t(41598),o=t(53402),r=t(22562),n=t(15647),e=t(31725);(function(){a.rectangle=function(i,h,s,l,f){f=f||{};var u={label:"Rectangle Body",position:{x:i,y:h},vertices:v.fromPath("L 0 0 L "+s+" 0 L "+s+" "+l+" L 0 "+l)};if(f.chamfer){var d=f.chamfer;u.vertices=v.chamfer(u.vertices,d.radius,d.quality,d.qualityMin,d.qualityMax),delete f.chamfer}return r.create(o.extend({},u,f))},a.trapezoid=function(i,h,s,l,f,u){u=u||{},f*=.5;var d=(1-f*2)*s,p=s*f,g=p+d,y=g+p,x;f<.5?x="L 0 0 L "+p+" "+-l+" L "+g+" "+-l+" L "+y+" 0":x="L 0 0 L "+g+" "+-l+" L "+y+" 0";var T={label:"Trapezoid Body",position:{x:i,y:h},vertices:v.fromPath(x)};if(u.chamfer){var C=u.chamfer;T.vertices=v.chamfer(T.vertices,C.radius,C.quality,C.qualityMin,C.qualityMax),delete u.chamfer}return r.create(o.extend({},T,u))},a.circle=function(i,h,s,l,f){l=l||{};var u={label:"Circle Body",circleRadius:s};f=f||25;var d=Math.ceil(Math.max(10,Math.min(f,s)));return d%2===1&&(d+=1),a.polygon(i,h,d,s,o.extend({},u,l))},a.polygon=function(i,h,s,l,f){if(f=f||{},s<3)return a.circle(i,h,l,f);for(var u=2*Math.PI/s,d="",p=u*.5,g=0;g0&&v.area(J)1?(x=r.create(o.extend({parts:T.slice(0)},l)),r.setPosition(x,{x:i,y:h}),x):T[0]},a.flagCoincidentParts=function(i,h){h===void 0&&(h=5);for(var s=0;s{var a={};c.exports=a;var v=t(69351),o=t(48140),r=t(53402),n=t(22562),e=t(66280);(function(){a.stack=function(i,h,s,l,f,u,d){for(var p=v.create({label:"Stack"}),g=i,y=h,x,T=0,C=0;CM&&(M=F),n.translate(L,{x:O*.5,y:F*.5}),g=L.bounds.max.x+f,v.addBody(p,L),x=L,T+=1}else g+=f}y+=M+u,g=i}return p},a.chain=function(i,h,s,l,f,u){for(var d=i.bodies,p=1;p0)for(p=0;p0&&(x=u[p-1+(d-1)*h],v.addConstraint(i,o.create(r.extend({bodyA:x,bodyB:y},f)))),l&&pM)){x=M-x;var L=x,F=s-1-x;if(!(yF)){C===1&&n.translate(T,{x:(y+(s%2===1?1:-1))*w,y:0});var O=T?y*w:0;return d(i+O+y*f,g,y,x,T,C)}}})},a.newtonsCradle=function(i,h,s,l,f){for(var u=v.create({label:"Newtons Cradle"}),d=0;d{var a={};c.exports=a;var v=t(31725),o=t(53402);(function(){a.fromVertices=function(r){for(var n={},e=0;e{var m={};c.exports=m,function(){m.create=function(t){var a={min:{x:0,y:0},max:{x:0,y:0}};return t&&m.update(a,t),a},m.update=function(t,a,v){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var o=0;ot.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=v.x:t.min.x+=v.x,v.y>0?t.max.y+=v.y:t.min.y+=v.y)},m.contains=function(t,a){return a.x>=t.min.x&&a.x<=t.max.x&&a.y>=t.min.y&&a.y<=t.max.y},m.overlaps=function(t,a){return t.min.x<=a.max.x&&t.max.x>=a.min.x&&t.max.y>=a.min.y&&t.min.y<=a.max.y},m.translate=function(t,a){t.min.x+=a.x,t.max.x+=a.x,t.min.y+=a.y,t.max.y+=a.y},m.shift=function(t,a){var v=t.max.x-t.min.x,o=t.max.y-t.min.y;t.min.x=a.x,t.max.x=a.x+v,t.min.y=a.y,t.max.y=a.y+o}}()},74058:(c,m,t)=>{var a={};c.exports=a,t(15647);var v=t(53402);(function(){a.pathToVertices=function(o,r){typeof window<"u"&&!("SVGPathSeg"in window)&&v.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var n,e,i,h,s,l,f,u,d,p,g=[],y,x,T=0,C=0,M=0;r=r||15;var w=function(F,O,N){var G=N%2===1&&N>1;if(!d||F!=d.x||O!=d.y){d&&G?(y=d.x,x=d.y):(y=0,x=0);var V={x:y+F,y:x+O};(G||!d)&&(d=V),g.push(V),C=y+F,M=x+O}},L=function(F){var O=F.pathSegTypeAsLetter.toUpperCase();if(O!=="Z"){switch(O){case"M":case"L":case"T":case"C":case"S":case"Q":C=F.x,M=F.y;break;case"H":C=F.x;break;case"V":M=F.y;break}w(C,M,F.pathSegType)}};for(a._svgPathToAbsolute(o),i=o.getTotalLength(),l=[],n=0;n{var m={};c.exports=m,function(){m.create=function(t,a){return{x:t||0,y:a||0}},m.clone=function(t){return{x:t.x,y:t.y}},m.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},m.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},m.rotate=function(t,a,v){var o=Math.cos(a),r=Math.sin(a);v||(v={});var n=t.x*o-t.y*r;return v.y=t.x*r+t.y*o,v.x=n,v},m.rotateAbout=function(t,a,v,o){var r=Math.cos(a),n=Math.sin(a);o||(o={});var e=v.x+((t.x-v.x)*r-(t.y-v.y)*n);return o.y=v.y+((t.x-v.x)*n+(t.y-v.y)*r),o.x=e,o},m.normalise=function(t){var a=m.magnitude(t);return a===0?{x:0,y:0}:{x:t.x/a,y:t.y/a}},m.dot=function(t,a){return t.x*a.x+t.y*a.y},m.cross=function(t,a){return t.x*a.y-t.y*a.x},m.cross3=function(t,a,v){return(a.x-t.x)*(v.y-t.y)-(a.y-t.y)*(v.x-t.x)},m.add=function(t,a,v){return v||(v={}),v.x=t.x+a.x,v.y=t.y+a.y,v},m.sub=function(t,a,v){return v||(v={}),v.x=t.x-a.x,v.y=t.y-a.y,v},m.mult=function(t,a){return{x:t.x*a,y:t.y*a}},m.div=function(t,a){return{x:t.x/a,y:t.y/a}},m.perp=function(t,a){return a=a===!0?-1:1,{x:a*-t.y,y:a*t.x}},m.neg=function(t){return{x:-t.x,y:-t.y}},m.angle=function(t,a){return Math.atan2(a.y-t.y,a.x-t.x)},m._temp=[m.create(),m.create(),m.create(),m.create(),m.create(),m.create()]}()},41598:(c,m,t)=>{var a={};c.exports=a;var v=t(31725),o=t(53402);(function(){a.create=function(r,n){for(var e=[],i=0;i0)return!1;s=l}return!0},a.scale=function(r,n,e,i){if(n===1&&e===1)return r;i=i||a.centre(r);for(var h,s,l=0;l=0?l-1:r.length-1],u=r[l],d=r[(l+1)%r.length],p=n[l0&&(n|=2),n===3)return!1;return n!==0?!0:null},a.hull=function(r){var n=[],e=[],i,h;for(r=r.slice(0),r.sort(function(s,l){var f=s.x-l.x;return f!==0?f:s.y-l.y}),h=0;h=2&&v.cross3(e[e.length-2],e[e.length-1],i)<=0;)e.pop();e.push(i)}for(h=r.length-1;h>=0;h-=1){for(i=r[h];n.length>=2&&v.cross3(n[n.length-2],n[n.length-1],i)<=0;)n.pop();n.push(i)}return n.pop(),e.pop(),n.concat(e)}})()},18210:(c,m,t)=>{var a=t(19933),v={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(o){o.after("Body.create",function(){v.Body.init(this)}),o.before("Engine.update",function(r){v.Engine.update(r)})},Body:{init:function(o){o.plugin.attractors=o.plugin.attractors||[]}},Engine:{update:function(o){for(var r=a.Composite.allBodies(o.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 m={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(a){a.pairs.map(function(v){var o=v.bodyA,r=v.bodyB;o.gameObject&&o.gameObject.emit("collide",o,r,v),r.gameObject&&r.gameObject.emit("collide",r,o,v),t.Events.trigger(o,"onCollide",{pair:v}),t.Events.trigger(r,"onCollide",{pair:v}),o.onCollideCallback&&o.onCollideCallback(v),r.onCollideCallback&&r.onCollideCallback(v),o.onCollideWith[r.id]&&o.onCollideWith[r.id](r,v),r.onCollideWith[o.id]&&r.onCollideWith[o.id](o,v)})}),t.Events.on(this,"collisionActive",function(a){a.pairs.map(function(v){var o=v.bodyA,r=v.bodyB;o.gameObject&&o.gameObject.emit("collideActive",o,r,v),r.gameObject&&r.gameObject.emit("collideActive",r,o,v),t.Events.trigger(o,"onCollideActive",{pair:v}),t.Events.trigger(r,"onCollideActive",{pair:v}),o.onCollideActiveCallback&&o.onCollideActiveCallback(v),r.onCollideActiveCallback&&r.onCollideActiveCallback(v)})}),t.Events.on(this,"collisionEnd",function(a){a.pairs.map(function(v){var o=v.bodyA,r=v.bodyB;o.gameObject&&o.gameObject.emit("collideEnd",o,r,v),r.gameObject&&r.gameObject.emit("collideEnd",r,o,v),t.Events.trigger(o,"onCollideEnd",{pair:v}),t.Events.trigger(r,"onCollideEnd",{pair:v}),o.onCollideEndCallback&&o.onCollideEndCallback(v),r.onCollideEndCallback&&r.onCollideEndCallback(v)})})})}};c.exports=m},74507:(c,m,t)=>{var a=t(19933),v={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(o){o.after("Engine.update",function(){v.Engine.update(this)})},Engine:{update:function(o){for(var r=o.world,n=a.Composite.allBodies(r),e=a.Composite.allComposites(r),i=0;ir.max.x?n=r.min.x-o.max.x:o.max.xr.max.y?e=r.min.y-o.max.y:o.max.y{/** - * @author Stefan Hedman (http://steffe.se) - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={decomp:L,quickDecomp:G,isSimple:O,removeCollinearPoints:V,removeDuplicatePoints:j,makeCCW:d};function m(X,Y,D){D=D||0;var z=[0,0],W,H,Z,Q,k,et,st;return W=X[1][1]-X[0][1],H=X[0][0]-X[1][0],Z=W*X[0][0]+H*X[0][1],Q=Y[1][1]-Y[0][1],k=Y[0][0]-Y[1][0],et=Q*Y[0][0]+k*Y[0][1],st=W*k-Q*H,K(st,0,D)||(z[0]=(k*Z-H*et)/st,z[1]=(W*et-Q*Z)/st),z}function t(X,Y,D,z){var W=Y[0]-X[0],H=Y[1]-X[1],Z=z[0]-D[0],Q=z[1]-D[1];if(Z*H-Q*W===0)return!1;var k=(W*(D[1]-X[1])+H*(X[0]-D[0]))/(Z*H-Q*W),et=(Z*(X[1]-D[1])+Q*(D[0]-X[0]))/(Q*W-Z*H);return k>=0&&k<=1&&et>=0&&et<=1}function a(X,Y,D){return(Y[0]-X[0])*(D[1]-X[1])-(D[0]-X[0])*(Y[1]-X[1])}function v(X,Y,D){return a(X,Y,D)>0}function o(X,Y,D){return a(X,Y,D)>=0}function r(X,Y,D){return a(X,Y,D)<0}function n(X,Y,D){return a(X,Y,D)<=0}var e=[],i=[];function h(X,Y,D,z){if(z){var W=e,H=i;W[0]=Y[0]-X[0],W[1]=Y[1]-X[1],H[0]=D[0]-Y[0],H[1]=D[1]-Y[1];var Z=W[0]*H[0]+W[1]*H[1],Q=Math.sqrt(W[0]*W[0]+W[1]*W[1]),k=Math.sqrt(H[0]*H[0]+H[1]*H[1]),et=Math.acos(Z/(Q*k));return etD[Y][0])&&(Y=z);return v(l(X,Y-1),l(X,Y),l(X,Y+1))?!1:(p(X),!0)}function p(X){for(var Y=[],D=X.length,z=0;z!==D;z++)Y.push(X.pop());for(var z=0;z!==D;z++)X[z]=Y[z]}function g(X,Y){return r(l(X,Y-1),l(X,Y),l(X,Y+1))}var y=[],x=[];function T(X,Y,D){var z,W,H=y,Z=x;if(o(l(X,Y+1),l(X,Y),l(X,D))&&n(l(X,Y-1),l(X,Y),l(X,D)))return!1;W=s(l(X,Y),l(X,D));for(var Q=0;Q!==X.length;++Q)if(!((Q+1)%X.length===Y||Q===Y)&&o(l(X,Y),l(X,D),l(X,Q+1))&&n(l(X,Y),l(X,D),l(X,Q))&&(H[0]=l(X,Y),H[1]=l(X,D),Z[0]=l(X,Q),Z[1]=l(X,Q+1),z=m(H,Z),s(l(X,Y),z)0?F(X,Y):[X]}function F(X,Y){if(Y.length===0)return[X];if(Y instanceof Array&&Y.length&&Y[0]instanceof Array&&Y[0].length===2&&Y[0][0]instanceof Array){for(var D=[X],z=0;zH)return console.warn("quickDecomp: max level ("+H+") reached."),Y;for(var gt=0;gtat&&(at+=X.length),dt=Number.MAX_VALUE,at3&&z>=0;--z)h(l(X,z-1),l(X,z),l(X,z+1),Y)&&(X.splice(z%X.length,1),D++);return D}function j(X,Y){for(var D=X.length-1;D>=1;--D)for(var z=X[D],W=D-1;W>=0;--W)if(J(z,X[W],Y)){X.splice(D,1);continue}}function K(X,Y,D){return D=D||0,Math.abs(X-Y)<=D}function J(X,Y,D){return K(X[0],Y[0],D)&&K(X[1],Y[1],D)}},52018:(c,m,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 a=t(83419),v=new a({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}});c.exports=v},42363:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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"]};c.exports=m},37277:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={},t={},a={};a.register=function(v,o,r,n){n===void 0&&(n=!1),m[v]={plugin:o,mapping:r,custom:n}},a.registerCustom=function(v,o,r,n){t[v]={plugin:o,mapping:r,data:n}},a.hasCore=function(v){return m.hasOwnProperty(v)},a.hasCustom=function(v){return t.hasOwnProperty(v)},a.getCore=function(v){return m[v]},a.getCustom=function(v){return t[v]},a.getCustomClass=function(v){return t.hasOwnProperty(v)?t[v].plugin:null},a.remove=function(v){m.hasOwnProperty(v)&&delete m[v]},a.removeCustom=function(v){t.hasOwnProperty(v)&&delete t[v]},a.destroyCorePlugins=function(){for(var v in m)m.hasOwnProperty(v)&&delete m[v]},a.destroyCustomPlugins=function(){for(var v in t)t.hasOwnProperty(v)&&delete t[v]},c.exports=a},77332:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(8443),o=t(50792),r=t(74099),n=t(44603),e=t(39429),i=t(95540),h=t(37277),s=t(72905),l=new a({Extends:o,initialize:function(u){o.call(this),this.game=u,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],u.isBooted?this.boot():u.events.once(v.BOOT,this.boot,this)},boot:function(){var f,u,d,p,g,y,x,T=this.game.config,C=T.installGlobalPlugins;for(C=C.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 a=t(52018),v=t(83419),o=t(44594),r=new v({Extends:a,initialize:function(e,i,h){a.call(this,i),this.scene=e,this.systems=e.sys,this.pluginKey=h,e.sys.events.once(o.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});c.exports=r},18922:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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(c){const m=performance.now(),t=this.getVideoPlaybackQuality(),a=this.mozPresentedFrames||this.mozPaintedFrames||t.totalVideoFrames-t.droppedVideoFrames,v=(o,r)=>{const n=this.getVideoPlaybackQuality(),e=this.mozPresentedFrames||this.mozPaintedFrames||n.totalVideoFrames-n.droppedVideoFrames;if(e>a){const i=this.mozFrameDelay||n.totalFrameDelay-t.totalFrameDelay||0,h=r-o;c(r,{presentationTime:r+i*1e3,expectedDisplayTime:r+h,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+h/1e3,presentedFrames:e,processingDuration:i}),delete this._rvfcpolyfillmap[m]}else this._rvfcpolyfillmap[m]=requestAnimationFrame(i=>v(r,i))};return this._rvfcpolyfillmap[m]=requestAnimationFrame(o=>v(m,o)),m},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(c){cancelAnimationFrame(this._rvfcpolyfillmap[c]),delete this._rvfcpolyfillmap[c]})},10312:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={DEFAULT:0,LINEAR:0,NEAREST:1};c.exports=m},68627:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19715),v=t(32880),o=t(83419),r=t(8054),n=t(50792),e=t(92503),i=t(56373),h=t(97480),s=t(69442),l=t(61340),f=new o({Extends:n,initialize:function(d){n.call(this);var p=d.config;this.config={clearBeforeRender:p.clearBeforeRender,backgroundColor:p.backgroundColor,antialias:p.antialias,roundPixels:p.roundPixels},this.game=d,this.type=r.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=d.canvas;var g={alpha:d.config.transparent,desynchronized:d.config.desynchronized,willReadFrequently:!1};this.gameContext=p.context?p.context:this.gameCanvas.getContext("2d",g),this.currentContext=this.gameContext,this.antialias=d.config.antialias,this.blendModes=i(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(s.READY,this.boot,this)},boot:function(){var u=this.game,d=u.scale.baseSize;this.width=d.width,this.height=d.height,this.isBooted=!0,u.scale.on(h.RESIZE,this.onResize,this),this.resize(d.width,d.height)},onResize:function(u,d){(d.width!==this.width||d.height!==this.height)&&this.resize(d.width,d.height)},resize:function(u,d){this.width=u,this.height=d,this.emit(e.RESIZE,u,d)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(u){return this.currentContext.globalCompositeOperation=u,this},setContext:function(u){return this.currentContext=u||this.gameContext,this},setAlpha:function(u){return this.currentContext.globalAlpha=u,this},preRender:function(){var u=this.gameContext,d=this.config,p=this.width,g=this.height;u.globalAlpha=1,u.globalCompositeOperation="source-over",u.setTransform(1,0,0,1,0,0),d.clearBeforeRender&&(u.clearRect(0,0,p,g),d.transparent||(u.fillStyle=d.backgroundColor.rgba,u.fillRect(0,0,p,g))),u.save(),this.drawCount=0,this.emit(e.PRE_RENDER)},render:function(u,d,p){var g=d.length;this.emit(e.RENDER,u,p);var y=p.x,x=p.y,T=p.width,C=p.height,M=p.renderToTexture?p.context:u.sys.context;M.save(),this.game.scene.customViewports&&(M.beginPath(),M.rect(y,x,T,C),M.clip()),p.emit(a.PRE_RENDER,p),this.currentContext=M;var w=p.mask;w&&w.preRenderCanvas(this,null,p._maskCamera),p.transparent||(M.fillStyle=p.backgroundColor.rgba,M.fillRect(y,x,T,C)),M.globalAlpha=p.alpha,M.globalCompositeOperation="source-over",this.drawCount+=g,p.renderToTexture&&p.emit(a.PRE_RENDER,p),p.matrix.copyToContext(M);for(var L=0;L=0?K=-(K+F):K<0&&(K=Math.abs(K)-F)),u.flipY&&(J>=0?J=-(J+O):J<0&&(J=Math.abs(J)-O))}var Y=1,D=1;u.flipX&&(N||(K+=-d.realWidth+V*2),Y=-1),u.flipY&&(N||(J+=-d.realHeight+j*2),D=-1);var z=u.x,W=u.y;C.applyITRS(z,W,u.rotation,u.scaleX*Y,u.scaleY*D),T.copyFrom(p.matrix),g?(T.multiplyWithOffset(g,-p.scrollX*u.scrollFactorX,-p.scrollY*u.scrollFactorY),C.e=z,C.f=W):(C.e-=p.scrollX*u.scrollFactorX,C.f-=p.scrollY*u.scrollFactorY),T.multiply(C),p.roundPixels&&(T.e=Math.round(T.e),T.f=Math.round(T.f)),x.save(),T.setToContext(x),x.globalCompositeOperation=this.blendModes[u.blendMode],x.globalAlpha=y,x.imageSmoothingEnabled=!d.source.scaleMode,u.mask&&u.mask.preRenderCanvas(this,u,p),F>0&&O>0&&(p.roundPixels?x.drawImage(d.source.image,w,L,F,O,Math.round(K),Math.round(J),Math.round(F/G),Math.round(O/G)):x.drawImage(d.source.image,w,L,F,O,K,J,F/G,O/G)),u.mask&&u.mask.postRenderCanvas(this,u,p),x.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});c.exports=f},55830:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={CanvasRenderer:t(68627),GetBlendModes:t(56373),SetTransform:t(20926)}},56373:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(89289),o=function(){var r=[],n=v.supportNewBlendModes,e="source-over";return r[a.NORMAL]=e,r[a.ADD]="lighter",r[a.MULTIPLY]=n?"multiply":e,r[a.SCREEN]=n?"screen":e,r[a.OVERLAY]=n?"overlay":e,r[a.DARKEN]=n?"darken":e,r[a.LIGHTEN]=n?"lighten":e,r[a.COLOR_DODGE]=n?"color-dodge":e,r[a.COLOR_BURN]=n?"color-burn":e,r[a.HARD_LIGHT]=n?"hard-light":e,r[a.SOFT_LIGHT]=n?"soft-light":e,r[a.DIFFERENCE]=n?"difference":e,r[a.EXCLUSION]=n?"exclusion":e,r[a.HUE]=n?"hue":e,r[a.SATURATION]=n?"saturation":e,r[a.COLOR]=n?"color":e,r[a.LUMINOSITY]=n?"luminosity":e,r[a.ERASE]="destination-out",r[a.SOURCE_IN]="source-in",r[a.SOURCE_OUT]="source-out",r[a.SOURCE_ATOP]="source-atop",r[a.DESTINATION_OVER]="destination-over",r[a.DESTINATION_IN]="destination-in",r[a.DESTINATION_OUT]="destination-out",r[a.DESTINATION_ATOP]="destination-atop",r[a.LIGHTER]="lighter",r[a.COPY]="copy",r[a.XOR]="xor",r};c.exports=o},20926:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91296),v=function(o,r,n,e,i){var h=e.alpha*n.alpha;if(h<=0)return!1;var s=a(n,e,i).calc;return r.globalCompositeOperation=o.blendModes[n.blendMode],r.globalAlpha=h,r.save(),s.setToContext(r),r.imageSmoothingEnabled=n.frame?!n.frame.source.scaleMode:o.antialias,!0};c.exports=v},63899:c=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="losewebgl"},6119:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="postrender"},48070:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="prerender"},15640:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="render"},8912:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resize"},87124:c=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="restorewebgl"},92503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={LOSE_WEBGL:t(63899),POST_RENDER:t(6119),PRE_RENDER:t(48070),RENDER:t(15640),RESIZE:t(8912),RESTORE_WEBGL:t(87124)}},36909:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Events:t(92503),Snapshot:t(89966)},c.exports.Canvas=t(55830),c.exports.WebGL=t(4159)},32880:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=t(40987),o=t(95540),r=function(n,e){var i=o(e,"callback"),h=o(e,"type","image/png"),s=o(e,"encoder",.92),l=Math.abs(Math.round(o(e,"x",0))),f=Math.abs(Math.round(o(e,"y",0))),u=Math.floor(o(e,"width",n.width)),d=Math.floor(o(e,"height",n.height)),p=o(e,"getPixel",!1);if(p){var g=n.getContext("2d",{willReadFrequently:!1}),y=g.getImageData(l,f,1,1),x=y.data;i.call(null,new v(x[0],x[1],x[2],x[3]))}else if(l!==0||f!==0||u!==n.width||d!==n.height){var T=a.createWebGL(this,u,d),C=T.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&C.drawImage(n,l,f,u,d,0,0,u,d);var M=new Image;M.onerror=function(){i.call(null),a.remove(T)},M.onload=function(){i.call(null,M),a.remove(T)},M.src=T.toDataURL(h,s)}else{var w=new Image;w.onerror=function(){i.call(null)},w.onload=function(){i.call(null,w)},w.src=n.toDataURL(h,s)}};c.exports=r},88815:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=t(40987),o=t(95540),r=function(n,e){var i=n,h=o(e,"callback"),s=o(e,"type","image/png"),l=o(e,"encoder",.92),f=Math.abs(Math.round(o(e,"x",0))),u=Math.abs(Math.round(o(e,"y",0))),d=o(e,"getPixel",!1),p=o(e,"isFramebuffer",!1),g=p?o(e,"bufferWidth",1):i.drawingBufferWidth,y=p?o(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var x=new Uint8Array(4),T=p?u:y-u;i.readPixels(f,T,1,1,i.RGBA,i.UNSIGNED_BYTE,x),h.call(null,new v(x[0],x[1],x[2],x[3]))}else{var C=Math.floor(o(e,"width",g)),M=Math.floor(o(e,"height",y)),w=C*M*4,L=new Uint8Array(w);i.readPixels(f,y-u-M,C,M,i.RGBA,i.UNSIGNED_BYTE,L);for(var F=a.createWebGL(this,C,M),O=F.getContext("2d",{willReadFrequently:!0}),N=O.getImageData(0,0,C,M),G=N.data,V=0;V{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Canvas:t(32880),WebGL:t(88815)}},7530:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(36060),o=t(90330),r=t(82264),n=t(95540),e=t(32302),i=t(63448),h=t(31302),s=t(58918),l=t(14811),f=t(92651),u=t(96569),d=t(56527),p=t(57516),g=t(43439),y=t(81041),x=t(12385),T=t(7589),C=t(95428),M=t(72905),w=new a({initialize:function(F){this.game=F.game,this.renderer=F,this.classes=new o([[v.UTILITY_PIPELINE,T],[v.MULTI_PIPELINE,p],[v.BITMAPMASK_PIPELINE,h],[v.SINGLE_PIPELINE,x],[v.ROPE_PIPELINE,y],[v.LIGHT_PIPELINE,u],[v.POINTLIGHT_PIPELINE,g],[v.MOBILE_PIPELINE,d]]),this.postPipelineClasses=new o,this.pipelines=new o,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(L,F,O){var N=this.renderer,G=this.renderTargets;this.frameInc=Math.floor(n(L,"frameInc",32));var V=N.width,j=N.height,K=this.game.config.disablePreFX,J=this.game.config.disablePostFX;if(J||this.postPipelineClasses.setAll([[String(l.BARREL),s.Barrel],[String(l.BLOOM),s.Bloom],[String(l.BLUR),s.Blur],[String(l.BOKEH),s.Bokeh],[String(l.CIRCLE),s.Circle],[String(l.COLOR_MATRIX),s.ColorMatrix],[String(l.DISPLACEMENT),s.Displacement],[String(l.GLOW),s.Glow],[String(l.GRADIENT),s.Gradient],[String(l.PIXELATE),s.Pixelate],[String(l.SHADOW),s.Shadow],[String(l.SHINE),s.Shine],[String(l.VIGNETTE),s.Vignette],[String(l.WIPE),s.Wipe]]),!K){this.classes.set(v.FX_PIPELINE,f);for(var X=Math.min(V,j),Y=Math.ceil(X/this.frameInc),D=1;D=0;O--){var N=F[O];N.active&&N.preBatch(L)}}},postBatch:function(L){if(L.hasPostPipeline){this.flush();for(var F=L.postPipelines,O=0;O=0;O--){var N=F[O];N.active&&N.preBatch(L)}}},postBatchCamera:function(L){if(L.hasPostPipeline){this.flush();for(var F=L.postPipelines,O=0;Othis.maxDimension)return this.targetIndex=F.length-O,F[this.targetIndex];var N=(i(L,this.frameInc,0,!0)-1)*O;return this.targetIndex=N,F[N]},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}});c.exports=w},32302:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(92503),o=new a({initialize:function(n,e,i,h,s,l,f,u,d){h===void 0&&(h=1),s===void 0&&(s=0),l===void 0&&(l=!0),f===void 0&&(f=!1),u===void 0&&(u=!0),d===void 0&&(d=!0),this.renderer=n,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=h,this.minFilter=s,this.autoClear=l,this.autoResize=!0,this.hasDepthBuffer=u,this.forceClamp=d,this.resize(e,i),f?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(r){return r&&!this.autoResize?(this.renderer.on(v.RESIZE,this.resize,this),this.autoResize=!0):!r&&this.autoResize&&(this.renderer.off(v.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 i=this.renderer;if(r&&i.flush(),n&&e&&this.resize(n,e),i.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)}i.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(v.RESIZE,this.resize,this),r.deleteFramebuffer(this.framebuffer),r.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});c.exports=o},70554:c=>{/** - * @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} - */c.exports={getTintFromFloats:function(m,t,a,v){var o=(m*255|0)&255,r=(t*255|0)&255,n=(a*255|0)&255,e=(v*255|0)&255;return(e<<24|o<<16|r<<8|n)>>>0},getTintAppendFloatAlpha:function(m,t){var a=(t*255|0)&255;return(a<<24|m)>>>0},getTintAppendFloatAlphaAndSwap:function(m,t){var a=(m>>16|0)&255,v=(m>>8|0)&255,o=(m|0)&255,r=(t*255|0)&255;return(r<<24|o<<16|v<<8|a)>>>0},getFloatsFromUintRGB:function(m){var t=(m>>16|0)&255,a=(m>>8|0)&255,v=(m|0)&255;return[t/255,a/255,v/255]},checkShaderMax:function(m,t){var a=Math.min(16,m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS));return!t||t===-1?a:Math.min(a,t)},parseFragmentShaderMaxTextures:function(m,t){if(!m)return"";for(var a="",v=0;v0&&(a+=` - else `),v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(62644),o=t(50792),r=t(77085),n=t(95540),e=t(37867),i=t(92503),h=t(32302),s=t(70554),l=t(38683),f=new a({Extends:o,initialize:function(d){o.call(this);var p=d.game,g=p.renderer,y=g.gl;this.name=n(d,"name","WebGLPipeline"),this.game=p,this.renderer=g,this.manager,this.gl=y,this.view=p.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=n(d,"topology",y.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=n(d,"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=d,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=n(d,"resizeUniform","")},boot:function(){var u,d=this.gl,p=this.config,g=this.renderer;this.isPostFX||(this.projectionMatrix=new e().identity());var y=this.renderTargets,x=n(p,"renderTarget",!1);typeof x=="boolean"&&x&&(x=1);var T=g.width,C=g.height;if(typeof x=="number")for(u=0;uV&&(V=G[u].vertexSize);var j=n(p,"batchSize",g.config.batchSize);this.vertexCapacity=j*6;var K=new ArrayBuffer(this.vertexCapacity*V);this.vertexData=K,this.bytes=new Uint8Array(K),this.vertexViewF32=new Float32Array(K),this.vertexViewU32=new Uint32Array(K);var J=n(p,"vertices",null);for(J?(this.vertexViewF32.set(J),this.vertexBuffer=g.createVertexBuffer(K,d.STATIC_DRAW)):this.vertexBuffer=g.createVertexBuffer(K.byteLength,d.DYNAMIC_DRAW),this.setVertexBuffer(),u=G.length-1;u>=0;u--)G[u].rebind();this.hasBooted=!0,g.on(i.RESIZE,this.resize,this),g.on(i.PRE_RENDER,this.onPreRender,this),g.on(i.RENDER,this.onRender,this),g.on(i.POST_RENDER,this.onPostRender,this),this.emit(r.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(u,d,p){var g=this.renderer;if(u!==this.currentShader||g.currentProgram!==this.currentShader.program){this.flush();var y=this.setVertexBuffer(p);y&&!d&&(d=!0),u.bind(d,!1),this.currentShader=u}return this},getShaderByName:function(u){for(var d=this.shaders,p=0;p-1&&(G=X.substring(20))}V&&j&&O.push(new l(this,G,V,j,v(K)))}this.shaders=O}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(u){return this.currentBatch={start:this.vertexCount,count:0,texture:[u],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=u,this.batch.push(this.currentBatch),0},addTextureToBatch:function(u){var d=this.currentBatch;d&&(d.texture.push(u),d.unit++,d.maxUnit++)},pushBatch:function(u){if(!this.currentBatch||this.forceZero&&u!==this.currentTexture)return this.createBatch(u);if(u===this.currentTexture)return this.currentUnit;var d=this.currentBatch,p=d.texture.indexOf(u);return p===-1?d.texture.length===this.renderer.maxTextures?this.createBatch(u):(d.unit++,d.maxUnit++,d.texture.push(u),this.currentUnit=d.unit,this.currentTexture=u,d.unit):(this.currentUnit=p,this.currentTexture=u,p)},setGameObject:function(u,d){return d===void 0&&(d=u.frame),this.pushBatch(d.source.glTexture)},shouldFlush:function(u){return u===void 0&&(u=0),this.vertexCount+u>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(u,d){(u!==this.width||d!==this.height)&&this.flush(),this.width=u,this.height=d;for(var p=this.renderTargets,g=0;g=0;p--){var g=d[p].rebind();(!u||g===u)&&(this.currentShader=g)}return this.activeTextures.length=0,this.emit(r.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var u=this.shaders,d=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,d&&this.setVertexBuffer();for(var p=0;p0){this.emit(r.BEFORE_FLUSH,this,u),this.onBeforeFlush(u);var d=this.gl,p=this.vertexCount,g=this.currentShader.vertexSize,y=this.topology;if(this.active){this.setVertexBuffer(),p===this.vertexCapacity?d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.DYNAMIC_DRAW):d.bufferSubData(d.ARRAY_BUFFER,0,this.bytes.subarray(0,p*g));var x,T,C,M=this.batch,w=this.activeTextures;if(this.forceZero)for(w[0]||d.activeTexture(d.TEXTURE0),x=0;x{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95428),v=t(72905),o=t(19715),r=t(83419),n=t(8054),e=t(50792),i=t(92503),h=t(50030),s=t(37867),l=t(29747),f=t(7530),u=t(32302),d=t(97480),p=t(69442),g=t(70554),y=t(88815),x=t(26128),T=t(1482),C=t(82751),M=t(84387),w=t(93567),L=t(57183),F=new r({Extends:e,initialize:function(N){e.call(this);var G=N.config,V={alpha:G.transparent,desynchronized:G.desynchronized,depth:!0,antialias:G.antialiasGL,premultipliedAlpha:G.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:G.failIfMajorPerformanceCaveat,powerPreference:G.powerPreference,preserveDrawingBuffer:G.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:G.clearBeforeRender,antialias:G.antialias,backgroundColor:G.backgroundColor,contextCreation:V,roundPixels:G.roundPixels,maxTextures:G.maxTextures,maxTextureSize:G.maxTextureSize,batchSize:G.batchSize,maxLights:G.maxLights,mipmapFilter:G.mipmapFilter},this.game=N,this.type=n.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=N.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=l,this.contextRestoredHandler=l,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(O){var N,G=this.game,V=this.canvas,j=O.backgroundColor;if(G.config.context?N=G.config.context:N=V.getContext("webgl",O.contextCreation)||V.getContext("experimental-webgl",O.contextCreation),!N||N.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=N;var K=this,J=function(){var D=N.getSupportedExtensions();K.supportedExtensions=D;var z="ANGLE_instanced_arrays";K.instancedArraysExtension=D.indexOf(z)>-1?N.getExtension(z):null;var W="OES_vertex_array_object";K.vaoExtension=D.indexOf(W)>-1?N.getExtension(W):null};J(),this.contextLostHandler=function(D){K.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),K.emit(i.LOSE_WEBGL,K),D.preventDefault()},V.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(D){if(N.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}K.currentProgram=null,K.currentFramebuffer=null,K.setBlendMode(n.BlendModes.NORMAL),N.disable(N.BLEND),N.disable(N.DEPTH_TEST),N.enable(N.CULL_FACE),K.compression=K.getCompressedTextures();var z=function(W){W.createResource()};a(K.glTextureWrappers,z),a(K.glBufferWrappers,z),a(K.glFramebufferWrappers,z),a(K.glProgramWrappers,z),a(K.glAttribLocationWrappers,z),a(K.glUniformLocationWrappers,z),K.createTemporaryTextures(),K.pipelines.restoreContext(),K.resize(K.game.scale.baseSize.width,K.game.scale.baseSize.height),J(),K.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),K.emit(i.RESTORE_WEBGL,K),D.preventDefault()},V.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),G.context=N;for(var X=0;X<=27;X++)this.blendModes.push({func:[N.ONE,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_ADD});this.blendModes[1].func=[N.ONE,N.DST_ALPHA],this.blendModes[2].func=[N.DST_COLOR,N.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[N.ONE,N.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[N.ZERO,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_REVERSE_SUBTRACT},this.glFormats=[N.BYTE,N.SHORT,N.UNSIGNED_BYTE,N.UNSIGNED_SHORT,N.FLOAT],this.glFuncMap={mat2:{func:N.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:N.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:N.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:N.uniform1f,length:1},"1fv":{func:N.uniform1fv,length:1},"1i":{func:N.uniform1i,length:1},"1iv":{func:N.uniform1iv,length:1},"2f":{func:N.uniform2f,length:2},"2fv":{func:N.uniform2fv,length:1},"2i":{func:N.uniform2i,length:2},"2iv":{func:N.uniform2iv,length:1},"3f":{func:N.uniform3f,length:3},"3fv":{func:N.uniform3fv,length:1},"3i":{func:N.uniform3i,length:3},"3iv":{func:N.uniform3iv,length:1},"4f":{func:N.uniform4f,length:4},"4fv":{func:N.uniform4fv,length:1},"4i":{func:N.uniform4i,length:4},"4iv":{func:N.uniform4iv,length:1}},(!O.maxTextures||O.maxTextures===-1)&&(O.maxTextures=N.getParameter(N.MAX_TEXTURE_IMAGE_UNITS)),O.maxTextureSize||(O.maxTextureSize=N.getParameter(N.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),N.disable(N.DEPTH_TEST),N.disable(N.CULL_FACE),N.enable(N.BLEND),N.clearColor(j.redGL,j.greenGL,j.blueGL,j.alphaGL);var Y=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return Y.indexOf(O.mipmapFilter)!==-1&&(this.mipmapFilter=N[O.mipmapFilter]),this.maxTextures=g.checkShaderMax(N,O.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(n.BlendModes.NORMAL),this.projectionMatrix=new s().identity(),G.textures.once(p.READY,this.boot,this),this},boot:function(){var O=this.game,N=this.pipelines,G=O.scale.baseSize,V=G.width,j=G.height;this.width=V,this.height=j,this.isBooted=!0,this.renderTarget=new u(this,V,j,1,0,!0,!0),this.maskTarget=new u(this,V,j,1,0,!0,!0),this.maskSource=new u(this,V,j,1,0,!0,!0);var K=O.config;N.boot(K.pipeline,K.defaultPipeline,K.autoMobilePipeline),this.blankTexture=O.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=O.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=O.textures.getFrame("__WHITE").glTexture;var J=this.gl;J.bindFramebuffer(J.FRAMEBUFFER,null),J.enable(J.SCISSOR_TEST),O.scale.on(d.RESIZE,this.onResize,this),this.resize(V,j)},createTemporaryTextures:function(){for(var O=this.gl,N=0;N0&&V>0;if(J&&X){var Y=J[0],D=J[1],z=J[2],W=J[3];X=Y!==O||D!==N||z!==G||W!==V}X&&(this.flush(),K.scissor(O,j-N-V,G,V))},resetScissor:function(){var O=this.gl;O.enable(O.SCISSOR_TEST);var N=this.currentScissor;if(N){var G=N[0],V=N[1],j=N[2],K=N[3];j>0&&K>0&&O.scissor(G,this.drawingBufferHeight-V-K,j,K)}},popScissor:function(){var O=this.scissorStack;O.pop();var N=O[O.length-1];N&&this.setScissor(N[0],N[1],N[2],N[3]),this.currentScissor=N},hasActiveStencilMask:function(){var O=this.currentMask.mask,N=this.currentCameraMask.mask;return O&&O.isStencil||N&&N.isStencil},resetViewport:function(){var O=this.gl;O.viewport(0,0,this.width,this.height),this.drawingBufferHeight=O.drawingBufferHeight},setBlendMode:function(O,N){N===void 0&&(N=!1);var G=this.gl,V=this.blendModes[O];return N||O!==n.BlendModes.SKIP_CHECK&&this.currentBlendMode!==O?(this.flush(),G.enable(G.BLEND),G.blendEquation(V.equation),V.func.length>2?G.blendFuncSeparate(V.func[0],V.func[1],V.func[2],V.func[3]):G.blendFunc(V.func[0],V.func[1]),this.currentBlendMode=O,!0):!1},addBlendMode:function(O,N){var G=this.blendModes.push({func:O,equation:N});return G-1},updateBlendMode:function(O,N,G){return this.blendModes[O]&&(this.blendModes[O].func=N,G&&(this.blendModes[O].equation=G)),this},removeBlendMode:function(O){return O>17&&this.blendModes[O]&&this.blendModes.splice(O,1),this},pushFramebuffer:function(O,N,G,V,j){return O===this.currentFramebuffer?this:(this.fboStack.push(O),this.setFramebuffer(O,N,G,V,j))},setFramebuffer:function(O,N,G,V,j){if(N===void 0&&(N=!1),G===void 0&&(G=!0),V===void 0&&(V=null),j===void 0&&(j=!1),O===this.currentFramebuffer)return this;var K=this.gl,J=this.width,X=this.height;return O&&O.renderTexture&&G?(J=O.renderTexture.width,X=O.renderTexture.height):this.flush(),O?K.bindFramebuffer(K.FRAMEBUFFER,O.webGLFramebuffer):K.bindFramebuffer(K.FRAMEBUFFER,null),G&&K.viewport(0,0,J,X),V&&K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,V.webGLTexture,0),j&&(K.clearColor(0,0,0,0),K.clear(K.COLOR_BUFFER_BIT)),N&&(O?(this.drawingBufferHeight=X,this.pushScissor(0,0,J,X)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=O,this},popFramebuffer:function(O,N){O===void 0&&(O=!1),N===void 0&&(N=!0);var G=this.fboStack;G.pop();var V=G[G.length-1];return V||(V=null),this.setFramebuffer(V,O,N),V},restoreFramebuffer:function(O,N){O===void 0&&(O=!1),N===void 0&&(N=!0);var G=this.fboStack,V=G[G.length-1];V||(V=null),this.currentFramebuffer=null,this.setFramebuffer(V,O,N)},setProgram:function(O){return O!==this.currentProgram?(this.flush(),this.gl.useProgram(O.webGLProgram),this.currentProgram=O,!0):!1},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(O,N,G,V,j){j===void 0&&(j=!1);var K=this.gl,J=K.NEAREST,X=K.NEAREST,Y=K.CLAMP_TO_EDGE,D=null;N=O?O.width:N,G=O?O.height:G;var z=h(N,G);if(z&&!j&&(Y=K.REPEAT),V===n.ScaleModes.LINEAR&&this.config.antialias){var W=O&&O.compressed,H=!W&&z||W&&O.mipmaps.length>1;J=this.mipmapFilter&&H?this.mipmapFilter:K.LINEAR,X=K.LINEAR}return!O&&typeof N=="number"&&typeof G=="number"?D=this.createTexture2D(0,J,X,Y,Y,K.RGBA,null,N,G):D=this.createTexture2D(0,J,X,Y,Y,K.RGBA,O),D},createTexture2D:function(O,N,G,V,j,K,J,X,Y,D,z,W){typeof X!="number"&&(X=J?J.width:1),typeof Y!="number"&&(Y=J?J.height:1);var H=new C(this.gl,O,N,G,V,j,K,J,X,Y,D,z,W);return this.glTextureWrappers.push(H),H},createFramebuffer:function(O,N,G,V){this.currentFramebuffer=null;var j=new M(this.gl,O,N,G,V);return this.glFramebufferWrappers.push(j),j},beginBitmapMask:function(O,N){var G=this.gl;G&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==O&&(this.currentMask.mask=O,this.currentMask.camera=N))},drawBitmapMask:function(O,N,G){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),O.renderWebGL(this,O,N),this.maskSource.unbind(!0),this.maskTarget.unbind();var V=this.gl,j=this.getCurrentStencilMask();j?(V.enable(V.STENCIL_TEST),j.mask.applyStencil(this,j.camera,!0)):this.currentMask.mask=null,this.pipelines.set(G),V.activeTexture(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,this.maskTarget.texture.webGLTexture),V.activeTexture(V.TEXTURE1),V.bindTexture(V.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(O,N){var G=new T(this.gl,O,N);return this.glProgramWrappers.push(G),G},createVertexBuffer:function(O,N){var G=this.gl,V=new x(G,O,G.ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},createAttribLocation:function(O,N){var G=new w(this.gl,O,N);return this.glAttribLocationWrappers.push(G),G},createUniformLocation:function(O,N){var G=new L(this.gl,O,N);return this.glUniformLocationWrappers.push(G),G},createIndexBuffer:function(O,N){var G=this.gl,V=new x(G,O,G.ELEMENT_ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},deleteTexture:function(O){if(O)return v(this.glTextureWrappers,O),O.destroy(),this},deleteFramebuffer:function(O){return O?(v(this.fboStack,O),v(this.glFramebufferWrappers,O),O.destroy(),this):this},deleteProgram:function(O){return O&&(v(this.glProgramWrappers,O),O.destroy()),this},deleteAttribLocation:function(O){return O&&(v(this.glAttribLocationWrappers,O),O.destroy()),this},deleteUniformLocation:function(O){return O&&(v(this.glUniformLocationWrappers,O),O.destroy()),this},deleteBuffer:function(O){return O?(v(this.glBufferWrappers,O),O.destroy(),this):this},preRenderCamera:function(O){var N=O.x,G=O.y,V=O.width,j=O.height,K=O.backgroundColor;if(O.emit(o.PRE_RENDER,O),this.pipelines.preBatchCamera(O),this.pushScissor(N,G,V,j),O.mask&&(this.currentCameraMask.mask=O.mask,this.currentCameraMask.camera=O._maskCamera,O.mask.preRenderWebGL(this,O,O._maskCamera)),K.alphaGL>0){var J=this.pipelines.setMulti();J.drawFillRect(N,G,V,j,g.getTintFromFloats(K.blueGL,K.greenGL,K.redGL,1),K.alphaGL)}},getCurrentStencilMask:function(){var O=null,N=this.maskStack,G=this.currentCameraMask;return N.length>0?O=N[N.length-1]:G.mask&&G.mask.isStencil&&(O=G),O},postRenderCamera:function(O){var N=O.flashEffect,G=O.fadeEffect;if(N.isRunning||G.isRunning||G.isComplete){var V=this.pipelines.setMulti();N.postRenderWebGL(V,g.getTintFromFloats),G.postRenderWebGL(V,g.getTintFromFloats)}O.dirty=!1,this.popScissor(),O.mask&&(this.currentCameraMask.mask=null,O.mask.postRenderWebGL(this,O._maskCamera)),this.pipelines.postBatchCamera(O),O.emit(o.POST_RENDER,O)},preRender:function(){if(!this.contextLost){var O=this.gl;if(O.bindFramebuffer(O.FRAMEBUFFER,null),this.config.clearBeforeRender){var N=this.config.backgroundColor;O.clearColor(N.redGL,N.greenGL,N.blueGL,N.alphaGL),O.clear(O.COLOR_BUFFER_BIT|O.DEPTH_BUFFER_BIT|O.STENCIL_BUFFER_BIT)}O.enable(O.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&O.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(i.PRE_RENDER)}},render:function(O,N,G){if(!this.contextLost){var V=N.length;if(this.emit(i.RENDER,O,G),this.preRenderCamera(G),V===0){this.setBlendMode(n.BlendModes.NORMAL),this.postRenderCamera(G);return}this.currentType="";for(var j=this.currentMask,K=0;K{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95428),o=t(95540),r=t(14500),n=new a({initialize:function(i,h,s,l,f){this.pipeline=i,this.name=h,this.renderer=i.renderer,this.gl=this.renderer.gl,this.fragSrc=l,this.vertSrc=s,this.program=this.renderer.createProgram(s,l),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(f),this.createUniforms()},createAttributes:function(e){var i=0,h=0,s=[];this.vertexComponentCount=0;for(var l=0;l=0?(i.enableVertexAttribArray(M.webGLAttribLocation),i.vertexAttribPointer(M.webGLAttribLocation,p,g,C,s,y),d.enabled=!0,d.location=M):M.webGLAttribLocation!==-1&&i.disableVertexAttribArray(M.webGLAttribLocation)}else x?i.vertexAttribPointer(T.webGLAttribLocation,p,g,C,s,y):!x&&T!==-1&&T.webGLAttribLocation>-1&&(i.disableVertexAttribArray(T.webGLAttribLocation),d.location=-1)}return this},createUniforms:function(){var e=this.gl,i=this.program,h=this.uniforms,s,l,f,u=e.getProgramParameter(i.webGLProgram,e.ACTIVE_UNIFORMS);for(s=0;s0&&(l=l.substr(0,p),h.hasOwnProperty(l)||(f=this.renderer.createUniformLocation(i,l),f!==null&&(h[l]={name:l,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 i in this.uniforms){var h=this.uniforms[i];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 i=this.uniforms[e];return i&&(i.value1=null,i.value2=null,i.value3=null,i.value4=null),this},setUniform1:function(e,i,h,s){var l=this.uniforms[i];return l?((s||l.value1!==h)&&(l.setter||(l.setter=e),l.value1=h,this.renderer.setProgram(this.program),e.call(this.gl,l.location.webGLUniformLocation,h),this.pipeline.currentShader=this),this):this},setUniform2:function(e,i,h,s,l){var f=this.uniforms[i];return f?((l||f.value1!==h||f.value2!==s)&&(f.setter||(f.setter=e),f.value1=h,f.value2=s,this.renderer.setProgram(this.program),e.call(this.gl,f.location.webGLUniformLocation,h,s),this.pipeline.currentShader=this),this):this},setUniform3:function(e,i,h,s,l,f){var u=this.uniforms[i];return u?((f||u.value1!==h||u.value2!==s||u.value3!==l)&&(u.setter||(u.setter=e),u.value1=h,u.value2=s,u.value3=l,this.renderer.setProgram(this.program),e.call(this.gl,u.location.webGLUniformLocation,h,s,l),this.pipeline.currentShader=this),this):this},setUniform4:function(e,i,h,s,l,f,u){var d=this.uniforms[i];return d?((u||d.value1!==h||d.value2!==s||d.value3!==l||d.value4!==f)&&(d.setter||(d.setter=e),d.value1=h,d.value2=s,d.value3=l,d.value4=f,this.renderer.setProgram(this.program),e.call(this.gl,d.location.webGLUniformLocation,h,s,l,f),this.pipeline.currentShader=this),this):this},setBoolean:function(e,i){return this.setUniform1(this.gl.uniform1i,e,Number(i))},set1f:function(e,i){return this.setUniform1(this.gl.uniform1f,e,i)},set2f:function(e,i,h){return this.setUniform2(this.gl.uniform2f,e,i,h)},set3f:function(e,i,h,s){return this.setUniform3(this.gl.uniform3f,e,i,h,s)},set4f:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4f,e,i,h,s,l)},set1fv:function(e,i){return this.setUniform1(this.gl.uniform1fv,e,i,!0)},set2fv:function(e,i){return this.setUniform1(this.gl.uniform2fv,e,i,!0)},set3fv:function(e,i){return this.setUniform1(this.gl.uniform3fv,e,i,!0)},set4fv:function(e,i){return this.setUniform1(this.gl.uniform4fv,e,i,!0)},set1iv:function(e,i){return this.setUniform1(this.gl.uniform1iv,e,i,!0)},set2iv:function(e,i){return this.setUniform1(this.gl.uniform2iv,e,i,!0)},set3iv:function(e,i){return this.setUniform1(this.gl.uniform3iv,e,i,!0)},set4iv:function(e,i){return this.setUniform1(this.gl.uniform4iv,e,i,!0)},set1i:function(e,i){return this.setUniform1(this.gl.uniform1i,e,i)},set2i:function(e,i,h){return this.setUniform2(this.gl.uniform2i,e,i,h)},set3i:function(e,i,h,s){return this.setUniform3(this.gl.uniform3i,e,i,h,s)},set4i:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4i,e,i,h,s,l)},setMatrix2fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix2fv,e,i,h,!0)},setMatrix3fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix3fv,e,i,h,!0)},setMatrix4fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix4fv,e,i,h,!0)},createProgram:function(e,i){return e===void 0&&(e=this.vertSrc),i===void 0&&(i=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=e,this.fragSrc=i,this.program=this.renderer.createProgram(e,i),this.createUniforms(),this.rebind()},destroy:function(){var e=this.renderer;v(this.uniforms,function(i){e.deleteUniformLocation(i.location)}),this.uniforms=null,v(this.attributes,function(i){e.deleteAttribLocation(i.location)}),this.attributes=null,e.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});c.exports=n},14500:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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}};c.exports=m},4159:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(14500),v=t(79291),o={PipelineManager:t(7530),Pipelines:t(96615),RenderTarget:t(32302),Utils:t(70554),WebGLPipeline:t(29100),WebGLRenderer:t(74797),WebGLShader:t(38683),Wrappers:t(9503)};o=v(!1,o,a),c.exports=o},31302:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(78908),r=t(85191),n=t(14500),e=t(29100),i=new a({Extends:e,initialize:function(s){s.fragShader=v(s,"fragShader",o),s.vertShader=v(s,"vertShader",r),s.batchSize=v(s,"batchSize",1),s.vertices=v(s,"vertices",[-1,1,-1,-7,7,1]),s.attributes=v(s,"attributes",[{name:"inPosition",size:2,type:n.FLOAT}]),e.call(this,s)},boot:function(){e.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(h,s){e.prototype.resize.call(this,h,s),this.set2f("uResolution",h,s)},beginMask:function(h,s,l){this.renderer.beginBitmapMask(h,l)},endMask:function(h,s,l){var f=this.gl,u=this.renderer,d=h.bitmapMask;d&&f&&(u.drawBitmapMask(d,s,this),l&&this.set2f("uResolution",l.width,l.height),this.set1i("uInvertMaskAlpha",h.invertAlpha),f.drawArrays(this.topology,0,3),l&&this.set2f("uResolution",this.width,this.height),f.bindTexture(f.TEXTURE_2D,null))}});c.exports=i},92651:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(58918),o=t(14811),r=t(95540),n=t(43558),e=t(89350),i=t(70554),h=new a({Extends:n,initialize:function(l){l.shaders=[i.setGlowQuality(e.FXGlowFrag,l.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,l);var f=this.game;this.glow=new v.Glow(f),this.shadow=new v.Shadow(f),this.pixelate=new v.Pixelate(f),this.vignette=new v.Vignette(f),this.shine=new v.Shine(f),this.gradient=new v.Gradient(f),this.circle=new v.Circle(f),this.barrel=new v.Barrel(f),this.wipe=new v.Wipe(f),this.bokeh=new v.Bokeh(f);var u=[];u[o.GLOW]=this.onGlow,u[o.SHADOW]=this.onShadow,u[o.PIXELATE]=this.onPixelate,u[o.VIGNETTE]=this.onVignette,u[o.SHINE]=this.onShine,u[o.BLUR]=this.onBlur,u[o.GRADIENT]=this.onGradient,u[o.BLOOM]=this.onBloom,u[o.COLOR_MATRIX]=this.onColorMatrix,u[o.CIRCLE]=this.onCircle,u[o.BARREL]=this.onBarrel,u[o.DISPLACEMENT]=this.onDisplacement,u[o.WIPE]=this.onWipe,u[o.BOKEH]=this.onBokeh,this.fxHandlers=u,this.source,this.target,this.swap},onDraw:function(s,l,f){this.source=s,this.target=l,this.swap=f;var u=s.width,d=s.height,p=this.tempSprite,g=this.fxHandlers;if(p&&p.preFX)for(var y=p.preFX.list,x=0;x{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(31063),r=t(57516),n=t(61340),e=t(26099),i=t(29100),h=new a({Extends:r,initialize:function(l){var f=v(l,"fragShader",o);l.fragShader=f.replace("%LIGHT_COUNT%",l.game.renderer.config.maxLights),r.call(this,l),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(){i.prototype.boot.call(this)},onRender:function(s,l){var f=s.sys.lights;if(this.lightsActive=!1,!(!f||!f.active)){var u=f.getLights(l),d=u.length;this.lightsActive=!0;var p,g=this.renderer,y=g.height,x=l.matrix,T=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",l.x,l.y,l.rotation,l.zoom),this.set3f("uAmbientLightColor",f.ambientColor.r,f.ambientColor.g,f.ambientColor.b),this.set1i("uLightCount",d),p=0;p0&&this.flush();var l=this.inverseRotationMatrix;if(s){var f=-s,u=Math.cos(f),d=Math.sin(f);l[1]=d,l[3]=-d,l[0]=l[4]=u}else l[0]=l[4]=1,l[1]=l[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,l),this.currentNormalMapRotation=s}},setTexture2D:function(s,l){var f=this.renderer;s===void 0&&(s=f.whiteTexture);var u=this.getNormalMap(l);this.isNewNormalMap(s,u)&&(this.flush(),this.createBatch(s),this.addTextureToBatch(u),this.currentNormalMap=u);var d=0;if(l&&l.parentContainer){var p=l.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);d=p.rotationNormalized}else l&&(d=l.rotation);return this.setNormalMapRotation(d),0},setGameObject:function(s,l){l===void 0&&(l=s.frame);var f=l.glTexture,u=this.getNormalMap(s);if(this.isNewNormalMap(f,u)&&(this.flush(),this.createBatch(f),this.addTextureToBatch(u),this.currentNormalMap=u),s.parentContainer){var d=s.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(d.rotationNormalized)}else this.setNormalMapRotation(s.rotation);return 0},isNewNormalMap:function(s,l){return this.currentTexture!==s||this.currentNormalMap!==l},getNormalMap:function(s){var l;if(s)s.displayTexture?l=s.displayTexture.dataSource[s.displayFrame.sourceIndex]:s.texture?l=s.texture.dataSource[s.frame.sourceIndex]:s.tileset&&(Array.isArray(s.tileset)?l=s.tileset[0].image.dataSource[0]:l=s.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return l?l.glTexture:this.renderer.normalTexture},batchSprite:function(s,l,f){this.lightsActive&&r.prototype.batchSprite.call(this,s,l,f)},batchTexture:function(s,l,f,u,d,p,g,y,x,T,C,M,w,L,F,O,N,G,V,j,K,J,X,Y,D,z,W,H,Z,Q,k,et){this.lightsActive&&r.prototype.batchTexture.call(this,s,l,f,u,d,p,g,y,x,T,C,M,w,L,F,O,N,G,V,j,K,J,X,Y,D,z,W,H,Z,Q,k,et)},batchTextureFrame:function(s,l,f,u,d,p,g){this.lightsActive&&r.prototype.batchTextureFrame.call(this,s,l,f,u,d,p,g)}});c.exports=h},56527:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(57516),r=t(45561),n=t(60722),e=t(14500),i=t(29100),h=new a({Extends:o,initialize:function(l){l.fragShader=v(l,"fragShader",r),l.vertShader=v(l,"vertShader",n),l.attributes=v(l,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),l.forceZero=!0,l.resizeUniform="uResolution",o.call(this,l)},boot:function(){i.prototype.boot.call(this);var s=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",s.width,s.height),this.set1i("uRoundPixels",s.config.roundPixels)}});c.exports=h},57516:(c,m,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(94811),o=t(95540),r=t(98840),n=t(44667),e=t(61340),i=t(70554),h=t(14500),s=t(29100),l=new a({Extends:s,initialize:function(u){var d=u.game.renderer,p=o(u,"fragShader",r);u.fragShader=i.parseFragmentShaderMaxTextures(p,d.maxTextures),u.vertShader=o(u,"vertShader",n),u.attributes=o(u,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),u.resizeUniform="uResolution",s.call(this,u),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(){s.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,u,d){this.manager.set(this,f);var p=this._tempMatrix1,g=this._tempMatrix2,y=this._tempMatrix3,x=f.frame,T=x.glTexture,C=x.u0,M=x.v0,w=x.u1,L=x.v1,F=x.x,O=x.y,N=x.cutWidth,G=x.cutHeight,V=x.customPivot,j=f.displayOriginX,K=f.displayOriginY,J=-j+F,X=-K+O;if(f.isCropped){var Y=f._crop;(Y.flipX!==f.flipX||Y.flipY!==f.flipY)&&x.updateCropUVs(Y,f.flipX,f.flipY),C=Y.u0,M=Y.v0,w=Y.u1,L=Y.v1,N=Y.width,G=Y.height,F=Y.x,O=Y.y,J=-j+F,X=-K+O}var D=1,z=1;f.flipX&&(V||(J+=-x.realWidth+j*2),D=-1),f.flipY&&(V||(X+=-x.realHeight+K*2),z=-1);var W=f.x,H=f.y;g.applyITRS(W,H,f.rotation,f.scaleX*D,f.scaleY*z),p.copyFrom(u.matrix),d?(p.multiplyWithOffset(d,-u.scrollX*f.scrollFactorX,-u.scrollY*f.scrollFactorY),g.e=W,g.f=H):(g.e-=u.scrollX*f.scrollFactorX,g.f-=u.scrollY*f.scrollFactorY),p.multiply(g,y);var Z=y.setQuad(J,X,J+N,X+G),Q=i.getTintAppendFloatAlpha,k=u.alpha,et=Q(f.tintTopLeft,k*f._alphaTL),st=Q(f.tintTopRight,k*f._alphaTR),rt=Q(f.tintBottomLeft,k*f._alphaBL),ot=Q(f.tintBottomRight,k*f._alphaBR);this.shouldFlush(6)&&this.flush();var dt=this.setGameObject(f,x);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",u.roundPixels),this.batchQuad(f,Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],C,M,w,L,et,st,rt,ot,f.tintFill,T,dt),this.manager.postBatch(f)},batchTexture:function(f,u,d,p,g,y,x,T,C,M,w,L,F,O,N,G,V,j,K,J,X,Y,D,z,W,H,Z,Q,k,et,st,rt,ot){ot===void 0&&(ot=!1),this.manager.set(this,f);var dt=this._tempMatrix1,at=this._tempMatrix2,pt=this._tempMatrix3,Pt=j/d+Z,Ct=K/p+Q,Et=(j+J)/d+Z,vt=(K+X)/p+Q,St=x,gt=T,Mt=-G,It=-V;if(f.isCropped){var Kt=f._crop,Gt=Kt.width,Wt=Kt.height;St=Gt,gt=Wt,x=Gt,T=Wt,j=Kt.x,K=Kt.y;var Bt=j,ie=K;L&&(Bt=J-Kt.x-Gt),F&&(ie=X-Kt.y-Wt),Pt=Bt/d+Z,Ct=ie/p+Q,Et=(Bt+Gt)/d+Z,vt=(ie+Wt)/p+Q,Mt=-G+j,It=-V+K}F=F^(!st&&u.isRenderTexture?1:0),L&&(St*=-1,Mt+=x),F&&(gt*=-1,It+=T),at.applyITRS(g,y,w,C,M),dt.copyFrom(k.matrix),et?(dt.multiplyWithOffset(et,-k.scrollX*O,-k.scrollY*N),at.e=g,at.f=y):(at.e-=k.scrollX*O,at.f-=k.scrollY*N),dt.multiply(at,pt);var Zt=pt.setQuad(Mt,It,Mt+St,It+gt);rt==null&&(rt=this.setTexture2D(u)),f&&!ot&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",k.roundPixels),this.batchQuad(f,Zt[0],Zt[1],Zt[2],Zt[3],Zt[4],Zt[5],Zt[6],Zt[7],Pt,Ct,Et,vt,Y,D,z,W,H,u,rt),f&&!ot&&this.manager.postBatch(f)},batchTextureFrame:function(f,u,d,p,g,y,x){this.manager.set(this);var T=this._tempMatrix1.copyFrom(y),C=this._tempMatrix2;x?T.multiply(x,C):C=T;var M=C.setQuad(u,d,u+f.width,d+f.height),w=this.setTexture2D(f.source.glTexture);p=i.getTintAppendFloatAlpha(p,g),this.batchQuad(null,M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],f.u0,f.v0,f.u1,f.v1,p,p,p,p,0,f.glTexture,w)},batchFillRect:function(f,u,d,p,g,y){this.renderer.pipelines.set(this);var x=this.calcMatrix;y&&y.multiply(g,x);var T=x.setQuad(f,u,f+d,u+p),C=this.fillTint;this.batchQuad(null,T[0],T[1],T[2],T[3],T[4],T[5],T[6],T[7],0,0,1,1,C.TL,C.TR,C.BL,C.BR,2)},batchFillTriangle:function(f,u,d,p,g,y,x,T){this.renderer.pipelines.set(this);var C=this.calcMatrix;T&&T.multiply(x,C);var M=C.getX(f,u),w=C.getY(f,u),L=C.getX(d,p),F=C.getY(d,p),O=C.getX(g,y),N=C.getY(g,y),G=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,M,w,L,F,O,N,0,0,1,1,G.TL,G.TR,G.BL,2)},batchStrokeTriangle:function(f,u,d,p,g,y,x,T,C){var M=this.tempTriangle;M[0].x=f,M[0].y=u,M[0].width=x,M[1].x=d,M[1].y=p,M[1].width=x,M[2].x=g,M[2].y=y,M[2].width=x,M[3].x=f,M[3].y=u,M[3].width=x,this.batchStrokePath(M,x,!1,T,C)},batchFillPath:function(f,u,d){this.renderer.pipelines.set(this);var p=this.calcMatrix;d&&d.multiply(u,p);for(var g=f.length,y=this.polygonCache,x,T,C=this.fillTint.TL,M=this.fillTint.TR,w=this.fillTint.BL,L=0;L0&&St[4]?this.batchQuad(null,dt,at,et,st,St[0],St[1],St[2],St[3],0,0,1,1,Pt,Ct,Et,vt,2):(gt[0]=dt,gt[1]=at,gt[2]=et,gt[3]=st,gt[4]=1),C&>[4]?this.batchQuad(null,Q,k,rt,ot,gt[0],gt[1],gt[2],gt[3],0,0,1,1,Pt,Ct,Et,vt,2):(St[0]=Q,St[1]=k,St[2]=rt,St[3]=ot,St[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,s.prototype.destroy.call(this),this}});c.exports=l},43439:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(4127),r=t(89924),n=t(29100),e=new a({Extends:n,initialize:function(h){h.vertShader=v(h,"vertShader",r),h.fragShader=v(h,"fragShader",o),h.attributes=v(h,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),n.call(this,h)},onRender:function(i,h){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",h.zoom)},batchPointLight:function(i,h,s,l,f,u,d,p,g,y,x,T){var C=i.color,M=i.intensity,w=i.radius,L=i.attenuation,F=C.r*M,O=C.g*M,N=C.b*M,G=h.alpha*i.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(s,l,x,T,w,L,F,O,N,G),this.batchLightVert(f,u,x,T,w,L,F,O,N,G),this.batchLightVert(d,p,x,T,w,L,F,O,N,G),this.batchLightVert(s,l,x,T,w,L,F,O,N,G),this.batchLightVert(d,p,x,T,w,L,F,O,N,G),this.batchLightVert(g,y,x,T,w,L,F,O,N,G),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(i,h,s,l,f,u,d,p,g,y){var x=this.vertexViewF32,T=this.vertexCount*this.currentShader.vertexComponentCount-1;x[++T]=i,x[++T]=h,x[++T]=s,x[++T]=l,x[++T]=f,x[++T]=u,x[++T]=d,x[++T]=p,x[++T]=g,x[++T]=y,this.vertexCount++}});c.exports=e},84057:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(89422),o=t(95540),r=t(27681),n=t(49627),e=t(29100),i=new a({Extends:e,initialize:function(s){s.renderTarget=o(s,"renderTarget",1),s.fragShader=o(s,"fragShader",r),s.vertShader=o(s,"vertShader",n),s.attributes=o(s,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),s.batchSize=1,s.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,s),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new v,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 s=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",s.width,s.height),this.set1i("uRoundPixels",s.config.roundPixels);for(var l=this.renderTargets,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(67502),o=t(83419),r=t(96293),n=t(95540),e=t(57516),i=t(27681),h=t(87841),s=t(32302),l=t(45561),f=t(60722),u=t(29100),d=new o({Extends:e,initialize:function(g){var y=n(g,"fragShader",i),x=n(g,"vertShader",f),T=n(g,"drawShader",i),C=[{name:"DrawSprite",fragShader:l,vertShader:f},{name:"CopySprite",fragShader:y,vertShader:x},{name:"DrawGame",fragShader:T,vertShader:f},{name:"ColorMatrix",fragShader:r}],M=n(g,"shaders",[]);g.shaders=C.concat(M),g.vertShader||(g.vertShader=x),g.batchSize=1,e.call(this,g),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(){u.prototype.boot.call(this);var p=this.shaders,g=this.renderer;this.drawSpriteShader=p[0],this.copyShader=p[1],this.gameShader=p[2],this.colorMatrixShader=p[3],this.fsTarget=new s(g,g.width,g.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var y=new ArrayBuffer(168);this.quadVertexData=y,this.quadVertexViewF32=new Float32Array(y),this.quadVertexBuffer=g.createVertexBuffer(y,this.gl.STATIC_DRAW),this.onResize(g.width,g.height),this.currentShader=this.copyShader,this.set2f("uResolution",g.width,g.height),this.set1i("uRoundPixels",g.config.roundPixels)},onResize:function(p,g){var y=this.quadVertexViewF32;y[1]=g,y[22]=g,y[14]=p,y[28]=p,y[35]=p,y[36]=g},batchQuad:function(p,g,y,x,T,C,M,w,L,F,O,N,G,V,j,K,J,X,Y){var D=Math.min(g,x,C,w),z=Math.min(y,T,M,L),W=Math.max(g,x,C,w),H=Math.max(y,T,M,L),Z=W-D,Q=H-z,k=this.spriteBounds.setTo(D,z,Z,Q),et=p?p.preFX.padding:0,st=Z+et*2,rt=Q+et*2,ot=Math.abs(Math.max(st,rt)),dt=this.manager.getRenderTarget(ot),at=this.targetBounds.setTo(0,0,dt.width,dt.height);v(at,k.centerX,k.centerY),this.tempSprite=p;var pt=this.gl,Pt=this.renderer;Pt.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",Pt.width,Pt.height),this.set1i("uRoundPixels",Pt.config.roundPixels),this.flipProjectionMatrix(!0),p&&(this.onDrawSprite(p,dt),p.preFX.onFX(this));var Ct=this.fsTarget;return this.flush(),pt.viewport(0,0,Pt.width,Pt.height),pt.bindFramebuffer(pt.FRAMEBUFFER,Ct.framebuffer.webGLFramebuffer),pt.framebufferTexture2D(pt.FRAMEBUFFER,pt.COLOR_ATTACHMENT0,pt.TEXTURE_2D,Ct.texture.webGLTexture,0),pt.clearColor(0,0,0,0),pt.clear(pt.COLOR_BUFFER_BIT),this.setTexture2D(Y),this.batchVert(g,y,F,O,0,X,V),this.batchVert(x,T,F,G,0,X,K),this.batchVert(C,M,N,G,0,X,J),this.batchVert(g,y,F,O,0,X,V),this.batchVert(C,M,N,G,0,X,J),this.batchVert(w,L,N,O,0,X,j),this.flush(),this.flipProjectionMatrix(!1),pt.activeTexture(pt.TEXTURE0),pt.bindTexture(pt.TEXTURE_2D,dt.texture.webGLTexture),pt.copyTexSubImage2D(pt.TEXTURE_2D,0,0,0,at.x,at.y,at.width,at.height),pt.bindFramebuffer(pt.FRAMEBUFFER,null),pt.bindTexture(pt.TEXTURE_2D,null),this.onBatch(p),this.currentShader=this.copyShader,this.onDraw(dt,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(p,g,y,x,T,C,M){y===void 0&&(y=!0),x===void 0&&(x=!0),T===void 0&&(T=!1),M===void 0&&(M=this.copyShader);var w=this.gl,L=this.tempSprite;C&&(M=this.colorMatrixShader),this.currentShader=M;var F=this.setVertexBuffer(this.quadVertexBuffer);M.bind(F,!1);var O=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",O.width,O.height),this.set1i("uRoundPixels",O.config.roundPixels),L.preFX.onFXCopy(this),this.onCopySprite(p,g,L),C&&(this.set1fv("uColorMatrix",C.getData()),this.set1f("uAlpha",C.alpha)),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,p.texture.webGLTexture),p.height>g.height)w.viewport(0,0,p.width,p.height),this.setTargetUVs(p,g);else{var N=g.height-p.height;w.viewport(0,N,p.width,p.height),this.resetUVs()}if(w.bindFramebuffer(w.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,g.texture.webGLTexture,0),y&&(w.clearColor(0,0,0,+!x),w.clear(w.COLOR_BUFFER_BIT)),T){var G=this.renderer.currentBlendMode;this.renderer.setBlendMode(a.ERASE)}w.bufferData(w.ARRAY_BUFFER,this.quadVertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),T&&this.renderer.setBlendMode(G),w.bindFramebuffer(w.FRAMEBUFFER,null)},copy:function(p,g){var y=this.gl;this.set1i("uMainSampler",0),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,p.texture.webGLTexture),y.viewport(0,0,p.width,p.height),this.setUVs(0,0,0,1,1,1,1,0),y.bindFramebuffer(y.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,g.texture.webGLTexture,0),y.clearColor(0,0,0,0),y.clear(y.COLOR_BUFFER_BIT),y.bufferData(y.ARRAY_BUFFER,this.quadVertexData,y.STATIC_DRAW),y.drawArrays(y.TRIANGLES,0,6),y.bindFramebuffer(y.FRAMEBUFFER,null)},blendFrames:function(p,g,y,x,T){this.manager.blendFrames(p,g,y,x,T)},blendFramesAdditive:function(p,g,y,x,T){this.manager.blendFramesAdditive(p,g,y,x,T)},drawToGame:function(p){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(p)},copyToGame:function(p){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(p)},bindAndDraw:function(p){var g=this.gl,y=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(p.texture);var x=this._tempMatrix1.loadIdentity(),T=this.targetBounds.x,C=this.targetBounds.y,M=T+p.width,w=C+p.height,L=x.getX(T,C),F=x.getX(T,w),O=x.getX(M,w),N=x.getX(M,C),G=x.getY(T,C),V=x.getY(T,w),j=x.getY(M,w),K=x.getY(M,C),J=16777215;this.batchVert(L,G,0,0,0,0,J),this.batchVert(F,V,0,1,0,0,J),this.batchVert(O,j,1,1,0,0,J),this.batchVert(L,G,0,0,0,0,J),this.batchVert(O,j,1,1,0,0,J),this.batchVert(N,K,1,0,0,0,J),y.restoreFramebuffer(!1,!0),y.currentFramebuffer||g.viewport(0,0,y.width,y.height),y.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(p){this.drawToGame(p)},setUVs:function(p,g,y,x,T,C,M,w){var L=this.quadVertexViewF32;L[2]=p,L[3]=g,L[9]=y,L[10]=x,L[16]=T,L[17]=C,L[23]=p,L[24]=g,L[30]=T,L[31]=C,L[37]=M,L[38]=w},setTargetUVs:function(p,g){var y=g.height/p.height;y>.5?y=.5-(y-.5):y=.5+(.5-y),this.setUVs(0,y,0,1+y,1,1+y,1,y)},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}});c.exports=d},81041:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(57516),r=new a({Extends:o,initialize:function(e){e.topology=5,e.batchSize=v(e,"batchSize",256),o.call(this,e)}});c.exports=r},12385:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(57516),r=t(45561),n=t(60722),e=t(29100),i=new a({Extends:o,initialize:function(s){s.fragShader=v(s,"fragShader",r),s.vertShader=v(s,"vertShader",n),s.forceZero=!0,o.call(this,s)},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)}});c.exports=i},7589:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35407),v=t(10312),o=t(83419),r=t(89422),n=t(96293),e=t(36682),i=t(95540),h=t(48247),s=t(49627),l=t(29100),f=new o({Extends:l,initialize:function(d){d.renderTarget=i(d,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),d.vertShader=i(d,"vertShader",s),d.shaders=i(d,"shaders",[{name:"Copy",fragShader:e},{name:"AddBlend",fragShader:a},{name:"LinearBlend",fragShader:h},{name:"ColorMatrix",fragShader:n}]),d.attributes=i(d,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),d.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],d.batchSize=1,l.call(this,d),this.colorMatrix=new r,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){l.prototype.boot.call(this);var u=this.shaders,d=this.renderTargets;this.copyShader=u[0],this.addShader=u[1],this.linearShader=u[2],this.colorMatrixShader=u[3],this.fullFrame1=d[0],this.fullFrame2=d[1],this.halfFrame1=d[2],this.halfFrame2=d[3]},copyFrame:function(u,d,p,g,y){p===void 0&&(p=1),g===void 0&&(g=!0),y===void 0&&(y=!0);var x=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,u.texture.webGLTexture),d?(x.viewport(0,0,d.width,d.height),x.bindFramebuffer(x.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,d.texture.webGLTexture,0)):x.viewport(0,0,u.width,u.height),g&&(y?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)},blitFrame:function(u,d,p,g,y,x,T){p===void 0&&(p=1),g===void 0&&(g=!0),y===void 0&&(y=!0),x===void 0&&(x=!1),T===void 0&&(T=!1);var C=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,u.texture.webGLTexture),u.height>d.height)C.viewport(0,0,u.width,u.height),this.setTargetUVs(u,d);else{var M=d.height-u.height;C.viewport(0,M,u.width,u.height)}if(C.bindFramebuffer(C.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,d.texture.webGLTexture,0),g&&(y?C.clearColor(0,0,0,0):C.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT)),x){var w=this.renderer.currentBlendMode;this.renderer.setBlendMode(v.ERASE)}T&&this.flipY(),C.bufferData(C.ARRAY_BUFFER,this.vertexData,C.STATIC_DRAW),C.drawArrays(C.TRIANGLES,0,6),x&&this.renderer.setBlendMode(w),C.bindFramebuffer(C.FRAMEBUFFER,null),C.bindTexture(C.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(u,d,p,g,y,x,T,C){T===void 0&&(T=!0),C===void 0&&(C=!0);var M=this.gl;M.bindFramebuffer(M.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,u.texture.webGLTexture,0),T&&(C?M.clearColor(0,0,0,0):M.clearColor(0,0,0,1),M.clear(M.COLOR_BUFFER_BIT)),M.activeTexture(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,d.texture.webGLTexture),M.copyTexSubImage2D(M.TEXTURE_2D,0,0,0,p,g,y,x),M.bindFramebuffer(M.FRAMEBUFFER,null),M.bindTexture(M.TEXTURE_2D,null)},copyToGame:function(u){var d=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,u.texture.webGLTexture),d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.STATIC_DRAW),d.drawArrays(d.TRIANGLES,0,6)},drawFrame:function(u,d,p,g){p===void 0&&(p=!0),g===void 0&&(g=this.colorMatrix);var y=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",g.getData()),this.set1f("uAlpha",g.alpha),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,u.texture.webGLTexture),d?(y.viewport(0,0,d.width,d.height),y.bindFramebuffer(y.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,d.texture.webGLTexture,0)):y.viewport(0,0,u.width,u.height),p?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)},blendFrames:function(u,d,p,g,y,x){g===void 0&&(g=1),y===void 0&&(y=!0),x===void 0&&(x=this.linearShader);var T=this.gl;this.setShader(x),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",g),T.activeTexture(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,u.texture.webGLTexture),T.activeTexture(T.TEXTURE1),T.bindTexture(T.TEXTURE_2D,d.texture.webGLTexture),p?(T.bindFramebuffer(T.FRAMEBUFFER,p.framebuffer.webGLFramebuffer),T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_2D,p.texture.webGLTexture,0),T.viewport(0,0,p.width,p.height)):T.viewport(0,0,u.width,u.height),y?T.clearColor(0,0,0,0):T.clearColor(0,0,0,1),T.clear(T.COLOR_BUFFER_BIT),T.bufferData(T.ARRAY_BUFFER,this.vertexData,T.STATIC_DRAW),T.drawArrays(T.TRIANGLES,0,6),T.bindFramebuffer(T.FRAMEBUFFER,null),T.bindTexture(T.TEXTURE_2D,null)},blendFramesAdditive:function(u,d,p,g,y){this.blendFrames(u,d,p,g,y,this.addShader)},clearFrame:function(u,d){d===void 0&&(d=!0);var p=this.gl;p.viewport(0,0,u.width,u.height),p.bindFramebuffer(p.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),d?p.clearColor(0,0,0,0):p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT);var g=this.renderer.currentFramebuffer;p.bindFramebuffer(p.FRAMEBUFFER,g.webGLFramebuffer)},setUVs:function(u,d,p,g,y,x,T,C){var M=this.vertexViewF32;M[2]=u,M[3]=d,M[6]=p,M[7]=g,M[10]=y,M[11]=x,M[14]=u,M[15]=d,M[18]=y,M[19]=x,M[22]=T,M[23]=C},setTargetUVs:function(u,d){var p=d.height/u.height;p>.5?p=.5-(p-.5):p=.5+(.5-p),this.setUVs(0,p,0,1+p,1,1+p,1,p)},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)}});c.exports=f},36060:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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"};c.exports=m},84817:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelineafterflush"},36712:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelinebeforeflush"},40285:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelinebind"},65918:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelineboot"},92852:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelinedestroy"},56072:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelinerebind"},57566:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pipelineresize"},77085:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(99155),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),this.amount=1},onPreRender:function(n,e){n=this.getController(n),this.set1f("amount",n.amount,e)}});c.exports=r},67329:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(24400),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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(),i=this.fullFrame1,h=this.fullFrame2;this.copyFrame(n,h);for(var s=2/n.width*e.offsetX,l=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 a=t(83419),v=t(41514),o=t(51078),r=t(94328),n=t(84057),e=new a({Extends:n,initialize:function(h){n.call(this,{game:h,shaders:[{name:"Gaussian5",fragShader:v},{name:"Gaussian9",fragShader:o},{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(i){var h=this.getController(),s=this.gl,l=this.fullFrame1,f=s.getParameter(s.FRAMEBUFFER_BINDING);this.bind(this.shaders[h.quality]),s.activeTexture(s.TEXTURE0),s.viewport(0,0,i.width,i.height),this.set1i("uMainSampler",0),this.set2f("resolution",i.width,i.height),this.set1f("strength",h.strength),this.set3fv("color",h.glcolor);for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(90610),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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,i,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),i&&h&&this.set2f("resolution",i,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});c.exports=r},89428:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(91899),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(n,e,i,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),i&&h&&this.set2f("resolution",i,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});c.exports=r},88904:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(84057),o=new a({Extends:v,initialize:function(n){v.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)}});c.exports=o},63563:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(47838),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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(),i=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,i),this.copyToGame(i)}});c.exports=r},94045:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=t(98656),r=t(84057),n=t(70554),e=new a({Extends:r,initialize:function(h,s){var l=v(s,"quality",.1),f=v(s,"distance",10);r.call(this,{game:h,fragShader:n.setGlowQuality(o,h,l,f)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(i,h,s,l){i=this.getController(i),this.set1f("outerStrength",i.outerStrength,h),this.set1f("innerStrength",i.innerStrength,h),this.set4fv("glowColor",i.glcolor,h),this.setBoolean("knockout",i.knockout,h),s&&l&&this.set2f("resolution",s,l,h)},onDraw:function(i){this.set2f("resolution",i.width,i.height),this.bindAndDraw(i)}});c.exports=e},74088:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(70463),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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)}});c.exports=r},99636:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50831),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),this.amount=1},onPreRender:function(n,e,i,h){n=this.getController(n),this.set1f("amount",n.amount,e),i&&h&&this.set2f("resolution",i,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});c.exports=r},34700:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(92595),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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 i=n.samples;this.set1i("samples",i,e),this.set1f("intensity",n.intensity,e),this.set1f("decay",n.decay,e),this.set1f("power",n.power/i,e),this.set2f("lightPosition",n.x,n.y,e),this.set4fv("color",n.glcolor,e)}});c.exports=r},91157:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(72464),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(n,e,i,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),i&&h&&this.set2f("resolution",i,h,e)},onDraw:function(n){this.set2f("resolution",n.width,n.height),this.bindAndDraw(n)}});c.exports=r},27797:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(39249),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),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)}});c.exports=r},67603:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(2878),o=t(84057),r=new a({Extends:o,initialize:function(e){o.call(this,{game:e,fragShader:v}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(n,e){n=this.getController(n);var i=n.progress,h=n.wipeWidth,s=n.direction,l=n.axis;this.set4f("config",i,h,s,l,e),this.setBoolean("reveal",n.reveal,e)}});c.exports=r},58918:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={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)};c.exports=a},96615:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(36060),v=t(79291),o={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)};o=v(!1,o,a),c.exports=o},35407:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:c=>{c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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 o=this.gl;o.isContextLost()||(this.webGLAttribLocation=o.getAttribLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});c.exports=v},26128:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i){this.webGLBuffer=null,this.gl=r,this.initialDataOrSize=n,this.bufferType=e,this.bufferUsage=i,this.createResource()},createResource:function(){if(this.initialDataOrSize!==null){var o=this.gl;if(!o.isContextLost()){var r=this.bufferType,n=o.createBuffer();this.webGLBuffer=n,o.bindBuffer(r,this.webGLBuffer),o.bufferData(r,this.initialDataOrSize,this.bufferUsage),o.bindBuffer(r,null)}}},destroy:function(){var o=this.gl;o.isContextLost()||o.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});c.exports=v},84387:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},o=new a({initialize:function(n,e,i,h,s){this.webGLFramebuffer=null,this.gl=n,this.width=e,this.height=i,this.renderTexture=h,this.addDepthStencilBuffer=!!s,this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){var n=this.renderTexture,e=0,i=r.createFramebuffer();if(this.webGLFramebuffer=i,r.bindFramebuffer(r.FRAMEBUFFER,i),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: "+(v[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}}});c.exports=o},1482:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e){this.webGLProgram=null,this.gl=r,this.vertexSource=n,this.fragmentSource=e,this.createResource()},createResource:function(){var o=this.gl;if(!o.isContextLost()){var r=o.createProgram(),n=o.createShader(o.VERTEX_SHADER),e=o.createShader(o.FRAGMENT_SHADER);o.shaderSource(n,this.vertexSource),o.shaderSource(e,this.fragmentSource),o.compileShader(n),o.compileShader(e);var i=`Shader failed: -`;if(!o.getShaderParameter(n,o.COMPILE_STATUS))throw new Error("Vertex "+i+o.getShaderInfoLog(n));if(!o.getShaderParameter(e,o.COMPILE_STATUS))throw new Error("Fragment "+i+o.getShaderInfoLog(e));if(o.attachShader(r,n),o.attachShader(r,e),o.linkProgram(r),!o.getProgramParameter(r,o.LINK_STATUS))throw new Error("Link "+i+o.getProgramInfoLog(r));o.useProgram(r),this.webGLProgram=r}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});c.exports=v},82751:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50030),o=new a({initialize:function(n,e,i,h,s,l,f,u,d,p,g,y,x){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=n,this.mipLevel=e,this.minFilter=i,this.magFilter=h,this.wrapT=s,this.wrapS=l,this.format=f,this.pixels=u,this.width=d,this.height=p,this.pma=g??!0,this.forceSize=!!y,this.flipY=!!x,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){if(this.pixels instanceof o){this.webGLTexture=this.pixels.webGLTexture;return}var n=r.createTexture();n.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=n,this._processTexture()}},update:function(r,n,e,i,h,s,l,f,u){if(!(n===0||e===0)){this.pixels=r,this.width=n,this.height=e,this.flipY=i,this.wrapS=h,this.wrapT=s,this.minFilter=l,this.magFilter=f,this.format=u;var d=this.gl;d.isContextLost()||this._processTexture()}},_processTexture:function(){var r=this.gl;r.activeTexture(r.TEXTURE0);var n=r.getParameter(r.TEXTURE_BINDING_2D);r.bindTexture(r.TEXTURE_2D,this.webGLTexture),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),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flipY);var e=this.pixels,i=this.mipLevel,h=this.width,s=this.height,l=this.format,f=!1;if(e==null)r.texImage2D(r.TEXTURE_2D,i,l,h,s,0,l,r.UNSIGNED_BYTE,null),f=v(h,s);else if(e.compressed){h=e.width,s=e.height,f=e.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 a=t(83419),v=new a({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 o=this.gl;o.isContextLost()||(this.webGLUniformLocation=o.getUniformLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});c.exports=v},9503:(c,m,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={WebGLAttribLocationWrapper:t(93567),WebGLBufferWrapper:t(26128),WebGLProgramWrapper:t(1482),WebGLTextureWrapper:t(82751),WebGLFramebufferWrapper:t(84387),WebGLUniformLocationWrapper:t(57183)};c.exports=a},76531:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(13560),v=t(83419),o=t(50792),r=t(97480),n=t(8443),e=t(57811),i=t(74403),h=t(45818),s=t(29747),l=t(87841),f=t(86555),u=t(56583),d=t(26099),p=t(38058),g=new v({Extends:o,initialize:function(x){o.call(this),this.game=x,this.canvas,this.canvasBounds=new l,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=a.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new d(1,1),this.autoRound=!1,this.autoCenter=a.CENTER.NO_CENTER,this.orientation=a.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:s,windowResize:s,fullScreenChange:s,fullScreenError:s}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(n.BOOT,this.boot,this)},boot:function(){var y=this.game;this.canvas=y.canvas,this.fullscreen=y.device.fullscreen,this.scaleMode!==a.SCALE_MODE.RESIZE&&this.scaleMode!==a.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===a.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()),y.events.on(n.PRE_STEP,this.step,this),y.events.once(n.READY,this.refresh,this),y.events.once(n.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(y){this.getParent(y),this.getParentBounds();var x=y.width,T=y.height,C=y.scaleMode,M=y.zoom,w=y.autoRound;if(typeof x=="string")if(x.substr(-1)!=="%")x=parseInt(x,10);else{var L=this.parentSize.width;L===0&&(L=window.innerWidth);var F=parseInt(x,10)/100;x=Math.floor(L*F)}if(typeof T=="string")if(T.substr(-1)!=="%")T=parseInt(T,10);else{var O=this.parentSize.height;O===0&&(O=window.innerHeight);var N=parseInt(T,10)/100;T=Math.floor(O*N)}this.scaleMode=C,this.autoRound=w,this.autoCenter=y.autoCenter,this.resizeInterval=y.resizeInterval,w&&(x=Math.floor(x),T=Math.floor(T)),this.gameSize.setSize(x,T),M===a.ZOOM.MAX_ZOOM&&(M=this.getMaxZoom()),this.zoom=M,M!==1&&(this._resetZoom=!0),this.baseSize.setSize(x,T),w&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),y.minWidth>0&&this.displaySize.setMin(y.minWidth*M,y.minHeight*M),y.maxWidth>0&&this.displaySize.setMax(y.maxWidth*M,y.maxHeight*M),this.displaySize.setSize(x,T),(y.snapWidth>0||y.snapHeight>0)&&this.displaySize.setSnap(y.snapWidth,y.snapHeight),this.orientation=h(x,T)},getParent:function(y){var x=y.parent;if(x!==null){if(this.parent=i(x),this.parentIsWindow=this.parent===document.body,y.expandParent&&y.scaleMode!==a.SCALE_MODE.NONE){var T=this.parent.getBoundingClientRect();(this.parentIsWindow||T.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",T=this.parent.getBoundingClientRect(),!this.parentIsWindow&&T.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}y.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=i(y.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var y=this.parentSize,x=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(x.height=e(!0));var T=x.width,C=x.height;if(y.width!==T||y.height!==C)return y.setSize(T,C),!0;if(this.canvas){var M=this.canvasBounds,w=this.canvas.getBoundingClientRect();if(w.x!==M.x||w.y!==M.y)return!0}return!1},lockOrientation:function(y){var x=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return x?x.call(screen,y):!1},setParentSize:function(y,x){return this.parentSize.setSize(y,x),this.refresh()},setGameSize:function(y,x){var T=this.autoRound;T&&(y=Math.floor(y),x=Math.floor(x));var C=this.width,M=this.height;return this.gameSize.resize(y,x),this.baseSize.resize(y,x),T&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(y/x),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(C,M)},resize:function(y,x){var T=this.zoom,C=this.autoRound;C&&(y=Math.floor(y),x=Math.floor(x));var M=this.width,w=this.height;this.gameSize.resize(y,x),this.baseSize.resize(y,x),C&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(y*T,x*T),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var L=this.canvas.style,F=y*T,O=x*T;return C&&(F=Math.floor(F),O=Math.floor(O)),(F!==y||O!==x)&&(L.width=F+"px",L.height=O+"px"),this.refresh(M,w)},setZoom:function(y){return this.zoom=y,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(y,x){return y===void 0&&(y=0),x===void 0&&(x=y),this.displaySize.setSnap(y,x),this.refresh()},refresh:function(y,x){y===void 0&&(y=this.width),x===void 0&&(x=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var T=this.game.domContainer;if(T){this.baseSize.setCSS(T);var C=this.canvas.style,M=T.style;M.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",M.marginLeft=C.marginLeft,M.marginTop=C.marginTop}return this.emit(r.RESIZE,this.gameSize,this.baseSize,this.displaySize,y,x),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var y=h(this.width,this.height);y!==this.orientation&&(this.orientation=y,this.emit(r.ORIENTATION_CHANGE,y))}},updateScale:function(){var y=this.canvas.style,x=this.gameSize.width,T=this.gameSize.height,C,M,w=this.zoom,L=this.autoRound;if(this.scaleMode===a.SCALE_MODE.NONE)this.displaySize.setSize(x*w,T*w),C=this.displaySize.width,M=this.displaySize.height,L&&(C=Math.floor(C),M=Math.floor(M)),this._resetZoom&&(y.width=C+"px",y.height=M+"px",this._resetZoom=!1);else if(this.scaleMode===a.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),C=this.displaySize.width,M=this.displaySize.height,L&&(C=Math.floor(C),M=Math.floor(M)),this.canvas.width=C,this.canvas.height=M;else if(this.scaleMode===a.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),C=this.displaySize.width,M=this.displaySize.height,L&&(C=Math.floor(C),M=Math.floor(M)),y.width=C+"px",y.height=M+"px";var F=this.parentSize.width/this.gameSize.width,O=this.parentSize.height/this.gameSize.height;F=0?0:-(M.x*w.x),F=M.y>=0?0:-(M.y*w.y),O;C.width>=M.width?O=T.width:O=T.width-(M.width-C.width)*w.x;var N;return C.height>=M.height?N=T.height:N=T.height-(M.height-C.height)*w.y,x.setTo(L,F,O,N),y&&(x.width/=y.zoomX,x.height/=y.zoomY,x.centerX=y.centerX+y.scrollX,x.centerY=y.centerY+y.scrollY),x},step:function(y,x){this.parent&&(this._lastCheck+=x,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var y=this.domlisteners;window.removeEventListener("orientationchange",y.orientationChange,!1),window.removeEventListener("resize",y.windowResize,!1);var x=["webkit","moz",""];x.forEach(function(T){document.removeEventListener(T+"fullscreenchange",y.fullScreenChange,!1),document.removeEventListener(T+"fullscreenerror",y.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",y.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",y.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===a.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===a.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});c.exports=g},64743:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={CENTER:t(64743),ORIENTATION:t(39218),SCALE_MODE:t(81050),ZOOM:t(80805)};c.exports=a},56139:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="enterfullscreen"},2336:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="fullscreenfailed"},47412:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="fullscreenunsupported"},51452:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="leavefullscreen"},20666:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="orientationchange"},47945:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resize"},97480:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79291),v=t(13560),o={Center:t(64743),Events:t(97480),Orientation:t(39218),ScaleManager:t(76531),ScaleModes:t(81050),Zoom:t(80805)};o=a(!1,o,v.CENTER),o=a(!1,o,v.ORIENTATION),o=a(!1,o,v.SCALE_MODE),o=a(!1,o,v.ZOOM),c.exports=o},27397:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=t(35355),o=function(r){var n=r.game.config.defaultPhysicsSystem,e=a(r.settings,"physics",!1);if(!(!n&&!e)){var i=[];if(n&&i.push(v(n+"Physics")),e)for(var h in e)h=v(h.concat("Physics")),i.indexOf(h)===-1&&i.push(h);return i}};c.exports=o},52106:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=function(o){var r=o.plugins.getDefaultScenePlugins(),n=a(o.settings,"plugins",!1);return Array.isArray(n)?n:r||[]};c.exports=v},87033:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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"};c.exports=m},97482:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(2368),o=new a({initialize:function(n){this.sys=new v(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(){}});c.exports=o},60903:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(89993),o=t(44594),r=t(8443),n=t(35154),e=t(54899),i=t(29747),h=t(97482),s=t(2368),l=new a({initialize:function(u,d){if(this.game=u,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,d){Array.isArray(d)||(d=[d]);for(var p=0;p-1&&(delete this.keys[p],this.scenes.splice(d,1),this._start.indexOf(p)>-1&&(d=this._start.indexOf(p),this._start.splice(d,1)),u.sys.destroy())}return this},bootScene:function(f){var u=f.sys,d=u.settings;u.sceneUpdate=i,f.init&&(f.init.call(f,d.data),d.status=v.INIT,d.isTransition&&u.events.emit(o.TRANSITION_INIT,d.transitionFrom,d.transitionDuration));var p;u.load&&(p=u.load,p.reset()),p&&f.preload?(f.preload.call(f),d.status=v.LOADING,p.once(e.COMPLETE,this.loadComplete,this),p.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,u){this.processQueue(),this.isProcessing=!0;for(var d=this.scenes.length-1;d>=0;d--){var p=this.scenes[d].sys;p.settings.status>v.START&&p.settings.status<=v.RUNNING&&p.step(f,u),p.scenePlugin&&p.scenePlugin._target&&p.scenePlugin.step(f,u)}},render:function(f){for(var u=0;u=v.LOADING&&d.settings.status=v.START&&g<=v.CREATING)return this;if(g>=v.RUNNING&&g<=v.SLEEPING)p.shutdown(),p.sceneUpdate=i,p.start(u);else{p.sceneUpdate=i,p.start(u);var y;if(p.load&&(y=p.load),y&&p.settings.hasOwnProperty("pack")&&(y.reset(),y.addPack({payload:p.settings.pack})))return p.settings.status=v.LOADING,y.once(e.COMPLETE,this.payloadComplete,this),y.start(),this}return this.bootScene(d),this},stop:function(f,u){var d=this.getScene(f);if(d&&!d.sys.isTransitioning()&&d.sys.settings.status!==v.SHUTDOWN){var p=d.sys.load;p&&(p.off(e.COMPLETE,this.loadComplete,this),p.off(e.COMPLETE,this.payloadComplete,this)),d.sys.shutdown(u)}return this},switch:function(f,u){var d=this.getScene(f),p=this.getScene(u);return d&&p&&d!==p&&(this.sleep(f),this.isSleeping(u)?this.wake(u):this.start(u)),this},getAt:function(f){return this.scenes[f]},getIndex:function(f){var u=this.getScene(f);return this.scenes.indexOf(u)},bringToTop:function(f){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u!==-1&&u0){var d=this.getScene(f);this.scenes.splice(u,1),this.scenes.unshift(d)}}return this},moveDown:function(f){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u>0){var d=u-1,p=this.getScene(f),g=this.getAt(d);this.scenes[u]=g,this.scenes[d]=p}}return this},moveUp:function(f){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:f,keyB:null});else{var u=this.getIndex(f);if(ud),0,g)}}return this},moveBelow:function(f,u){if(f===u)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:f,keyB:u});else{var d=this.getIndex(f),p=this.getIndex(u);if(d!==-1&&p!==-1&&p>d){var g=this.getAt(p);this.scenes.splice(p,1),d===0?this.scenes.unshift(g):this.scenes.splice(d-(p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(44594),r=t(95540),n=t(37277),e=new v({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(o.BOOT,this.boot,this),h.sys.events.on(o.START,this.pluginStart,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(o.SHUTDOWN,this.shutdown,this)},start:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",i,h),this},restart:function(i){var h=this.key;return this.manager.queueOp("stop",h),this.manager.queueOp("start",h,i),this},transition:function(i){i===void 0&&(i={});var h=r(i,"target",!1),s=this.manager.getScene(h);if(!h||!this.checkValidTransition(s))return!1;var l=r(i,"duration",1e3);this._elapsed=0,this._target=s,this._duration=l,this._willSleep=r(i,"sleep",!1),this._willRemove=r(i,"remove",!1);var f=r(i,"onUpdate",null);f&&(this._onUpdate=f,this._onUpdateScope=r(i,"onUpdateScope",this.scene));var u=r(i,"allowInput",!1);this.settings.transitionAllowInput=u;var d=s.sys.settings;d.isTransition=!0,d.transitionFrom=this.scene,d.transitionDuration=l,d.transitionAllowInput=u,r(i,"moveAbove",!1)?this.manager.moveAbove(this.key,h):r(i,"moveBelow",!1)&&this.manager.moveBelow(this.key,h),s.sys.isSleeping()?s.sys.wake(r(i,"data")):this.manager.start(h,r(i,"data"));var p=r(i,"onStart",null),g=r(i,"onStartScope",this.scene);return p&&p.call(g,this.scene,s,l),this.systems.events.emit(o.TRANSITION_OUT,s,l),!0},checkValidTransition:function(i){return!(!i||i.sys.isActive()||i.sys.isTransitioning()||i===this.scene||this.systems.isTransitioning())},step:function(i,h){this._elapsed+=h,this.transitionProgress=a(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var i=this._target.sys,h=this._target.sys.settings;i.events.emit(o.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(i,h,s,l){return this.manager.add(i,h,s,l)},launch:function(i,h){return i&&i!==this.key&&this.manager.queueOp("start",i,h),this},run:function(i,h){return i&&i!==this.key&&this.manager.queueOp("run",i,h),this},pause:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("pause",i,h),this},resume:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("resume",i,h),this},sleep:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("sleep",i,h),this},wake:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("wake",i,h),this},switch:function(i){return i!==this.key&&this.manager.queueOp("switch",this.key,i),this},stop:function(i,h){return i===void 0&&(i=this.key),this.manager.queueOp("stop",i,h),this},setActive:function(i,h,s){h===void 0&&(h=this.key);var l=this.manager.getScene(h);return l&&l.sys.setActive(i,s),this},setVisible:function(i,h){h===void 0&&(h=this.key);var s=this.manager.getScene(h);return s&&s.sys.setVisible(i),this},isSleeping:function(i){return i===void 0&&(i=this.key),this.manager.isSleeping(i)},isActive:function(i){return i===void 0&&(i=this.key),this.manager.isActive(i)},isPaused:function(i){return i===void 0&&(i=this.key),this.manager.isPaused(i)},isVisible:function(i){return i===void 0&&(i=this.key),this.manager.isVisible(i)},swapPosition:function(i,h){return h===void 0&&(h=this.key),i!==h&&this.manager.swapPosition(i,h),this},moveAbove:function(i,h){return h===void 0&&(h=this.key),i!==h&&this.manager.moveAbove(i,h),this},moveBelow:function(i,h){return h===void 0&&(h=this.key),i!==h&&this.manager.moveBelow(i,h),this},remove:function(i){return i===void 0&&(i=this.key),this.manager.remove(i),this},moveUp:function(i){return i===void 0&&(i=this.key),this.manager.moveUp(i),this},moveDown:function(i){return i===void 0&&(i=this.key),this.manager.moveDown(i),this},bringToTop:function(i){return i===void 0&&(i=this.key),this.manager.bringToTop(i),this},sendToBack:function(i){return i===void 0&&(i=this.key),this.manager.sendToBack(i),this},get:function(i){return this.manager.getScene(i)},getStatus:function(i){var h=this.manager.getScene(i);if(h)return h.sys.getStatus()},getIndex:function(i){return i===void 0&&(i=this.key),this.manager.getIndex(i)},shutdown:function(){var i=this.systems.events;i.off(o.SHUTDOWN,this.shutdown,this),i.off(o.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(o.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});n.register("ScenePlugin",e,"scenePlugin"),c.exports=e},55681:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(89993),v=t(35154),o=t(46975),r=t(87033),n={create:function(e){return typeof e=="string"?e={key:e}:e===void 0&&(e={}),{status:a.PENDING,key:v(e,"key",""),active:v(e,"active",!1),visible:v(e,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:v(e,"pack",!1),cameras:v(e,"cameras",null),map:v(e,"map",o(r,v(e,"mapAdd",{}))),physics:v(e,"physics",{}),loader:v(e,"loader",{}),plugins:v(e,"plugins",!1),input:v(e,"input",{})}}};c.exports=n},2368:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(89993),o=t(42363),r=t(44594),n=t(27397),e=t(52106),i=t(29747),h=t(55681),s=new a({initialize:function(f,u){this.scene=f,this.game,this.renderer,this.config=u,this.settings=h.create(u),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=i},init:function(l){this.settings.status=v.INIT,this.sceneUpdate=i,this.game=l,this.renderer=l.renderer,this.canvas=l.canvas,this.context=l.context;var f=l.plugins;this.plugins=f,f.addToScene(this,o.Global,[o.CoreScene,e(this),n(this)]),this.events.emit(r.BOOT,this),this.settings.isBooted=!0},step:function(l,f){var u=this.events;u.emit(r.PRE_UPDATE,l,f),u.emit(r.UPDATE,l,f),this.sceneUpdate.call(this.scene,l,f),u.emit(r.POST_UPDATE,l,f)},render:function(l){var f=this.displayList;f.depthSort(),this.events.emit(r.PRE_RENDER,l),this.cameras.render(l,f),this.events.emit(r.RENDER,l)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(l){var f=this.settings,u=this.getStatus();return u!==v.CREATING&&u!==v.RUNNING?console.warn("Cannot pause non-running Scene",f.key):this.settings.active&&(f.status=v.PAUSED,f.active=!1,this.events.emit(r.PAUSE,this,l)),this},resume:function(l){var f=this.events,u=this.settings;return this.settings.active||(u.status=v.RUNNING,u.active=!0,f.emit(r.RESUME,this,l)),this},sleep:function(l){var f=this.settings,u=this.getStatus();return u!==v.CREATING&&u!==v.RUNNING?console.warn("Cannot sleep non-running Scene",f.key):(f.status=v.SLEEPING,f.active=!1,f.visible=!1,this.events.emit(r.SLEEP,this,l)),this},wake:function(l){var f=this.events,u=this.settings;return u.status=v.RUNNING,u.active=!0,u.visible=!0,f.emit(r.WAKE,this,l),u.isTransition&&f.emit(r.TRANSITION_WAKE,u.transitionFrom,u.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var l=this.settings.status;return l>v.PENDING&&l<=v.RUNNING},isSleeping:function(){return this.settings.status===v.SLEEPING},isActive:function(){return this.settings.status===v.RUNNING},isPaused:function(){return this.settings.status===v.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(l){return this.settings.visible=l,this},setActive:function(l,f){return l?this.resume(f):this.pause(f)},start:function(l){var f=this.events,u=this.settings;l&&(u.data=l),u.status=v.START,u.active=!0,u.visible=!0,f.emit(r.START,this),f.emit(r.READY,this,l)},shutdown:function(l){var f=this.events,u=this.settings;f.off(r.TRANSITION_INIT),f.off(r.TRANSITION_START),f.off(r.TRANSITION_COMPLETE),f.off(r.TRANSITION_OUT),u.status=v.SHUTDOWN,u.active=!1,u.visible=!1,f.emit(r.SHUTDOWN,this,l)},destroy:function(){var l=this.events,f=this.settings;f.status=v.DESTROYED,f.active=!1,f.visible=!1,l.emit(r.DESTROY,this),l.removeAllListeners();for(var u=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9};c.exports=m},69830:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="addedtoscene"},7919:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="boot"},46763:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="create"},11763:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},71555:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},36735:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="postupdate"},3809:c=>{/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="prerender"},90716:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="preupdate"},58262:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="ready"},91633:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="removedfromscene"},10319:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="render"},87132:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},81961:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="shutdown"},90194:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="sleep"},6265:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="start"},33178:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="transitioncomplete"},43063:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="transitioninit"},11259:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="transitionout"},61611:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="transitionstart"},45209:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="transitionwake"},22966:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="update"},21747:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="wake"},44594:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(89993),v=t(79291),o={Events:t(44594),GetPhysicsPlugins:t(27397),GetScenePlugins:t(52106),SceneManager:t(60903),ScenePlugin:t(52209),Settings:t(55681),Systems:t(2368)};o=v(!1,o,a),c.exports=o},30341:(c,m,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 a=t(83419),v=t(50792),o=t(14463),r=t(79291),n=t(29747),e=new a({Extends:v,initialize:function(h,s,l){v.call(this),this.manager=h,this.key=s,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,l),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(i){return!i||!i.name||typeof i.name!="string"?!1:this.markers[i.name]?(console.error("addMarker "+i.name+" already exists in Sound"),!1):(i=r(!0,{name:"",start:0,duration:this.totalDuration-(i.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},i),this.markers[i.name]=i,!0)},updateMarker:function(i){return!i||!i.name||typeof i.name!="string"?!1:this.markers[i.name]?(this.markers[i.name]=r(!0,this.markers[i.name],i),!0):(console.warn("Audio Marker: "+i.name+" missing in Sound: "+this.key),!1)},removeMarker:function(i){var h=this.markers[i];return h?(this.markers[i]=null,h):null},play:function(i,h){if(i===void 0&&(i=""),typeof i=="object"&&(h=i,i=""),typeof i!="string")return!1;if(!i)this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;else{if(!this.markers[i])return console.warn("Marker: "+i+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[i],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 i=1.0005777895065548,h=this.currentConfig.detune+this.manager.detune,s=Math.pow(i,h);this.totalRate=this.currentConfig.rate*this.manager.rate*s},destroy:function(){this.pendingRemove||(this.stop(),this.emit(o.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});c.exports=e},85034:(c,m,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 a=t(83419),v=t(41786),o=t(50792),r=t(14463),n=t(8443),e=t(46710),i=t(58731),h=t(29747),s=t(26099),l=new a({Extends:o,initialize:function(u){o.call(this),this.game=u,this.jsonCache=u.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 s,u.events.on(n.BLUR,this.onGameBlur,this),u.events.on(n.FOCUS,this.onGameFocus,this),u.events.on(n.PRE_STEP,this.update,this),u.events.once(n.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(f,u){u===void 0&&(u={});var d=this.add(f,u);d.spritemap=this.jsonCache.get(f).spritemap;for(var p in d.spritemap)if(d.spritemap.hasOwnProperty(p)){var g=v(u),y=d.spritemap[p];g.loop=y.hasOwnProperty("loop")?y.loop:!1,d.addMarker({name:p,start:y.start,duration:y.end-y.start,config:g})}return d},get:function(f){return i(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,u){var d=this.add(f);return d.once(r.COMPLETE,d.destroy,d),u?u.name?(d.addMarker(u),d.play(u.name)):d.play(u):d.play()},playAudioSprite:function(f,u,d){var p=this.addAudioSprite(f);return p.once(r.COMPLETE,p.destroy,p),p.play(u,d)},remove:function(f){var u=this.sounds.indexOf(f);return u!==-1?(f.destroy(),this.sounds.splice(u,1),!0):!1},removeAll:function(){this.sounds.forEach(function(f){f.destroy()}),this.sounds.length=0},removeByKey:function(f){for(var u=0,d=this.sounds.length-1;d>=0;d--){var p=this.sounds[d];p.key===f&&(p.destroy(),this.sounds.splice(d,1),u++)}return u},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 u=0;return this.getAll(f).forEach(function(d){d.stop()&&u++}),u},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,u){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(r.UNLOCKED,this));for(var d=this.sounds.length-1;d>=0;d--)this.sounds[d].pendingRemove&&this.sounds.splice(d,1);this.sounds.forEach(function(p){p.update(f,u)})},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,u){var d=this;this.sounds.forEach(function(p,g){p&&!p.pendingRemove&&f.call(u||d,p,g,d.sounds)})},setRate:function(f){return this.rate=f,this},rate:{get:function(){return this._rate},set:function(f){this._rate=f,this.forEachActiveSound(function(u){u.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(u){u.calculateRate()}),this.emit(r.GLOBAL_DETUNE,this,f)}}});c.exports=l},14747:(c,m,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 a=t(33684),v=t(25960),o=t(57490),r={create:function(n){var e=n.config.audio,i=n.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new v(n):i.webAudio&&!e.disableWebAudio?new o(n):new a(n)}};c.exports=r},19723:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},98882:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="decodedall"},57506:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="decoded"},73146:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="destroy"},11305:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="detune"},40577:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="detune"},30333:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="mute"},20394:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="rate"},21802:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="volume"},1299:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="looped"},99190:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="loop"},97125:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="mute"},89259:c=>{/** - * @author pi-kei - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pan"},79986:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pauseall"},17586:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},19618:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="play"},42306:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="rate"},10387:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resumeall"},48959:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},9960:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="seek"},19180:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stopall"},98328:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stop"},50401:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="unlocked"},52498:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="volume"},14463:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,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 a=t(30341),v=t(83419),o=t(14463),r=t(45319),n=new v({Extends:a,initialize:function(i,h,s){if(s===void 0&&(s={}),this.tags=i.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,a.call(this,i,h,s)},play:function(e,i){return this.manager.isLocked(this,"play",[e,i])||!a.prototype.play.call(this,e,i)||!this.pickAndPlayAudioTag()?!1:(this.emit(o.PLAY,this),!0)},pause:function(){return this.manager.isLocked(this,"pause")||this.startTime>0||!a.prototype.pause.call(this)?!1:(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(o.PAUSE,this),!0)},resume:function(){return this.manager.isLocked(this,"resume")||this.startTime>0||!a.prototype.resume.call(this)||!this.pickAndPlayAudioTag()?!1:(this.emit(o.RESUME,this),!0)},stop:function(){return this.manager.isLocked(this,"stop")||!a.prototype.stop.call(this)?!1:(this.stopAndReleaseAudioTag(),this.emit(o.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var e=this.currentConfig.seek,i=this.currentConfig.delay,h=(this.currentMarker?this.currentMarker.start:0)+e;return this.previousTime=h,this.audio.currentTime=h,this.applyConfig(),i===0?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+i*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=i+Math.max(0,s-h),s=this.audio.currentTime):s=h){this.reset(),this.stopAndReleaseAudioTag(),this.emit(o.COMPLETE,this);return}this.previousTime=s}},destroy:function(){a.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(){a.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(o.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(o.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,o.RATE,e)&&(this.calculateRate(),this.emit(o.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,o.DETUNE,e)&&(this.calculateRate(),this.emit(o.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(o.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(o.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(o.PAN,this,e)}},setPan:function(e){return this.pan=e,this}});c.exports=n},33684:(c,m,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 a=t(85034),v=t(83419),o=t(14463),r=t(64895),n=new v({Extends:a,initialize:function(i){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,a.call(this,i)},add:function(e,i){var h=new r(this,e,i);return this.sounds.push(h),h},unlock:function(){this.locked=!1;var e=this;if(this.game.cache.audio.entries.each(function(l,f){for(var u=0;u{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,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 a=t(30341),v=t(83419),o=t(50792),r=t(79291),n=t(29747),e=function(){return!1},i=function(){return null},h=function(){return this},s=new v({Extends:o,initialize:function(f,u,d){d===void 0&&(d={}),o.call(this),this.manager=f,this.key=u,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},d),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:i,play:e,pause:e,resume:e,stop:e,setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h,applyConfig:i,resetConfig:i,update:n,calculateRate:i,destroy:function(){a.prototype.destroy.call(this)}});c.exports=s},25960:(c,m,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 a=t(85034),v=t(83419),o=t(50792),r=t(4603),n=t(29747),e=new v({Extends:o,initialize:function(h){o.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(i,h){var s=new r(this,i,h);return this.sounds.push(s),s},addAudioSprite:function(i,h){var s=this.add(i,h);return s.spritemap={},s},get:function(i){return a.prototype.get.call(this,i)},getAll:function(i){return a.prototype.getAll.call(this,i)},play:function(i,h){return!1},playAudioSprite:function(i,h,s){return!1},remove:function(i){return a.prototype.remove.call(this,i)},removeAll:function(){return a.prototype.removeAll.call(this)},removeByKey:function(i){return a.prototype.removeByKey.call(this,i)},stopByKey:function(i){return a.prototype.stopByKey.call(this,i)},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(i,h){a.prototype.forEachActiveSound.call(this,i,h)},destroy:function(){a.prototype.destroy.call(this)}});c.exports=e},71741:(c,m,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 a=t(30341),v=t(83419),o=t(14463),r=t(95540),n=new v({Extends:a,initialize:function(i,h,s){if(s===void 0&&(s={}),this.audioBuffer=i.game.cache.audio.get(h),!this.audioBuffer)throw new Error('Audio key "'+h+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=i.context.createGain(),this.volumeNode=i.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),i.context.createPanner&&(this.spatialNode=i.context.createPanner(),this.volumeNode.connect(this.spatialNode)),i.context.createStereoPanner?(this.pannerNode=i.context.createStereoPanner(),i.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(i.destination)):i.context.createPanner?this.spatialNode.connect(i.destination):this.volumeNode.connect(i.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,a.call(this,i,h,s)},play:function(e,i){return a.prototype.play.call(this,e,i)?(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(o.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 a=t(53134),v=t(85034),o=t(83419),r=t(14463),n=t(8443),e=t(71741),i=t(95540),h=new o({Extends:v,initialize:function(l){this.context=this.createAudioContext(l),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),v.call(this,l),this.locked&&l.isBooted?this.unlock():l.events.once(n.BOOT,this.unlock,this)},createAudioContext:function(s){var l=s.config.audio;if(l.context)return l.context.resume(),l.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(s){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=s,this.masterMuteNode=s.createGain(),this.masterVolumeNode=s.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(s.destination),this.destination=this.masterMuteNode,this},add:function(s,l){var f=new e(this,s,l);return this.sounds.push(f),f},decodeAudio:function(s,l){var f;Array.isArray(s)?f=s:f=[{key:s,data:l}];for(var u=this.game.cache.audio,d=f.length,p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37105),v=t(83419),o=t(29747),r=t(19186),n=new v({initialize:function(i){this.parent=i,this.list=[],this.position=0,this.addCallback=o,this.removeCallback=o,this._sortKey=""},add:function(e,i){return i?a.Add(this.list,e):a.Add(this.list,e,0,this.addCallback,this)},addAt:function(e,i,h){return h?a.AddAt(this.list,e,i):a.AddAt(this.list,e,i,0,this.addCallback,this)},getAt:function(e){return this.list[e]},getIndex:function(e){return this.list.indexOf(e)},sort:function(e,i){return e?(i===void 0&&(i=function(h,s){return h[e]-s[e]}),r(this.list,i),this):this},getByName:function(e){return a.GetFirst(this.list,"name",e)},getRandom:function(e,i){return a.GetRandom(this.list,e,i)},getFirst:function(e,i,h,s){return a.GetFirst(this.list,e,i,h,s)},getAll:function(e,i,h,s){return a.GetAll(this.list,e,i,h,s)},count:function(e,i){return a.CountAllMatching(this.list,e,i)},swap:function(e,i){a.Swap(this.list,e,i)},moveTo:function(e,i){return a.MoveTo(this.list,e,i)},moveAbove:function(e,i){return a.MoveAbove(this.list,e,i)},moveBelow:function(e,i){return a.MoveBelow(this.list,e,i)},remove:function(e,i){return i?a.Remove(this.list,e):a.Remove(this.list,e,this.removeCallback,this)},removeAt:function(e,i){return i?a.RemoveAt(this.list,e):a.RemoveAt(this.list,e,this.removeCallback,this)},removeBetween:function(e,i,h){return h?a.RemoveBetween(this.list,e,i):a.RemoveBetween(this.list,e,i,this.removeCallback,this)},removeAll:function(e){for(var i=this.list.length;i--;)this.remove(this.list[i],e);return this},bringToTop:function(e){return a.BringToTop(this.list,e)},sendToBack:function(e){return a.SendToBack(this.list,e)},moveUp:function(e){return a.MoveUp(this.list,e),e},moveDown:function(e){return a.MoveDown(this.list,e),e},reverse:function(){return this.list.reverse(),this},shuffle:function(){return a.Shuffle(this.list),this},replace:function(e,i){return a.Replace(this.list,e,i)},exists:function(e){return this.list.indexOf(e)>-1},setAll:function(e,i,h,s){return a.SetAll(this.list,e,i,h,s),this},each:function(e,i){for(var h=[null],s=2;s0?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}}});c.exports=n},90330:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r){this.entries={},this.size=0,this.setAll(r)},setAll:function(o){if(Array.isArray(o))for(var r=0;r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(82348),r=new a({Extends:v,initialize:function(){v.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,i=e.indexOf(n);i!==-1&&e.splice(i,1)}else this.isActive(n)&&(this._destroy.push(n),this._toProcess++);return n},removeAll:function(){for(var n=this._active,e=this._destroy,i=n.length;i--;)e.push(n[i]),this._toProcess++;return this},update:function(){if(this._toProcess===0)return this._active;var n=this._destroy,e=this._active,i,h;for(i=0;i{/** - * @author Vladimir Agafonkin - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(43886);function v(x){if(!(this instanceof v))return new v(x);this._maxEntries=Math.max(4,x||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}v.prototype={all:function(){return this._all(this.data,[])},search:function(x){var T=this.data,C=[],M=this.toBBox;if(!p(x,T))return C;for(var w=[],L,F,O,N;T;){for(L=0,F=T.children.length;L=0&&L[T].children.length>this._maxEntries;)this._split(L,T),T--;this._adjustParentBBoxes(w,L,T)},_split:function(x,T){var C=x[T],M=C.children.length,w=this._minEntries;this._chooseSplitAxis(C,w,M);var L=this._chooseSplitIndex(C,w,M),F=g(C.children.splice(L,C.children.length-L));F.height=C.height,F.leaf=C.leaf,r(C,this.toBBox),r(F,this.toBBox),T?x[T-1].children.push(F):this._splitRoot(C,F)},_splitRoot:function(x,T){this.data=g([x,T]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(x,T,C){var M,w,L,F,O,N,G,V;for(N=G=1/0,M=T;M<=C-T;M++)w=n(x,0,M,this.toBBox),L=n(x,M,C,this.toBBox),F=u(w,L),O=s(w)+s(L),F=T;N--)G=x.children[N],e(F,x.leaf?w(G):G),O+=l(F);return O},_adjustParentBBoxes:function(x,T,C){for(var M=C;M>=0;M--)e(T[M],x)},_condense:function(x){for(var T=x.length-1,C;T>=0;T--)x[T].children.length===0?T>0?(C=x[T-1].children,C.splice(C.indexOf(x[T]),1)):this.clear():r(x[T],this.toBBox)},compareMinX:function(x,T){return x.left-T.left},compareMinY:function(x,T){return x.top-T.top},toBBox:function(x){return{minX:x.left,minY:x.top,maxX:x.right,maxY:x.bottom}}};function o(x,T,C){if(!C)return T.indexOf(x);for(var M=0;M=x.minX&&T.maxY>=x.minY}function g(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(x,T,C,M,w){for(var L=[T,C],F;L.length;)C=L.pop(),T=L.pop(),!(C-T<=M)&&(F=T+Math.ceil((C-T)/M/2)*M,a(x,F,T,C,w),L.push(T,F,F,C))}c.exports=v},35072:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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 o=0;o-1},union:function(o){var r=new v;return o.entries.forEach(function(n){r.set(n)}),this.entries.forEach(function(n){r.set(n)}),r},intersect:function(o){var r=new v;return this.entries.forEach(function(n){o.contains(n)&&r.set(n)}),r},difference:function(o){var r=new v;return this.entries.forEach(function(n){o.contains(n)||r.set(n)}),r},size:{get:function(){return this.entries.length},set:function(o){return o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45319),v=t(83419),o=t(56583),r=t(26099),n=new v({initialize:function(i,h,s,l){i===void 0&&(i=0),h===void 0&&(h=i),s===void 0&&(s=0),l===void 0&&(l=null),this._width=i,this._height=h,this._parent=l,this.aspectMode=s,this.aspectRatio=h===0?1:i/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,i){return e===void 0&&(e=0),i===void 0&&(i=e),this.snapTo.set(e,i),this.setSize(this._width,this._height)},setParent:function(e){return this._parent=e,this.setSize(this._width,this._height)},setMin:function(e,i){return e===void 0&&(e=0),i===void 0&&(i=e),this.minWidth=a(e,0,this.maxWidth),this.minHeight=a(i,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(e,i){return e===void 0&&(e=Number.MAX_VALUE),i===void 0&&(i=e),this.maxWidth=a(e,this.minWidth,Number.MAX_VALUE),this.maxHeight=a(i,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(e,i){switch(e===void 0&&(e=0),i===void 0&&(i=e),this.aspectMode){case n.NONE:this._width=this.getNewWidth(o(e,this.snapTo.x)),this._height=this.getNewHeight(o(i,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height;break;case n.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(o(e,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case n.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(o(i,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case n.FIT:this.constrain(e,i,!0);break;case n.ENVELOP:this.constrain(e,i,!1);break}return this},setAspectRatio:function(e){return this.aspectRatio=e,this.setSize(this._width,this._height)},resize:function(e,i){return this._width=this.getNewWidth(o(e,this.snapTo.x)),this._height=this.getNewHeight(o(i,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height,this},getNewWidth:function(e,i){return i===void 0&&(i=!0),e=a(e,this.minWidth,this.maxWidth),i&&this._parent&&e>this._parent.width&&(e=Math.max(this.minWidth,this._parent.width)),e},getNewHeight:function(e,i){return i===void 0&&(i=!0),e=a(e,this.minHeight,this.maxHeight),i&&this._parent&&e>this._parent.height&&(e=Math.max(this.minHeight,this._parent.height)),e},constrain:function(e,i,h){e===void 0&&(e=0),i===void 0&&(i=e),h===void 0&&(h=!0),e=this.getNewWidth(e),i=this.getNewHeight(i);var s=this.snapTo,l=i===0?1:e/i;return h&&this.aspectRatio>l||!h&&this.aspectRatio0&&(i=o(i,s.y),e=i*this.aspectRatio)):(h&&this.aspectRatiol)&&(i=o(i,s.y),e=i*this.aspectRatio,s.x>0&&(e=o(e,s.x),i=e*(1/this.aspectRatio))),this._width=e,this._height=i,this},fitTo:function(e,i){return this.constrain(e,i,!0)},envelop:function(e,i){return this.constrain(e,i,!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,c.exports=n},15238:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="add"},56187:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="remove"},82348:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={PROCESS_QUEUE_ADD:t(15238),PROCESS_QUEUE_REMOVE:t(56187)}},41392:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Events:t(82348),List:t(73162),Map:t(90330),ProcessQueue:t(25774),RTree:t(59542),Set:t(35072),Size:t(86555)}},57382:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(45319),o=t(40987),r=t(8054),n=t(50030),e=t(79237),i=new a({Extends:e,initialize:function(s,l,f,u,d){e.call(this,s,l,f,u,d),this.add("__BASE",0,0,0,u,d),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=u,this.height=d,this.imageData=this.context.getImageData(0,0,u,d),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,s,l,f){return f===void 0&&(f=!0),this.context.drawImage(l,h,s),f&&this.update(),this},drawFrame:function(h,s,l,f,u){l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=!0);var d=this.manager.getFrame(h,s);if(d){var p=d.canvasData,g=d.cutWidth,y=d.cutHeight,x=d.source.resolution;this.context.drawImage(d.source.image,p.x,p.y,g,y,l,f,g/x,y/x),u&&this.update()}return this},setPixel:function(h,s,l,f,u,d){d===void 0&&(d=255),h=Math.abs(Math.floor(h)),s=Math.abs(Math.floor(s));var p=this.getIndex(h,s);if(p>-1){var g=this.context.getImageData(h,s,1,1);g.data[0]=l,g.data[1]=f,g.data[2]=u,g.data[3]=d,this.context.putImageData(g,h,s)}return this},putData:function(h,s,l,f,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=h.width),p===void 0&&(p=h.height),this.context.putImageData(h,s,l,f,u,d,p),this},getData:function(h,s,l,f){h=v(Math.floor(h),0,this.width-1),s=v(Math.floor(s),0,this.height-1),l=v(l,1,this.width-h),f=v(f,1,this.height-s);var u=this.context.getImageData(h,s,l,f);return u},getPixel:function(h,s,l){l||(l=new o);var f=this.getIndex(h,s);if(f>-1){var u=this.data,d=u[f+0],p=u[f+1],g=u[f+2],y=u[f+3];l.setTo(d,p,g,y)}return l},getPixels:function(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=this.width),f===void 0&&(f=l),h=Math.abs(Math.round(h)),s=Math.abs(Math.round(s));for(var u=v(h,0,this.width),d=v(h+l,0,this.width),p=v(s,0,this.height),g=v(s+f,0,this.height),y=new o,x=[],T=p;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(10312),v=t(71911),o=t(27919),r=t(83419),n=t(8054),e=t(4327),i=t(95540),h=t(36060),s=t(32302),l=t(79237),f=t(70554),u=new r({Extends:l,initialize:function(p,g,y,x){y===void 0&&(y=256),x===void 0&&(x=256),this.type="DynamicTexture";var T=p.game.renderer,C=T&&T.type===n.CANVAS,M=C?o.create2D(this,y,x):[this];l.call(this,p,g,M,y,x),this.add("__BASE",0,0,0,y,x),this.renderer=T,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=C?M:null,this.context=C?M.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new v(0,0,y,x).setScene(p.game.scene.systemScene,!1),this.renderTarget=C?null:new s(T,y,x,1,0,!1,!0,!0,!1),this.pipeline=C?null:T.pipelines.get(h.SINGLE_PIPELINE),this.setSize(y,x)},setSize:function(d,p){p===void 0&&(p=d);var g=this.get(),y=g.source;if(d!==this.width||p!==this.height){this.canvas&&(this.canvas.width=d,this.canvas.height=p);var x=this.renderTarget;x&&(x.willResize(d,p)&&x.resize(d,p),x.texture!==y.glTexture&&this.renderer.deleteTexture(y.glTexture),this.setFromRenderTarget()),this.camera.setSize(d,p),y.width=d,y.height=p,g.setSize(d,p),this.width=d,this.height=p}else{var T=this.getSourceImage();g.cutX+d>T.width&&(d=T.width-g.cutX),g.cutY+p>T.height&&(p=T.height-g.cutY),g.setSize(d,p,g.cutX,g.cutY)}return this},setFromRenderTarget:function(){var d=this.get(),p=d.source,g=this.renderTarget;return p.isRenderTexture=!0,p.isGLTexture=!0,p.glTexture=g.texture,this},setIsSpriteTexture:function(d){return this.isSpriteTexture=d,this},fill:function(d,p,g,y,x,T){var C=this.camera,M=this.renderer;p===void 0&&(p=1),g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=this.width),T===void 0&&(T=this.height);var w=d>>16&255,L=d>>8&255,F=d&255,O=this.renderTarget;if(C.preRender(),O){O.bind(!0);var N=this.pipeline.manager.set(this.pipeline),G=M.width/O.width,V=M.height/O.height,j=O.height-(y+T);N.drawFillRect(g*G,j*V,x*G,T*V,f.getTintFromFloats(F/255,L/255,w/255,1),p),O.unbind(!0)}else{var K=this.context;M.setContext(K),K.globalCompositeOperation="source-over",K.fillStyle="rgba("+w+","+L+","+F+","+p+")",K.fillRect(g,y,x,T),M.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var d=this.context,p=this.renderTarget;p?p.clear():d&&(d.save(),d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,this.width,this.height),d.restore()),this.dirty=!1}return this},stamp:function(d,p,g,y,x){g===void 0&&(g=0),y===void 0&&(y=0);var T=i(x,"alpha",1),C=i(x,"tint",16777215),M=i(x,"angle",0),w=i(x,"rotation",0),L=i(x,"scale",1),F=i(x,"scaleX",L),O=i(x,"scaleY",L),N=i(x,"originX",.5),G=i(x,"originY",.5),V=i(x,"blendMode",0),j=i(x,"erase",!1),K=i(x,"skipBatch",!1),J=this.manager.resetStamp(T,C);return J.setAngle(0),M!==0?J.setAngle(M):w!==0&&J.setRotation(w),J.setScale(F,O),J.setTexture(d,p),J.setOrigin(N,G),J.setBlendMode(V),j&&(this._eraseMode=!0),K?this.batchGameObject(J,g,y):this.draw(J,g,y),j&&(this._eraseMode=!1),this},erase:function(d,p,g){return this._eraseMode=!0,this.draw(d,p,g),this._eraseMode=!1,this},draw:function(d,p,g,y,x){return this.beginDraw(),this.batchDraw(d,p,g,y,x),this.endDraw(),this},drawFrame:function(d,p,g,y,x,T){return this.beginDraw(),this.batchDrawFrame(d,p,g,y,x,T),this.endDraw(),this},repeat:function(d,p,g,y,x,T,C,M,w){if(g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=this.width),T===void 0&&(T=this.height),C===void 0&&(C=1),M===void 0&&(M=16777215),w===void 0&&(w=!1),d instanceof e?p=d:p=this.manager.getFrame(d,p),!p)return this;var L=this.manager.resetStamp(C,M);L.setFrame(p),L.setOrigin(0);var F=p.width,O=p.height;x=Math.floor(x),T=Math.floor(T);var N=Math.ceil(x/F),G=Math.ceil(T/O),V=N*F-x,j=G*O-T;V>0&&(V=F-V),j>0&&(j=O-j),g<0&&(N+=Math.ceil(Math.abs(g)/F)),y<0&&(G+=Math.ceil(Math.abs(y)/O));var K=g,J=y,X=!1,Y=this.manager.stampCrop.setTo(0,0,F,O);w||this.beginDraw();for(var D=0;D0&&z===N-1&&(X=!0,Y.width=V),j>0&&D===G-1&&(X=!0,Y.height=j),X&&L.setCrop(Y),this.batchGameObject(L,K,J),L.isCropped=!1,Y.setTo(0,0,F,O),K+=F}K=g,J+=O}return w||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var d=this.camera,p=this.renderer,g=this.renderTarget;d.preRender(),g?p.beginCapture(g.width,g.height):p.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(d,p,g,y,x){return Array.isArray(d)||(d=[d]),this.batchList(d,p,g,y,x),this},batchDrawFrame:function(d,p,g,y,x,T){g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=1),T===void 0&&(T=16777215);var C=this.manager.getFrame(d,p);return C&&(this.renderTarget?this.pipeline.batchTextureFrame(C,g,y,T,x,this.camera.matrix,null):this.batchTextureFrame(C,g,y,x,T)),this},endDraw:function(d){if(d===void 0&&(d=this._eraseMode),this.isDrawing){var p=this.renderer,g=this.renderTarget;if(g){var y=p.endCapture(),x=p.pipelines.setUtility();x.blitFrame(y,g,1,!1,!1,d,this.isSpriteTexture),p.resetScissor(),p.resetViewport()}else p.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(d,p,g,y,x){var T=d.length;if(T!==0)for(var C=0;C0&&w.height>0&&M.drawImage(L,w.x,w.y,w.width,w.height,p,g,w.width,w.height),M.restore()}},snapshotArea:function(d,p,g,y,x,T,C){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,x,!1,d,p,g,y,T,C):this.renderer.snapshotCanvas(this.canvas,x,!1,d,p,g,y,T,C),this},snapshot:function(d,p,g){return this.snapshotArea(0,0,this.width,this.height,d,p,g)},snapshotPixel:function(d,p,g){return this.snapshotArea(d,p,1,1,g,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(d,p,g,y){var x=this.manager.resetStamp();x.setTexture(this),x.setOrigin(0),x.renderWebGL(d,x,g,y)},renderCanvas:function(){},destroy:function(){var d=this.manager.stamp;d&&d.texture===this&&this.manager.resetStamp(),l.prototype.destroy.call(this),o.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});c.exports=u},4327:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(45319),o=t(79291),r=new a({initialize:function(e,i,h,s,l,f,u){this.texture=e,this.name=i,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,u,s,l)},setSize:function(n,e,i,h){i===void 0&&(i=0),h===void 0&&(h=0),this.cutX=i,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 s=this.data,l=s.cut;l.x=i,l.y=h,l.w=n,l.h=e,l.r=i+n,l.b=h+e,s.sourceSize.w=n,s.sourceSize.h=e,s.spriteSourceSize.w=n,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(n*n+e*e);var f=s.drawImage;return f.x=i,f.y=h,f.width=n,f.height=e,this.updateUVs()},setTrim:function(n,e,i,h,s,l){var f=this.data,u=f.spriteSourceSize;return f.trim=!0,f.sourceSize.w=n,f.sourceSize.h=e,u.x=i,u.y=h,u.w=s,u.h=l,u.r=i+s,u.b=h+l,this.x=i,this.y=h,this.width=s,this.height=l,this.halfWidth=s*.5,this.halfHeight=l*.5,this.centerX=Math.floor(s/2),this.centerY=Math.floor(l/2),this.updateUVs()},setScale9:function(n,e,i,h){var s=this.data;return s.scale9=!0,s.is3Slice=e===0&&h===this.height,s.scale9Borders.x=n,s.scale9Borders.y=e,s.scale9Borders.w=i,s.scale9Borders.h=h,this},setCropUVs:function(n,e,i,h,s,l,f){var u=this.cutX,d=this.cutY,p=this.cutWidth,g=this.cutHeight,y=this.realWidth,x=this.realHeight;e=v(e,0,y),i=v(i,0,x),h=v(h,0,y-e),s=v(s,0,x-i);var T=u+e,C=d+i,M=h,w=s,L=this.data;if(L.trim){var F=L.spriteSourceSize;h=v(h,0,p-e),s=v(s,0,g-i);var O=e+h,N=i+s,G=!(F.rO||F.y>N);if(G){var V=Math.max(F.x,e),j=Math.max(F.y,i),K=Math.min(F.r,O)-V,J=Math.min(F.b,N)-j;M=K,w=J,l?T=u+(p-(V-F.x)-K):T=u+(V-F.x),f?C=d+(g-(j-F.y)-J):C=d+(j-F.y),e=V,i=j,h=K,s=J}else T=0,C=0,M=0,w=0}else l&&(T=u+(p-e-h)),f&&(C=d+(g-i-s));var X=this.source.width,Y=this.source.height;return n.u0=Math.max(0,T/X),n.v0=Math.max(0,C/Y),n.u1=Math.min(1,(T+M)/X),n.v1=Math.min(1,(C+w)/Y),n.x=e,n.y=i,n.cx=T,n.cy=C,n.cw=M,n.ch=w,n.width=h,n.height=s,n.flipX=l,n.flipY=f,n},updateCropUVs:function(n,e,i){return this.setCropUVs(n,n.x,n.y,n.width,n.height,e,i)},setUVs:function(n,e,i,h,s,l){var f=this.data.drawImage;return f.width=n,f.height=e,this.u0=i,this.v0=h,this.u1=s,this.v1=l,this},updateUVs:function(){var n=this.cutX,e=this.cutY,i=this.cutWidth,h=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=h;var l=this.source.width,f=this.source.height;return this.u0=n/l,this.v0=e/f,this.u1=(n+i)/l,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=o(!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}}});c.exports=r},79237:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(4327),o=t(11876),r='Texture "%s" has no frame "%s"',n=new a({initialize:function(i,h,s,l,f){Array.isArray(s)||(s=[s]),this.manager=i,this.key=h,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var u=0;ul&&(l=d.cutX+d.cutWidth),d.cutY+d.cutHeight>f&&(f=d.cutY+d.cutHeight)}return{x:h,y:s,width:l-h,height:f-s}},getFrameNames:function(e){e===void 0&&(e=!1);var i=Object.keys(this.frames);if(!e){var h=i.indexOf("__BASE");h!==-1&&i.splice(h,1)}return i},getSourceImage:function(e){(e==null||this.frameTotal===1)&&(e="__BASE");var i=this.frames[e];return i?i.source.image:(console.warn(r,this.key,e),this.frames.__BASE.source.image)},getDataSourceImage:function(e){(e==null||this.frameTotal===1)&&(e="__BASE");var i=this.frames[e],h;return i?h=i.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 i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=t(57382),o=t(83419),r=t(40987),n=t(8054),e=t(81320),i=t(50792),h=t(69442),s=t(4327),l=t(8443),f=t(99584),u=t(35154),d=t(88571),p=t(41212),g=t(61309),y=t(87841),x=t(79237),T=new o({Extends:i,initialize:function(M){i.call(this),this.game=M,this.name="TextureManager",this.list={},this._tempCanvas=a.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.silentWarnings=!1,M.events.once(l.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(h.LOAD,this.updatePending,this),this.on(h.ERROR,this.updatePending,this);var C=this.game.config;this.addBase64("__DEFAULT",C.defaultImage),this.addBase64("__MISSING",C.missingImage),this.addBase64("__WHITE",C.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(l.DESTROY,this.destroy,this),this.game.events.once(l.SYSTEM_READY,function(M){this.stamp=new d(M).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(h.LOAD),this.off(h.ERROR),this.emit(h.READY))},checkKey:function(C){return this.exists(C)?(this.silentWarnings||console.error("Texture key already in use: "+C),!1):!0},remove:function(C){if(typeof C=="string")if(this.exists(C))C=this.get(C);else return this.silentWarnings||console.warn("No texture found matching key: "+C),this;var M=C.key;return this.list.hasOwnProperty(M)&&(C.destroy(),this.emit(h.REMOVE,M),this.emit(h.REMOVE_KEY+M)),this},removeKey:function(C){return this.list.hasOwnProperty(C)&&delete this.list[C],this},addBase64:function(C,M){if(this.checkKey(C)){var w=this,L=new Image;L.onerror=function(){w.emit(h.ERROR,C)},L.onload=function(){var F=w.create(C,L);g.Image(F,0),w.emit(h.ADD,C,F),w.emit(h.ADD_KEY+C,F),w.emit(h.LOAD,C,F)},L.src=M}return this},getBase64:function(C,M,w,L){w===void 0&&(w="image/png"),L===void 0&&(L=.92);var F="",O=this.getFrame(C,M);if(O&&(O.source.isRenderTexture||O.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(O){var N=O.canvasData,G=a.create2D(this,N.width,N.height),V=G.getContext("2d",{willReadFrequently:!0});N.width>0&&N.height>0&&V.drawImage(O.source.image,N.x,N.y,N.width,N.height,0,0,N.width,N.height),F=G.toDataURL(w,L),a.remove(G)}return F},addImage:function(C,M,w){var L=null;return this.checkKey(C)&&(L=this.create(C,M),g.Image(L,0),w&&L.setDataSource(w),this.emit(h.ADD,C,L),this.emit(h.ADD_KEY+C,L)),L},addGLTexture:function(C,M){var w=null;if(this.checkKey(C)){var L=M.width,F=M.height;w=this.create(C,M,L,F),w.add("__BASE",0,0,0,L,F),this.emit(h.ADD,C,w),this.emit(h.ADD_KEY+C,w)}return w},addCompressedTexture:function(C,M,w){var L=null;if(this.checkKey(C)){if(L=this.create(C,M),L.add("__BASE",0,0,0,M.width,M.height),w){var F=function(N,G,V){Array.isArray(V.textures)||Array.isArray(V.frames)?g.JSONArray(N,G,V):g.JSONHash(N,G,V)};if(Array.isArray(w))for(var O=0;O=O.x&&C=O.y&&M=O.x&&C=O.y&&M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(27919),v=t(83419),o=t(50030),r=t(29795),n=t(82751),e=new v({initialize:function(h,s,l,f,u){u===void 0&&(u=!1);var d=h.manager.game;this.renderer=d.renderer,this.texture=h,this.source=s,this.image=s.compressed?null:s,this.compressionAlgorithm=s.compressed?s.format:null,this.resolution=1,this.width=l||s.naturalWidth||s.videoWidth||s.width||0,this.height=f||s.naturalHeight||s.videoHeight||s.height||0,this.scaleMode=r.DEFAULT,this.isCanvas=s instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&s instanceof HTMLVideoElement,this.isRenderTexture=s.type==="RenderTexture"||s.type==="DynamicTexture",this.isGLTexture=s instanceof n,this.isPowerOf2=o(this.width,this.height),this.glTexture=null,this.flipY=u,this.init(d)},init:function(i){var h=this.renderer;if(h){var s=this.source;if(h.gl){var l=this.image,f=this.flipY,u=this.width,d=this.height,p=this.scaleMode;this.isCanvas?this.glTexture=h.createCanvasTexture(l,!1,f):this.isVideo?this.glTexture=h.createVideoTexture(l,!1,f):this.isRenderTexture?this.glTexture=h.createTextureFromSource(null,u,d,p):this.isGLTexture?this.glTexture=s:this.compressionAlgorithm?this.glTexture=h.createTextureFromSource(s,void 0,void 0,p):s instanceof Uint8Array?this.glTexture=h.createUint8ArrayTexture(s,u,d,p):this.glTexture=h.createTextureFromSource(l,u,d,p)}else this.isRenderTexture&&(this.image=s.canvas)}i.config.antialias||this.setFilter(1)},setFilter:function(i){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,i),this.scaleMode=i},setFlipY:function(i){return i===void 0&&(i=!0),i===this.flipY?this:(this.flipY=i,this.update(),this)},update:function(){var i=this.renderer,h=this.image,s=this.flipY,l=i.gl;l&&this.isCanvas?i.updateCanvasTexture(h,this.glTexture,s):l&&this.isVideo&&i.updateVideoTexture(h,this.glTexture,s)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&a.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});c.exports=e},19673:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={LINEAR:0,NEAREST:1};c.exports=m},44538:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="addtexture"},63486:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="addtexture-"},94851:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="onerror"},29099:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="onload"},8678:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="ready"},86415:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="removetexture"},30879:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="removetexture-"},69442:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79291),v=t(19673),o={CanvasTexture:t(57382),DynamicTexture:t(81320),Events:t(69442),FilterMode:v,Frame:t(4327),Parsers:t(61309),Texture:t(79237),TextureManager:t(17130),TextureSource:t(11876)};o=a(!1,o,v),c.exports=o},89905:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(!v.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var o=t.source[a];t.add("__BASE",a,0,0,o.width,o.height);for(var r=v.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 m=function(t,a){var v=t.source[a];return t.add("__BASE",a,0,0,v.width,v.height),t};c.exports=m},4832:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.source[a];return t.add("__BASE",a,0,0,v.width,v.height),t};c.exports=m},78566:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41786),v=function(o,r,n){if(!n.frames&&!n.textures){console.warn("Invalid Texture Atlas JSON Array");return}var e=o.source[r];o.add("__BASE",r,0,0,e.width,e.height);for(var i=Array.isArray(n.textures)?n.textures[r].frames:n.frames,h,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41786),v=function(o,r,n){if(!n.frames){console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object");return}var e=o.source[r];o.add("__BASE",r,0,0,e.width,e.height);var i=n.frames,h;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];if(h=o.add(s,r,l.frame.x,l.frame.y,l.frame.w,l.frame.h),!h){console.warn("Invalid atlas json, frame already exists: "+s);continue}l.trimmed&&h.setTrim(l.sourceSize.w,l.sourceSize.h,l.spriteSourceSize.x,l.spriteSourceSize.y,l.spriteSourceSize.w,l.spriteSourceSize.h),l.rotated&&(h.rotated=!0,h.updateUVsInverted());var f=l.anchor||l.pivot;f&&(h.customPivot=!0,h.pivotX=f.x,h.pivotY=f.y),l.scale9Borders&&h.setScale9(l.scale9Borders.x,l.scale9Borders.y,l.scale9Borders.w,l.scale9Borders.h),h.customData=a(l)}for(var u in n)u!=="frames"&&(Array.isArray(n[u])?o.customData[u]=n[u].slice(0):o.customData[u]=n[u]);return o};c.exports=v},31403:c=>{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=[171,75,84,88,32,49,49,187,13,10,26,10],v,o=new Uint8Array(t,0,12);for(v=0;v>1),y=Math.max(1,y>>1),p+=x}return{mipmaps:d,width:s,height:l,internalFormat:h,compressed:!0,generateMipmap:!1}};c.exports=m},82038:c=>{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(M,w,L,F,O,N,G){return G===void 0&&(G=16),Math.floor((M+L)/O)*Math.floor((w+F)/N)*G}function t(M,w){return M=Math.max(M,16),w=Math.max(w,8),M*w/4}function a(M,w){return M=Math.max(M,8),w=Math.max(w,8),M*w/2}function v(M,w){return Math.ceil(M/4)*Math.ceil(w/4)*16}function o(M,w){return m(M,w,3,3,4,4,8)}function r(M,w){return m(M,w,3,3,4,4)}function n(M,w){return m(M,w,4,3,5,4)}function e(M,w){return m(M,w,4,4,5,5)}function i(M,w){return m(M,w,5,4,6,5)}function h(M,w){return m(M,w,5,5,6,6)}function s(M,w){return m(M,w,7,4,8,5)}function l(M,w){return m(M,w,7,5,8,6)}function f(M,w){return m(M,w,7,7,8,8)}function u(M,w){return m(M,w,9,4,10,5)}function d(M,w){return m(M,w,9,5,10,6)}function p(M,w){return m(M,w,9,7,10,8)}function g(M,w){return m(M,w,9,9,10,10)}function y(M,w){return m(M,w,11,9,12,10)}function x(M,w){return m(M,w,11,11,12,12)}var T={0:{sizeFunc:t,glFormat:[35841]},1:{sizeFunc:t,glFormat:[35843]},2:{sizeFunc:a,glFormat:[35840]},3:{sizeFunc:a,glFormat:[35842]},6:{sizeFunc:o,glFormat:[36196]},7:{sizeFunc:o,glFormat:[33776,35916]},8:{sizeFunc:r,glFormat:[33777,35917]},9:{sizeFunc:r,glFormat:[33778,35918]},11:{sizeFunc:r,glFormat:[33779,35919]},14:{sizeFunc:v,glFormat:[36494,36495]},15:{sizeFunc:v,glFormat:[36492,36493]},22:{sizeFunc:o,glFormat:[37492,37493]},23:{sizeFunc:r,glFormat:[37496,37497]},24:{sizeFunc:o,glFormat:[37494,37495]},25:{sizeFunc:o,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:i,glFormat:[37811,37843]},31:{sizeFunc:h,glFormat:[37812,37844]},32:{sizeFunc:s,glFormat:[37813,37845]},33:{sizeFunc:l,glFormat:[37814,37846]},34:{sizeFunc:f,glFormat:[37815,37847]},35:{sizeFunc:u,glFormat:[37816,37848]},36:{sizeFunc:d,glFormat:[37817,37849]},37:{sizeFunc:p,glFormat:[37818,37850]},38:{sizeFunc:g,glFormat:[37819,37851]},39:{sizeFunc:y,glFormat:[37820,37852]},40:{sizeFunc:x,glFormat:[37821,37853]}},C=function(M){for(var w=new Uint32Array(M,0,13),L=w[0],F=L===55727696,O=F?w[2]:w[3],N=w[4],G=T[O].glFormat[N],V=T[O].sizeFunc,j=w[11],K=w[7],J=w[6],X=52+w[12],Y=new Uint8Array(M,X),D=new Array(j),z=0,W=K,H=J,Z=0;Z>1),H=Math.max(1,H>>1),z+=Q}return{mipmaps:D,width:K,height:J,internalFormat:G,compressed:!0,generateMipmap:!1}};c.exports=C},75549:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=function(o,r,n,e,i,h,s){var l=a(s,"frameWidth",null),f=a(s,"frameHeight",l);if(l===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=o.source[r];o.add("__BASE",r,0,0,u.width,u.height);var d=a(s,"startFrame",0),p=a(s,"endFrame",-1),g=a(s,"margin",0),y=a(s,"spacing",0),x=Math.floor((i-g+y)/(l+y)),T=Math.floor((h-g+y)/(f+y)),C=x*T;C===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",o.key),(d>C||d<-C)&&(d=0),d<0&&(d=C+d),(p===-1||p>C||pi&&(L=G-i),V>h&&(F=V-h),N>=d&&N<=p&&(o.add(O,r,n+M,e+w,l-L,f-F),O++),M+=l+y,M+l>i&&(M=g,w+=f+y)}return o};c.exports=v},47534:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=function(o,r,n){var e=a(n,"frameWidth",null),i=a(n,"frameHeight",e);if(!e)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var h=o.source[0];o.add("__BASE",0,0,0,h.width,h.height),a(n,"startFrame",0),a(n,"endFrame",-1);for(var s=a(n,"margin",0),l=a(n,"spacing",0),f=r.cutX,u=r.cutY,d=r.cutWidth,p=r.cutHeight,g=r.realWidth,y=r.realHeight,x=Math.floor((g-s+l)/(e+l)),T=Math.floor((y-s+l)/(i+l)),C=r.x,M=e-C,w=e-(g-d-C),L=r.y,F=i-L,O=i-(y-p-L),N,G=s,V=s,j=0,K=0,J=0;J{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=0,t=function(v,o,r,n){var e=m-n.y-n.height;v.add(r,o,n.x,e,n.width,n.height)},a=function(v,o,r){var n=v.source[o];v.add("__BASE",o,0,0,n.width,n.height),m=n.height;for(var e=r.split(` -`),i=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",s="",l={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 a=t(50030),v=function(h){for(var s=h.mipmaps,l=1;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({initialize:function(r,n,e,i,h,s,l){(e===void 0||e<=0)&&(e=32),(i===void 0||i<=0)&&(i=32),h===void 0&&(h=0),s===void 0&&(s=0),this.name=r,this.firstgid=n|0,this.imageWidth=e|0,this.imageHeight=i|0,this.imageMargin=h|0,this.imageSpacing=s|0,this.properties=l||{},this.images=[],this.total=0},containsImageIndex:function(o){return o>=this.firstgid&&o{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=new a({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 a=t(80341),v=t(87010),o=t(46177),r=t(49075),n=function(e,i,h,s,l,f,u,d){h===void 0&&(h=32),s===void 0&&(s=32),l===void 0&&(l=10),f===void 0&&(f=10),d===void 0&&(d=!1);var p=null;if(Array.isArray(u)){var g=i!==void 0?i:"map";p=o(g,a.ARRAY_2D,u,h,s,d)}else if(i!==void 0){var y=e.cache.tilemap.get(i);y?p=o(i,y.format,y.data,h,s,d):console.warn("No map data found for key "+i)}return p===null&&(p=new v({tileWidth:h,tileHeight:s,width:l,height:f})),new r(e,p)};c.exports=n},23029:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(31401),o=t(91907),r=t(62644),n=t(93232),e=new a({Mixins:[v.AlphaSingle,v.Flip,v.Visible],initialize:function(h,s,l,f,u,d,p,g){this.layer=h,this.index=s,this.x=l,this.y=f,this.width=u,this.height=d,this.right,this.bottom,this.baseWidth=p!==void 0?p:u,this.baseHeight=g!==void 0?g:d,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(i,h){return!(ithis.right||h>this.bottom)},copy:function(i){return this.index=i.index,this.alpha=i.alpha,this.properties=r(i.properties),this.visible=i.visible,this.setFlip(i.flipX,i.flipY),this.tint=i.tint,this.rotation=i.rotation,this.collideUp=i.collideUp,this.collideDown=i.collideDown,this.collideLeft=i.collideLeft,this.collideRight=i.collideRight,this.collisionCallback=i.collisionCallback,this.collisionCallbackContext=i.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(i){var h=this.tilemapLayer;if(h){var s=h.tileToWorldXY(this.x,this.y,void 0,i);return s.x}return this.x*this.baseWidth},getRight:function(i){var h=this.tilemapLayer;return h?this.getLeft(i)+this.width*h.scaleX:this.getLeft(i)+this.width},getTop:function(i){var h=this.tilemapLayer;if(h){var s=h.tileToWorldXY(this.x,this.y,void 0,i);return s.y}return this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(i){var h=this.tilemapLayer;return h?this.getTop(i)+this.height*h.scaleY:this.getTop(i)+this.height},getBounds:function(i,h){return h===void 0&&(h=new n),h.x=this.getLeft(i),h.y=this.getTop(i),h.width=this.getRight(i)-h.x,h.height=this.getBottom(i)-h.y,h},getCenterX:function(i){return(this.getLeft(i)+this.getRight(i))/2},getCenterY:function(i){return(this.getTop(i)+this.getBottom(i))/2},intersects:function(i,h,s,l){return!(s<=this.pixelX||l<=this.pixelY||i>=this.right||h>=this.bottom)},isInteresting:function(i,h){return i&&h?this.canCollide||this.hasInterestingFace:i?this.collides:h?this.hasInterestingFace:!1},resetCollision:function(i){if(i===void 0&&(i=!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,i){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(i,h,s,l,f){if(h===void 0&&(h=i),s===void 0&&(s=i),l===void 0&&(l=i),f===void 0&&(f=!0),this.collideLeft=i,this.collideRight=h,this.collideUp=s,this.collideDown=l,this.faceLeft=i,this.faceRight=h,this.faceTop=s,this.faceBottom=l,f){var u=this.tilemapLayer;u&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},setCollisionCallback:function(i,h){return i===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=i,this.collisionCallbackContext=h),this},setSize:function(i,h,s,l){return i!==void 0&&(this.width=i),h!==void 0&&(this.height=h),s!==void 0&&(this.baseWidth=s),l!==void 0&&(this.baseHeight=l),this.updatePixelXY(),this},updatePixelXY:function(){var i=this.layer.orientation;if(i===o.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(i===o.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(i===o.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(i===o.HEXAGONAL){var h=this.layer.staggerAxis,s=this.layer.staggerIndex,l=this.layer.hexSideLength,f,u;h==="y"?(u=(this.baseHeight-l)/2+l,s==="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*u):h==="x"&&(f=(this.baseWidth-l)/2+l,this.pixelX=this.x*f,s==="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 i=this.layer.tilemapLayer;if(i){var h=i.gidMap[this.index];if(h)return h}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var i=this.tilemapLayer;return i?i.tilemap:null}}});c.exports=e},49075:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(84101),v=t(83419),o=t(39506),r=t(80341),n=t(95540),e=t(14977),i=t(27462),h=t(91907),s=t(36305),l=t(19133),f=t(68287),u=t(23029),d=t(81086),p=t(20442),g=t(33629),y=new v({initialize:function(T,C){this.scene=T,this.tileWidth=C.tileWidth,this.tileHeight=C.tileHeight,this.width=C.width,this.height=C.height,this.orientation=C.orientation,this.renderOrder=C.renderOrder,this.format=C.format,this.version=C.version,this.properties=C.properties,this.widthInPixels=C.widthInPixels,this.heightInPixels=C.heightInPixels,this.imageCollections=C.imageCollections,this.images=C.images,this.layers=C.layers,this.tiles=C.tiles,this.tilesets=C.tilesets,this.objects=C.objects,this.currentLayerIndex=0,this.hexSideLength=C.hexSideLength;var M=this.orientation;this._convert={WorldToTileXY:d.GetWorldToTileXYFunction(M),WorldToTileX:d.GetWorldToTileXFunction(M),WorldToTileY:d.GetWorldToTileYFunction(M),TileToWorldXY:d.GetTileToWorldXYFunction(M),TileToWorldX:d.GetTileToWorldXFunction(M),TileToWorldY:d.GetTileToWorldYFunction(M),GetTileCorners:d.GetTileCornersFunction(M)}},setRenderOrder:function(x){var T=["right-down","left-down","right-up","left-up"];return typeof x=="number"&&(x=T[x]),T.indexOf(x)>-1&&(this.renderOrder=x),this},addTilesetImage:function(x,T,C,M,w,L,F,O){if(x===void 0)return null;T==null&&(T=x);var N=this.scene.sys.textures;if(!N.exists(T))return console.warn('Texture key "%s" not found',T),null;var G=N.get(T),V=this.getTilesetIndex(x);if(V===null&&this.format===r.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',x,this.tilesets),null;var j=this.tilesets[V];return j?(j.setTileSize(C,M),j.setSpacing(w,L),j.setImage(G),j):(C===void 0&&(C=this.tileWidth),M===void 0&&(M=this.tileHeight),w===void 0&&(w=0),L===void 0&&(L=0),F===void 0&&(F=0),O===void 0&&(O={x:0,y:0}),j=new g(x,F,C,M,w,L,void 0,void 0,O),j.setImage(G),this.tilesets.push(j),this.tiles=a(this),j)},copy:function(x,T,C,M,w,L,F,O){return O=this.getLayer(O),O!==null?(d.Copy(x,T,C,M,w,L,F,O),this):null},createBlankLayer:function(x,T,C,M,w,L,F,O){C===void 0&&(C=0),M===void 0&&(M=0),w===void 0&&(w=this.width),L===void 0&&(L=this.height),F===void 0&&(F=this.tileWidth),O===void 0&&(O=this.tileHeight);var N=this.getLayerIndex(x);if(N!==null)return console.warn("Invalid Tilemap Layer ID: "+x),null;for(var G=new e({name:x,tileWidth:F,tileHeight:O,width:w,height:L,orientation:this.orientation}),V,j=0;j-1&&this.putTileAt(T,L.x,L.y,C,L.tilemapLayer)}return M},removeTileAt:function(x,T,C,M,w){return C===void 0&&(C=!0),M===void 0&&(M=!0),w=this.getLayer(w),w===null?null:d.RemoveTileAt(x,T,C,M,w)},removeTileAtWorldXY:function(x,T,C,M,w,L){return C===void 0&&(C=!0),M===void 0&&(M=!0),L=this.getLayer(L),L===null?null:d.RemoveTileAtWorldXY(x,T,C,M,w,L)},renderDebug:function(x,T,C){return C=this.getLayer(C),C===null?null:(this.orientation===h.ORTHOGONAL&&d.RenderDebug(x,T,C),this)},renderDebugFull:function(x,T){for(var C=this.layers,M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(44603),v=t(31989);a.register("tilemap",function(o){var r=o!==void 0?o:{};return v(this.scene,r.key,r.tileWidth,r.tileHeight,r.width,r.height,r.data,r.insertNull)})},46029:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(39429),v=t(31989);a.register("tilemap",function(o,r,n,e,i,h,s){return o===null&&(o=void 0),r===null&&(r=void 0),n===null&&(n=void 0),e===null&&(e=void 0),i===null&&(i=void 0),v(this.scene,o,r,n,e,i,h,s)})},20442:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(78389),o=t(31401),r=t(95643),n=t(81086),e=t(19218),i=t(26099),h=new a({Extends:r,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.Transform,o.Visible,o.ScrollFactor,v,e],initialize:function(l,f,u,d,p,g){r.call(this,l,"TilemapLayer"),this.isTilemap=!0,this.tilemap=f,this.layerIndex=u,this.layer=f.layers[u],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 i,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(d),this.setAlpha(this.layer.alpha),this.setPosition(p,g),this.setOrigin(0,0),this.setSize(f.tileWidth*this.layer.width,f.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(s){var l=[],f=[],u=this.tilemap;Array.isArray(s)||(s=[s]);for(var d=0;d=0&&s<4&&(this._renderOrder=s),this},calculateFacesAt:function(s,l){return n.CalculateFacesAt(s,l,this.layer),this},calculateFacesWithin:function(s,l,f,u){return n.CalculateFacesWithin(s,l,f,u,this.layer),this},createFromTiles:function(s,l,f,u,d){return n.CreateFromTiles(s,l,f,u,d,this.layer)},cull:function(s){return this.cullCallback(this.layer,s,this.culledTiles,this._renderOrder)},copy:function(s,l,f,u,d,p,g){return n.Copy(s,l,f,u,d,p,g,this.layer),this},fill:function(s,l,f,u,d,p){return n.Fill(s,l,f,u,d,p,this.layer),this},filterTiles:function(s,l,f,u,d,p,g){return n.FilterTiles(s,l,f,u,d,p,g,this.layer)},findByIndex:function(s,l,f){return n.FindByIndex(s,l,f,this.layer)},findTile:function(s,l,f,u,d,p,g){return n.FindTile(s,l,f,u,d,p,g,this.layer)},forEachTile:function(s,l,f,u,d,p,g){return n.ForEachTile(s,l,f,u,d,p,g,this.layer),this},setTint:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(y){y.tint=s,y.tintFill=!1};return this.forEachTile(g,this,l,f,u,d,p)},setTintFill:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(y){y.tint=s,y.tintFill=!0};return this.forEachTile(g,this,l,f,u,d,p)},getTileAt:function(s,l,f){return n.GetTileAt(s,l,f,this.layer)},getTileAtWorldXY:function(s,l,f,u){return n.GetTileAtWorldXY(s,l,f,u,this.layer)},getIsoTileAtWorldXY:function(s,l,f,u,d){f===void 0&&(f=!0);var p=this.tempVec;return n.IsometricWorldToTileXY(s,l,!0,p,d,this.layer,f),this.getTileAt(p.x,p.y,u)},getTilesWithin:function(s,l,f,u,d){return n.GetTilesWithin(s,l,f,u,d,this.layer)},getTilesWithinShape:function(s,l,f){return n.GetTilesWithinShape(s,l,f,this.layer)},getTilesWithinWorldXY:function(s,l,f,u,d,p){return n.GetTilesWithinWorldXY(s,l,f,u,d,p,this.layer)},hasTileAt:function(s,l){return n.HasTileAt(s,l,this.layer)},hasTileAtWorldXY:function(s,l,f){return n.HasTileAtWorldXY(s,l,f,this.layer)},putTileAt:function(s,l,f,u){return n.PutTileAt(s,l,f,u,this.layer)},putTileAtWorldXY:function(s,l,f,u,d){return n.PutTileAtWorldXY(s,l,f,u,d,this.layer)},putTilesAt:function(s,l,f,u){return n.PutTilesAt(s,l,f,u,this.layer),this},randomize:function(s,l,f,u,d){return n.Randomize(s,l,f,u,d,this.layer),this},removeTileAt:function(s,l,f,u){return n.RemoveTileAt(s,l,f,u,this.layer)},removeTileAtWorldXY:function(s,l,f,u,d){return n.RemoveTileAtWorldXY(s,l,f,u,d,this.layer)},renderDebug:function(s,l){return n.RenderDebug(s,l,this.layer),this},replaceByIndex:function(s,l,f,u,d,p){return n.ReplaceByIndex(s,l,f,u,d,p,this.layer),this},setSkipCull:function(s){return s===void 0&&(s=!0),this.skipCull=s,this},setCullPadding:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=1),this.cullPaddingX=s,this.cullPaddingY=l,this},setCollision:function(s,l,f,u){return n.SetCollision(s,l,f,this.layer,u),this},setCollisionBetween:function(s,l,f,u){return n.SetCollisionBetween(s,l,f,u,this.layer),this},setCollisionByProperty:function(s,l,f){return n.SetCollisionByProperty(s,l,f,this.layer),this},setCollisionByExclusion:function(s,l,f){return n.SetCollisionByExclusion(s,l,f,this.layer),this},setCollisionFromCollisionGroup:function(s,l){return n.SetCollisionFromCollisionGroup(s,l,this.layer),this},setTileIndexCallback:function(s,l,f){return n.SetTileIndexCallback(s,l,f,this.layer),this},setTileLocationCallback:function(s,l,f,u,d,p){return n.SetTileLocationCallback(s,l,f,u,d,p,this.layer),this},shuffle:function(s,l,f,u){return n.Shuffle(s,l,f,u,this.layer),this},swapByIndex:function(s,l,f,u,d,p){return n.SwapByIndex(s,l,f,u,d,p,this.layer),this},tileToWorldX:function(s,l){return this.tilemap.tileToWorldX(s,l,this)},tileToWorldY:function(s,l){return this.tilemap.tileToWorldY(s,l,this)},tileToWorldXY:function(s,l,f,u){return this.tilemap.tileToWorldXY(s,l,f,u,this)},getTileCorners:function(s,l,f){return this.tilemap.getTileCorners(s,l,f,this)},weightedRandomize:function(s,l,f,u,d){return n.WeightedRandomize(l,f,u,d,s,this.layer),this},worldToTileX:function(s,l,f){return this.tilemap.worldToTileX(s,l,f,this)},worldToTileY:function(s,l,f){return this.tilemap.worldToTileY(s,l,f,this)},worldToTileXY:function(s,l,f,u,d){return this.tilemap.worldToTileXY(s,l,f,u,d,this)},destroy:function(s){s===void 0&&(s=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),s&&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))}});c.exports=h},16153:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61340),v=new a,o=new a,r=new a,n=function(e,i,h,s){var l=i.cull(h),f=l.length,u=h.alpha*i.alpha;if(!(f===0||u<=0)){var d=v,p=o,g=r;p.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),d.copyFrom(h.matrix);var y=e.currentContext,x=i.gidMap;y.save(),s?(d.multiplyWithOffset(s,-h.scrollX*i.scrollFactorX,-h.scrollY*i.scrollFactorY),p.e=i.x,p.f=i.y,d.multiply(p,g),g.copyToContext(y)):(p.e-=h.scrollX*i.scrollFactorX,p.f-=h.scrollY*i.scrollFactorY,p.copyToContext(y)),(!e.antialias||i.scaleX>1||i.scaleY>1)&&(y.imageSmoothingEnabled=!1);for(var T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(29747),v=a,o=a;v=t(99558),o=t(16153),c.exports={renderWebGL:v,renderCanvas:o}},99558:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70554),v=function(o,r,n){var e=r.cull(n),i=e.length,h=n.alpha*r.alpha;if(!(i===0||h<=0)){var s=r.gidMap,l=o.pipelines.set(r.pipeline,r),f=a.getTintAppendFloatAlpha,u=r.scrollFactorX,d=r.scrollFactorY,p=r.x,g=r.y,y=r.scaleX,x=r.scaleY;o.pipelines.preBatch(r);for(var T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(26099),o=new a({initialize:function(n,e,i,h,s,l,f,u,d){(i===void 0||i<=0)&&(i=32),(h===void 0||h<=0)&&(h=32),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f={}),u===void 0&&(u={}),this.name=n,this.firstgid=e,this.tileWidth=i,this.tileHeight=h,this.tileMargin=s,this.tileSpacing=l,this.tileProperties=f,this.tileData=u,this.tileOffset=new v,d!==void 0&&this.tileOffset.set(d.x,d.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,i){e===void 0&&(e=0),i===void 0&&(i=0);var h=(n-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),s=(r-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(h%1!==0||s%1!==0)&&console.warn("Image tile area not tile size multiple in: "+this.name),h=Math.floor(h),s=Math.floor(s),this.rows=h,this.columns=s,this.total=h*s,this.texCoordinates.length=0;for(var l=this.tileMargin+e,f=this.tileMargin+i,u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7423),v=function(o,r,n){var e=a(o,r,!0,n),i=a(o,r-1,!0,n),h=a(o,r+1,!0,n),s=a(o-1,r,!0,n),l=a(o+1,r,!0,n),f=e&&e.collides;return f&&(e.faceTop=!0,e.faceBottom=!0,e.faceLeft=!0,e.faceRight=!0),i&&i.collides&&(f&&(e.faceTop=!1),i.faceBottom=!f),h&&h.collides&&(f&&(e.faceBottom=!1),h.faceTop=!f),s&&s.collides&&(f&&(e.faceLeft=!1),s.faceRight=!f),l&&l.collides&&(f&&(e.faceRight=!1),l.faceLeft=!f),e&&!e.collides&&e.resetFaces(),e};c.exports=v},42573:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7423),v=t(7386),o=function(r,n,e,i,h){for(var s=null,l=null,f=null,u=null,d=v(r,n,e,i,null,h),p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=new a,o=function(r,n,e,i){var h=e.tilemapLayer,s=h.cullPaddingX,l=h.cullPaddingY,f=h.tilemap.tileToWorldXY(r,n,v,i,h);return f.x>i.worldView.x+h.scaleX*e.tileWidth*(-s-.5)&&f.xi.worldView.y+h.scaleY*e.tileHeight*(-l-1)&&f.y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(42573),v=t(7386),o=t(62991),r=t(23029),n=function(e,i,h,s,l,f,u,d){u===void 0&&(u=!0);var p=v(e,i,h,s,null,d),g=[];p.forEach(function(L){var F=new r(L.layer,L.index,L.x,L.y,L.width,L.height,L.baseWidth,L.baseHeight);F.copy(L),g.push(F)});for(var y=l-e,x=f-i,T=0;T{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62644),v=t(7386),o=t(27987),r=function(n,e,i,h,s,l){i||(i={}),Array.isArray(n)||(n=[n]);var f=l.tilemapLayer;h||(h=f.scene),s||(s=h.cameras.main);var u=l.width,d=l.height,p=v(0,0,u,d,null,l),g=[],y,x=function(w,L,F){for(var O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(87841),v=t(63448),o=t(56583),r=new a,n=function(e,i){var h=e.tilemapLayer.tilemap,s=e.tilemapLayer,l=Math.floor(h.tileWidth*s.scaleX),f=Math.floor(h.tileHeight*s.scaleY),u=o(i.worldView.x-s.x,l,0,!0)-s.cullPaddingX,d=v(i.worldView.right-s.x,l,0,!0)+s.cullPaddingX,p=o(i.worldView.y-s.y,f,0,!0)-s.cullPaddingY,g=v(i.worldView.bottom-s.y,f,0,!0)+s.cullPaddingY;return r.setTo(u,p,d-u,g-p)};c.exports=n},30003:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19545),v=t(32483),o=function(r,n,e,i){e===void 0&&(e=[]),i===void 0&&(i=0),e.length=0;var h=r.tilemapLayer,s=a(r,n);return(h.skipCull||h.scrollFactorX!==1||h.scrollFactorY!==1)&&(s.left=0,s.right=r.width,s.top=0,s.bottom=r.height),v(r,s,i,e),e};c.exports=o},35137:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=t(42573),o=t(20576),r=function(n,e,i,h,s,l,f){for(var u=f.collideIndexes.indexOf(n)!==-1,d=a(e,i,h,s,null,f),p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=function(o,r,n,e,i,h,s,l){var f=a(n,e,i,h,s,l);return f.filter(o,r)};c.exports=v},52692:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a===void 0&&(a=0),v===void 0&&(v=!1);var r=0,n,e,i;if(v){for(e=o.height-1;e>=0;e--)for(n=o.width-1;n>=0;n--)if(i=o.data[e][n],i&&i.index===t){if(r===a)return i;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 a=t(7386),v=function(o,r,n,e,i,h,s,l){var f=a(n,e,i,h,s,l);return f.find(o,r)||null};c.exports=v},97560:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=function(o,r,n,e,i,h,s,l){var f=a(n,e,i,h,s,l);f.forEach(o,r)};c.exports=v},43305:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(30003),o=t(9474),r=t(14018),n=t(29747),e=t(54503),i=function(h){return h===a.ORTHOGONAL?v:h===a.HEXAGONAL?o:h===a.STAGGERED?e:h===a.ISOMETRIC?r:n};c.exports=i},7423:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62991),v=function(o,r,n,e){if(n===void 0&&(n=!1),a(o,r,e)){var i=e.data[r][o]||null;return i?i.index===-1?n?i:null:i:null}else return null};c.exports=v},60540:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7423),v=t(26099),o=new v,r=function(n,e,i,h,s){return s.tilemapLayer.worldToTileXY(n,e,!0,o,h),a(o.x,o.y,i,s)};c.exports=r},55826:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e){var i=e.baseTileWidth,h=e.baseTileHeight,s=e.tilemapLayer,l=0,f=0;s&&(n||(n=s.scene.cameras.main),l=s.x+n.scrollX*(1-s.scrollFactorX),f=s.y+n.scrollY*(1-s.scrollFactorY),i*=s.scaleX,h*=s.scaleY);var u=l+o*i,d=f+r*h;return[new a(u,d),new a(u+i,d),new a(u+i,d+h),new a(u,d+h)]};c.exports=v},11758:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(27229),o=t(29747),r=t(55826),n=function(e){return e===a.ORTHOGONAL?r:e===a.ISOMETRIC?o:e===a.HEXAGONAL?v:(e===a.STAGGERED,o)};c.exports=n},39167:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(29747),o=t(97281),r=function(n){return n===a.ORTHOGONAL?o:v};c.exports=r},62e3:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(19951),o=t(14127),r=t(29747),n=t(97202),e=t(70326),i=function(h){return h===a.ORTHOGONAL?e:h===a.ISOMETRIC?o:h===a.HEXAGONAL?v:h===a.STAGGERED?n:r};c.exports=i},5984:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(29747),o=t(28054),r=t(29650),n=function(e){return e===a.ORTHOGONAL?r:e===a.STAGGERED?o:v};c.exports=n},7386:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=function(o,r,n,e,i,h){o===void 0&&(o=0),r===void 0&&(r=0),n===void 0&&(n=h.width),e===void 0&&(e=h.height),i||(i={});var s=a(i,"isNotEmpty",!1),l=a(i,"isColliding",!1),f=a(i,"hasInterestingFace",!1);o<0&&(n+=o,o=0),r<0&&(e+=r,r=0),o+n>h.width&&(n=Math.max(h.width-o,0)),r+e>h.height&&(e=Math.max(h.height-r,0));for(var u=[],d=r;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(55738),v=t(7386),o=t(91865),r=t(29747),n=t(26099),e=function(f,u){return o.RectangleToTriangle(u,f)},i=new n,h=new n,s=new n,l=function(f,u,d,p){if(f===void 0)return[];var g=r;f instanceof a.Circle?g=o.CircleToRectangle:f instanceof a.Rectangle?g=o.RectangleToRectangle:f instanceof a.Triangle?g=e:f instanceof a.Line&&(g=o.LineToRectangle),p.tilemapLayer.worldToTileXY(f.left,f.top,!0,h,d);var y=h.x,x=h.y;p.tilemapLayer.worldToTileXY(f.right,f.bottom,!1,s,d);var T=Math.ceil(s.x),C=Math.ceil(s.y),M=Math.max(T-y,1),w=Math.max(C-x,1),L=v(y,x,M,w,u,p),F=p.tileWidth,O=p.tileHeight;p.tilemapLayer&&(F*=p.tilemapLayer.scaleX,O*=p.tilemapLayer.scaleY);for(var N=[],G=new a.Rectangle(0,0,F,O),V=0;V{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=t(26099),o=new v,r=new v,n=function(e,i,h,s,l,f,u){var d=u.tilemapLayer.tilemap._convert.WorldToTileXY;d(e,i,!0,o,f,u);var p=o.x,g=o.y;d(e+h,i+s,!1,r,f,u);var y=Math.ceil(r.x),x=Math.ceil(r.y);return a(p,g,y-p,x-g,l,u)};c.exports=n},96113:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(20242),o=t(10095),r=function(n){return n===a.ORTHOGONAL?o:v};c.exports=r},16926:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(86625),o=t(96897),r=t(29747),n=t(15108),e=t(85896),i=function(h){return h===a.ORTHOGONAL?e:h===a.ISOMETRIC?o:h===a.HEXAGONAL?v:h===a.STAGGERED?n:r};c.exports=i},55762:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=t(20242),o=t(51900),r=t(63288),n=function(e){return e===a.ORTHOGONAL?r:e===a.STAGGERED?o:v};c.exports=n},45091:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62991),v=function(o,r,n){if(a(o,r,n)){var e=n.data[r][o];return e!==null&&e.index>-1}else return!1};c.exports=v},24152:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(45091),v=t(26099),o=new v,r=function(n,e,i,h){h.tilemapLayer.worldToTileXY(n,e,!0,o,i);var s=o.x,l=o.y;return a(s,l,h)};c.exports=r},90454:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(63448),v=t(56583),o=function(r,n){var e=r.tilemapLayer.tilemap,i=r.tilemapLayer,h=Math.floor(e.tileWidth*i.scaleX),s=Math.floor(e.tileHeight*i.scaleY),l=r.hexSideLength,f,u,d,p;if(r.staggerAxis==="y"){var g=(s-l)/2+l;f=v(n.worldView.x-i.x,h,0,!0)-i.cullPaddingX,u=a(n.worldView.right-i.x,h,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,g,0,!0)-i.cullPaddingY,p=a(n.worldView.bottom-i.y,g,0,!0)+i.cullPaddingY}else{var y=(h-l)/2+l;f=v(n.worldView.x-i.x,y,0,!0)-i.cullPaddingX,u=a(n.worldView.right-i.x,y,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,s,0,!0)-i.cullPaddingY,p=a(n.worldView.bottom-i.y,s,0,!0)+i.cullPaddingY}return{left:f,right:u,top:d,bottom:p}};c.exports=o},9474:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(90454),v=t(32483),o=function(r,n,e,i){e===void 0&&(e=[]),i===void 0&&(i=0),e.length=0;var h=r.tilemapLayer,s=a(r,n);return h.skipCull&&h.scrollFactorX===1&&h.scrollFactorY===1&&(s.left=0,s.right=r.width,s.top=0,s.bottom=r.height),v(r,s,i,e),e};c.exports=o},27229:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19951),v=t(26099),o=new v,r=function(n,e,i,h){var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(s*=f.scaleX,l*=f.scaleY);var u=a(n,e,o,i,h),d=[],p=.5773502691896257,g,y;h.staggerAxis==="y"?(g=p*s,y=l/2):(g=s/2,y=p*l);for(var x=0;x<6;x++){var T=2*Math.PI*(.5-x)/6;d.push(new v(u.x+g*Math.cos(T),u.y+y*Math.sin(T)))}return d};c.exports=r},19951:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i){n||(n=new a);var h=i.baseTileWidth,s=i.baseTileHeight,l=i.tilemapLayer,f=0,u=0;l&&(e||(e=l.scene.cameras.main),f=l.x+e.scrollX*(1-l.scrollFactorX),u=l.y+e.scrollY*(1-l.scrollFactorY),h*=l.scaleX,s*=l.scaleY);var d=h/2,p=s/2,g,y;return i.staggerAxis==="y"?(g=f+h*o+h,y=u+1.5*r*p+p,r%2===0&&(this.staggerIndex==="odd"?g-=d:g+=d)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(g=f+1.5*o*d+d,y=u+s*o+s,o%2===0&&(this.staggerIndex==="odd"?y-=p:y+=p)),n.set(g,y)};c.exports=v},86625:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i,h){e||(e=new a);var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(i||(i=f.scene.cameras.main),o=o-(f.x+i.scrollX*(1-f.scrollFactorX)),r=r-(f.y+i.scrollY*(1-f.scrollFactorY)),s*=f.scaleX,l*=f.scaleY);var u=.5773502691896257,d=-.3333333333333333,p=0,g=.6666666666666666,y=s/2,x=l/2,T,C,M,w,L;h.staggerAxis==="y"?(T=(o-y)/(u*s),C=(r-x)/x,M=u*T+d*C,w=p*T+g*C):(T=(o-y)/y,C=(r-x)/(u*l),M=d*T+u*C,w=g*T+p*C),L=-M-w;var F=Math.round(M),O=Math.round(w),N=Math.round(L),G=Math.abs(F-M),V=Math.abs(O-w),j=Math.abs(N-L);G>V&&G>j?F=-O-N:V>j&&(O=-F-N);var K,J=O;return h.staggerIndex==="odd"?K=J%2===0?O/2+F:O/2+F-.5:K=J%2===0?O/2+F:O/2+F+.5,e.set(K,J)};c.exports=v},62991:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t>=0&&t=0&&a{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33528),v=function(o,r,n,e){n===void 0&&(n=[]),e===void 0&&(e=0),n.length=0;var i=o.tilemapLayer,h=o.data,s=o.width,l=o.height,f=i.skipCull,u=0,d=s,p=0,g=l,y,x,T;if(e===0)for(x=p;x=u;y--)T=h[x][y],!(!T||T.index===-1||!T.visible||T.alpha===0)&&(!f&&!a(y,x,o,r)||n.push(T));else if(e===2)for(x=g;x>=p;x--)for(y=u;y=p;x--)for(y=d;y>=u;y--)T=h[x][y],!(!T||T.index===-1||!T.visible||T.alpha===0)&&(!f&&!a(y,x,o,r)||n.push(T));return i.tilesDrawn=n.length,i.tilesTotal=s*l,n};c.exports=v},14127:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i){n||(n=new a);var h=i.baseTileWidth,s=i.baseTileHeight,l=i.tilemapLayer,f=0,u=0;l&&(e||(e=l.scene.cameras.main),f=l.x+e.scrollX*(1-l.scrollFactorX),h*=l.scaleX,u=l.y+e.scrollY*(1-l.scrollFactorY),s*=l.scaleY);var d=f+(o-r)*(h/2),p=u+(o+r)*(s/2);return n.set(d,p)};c.exports=v},96897:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i,h,s){e||(e=new a);var l=h.baseTileWidth,f=h.baseTileHeight,u=h.tilemapLayer;u&&(i||(i=u.scene.cameras.main),r=r-(u.y+i.scrollY*(1-u.scrollFactorY)),f*=u.scaleY,o=o-(u.x+i.scrollX*(1-u.scrollFactorX)),l*=u.scaleX);var d=l/2,p=f/2;o=o-d,s||(r=r-f);var g=.5*(o/d+r/p),y=.5*(-o/d+r/p);return n&&(g=Math.floor(g),y=Math.floor(y)),e.set(g,y)};c.exports=v},71558:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23029),v=t(62991),o=t(72023),r=t(20576),n=function(e,i,h,s,l){if(s===void 0&&(s=!0),!v(i,h,l))return null;var f,u=l.data[h][i],d=u&&u.collides;e instanceof a?(l.data[h][i]===null&&(l.data[h][i]=new a(l,e.index,i,h,l.tileWidth,l.tileHeight)),l.data[h][i].copy(e)):(f=e,l.data[h][i]===null?l.data[h][i]=new a(l,f,i,h,l.tileWidth,l.tileHeight):l.data[h][i].index=f);var p=l.data[h][i],g=l.collideIndexes.indexOf(p.index)!==-1;if(f=e instanceof a?e.index:e,f===-1)p.width=l.tileWidth,p.height=l.tileHeight;else{var y=l.tilemapLayer.tilemap,x=y.tiles,T=x[f][2],C=y.tilesets[T];p.width=C.tileWidth,p.height=C.tileHeight}return r(p,g),s&&d!==p.collides&&o(i,h,l),p};c.exports=n},26303:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(71558),v=t(26099),o=new v,r=function(n,e,i,h,s,l){return l.tilemapLayer.worldToTileXY(e,i,!0,o,s,l),a(n,o.x,o.y,h,l)};c.exports=r},14051:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(42573),v=t(71558),o=function(r,n,e,i,h){if(i===void 0&&(i=!0),!Array.isArray(r))return null;Array.isArray(r[0])||(r=[r]);for(var s=r.length,l=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 a=t(7386),v=t(26546),o=function(r,n,e,i,h,s){var l,f=a(r,n,e,i,{},s);if(!h)for(h=[],l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(23029),v=t(62991),o=t(72023),r=function(n,e,i,h,s){if(i===void 0&&(i=!0),h===void 0&&(h=!0),!v(n,e,s))return null;var l=s.data[e][n];if(l)s.data[e][n]=i?null:new a(s,-1,n,e,s.tileWidth,s.tileHeight);else return null;return h&&l&&l.collides&&o(n,e,s),l};c.exports=r},94178:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(63557),v=t(26099),o=new v,r=function(n,e,i,h,s,l){return l.tilemapLayer.worldToTileXY(n,e,!0,o,s,l),a(o.x,o.y,i,h,l)};c.exports=r},15533:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=t(3956),o=new v(105,210,231,150),r=new v(243,134,48,200),n=new v(40,39,37,150),e=function(i,h,s){h===void 0&&(h={});var l=h.tileColor!==void 0?h.tileColor:o,f=h.collidingTileColor!==void 0?h.collidingTileColor:r,u=h.faceColor!==void 0?h.faceColor:n,d=a(0,0,s.width,s.height,null,s);i.translateCanvas(s.tilemapLayer.x,s.tilemapLayer.y),i.scaleCanvas(s.tilemapLayer.scaleX,s.tilemapLayer.scaleY);for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=function(o,r,n,e,i,h,s){for(var l=a(n,e,i,h,null,s),f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=t.data,n=t.width,e=t.height,i=t.tilemapLayer,h=Math.max(0,a.left),s=Math.min(n,a.right),l=Math.max(0,a.top),f=Math.min(e,a.bottom),u,d,p;if(v===0)for(d=l;d=h;u--)p=r[d][u],!(!p||p.index===-1||!p.visible||p.alpha===0)&&o.push(p);else if(v===2)for(d=f;d>=l;d--)for(u=h;r[d]&&u=l;d--)for(u=s;r[d]&&u>=h;u--)p=r[d][u],!(!p||p.index===-1||!p.visible||p.alpha===0)&&o.push(p);return i.tilesDrawn=o.length,i.tilesTotal=n*e,o};c.exports=m},57068:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20576),v=t(42573),o=t(9589),r=function(n,e,i,h,s){e===void 0&&(e=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),Array.isArray(n)||(n=[n]);for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20576),v=t(42573),o=t(9589),r=function(n,e,i,h,s,l){if(i===void 0&&(i=!0),h===void 0&&(h=!0),l===void 0&&(l=!0),!(n>e)){for(var f=n;f<=e;f++)o(f,i,s);if(l)for(var u=0;u=n&&p.index<=e&&a(p,i)}h&&v(0,0,s.width,s.height,s)}};c.exports=r},75661:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(20576),v=t(42573),o=t(9589),r=function(n,e,i,h){e===void 0&&(e=!0),i===void 0&&(i=!0),Array.isArray(n)||(n=[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 a=t(20576),v=t(42573),o=t(97022),r=function(n,e,i,h){e===void 0&&(e=!0),i===void 0&&(i=!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 a=t(20576),v=t(42573),o=function(r,n,e){r===void 0&&(r=!0),n===void 0&&(n=!0);for(var i=0;i0&&a(s,r)}}n&&v(0,0,e.width,e.height,e)};c.exports=o},9589:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=v.collideIndexes.indexOf(t);a&&o===-1?v.collideIndexes.push(t):!a&&o!==-1&&v.collideIndexes.splice(o,1)};c.exports=m},20576:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)};c.exports=m},79583:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){if(typeof t=="number")o.callbacks[t]=a!==null?{callback:a,callbackContext:v}: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 a=t(7386),v=function(o,r,n,e,i,h,s){for(var l=a(o,r,n,e,null,s),f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=t(33680),o=function(r,n,e,i,h){var s=a(r,n,e,i,null,h),l=s.map(function(u){return u.index});v(l);for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(63448),v=t(56583),o=function(r,n){var e=r.tilemapLayer.tilemap,i=r.tilemapLayer,h=Math.floor(e.tileWidth*i.scaleX),s=Math.floor(e.tileHeight*i.scaleY),l=v(n.worldView.x-i.x,h,0,!0)-i.cullPaddingX,f=a(n.worldView.right-i.x,h,0,!0)+i.cullPaddingX,u=v(n.worldView.y-i.y,s/2,0,!0)-i.cullPaddingY,d=a(n.worldView.bottom-i.y,s/2,0,!0)+i.cullPaddingY;return{left:l,right:f,top:u,bottom:d}};c.exports=o},54503:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(61325),v=t(32483),o=function(r,n,e,i){e===void 0&&(e=[]),i===void 0&&(i=0),e.length=0;var h=r.tilemapLayer,s=a(r,n);return h.skipCull&&h.scrollFactorX===1&&h.scrollFactorY===1&&(s.left=0,s.right=r.width,s.top=0,s.bottom=r.height),v(r,s,i,e),e};c.exports=o},97202:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i){n||(n=new a);var h=i.baseTileWidth,s=i.baseTileHeight,l=i.tilemapLayer,f=0,u=0;l&&(e||(e=l.scene.cameras.main),f=l.x+e.scrollX*(1-l.scrollFactorX),h*=l.scaleX,u=l.y+e.scrollY*(1-l.scrollFactorY),s*=l.scaleY);var d=f+o*h+r%2*(h/2),p=u+r*(s/2);return n.set(d,p)};c.exports=v},28054:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=v.baseTileHeight,r=v.tilemapLayer,n=0;return r&&(a===void 0&&(a=r.scene.cameras.main),n=r.y+a.scrollY*(1-r.scrollFactorY),o*=r.scaleY),n+t*(o/2)+o};c.exports=m},15108:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i,h){e||(e=new a);var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(i||(i=f.scene.cameras.main),r=r-(f.y+i.scrollY*(1-f.scrollFactorY)),l*=f.scaleY,o=o-(f.x+i.scrollX*(1-f.scrollFactorX)),s*=f.scaleX);var u=n?Math.floor(r/(l/2)):r/(l/2),d=n?Math.floor((o+u%2*.5*s)/s):(o+u%2*.5*s)/s;return e.set(d,u)};c.exports=v},51900:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=o.baseTileHeight,n=o.tilemapLayer;return n&&(v||(v=n.scene.cameras.main),t=t-(n.y+v.scrollY*(1-n.scrollFactorY)),r*=n.scaleY),a?Math.floor(t/(r/2)):t/(r/2)};c.exports=m},86560:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=function(o,r,n,e,i,h,s){for(var l=a(n,e,i,h,null,s),f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=v.baseTileWidth,r=v.tilemapLayer,n=0;return r&&(a||(a=r.scene.cameras.main),n=r.x+a.scrollX*(1-r.scrollFactorX),o*=r.scaleX),n+t*o};c.exports=m},70326:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(97281),v=t(29650),o=t(26099),r=function(n,e,i,h,s){return i||(i=new o(0,0)),i.x=a(n,h,s),i.y=v(e,h,s),i};c.exports=r},29650:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=v.baseTileHeight,r=v.tilemapLayer,n=0;return r&&(a||(a=r.scene.cameras.main),n=r.y+a.scrollY*(1-r.scrollFactorY),o*=r.scaleY),n+t*o};c.exports=m},77366:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(7386),v=t(75508),o=function(r,n,e,i,h,s){if(h){var l,f=a(r,n,e,i,null,s),u=0;for(l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(85896),v=t(26099),o=new v,r=function(n,e,i,h){return a(n,0,e,o,i,h),o.x};c.exports=r},85896:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(26099),v=function(o,r,n,e,i,h){n===void 0&&(n=!0),e||(e=new a);var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(i||(i=f.scene.cameras.main),o=o-(f.x+i.scrollX*(1-f.scrollFactorX)),r=r-(f.y+i.scrollY*(1-f.scrollFactorY)),s*=f.scaleX,l*=f.scaleY);var u=o/s,d=r/l;return n&&(u=Math.floor(u),d=Math.floor(d)),e.set(u,d)};c.exports=v},63288:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(85896),v=t(26099),o=new v,r=function(n,e,i,h){return a(0,n,e,o,i,h),o.y};c.exports=r},81086:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={ORIENTATION:t(91907)};c.exports=a},62501:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79291),v=t(21829),o={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)};o=a(!1,o,v.ORIENTATION),c.exports=o},14977:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(91907),o=t(95540),r=new a({initialize:function(e){e===void 0&&(e={}),this.name=o(e,"name","layer"),this.id=o(e,"id",0),this.x=o(e,"x",0),this.y=o(e,"y",0),this.width=o(e,"width",0),this.height=o(e,"height",0),this.tileWidth=o(e,"tileWidth",0),this.tileHeight=o(e,"tileHeight",0),this.baseTileWidth=o(e,"baseTileWidth",this.tileWidth),this.baseTileHeight=o(e,"baseTileHeight",this.tileHeight),this.orientation=o(e,"orientation",v.ORTHOGONAL),this.widthInPixels=o(e,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=o(e,"heightInPixels",this.height*this.baseTileHeight),this.alpha=o(e,"alpha",1),this.visible=o(e,"visible",!0),this.properties=o(e,"properties",[]),this.indexes=o(e,"indexes",[]),this.collideIndexes=o(e,"collideIndexes",[]),this.callbacks=o(e,"callbacks",[]),this.bodies=o(e,"bodies",[]),this.data=o(e,"data",[]),this.tilemapLayer=o(e,"tilemapLayer",null),this.hexSideLength=o(e,"hexSideLength",0),this.staggerAxis=o(e,"staggerAxis","y"),this.staggerIndex=o(e,"staggerIndex","odd")}});c.exports=r},87010:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(91907),o=t(95540),r=new a({initialize:function(e){e===void 0&&(e={}),this.name=o(e,"name","map"),this.width=o(e,"width",0),this.height=o(e,"height",0),this.infinite=o(e,"infinite",!1),this.tileWidth=o(e,"tileWidth",0),this.tileHeight=o(e,"tileHeight",0),this.widthInPixels=o(e,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=o(e,"heightInPixels",this.height*this.tileHeight),this.format=o(e,"format",null),this.orientation=o(e,"orientation",v.ORTHOGONAL),this.renderOrder=o(e,"renderOrder","right-down"),this.version=o(e,"version","1"),this.properties=o(e,"properties",{}),this.layers=o(e,"layers",[]),this.images=o(e,"images",[]),this.objects=o(e,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=o(e,"collision",{}),this.tilesets=o(e,"tilesets",[]),this.imageCollections=o(e,"imageCollections",[]),this.tiles=o(e,"tiles",[]),this.hexSideLength=o(e,"hexSideLength",0),this.staggerAxis=o(e,"staggerAxis","y"),this.staggerIndex=o(e,"staggerIndex","odd")}});c.exports=r},48700:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(95540),o=new a({initialize:function(n){n===void 0&&(n={}),this.name=v(n,"name","object layer"),this.id=v(n,"id",0),this.opacity=v(n,"opacity",1),this.properties=v(n,"properties",{}),this.propertyTypes=v(n,"propertytypes",{}),this.type=v(n,"type","objectgroup"),this.visible=v(n,"visible",!0),this.objects=v(n,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});c.exports=o},6641:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(91907),v=function(o){return o=o.toLowerCase(),o==="isometric"?a.ISOMETRIC:o==="staggered"?a.STAGGERED:o==="hexagonal"?a.HEXAGONAL:a.ORTHOGONAL};c.exports=v},46177:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(80341),v=t(2342),o=t(82593),r=t(46594),n=t(87021),e=function(i,h,s,l,f,u){var d;switch(h){case a.ARRAY_2D:d=v(i,s,l,f,u);break;case a.CSV:d=o(i,s,l,f,u);break;case a.TILED_JSON:d=r(i,s,u);break;case a.WELTMEISTER:d=n(i,s,u);break;default:console.warn("Unrecognized tilemap data format: "+h),d=null}return d};c.exports=e},2342:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(80341),v=t(14977),o=t(87010),r=t(23029),n=function(e,i,h,s,l){for(var f=new v({tileWidth:h,tileHeight:s}),u=new o({name:e,tileWidth:h,tileHeight:s,format:a.ARRAY_2D,layers:[f]}),d=[],p=i.length,g=0,y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(80341),v=t(2342),o=function(r,n,e,i,h){var s=n.trim().split(` -`).map(function(f){return f.split(",")}),l=v(r,s,e,i,h);return l.format=a.CSV,l};c.exports=o},6656:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(14977),v=t(23029),o=function(r,n){for(var e=[],i=0;i-1?g=new v(s,p,d,u,h.tilesize,h.tilesize):g=n?null:new v(s,-1,d,u,h.tilesize,h.tilesize),l.push(g)}f.push(l),l=[]}s.data=f,e.push(s)}return e};c.exports=o},96483:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33629),v=function(o){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 a=t(80341),v=t(87010),o=t(6656),r=t(96483),n=function(e,i,h){if(i.layer.length===0)return console.warn("No layers found in the Weltmeister map: "+e),null;for(var s=0,l=0,f=0;fs&&(s=i.layer[f].width),i.layer[f].height>l&&(l=i.layer[f].height);var u=new v({width:s,height:l,name:e,tileWidth:i.layer[0].tilesize,tileHeight:i.layer[0].tilesize,format:a.WELTMEISTER});return u.layers=o(i,h),u.tilesets=r(i),u};c.exports=n},52833:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={ParseTileLayers:t(6656),ParseTilesets:t(96483),ParseWeltmeister:t(87021)}},57442:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={FromOrientationString:t(6641),Parse:t(46177),Parse2DArray:t(2342),ParseCSV:t(82593),Impact:t(52833),Tiled:t(96761)}},51233:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(79291),v=function(o){for(var r,n,e,i,h,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){for(var a=window.atob(t),v=a.length,o=new Array(v/4),r=0;r>>0;return o};c.exports=m},84101:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33629),v=function(o){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 a=t(95540),v=function(o,r,n){if(!r)return{i:0,layers:o.layers,name:"",opacity:1,visible:!0,x:0,y:0};var e=r.x+a(r,"startx",0)*o.tilewidth+a(r,"offsetx",0),i=r.y+a(r,"starty",0)*o.tileheight+a(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+i}};c.exports=v},29920:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=2147483648,t=1073741824,a=536870912,v=function(o){var r=!!(o&m),n=!!(o&t),e=!!(o&a);o=o&~(m|t|a);var i=0,h=!1;return r&&n&&e?(i=Math.PI/2,h=!0):r&&n&&!e?(i=Math.PI,h=!1):r&&!n&&e?(i=Math.PI/2,h=!1):r&&!n&&!e?(i=0,h=!0):!r&&n&&e?(i=3*Math.PI/2,h=!1):!r&&n&&!e?(i=Math.PI,h=!0):!r&&!n&&e?(i=3*Math.PI/2,h=!0):!r&&!n&&!e&&(i=0,h=!1),{gid:o,flippedHorizontal:r,flippedVertical:n,flippedAntiDiagonal:e,rotation:i,flipped:h}};c.exports=v},12635:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=t(79677),o=function(r){for(var n=[],e=[],i=v(r);i.i0;){if(i.i>=i.layers.length){if(e.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}i=e.pop();continue}var h=i.layers[i.i];if(i.i++,h.type!=="imagelayer"){if(h.type==="group"){var s=v(r,h,i);e.push(i),i=s}continue}var l=a(h,"offsetx",0)+a(h,"startx",0),f=a(h,"offsety",0)+a(h,"starty",0);n.push({name:i.name+h.name,image:h.image,x:i.x+l+h.x,y:i.y+f+h.y,alpha:i.opacity*h.opacity,visible:i.visible&&h.visible,properties:a(h,"properties",{})})}return n};c.exports=o},46594:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(51233),v=t(84101),o=t(91907),r=t(62644),n=t(80341),e=t(6641),i=t(87010),h=t(12635),s=t(22611),l=t(28200),f=t(24619),u=function(d,p,g){var y=r(p),x=new i({width:y.width,height:y.height,name:d,tileWidth:y.tilewidth,tileHeight:y.tileheight,orientation:e(y.orientation),format:n.TILED_JSON,version:y.version,properties:y.properties,renderOrder:y.renderorder,infinite:y.infinite});x.orientation===o.HEXAGONAL&&(x.hexSideLength=y.hexsidelength,x.staggerAxis=y.staggeraxis,x.staggerIndex=y.staggerindex),x.layers=l(y,g),x.images=h(y);var T=f(y);return x.tilesets=T.tilesets,x.imageCollections=T.imageCollections,x.objects=s(y),x.tiles=v(x),a(x),x};c.exports=u},52205:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(18254),v=t(29920),o=function(e){return{x:e.x,y:e.y}},r=["id","name","type","rotation","properties","visible","x","y","width","height"],n=function(e,i,h){i===void 0&&(i=0),h===void 0&&(h=0);var s=a(e,r);if(s.x+=i,s.y+=h,e.gid){var l=v(e.gid);s.gid=l.gid,s.flippedHorizontal=l.flippedHorizontal,s.flippedVertical=l.flippedVertical,s.flippedAntiDiagonal=l.flippedAntiDiagonal}else e.polyline?s.polyline=e.polyline.map(o):e.polygon?s.polygon=e.polygon.map(o):e.ellipse?s.ellipse=e.ellipse:e.text?s.text=e.text:e.point?s.point=!0:s.rectangle=!0;return s};c.exports=n},22611:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95540),v=t(52205),o=t(48700),r=t(79677),n=function(e){for(var i=[],h=[],s=r(e);s.i0;){if(s.i>=s.layers.length){if(h.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=h.pop();continue}var l=s.layers[s.i];if(s.i++,l.opacity*=s.opacity,l.visible=s.visible&&l.visible,l.type!=="objectgroup"){if(l.type==="group"){var f=r(e,l,s);h.push(s),s=f}continue}l.name=s.name+l.name;for(var u=s.x+a(l,"startx",0)+a(l,"offsetx",0),d=s.y+a(l,"starty",0)+a(l,"offsety",0),p=[],g=0;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41868),v=t(91907),o=t(79677),r=t(6641),n=t(95540),e=t(14977),i=t(29920),h=t(23029),s=function(l,f){for(var u=n(l,"infinite",!1),d=[],p=[],g=o(l);g.i0;){if(g.i>=g.layers.length){if(p.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}g=p.pop();continue}var y=g.layers[g.i];if(g.i++,y.type!=="tilelayer"){if(y.type==="group"){var x=o(l,y,g);p.push(g),g=x}continue}if(y.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+y.name+"'");continue}else if(y.encoding&&y.encoding==="base64"){if(y.chunks)for(var T=0;T0?(w=new h(C,M.gid,W,H,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,F[H][W]=w):(L=f?null:new h(C,-1,W,H,l.tilewidth,l.tileheight),F[H][W]=L),O++,O===K.width&&(Y++,O=0)}}else{C=new e({name:g.name+y.name,id:y.id,x:g.x+n(y,"offsetx",0)+y.x,y:g.y+n(y,"offsety",0)+y.y,width:y.width,height:y.height,tileWidth:l.tilewidth,tileHeight:l.tileheight,alpha:g.opacity*y.opacity,visible:g.visible&&y.visible,properties:n(y,"properties",[]),orientation:r(l.orientation)}),C.orientation===v.HEXAGONAL&&(C.hexSideLength=l.hexsidelength,C.staggerAxis=l.staggeraxis,C.staggerIndex=l.staggerindex);for(var Z=[],Q=0,k=y.data.length;Q0?(w=new h(C,M.gid,O,F.length,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,Z.push(w)):(L=f?null:new h(C,-1,O,F.length,l.tilewidth,l.tileheight),Z.push(L)),O++,O===y.width&&(F.push(Z),O=0,Z=[])}C.data=F,d.push(C)}return d};c.exports=s},24619:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(33629),v=t(16536),o=t(52205),r=t(57880),n=function(e){for(var i=[],h=[],s=null,l,f=0;f1){var p=void 0,g=void 0;if(Array.isArray(u.tiles)){p=p||{},g=g||{};for(var y=0;y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){for(var v=0;v0){var n={},e={},i,h,s;if(Array.isArray(o.edgecolors))for(i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(37277),o=t(44594),r=t(94880),n=t(72905),e=new a({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(o.BOOT,this.boot,this),h.sys.events.on(o.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var i=this.systems.events;i.on(o.PRE_UPDATE,this.preUpdate,this),i.on(o.UPDATE,this.update,this),i.once(o.SHUTDOWN,this.shutdown,this)},addEvent:function(i){var h;return i instanceof r?(h=i,this.removeEvent(h),h.elapsed=h.startAt,h.hasDispatched=!1,h.repeatCount=h.repeat===-1||h.loop?999999999999:h.repeat):h=new r(i),this._pendingInsertion.push(h),h},delayedCall:function(i,h,s,l){return this.addEvent({delay:i,callback:h,args:s,callbackScope:l})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(i){Array.isArray(i)||(i=[i]);for(var h=0;h-1&&this._active.splice(f,1),l.destroy()}for(s=0;s=l.delay)){var f=l.elapsed-l.delay;if(l.elapsed=l.delay,!l.hasDispatched&&l.callback&&(l.hasDispatched=!0,l.callback.apply(l.callbackScope,l.args)),l.repeatCount>0){if(l.repeatCount--,f>=l.delay)for(;f>=l.delay&&l.repeatCount>0;)l.callback&&l.callback.apply(l.callbackScope,l.args),f-=l.delay,l.repeatCount--;l.elapsed=f,l.hasDispatched=!1}else l.hasDispatched&&this._pendingRemoval.push(l)}}}},shutdown:function(){var i;for(i=0;i{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(39429),r=t(95540),n=t(44594),e=t(89809),i=new a({Extends:v,initialize:function(s,l){v.call(this),this.scene=s,this.systems=s.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),l&&this.add(l)},preUpdate:function(h,s){this.paused||(this.elapsed+=s)},update:function(){if(!(this.paused||this.complete)){var h,s=this.events,l=!1,f=this.systems,u;for(h=0;h=s.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 s=0;s0&&(l=s[s.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 a=t(83419),v=t(95540),o=new a({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=v(r,"delay",0),this.repeat=v(r,"repeat",0),this.loop=v(r,"loop",!1),this.callback=v(r,"callback",void 0),this.callbackScope=v(r,"callbackScope",this),this.args=v(r,"args",[]),this.timeScale=v(r,"timeScale",1),this.startAt=v(r,"startAt",0),this.paused=v(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=[]}});c.exports=o},35945:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},89809:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={COMPLETE:t(35945)}},90291:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Clock:t(33385),Events:t(89809),Timeline:t(96120),TimerEvent:t(94880)}},40382:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(72905),v=t(83419),o=t(43491),r=t(88032),n=t(37277),e=t(44594),i=t(93109),h=t(86081),s=t(8357),l=t(43960),f=t(26012),u=new v({initialize:function(p){this.scene=p,this.events=p.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(d){Array.isArray(d)||(d=[d]);for(var p=[],g=0;g-1},existing:function(d){return this.has(d)||this.tweens.push(d.reset()),this},addCounter:function(d){var p=r(this,d);return this.tweens.push(p.reset()),p},stagger:function(d,p){return i(d,p)},setLagSmooth:function(d,p){return d===void 0&&(d=1/1e-8),p===void 0&&(p=0),this.maxLag=d,this.lagSkip=Math.min(p,this.maxLag),this},setFps:function(d){return d===void 0&&(d=240),this.gap=1e3/d,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(d){var p=Date.now()-this.prevTime;p>this.maxLag&&(this.startTime+=p-this.lagSkip),this.prevTime+=p;var g=this.prevTime-this.startTime,y=g-this.nextTime,x=g-this.time*1e3;return y>0||d?(g/=1e3,this.time=g,this.nextTime+=y+(y>=this.gap?4:this.gap-y)):x=0,x},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(d){d===void 0&&(d=!1);var p=this.getDelta(d);if(!(p<=0)){this.processing=!0;var g,y,x=[],T=this.tweens;for(g=0;g0){for(g=0;g-1&&(y.isPendingRemove()||y.isDestroyed())&&(T.splice(M,1),y.destroy())}x.length=0}this.processing=!1}},remove:function(d){return this.processing?d.setPendingRemoveState():(a(this.tweens,d),d.setRemovedState()),this},reset:function(d){return this.existing(d),d.seek(),d.setActiveState(),this},makeActive:function(d){return this.existing(d),d.setActiveState(),this},each:function(d,p){var g,y=[null];for(g=1;g{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){return t&&t.hasOwnProperty(a)?t[a]:v};c.exports=m},6113:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(62640),v=t(35355),o=function(r,n){var e=a.Power0;if(typeof r=="string")if(a.hasOwnProperty(r))e=a[r];else{var i="";if(r.indexOf(".")){i=r.substring(r.indexOf(".")+1);var h=i.toLowerCase();h==="in"?i="easeIn":h==="out"?i="easeOut":h==="inout"&&(i="easeInOut")}r=v(r.substring(0,r.indexOf(".")+1)+i),a.hasOwnProperty(r)&&(e=a[r])}else typeof r=="function"&&(e=r);if(!n)return e;var s=n.slice(0);return s.unshift(0),function(l){return s[0]=l,e.apply(this,s)}};c.exports=o},91389:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(89318),v=t(77259),o=t(28392),r={bezier:a,catmull:v,catmullrom:v,linear:o},n=function(e){if(e===null)return null;var i=r.linear;return typeof e=="string"?r.hasOwnProperty(e)&&(i=r[e]):typeof e=="function"&&(i=e),i};c.exports=n},55292:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o;if(t.hasOwnProperty(a)){var r=typeof t[a];r==="function"?o=function(n,e,i,h,s,l){return t[a](n,e,i,h,s,l)}:o=function(){return t[a]}}else typeof v=="function"?o=v:o=function(){return v};return o};c.exports=m},82985:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(81076),v=function(o){var r,n=[];if(o.hasOwnProperty("props"))for(r in o.props)r.substring(0,1)!=="_"&&n.push({key:r,value:o.props[r]});else for(r in o)a.indexOf(r)===-1&&r.substring(0,1)!=="_"&&n.push({key:r,value:o[r]});return n};c.exports=v},62329:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35154),v=function(o){var r=a(o,"targets",null);return r===null||(typeof r=="function"&&(r=r.call()),Array.isArray(r)||(r=[r])),r};c.exports=v},17777:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(30976),v=t(99472);function o(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)||o(h)}var i=function(h,s){var l,f=function(K,J,X){return X},u=function(K,J,X){return X},d=null,p=typeof s;if(p==="number")f=function(){return s};else if(Array.isArray(s))u=function(){return s[0]},f=function(){return s[s.length-1]};else if(p==="string"){var g=s.toLowerCase(),y=g.substring(0,6)==="random",x=g.substring(0,3)==="int";if(y||x){var T=g.indexOf("("),C=g.indexOf(")"),M=g.indexOf(",");if(T&&C&&M){var w=parseFloat(g.substring(T+1,M)),L=parseFloat(g.substring(M+1,C));y?f=function(){return v(w,L)}:f=function(){return a(w,L)}}else throw new Error("invalid random() format")}else{g=g[0];var F=parseFloat(s.substr(2));switch(g){case"+":f=function(K,J,X){return X+F};break;case"-":f=function(K,J,X){return X-F};break;case"*":f=function(K,J,X){return X*F};break;case"/":f=function(K,J,X){return X/F};break;default:f=function(){return parseFloat(s)}}}}else if(p==="function")f=s;else if(p==="object")if(e(s))o(s)&&(d=s.getActive),n(s)&&(f=s.getEnd),r(s)&&(u=s.getStart);else if(s.hasOwnProperty("value"))l=i(h,s.value);else{var O=s.hasOwnProperty("to"),N=s.hasOwnProperty("from"),G=s.hasOwnProperty("start");if(O&&(N||G)){if(l=i(h,s.to),G){var V=i(h,s.start);l.getActive=V.getEnd}if(N){var j=i(h,s.from);l.getStart=j.getEnd}}}return l||(l={getActive:d,getEnd:f,getStart:u}),l};c.exports=i},88032:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70402),v=t(69902),o=t(23568),r=t(57355),n=t(6113),e=t(55292),i=t(35154),h=t(17777),s=t(269),l=t(86081),f=function(u,d,p){if(d instanceof l)return d.parent=u,d;p===void 0?p=v:p=s(v,p);var g=i(d,"from",0),y=i(d,"to",1),x=[{value:g}],T=i(d,"delay",p.delay),C=i(d,"easeParams",p.easeParams),M=i(d,"ease",p.ease),w=h("value",y),L=new l(u,x),F=L.add(0,"value",w.getEnd,w.getStart,w.getActive,n(i(d,"ease",M),i(d,"easeParams",C)),e(d,"delay",T),i(d,"duration",p.duration),r(d,"yoyo",p.yoyo),i(d,"hold",p.hold),i(d,"repeat",p.repeat),i(d,"repeatDelay",p.repeatDelay),!1,!1);F.start=g,F.current=g,L.completeDelay=o(d,"completeDelay",0),L.loop=Math.round(o(d,"loop",0)),L.loopDelay=Math.round(o(d,"loopDelay",0)),L.paused=r(d,"paused",!1),L.persist=r(d,"persist",!1),L.callbackScope=i(d,"callbackScope",L);for(var O=a.TYPES,N=0;N{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(6113),v=t(35154),o=t(36383),r=function(n,e){e===void 0&&(e={});var i,h=v(e,"start",0),s=v(e,"ease",null),l=v(e,"grid",null),f=v(e,"from",0),u=f==="first",d=f==="center",p=f==="last",g=typeof f=="number",y=Array.isArray(n),x=parseFloat(y?n[0]:n),T=y?parseFloat(n[1]):0,C=Math.max(x,T);if(y&&(h+=x),l){var M=l[0],w=l[1],L=0,F=0,O=0,N=0,G=[];p?(L=M-1,F=w-1):g?(L=f%M,F=Math.floor(f/M)):d&&(L=(M-1)/2,F=(w-1)/2);for(var V=o.MIN_SAFE_INTEGER,j=0;jV&&(V=J),G[j][K]=J}}}var X=s?a(s):null;return l?i=function(Y,D,z,W){var H=0,Z=W%M,Q=Math.floor(W/M);Z>=0&&Z=0&&Q{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70402),v=t(69902),o=t(23568),r=t(57355),n=t(6113),e=t(91389),i=t(55292),h=t(82985),s=t(62329),l=t(35154),f=t(17777),u=t(269),d=t(86081),p=function(g,y,x){if(y instanceof d)return y.parent=g,y;x===void 0?x=v:x=u(v,x);var T=s(y);!T&&x.targets&&(T=x.targets);for(var C=h(y),M=l(y,"delay",x.delay),w=l(y,"duration",x.duration),L=l(y,"easeParams",x.easeParams),F=l(y,"ease",x.ease),O=l(y,"hold",x.hold),N=l(y,"repeat",x.repeat),G=l(y,"repeatDelay",x.repeatDelay),V=r(y,"yoyo",x.yoyo),j=r(y,"flipX",x.flipX),K=r(y,"flipY",x.flipY),J=l(y,"interpolation",x.interpolation),X=function(rt,ot,dt,at){if(dt==="texture"){var pt=at,Pt=void 0;Array.isArray(at)?(pt=at[0],Pt=at[1]):at.hasOwnProperty("value")?(pt=at.value,Array.isArray(at.value)?(pt=at.value[0],Pt=at.value[1]):typeof at.value=="string"&&(pt=at.value)):typeof at=="string"&&(pt=at),rt.addFrame(ot,pt,Pt,i(at,"delay",M),l(at,"duration",w),l(at,"hold",O),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",j),r(at,"flipY",K))}else{var Ct=f(dt,at),Et=e(l(at,"interpolation",J));rt.add(ot,dt,Ct.getEnd,Ct.getStart,Ct.getActive,n(l(at,"ease",F),l(at,"easeParams",L)),i(at,"delay",M),l(at,"duration",w),r(at,"yoyo",V),l(at,"hold",O),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",j),r(at,"flipY",K),Et,Et?at:null)}},Y=new d(g,T),D=0;D{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70402),v=t(23568),o=t(57355),r=t(62329),n=t(35154),e=t(8357),i=t(43960),h=function(s,l){if(l instanceof i)return l.parent=s,l;var f=new i(s);f.startDelay=n(l,"delay",0),f.completeDelay=v(l,"completeDelay",0),f.loop=Math.round(v(l,"loop",n(l,"repeat",0))),f.loopDelay=Math.round(v(l,"loopDelay",n(l,"repeatDelay",0))),f.paused=o(l,"paused",!1),f.persist=o(l,"persist",!1),f.callbackScope=n(l,"callbackScope",f);var u,d=a.TYPES;for(u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="active"},98540:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="complete"},67233:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="loop"},2859:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="pause"},98336:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="repeat"},25764:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="resume"},32193:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="start"},84371:c=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="stop"},70766:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="update"},55659:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports="yoyo"},842:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a={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)};c.exports=a},70402:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(50792),o=t(842),r=t(86353),n=new a({Extends:v,initialize:function(i){v.call(this),this.parent=i,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(o.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(o.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(o.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(o.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(e){this.countdown-=e,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(e){return this.countdown-=e,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(o.TWEEN_START,"onStart"),e=0),e},updateCompleteDelay:function(e){this.countdown-=e,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(e,i,h){return h===void 0&&(h=[]),this.callbacks.hasOwnProperty(e)&&(this.callbacks[e]={func:i,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"],c.exports=n},95042:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(83419),v=t(842),o=t(86353),r=new a({initialize:function(e,i,h,s,l,f,u,d,p,g){this.tween=e,this.targetIndex=i,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=h,this.yoyo=l,this.hold=f,this.repeat=u,this.repeatDelay=d,this.repeatCounter=0,this.flipX=p,this.flipY=g,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=o.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=o.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=o.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=o.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=o.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=o.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=o.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=o.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===o.CREATED},isDelayed:function(){return this.state===o.DELAY},isPendingRender:function(){return this.state===o.PENDING_RENDER},isPlayingForward:function(){return this.state===o.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===o.PLAYING_BACKWARD},isHolding:function(){return this.state===o.HOLD_DELAY},isRepeating:function(){return this.state===o.REPEAT_DELAY},isComplete:function(){return this.state===o.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,i=this.targetIndex,h=n.targets[i],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(h,s,0,i,e,n),this.repeatCounter=this.repeat===-1?o.MAX:this.repeat,this.setPendingRenderState();var l=this.duration+this.hold;this.yoyo&&(l+=this.duration);var f=l+this.repeatDelay;this.totalDuration=this.delay+l,this.repeat===-1?(this.totalDuration+=f*o.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,i){var h=this.tween,s=h.totalTargets,l=this.targetIndex,f=h.targets[l],u=this.key,d=u!=="texture";if(this.elapsed=n,this.progress=n/this.duration,this.flipX&&f.toggleFlipX(),this.flipY&&f.toggleFlipY(),d&&(e||i)&&(this.start=this.getStartValue(f,u,this.start,l,s,h)),i){this.setPlayingBackwardState(),this.dispatchEvent(v.TWEEN_YOYO,"onYoyo");return}this.repeatCounter--,d&&(this.end=this.getEndValue(f,u,this.start,l,s,h)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-n,d&&(this.current=this.start,f[u]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(v.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});c.exports=r},69902:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},81076:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(70402),v=t(83419),o=t(842),r=t(44603),n=t(39429),e=t(36383),i=t(86353),h=t(48177),s=t(42220),l=new v({Extends:a,initialize:function(u,d){a.call(this,u),this.targets=d,this.totalTargets=d.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,u,d,p,g,y,x,T,C,M,w,L,F,O,N,G){var V=new h(this,f,u,d,p,g,y,x,T,C,M,w,L,F,O,N,G);return this.totalData=this.data.push(V),V},addFrame:function(f,u,d,p,g,y,x,T,C,M){var w=new s(this,f,u,d,p,g,y,x,T,C,M);return this.totalData=this.data.push(w),w},getValue:function(f){f===void 0&&(f=0);var u=null;return this.data&&(u=this.data[f].current),u},hasTarget:function(f){return this.targets&&this.targets.indexOf(f)!==-1},updateTo:function(f,u,d){if(d===void 0&&(d=!1),f!=="texture")for(var p=0;p0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.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,a.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,u,d){if(f===void 0&&(f=0),u===void 0&&(u=16.6),d===void 0&&(d=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;d||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive");var p=this.paused;if(this.paused=!1,f>0){for(var g=Math.floor(f/u),y=f-g*u,x=0;x0&&this.update(y)}return this.paused=p,this.isSeeking=!1,this},initTweenData:function(f){f===void 0&&(f=!1),this.duration=0,this.startDelay=e.MAX_SAFE_INTEGER;for(var u=this.data,d=0;d0?this.totalDuration=p+g+(p+x)*y:this.totalDuration=p+g},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=i.MAX),f||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(o.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(o.TWEEN_START,"onStart"),f=0));var u=!1;if(this.isActive())for(var d=this.data,p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(72905),v=t(70402),o=t(83419),r=t(842),n=t(44603),e=t(39429),i=t(86353),h=new o({Extends:v,initialize:function(l){v.call(this,l),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?i.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive"),this},add:function(s){var l=this.parent.create(s);Array.isArray(l)||(l=[l]);for(var f=this.data,u=0;u0)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 s=this.data,l=this.totalData,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95042),v=t(45319),o=t(83419),r=t(842),n=new o({Extends:a,initialize:function(i,h,s,l,f,u,d,p,g,y,x,T,C,M,w,L,F){a.call(this,i,h,p,g,y,x,T,C,M,w),this.key=s,this.getActiveValue=u,this.getEndValue=l,this.getStartValue=f,this.ease=d,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=L,this.interpolationData=F},reset:function(e){a.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex],h=this.key;e&&(i[h]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(i[h]=this.getActiveValue(i,h,0))},update:function(e){var i=this.tween,h=i.totalTargets,s=this.targetIndex,l=i.targets[s],f=this.key;if(!l)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(l,f,l[f],s,h,i),this.end=this.getEndValue(l,f,this.start,s,h,i),this.current=this.start,l[f]=this.start,this.setPlayingForwardState(),!0;var u=this.isPlayingForward(),d=this.isPlayingBackward();if(u||d){var p=this.elapsed,g=this.duration,y=0,x=!1;p+=e,p>=g?(y=p-g,p=g,x=!0):p<0&&(p=0);var T=v(p/g,0,1);if(this.elapsed=p,this.progress=T,this.previous=this.current,x)u?(this.current=this.end,l[f]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(y)):(this.current=this.start,l[f]=this.start,this.setStateFromStart(y));else{u||(T=1-T);var C=this.ease(T);this.interpolation?this.current=this.interpolation(this.interpolationData,C):this.current=this.start+(this.end-this.start)*C,l[f]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key,f=this.current,u=this.previous;h.emit(e,h,l,s,f,u);var d=h.callbacks[i];d&&d.func.apply(h.callbackScope,[h,s,l,f,u].concat(d.params))}},destroy:function(){a.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});c.exports=n},42220:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(95042),v=t(45319),o=t(83419),r=t(842),n=new o({Extends:a,initialize:function(i,h,s,l,f,u,d,p,g,y,x){a.call(this,i,h,f,u,!1,d,p,g,y,x),this.key="texture",this.startTexture=null,this.endTexture=s,this.startFrame=null,this.endFrame=l,this.yoyo=p!==0},reset:function(e){a.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=i.texture.key,this.startFrame=i.frame.name),e&&i.setTexture(this.startTexture,this.startFrame)},update:function(e){var i=this.tween,h=this.targetIndex,s=i.targets[h];if(!s)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&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var l=this.isPlayingForward(),f=this.isPlayingBackward();if(l||f){var u=this.elapsed,d=this.duration,p=0,g=!1;u+=e,u>=d?(p=u-d,u=d,g=!0):u<0&&(u=0);var y=v(u/d,0,1);this.elapsed=u,this.progress=y,g&&(l?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(p)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(p))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key;h.emit(e,h,l,s);var f=h.callbacks[i];f&&f.func.apply(h.callbackScope,[h,s,l].concat(f.params))}},destroy:function(){a.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});c.exports=n},86353:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={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};c.exports=m},83419:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(n){return!!n.get&&typeof n.get=="function"||!!n.set&&typeof n.set=="function"}function t(n,e,i){var h=i?n[e]:Object.getOwnPropertyDescriptor(n,e);return!i&&h.value&&typeof h.value=="object"&&(h=h.value),h&&m(h)?(typeof h.enumerable>"u"&&(h.enumerable=!0),typeof h.configurable>"u"&&(h.configurable=!0),h):!1}function a(n,e){var i=Object.getOwnPropertyDescriptor(n,e);return i?(i.value&&typeof i.value=="object"&&(i=i.value),i.configurable===!1):!1}function v(n,e,i,h){for(var s in e)if(e.hasOwnProperty(s)){var l=t(e,s,i);if(l!==!1){var f=h||n;if(a(f.prototype,s)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(n.prototype,s,l)}else n.prototype[s]=e[s]}}function o(n,e){if(e){Array.isArray(e)||(e=[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 m=function(){};c.exports=m},20242:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(){return null};c.exports=m},71146:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o,r){if(r===void 0&&(r=t),v>0){var n=v-t.length;if(n<=0)return null}if(!Array.isArray(a))return t.indexOf(a)===-1?(t.push(a),o&&o.call(r,a),a):null;for(var e=a.length-1;e>=0;)t.indexOf(a[e])!==-1&&a.splice(e,1),e--;if(e=a.length,e===0)return null;v>0&&e>n&&(a.splice(n),e=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 m=function(t,a,v,o,r,n){if(v===void 0&&(v=0),n===void 0&&(n=t),o>0){var e=o-t.length;if(e<=0)return null}if(!Array.isArray(a))return t.indexOf(a)===-1?(t.splice(v,0,a),r&&r.call(n,a),a):null;for(var i=a.length-1;i>=0;)t.indexOf(a[i])!==-1&&a.pop(),i--;if(i=a.length,i===0)return null;o>0&&i>e&&(a.splice(e),i=e);for(var h=i-1;h>=0;h--){var s=a[h];t.splice(v,0,s),r&&r.call(n,s)}return a};c.exports=m},66905:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.indexOf(a);return v!==-1&&v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){e===void 0&&(e=0),i===void 0&&(i=o.length);var h=0;if(a(o,e,i))for(var s=e;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o,r=[null];for(o=3;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){if(e===void 0&&(e=0),i===void 0&&(i=o.length),a(o,e,i)){var h,s=[null];for(h=5;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a.length){if(a.length===1)return a[0]}else return NaN;var o=1,r,n;if(v){if(ta.length&&(o=a.length),v?(r=a[o-1][v],n=a[o][v],n-t<=t-r?a[o]:a[o-1]):(r=a[o-1],n=a[o],n-t<=t-r?n:r)};c.exports=m},43491:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=[]);for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){e===void 0&&(e=0),i===void 0&&(i=o.length);var h=[];if(a(o,e,i))for(var s=e;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){if(e===void 0&&(e=0),i===void 0&&(i=o.length),a(o,e,i))for(var h=e;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){a===void 0&&(a=0),v===void 0&&(v=t.length);var o=a+Math.floor(Math.random()*v);return t[o]===void 0?null:t[o]};c.exports=m},85835:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===v)return t;var o=t.indexOf(a),r=t.indexOf(v);if(o<0||r<0)throw new Error("Supplied items must be elements of the same array");return o>r||(t.splice(o,1),r===t.length-1?t.push(a):t.splice(r,0,a)),t};c.exports=m},83371:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===v)return t;var o=t.indexOf(a),r=t.indexOf(v);if(o<0||r<0)throw new Error("Supplied items must be elements of the same array");return o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.indexOf(a);if(v>0){var o=t[v-1],r=t.indexOf(o);t[v]=o,t[r]=a}return t};c.exports=m},69693:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=t.indexOf(a);if(o===-1||v<0||v>=t.length)throw new Error("Supplied index out of bounds");return o!==v&&(t.splice(o,1),t.splice(v,0,a)),a};c.exports=m},40853:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.indexOf(a);if(v!==-1&&v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=[],n,e=!1;if((v||o)&&(e=!0,v||(v=""),o||(o="")),a=a;n--)e?r.push(v+n.toString()+o):r.push(n);else for(n=t;n<=a;n++)e?r.push(v+n.toString()+o):r.push(n);return r};c.exports=m},593:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(2284),v=function(o,r,n){o===void 0&&(o=0),r===void 0&&(r=null),n===void 0&&(n=1),r===null&&(r=o,o=0);for(var e=[],i=Math.max(a((r-o)/(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 m(v,o,r){var n=v[o];v[o]=v[r],v[r]=n}function t(v,o){return vo?1:0}var a=function(v,o,r,n,e){for(r===void 0&&(r=0),n===void 0&&(n=v.length-1),e===void 0&&(e=t);n>r;){if(n-r>600){var i=n-r+1,h=o-r+1,s=Math.log(i),l=.5*Math.exp(2*s/3),f=.5*Math.sqrt(s*l*(i-l)/i)*(h-i/2<0?-1:1),u=Math.max(r,Math.floor(o-h*l/i+f)),d=Math.min(n,Math.floor(o+(i-h)*l/i+f));a(v,o,u,d,e)}var p=v[o],g=r,y=n;for(m(v,r,o),e(v[n],p)>0&&m(v,r,n);g0;)y--}e(v[r],p)===0?m(v,r,y):(y++,m(v,y,n)),y<=o&&(r=y+1),o<=y&&(n=y-1)}};c.exports=a},88492:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35154),v=t(33680),o=function(n,e,i){for(var h=[],s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19133),v=function(o,r,n,e){e===void 0&&(e=o);var i;if(!Array.isArray(r))return i=o.indexOf(r),i!==-1?(a(o,i),n&&n.call(e,r),r):null;for(var h=r.length-1,s=[];h>=0;){var l=r[h];i=o.indexOf(l),i!==-1&&(a(o,i),s.push(l),n&&n.call(e,l)),h--}return s};c.exports=v},60248:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19133),v=function(o,r,n,e){if(e===void 0&&(e=o),r<0||r>o.length-1)throw new Error("Index out of bounds");var i=a(o,r);return n&&n.call(e,i),i};c.exports=v},81409:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){if(r===void 0&&(r=0),n===void 0&&(n=o.length),i===void 0&&(i=o),a(o,r,n)){var h=n-r,s=o.splice(r,h);if(e)for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(19133),v=function(o,r,n){r===void 0&&(r=0),n===void 0&&(n=o.length);var e=r+Math.floor(Math.random()*n);return a(o,e)};c.exports=v},42169:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=t.indexOf(a),r=t.indexOf(v);return o!==-1&&r===-1?(t[o]=v,!0):!1};c.exports=m},86003:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=1);for(var v=null,o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){a===void 0&&(a=1);for(var v=null,o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){var r=t.length;if(a<0||a>r||a>=v||v>r){if(o)throw new Error("Range Error: Values outside acceptable range");return!1}else return!0};c.exports=m},89545:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){var v=t.indexOf(a);return v!==-1&&v>0&&(t.splice(v,1),t.unshift(a)),a};c.exports=m},17810:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(82011),v=function(o,r,n,e,i){if(e===void 0&&(e=0),i===void 0&&(i=o.length),a(o,e,i))for(var h=e;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){for(var a=t.length-1;a>0;a--){var v=Math.floor(Math.random()*(a+1)),o=t[a];t[a]=t[v],t[v]=o}return t};c.exports=m},90126:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a=/\D/g;return t.sort(function(v,o){return parseInt(v.replace(a,""),10)-parseInt(o.replace(a,""),10)}),t};c.exports=m},19133:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){if(!(a>=t.length)){for(var v=t.length-1,o=t[a],r=a;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 a=t(82264);function v(e,i){return String(e).localeCompare(i)}function o(e,i){var h=e.length;if(h<=1)return e;for(var s=new Array(h),l=1;ll&&(p=l),g>l&&(g=l),y=d,x=p;;)if(y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){if(a===v)return t;var o=t.indexOf(a),r=t.indexOf(v);if(o<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[o]=v,t[r]=a,t};c.exports=m},37105:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var a=t[0].length,v=1;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41836),v=t(86922),o=function(r){var n="";if(!v(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 m=function(t){return t.reverse()};c.exports=m},21224:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){for(var a=0;a{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37829),v=function(o){return a(o,180)};c.exports=v},44657:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(37829),v=function(o,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 a=t(86922),v=t(2429),o=function(r,n){if(n===void 0&&(n=90),!a(r))return null;if(typeof n!="string"&&(n=(n%360+360)%360),n===90||n===-270||n==="rotateLeft")r=v(r),r.reverse();else if(n===-90||n===270||n==="rotateRight")r.reverse(),r=v(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 a=t(37829),v=function(o,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 a=t(86003),v=t(49498),o=function(r,n,e){if(n===void 0&&(n=0),e===void 0&&(e=0),e!==0&&(e<0?a(r,Math.abs(e)):v(r,e)),n!==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 m=function(t){for(var a=t.length,v=t[0].length,o=new Array(v),r=0;r-1;n--)o[r][n]=t[n][r]}return o};c.exports=m},54915:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.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:c=>{/** - * @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 m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=function(a,v){for(var o=new Uint8Array(a),r=o.length,n=v?"data:"+v+";base64,":"",e=0;e>2],n+=m[(o[e]&3)<<4|o[e+1]>>4],n+=m[(o[e+1]&15)<<2|o[e+2]>>6],n+=m[o[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};c.exports=t},53134:c=>{/** - * @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 m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),a=0;a>4,u[e++]=(h&15)<<4|s>>2,u[e++]=(s&3)<<6|l&63;return f};c.exports=v},65839:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={ArrayBufferToBase64:t(71334),Base64ToArrayBuffer:t(53134)}},91799:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Array:t(37105),Base64:t(65839),Objects:t(1183),String:t(31749),NOOP:t(29747),NULL:t(20242)}},41786:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a={};for(var v in t)Array.isArray(t[v])?a[v]=t[v].slice(0):a[v]=t[v];return a};c.exports=m},62644:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var a,v,o;if(typeof t!="object"||t===null)return t;a=Array.isArray(t)?[]:{};for(o in t)v=t[o],a[o]=m(v);return a};c.exports=m},79291:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41212),v=function(){var o,r,n,e,i,h,s=arguments[0]||{},l=1,f=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),f===l&&(s=this,--l);l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(75508),v=t(35154),o=function(r,n,e){var i=v(r,n,null);if(i===null)return e;if(Array.isArray(i))return a.RND.pick(i);if(typeof i=="object"){if(i.hasOwnProperty("randInt"))return a.RND.integerInRange(i.randInt[0],i.randInt[1]);if(i.hasOwnProperty("randFloat"))return a.RND.realInRange(i.randFloat[0],i.randFloat[1])}else if(typeof i=="function")return i(n);return i};c.exports=o},95540:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v){var o=typeof t;return!t||o==="number"||o==="string"?v:t.hasOwnProperty(a)&&t[a]!==void 0?t[a]:v};c.exports=m},82840:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(35154),v=t(45319),o=function(r,n,e,i,h){h===void 0&&(h=e);var s=a(r,n,h);return v(s,e,i)};c.exports=o},35154:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){if(!t&&!o||typeof t=="number")return v;if(t&&t.hasOwnProperty(a))return t[a];if(o&&o.hasOwnProperty(a))return o[a];if(a.indexOf(".")!==-1){for(var r=a.split("."),n=t,e=o,i=v,h=v,s=!0,l=!0,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.hasOwnProperty(a)};c.exports=m},41212:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=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};c.exports=m},46975:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41786),v=function(o,r){var n=a(o);for(var e in r)n.hasOwnProperty(e)||(n[e]=r[e]);return n};c.exports=v},269:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(41786),v=function(o,r){var n=a(o);for(var e in r)n.hasOwnProperty(e)&&(n[e]=r[e]);return n};c.exports=v},18254:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var a=t(97022),v=function(o,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 m=function(t,a,v){if(!t||typeof t=="number")return!1;if(t.hasOwnProperty(a))return t[a]=v,!0;if(a.indexOf(".")!==-1){for(var o=a.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} - */c.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:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return t.replace(/%([0-9]+)/g,function(v,o){return a[Number(o)-1]})};c.exports=m},41836:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a,v,o){a===void 0&&(a=0),v===void 0&&(v=" "),o===void 0&&(o=3),t=t.toString();var r=0;if(a+1>=t.length)switch(o){case 1:t=new Array(a+1-t.length).join(v)+t;break;case 3:var n=Math.ceil((r=a-t.length)/2),e=r-n;t=new Array(e+1).join(v)+t+new Array(n+1).join(v);break;default:t=t+new Array(a+1-t.length).join(v);break}return t};c.exports=m},33628:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,a){return a===0?t.slice(1):t.slice(0,a-1)+t.slice(a)};c.exports=m},27671:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t.split("").reverse().join("")};c.exports=m},45650:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var a=Math.random()*16|0,v=t==="x"?a:a&3|8;return v.toString(16)})};c.exports=m},35355:c=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){return t&&t[0].toUpperCase()+t.slice(1)};c.exports=m},31749:(c,m,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},B={};function I(c){var m=B[c];if(m!==void 0)return m.exports;var t=B[c]={exports:{}};return A[c](t,t.exports,I),t.exports}I.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var b=I(85454);return b})())})(af);var Fr=af.exports;const Cs=Wu(Fr);var f1=Object.create,Ao=Object.defineProperty,d1=Object.defineProperties,c1=Object.getOwnPropertyDescriptor,v1=Object.getOwnPropertyDescriptors,p1=Object.getOwnPropertyNames,Pu=Object.getOwnPropertySymbols,g1=Object.getPrototypeOf,of=Object.prototype.hasOwnProperty,m1=Object.prototype.propertyIsEnumerable,Au=(E,S,A)=>S in E?Ao(E,S,{enumerable:!0,configurable:!0,writable:!0,value:A}):E[S]=A,re=(E,S)=>{for(var A in S||(S={}))of.call(S,A)&&Au(E,A,S[A]);if(Pu)for(var A of Pu(S))m1.call(S,A)&&Au(E,A,S[A]);return E},Vi=(E,S)=>d1(E,v1(S)),Ft=(E,S)=>()=>(S||E((S={exports:{}}).exports,S),S.exports),x1=(E,S,A,B)=>{if(S&&typeof S=="object"||typeof S=="function")for(let I of p1(S))!of.call(E,I)&&I!==A&&Ao(E,I,{get:()=>S[I],enumerable:!(B=c1(S,I))||B.enumerable});return E},hf=(E,S,A)=>(A=E!=null?f1(g1(E)):{},x1(S||!E||!E.__esModule?Ao(A,"default",{value:E,enumerable:!0}):A,E)),Lr=Ft(E=>{var S=function(b,c){return bc?1:0},A=function(b,c){return bc?-1:0};function B(b){return function(c,m){return b(m,c)}}function I(b){return b===2?function(c,m){return c[0]m[0]?1:c[1]m[1]?1:0}:function(c,m){for(var t=0;tm[t])return 1;t++}return 0}}E.DEFAULT_COMPARATOR=S,E.DEFAULT_REVERSE_COMPARATOR=A,E.reverseComparator=B,E.createTupleComparator=I}),y1=Ft(E=>{E.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",E.SYMBOL_SUPPORT=typeof Symbol<"u"}),he=Ft((E,S)=>{var A=y1(),B=A.ARRAY_BUFFER_SUPPORT,I=A.SYMBOL_SUPPORT;S.exports=function(b,c){var m,t,a,v,o;if(!b)throw new Error("obliterator/forEach: invalid iterable.");if(typeof c!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(b)||B&&ArrayBuffer.isView(b)||typeof b=="string"||b.toString()==="[object Arguments]"){for(a=0,v=b.length;a{var A=Lr(),B=he(),I=A.DEFAULT_COMPARATOR,b=A.reverseComparator;function c(i){if(this.clear(),this.comparator=i||I,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}c.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function m(i){return{item:i,degree:0}}function t(i,h){i.root?(h.right=i.root.right,h.left=i.root,i.root.right.left=h,i.root.right=h):i.root=h}c.prototype.push=function(i){var h=m(i);return h.left=h,h.right=h,t(this,h),(!this.min||this.comparator(h.item,this.min.item)<=0)&&(this.min=h),++this.size},c.prototype.peek=function(){return this.min?this.min.item:void 0};function a(i){for(var h=[],s=i,l=!1;!(s===i&&l);)s===i&&(l=!0),h.push(s),s=s.right;return h}function v(i,h){i.root===h&&(i.root=h.right),h.left.right=h.right,h.right.left=h.left}function o(i,h){i.child?(h.right=i.child.right,h.left=i.child,i.child.right.left=h,i.child.right=h):i.child=h}function r(i,h,s){v(i,h),h.left=h,h.right=h,o(s,h),s.degree++,h.parent=s}function n(i){var h=new Array(i.size),s=a(i.root),l,f,u,d,p,g;for(l=0,f=s.length;l0&&(g=u,u=d,d=g),r(i,d,u),h[p]=null,p++;h[p]=u}for(l=0;l{var S=Math.pow(2,8)-1,A=Math.pow(2,16)-1,B=Math.pow(2,32)-1,I=Math.pow(2,7)-1,b=Math.pow(2,15)-1,c=Math.pow(2,31)-1;E.getPointerArray=function(t){var a=t-1;if(a<=S)return Uint8Array;if(a<=A)return Uint16Array;if(a<=B)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},E.getSignedPointerArray=function(t){var a=t-1;return a<=I?Int8Array:a<=b?Int16Array:a<=c?Int32Array:Float64Array},E.getNumberType=function(t){return t===(t|0)?Math.sign(t)===-1?t<=127&&t>=-128?Int8Array:t<=32767&&t>=-32768?Int16Array:Int32Array:t<=255?Uint8Array:t<=65535?Uint16Array:Uint32Array:Float64Array};var m={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};E.getMinimalRepresentation=function(t,a){var v=null,o=0,r,n,e,i,h;for(i=0,h=t.length;io&&(o=r,v=n);return v},E.isTypedArray=function(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(t)},E.concat=function(){var t=0,a,v,o;for(a=0,o=arguments.length;a{var S=he(),A=Be();function B(m){return Array.isArray(m)||A.isTypedArray(m)}function I(m){if(typeof m.length=="number")return m.length;if(typeof m.size=="number")return m.size}function b(m){var t=I(m),a=typeof t=="number"?new Array(t):[],v=0;return S(m,function(o){a[v++]=o}),a}function c(m){var t=I(m),a=typeof t=="number"?A.getPointerArray(t):Array,v=typeof t=="number"?new Array(t):[],o=typeof t=="number"?new a(t):[],r=0;return S(m,function(n){v[r]=n,o[r]=r++}),[v,o]}E.isArrayLike=B,E.guessLength=I,E.toArray=b,E.toArrayWithIndices=c}),wo=Ft((E,S)=>{var A=he(),B=Lr(),I=We(),b=B.DEFAULT_COMPARATOR,c=B.reverseComparator;function m(f,u,d,p){for(var g=u[p],y,x;p>d;){if(y=p-1>>1,x=u[y],f(g,x)<0){u[p]=x,p=y;continue}break}u[p]=g}function t(f,u,d){for(var p=u.length,g=d,y=u[d],x=2*d+1,T;x=0&&(x=T),u[d]=u[x],d=x,x=2*d+1;u[d]=y,m(f,u,g,d)}function a(f,u,d){u.push(d),m(f,u,0,u.length-1)}function v(f,u){var d=u.pop();if(u.length!==0){var p=u[0];return u[0]=d,t(f,u,0),p}return d}function o(f,u,d){if(u.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var p=u[0];return u[0]=d,t(f,u,0),p}function r(f,u,d){var p;return u.length!==0&&f(u[0],d)<0&&(p=u[0],u[0]=d,d=p,t(f,u,0)),d}function n(f,u){for(var d=u.length,p=d>>1,g=p;--g>=0;)t(f,u,g)}function e(f,u){for(var d=u.length,p=0,g=new Array(d);p=d.length)return d.slice().sort(f);for(C=d.slice(0,u),n(p,C),g=u,y=d.length;g0&&o(p,C,d[g]);return C.sort(f)}var M=I.guessLength(d);return M!==null&&M0&&o(p,C,w)),g++}),C.length>g&&(C.length=g),C.sort(f)}function h(f,u,d){arguments.length===2&&(d=u,u=f,f=b);var p=c(f),g,y,x,T=-1/0,C;if(u===1){if(I.isArrayLike(d)){for(g=0,y=d.length;g0)&&(T=x);return C=new d.constructor(1),C[0]=T,C}return A(d,function(w){(T===-1/0||f(w,T)>0)&&(T=w)}),[T]}if(I.isArrayLike(d)){if(u>=d.length)return d.slice().sort(p);for(C=d.slice(0,u),n(f,C),g=u,y=d.length;g0&&o(f,C,d[g]);return C.sort(p)}var M=I.guessLength(d);return M!==null&&M0&&o(f,C,w)),g++}),C.length>g&&(C.length=g),C.sort(p)}function s(f){if(this.clear(),this.comparator=f||b,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}s.prototype.clear=function(){this.items=[],this.size=0},s.prototype.push=function(f){return a(this.comparator,this.items,f),++this.size},s.prototype.peek=function(){return this.items[0]},s.prototype.pop=function(){return this.size!==0&&this.size--,v(this.comparator,this.items)},s.prototype.replace=function(f){return o(this.comparator,this.items,f)},s.prototype.pushpop=function(f){return r(this.comparator,this.items,f)},s.prototype.consume=function(){return this.size=0,e(this.comparator,this.items)},s.prototype.toArray=function(){return e(this.comparator,this.items.slice())},s.prototype.inspect=function(){var f=this.toArray();return Object.defineProperty(f,"constructor",{value:s,enumerable:!1}),f},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect);function l(f){if(this.clear(),this.comparator=f||b,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=c(this.comparator)}l.prototype=s.prototype,s.from=function(f,u){var d=new s(u),p;return I.isArrayLike(f)?p=f.slice():p=I.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},l.from=function(f,u){var d=new l(u),p;return I.isArrayLike(f)?p=f.slice():p=I.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},s.siftUp=t,s.siftDown=m,s.push=a,s.pop=v,s.replace=o,s.pushpop=r,s.heapify=n,s.consume=e,s.nsmallest=i,s.nlargest=h,s.MinHeap=s,s.MaxHeap=l,S.exports=s}),T1=Ft((E,S)=>{var A="";function B(a,v,o){for(var r=v.length,n=[],e=r,i=-1,h,s=0,l;e--;)i=Math.max(a[v[e]+o],i);for(l=i>>24&&32||i>>16&&24||i>>8&&16||8;s>s&15].push(v[e]);for(h=0;h<16;h++)for(i=n[h].length;i--;)v[++e]=n[h][i]}}function I(a,v,o,r){return a[o]-a[r]||(o%3===2?a[o+1]-a[r+1]||v[o+2]-v[r+2]:v[o+1]-v[r+1])}function b(a,v){var o=[],r=[],n=2*v/3|0,e=v-n,i=n+1>>1,h=n,s=0,l,f=[],u=[];if(v===1)return[0];for(;h--;)o[h]=(h*3>>1)+1;for(h=3;h--;)B(a,o,h);for(s=r[(o[0]/3|0)+(o[0]%3===1?0:i)]=1,h=1;hthis.firstLength&&e>this.firstLength)){for(v=Math.min(this.length-n,this.length-e),r=0;ra.length&&(a=this.text.slice(n,n+v))}return a},t.prototype.toString=function(){return this.array.join(",")},t.prototype.toJSON=function(){return this.array},t.prototype.inspect=function(){for(var a=new Array(this.length),v=0;v{var A=he();function B(a){this.size=0,this.items=new Map,this.inverse=a}function I(){this.size=0,this.items=new Map,this.inverse=new B(this)}function b(){this.size=0,this.items.clear(),this.inverse.items.clear()}I.prototype.clear=b,B.prototype.clear=b;function c(a,v){if(this.items.has(a)){var o=this.items.get(a);if(o===v)return this;this.inverse.items.delete(o)}if(this.inverse.items.has(v)){var r=this.inverse.items.get(v);if(r===a)return this;this.items.delete(r)}return this.items.set(a,v),this.inverse.items.set(v,a),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}I.prototype.set=c,B.prototype.set=c;function m(a){if(this.items.has(a)){var v=this.items.get(a);return this.items.delete(a),this.inverse.items.delete(v),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}I.prototype.delete=m,B.prototype.delete=m;var t=["has","get","forEach","keys","values","entries"];t.forEach(function(a){I.prototype[a]=B.prototype[a]=function(){return Map.prototype[a].apply(this.items,arguments)}}),typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.entries,B.prototype[Symbol.iterator]=B.prototype.entries),I.prototype.inspect=function(){var a={left:this.items,right:this.inverse.items};return Object.defineProperty(a,"constructor",{value:I,enumerable:!1}),a},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),B.prototype.inspect=function(){var a={left:this.inverse.items,right:this.items};return Object.defineProperty(a,"constructor",{value:B,enumerable:!1}),a},typeof Symbol<"u"&&(B.prototype[Symbol.for("nodejs.util.inspect.custom")]=B.prototype.inspect),I.from=function(a){var v=new I;return A(a,function(o,r){v.set(r,o)}),v},S.exports=I}),Pe=Ft((E,S)=>{function A(B){if(typeof B!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=B}typeof Symbol<"u"&&(A.prototype[Symbol.iterator]=function(){return this}),A.of=function(){var B=arguments,I=B.length,b=0;return new A(function(){return b>=I?{done:!0}:{done:!1,value:B[b++]}})},A.empty=function(){var B=new A(function(){return{done:!0}});return B},A.fromSequence=function(B){var I=0,b=B.length;return new A(function(){return I>=b?{done:!0}:{done:!1,value:B[I++]}})},A.is=function(B){return B instanceof A?!0:typeof B=="object"&&B!==null&&typeof B.next=="function"},S.exports=A}),lf=Ft(E=>{function S(c){return c|=c>>1,c|=c>>2,c|=c>>4,c|=c>>8,c|=c>>16,c&~(c>>1)}E.msb32=S;function A(c){return c|=c>>1,c|=c>>2,c|=c>>4,c&~(c>>1)}E.msb8=A,E.test=function(c,m){return c>>m&1},E.criticalBit8=function(c,m){return A(c^m)},E.criticalBit8Mask=function(c,m){return~A(c^m)>>>0&255},E.testCriticalBit8=function(c,m){return 1+(c|m)>>8},E.criticalBit32Mask=function(c,m){return~S(c^m)>>>0&4294967295},E.popcount=function(c){return c-=c>>1&1431655765,c=(c&858993459)+(c>>2&858993459),c=c+(c>>4)&252645135,c+=c>>8,c+=c>>16,c&127};var B=new Uint8Array(Math.pow(2,8));for(I=0,b=B.length;I>8&255]+B[c>>16&255]+B[c>>24&255]}}),C1=Ft((E,S)=>{var A=Pe(),B=lf();function I(b){this.length=b,this.clear()}I.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},I.prototype.set=function(b,c){var m=b>>5,t=b&31,a=this.array[m],v;return c===0||c===!1?v=this.array[m]&=~(1<>>0,v>a?this.size++:v>5,m=b&31,t=this.array[c],a;return a=this.array[c]&=~(1<>5,m=b&31,t=this.array[c],a=this.array[c]^=1<>>0,a>t?this.size++:a>5,m=b&31;return this.array[c]>>m&1},I.prototype.test=function(b){return!!this.get(b)},I.prototype.rank=function(b){if(this.size===0)return 0;for(var c=b>>5,m=b&31,t=0,a=0;a=this.length)return-1;for(var c,m=32,t=0,a=0,v=0,o=this.array.length;v>r&1,a===b)return t}},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=this.length,t,a,v=32,o=0,r=this.array.length;o>n&1,b.call(c,a,o*32+n)}},I.prototype.values=function(){var b=this.length,c=!1,m,t,a=this.array,v=a.length,o=0,r=-1,n=32;return new A(function e(){if(!c){if(o>=v)return{done:!0};o===v-1&&(n=b%32||32),m=a[o++],c=!0,r=-1}return r++,r>=n?(c=!1,e()):(t=m>>r&1,{value:t})})},I.prototype.entries=function(){var b=this.length,c=!1,m,t,a=this.array,v,o=a.length,r=0,n=-1,e=32;return new A(function i(){if(!c){if(r>=o)return{done:!0};r===o-1&&(e=b%32||32),m=a[r++],c=!0,n=-1}return n++,v=~-r*32+n,n>=e?(c=!1,i()):(t=m>>n&1,{value:[v,t]})})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.inspect=function(){var b=new Uint8Array(this.length);return this.forEach(function(c,m){b[m]=c}),Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.prototype.toJSON=function(){return Array.from(this.array)},S.exports=I}),E1=Ft((E,S)=>{var A=Pe(),B=lf(),I=function(m){return Math.max(1,Math.ceil(m*1.5))};function b(m){return new Uint32Array(Math.ceil(m/32))}function c(m){var t=m||0,a=I;typeof m=="object"&&(t=m.initialLength||m.initialCapacity||0,a=m.policy||a),this.size=0,this.length=t,this.capacity=Math.ceil(this.length/32)*32,this.policy=a,this.array=b(this.capacity)}c.prototype.set=function(m,t){if(this.length>5,v=m&31,o=this.array[a],r;return t===0||t===!1?r=this.array[a]&=~(1<>>0,r>o?this.size++:r>5,a=m&31,v=this.array[t],o;return o=this.array[t]&=~(1<>5,a=m&31,v=this.array[t],o=this.array[t]^=1<>>0,o>v?this.size++:othis.array.length?(this.array=new Uint32Array(v),this.array.set(a,0)):this.array=a.slice(0,v),this.capacity=m,this)},c.prototype.grow=function(m){var t;if(typeof m=="number"){if(this.capacity>=m)return this;for(t=this.capacity;t>5,v=t&31;return this.array[a]|=1<>5,a=m&31;return this.array[t]>>a&1}},c.prototype.get=function(m){if(!(this.length>5,a=m&31;return this.array[t]>>a&1}},c.prototype.test=function(m){return this.length>5,a=m&31,v=0,o=0;o=this.length)return-1;for(var t,a=32,v=0,o=0,r=0,n=this.array.length;r>e&1,o===m)return v}},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;for(var a=this.length,v,o,r=32,n=0,e=this.array.length;n>i&1,m.call(t,o,n*32+i)}},c.prototype.values=function(){var m=this.length,t=!1,a,v,o=this.array,r=o.length,n=0,e=-1,i=32;return new A(function h(){if(!t){if(n>=r)return{done:!0};n===r-1&&(i=m%32||32),a=o[n++],t=!0,e=-1}return e++,e>=i?(t=!1,h()):(v=a>>e&1,{value:v})})},c.prototype.entries=function(){var m=this.length,t=!1,a,v,o=this.array,r,n=o.length,e=0,i=-1,h=32;return new A(function s(){if(!t){if(e>=n)return{done:!0};e===n-1&&(h=m%32||32),a=o[e++],t=!0,i=-1}return i++,r=~-e*32+i,i>=h?(t=!1,s()):(v=a>>i&1,{value:[r,v]})})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){var m=new Uint8Array(this.length);return this.forEach(function(t,a){m[a]=t}),Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},S.exports=c}),P1=Ft((E,S)=>{function A(b,c){return(b&65535)*c+(((b>>>16)*c&65535)<<16)&4294967295}function B(b,c){return(b&65535)+(c>>>16)+(((b>>>16)+c&65535)<<16)&4294967295}function I(b,c){return b<>>32-c}S.exports=function(b,c){var m=3432918353,t=461845907,a=15,v=13,o=5,r=1801774676,n=b,e,i,h;for(i=0,h=c.length-4;i<=h;i+=4)e=c[i]|c[i+1]<<8|c[i+2]<<16|c[i+3]<<24,e=A(e,m),e=I(e,a),e=A(e,t),n^=e,n=I(n,v),n=A(n,o),n=B(n,r);switch(e=0,c.length&3){case 3:e^=c[i+2]<<16;case 2:e^=c[i+1]<<8;case 1:e^=c[i],e=A(e,m),e=I(e,a),e=A(e,t),n^=e}return n^=c.length,n^=n>>>16,n=A(n,2246822507),n^=n>>>13,n=A(n,3266489909),n^=n>>>16,n>>>0}}),A1=Ft((E,S)=>{var A=P1(),B=he(),I=Math.LN2*Math.LN2,b={errorRate:.005};function c(a){var v=new Uint16Array(a.length),o,r;for(o=0,r=a.length;o>3]|=e}return this},t.prototype.test=function(a){for(var v=c(a),o=0,r=this.hashFunctions;o>3]&1<<(7&n)))return!1}return!0},t.prototype.toJSON=function(){return this.data},t.from=function(a,v){if(!v&&(v=a.length||a.size,typeof v!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var o=new t(v);return B(a,function(r){o.add(r)}),o},S.exports=t}),M1=Ft((E,S)=>{var A=he();function B(I){if(typeof I!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=I,this.clear()}B.prototype.add=function(I){if(!this.root)return this.root={item:I,children:{}},this.size++,this;for(var b=this.root,c;c=this.distance(I,b.item),!!b.children[c];)b=b.children[c];return b.children[c]={item:I,children:{}},this.size++,this},B.prototype.search=function(I,b){if(!this.root)return[];for(var c=[],m=[this.root],t,a,v,o,r;m.length;)for(t=m.pop(),v=this.distance(b,t.item),v<=I&&c.push({item:t.item,distance:v}),o=v-I,r=v+I+1;o{var A=We(),B=Pe();function I(b,c){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=b,this.capacity=c,this.items=new b(this.capacity),this.clear()}I.prototype.clear=function(){this.start=0,this.size=0},I.prototype.push=function(b){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var c=this.start+this.size;return c>=this.capacity&&(c-=this.capacity),this.items[c]=b,++this.size},I.prototype.unshift=function(b){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var c=this.start-1;return this.start===0&&(c=this.capacity-1),this.items[c]=b,this.start=c,++this.size},I.prototype.pop=function(){if(this.size!==0){this.size--;var b=this.start+this.size;return b>=this.capacity&&(b-=this.capacity),this.items[b]}},I.prototype.shift=function(){if(this.size!==0){var b=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[b]}},I.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},I.prototype.peekLast=function(){if(this.size!==0){var b=this.start+this.size-1;return b>=this.capacity&&(b-=this.capacity),this.items[b]}},I.prototype.get=function(b){if(!(this.size===0||b>=this.capacity))return b=this.start+b,b>=this.capacity&&(b-=this.capacity),this.items[b]},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=this.capacity,t=this.size,a=this.start,v=0;v=m)return{done:!0};var v=b[t];return t++,a++,t===c&&(t=0),{value:v,done:!1}})},I.prototype.entries=function(){var b=this.items,c=this.capacity,m=this.size,t=this.start,a=0;return new B(function(){if(a>=m)return{done:!0};var v=b[t];return t++,t===c&&(t=0),{value:[a++,v],done:!1}})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.inspect=function(){var b=this.toArray();return b.type=this.ArrayClass.name,b.capacity=this.capacity,Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.from=function(b,c,m){if(arguments.length<3&&(m=A.guessLength(b),typeof m!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new I(c,m);if(A.isArrayLike(b)){var a,v;for(a=0,v=b.length;a{var A=We(),B=uf();function I(c,m){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof m!="number"||m<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=c,this.capacity=m,this.items=new c(this.capacity),this.clear()}function b(c){I.prototype[c]=B.prototype[c]}Object.keys(B.prototype).forEach(b),typeof Symbol<"u"&&Object.getOwnPropertySymbols(B.prototype).forEach(b),I.prototype.push=function(c){var m=this.start+this.size;return m>=this.capacity&&(m-=this.capacity),this.items[m]=c,this.size===this.capacity?(m++,m>=this.capacity?this.start=0:this.start=m,this.size):++this.size},I.prototype.unshift=function(c){var m=this.start-1;return this.start===0&&(m=this.capacity-1),this.items[m]=c,this.size===this.capacity?(this.start=m,this.size):(this.start=m,++this.size)},I.from=function(c,m,t){if(arguments.length<3&&(t=A.guessLength(c),typeof t!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var a=new I(m,t);if(A.isArrayLike(c)){var v,o;for(v=0,o=c.length;v{function A(B){if(typeof B!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=B,this.size=0}A.prototype.clear=function(){this.items.clear(),this.size=0},A.prototype.get=function(B){var I=this.items.get(B);return typeof I>"u"&&(I=this.factory(B,this.size),this.items.set(B,I),this.size++),I},A.prototype.peek=function(B){return this.items.get(B)},A.prototype.set=function(B,I){return this.items.set(B,I),this.size=this.items.size,this},A.prototype.has=function(B){return this.items.has(B)},A.prototype.delete=function(B){var I=this.items.delete(B);return this.size=this.items.size,I},A.prototype.forEach=function(B,I){I=arguments.length>1?I:this,this.items.forEach(B,I)},A.prototype.entries=function(){return this.items.entries()},A.prototype.keys=function(){return this.items.keys()},A.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(A.prototype[Symbol.iterator]=A.prototype.entries),A.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(A.prototype[Symbol.for("nodejs.util.inspect.custom")]=A.prototype.inspect),A.autoIncrement=function(){var B=0;return function(){return B++}},S.exports=A}),F1=Ft((E,S)=>{function A(B){if(typeof B!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=B}A.prototype.clear=function(){this.items=new WeakMap},A.prototype.get=function(B){var I=this.items.get(B);return typeof I>"u"&&(I=this.factory(B),this.items.set(B,I)),I},A.prototype.peek=function(B){return this.items.get(B)},A.prototype.set=function(B,I){return this.items.set(B,I),this},A.prototype.has=function(B){return this.items.has(B)},A.prototype.delete=function(B){return this.items.delete(B)},A.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(A.prototype[Symbol.for("nodejs.util.inspect.custom")]=A.prototype.inspect),S.exports=A}),L1=Ft((E,S)=>{var A=Be();function B(I){var b=A.getPointerArray(I),c=A.getPointerArray(Math.log2(I));this.size=I,this.dimension=I,this.parents=new b(I),this.ranks=new c(I);for(var m=0;ma?this.parents[m]=c:(this.parents[m]=c,this.ranks[c]++),this},B.prototype.connected=function(I,b){var c=this.find(I);return c===this.find(b)},B.prototype.mapping=function(){for(var I=A.getPointerArray(this.dimension),b={},c=new I(this.size),m=0,t,a=0,v=this.parents.length;a"u"?(c[a]=m,b[t]=m++):c[a]=b[t];return c},B.prototype.compile=function(){for(var I={},b=new Array(this.dimension),c=0,m,t=0,a=this.parents.length;t"u"?(b[c]=[t],I[m]=c++):b[I[m]].push(t);return b},B.prototype.inspect=function(){var I=this.compile();return Object.defineProperty(I,"constructor",{value:B,enumerable:!1}),I},typeof Symbol<"u"&&(B.prototype[Symbol.for("nodejs.util.inspect.custom")]=B.prototype.inspect),S.exports=B}),Ro=Ft((E,S)=>{var A=Lr(),B=wo(),I=A.DEFAULT_COMPARATOR,b=A.reverseComparator;function c(a,v,o,r){for(var n=o,e=r,i=v[r],h=2*r+1,s;h=0&&(h=s),v[r]=v[h],r=h,h=2*r+1;v[r]=i,B.siftDown(a,v,e,r)}function m(a,v,o,r){for(var n=r,e=n,i=new a(r),h,s;e>0;)h=o[--e],e!==0&&(s=o[0],o[0]=h,c(v,o,--r,0),h=s),i[e]=h;return i}function t(a,v,o){if(arguments.length===2&&(o=v,v=null),this.ArrayClass=a,this.capacity=o,this.items=new a(o),this.clear(),this.comparator=v||I,typeof o!="number"&&o<=0)throw new Error("mnemonist/FixedReverseHeap.constructor: capacity should be a number > 0.");if(typeof this.comparator!="function")throw new Error("mnemonist/FixedReverseHeap.constructor: given comparator should be a function.");this.comparator=b(this.comparator)}t.prototype.clear=function(){this.size=0},t.prototype.push=function(a){return this.size0&&B.replace(this.comparator,this.items,a),this.size},t.prototype.peek=function(){return this.items[0]},t.prototype.consume=function(){var a=m(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,a},t.prototype.toArray=function(){return m(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},t.prototype.inspect=function(){var a=this.toArray();return Object.defineProperty(a,"constructor",{value:t,enumerable:!1}),a},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),S.exports=t}),O1=Ft((E,S)=>{var A=he(),B=function(b){return b};function I(b){if(this.items=new Map,this.clear(),Array.isArray(b)?(this.writeHashFunction=b[0],this.readHashFunction=b[1]):(this.writeHashFunction=b,this.readHashFunction=b),this.writeHashFunction||(this.writeHashFunction=B),this.readHashFunction||(this.readHashFunction=B),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.")}I.prototype.clear=function(){this.items.clear(),this.size=0},I.prototype.add=function(b){var c=this.writeHashFunction(b);return this.items.set(c,b),this.size=this.items.size,this},I.prototype.set=function(b,c){return b=this.writeHashFunction(b),this.items.set(b,c),this.size=this.items.size,this},I.prototype.get=function(b){return b=this.readHashFunction(b),this.items.get(b)},I.prototype.has=function(b){return b=this.readHashFunction(b),this.items.has(b)},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this,this.items.forEach(function(m){b.call(c,m,m)})},I.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.inspect=function(){var b=Array.from(this.items.values());return Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.from=function(b,c,m){var t=new I(c);return A(b,function(a,v){m?t.set(v,a):t.add(a)}),t},S.exports=I}),ff=Ft((E,S)=>{var A=Pe(),B=he();function I(b){this.Container=b||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:I,enumerable:!1})}I.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},I.prototype.set=function(b,c){var m=this.items.get(b),t;return m||(this.dimension++,m=new this.Container,this.items.set(b,m)),this.Container===Set?(t=m.size,m.add(c),t"u"?0:this.Container===Set?c.size:c.length},I.prototype.count=I.prototype.multiplicity,I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;var m;function t(a){b.call(c,a,m)}this.items.forEach(function(a,v){m=v,a.forEach(t)})},I.prototype.forEachAssociation=function(b,c){c=arguments.length>1?c:this,this.items.forEach(b,c)},I.prototype.keys=function(){return this.items.keys()},I.prototype.values=function(){var b=this.items.values(),c=!1,m,t,a,v;return this.Container===Set?new A(function o(){if(!c){if(t=b.next(),t.done)return{done:!0};c=!0,m=t.value.values()}return t=m.next(),t.done?(c=!1,o()):{done:!1,value:t.value}}):new A(function o(){if(!c){if(t=b.next(),t.done)return{done:!0};c=!0,m=t.value,a=0,v=m.length}return a>=v?(c=!1,o()):{done:!1,value:m[a++]}})},I.prototype.entries=function(){var b=this.items.entries(),c=!1,m,t,a,v,o;return this.Container===Set?new A(function r(){if(!c){if(t=b.next(),t.done)return{done:!0};c=!0,a=t.value[0],m=t.value[1].values()}return t=m.next(),t.done?(c=!1,r()):{done:!1,value:[a,t.value]}}):new A(function r(){if(!c){if(t=b.next(),t.done)return{done:!0};c=!0,a=t.value[0],m=t.value[1],v=0,o=m.length}return v>=o?(c=!1,r()):{done:!1,value:[a,m[v++]]}})},I.prototype.containers=function(){return this.items.values()},I.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.entries),I.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.prototype.toJSON=function(){return this.items},I.from=function(b,c){var m=new I(c);return B(b,function(t,a){m.set(a,t)}),m},S.exports=I}),D1=Ft((E,S)=>{var A=ff(),B=he(),I=function(c){return c};function b(c,m){if(this.items=new A(m),this.clear(),Array.isArray(c)?(this.writeHashFunction=c[0],this.readHashFunction=c[1]):(this.writeHashFunction=c,this.readHashFunction=c),this.writeHashFunction||(this.writeHashFunction=I),this.readHashFunction||(this.readHashFunction=I),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.")}b.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},b.prototype.add=function(c){var m=this.writeHashFunction(c);return this.items.set(m,c),this.size=this.items.size,this.dimension=this.items.dimension,this},b.prototype.set=function(c,m){return c=this.writeHashFunction(c),this.items.set(c,m),this.size=this.items.size,this.dimension=this.items.dimension,this},b.prototype.get=function(c){return c=this.readHashFunction(c),this.items.get(c)},b.prototype.has=function(c){return c=this.readHashFunction(c),this.items.has(c)},b.prototype.forEach=function(c,m){m=arguments.length>1?m:this,this.items.forEach(function(t){c.call(m,t,t)})},b.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(b.prototype[Symbol.iterator]=b.prototype.values),b.prototype.inspect=function(){var c=Array.from(this);return Object.defineProperty(c,"constructor",{value:b,enumerable:!1}),c},typeof Symbol<"u"&&(b.prototype[Symbol.for("nodejs.util.inspect.custom")]=b.prototype.inspect),b.from=function(c,m,t,a){arguments.length===3&&typeof t=="boolean"&&(a=t,t=Array);var v=new b(m,t);return B(c,function(o,r){a?v.set(r,o):v.add(o)}),v},S.exports=b}),I1=Ft((E,S)=>{var A=1024;function B(b){return(b&b-1)===0}function I(b,c){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var m=c||0,t=A,a=0;if(typeof c=="object"&&(m=c.initialCapacity||0,a=c.initialLength||0,t=c.blockSize||A),!t||!B(t))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var v=Math.max(a,m),o=Math.ceil(v/t);this.ArrayClass=b,this.length=a,this.capacity=o*t,this.blockSize=t,this.offsetMask=t-1,this.blockMask=Math.log2(t),this.blocks=new Array(o);for(var r=0;r>this.blockMask,t=b&this.offsetMask;return this.blocks[m][t]=c,this},I.prototype.get=function(b){if(!(this.length>this.blockMask,m=b&this.offsetMask;return this.blocks[c][m]}},I.prototype.grow=function(b){if(typeof b!="number"&&(b=this.capacity+this.blockSize),this.capacity>=b)return this;for(;this.capacity>this.blockMask,t=c&this.offsetMask;return this.blocks[m][t]=b,++this.length},I.prototype.pop=function(){if(this.length!==0){var b=this.blocks[this.blocks.length-1],c=--this.length&this.offsetMask;return b[c]}},I.prototype.inspect=function(){for(var b=new this.ArrayClass(this.length),c,m=0,t=this.length;m>this.blockMask,b[m]=this.blocks[c][m&this.offsetMask];return b.type=this.ArrayClass.name,b.items=this.length,b.capacity=this.capacity,b.blockSize=this.blockSize,Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),S.exports=I}),df=Ft((E,S)=>{var A=Pe(),B=We();function I(b,c){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=c,this.ArrayClass=b,this.items=new this.ArrayClass(this.capacity),this.clear()}I.prototype.clear=function(){this.size=0},I.prototype.push=function(b){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=b,this.size},I.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},I.prototype.peek=function(){return this.items[this.size-1]},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=b[c-m-1];return m++,{value:t,done:!1}})},I.prototype.entries=function(){var b=this.items,c=this.size,m=0;return new A(function(){if(m>=c)return{done:!0};var t=b[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.toString=function(){return this.toArray().join(",")},I.prototype.toJSON=function(){return this.toArray()},I.prototype.inspect=function(){var b=this.toArray();return b.type=this.ArrayClass.name,b.capacity=this.capacity,Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.from=function(b,c,m){if(arguments.length<3&&(m=B.guessLength(b),typeof m!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new I(c,m);if(B.isArrayLike(b)){var a,v;for(a=0,v=b.length;a{var A=We(),B=Be(),I=df();function b(m,t,a,v,o,r,n,e){var i=n+(e-n)/2|0,h=~-i,s=-~i,l=a[i];v[r]=l+1;var f=t?t(m[l]):m[l][1],u=r*2+1,d=r*2+2,p=-1/0,g=-1/0;n<=h&&(p=b(m,t,a,v,o,u,n,h)),s<=e&&(g=b(m,t,a,v,o,d,s,e));var y=Math.max(f,p,g),x=l;return y===p?x=o[v[u]-1]:y===g&&(x=o[v[d]-1]),o[l]=x,y}function c(m,t){this.size=m.length,this.intervals=m;var a=null,v=null;Array.isArray(t)&&(a=t[0],v=t[1]);var o=m.length,r=B.getPointerArray(o+1),n=new r(o),e;for(e=1;eu?1:0});var i=Math.ceil(Math.log2(o+1)),h=Math.pow(2,i)-1,s=new r(h),l=new r(o);b(m,v,n,s,l,0,0,o-1),n=null,this.height=i,this.tree=s,this.augmentations=l,this.startGetter=a,this.endGetter=v,this.stack=new I(r,this.height)}c.prototype.intervalsContainingPoint=function(m){var t=[],a=this.stack;a.clear(),a.push(0);for(var v=this.tree.length,o,r,n,e,i,h,s,l,f;a.size;)o=a.pop(),r=this.tree[o]-1,n=this.intervals[r],e=this.intervals[this.augmentations[r]],s=this.endGetter?this.endGetter(e):e[1],!(m>s)&&(l=o*2+1,l=i&&m<=h&&t.push(n),!(mf)&&(u=n*2+1,u=s&&t<=l&&v.push(i),!(a{E.search=function(S,A,B,I){var b=0;B=typeof B<"u"?B:0,I=typeof I<"u"?I:S.length,I--;for(var c;B<=I;)if(b=B+I>>>1,c=S[b],c>A)I=~-b;else if(c>>1,m=S(A[I],B),m>0)c=~-I;else if(m<0)b=-~I;else return I;return-1},E.lowerBound=function(S,A,B,I){var b=0;for(B=typeof B<"u"?B:0,I=typeof I<"u"?I:S.length;B>>1,A<=S[b]?I=b:B=-~b;return B},E.lowerBoundWithComparator=function(S,A,B){for(var I=0,b=0,c=A.length;b>>1,S(B,A[I])<=0?c=I:b=-~I;return b},E.lowerBoundIndices=function(S,A,B,I,b){var c=0;for(I=typeof I<"u"?I:0,b=typeof b<"u"?b:S.length;I>>1,B<=S[A[c]]?b=c:I=-~c;return I},E.upperBound=function(S,A,B,I){var b=0;for(B=typeof B<"u"?B:0,I=typeof I<"u"?I:S.length;B>>1,A>=S[b]?B=-~b:I=b;return B},E.upperBoundWithComparator=function(S,A,B){for(var I=0,b=0,c=A.length;b>>1,S(B,A[I])>=0?b=-~I:c=I;return b}}),b1=Ft(E=>{var S=Be(),A=We().isArrayLike,B=cf(),I=Mo();function b(a,v){if(a.length===0)return v.slice();if(v.length===0)return a.slice();var o;a[0]>v[0]&&(o=a,a=v,v=o);var r=a[a.length-1],n=v[0];if(r<=n)return S.isTypedArray(a)?S.concat(a,v):a.concat(v);var e=new a.constructor(a.length+v.length),i,h,s;for(i=0,h=a.length;iv[0]&&(o=a,a=v,v=o);var r=a[a.length-1],n=v[0];if(rv[0]&&(o=a,a=v,v=o);var r=a[a.length-1],n=v[0];if(ru?s=B.lowerBound(v,f,s+1):(e.push(f),i++,s++);return e};function m(a){var v=0,o=-1/0,r,n,e,i=[];for(n=0,e=a.length;no&&(o=r));if(i.length===0)return new a[0].constructor(0);if(i.length===1)return i[0].slice();if(i.length===2)return b(i[0],i[1]);a=i;var h=new a[0].constructor(v),s=S.getPointerArray(o),l=new s(a.length),f=new I(function(p,g){return p=a[p][l[p]],g=a[g][l[g]],pg?1:0});for(n=0;nv&&(v=o));if(e.length===0)return new a[0].constructor(0);if(e.length===1)return e[0].slice();if(e.length===2)return c(e[0],e[1]);a=e;var i=new a[0].constructor,h=S.getPointerArray(v),s=new h(a.length),l=new I(function(d,p){return d=a[d][s[d]],p=a[p][s[p]],dp?1:0});for(r=0;rv&&(v=r),no)return[];if(v===o)return[v];var s,l,f=a[0],u,d,p,g,y,x,T=v;for(i=1;ix?d=B.lowerBound(l,y,d+1):(f.push(y),u++,d++);if(f.length===0)return f;T=f[0]}return f},E.merge=function(){if(arguments.length===2){if(A(arguments[0]))return b(arguments[0],arguments[1])}else if(A(arguments[0]))return m(arguments);return null},E.unionUnique=function(){if(arguments.length===2){if(A(arguments[0]))return c(arguments[0],arguments[1])}else if(A(arguments[0]))return t(arguments);return null},E.intersectionUnique=function(){if(arguments.length===2){if(A(arguments[0]))return E.intersectionUniqueArrays(arguments[0],arguments[1])}else if(A(arguments[0]))return E.kWayIntersectionUniqueArrays(arguments);return null}}),N1=Ft((E,S)=>{var A=Pe(),B=he(),I=b1();function b(m){return m}function c(m){if(this.clear(),Array.isArray(m)?(this.documentTokenizer=m[0],this.queryTokenizer=m[1]):(this.documentTokenizer=m,this.queryTokenizer=m),this.documentTokenizer||(this.documentTokenizer=b),this.queryTokenizer||(this.queryTokenizer=b),typeof this.documentTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: document tokenizer is not a function.");if(typeof this.queryTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: query tokenizer is not a function.")}c.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},c.prototype.add=function(m){this.size++;var t=this.items.length;this.items.push(m);var a=this.documentTokenizer(m);if(!Array.isArray(a))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var v=new Set,o,r,n=0,e=a.length;n"u"||a.length===0)return[];if(t.length>1)for(o=1,r=t.length;o"u"||v.length===0)return[];a=I.intersectionUniqueArrays(a,v)}var n=new Array(a.length);for(o=0,r=n.length;o1?t:this;for(var a=0,v=this.documents.length;a=t)return{done:!0};var v=m[a++];return{value:v,done:!1}})},c.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.documents),c.prototype.inspect=function(){var m=this.items.slice();return Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(m,t){var a=new c(t);return B(m,function(v){a.add(v)}),a},S.exports=c}),vf=Ft(E=>{var S=new Float64Array(64),A=new Float64Array(64);function B(b,c,m){var t,a,v,o,r;for(S[0]=c,A[0]=m,a=0;a>=0;)if(v=S[a],o=A[a]-1,v=t&&vA[a-1]-S[a-1]&&(r=S[a],S[a]=S[a-1],S[a-1]=r,r=A[a],A[a]=A[a-1],A[a-1]=r)}else a--;return b}E.inplaceQuickSort=B;function I(b,c,m,t){var a,v,o,r,n,e;for(S[0]=m,A[0]=t,v=0;v>=0;)if(o=S[v],r=A[v]-1,o=a&&oA[v-1]-S[v-1]&&(e=S[v],S[v]=S[v-1],S[v-1]=e,e=A[v],A[v]=A[v-1],A[v-1]=e)}else v--;return c}E.inplaceQuickSortIndices=I}),G1=Ft((E,S)=>{var A=We(),B=Be(),I=Lr().createTupleComparator,b=Ro(),c=vf().inplaceQuickSortIndices;function m(n,e,i,h){var s,l=0,f;for(s=0;s>>1),C=i[T],f[F]=C,y>-1&&(x===0?u[y]=F+1:d[y]=F+1),L=(L+1)%n,T!==M&&T!==w-1&&p.push([L,T+1,w,F,1]),T!==M&&p.push([L,M,T,F,0]),F++;return{axes:e,labels:h,pivots:f,lefts:u,rights:d}}function v(n,e){this.dimensions=n,this.visited=0,this.axes=e.axes,this.labels=e.labels,this.pivots=e.pivots,this.lefts=e.lefts,this.rights=e.rights,this.size=this.labels.length}v.prototype.nearestNeighbor=function(n){var e=1/0,i=null,h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(g,y){d++;var x=f[y],T=u[y],C=l[y],M=m(h,s,C,n);if(!(M0?x!==0&&p(g,x-1):T!==0&&p(g,T-1),w*w0?T!==0&&p(g,T-1):x!==0&&p(g,x-1))}}return p(0,0),this.visited=d,this.labels[i]};var o=I(3),r=I(2);v.prototype.kNearestNeighbors=function(n,e){if(n<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(n=Math.min(n,this.size),n===1)return[this.nearestNeighbor(e)];var i=new b(Array,o,n),h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(x,T){var C=f[T],M=u[T],w=l[T],L=m(h,s,w,e);i.push([L,d++,w]);var F=e[x],O=s[x][w],N=F-O;x=(x+1)%h,F{var A=Pe(),B=he();function I(){this.clear()}I.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},I.prototype.first=function(){return this.head?this.head.item:void 0},I.prototype.peek=I.prototype.first,I.prototype.last=function(){return this.tail?this.tail.item:void 0},I.prototype.push=function(b){var c={item:b,next:null};return this.head?(this.tail.next=c,this.tail=c):(this.head=c,this.tail=c),this.size++,this.size},I.prototype.unshift=function(b){var c={item:b,next:null};return this.head?(this.head.next||(this.tail=this.head),c.next=this.head,this.head=c):(this.head=c,this.tail=c),this.size++,this.size},I.prototype.shift=function(){if(this.size){var b=this.head;return this.head=b.next,this.size--,b.item}},I.prototype.forEach=function(b,c){if(this.size){c=arguments.length>1?c:this;for(var m=this.head,t=0;m;)b.call(c,m.item,t,this),m=m.next,t++}},I.prototype.toArray=function(){if(!this.size)return[];for(var b=new Array(this.size),c=0,m=this.size,t=this.head;c{var A=Pe(),B=he(),I=Be(),b=We();function c(m,t,a){if(arguments.length<2&&(a=m,m=null,t=null),this.capacity=a,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var v=I.getPointerArray(a);this.forward=new v(a),this.backward=new v(a),this.K=typeof m=="function"?new m(a):new Array(a),this.V=typeof t=="function"?new t(a):new Array(a),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(m){var t=this.head;if(this.head===m)return this;var a=this.backward[m],v=this.forward[m];return this.tail===m?this.tail=a:this.backward[v]=a,this.forward[a]=v,this.backward[t]=m,this.head=m,this.forward[m]=t,this},c.prototype.set=function(m,t){var a=this.items[m];if(typeof a<"u"){this.splayOnTop(a),this.V[a]=t;return}this.size1?t:this;for(var a=0,v=this.size,o=this.head,r=this.K,n=this.V,e=this.forward;a=t)return{done:!0};var r=v[a];return m++,m=t)return{done:!0};var r=v[a];return m++,m=t)return{done:!0};var n=v[a],e=o[a];return m++,m{var A=Fo(),B=he(),I=Be(),b=We();function c(t,a,v){arguments.length<2?A.call(this,t):A.call(this,t,a,v);var o=I.getPointerArray(this.capacity);this.deleted=new o(this.capacity),this.deletedSize=0}for(m in A.prototype)c.prototype[m]=A.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=A.prototype[Symbol.iterator]),c.prototype.clear=function(){A.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,a){var v=this.items[t];if(typeof v<"u"){this.splayOnTop(v),this.V[v]=a;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],delete this.items[this.K[v]]),this.items[t]=v,this.K[v]=t,this.V[v]=a,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,a){var v=null,o=null,r=this.items[t];return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=a,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],o=this.K[r],delete this.items[o]),this.items[t]=r,this.K[r]=t,this.V[r]=a,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,o?{evicted:!0,key:o,value:v}:null)},c.prototype.delete=function(t){var a=this.items[t];if(typeof a>"u")return!1;if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[a],o=this.forward[a];return this.head===a&&(this.head=o),this.tail===a&&(this.tail=v),this.forward[v]=o,this.backward[o]=v,this.size--,this.deleted[this.deletedSize++]=a,!0},c.prototype.remove=function(t,a=void 0){var v=this.items[t];if(typeof v>"u")return a;var o=this.V[v];if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,o;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,o},c.from=function(t,a,v,o){if(arguments.length<2){if(o=b.guessLength(t),typeof o!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(o=a,a=null,v=null);var r=new c(a,v,o);return B(t,function(n,e){r.set(e,n)}),r},S.exports=c}),pf=Ft((E,S)=>{var A=Fo(),B=he(),I=Be(),b=We();function c(m,t,a){if(arguments.length<2&&(a=m,m=null,t=null),this.capacity=a,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var v=I.getPointerArray(a);this.forward=new v(a),this.backward=new v(a),this.K=typeof m=="function"?new m(a):new Array(a),this.V=typeof t=="function"?new t(a):new Array(a),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(m,t){var a=this.items.get(m);if(typeof a<"u"){this.splayOnTop(a),this.V[a]=t;return}this.size{var A=pf(),B=he(),I=Be(),b=We();function c(t,a,v){arguments.length<2?A.call(this,t):A.call(this,t,a,v);var o=I.getPointerArray(this.capacity);this.deleted=new o(this.capacity),this.deletedSize=0}for(m in A.prototype)c.prototype[m]=A.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=A.prototype[Symbol.iterator]),c.prototype.clear=function(){A.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,a){var v=this.items.get(t);if(typeof v<"u"){this.splayOnTop(v),this.V[v]=a;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],this.items.delete(this.K[v])),this.items.set(t,v),this.K[v]=t,this.V[v]=a,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,a){var v=null,o=null,r=this.items.get(t);return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=a,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],o=this.K[r],this.items.delete(o)),this.items.set(t,r),this.K[r]=t,this.V[r]=a,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,o?{evicted:!0,key:o,value:v}:null)},c.prototype.delete=function(t){var a=this.items.get(t);if(typeof a>"u")return!1;if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[a],o=this.forward[a];return this.head===a&&(this.head=o),this.tail===a&&(this.tail=v),this.forward[v]=o,this.backward[o]=v,this.size--,this.deleted[this.deletedSize++]=a,!0},c.prototype.remove=function(t,a=void 0){var v=this.items.get(t);if(typeof v>"u")return a;var o=this.V[v];if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,o;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,o},c.from=function(t,a,v,o){if(arguments.length<2){if(o=b.guessLength(t),typeof o!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(o=a,a=null,v=null);var r=new c(a,v,o);return B(t,function(n,e){r.set(e,n)}),r},S.exports=c}),V1=Ft((E,S)=>{var A=Pe(),B=he(),I=Ro(),b=function(m,t){return m[1]>t[1]?-1:m[1]"u"?0:t},c.prototype.get=c.prototype.multiplicity,c.prototype.count=c.prototype.multiplicity,c.prototype.frequency=function(m){if(this.size===0)return 0;var t=this.multiplicity(m);return t/this.size},c.prototype.top=function(m){if(typeof m!="number"||m<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var t=new I(Array,b,m),a=this.items.entries(),v;v=a.next(),!v.done;)t.push(v.value);return t.consume()},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;var a;this.items.forEach(function(v,o){for(a=0;a1?t:this,this.items.forEach(m,t)},c.prototype.keys=function(){return this.items.keys()},c.prototype.values=function(){var m=this.items.entries(),t=!1,a,v,o,r;return new A(function n(){if(!t){if(a=m.next(),a.done)return{done:!0};t=!0,v=a.value[0],o=a.value[1],r=0}return r>=o?(t=!1,n()):(r++,{done:!1,value:v})})},c.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return this.items},c.from=function(m){var t=new c;return B(m,function(a){t.add(a)}),t},c.isSubset=function(m,t){var a=m.multiplicities(),v,o,r;if(m===t)return!0;if(m.dimension>t.dimension)return!1;for(;v=a.next(),!v.done;)if(o=v.value[0],r=v.value[1],t.multiplicity(o){var A=Pe(),B=he();function I(n,e,i){return((Math.pow(n,2)-Math.pow(Math.abs(e-i),2))/2|0)+n+1}function b(n,e){for(var i=0,h=0,s=e+1;he.length?-1:n.lengthe?1:0}function m(n,e){var i=n+1,h=e/i|0,s=h+1,l,f,u=e-h*i,d=i-u,p=new Array(n+1);for(l=0;l 0");this.levenshtein=n,this.k=e,this.clear()}r.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},r.prototype.add=function(n){var e=n.length,i=this.size;this.strings.push(n),this.size++;var h=t(this.k,n),s=this.invertedIndices[e];typeof s>"u"&&(s={},this.invertedIndices[e]=s);var l,f,u,d,p;for(d=0,p=h.length;d"u"?(f=[i],s[u]=f):f.push(i);return this},r.prototype.search=function(n){var e=n.length,i=this.k,h=new Set,s,l,f,u,d,p,g,y,x,T,C,M,w,L,F;for(y=Math.max(0,e-i),x=e+i+1;y1?e:this;for(var i=0,h=this.strings.length;i=e)return{done:!0};var h=n[i];return i++,{value:h,done:!1}})},typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=r.prototype.values),r.prototype.inspect=function(){var n=this.strings.slice();return Object.defineProperty(n,"constructor",{value:r,enumerable:!1}),n},typeof Symbol<"u"&&(r.prototype[Symbol.for("nodejs.util.inspect.custom")]=r.prototype.inspect),r.from=function(n,e,i){var h=new r(e,i);return B(n,function(s){h.add(s)}),h},r.countKeys=b,r.comparator=c,r.partition=m,r.segments=t,r.segmentPos=a,r.multiMatchAwareInterval=v,r.multiMatchAwareSubstrings=o,S.exports=r}),Y1=Ft((E,S)=>{var A=Pe(),B=he();function I(){this.clear()}I.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},I.prototype.enqueue=function(b){return this.items.push(b),++this.size},I.prototype.dequeue=function(){if(this.size){var b=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,b}},I.prototype.peek=function(){if(this.size)return this.items[this.offset]},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=this.offset,t=0,a=this.items.length;m=b.length)return{done:!0};var m=b[c];return c++,{value:m,done:!1}})},I.prototype.entries=function(){var b=this.items,c=this.offset,m=0;return new A(function(){if(c>=b.length)return{done:!0};var t=b[c];return c++,{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.toString=function(){return this.toArray().join(",")},I.prototype.toJSON=function(){return this.toArray()},I.prototype.inspect=function(){var b=this.toArray();return Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.from=function(b){var c=new I;return B(b,function(m){c.enqueue(m)}),c},I.of=function(){return I.from(arguments)},S.exports=I}),H1=Ft((E,S)=>{var A=Pe(),B=he();function I(){this.clear()}I.prototype.clear=function(){this.items=[],this.size=0},I.prototype.push=function(b){return this.items.push(b),++this.size},I.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},I.prototype.peek=function(){return this.items[this.size-1]},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=b[c-m-1];return m++,{value:t,done:!1}})},I.prototype.entries=function(){var b=this.items,c=b.length,m=0;return new A(function(){if(m>=c)return{done:!0};var t=b[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.toString=function(){return this.toArray().join(",")},I.prototype.toJSON=function(){return this.toArray()},I.prototype.inspect=function(){var b=this.toArray();return Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),I.from=function(b){var c=new I;return B(b,function(m){c.push(m)}),c},I.of=function(){return I.from(arguments)},S.exports=I}),j1=Ft(E=>{E.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var S=new Set,A=1/0,B=null,I,b,c=arguments.length;for(b=0;bA.size)return!1;for(;I=B.next(),!I.done;)if(!A.has(I.value))return!1;return!0},E.isSuperset=function(S,A){return E.isSubset(A,S)},E.add=function(S,A){for(var B=A.values(),I;I=B.next(),!I.done;)S.add(I.value)},E.subtract=function(S,A){for(var B=A.values(),I;I=B.next(),!I.done;)S.delete(I.value)},E.intersect=function(S,A){for(var B=S.values(),I;I=B.next(),!I.done;)A.has(I.value)||S.delete(I.value)},E.disjunct=function(S,A){for(var B=S.values(),I,b=[];I=B.next(),!I.done;)A.has(I.value)&&b.push(I.value);for(B=A.values();I=B.next(),!I.done;)S.has(I.value)||S.add(I.value);for(var c=0,m=b.length;cA.size&&(B=S,S=A,A=B),S.size===0)return 0;if(S===A)return S.size;for(var I=S.values(),b,c=0;b=I.next(),!b.done;)A.has(b.value)&&c++;return c},E.unionSize=function(S,A){var B=E.intersectionSize(S,A);return S.size+A.size-B},E.jaccard=function(S,A){var B=E.intersectionSize(S,A);if(B===0)return 0;var I=S.size+A.size-B;return B/I},E.overlap=function(S,A){var B=E.intersectionSize(S,A);return B===0?0:B/Math.min(S.size,A.size)}}),K1=Ft((E,S)=>{var A=Pe(),B=Be().getPointerArray;function I(b){var c=B(b);this.start=0,this.size=0,this.capacity=b,this.dense=new c(b),this.sparse=new c(b)}I.prototype.clear=function(){this.start=0,this.size=0},I.prototype.has=function(b){if(this.size===0)return!1;var c=this.sparse[b],m=c=this.start&&c=this.start&&c1?c:this;for(var m=this.capacity,t=this.size,a=this.start,v=0;v=m)return{done:!0};var v=b[t];return t++,a++,t===c&&(t=0),{value:v,done:!1}})},typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=I.prototype.values),I.prototype.inspect=function(){var b=[];return this.forEach(function(c){b.push(c)}),Object.defineProperty(b,"constructor",{value:I,enumerable:!1}),b.capacity=this.capacity,b},typeof Symbol<"u"&&(I.prototype[Symbol.for("nodejs.util.inspect.custom")]=I.prototype.inspect),S.exports=I}),$1=Ft((E,S)=>{var A=Pe(),B=Be().getPointerArray;function I(b,c){arguments.length<2&&(c=b,b=Array);var m=B(c);this.size=0,this.length=c,this.dense=new m(c),this.sparse=new m(c),this.vals=new b(c)}I.prototype.clear=function(){this.size=0},I.prototype.has=function(b){var c=this.sparse[b];return c=this.size||this.dense[c]!==b?!1:(c=this.dense[this.size-1],this.dense[this.sparse[b]]=c,this.sparse[c]=this.sparse[b],this.size--,!0)},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m=0;m{var A=Pe(),B=Be().getPointerArray;function I(b){var c=B(b);this.size=0,this.length=b,this.dense=new c(b),this.sparse=new c(b)}I.prototype.clear=function(){this.size=0},I.prototype.has=function(b){var c=this.sparse[b];return c=this.size||this.dense[c]!==b?!1:(c=this.dense[this.size-1],this.dense[this.sparse[b]]=c,this.sparse[c]=this.sparse[b],this.size--,!0)},I.prototype.forEach=function(b,c){c=arguments.length>1?c:this;for(var m,t=0;t{var A=he(),B=2,I=2,b=new Set([0,1,2]),c={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function m(e){var i=new Set;return typeof e=="number"&&i.add(e),{suggestions:i,count:0}}function t(e,i,h){return{term:e||"",distance:i||0,count:h||0}}function a(e,i,h,s){s=s||new Set,i++;var l,f=e.length,u;if(f>1)for(u=0;u0&&e[u].length-f.length>s.length-f.length&&(h.suggestions=new Set,h.count=0),(i===2||!h.suggestions.size||e[u].length-f.length>=s.length-f.length)&&h.suggestions.add(l)}function o(e,i){var h=e.length,s=i.length,l=[[]],f=h+s,u=new Map,d,p,g;for(l[0][0]=f,d=0;d<=h;d++)l[d+1]||(l[d+1]=[]),l[d+1][1]=d,l[d+1][0]=f;for(g=0;g<=s;g++)l[1][g+1]=g,l[0][g+1]=f;var y=e+i,x;for(d=0,p=y.length;dl)return[];for(var d=[f],p=new Set,g=new Set,y=[],x,T;d.length>0&&(x=d.shift(),!(h<2&&y.length>0&&u-x.length>y[0].distance));){if(T=e[x],T!==void 0){if(typeof T=="number"&&(T=m(T)),T.count>0&&!g.has(x)){g.add(x);var C=t(x,u-x.length,T.count);if(y.push(C),h<2&&u-x.length===0)break}T.suggestions.forEach(F=>{var O=i[F];if(!g.has(O)){g.add(O);var N=0;if(f!==O)if(O.length===x.length)N=u-x.length;else if(u===x.length)N=O.length-x.length;else{for(var G=0,V=0,j=O.length;G0||V>0?N=o(O.substr(G,j-G-V),f.substr(G,u-G-V)):N=o(O,f)}if(h<2&&y.length>0&&y[0].distance>N&&(y=[]),!(h<2&&y.length>0&&N>y[0].distance)&&N<=s){var K=e[O];K!==void 0&&y.push(t(O,N,K.count))}}})}if(u-x.length0&&u-x.length>=y[0].distance)continue;for(var M=0,w=x.length;Mthis.maxLength&&(this.maxLength=e.length)),i.count===1){var h=this.words.length;this.words.push(e);var s=a(e,0,this.maxDistance);s.forEach(l=>{var f=this.dictionary[l];f!==void 0?(typeof f=="number"&&(f=m(f),this.dictionary[l]=f),f.suggestions.has(h)||v(this.words,this.verbosity,f,e,h,l)):this.dictionary[l]=h})}return this.size++,this},n.prototype.search=function(e){return r(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,e)},n.prototype.inspect=function(){var e=[];e.size=this.size,e.maxDistance=this.maxDistance,e.verbosity=this.verbosity,e.behavior=c[this.verbosity];for(var i in this.dictionary)typeof this.dictionary[i]=="object"&&this.dictionary[i].count&&e.push([i,this.dictionary[i].count]);return Object.defineProperty(e,"constructor",{value:n,enumerable:!1}),e},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(e,i){var h=new n(i);return A(e,function(s){h.add(s)}),h},S.exports=n}),gf=Ft((E,S)=>{var A=he(),B=Pe(),I="\0";function b(c){this.mode=c===Array?"array":"string",this.clear()}b.prototype.clear=function(){this.root={},this.size=0},b.prototype.set=function(c,m){for(var t=this.root,a,v=0,o=c.length;v"u")return;if(I in m)return m[I]},b.prototype.delete=function(c){var m=this.root,t=null,a=null,v,o,r,n;for(r=0,n=c.length;r"u")return!1;t!==null?Object.keys(m).length>1&&(t=null,a=null):Object.keys(m).length<2&&(t=v,a=o)}return I in m?(this.size--,t?delete t[a]:delete m[I],!0):!1},b.prototype.has=function(c){for(var m=this.root,t,a=0,v=c.length;a"u")return!1;return I in m},b.prototype.find=function(c){var m=typeof c=="string",t=this.root,a=[],v,o,r;for(o=0,r=c.length;o"u")return a;for(var n=[t],e=[c],i;n.length;){c=e.pop(),t=n.pop();for(i in t){if(i===I){a.push([c,t[I]]);continue}n.push(t[i]),e.push(m?c+i:c.concat(i))}}return a},b.prototype.values=function(c){var m=this.root,t=[],a,v,o;if(c){for(v=0,o=c.length;v"u")return B.empty()}return t.push(m),new B(function(){for(var r,n=!1,e;t.length;){r=t.pop();for(e in r){if(e===I){n=!0;continue}t.push(r[e])}if(n)return{done:!1,value:r[I]}}return{done:!0}})},b.prototype.prefixes=function(c){var m=this.root,t=[],a=[],v,o,r,n=this.mode==="string";if(c){for(o=0,r=c.length;o"u")return B.empty()}else c=n?"":[];return t.push(m),a.push(c),new B(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=a.pop();for(s in e){if(s===I){h=!0;continue}t.push(e[s]),a.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:i}}return{done:!0}})},b.prototype.keys=b.prototype.prefixes,b.prototype.entries=function(c){var m=this.root,t=[],a=[],v,o,r,n=this.mode==="string";if(c){for(o=0,r=c.length;o"u")return B.empty()}else c=n?"":[];return t.push(m),a.push(c),new B(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=a.pop();for(s in e){if(s===I){h=!0;continue}t.push(e[s]),a.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:[i,e[I]]}}return{done:!0}})},typeof Symbol<"u"&&(b.prototype[Symbol.iterator]=b.prototype.entries),b.prototype.inspect=function(){for(var c=new Array(this.size),m=this.entries(),t,a=0;t=m.next(),!t.done;)c[a++]=t.value;return Object.defineProperty(c,"constructor",{value:b,enumerable:!1}),c},typeof Symbol<"u"&&(b.prototype[Symbol.for("nodejs.util.inspect.custom")]=b.prototype.inspect),b.prototype.toJSON=function(){return this.root},b.from=function(c){var m=new b;return A(c,function(t,a){m.set(a,t)}),m},b.SENTINEL=I,S.exports=b}),Q1=Ft((E,S)=>{var A=he(),B=gf(),I="\0";function b(m){this.mode=m===Array?"array":"string",this.clear()}for(c in B.prototype)b.prototype[c]=B.prototype[c];var c;delete b.prototype.set,delete b.prototype.get,delete b.prototype.values,delete b.prototype.entries,b.prototype.add=function(m){for(var t=this.root,a,v=0,o=m.length;v"u")return v;for(var e=[a],i=[m],h;e.length;){m=i.pop(),a=e.pop();for(h in a){if(h===I){v.push(m);continue}e.push(a[h]),i.push(t?m+h:m.concat(h))}}return v},typeof Symbol<"u"&&(b.prototype[Symbol.iterator]=b.prototype.keys),b.prototype.inspect=function(){for(var m=new Set,t=this.keys(),a;a=t.next(),!a.done;)m.add(a.value);return Object.defineProperty(m,"constructor",{value:b,enumerable:!1}),m},typeof Symbol<"u"&&(b.prototype[Symbol.for("nodejs.util.inspect.custom")]=b.prototype.inspect),b.prototype.toJSON=function(){return this.root},b.from=function(m){var t=new b;return A(m,function(a){t.add(a)}),t},b.SENTINEL=I,S.exports=b}),k1=Ft((E,S)=>{var A=Pe(),B=he(),I=We(),b=Be(),c=function(v){return Math.max(1,Math.ceil(v*1.5))},m=function(v){var o=b.getPointerArray(v);return new o(v)};function t(v,o){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var r=o||0,n=c,e=0,i=!1;typeof o=="object"&&(r=o.initialCapacity||0,e=o.initialLength||0,n=o.policy||n,i=o.factory===!0),this.factory=i?v:null,this.ArrayClass=v,this.length=e,this.capacity=Math.max(e,r),this.policy=n,this.array=new v(this.capacity)}t.prototype.set=function(v,o){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(v):this.array=this.factory(v),b.isTypedArray(this.array))this.array.set(o,0);else for(var r=0,n=this.length;r=v)return this;for(o=this.capacity;o=o)return{done:!0};var n=v[r];return r++,{value:n,done:!1}})},t.prototype.entries=function(){var v=this.array,o=this.length,r=0;return new A(function(){if(r>=o)return{done:!0};var n=v[r];return{value:[r++,n],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var v=this.array.slice(0,this.length);return v.type=this.array.constructor.name,v.items=this.length,v.capacity=this.capacity,Object.defineProperty(v,"constructor",{value:t,enumerable:!1}),v},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(v,o,r){if(arguments.length<3&&(r=I.guessLength(v),typeof r!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var n=new t(o,r);return B(v,function(e){n.push(e)}),n};function a(v){var o=function(n){t.call(this,v,n)};for(var r in t.prototype)t.prototype.hasOwnProperty(r)&&(o.prototype[r]=t.prototype[r]);return o.from=function(n,e){return t.from(n,v,e)},typeof Symbol<"u"&&(o.prototype[Symbol.iterator]=o.prototype.values),o}t.Int8Vector=a(Int8Array),t.Uint8Vector=a(Uint8Array),t.Uint8ClampedVector=a(Uint8ClampedArray),t.Int16Vector=a(Int16Array),t.Uint16Vector=a(Uint16Array),t.Int32Vector=a(Int32Array),t.Uint32Vector=a(Uint32Array),t.Float32Vector=a(Float32Array),t.Float64Vector=a(Float64Array),t.PointerVector=a(m),S.exports=t}),q1=Ft((E,S)=>{var A=We(),B=Be(),I=vf().inplaceQuickSortIndices,b=cf().lowerBoundIndices,c=wo(),m=B.getPointerArray;function t(o,r){return o.distancer.distance?-1:0}function a(o,r,n){for(var e=n.length,i=m(e),h=0,s=new i(e),l=new i(e),f=new i(e),u=new Float64Array(e),d=[0,0,e],p=new Float64Array(e),g,y,x,T,C,M,w,L,F;d.length;)if(C=d.pop(),T=d.pop(),g=d.pop(),y=n[C-1],C--,F=C-T,s[g]=y,F!==0){if(F===1){w=o(r[y],r[n[T]]),u[g]=w,h++,f[g]=h,s[h]=n[T];continue}for(L=T;L0&&(h++,f[g]=h,d.push(h,M,C)),M-T>0&&(h++,l[g]=h,d.push(h,T,M))}return{nodes:s,lefts:l,rights:f,mus:u}}function v(o,r){if(typeof o!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!r)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=o,this.heap=new c(t),this.D=0;var n=A.toArrayWithIndices(r);this.items=n[0];var e=n[1];this.size=e.length;var i=a(o,this.items,e);this.nodes=i.nodes,this.lefts=i.lefts,this.rights=i.rights,this.mus=i.mus}v.prototype.nearestNeighbors=function(o,r){var n=this.heap,e=[0],i=1/0,h,s,l,f,u,d,p;for(this.D=0;e.length;)h=e.pop(),s=this.nodes[h],l=this.items[s],p=this.distance(l,r),this.D++,po&&n.pop(),n.size>=o&&(i=n.peek().distance)),f=this.lefts[h],u=this.rights[h],!(!f&&!u)&&(d=this.mus[h],p=d-i&&e.push(u)):(u&&p>=d-i&&e.push(u),f&&p=0;y--)g[y]=n.pop();return g},v.prototype.neighbors=function(o,r){var n=[],e=[0],i,h,s,l,f,u,d;for(this.D=0;e.length;)i=e.pop(),h=this.nodes[i],s=this.items[h],d=this.distance(s,r),this.D++,d<=o&&n.push({distance:d,item:s}),l=this.lefts[i],f=this.rights[i],!(!l&&!f)&&(u=this.mus[i],d=u-o&&e.push(f)):(f&&d>=u-o&&e.push(f),l&&d{var A=wo(),B=Mo(),I=T1();S.exports={BiMap:S1(),BitSet:C1(),BitVector:E1(),BloomFilter:A1(),BKTree:M1(),CircularBuffer:w1(),DefaultMap:R1(),DefaultWeakMap:F1(),FixedDeque:uf(),StaticDisjointSet:L1(),FibonacciHeap:B,MinFibonacciHeap:B.MinFibonacciHeap,MaxFibonacciHeap:B.MaxFibonacciHeap,FixedReverseHeap:Ro(),FuzzyMap:O1(),FuzzyMultiMap:D1(),HashedArrayTree:I1(),Heap:A,MinHeap:A.MinHeap,MaxHeap:A.MaxHeap,StaticIntervalTree:B1(),InvertedIndex:N1(),KDTree:G1(),LinkedList:z1(),LRUCache:Fo(),LRUCacheWithDelete:U1(),LRUMap:pf(),LRUMapWithDelete:X1(),MultiMap:ff(),MultiSet:V1(),PassjoinIndex:W1(),Queue:Y1(),FixedStack:df(),Stack:H1(),SuffixArray:I,GeneralizedSuffixArray:I.GeneralizedSuffixArray,Set:j1(),SparseQueueSet:K1(),SparseMap:$1(),SparseSet:Z1(),SymSpell:J1(),Trie:Q1(),TrieMap:gf(),Vector:k1(),VPTree:q1()}}),ft=class ve{static get ZERO(){return new ve(0,0)}static get ONE(){return new ve(1,1)}static get UP(){return new ve(0,-1)}static get DOWN(){return new ve(0,1)}static get LEFT(){return new ve(-1,0)}static get RIGHT(){return new ve(1,0)}static get UP_LEFT(){return new ve(-1,-1)}static get UP_RIGHT(){return new ve(1,-1)}static get DOWN_RIGHT(){return new ve(1,1)}static get DOWN_LEFT(){return new ve(-1,1)}constructor(S,A){typeof S=="number"?(this.x=S,this.y=A||0):(this.x=S.x,this.y=S.y)}clone(){return new ve(this.x,this.y)}add(S){return new ve(this.x+S.x,this.y+S.y)}multiply(S){return new ve(this.x*S.x,this.y*S.y)}divide(S){return new ve(this.x/S.x,this.y/S.y)}subtract(S){return new ve(this.x-S.x,this.y-S.y)}equals(S){return this.x===S.x&&this.y===S.y}abs(){return new ve(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(S){return new ve(this.x%S.x,this.y%S.y)}scalarModulo(S){return new ve(this.x%S,this.y%S)}scalarMult(S){return new ve(this.x*S,this.y*S)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},zt=class{static equal(E,S){return E.position.x===S.position.x&&E.position.y===S.position.y&&E.layer===S.layer}static copyOver(E,S){S.position.x=E.position.x,S.position.y=E.position.y,S.layer=E.layer}static clone(E){return{position:E.position.clone(),layer:E.layer}}static toString(E){return`${E.position.toString()}#${E.layer}`}static toInternal(E){return{position:new ft(E.position.x,E.position.y),layer:E.charLayer}}static fromInternal(E){return{position:E.position.toPosition(),charLayer:E.layer}}},tT=(E=>(E.NONE="none",E.LEFT="left",E.UP_LEFT="up-left",E.UP="up",E.UP_RIGHT="up-right",E.RIGHT="right",E.DOWN_RIGHT="down-right",E.DOWN="down",E.DOWN_LEFT="down-left",E))(tT||{}),eT={up:"down",down:"up",left:"right",right:"left",none:"none","up-left":"down-right","up-right":"down-left","down-right":"up-left","down-left":"up-right"},iT={up:ft.UP,down:ft.DOWN,left:ft.LEFT,right:ft.RIGHT,none:ft.ZERO,"up-left":ft.UP_LEFT,"up-right":ft.UP_RIGHT,"down-right":ft.DOWN_RIGHT,"down-left":ft.DOWN_LEFT},or={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},mf=["up","up-right","right","down-right","down","down-left","left","up-left"],sT=["down-left","down-right","up-right","up-left"];function Lo(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function Qs(E){return sT.includes(E)}function nT(E,S=1){return E==="none"?"none":mf[(or[E]+8-Math.abs(S)%8)%8]}function xf(E,S=1){return E==="none"?"none":mf[(or[E]+S)%8]}function ns(E){return iT[E]}function rT(E){return eT[E]}function qe(E,S){if(E.x===S.x){if(E.y>S.y)return"up";if(E.yS.x)return"left";if(E.xS.x){if(E.yS.y)return"up-left"}else if(E.xS.y)return"up-right"}return"none"}var aT=(E=>(E[E.FOUR=4]="FOUR",E[E.EIGHT=8]="EIGHT",E))(aT||{});function Es(E){return typeof E=="string"&&Lo().includes(E)}var ao=function(E,S){return ao=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,B){A.__proto__=B}||function(A,B){for(var I in B)Object.prototype.hasOwnProperty.call(B,I)&&(A[I]=B[I])},ao(E,S)};function on(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");ao(E,S);function A(){this.constructor=E}E.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}function oT(E,S,A,B){function I(b){return b instanceof A?b:new A(function(c){c(b)})}return new(A||(A=Promise))(function(b,c){function m(v){try{a(B.next(v))}catch(o){c(o)}}function t(v){try{a(B.throw(v))}catch(o){c(o)}}function a(v){v.done?b(v.value):I(v.value).then(m,t)}a((B=B.apply(E,S||[])).next())})}function yf(E,S){var A={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},B,I,b,c;return c={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function m(a){return function(v){return t([a,v])}}function t(a){if(B)throw new TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(A=0)),A;)try{if(B=1,I&&(b=a[0]&2?I.return:a[0]?I.throw||((b=I.return)&&b.call(I),0):I.next)&&!(b=b.call(I,a[1])).done)return b;switch(I=0,b&&(a=[a[0]&2,b.value]),a[0]){case 0:case 1:b=a;break;case 4:return A.label++,{value:a[1],done:!1};case 5:A.label++,I=a[1],a=[0];continue;case 7:a=A.ops.pop(),A.trys.pop();continue;default:if(b=A.trys,!(b=b.length>0&&b[b.length-1])&&(a[0]===6||a[0]===2)){A=0;continue}if(a[0]===3&&(!b||a[1]>b[0]&&a[1]=E.length&&(E=void 0),{value:E&&E[B++],done:!E}}};throw new TypeError(S?"Object is not iterable.":"Symbol.iterator is not defined.")}function en(E,S){var A=typeof Symbol=="function"&&E[Symbol.iterator];if(!A)return E;var B=A.call(E),I,b=[],c;try{for(;(S===void 0||S-- >0)&&!(I=B.next()).done;)b.push(I.value)}catch(m){c={error:m}}finally{try{I&&!I.done&&(A=B.return)&&A.call(B)}finally{if(c)throw c.error}}return b}function sn(E,S,A){if(A||arguments.length===2)for(var B=0,I=S.length,b;B1||m(r,n)})})}function m(r,n){try{t(B[r](n))}catch(e){o(b[0][3],e)}}function t(r){r.value instanceof Ps?Promise.resolve(r.value.v).then(a,v):o(b[0][2],r)}function a(r){m("next",r)}function v(r){m("throw",r)}function o(r,n){r(n),b.shift(),b.length&&m(b[0][0],b[0][1])}}function lT(E){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var S=E[Symbol.asyncIterator],A;return S?S.call(E):(E=typeof ws=="function"?ws(E):E[Symbol.iterator](),A={},B("next"),B("throw"),B("return"),A[Symbol.asyncIterator]=function(){return this},A);function B(b){A[b]=E[b]&&function(c){return new Promise(function(m,t){c=E[b](c),I(m,t,c.done,c.value)})}}function I(b,c,m,t){Promise.resolve(t).then(function(a){b({value:a,done:m})},c)}}function xe(E){return typeof E=="function"}function Tf(E){var S=function(B){Error.call(B),B.stack=new Error().stack},A=E(S);return A.prototype=Object.create(Error.prototype),A.prototype.constructor=A,A}var $a=Tf(function(E){return function(S){E(this),this.message=S?S.length+` errors occurred during unsubscription: -`+S.map(function(A,B){return B+1+") "+A.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=S}});function oo(E,S){if(E){var A=E.indexOf(S);0<=A&&E.splice(A,1)}}var Or=function(){function E(S){this.initialTeardown=S,this.closed=!1,this._parentage=null,this._finalizers=null}return E.prototype.unsubscribe=function(){var S,A,B,I,b;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var m=ws(c),t=m.next();!t.done;t=m.next()){var a=t.value;a.remove(this)}}catch(i){S={error:i}}finally{try{t&&!t.done&&(A=m.return)&&A.call(m)}finally{if(S)throw S.error}}else c.remove(this);var v=this.initialTeardown;if(xe(v))try{v()}catch(i){b=i instanceof $a?i.errors:[i]}var o=this._finalizers;if(o){this._finalizers=null;try{for(var r=ws(o),n=r.next();!n.done;n=r.next()){var e=n.value;try{Mu(e)}catch(i){b=b??[],i instanceof $a?b=sn(sn([],en(b)),en(i.errors)):b.push(i)}}}catch(i){B={error:i}}finally{try{n&&!n.done&&(I=r.return)&&I.call(r)}finally{if(B)throw B.error}}}if(b)throw new $a(b)}},E.prototype.add=function(S){var A;if(S&&S!==this)if(this.closed)Mu(S);else{if(S instanceof E){if(S.closed||S._hasParent(this))return;S._addParent(this)}(this._finalizers=(A=this._finalizers)!==null&&A!==void 0?A:[]).push(S)}},E.prototype._hasParent=function(S){var A=this._parentage;return A===S||Array.isArray(A)&&A.includes(S)},E.prototype._addParent=function(S){var A=this._parentage;this._parentage=Array.isArray(A)?(A.push(S),A):A?[A,S]:S},E.prototype._removeParent=function(S){var A=this._parentage;A===S?this._parentage=null:Array.isArray(A)&&oo(A,S)},E.prototype.remove=function(S){var A=this._finalizers;A&&oo(A,S),S instanceof E&&S._removeParent(this)},E.EMPTY=function(){var S=new E;return S.closed=!0,S}(),E}(),Sf=Or.EMPTY;function Cf(E){return E instanceof Or||E&&"closed"in E&&xe(E.remove)&&xe(E.add)&&xe(E.unsubscribe)}function Mu(E){xe(E)?E():E.unsubscribe()}var Ef={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},uT={setTimeout:function(E,S){for(var A=[],B=2;B0},enumerable:!1,configurable:!0}),S.prototype._trySubscribe=function(A){return this._throwIfClosed(),E.prototype._trySubscribe.call(this,A)},S.prototype._subscribe=function(A){return this._throwIfClosed(),this._checkFinalizedStatuses(A),this._innerSubscribe(A)},S.prototype._innerSubscribe=function(A){var B=this,I=this,b=I.hasError,c=I.isStopped,m=I.observers;return b||c?Sf:(this.currentObservers=null,m.push(A),new Or(function(){B.currentObservers=null,oo(m,A)}))},S.prototype._checkFinalizedStatuses=function(A){var B=this,I=B.hasError,b=B.thrownError,c=B.isStopped;I?A.error(b):c&&A.complete()},S.prototype.asObservable=function(){var A=new _e;return A.source=this,A},S.create=function(A,B){return new Ru(A,B)},S}(_e),Ru=function(E){on(S,E);function S(A,B){var I=E.call(this)||this;return I.destination=A,I.source=B,I}return S.prototype.next=function(A){var B,I;(I=(B=this.destination)===null||B===void 0?void 0:B.next)===null||I===void 0||I.call(B,A)},S.prototype.error=function(A){var B,I;(I=(B=this.destination)===null||B===void 0?void 0:B.error)===null||I===void 0||I.call(B,A)},S.prototype.complete=function(){var A,B;(B=(A=this.destination)===null||A===void 0?void 0:A.complete)===null||B===void 0||B.call(A)},S.prototype._subscribe=function(A){var B,I;return(I=(B=this.source)===null||B===void 0?void 0:B.subscribe(A))!==null&&I!==void 0?I:Sf},S}(oe),wf=new _e(function(E){return E.complete()});function ST(E){return E&&xe(E.schedule)}function Rf(E){return E[E.length-1]}function Ff(E){return ST(Rf(E))?E.pop():void 0}function Lf(E,S){return typeof Rf(E)=="number"?E.pop():S}var Of=function(E){return E&&typeof E.length=="number"&&typeof E!="function"};function Df(E){return xe(E?.then)}function If(E){return xe(E[Do])}function Bf(E){return Symbol.asyncIterator&&xe(E?.[Symbol.asyncIterator])}function bf(E){return new TypeError("You provided "+(E!==null&&typeof E=="object"?"an invalid object":"'"+E+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function CT(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Nf=CT();function Gf(E){return xe(E?.[Nf])}function zf(E){return hT(this,arguments,function(){var S,A,B,I;return yf(this,function(b){switch(b.label){case 0:S=E.getReader(),b.label=1;case 1:b.trys.push([1,,9,10]),b.label=2;case 2:return[4,Ps(S.read())];case 3:return A=b.sent(),B=A.value,I=A.done,I?[4,Ps(void 0)]:[3,5];case 4:return[2,b.sent()];case 5:return[4,Ps(B)];case 6:return[4,b.sent()];case 7:return b.sent(),[3,2];case 8:return[3,10];case 9:return S.releaseLock(),[7];case 10:return[2]}})})}function Uf(E){return xe(E?.getReader)}function as(E){if(E instanceof _e)return E;if(E!=null){if(If(E))return ET(E);if(Of(E))return PT(E);if(Df(E))return AT(E);if(Bf(E))return Xf(E);if(Gf(E))return MT(E);if(Uf(E))return wT(E)}throw bf(E)}function ET(E){return new _e(function(S){var A=E[Do]();if(xe(A.subscribe))return A.subscribe(S);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function PT(E){return new _e(function(S){for(var A=0;A{let I=this.tilePosInDirection(new ft(A,B),E);return this.tilemap.hasBlockingTile(I,S,rT(E),this.ignoreMissingTiles)})}isCharBlocking(E,S){return this.someCharTile((A,B)=>{let I=this.tilePosInDirection(new ft(A,B),E);return this.tilemap.hasBlockingChar(I,S,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(E){this.isMoving()||E!="none"&&this.changeFacingDirection(E)}changeFacingDirection(E){this.facingDirection!==E&&(this.facingDirection=E,this.directionChanged$.next(E))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(ns(this.facingDirection))}addCollisionGroup(E){this.collisionGroups.add(E)}setCollisionGroups(E){this.collisionGroups=new Set(E)}setIgnoreCollisionGroups(E){this.ignoreCollisionGroups=new Set(E)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(E){return this.collisionGroups.has(E)}removeCollisionGroup(E){this.collisionGroups.delete(E)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(E){for(let S of E)this.labels.add(S)}getLabels(){return[...this.labels.values()]}hasLabel(E){return this.labels.has(E)}clearLabels(){this.labels.clear()}removeLabels(E){for(let S of E)this.labels.delete(S)}getNumberOfDirections(){return this.numberOfDirections}movementStarted(){return this.movementStarted$}movementStopped(){return this.movementStopped$}directionChanged(){return this.directionChanged$}tilePositionSet(){return this.tilePositionSet$}positionChangeStarted(){return this.positionChangeStarted$}positionChangeFinished(){return this.positionChangeFinished$}autoMovementSet(){return this.autoMovementSet$}depthChanged(){return this.depthChanged$}getMovementProgress(){return this.movementProgress}setMovementProgress(E){let S=Math.max(0,Math.min(ts,E));this.movementProgress=S}hasWalkedHalfATile(){return this.movementProgress>ts/2}willCrossTileBorderThisUpdate(E){return this.movementProgress+this.maxProgressForDelta(E)>=ts}updateCharacterPosition(E){let S=this.willCrossTileBorderThisUpdate(E),A=1-(S?ts-this.movementProgress:this.maxProgressForDelta(E))/this.maxProgressForDelta(E);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(E),ts),S&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),A>0&&this.updateCharacterPosition(E*A)):this.stopMoving())}maxProgressForDelta(E){let S=E/1e3;return Math.floor(S*this.speed*ts)}get tilePos(){return zt.clone(this._tilePos)}set tilePos(E){zt.copyOver(E,this._tilePos)}startMoving(E){E!=="none"&&(E!=this.movementDirection&&this.movementStarted$.next(E),this.movementDirection=E,this.facingDirection=E,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(E,S){return E.add(ns(this.tilemap.toMapDirection(S)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let E=this.tilePos,S=this.getNextTilePos(),A=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(A),this.fire(this.positionChangeFinished$,E,S)}fire(E,{position:S,layer:A},{position:B,layer:I}){E.next({exitTile:S,enterTile:B,exitLayer:A,enterLayer:I})}someCharTile(E){let S=this.getNextTilePos().position;for(let A=S.x;Athis.isLayerAlwaysOnTop(I));this.tilemap.layers.filter(I=>!this.isLayerAlwaysOnTop(I)).forEach(I=>{this.hasLayerProp(I,es.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(I,A),S.push(I.tilemapLayer)):this.setDepth(I,++A)}),this.charLayerDepths.set(void 0,A),B.forEach((I,b)=>{I.tilemapLayer.setDepth(b+1+A)}),S.forEach(I=>I.destroy())}setDepth(S,A){S.tilemapLayer.setDepth(A),this.isCharLayer(S)&&this.charLayerDepths.set(this.getLayerProp(S,es.CHAR_LAYER_PROP_NAME),A)}createHeightShiftLayers(S,A){let B=this.getLayerProp(S,es.HEIGHT_SHIFT_PROP_NAME);isNaN(B)&&(B=0);let I=1;for(let b=0;bI.name==A);return B?.value}hasLayerProp(S,A){return this.getLayerProp(S,A)!=null}copyLayer(S,A){let B=`${S.name}#${A}`,I=this.tilemap.createBlankLayer(B,S.tilemapLayer.tileset);if(I){if(I.name=B,this.isIsometric())for(let b=A;b>=0;b--){let c=A-b;I.putTileAt(S.data[b][c],c,b)}else for(let b=0;bm===this.charData.id)).subscribe(({direction:m})=>{var t;(t=this.animation)==null||t.setStandingFrame(m)}),this.sprite&&(this.sprite.setOrigin(0,0),this.resetAnimation(this.sprite),this.updateOverlaySprite(),this.updateGridChar())}destroy(){this.destroy$.next(),this.destroy$.complete(),this.newSpriteSet$.complete()}setSprite(E){E?(this.sprite&&(E.x=this.sprite.x,E.y=this.sprite.y),this.sprite=E,this.newSpriteSet$.next(),this.layerOverlaySprite=this.layerOverlaySprite?this.scene.add.sprite(0,0,this.sprite.texture):void 0,this.updateOverlaySprite(),this.resetAnimation(this.sprite),this.updateDepth()):(this.layerOverlaySprite=void 0,this.sprite=void 0)}getSprite(){return this.sprite}getLayerOverlaySprite(){return this.layerOverlaySprite}setContainer(E){var S;this.container=E,this.cachedContainerHeight=(S=E?.getBounds().height)!=null?S:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(E){this.customOffset.x=E}getOffsetY(){return this.customOffset.y}setOffsetY(E){this.customOffset.y=E}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(E){var S;this.geHeadless.isMoving(this.charData.id)||E!="none"&&(this.geHeadless.turnTowards(this.charData.id,E),(S=this.animation)==null||S.setStandingFrame(E))}getAnimation(){return this.animation}setAnimation(E){this.animation=E}update(E){this.updateGridChar()}getEngineOffset(){var E,S,A,B;if(!this.sprite)return ft.ZERO;let I=this.tilemap.getTileWidth()/2-Math.floor(((S=(E=this.sprite)==null?void 0:E.displayWidth)!=null?S:0)/2),b=-((B=(A=this.sprite)==null?void 0:A.displayHeight)!=null?B:0)+this.tilemap.getTileHeight();return new ft(I,b)}updatePixelPos(){let E=new ft(this.geHeadless.getPosition(this.charData.id)),S=this.geHeadless.getMovementProgress(this.charData.id)/1e3,A=this.tilemap.tilePosToPixelPos(E).add(this.getEngineOffset()).add(this.customOffset).add(ns(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(S))),B=this.getGameObj();B&&(B.x=Math.floor(A.x),B.y=Math.floor(A.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var E;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let S=this.geHeadless.getMovementProgress(this.charData.id)>ts/2;(E=this.getAnimation())==null||E.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),S,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(E){let S=new Fu(this.walkingAnimationMapping,E.texture.source[0].width/E.width/Fu.FRAMES_CHAR_ROW);this.setAnimation(S),S.frameChange().pipe(ke(this.newSpriteSet$)).subscribe(A=>{E?.setFrame(A)}),S.setIsEnabled(this.walkingAnimationMapping!==void 0),S.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let E=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-E),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let E=new ft(this.geHeadless.getPosition(this.charData.id)),S=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:E,layer:S}):this.sprite&&this.setSpriteDepth(this.sprite,{position:E,layer:S});let A=this.getLayerOverlaySprite();if(A){let B=new ft(Vi(re({},E),{y:E.y-1}));this.setSpriteDepth(A,{position:B,layer:S})}}setSpriteDepth(E,S){E.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(S))+this.getPaddedPixelDepthSprite(E))}setContainerDepth(E,S){E.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(S))+this.getPaddedPixelDepthContainer(E))}getPaddedPixelDepthContainer(E){return fo.shiftPad(E.y+this.cachedContainerHeight,vo.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(E){return fo.shiftPad(E.y+E.displayHeight,vo.Z_INDEX_PADDING)}getTransitionLayer(E){if(E.layer)return this.geHeadless.getTransition(E.position,E.layer)||E.layer}},YT=(E=>(E.DONT_BLOCK="DONT_BLOCK",E.BLOCK_TWO_TILES="BLOCK_TWO_TILES",E.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",E.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",E))(YT||{}),$f=(E=>(E.STOP="STOP",E.CLOSEST_REACHABLE="CLOSEST_REACHABLE",E.RETRY="RETRY",E.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",E))($f||{}),HT=class{distance(E,S){return oi.manhattanDistance(E,S)}direction(E,S){if(oi.equal(E,S))return"none";let A=E.clone().subtract(S);return Math.abs(A.x)>Math.abs(A.y)?A.x>0?"left":"right":A.y>0?"up":"down"}neighbors(E){return[new ft(E.x,E.y+1),new ft(E.x+1,E.y),new ft(E.x-1,E.y),new ft(E.x,E.y-1)]}getDirections(){return["up","right","down","left"]}},jT=class{distance(E,S){return oi.chebyshevDistance(E,S)}neighbors(E){let S=[new ft(E.x,E.y+1),new ft(E.x+1,E.y),new ft(E.x-1,E.y),new ft(E.x,E.y-1)],A=[new ft(E.x+1,E.y+1),new ft(E.x+1,E.y-1),new ft(E.x-1,E.y+1),new ft(E.x-1,E.y-1)];return[...S,...A]}direction(E,S){return S.x>E.x?S.y>E.y?"down-right":S.yE.y?"down-left":S.yE.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},nn=class{static create(E){switch(E){case 4:return new HT;case 8:return new jT}}},Lu=class{constructor(E,S,A){this.backoffMs=E,this.maxRetries=S,this.onFinished=A,this.retries=0,this.elapsed=0}retry(E,S){this.shouldRetry()?(this.elapsed+=E,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,S())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(E.WAIT="WAIT",E.RETRY="RETRY",E.STOP="STOP",E))(Zf||{}),Dr=class{constructor(E,{shortestPathAlgorithm:S="BFS",pathWidth:A=1,pathHeight:B=1,numberOfDirections:I=4,isPositionAllowed:b=(i,h)=>!0,collisionGroups:c=[],ignoredChars:m=[],ignoreTiles:t=!1,ignoreMapBounds:a=!1,ignoreBlockedTarget:v=!1,maxPathLength:o=1/0,ignoreLayers:r=!1,considerCosts:n=!1,calculateClosestToTarget:e=!0}={}){this.gridTilemap=E,this.options={shortestPathAlgorithm:S,pathWidth:A,pathHeight:B,numberOfDirections:I,isPositionAllowed:b,collisionGroups:c,ignoredChars:m,ignoreTiles:t,ignoreMapBounds:a,ignoreBlockedTarget:v,maxPathLength:o,ignoreLayers:r,considerCosts:n,calculateClosestToTarget:e},this.ignoredCharsSet=new Set(m)}findShortestPath(E,S){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(E.layer),S.layer=E.layer);let A=this.findShortestPathImpl(E,S);return this.gridTilemap.unfixCacheLayers(),A}getNeighbors(E,S){var A;return nn.create((A=this.options.numberOfDirections)!=null?A:4).neighbors(E.position).map(B=>{let I=E.layer;return this.options.ignoreLayers||(I=this.gridTilemap.getTransition(B,E.layer)),{position:B,layer:I||E.layer}}).filter(B=>!this.isBlocking(E,B)||this.options.ignoreBlockedTarget&&zt.equal(B,S))}getTransition(E,S){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(E,S)}getCosts(E,S){if(!this.options.considerCosts)return 1;let A=qe(S.position,E);return this.gridTilemap.getTileCosts(S,A)}isBlocking(E,S){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(S.position))||!this.options.isPositionAllowed(S.position,S.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(E,S,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(E,S,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(E,S){return(this.options.numberOfDirections===4?oi.manhattanDistance:oi.chebyshevDistance)(E,S)}getTilePosInDir(E,S){return this.options.ignoreLayers?{position:E.position.add(ns(this.gridTilemap.toMapDirection(S))),layer:E.layer}:this.gridTilemap.getTilePosInDirection(E,S)}getReverseNeighbors(E,S){var A;let B=nn.create((A=this.options.numberOfDirections)!=null?A:4).neighbors(E.position),I;if(!this.options.ignoreLayers){let b=this.gridTilemap.getReverseTransitions(E.position,E.layer);I=b?[...b]:void 0}return B.map(b=>I?I.map(c=>({position:b,layer:c||E.layer})):[{position:b,layer:E.layer}]).flat().filter(b=>!this.isBlocking(b,E)||this.options.ignoreBlockedTarget&&zt.equal(E,S))}hasBlockingCharFrom(E,S,A,B,I,b,c){if(A===1&&B===1)return c.hasBlockingChar(S.position,S.layer,I,b);let m=a=>c.hasBlockingChar(a,S.layer,I,b),t=qe(E.position,S.position);return this.isBlockingMultiTile(E,t,A,B,m)}hasBlockingTileFrom(E,S,A,B,I,b){if(A===1&&B===1)return b.hasBlockingTile(S.position,S.layer,qe(S.position,E.position),I);let c=qe(E.position,S.position),m=t=>b.hasBlockingTile(t,S.layer,c,I);return this.isBlockingMultiTile(E,c,A,B,m)}isBlockingMultiTile(E,S,A,B,I){let b={src:new ft(E.position.x+A,E.position.y),dest:new ft(E.position.x+A,E.position.y+B-1)},c={src:new ft(E.position.x-1,E.position.y),dest:new ft(E.position.x-1,E.position.y+B-1)},m={src:new ft(E.position.x,E.position.y-1),dest:new ft(E.position.x+A-1,E.position.y-1)},t={src:new ft(E.position.x,E.position.y+B),dest:new ft(E.position.x+A-1,E.position.y+B)};switch(S){case"right":return this.checkLine(b,I);case"left":return this.checkLine(c,I);case"up":return this.checkLine(m,I);case"down":return this.checkLine(t,I);case"up-left":return this.checkLine({src:m.src,dest:new ft(m.dest.x-1,m.dest.y)},I)||this.checkLine({src:new ft(c.src.x,c.src.y-1),dest:new ft(c.dest.x,c.dest.y-1)},I);case"up-right":return this.checkLine({src:new ft(m.src.x+1,m.src.y),dest:m.dest},I)||this.checkLine({src:new ft(b.src.x,b.src.y-1),dest:new ft(b.dest.x,b.dest.y-1)},I);case"down-left":return this.checkLine({src:new ft(c.src.x,c.src.y+1),dest:new ft(c.dest.x,c.dest.y+1)},I)||this.checkLine({src:t.src,dest:new ft(t.dest.x-1,t.dest.y)},I);case"down-right":return this.checkLine({src:new ft(t.src.x+1,t.src.y),dest:t.dest},I)||this.checkLine({src:new ft(b.src.x,b.src.y+1),dest:new ft(b.dest.x,b.dest.y+1)},I)}return!1}checkLine(E,S){for(let A=E.src.x;A<=E.dest.x;A++)for(let B=E.src.y;B<=E.dest.y;B++)if(S(new ft(A,B)))return!0;return!1}},KT=hf(Mo(),1),$T=class extends Dr{findShortestPathImpl(E,S){let A=this.shortestPathBfs(E,S);return{path:this.returnPath(A.previous,E,S),closestToTarget:A.closestToTarget,steps:A.steps,maxPathLengthReached:A.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(E,S){let A=new Map,B=new Map,I=new Map,b=new KT.MinFibonacciHeap((a,v)=>js(I,a)-js(I,v)),c=E,m=this.distance(E.position,S.position),t=0;for(b.push(E),B.set(zt.toString(E),0),I.set(zt.toString(E),this.distance(E.position,S.position));b.size>0;){let a=b.pop();if(!a)break;t++;let v=this.distance(a.position,S.position);if(vthis.options.maxPathLength)return{previous:new Map,closestToTarget:c,steps:t,maxPathLengthReached:!0};for(let o of this.getNeighbors(a,S)){let r=js(B,a)+this.getCosts(a.position,o),n=zt.toString(o);(!B.has(n)||r0;){let t=I.dequeue();if(m++,!t)break;let{node:a,dist:v}=t;if(v>this.options.maxPathLength)return{previous:new Map,closestToTarget:b,steps:m,maxPathLengthReached:!0};let o=this.distance(a.position,S.position);if(othis.lastDist)}step(E,S,A){var B;this.lastDist=A;for(let I of E){let b=zt.toString(I);if(!this.visited.has(b)){this.previous.set(b,S),this.queue.enqueue({node:I,dist:A+1}),this.visited.set(b,A+1);let c=(B=this.otherBfs)==null?void 0:B.visited.get(b);c!==void 0&&c0,I.queue.size()>0);){let t=B.queue.dequeue();if(!t)break;let{node:a,dist:v}=t;if(v+1+(((A=I.queue.peek())==null?void 0:A.dist)||0)>this.options.maxPathLength)return{previous:B.previous,previous2:I.previous,closestToTarget:this.maybeClosestToTarget(c),steps:b,maxPathLengthReached:!0};let o=this.distance(a.position,S.position);if(oKs(this.f,I)-Ks(this.f,b)),this.openSet.push(E);let B=zt.toString(E);for(this.g.set(B,0),this.f.set(B,this.distance(E.position,S.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let I=this.openSet.pop();if(!I)break;if(this.steps++,zt.equal(I,S))return{previous:A,closestToTarget:S,steps:this.steps,maxPathLengthReached:!1};if(Ks(this.g,I)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(I,S);for(let b of this.getNeighborsInternal(I,A.get(zt.toString(I)),S)){let c=zt.toString(b.p),m=Ks(this.g,I)+b.dist;(!this.g.has(c)||m({p:b,dist:1}));let B=this.prune(S,E).filter(b=>!this.isBlockingIgnoreTarget(E,b,A)).map(b=>{let c=this.getTransition(b.position,E.layer);return{position:b.position,layer:c||E.layer}}),I=[];for(let b of B)if(this.isHorizontal(E.position,b.position))I.push({p:b,dist:1});else{let c=this.jump(E,b,A,1,qe(E.position,b.position));c&&I.push(c)}return I}isBlockingIgnoreTarget(E,S,A){return this.isBlocking(E,S)&&!(this.options.ignoreBlockedTarget&&zt.equal(S,A))}jump(E,S,A,B,I){if(!this.isBlockingIgnoreTarget(E,S,A))return zt.equal(S,A)?{p:S,dist:B}:B>=this.maxJumpSize?{p:S,dist:B}:this.getTransition(S.position,E.layer)!==void 0?{p:S,dist:B}:this.hasForced(E,S)?{p:S,dist:B}:(this.updateClosestToTarget(S,A),this.jump(S,this.getTilePosInDir(S,I),A,B+1,I))}isHorizontal(E,S){return E.y===S.y}getForced(E,S,A,B,I,b){let c=[],m=E;return(this.blockOrTrans(m,A)||this.blockOrTrans(A,B))&&this.addIfNotBlocked(c,S,B),(this.blockOrTrans(m,I)||this.blockOrTrans(I,b))&&this.addIfNotBlocked(c,S,b),c}hasForced(E,S){let{topLeft:A,downLeft:B,top:I,bottom:b}=this.normalizedPositions(E,S);return!!((this.blockOrTrans(E,B)||this.blockOrTrans(B,b))&&!this.blockOrTrans(S,b)||(this.blockOrTrans(E,A)||this.blockOrTrans(A,I))&&!this.blockOrTrans(S,I))}prune(E,S){let{right:A,top:B,bottom:I,downLeft:b,topLeft:c}=this.normalizedPositions(E,S);return this.isHorizontal(E.position,S.position)?[A,B,I]:[A,...this.getForced(E,S,b,I,c,B)]}normalizedPositions(E,S){return E.position.xS.position.x?{topLeft:{position:new ft(S.position.x+1,S.position.y+1),layer:S.layer},downLeft:{position:new ft(S.position.x+1,S.position.y-1),layer:S.layer},top:{position:new ft(S.position.x,S.position.y+1),layer:S.layer},bottom:{position:new ft(S.position.x,S.position.y-1),layer:S.layer},right:{position:new ft(S.position.x-1,S.position.y),layer:S.layer}}:E.position.y1?this.fillPath(I,b,B):B.push(b),I=b}return B.reverse()}fillPath(E,S,A){let B=E;do{let I=qe(B.position,S.position);B=this.getTilePosInDir(B,I),A.push(B)}while(!oi.equal(B.position,S.position))}};function Ks(E,S){var A;return(A=E.get(zt.toString(S)))!=null?A:Number.MAX_VALUE}var JT=class{constructor(E,S,A,B={}){this.character=E,this.gridTilemap=S,this.charToFollow=A;let I={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:B.considerCosts||!1,facingDirection:"none"};this.options=re(re({},I),B),this.options.considerCosts&&this.options.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.options.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.options.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.character=E,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(ke(this.character.autoMovementSet().pipe(Wi(b=>b!==this),Fs(1)))).subscribe(({enterTile:b,enterLayer:c})=>{this.updateTarget(b,c)})}update(E){var S;(S=this.targetMovement)==null||S.update(E)}getInfo(){return{type:"Follow",config:{charToFollow:this.charToFollow.getId(),distance:this.options.distance,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,facingDirection:this.options.facingDirection,shortestPathAlgorithm:this.options.shortestPathAlgorithm}}}getFacingPos(){let E=or[this.options.facingDirection]+or[this.charToFollow.getFacingDirection()],S=xf("up",E),A={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return S==="right"?A.x+=this.charToFollow.getTileWidth()-1:S==="down"?A.y+=this.charToFollow.getTileWidth()-1:S==="down-left"?A.y+=this.charToFollow.getTileWidth()-1:S==="down-right"?(A.y+=this.charToFollow.getTileWidth()-1,A.x+=this.charToFollow.getTileWidth()-1):S==="up-right"&&(A.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new ft(A),layer:this.charToFollow.getTilePos().layer},S).position}updateTarget(E,S){let A=this.options.facingDirection!=="none"&&this.options.distance===0;A&&(E=this.getFacingPos()),this.targetMovement=new ed(this.character,this.gridTilemap,{position:new ft(E),layer:S},{distance:A?0:this.options.distance+1,config:{algorithm:this.options.shortestPathAlgorithm,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,considerCosts:this.options.considerCosts,ignoredChars:[this.charToFollow.getId()]}})}},bu=class{static getRandomInt(E){return Math.floor(Math.random()*Math.floor(E))}},QT=class{constructor(E,S=0,A=-1){this.character=E,this.delay=S,this.radius=A,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=E.getNextTilePos().position.y,this.initialCol=E.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(ke(this.character.autoMovementSet().pipe(Wi(B=>B!==this),Fs(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=nn.create(E.getNumberOfDirections())}update(E){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=E,this.delayLeft<=0){this.delayLeft=this.delay;let S=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(S),this.currentMovementDirection=S,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(E)).filter(E=>this.isWithinRadius(E))}isWithinRadius(E){return this.radius==-1?!0:this.getDist(E)<=this.radius}getDist(E){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(ns(E)),new ft(this.initialCol,this.initialRow))}getFreeRandomDirection(){let E=this.getFreeDirections();return E.length==0?"none":E[bu.getRandomInt(E.length)]}randomizeStepSize(){this.stepSize=bu.getRandomInt(this.radius)+1}};function kT(E,S){return E.filter(A=>{var B,I,b,c,m,t;return(B=S.labels)!=null&&B.withAllLabels?(I=S.labels)==null?void 0:I.withAllLabels.every(a=>A.hasLabel(a)):(b=S.labels)!=null&&b.withOneOfLabels?(c=S.labels)==null?void 0:c.withOneOfLabels.some(a=>A.hasLabel(a)):(m=S.labels)!=null&&m.withNoneLabels?!((t=S.labels)!=null&&t.withNoneLabels.some(a=>A.hasLabel(a))):!0})}var kf="2.44.6",qT=class{constructor(E,S){this.collistionStrategy=E,this.collisionGroupRelation=S,this.tilePosToCharacters=new _T,this.charRemoved$=new oe}isCharBlockingAt(E,S,A,B=new Set,I=new Set){if(A.length===0)return!1;let b=this.tilePosToCharacters.get(E,S);return!!(b&&b.size>0&&[...b].filter(c=>!B.has(c.getId())).filter(c=>!this.doIntersect(c.getCollisionGroups(),I)).some(c=>A.some(m=>c.getCollisionGroups().some(t=>this.collidesWith(m,t)))))}doIntersect(E,S){for(let A of E)if(S.has(A))return!0;return!1}collidesWith(E,S){return this.collisionGroupRelation?(this.collisionGroupRelation.get(E)||new Set).has(S):E===S}getCharactersAt(E,S){return this.tilePosToCharacters.get(E,S)||new Set}addCharacter(E){this.addTilePositions(E.getTilePos(),E),this.addTilePositions(E.getNextTilePos(),E),this.addPositionChangeSub(E),this.addPositionChangeFinishedSub(E),this.addTilePosSetSub(E)}removeCharacter(E){let S=E.getId();this.charRemoved$.next(S),this.deleteTilePositions(E.getTilePos(),E),this.deleteTilePositions(E.getNextTilePos(),E)}add(E,S,A){let B=this.tilePosToCharacters.get(E,S);B||this.tilePosToCharacters.set(E,S,new Set([A])),B?.add(A)}addTilePosSetSub(E){E.tilePositionSet().pipe(ke(this.charRemoved(E.getId()))).subscribe(S=>{this.deleteTilePositions(E.getNextTilePos(),E),this.addTilePositions(S,E)})}charRemoved(E){var S;return(S=this.charRemoved$)==null?void 0:S.pipe(Fs(1),Wi(A=>A==E))}addPositionChangeSub(E){E.positionChangeStarted().pipe(ke(this.charRemoved(E.getId())),this.posChangeToLayerPos()).subscribe(S=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(S.exit,E),this.addTilePositions(S.enter,E)})}addPositionChangeFinishedSub(E){E.positionChangeFinished().pipe(ke(this.charRemoved(E.getId())),this.posChangeToLayerPos()).subscribe(S=>{this.deleteTilePositions(S.exit,E),this.addTilePositions(S.enter,E)})}addTilePositions(E,S){this.forEachCharTile(E,S,(A,B)=>{this.add(new ft(A,B),E.layer,S)})}deleteTilePositions(E,S){this.forEachCharTile(E,S,(A,B)=>{var I;(I=this.tilePosToCharacters.get(new ft(A,B),E.layer))==null||I.delete(S)})}forEachCharTile(E,S,A){let B=E.position;for(let I=B.x;I({enter:{position:new ft(E.enterTile),layer:E.enterLayer},exit:{position:new ft(E.exitTile),layer:E.exitLayer}})))}posToString(E,S){return`${E.x}#${E.y}#${S}`}},_T=class{constructor(){this.memo=new Map}set(E,S,A){let B=this.memo.get(E.x);B||(B=new Map,this.memo.set(E.x,B));let I=B.get(E.y);I||(I=new Map,B.set(E.y,I)),I.set(S,A)}get(E,S){let A=this.memo.get(E.x);if(!A)return;let B=A.get(E.y);if(B)return B.get(S)}},Io=class{constructor(E,S,A,B){this.x=E,this.y=S,this.width=A,this.height=B}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(E){return E.x>=this.x&&E.x=this.y&&E.yA.isCharLayer());for(let A of[...S,void 0]){let B=this.tileCollisionCache.get(A?.getName());if(B===void 0){B=new Array(this.tilemap.getWidth());for(let I=0;I>S&1)==1}var Gu="ge_cost",qf=class _f{constructor(S,A,B,I=void 0,b=!1){this.tilemap=S,this.collisionTilePropertyName=A,this.useTileCollisionCache=b,this.characters=new Map,this.transitions=new Map,this.reverseTransitions=new Map,this.collidesPropNames=new Map,this.tileCostPropNames=new Map,this.collisionRelevantLayersFrameCache=new Map,this.charBlockCache=new qT(B,I);for(let c of Lo())this.collidesPropNames.set(c,_f.ONE_WAY_COLLIDE_PROP_PREFIX+c),this.tileCostPropNames.set(c,`${Gu}_${c}`);this.useTileCollisionCache&&(this.tileCollisionCache=new eS(S,this),this.tileCollisionCache.rebuild())}fixCacheLayer(S){var A;(A=this.tileCollisionCache)==null||A.fixLayer(S)}unfixCacheLayers(){var S;(S=this.tileCollisionCache)==null||S.unfixLayers()}addCharacter(S){this.characters.set(S.getId(),S);let A=S.getNextTilePos().layer;A===void 0?S.setTilePosition(Vi(re({},S.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(A)||console.warn(`Char layer '${A}' of character '${S.getId()}' is unknown.`),this.charBlockCache.addCharacter(S)}removeCharacter(S){let A=this.characters.get(S);A&&(this.charBlockCache.removeCharacter(A),this.characters.delete(S))}getCharacters(){return[...this.characters.values()]}getCharactersAt(S,A){return this.charBlockCache.getCharactersAt(S,A)}rebuildTileCollisionCache(S){var A;(A=this.tileCollisionCache)==null||A.rebuild(S)}hasBlockingTileUncached(S,A,B,I){if(!I&&this.hasNoTileUncached(S,A))return!0;let b=this.getCollisionRelevantLayers(A);for(let c of b)if(this.isLayerBlockingAt(c.getName(),S,B))return!0;return!1}hasBlockingTile(S,A,B,I){var b;let c=(b=this.tileCollisionCache)==null?void 0:b.isBlockingFrom(S.x,S.y,A,B,I);return c!==void 0?c:this.hasBlockingTileUncached(S,A,B,I)}getTransition(S,A){let B=this.transitions.get(S.toString());if(B)return B.get(A)}getReverseTransitions(S,A){let B=this.reverseTransitions.get(S.toString());if(B)return B.get(A)}setTransition(S,A,B){var I,b,c,m,t;this.transitions.has(S.toString())||this.transitions.set(S.toString(),new Map),this.reverseTransitions.has(S.toString())||this.reverseTransitions.set(S.toString(),new Map),(I=this.transitions.get(S.toString()))==null||I.set(A,B),(b=this.reverseTransitions.get(S.toString()))!=null&&b.has(B)||(c=this.reverseTransitions.get(S.toString()))==null||c.set(B,new Set),(t=(m=this.reverseTransitions.get(S.toString()))==null?void 0:m.get(B))==null||t.add(A)}getTransitions(){return new Map([...this.transitions].map(([S,A])=>[S,new Map(A)]))}getTileCosts(S,A){let B=this.getCollisionRelevantLayers(S.layer),I=1;for(let b of B)I=Math.max(I,this.getTileCostsForLayer(Vi(re({},S),{layer:b.getName()}),A));return I}getTileCostsForLayer(S,A){let B=this.tilemap.getTileAt(S.position.x,S.position.y,S.layer);return A&&B?.getProperty(this.tileCostPropNames.get(A)||"")||B?.getProperty(Gu)||1}hasNoTileUncached(S,A){return!this.getCollisionRelevantLayers(A).some(B=>this.tilemap.hasTileAt(S.x,S.y,B.getName()))}hasNoTile(S,A){var B;let I=(B=this.tileCollisionCache)==null?void 0:B.hasTileAt(S.x,S.y,A);return I!==void 0?I:this.hasNoTileUncached(S,A)}hasBlockingChar(S,A,B,I=new Set,b=new Set){return this.charBlockCache.isCharBlockingAt(S,A,B,I,b)}isInRange(S){return new Io(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(S)}toMapDirection(S){return this.isIsometric()?nT(S):S}fromMapDirection(S){return this.isIsometric()?xf(S):S}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(S,A){let B=S.position.add(ns(this.toMapDirection(A))),I=this.getTransition(B,S.layer)||S.layer;return{position:B,layer:I}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(S,A,B){let I=this.tilemap.getTileAt(A.x,A.y,S);return I?!!(I.getProperty(this.collisionTilePropertyName)||B&&I.getProperty(this.collidesPropNames.get(B)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((S,A)=>({layer:S,index:A})).filter(({layer:S})=>S.isCharLayer()).map(({index:S})=>S)}findPrevAndCharLayer(S){let A=this.getCharLayerIndexes(),B=this.tilemap.getLayers(),I=A.findIndex(b=>B[b].getProperty(sr)==S);return I==0?{prevIndex:-1,charLayerIndex:A[I]}:{prevIndex:A[I-1],charLayerIndex:A[I]}}getCollisionRelevantLayers(S){if(!S)return this.tilemap.getLayers();let A=this.collisionRelevantLayersFrameCache.get(S);if(A)return A;let{prevIndex:B,charLayerIndex:I}=this.findPrevAndCharLayer(S),b=this.tilemap.getLayers().slice(B+1,I+1);return this.collisionRelevantLayersFrameCache.set(S,b),b}getLowestCharLayer(){for(let S of this.tilemap.getLayers())if(S.isCharLayer())return S.getProperty(sr)}getCharLayerNames(){return this.tilemap.getLayers().filter(S=>S.isCharLayer()).map(S=>S.getProperty(sr)).filter(sS)}};qf.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var iS=qf;function sS(E){return E!=null}var nS=(E=>(E.REMOVED="REMOVED",E.ADDED="ADDED",E))(nS||{}),rS=(E=>(E.WAIT="WAIT",E.SKIP="SKIP",E.STOP="STOP",E))(rS||{}),aS=class{constructor(E,S){this.character=E,this.tilemap=S,this.queue=new hr,this.finished$=new oe,this.pathBlockedWaitElapsed=0,this.distanceUtils=nn.create(E.getNumberOfDirections()),this.character.autoMovementSet().pipe(Wi(A=>A!==this),Fs(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(E){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(E))&&this.queue.size()>0&&this.moveCharOnPath(E)}getInfo(){return{type:"Queue"}}enqueue(E,S={}){var A,B,I;let b={pathBlockedStrategy:(A=S.pathBlockedStrategy)!=null?A:"STOP",pathBlockedWaitTimeoutMs:S?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(B=S.ignoreInvalidPositions)!=null?B:!1,skipInvalidPositions:(I=S.skipInvalidPositions)!=null?I:!1};for(let c of E){let m={command:c,config:b};if(Es(c)){this.queue.enqueue(m);continue}let t=this.queue.peekEnd(),a=t?.command;if(a||(a=this.character.getNextTilePos()),Es(a)){this.queue.enqueue(m);continue}let v=this.distanceUtils.distance(a.position,c.position)===1;(!S.ignoreInvalidPositions||v)&&this.queue.enqueue(m)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(E){let S=this.queue.peek();if(!S)return;let A=S.command,B=S.config;if(Es(A)&&(A=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),A)),B.skipInvalidPositions){if(A=this.getNextValidPosition(),!A){this.finishInvalidNextPos(A);return}}else if(!this.isNeighborPos(A)){this.finishInvalidNextPos(A);return}if(this.character.isBlockingDirection(qe(this.character.getNextTilePos().position,A.position))){if(B.pathBlockedStrategy==="STOP")this.finishPathBlocked(A);else if(B.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(E);return}else B.pathBlockedStrategy==="WAIT"&&B.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=E,this.pathBlockedWaitElapsed>=B.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(A,B.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,A.position)),this.isLastMovement()&&this.finish("SUCCESS","",A)}getNextValidPosition(){for(var E;this.queue.size()>0;){let S=(E=this.queue.peek())==null?void 0:E.command;if(Es(S)&&(S=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),S)),S&&this.isNeighborPos(S))return S;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(E){let S=this.distanceUtils.distance(this.character.getNextTilePos().position,E.position)===1,A=this.tilemap.getTransition(E.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==E.layer)return S&&A===E.layer;let B=A!==void 0&&A!==E.layer;return S&&!B}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(E){E?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(E)} is not reachable from ${this.posToStr(this.character.getNextTilePos())}.`):this.finish("INVALID_NEXT_POS",`No enqueued position is reachable from ${this.posToStr(this.character.getNextTilePos())}.`)}finishPathBlocked(E){this.finish("PATH_BLOCKED",`Position ${this.posToStr(E)} is blocked.`)}finishBlockedWaitTimeout(E,S){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(E)} is blocked and the wait timeout of ${S} ms has been exceeded.`)}finish(E,S="",A=this.character.getNextTilePos()){this.queue=new hr,this.finished$.next({position:A.position,result:E,description:S,layer:A.layer})}getDir(E,S){return this.tilemap.fromMapDirection(qe(E,S))}posToStr(E){return`(${E.position.x}, ${E.position.y}, ${E.layer})`}},oS=class{constructor(E=!0){this.isCreatedInternal=!1,E&&console.log(`Using GridEngine v${kf}`)}getCharLayer(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getTilePos().layer}getTransition(E,S){var A;return this.initGuard(),(A=this.gridTilemap)==null?void 0:A.getTransition(new ft(E),S)}setTransition(E,S,A){var B;return this.initGuard(),(B=this.gridTilemap)==null?void 0:B.setTransition(new ft(E),S,A)}create(E,S){this.isCreatedInternal=!0,this.gridCharacters=new Map;let A=this.setConfigDefaults(S);this.config=A,this.movementStopped$=new oe,this.movementStarted$=new oe,this.directionChanged$=new oe,this.positionChangeStarted$=new oe,this.positionChangeFinished$=new oe,this.queueMovementFinished$=new oe,this.charRemoved$=new oe,this.charAdded$=new oe,this.gridTilemap=new iS(E,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(E){return E?new Map(Object.entries(E).map(([S,A])=>[S,new Set(A)])):void 0}getPosition(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getTilePos().position}move(E,S){this.moveChar(E,S)}moveRandomly(E,S=0,A=-1){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(E);if(!I)throw this.createCharUnknownErr(E);let b=new QT(I,S,A);I.setMovement(b)}getMovement(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);let B=A.getMovement();return B?B.getInfo():{type:"None"}}moveTo(E,S,A){var B;let I=this.assembleMoveToConfig(A);this.initGuard();let b=(B=this.gridCharacters)==null?void 0:B.get(E);if(!b)throw this.createCharUnknownErr(E);if(!this.gridTilemap)throw this.createUninitializedErr();let c=new ed(b,this.gridTilemap,{position:new ft(S),layer:A?.targetLayer||b.getNextTilePos().layer},{distance:0,config:I});return b.setMovement(c),c.finishedObs().pipe(ks(m=>({charId:E,position:m.position,result:m.result,description:m.description,layer:m.layer})))}stopMovement(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);A.setMovement(void 0)}setSpeed(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);B.setSpeed(S)}getSpeed(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getSpeed()}collidesWithTiles(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.collidesWithTiles()}update(E,S){var A;if(this.isCreatedInternal&&this.gridCharacters)for(let[B,I]of this.gridCharacters)I.update(S);(A=this.gridTilemap)==null||A.invalidateFrameCache()}addCharacter(E){var S,A,B,I,b;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let c={speed:E.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:E.charLayer,facingDirection:E.facingDirection,labels:E.labels,numberOfDirections:(S=E.numberOfDirections)!=null?S:this.config.numberOfDirections,tileWidth:E.tileWidth,tileHeight:E.tileHeight};typeof E.collides=="boolean"?E.collides===!1&&(c.collidesWithTiles=!1,c.collisionGroups=[]):E.collides!==void 0&&(E.collides.collidesWithTiles===!1&&(c.collidesWithTiles=!1),E.collides.collisionGroups&&(c.collisionGroups=E.collides.collisionGroups),E.collides.ignoreCollisionGroups&&(c.ignoreCollisionGroups=E.collides.ignoreCollisionGroups),c.ignoreMissingTiles=(B=(A=E.collides)==null?void 0:A.ignoreMissingTiles)!=null?B:!1);let m=new VT(E.id,c);E.startPosition&&m.setTilePosition({position:new ft(E.startPosition),layer:m.getTilePos().layer}),(I=this.gridCharacters)==null||I.set(E.id,m),this.gridTilemap.addCharacter(m);let t=m.getId();m.movementStopped().pipe(ke(this.charRemoved(t))).subscribe(a=>{var v;(v=this.movementStopped$)==null||v.next({charId:t,direction:a})}),m.movementStarted().pipe(ke(this.charRemoved(t))).subscribe(a=>{var v;(v=this.movementStarted$)==null||v.next({charId:t,direction:a})}),m.directionChanged().pipe(ke(this.charRemoved(t))).subscribe(a=>{var v;(v=this.directionChanged$)==null||v.next({charId:t,direction:a})}),m.positionChangeStarted().pipe(ke(this.charRemoved(t))).subscribe(a=>{var v;(v=this.positionChangeStarted$)==null||v.next(re({charId:t},a))}),m.positionChangeFinished().pipe(ke(this.charRemoved(t))).subscribe(a=>{var v;(v=this.positionChangeFinished$)==null||v.next(re({charId:t},a))}),(b=this.charAdded$)==null||b.next(t)}hasCharacter(E){var S;return this.initGuard(),!!((S=this.gridCharacters)!=null&&S.has(E))}removeCharacter(E){var S,A,B,I;if(this.initGuard(),!((S=this.gridCharacters)!=null&&S.get(E)))throw this.createCharUnknownErr(E);(A=this.gridTilemap)==null||A.removeCharacter(E),(B=this.gridCharacters)==null||B.delete(E),(I=this.charRemoved$)==null||I.next(E)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let E of this.gridCharacters.keys())this.removeCharacter(E)}getAllCharacters(E){if(this.initGuard(),!this.gridCharacters)return[];let S=[...this.gridCharacters.values()];return(E?kT(S,E):S).map(A=>A.getId())}getLabels(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getLabels()}addLabels(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);B.addLabels(S)}removeLabels(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);B.removeLabels(S)}clearLabels(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);A.clearLabels()}follow(E,S,A,B){var I,b,c,m,t,a;let v;A===void 0?v={distance:0,closestPointIfBlocked:!1}:typeof A=="number"?(v={distance:A,closestPointIfBlocked:!1},B&&(v.closestPointIfBlocked=!0)):v=A,this.initGuard();let o=(I=this.gridCharacters)==null?void 0:I.get(E),r=(b=this.gridCharacters)==null?void 0:b.get(S);if(!o)throw this.createCharUnknownErr(E);if(!r)throw this.createCharUnknownErr(S);if(!this.gridTilemap)throw this.createUninitializedErr();let n=new JT(o,this.gridTilemap,r,{distance:(c=v.distance)!=null?c:0,noPathFoundStrategy:v.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(m=v.maxPathLength)!=null?m:1/0,shortestPathAlgorithm:(t=v.algorithm)!=null?t:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!v.ignoreLayers,facingDirection:(a=v.facingDirection)!=null?a:"none"});o.setMovement(n)}isMoving(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.isMoving()}getFacingDirection(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getFacingDirection()}getFacingPosition(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);let B=A.getFacingPosition();return{x:B.x,y:B.y}}turnTowards(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);return B.turnTowards(S)}getCharactersAt(E,S){if(this.initGuard(),!this.gridTilemap)return[];let A=this.gridTilemap.getCharactersAt(new ft(E),S);return Array.from(A).map(B=>B.getId())}setPosition(E,S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(E);if(!I)throw this.createCharUnknownErr(E);A||I.setTilePosition({position:new ft(S),layer:I.getTilePos().layer}),I.setTilePosition({position:new ft(S),layer:A})}isBlocked(E,S,A=["geDefault"]){var B,I;this.initGuard();let b=new ft(E);return!!((B=this.gridTilemap)!=null&&B.hasBlockingTile(b,S)||(I=this.gridTilemap)!=null&&I.hasBlockingChar(b,S,A))}isTileBlocked(E,S){var A;return this.initGuard(),!!((A=this.gridTilemap)!=null&&A.hasBlockingTile(new ft(E),S))}getCollisionGroups(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getCollisionGroups()||[]}setCollisionGroups(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);B.setCollisionGroups(S)}getIgnoreCollisionGroups(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(E,S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(E);if(!B)throw this.createCharUnknownErr(E);B.setIgnoreCollisionGroups(S)}getTilePosInDirection(E,S,A){if(!this.gridTilemap)throw this.createUninitializedErr();let B=this.gridTilemap.getTilePosInDirection({position:new ft(E),layer:S},A);return{position:B.position.toPosition(),charLayer:B.layer}}findShortestPath(E,S,A={}){if(!this.gridTilemap)throw this.createUninitializedErr();let B=A.shortestPathAlgorithm||"BFS";A.considerCosts&&B!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${B}'. It can only be used with A* algorithm.`);let I=A.pathWidth!==void 0&&A.pathWidth!==1,b=A.pathHeight!==void 0&&A.pathHeight!==1;(I||b)&&B==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let c=new td(this.gridTilemap).findShortestPath(zt.toInternal(E),zt.toInternal(S),Vi(re({},A),{shortestPathAlgorithm:B}));return{path:c.path.map(zt.fromInternal),closestToTarget:c.closestToTarget?zt.fromInternal(c.closestToTarget):void 0,reachedMaxPathLength:!1,steps:c.steps}}steppedOn(E,S,A){return this.positionChangeFinished().pipe(Wi(B=>E.includes(B.charId)&&S.some(I=>I.x===B.enterTile.x&&I.y===B.enterTile.y)&&(A===void 0||A.includes(B.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(ks(E=>({charId:E,action:"ADDED"})),XT(this.charRemoved$.pipe(ks(E=>({charId:E,action:"REMOVED"})))))}movementStarted(){if(!this.movementStarted$)throw this.createUninitializedErr();return this.movementStarted$}movementStopped(){if(!this.movementStopped$)throw this.createUninitializedErr();return this.movementStopped$}directionChanged(){if(!this.directionChanged$)throw this.createUninitializedErr();return this.directionChanged$}positionChangeStarted(){if(!this.positionChangeStarted$)throw this.createUninitializedErr();return this.positionChangeStarted$}positionChangeFinished(){if(!this.positionChangeFinished$)throw this.createUninitializedErr();return this.positionChangeFinished$}getMovementProgress(E){var S;this.initGuard();let A=(S=this.gridCharacters)==null?void 0:S.get(E);if(!A)throw this.createCharUnknownErr(E);return A.getMovementProgress()}rebuildTileCollisionCache(E,S,A,B){var I;(I=this.gridTilemap)==null||I.rebuildTileCollisionCache(new Io(E,S,A,B))}addQueueMovements(E,S,A){var B,I;this.initGuard();let b=(B=this.gridCharacters)==null?void 0:B.get(E);if(!b)throw this.createCharUnknownErr(E);if(!this.gridTilemap)throw this.createUninitializedErr();let c;((I=b?.getMovement())==null?void 0:I.getInfo().type)==="Queue"?c=b.getMovement():(c=new aS(b,this.gridTilemap),b.setMovement(c),c.finished().pipe(ke(NT(this.charRemoved(E),b.autoMovementSet()))).subscribe(m=>{var t;(t=this.queueMovementFinished$)==null||t.next(re({charId:E},m))})),c.enqueue(S.map(m=>Es(m)?m:{position:new ft(m.position),layer:m.charLayer}),A)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(E){var S,A;this.initGuard();let B=(S=this.gridCharacters)==null?void 0:S.get(E);if(!B)throw this.createCharUnknownErr(E);return((A=B.getMovement())==null?void 0:A.getInfo().type)==="Queue"?B.getMovement().peekAll().map(I=>({command:Es(I.command)?I.command:zt.fromInternal(I.command),config:I.config})):[]}clearEnqueuedMovements(E){var S,A;this.initGuard();let B=(S=this.gridCharacters)==null?void 0:S.get(E);if(!B)throw this.createCharUnknownErr(E);((A=B.getMovement())==null?void 0:A.getInfo().type)==="Queue"&&B.getMovement().clear()}getTileCost(E,S,A){var B,I;return this.initGuard(),(I=(B=this.gridTilemap)==null?void 0:B.getTileCosts({position:new ft(E),layer:S},A))!=null?I:1}getState(){let E=[];if(this.gridCharacters)for(let[S,A]of this.gridCharacters.entries())E.push({id:S,position:zt.fromInternal(A.getTilePos()),facingDirection:A.getFacingDirection(),speed:A.getSpeed(),labels:A.getLabels(),movementProgress:A.getMovementProgress(),collisionConfig:{collisionGroups:A.getCollisionGroups(),ignoreCollisionGroups:A.getIgnoreCollisionGroups(),collidesWithTiles:A.collidesWithTiles(),ignoreMissingTiles:A.getIgnoreMissingTiles()}});return{characters:E}}setState(E){if(this.gridCharacters)for(let S of E.characters){let A=this.gridCharacters.get(S.id);if(A){let B=A.getTilePos();zt.equal(B,zt.toInternal(S.position))||A.setTilePosition(zt.toInternal(S.position)),A.setSpeed(S.speed),A.turnTowards(S.facingDirection),S.collisionConfig.collisionGroups&&A.setCollisionGroups(S.collisionConfig.collisionGroups),S.collisionConfig.collidesWithTiles!==void 0&&A.setCollidesWithTiles(S.collisionConfig.collidesWithTiles),S.collisionConfig.ignoreMissingTiles!==void 0&&A.setIgnoreMissingTiles(S.collisionConfig.ignoreMissingTiles),A.setMovementProgress(S.movementProgress),A.clearLabels(),A.addLabels(S.labels)}}}charRemoved(E){var S;if(!this.charRemoved$)throw this.createUninitializedErr();return(S=this.charRemoved$)==null?void 0:S.pipe(Fs(1),Wi(A=>A==E))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var E;(E=this.config)==null||E.characters.forEach(S=>this.addCharacter(S))}moveChar(E,S){var A,B,I;this.initGuard();let b=(A=this.gridCharacters)==null?void 0:A.get(E);if(!b)throw this.createCharUnknownErr(E);if(b.getNumberOfDirections()===4){if(!((B=this.gridTilemap)!=null&&B.isIsometric())&&Qs(S)){console.warn(`GridEngine: Character '${E}' can't be moved '${S}' in 4 direction mode.`);return}else if((I=this.gridTilemap)!=null&&I.isIsometric()&&!Qs(S)){console.warn(`GridEngine: Character '${E}' can't be moved '${S}' in 4 direction isometric mode.`);return}}b.move(S)}createCharUnknownErr(E){return new Error(`Character unknown: ${E}`)}assembleMoveToConfig(E={}){let S=Vi(re({},E),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return E!=null&&E.noPathFoundStrategy&&(Object.values($f).includes(E.noPathFoundStrategy)?S.noPathFoundStrategy=E.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${E.noPathFoundStrategy}'. Falling back to 'STOP'`)),E!=null&&E.pathBlockedStrategy&&(Object.values(Zf).includes(E.pathBlockedStrategy)?S.pathBlockedStrategy=E.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${E.pathBlockedStrategy}'. Falling back to 'WAIT'`)),S}setConfigDefaults(E){return re({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},E)}},hS=class extends Qf{constructor(E,S={}){super(E,S),this.jumpCache=new zu}findShortestPathImpl(E,S){return this.jumpCache=new zu,super.findShortestPathImpl(E,S)}getNeighborsInternal(E,S,A){if(!S||E.layer!==S.layer)return this.getNeighbors(E,A).map(b=>({p:b,dist:1}));let B=this.prune(S,E).map(b=>{let c=this.getTransition(b.position,E.layer);return{position:b.position,layer:c||E.layer}}),I=[];for(let b of B){let c=this.jump(E,b,A,1,qe(E.position,b.position));c&&(c.dist=this.distance(E.position,c.p.position),I.push(c))}return I}getForced(E,S){let A=[],{topLeft:B,downLeft:I,top:b,bottom:c,topRight:m,downRight:t}=this.normalizedPositions(E,S),a=qe(E.position,S.position);return Qs(a)?(this.blockOrTrans(E,B)&&(this.addIfNotBlocked(A,S,b),this.addIfNotBlocked(A,S,m),this.blockOrTrans(I,B)&&this.addIfNotBlocked(A,S,B)),this.blockOrTrans(E,I)&&(this.addIfNotBlocked(A,S,c),this.addIfNotBlocked(A,S,t),this.blockOrTrans(B,I)&&this.addIfNotBlocked(A,S,I)),this.blockOrTrans(B,b)&&this.addIfNotBlocked(A,S,b),this.blockOrTrans(I,c)&&this.addIfNotBlocked(A,S,c),this.blockOrTrans(B,m)&&this.addIfNotBlocked(A,S,m),this.blockOrTrans(I,t)&&this.addIfNotBlocked(A,S,t)):((this.blockOrTrans(E,b)||this.blockOrTrans(b,m))&&this.addIfNotBlocked(A,S,m),(this.blockOrTrans(E,c)||this.blockOrTrans(c,t))&&this.addIfNotBlocked(A,S,t),this.blockOrTrans(E,B)&&this.blockOrTrans(E,b)&&(this.addIfNotBlocked(A,S,b),this.addIfNotBlocked(A,S,B)),this.blockOrTrans(E,I)&&this.blockOrTrans(E,c)&&(this.addIfNotBlocked(A,S,c),this.addIfNotBlocked(A,S,I)),this.blockOrTrans(B,b)&&this.blockOrTrans(E,b)&&this.addIfNotBlocked(A,S,b),this.blockOrTrans(I,c)&&this.blockOrTrans(E,c)&&this.addIfNotBlocked(A,S,c)),A}hasForced(E,S){let{topLeft:A,downLeft:B,top:I,bottom:b,topRight:c,downRight:m}=this.normalizedPositions(E,S),t=qe(E.position,S.position);if(Qs(t)){if(this.blockOrTrans(E,A)&&(!this.blockOrTrans(S,I)||!this.blockOrTrans(S,c)||this.blockOrTrans(B,A)&&!this.blockOrTrans(S,A))||this.blockOrTrans(E,B)&&(!this.blockOrTrans(S,b)||!this.blockOrTrans(S,m)||this.blockOrTrans(A,B)&&!this.blockOrTrans(S,B))||this.blockOrTrans(A,I)&&!this.blockOrTrans(S,I)||this.blockOrTrans(B,b)&&!this.blockOrTrans(S,b)||this.blockOrTrans(A,c)&&!this.blockOrTrans(S,c)||this.blockOrTrans(B,m)&&!this.blockOrTrans(S,m))return!0}else if((this.blockOrTrans(E,I)||this.blockOrTrans(I,c))&&!this.blockOrTrans(S,c)||(this.blockOrTrans(E,b)||this.blockOrTrans(b,m))&&!this.blockOrTrans(S,m)||this.blockOrTrans(E,A)&&this.blockOrTrans(E,I)&&(!this.blockOrTrans(S,I)||!this.blockOrTrans(S,A))||this.blockOrTrans(E,B)&&this.blockOrTrans(E,b)&&(!this.blockOrTrans(S,b)||!this.blockOrTrans(S,B))||this.blockOrTrans(A,I)&&this.blockOrTrans(E,I)&&!this.blockOrTrans(S,I)||this.blockOrTrans(B,b)&&this.blockOrTrans(E,b)&&!this.blockOrTrans(S,b))return!0;return!1}prune(E,S){let{top:A,right:B,topRight:I,downRight:b,bottom:c}=this.normalizedPositions(E,S),m=this.getForced(E,S),t=qe(E.position,S.position);return Qs(t)?[A,B,I,b,c,...m]:[B,...m]}jump(E,S,A,B,I){let b=this.jumpCache.get(E,S);if(b!==null)return b;if(this.isBlocking(E,S)&&!(zt.equal(S,A)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(E,S,void 0);return}if(zt.equal(S,A))return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(B>=this.maxJumpSize)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.getTransition(S.position,E.layer)!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.hasForced(E,S))return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.updateClosestToTarget(S,A),I==="up-left"){if(this.jump(S,this.getTilePosInDir(S,"up"),A,B+1,"up")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.jump(S,this.getTilePosInDir(S,"left"),A,B+1,"left")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0}}else if(I==="down-left"){if(this.jump(S,this.getTilePosInDir(S,"down"),A,B+1,"down")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.jump(S,this.getTilePosInDir(S,"left"),A,B+1,"left")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0}}else if(I==="up-right"){if(this.jump(S,this.getTilePosInDir(S,"up"),A,B+1,"up")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.jump(S,this.getTilePosInDir(S,"right"),A,B+1,"right")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0}}else if(I==="down-right"){if(this.jump(S,this.getTilePosInDir(S,"down"),A,B+1,"down")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0};if(this.jump(S,this.getTilePosInDir(S,"right"),A,B+1,"right")!==void 0)return this.jumpCache.set(E,S,{p:S,dist:0}),{p:S,dist:0}}let c=this.jump(S,this.getTilePosInDir(S,I),A,B+1,I);return this.jumpCache.set(E,S,c),c}normalizedPositions(E,S){return E.position.xS.position.x&&E.position.y===S.position.y?{topLeft:{position:new ft(S.position.x+1,S.position.y+1),layer:S.layer},downLeft:{position:new ft(S.position.x+1,S.position.y-1),layer:S.layer},top:{position:new ft(S.position.x,S.position.y+1),layer:S.layer},bottom:{position:new ft(S.position.x,S.position.y-1),layer:S.layer},right:{position:new ft(S.position.x-1,S.position.y),layer:S.layer},topRight:{position:new ft(S.position.x-1,S.position.y+1),layer:S.layer},downRight:{position:new ft(S.position.x-1,S.position.y-1),layer:S.layer}}:E.position.yS.position.y&&E.position.x===S.position.x?{topLeft:{position:new ft(S.position.x-1,S.position.y+1),layer:S.layer},downLeft:{position:new ft(S.position.x+1,S.position.y+1),layer:S.layer},top:{position:new ft(S.position.x-1,S.position.y),layer:S.layer},bottom:{position:new ft(S.position.x+1,S.position.y),layer:S.layer},right:{position:new ft(S.position.x,S.position.y-1),layer:S.layer},topRight:{position:new ft(S.position.x-1,S.position.y-1),layer:S.layer},downRight:{position:new ft(S.position.x+1,S.position.y-1),layer:S.layer}}:E.position.yS.position.x?{topLeft:{position:new ft(S.position.x+1,S.position.y),layer:S.layer},downLeft:{position:new ft(S.position.x,S.position.y-1),layer:S.layer},top:{position:new ft(S.position.x+1,S.position.y+1),layer:S.layer},bottom:{position:new ft(S.position.x-1,S.position.y-1),layer:S.layer},right:{position:new ft(S.position.x-1,S.position.y+1),layer:S.layer},topRight:{position:new ft(S.position.x,S.position.y+1),layer:S.layer},downRight:{position:new ft(S.position.x-1,S.position.y),layer:S.layer}}:E.position.y>S.position.y&&E.position.x(E.SUCCESS="SUCCESS",E.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",E.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",E.PATH_BLOCKED="PATH_BLOCKED",E.NO_PATH_FOUND="NO_PATH_FOUND",E.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",E.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",E.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",E))(uS||{}),ed=class{constructor(E,S,A,{config:B,ignoreBlockedTarget:I=!1,distance:b=0}={}){this.character=E,this.tilemap=S,this.targetPos=A,this.shortestPath=[],this.distOffset=0,this.posOnPath=0,this.stopped=!1,this.pathBlockedWaitElapsed=0,this.isPositionAllowed=()=>!0,this.shortestPathAlgorithm="BIDIRECTIONAL_SEARCH",this.maxPathLength=1/0,this.considerCosts=!1,this.ignoredChars=[],this.isBlocking=(t,a)=>t?new Jf(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:t,layer:a}):!0;var c,m;this.shortestPathAlgorithm=(c=B?.algorithm)!=null?c:this.shortestPathAlgorithm,this.ignoreBlockedTarget=I,this.distance=b,this.noPathFoundStrategy=B?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=B?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new Lu(B?.noPathFoundRetryBackoffMs||200,B?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new Lu(B?.pathBlockedRetryBackoffMs||200,B?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),B!=null&&B.isPositionAllowedFn&&(this.isPositionAllowed=B.isPositionAllowedFn),B!=null&&B.maxPathLength&&(this.maxPathLength=B.maxPathLength),this.alternativeTargets=B?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=B?.noPathFoundAlternativeTargetsFallbackStrategy,B!=null&&B.considerCosts&&this.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.considerCosts=B?.considerCosts||!1,this.ignoreLayers=!!(B!=null&&B.ignoreLayers),this.distanceUtils=nn.create(E.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=B?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(m=B?.ignoredChars)!=null?m:[],this.finished$=new oe,this.setCharacter(E)}setPathBlockedStrategy(E){this.pathBlockedStrategy=E}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(E){this.character=E,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(Wi(S=>S!==this),Fs(1)).subscribe(()=>{this.stop("MOVEMENT_TERMINATED")})}getPathfindingOptions(){return{shortestPathAlgorithm:this.shortestPathAlgorithm,pathWidth:this.character.getTileWidth(),pathHeight:this.character.getTileHeight(),numberOfDirections:this.character.getNumberOfDirections(),isPositionAllowed:this.isPositionAllowed,collisionGroups:this.character.getCollisionGroups(),ignoredChars:[this.character.getId(),...this.ignoredChars],ignoreTiles:!this.character.collidesWithTiles(),ignoreMapBounds:this.character.getIgnoreMissingTiles(),ignoreBlockedTarget:this.ignoreBlockedTarget,maxPathLength:this.maxPathLength,ignoreLayers:this.ignoreLayers,considerCosts:this.considerCosts,calculateClosestToTarget:!0}}update(E){var S,A,B,I;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(E,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((S=this.nextTileOnPath())==null?void 0:S.position,(A=this.character)==null?void 0:A.getNextTilePos().layer)?this.applyPathBlockedStrategy(E):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((B=this.nextTileOnPath())==null?void 0:B.position,(I=this.character)==null?void 0:I.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(E=>zt.fromInternal(E))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:zt.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(E){switch(E){case"SUCCESS":return"Successfully arrived.";case"MOVEMENT_TERMINATED":return"Movement of character has been replaced before destination was reached.";case"PATH_BLOCKED":return"PathBlockedStrategy STOP: Path blocked.";case"NO_PATH_FOUND_MAX_RETRIES_EXCEEDED":return`NoPathFoundStrategy RETRY: Maximum retries of ${this.noPathFoundRetryable.getMaxRetries()} exceeded.`;case"NO_PATH_FOUND":return"NoPathFoundStrategy STOP: No path found.";case"PATH_BLOCKED_MAX_RETRIES_EXCEEDED":return`PathBlockedStrategy RETRY: Maximum retries of ${this.pathBlockedRetryable.getMaxRetries()} exceeded.`;case"PATH_BLOCKED_WAIT_TIMEOUT":return`PathBlockedStrategy WAIT: Wait timeout of ${this.pathBlockedWaitTimeoutMs}ms exceeded.`}}applyPathBlockedStrategy(E){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(E,()=>{let S=this.getShortestPath();S.path.length>0&&this.calcShortestPath(S)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=E,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let E=this.nextTileOnPath();if(!E)return;let S=this.getDir(this.character.getNextTilePos().position,E.position);this.character.move(S)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(E){this.finished$.next({position:this.character.getTilePos().position,result:E,description:this.resultToReason(E),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let E=this.shortestPath[this.posOnPath+1],S=this.getDir(this.character.getNextTilePos().position,E.position);this.character.turnTowards(S)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let E=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:b,distOffset:c}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:A,distOffset:0}}pathToAlternativeTarget(E,S){let A=S.findShortestPath(this.character.getNextTilePos(),E,this.getPathfindingOptions()).path,B=this.distanceUtils.distance(E.position,this.targetPos.position);return{path:A,distOffset:B}}getDir(E,S){return this.tilemap.fromMapDirection(this.distanceUtils.direction(E,S))}},fS=Object.create,id=Object.defineProperty,dS=Object.getOwnPropertyDescriptor,cS=Object.getOwnPropertyNames,vS=Object.getPrototypeOf,pS=Object.prototype.hasOwnProperty,gS=(E,S)=>()=>(S||E((S={exports:{}}).exports,S),S.exports),mS=(E,S,A,B)=>{if(S&&typeof S=="object"||typeof S=="function")for(let I of cS(S))!pS.call(E,I)&&I!==A&&id(E,I,{get:()=>S[I],enumerable:!(B=dS(S,I))||B.enumerable});return E},Bo=(E,S,A)=>(A=E!=null?fS(vS(E)):{},mS(S||!E||!E.__esModule?id(A,"default",{value:E,enumerable:!0}):A,E)),bo=gS((E,S)=>{(function(){var A,B="4.17.21",I=200,b="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",m="Invalid `variable` option passed into `_.template`",t="__lodash_hash_undefined__",a=500,v="__lodash_placeholder__",o=1,r=2,n=4,e=1,i=2,h=1,s=2,l=4,f=8,u=16,d=32,p=64,g=128,y=256,x=512,T=30,C="...",M=800,w=16,L=1,F=2,O=3,N=1/0,G=9007199254740991,V=17976931348623157e292,j=NaN,K=4294967295,J=K-1,X=K>>>1,Y=[["ary",g],["bind",h],["bindKey",s],["curry",f],["curryRight",u],["flip",x],["partial",d],["partialRight",p],["rearg",y]],D="[object Arguments]",z="[object Array]",W="[object AsyncFunction]",H="[object Boolean]",Z="[object Date]",Q="[object DOMException]",k="[object Error]",et="[object Function]",st="[object GeneratorFunction]",rt="[object Map]",ot="[object Number]",dt="[object Null]",at="[object Object]",pt="[object Promise]",Pt="[object Proxy]",Ct="[object RegExp]",Et="[object Set]",vt="[object String]",St="[object Symbol]",gt="[object Undefined]",Mt="[object WeakMap]",It="[object WeakSet]",Kt="[object ArrayBuffer]",Gt="[object DataView]",Wt="[object Float32Array]",Bt="[object Float64Array]",ie="[object Int8Array]",Zt="[object Int16Array]",le="[object Int32Array]",fe="[object Uint8Array]",Ce="[object Uint8ClampedArray]",ei="[object Uint16Array]",ii="[object Uint32Array]",ci=/\b__p \+= '';/g,vi=/\b(__p \+=) '' \+/g,pi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,No=/&(?:amp|lt|gt|quot|#39);/g,Go=/[&<>"']/g,vd=RegExp(No.source),pd=RegExp(Go.source),gd=/<%-([\s\S]+?)%>/g,md=/<%([\s\S]+?)%>/g,zo=/<%=([\s\S]+?)%>/g,xd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yd=/^\w*$/,Td=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ir=/[\\^$.*+?()[\]{}|]/g,Sd=RegExp(Ir.source),Br=/^\s+/,Cd=/\s/,Ed=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pd=/\{\n\/\* \[wrapped with (.+)\] \*/,Ad=/,? & /,Md=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wd=/[()=,{}\[\]\/\s]/,Rd=/\\(\\)?/g,Fd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Uo=/\w*$/,Ld=/^[-+]0x[0-9a-f]+$/i,Od=/^0b[01]+$/i,Dd=/^\[object .+?Constructor\]$/,Id=/^0o[0-7]+$/i,Bd=/^(?:0|[1-9]\d*)$/,bd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hn=/($^)/,Nd=/['\n\r\u2028\u2029\\]/g,ln="\\ud800-\\udfff",Gd="\\u0300-\\u036f",zd="\\ufe20-\\ufe2f",Ud="\\u20d0-\\u20ff",Xo=Gd+zd+Ud,Vo="\\u2700-\\u27bf",Wo="a-z\\xdf-\\xf6\\xf8-\\xff",Xd="\\xac\\xb1\\xd7\\xf7",Vd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wd="\\u2000-\\u206f",Yd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yo="A-Z\\xc0-\\xd6\\xd8-\\xde",Ho="\\ufe0e\\ufe0f",jo=Xd+Vd+Wd+Yd,br="['’]",Hd="["+ln+"]",Ko="["+jo+"]",un="["+Xo+"]",$o="\\d+",jd="["+Vo+"]",Zo="["+Wo+"]",Jo="[^"+ln+jo+$o+Vo+Wo+Yo+"]",Nr="\\ud83c[\\udffb-\\udfff]",Kd="(?:"+un+"|"+Nr+")",Qo="[^"+ln+"]",Gr="(?:\\ud83c[\\udde6-\\uddff]){2}",zr="[\\ud800-\\udbff][\\udc00-\\udfff]",os="["+Yo+"]",ko="\\u200d",qo="(?:"+Zo+"|"+Jo+")",$d="(?:"+os+"|"+Jo+")",_o="(?:"+br+"(?:d|ll|m|re|s|t|ve))?",th="(?:"+br+"(?:D|LL|M|RE|S|T|VE))?",eh=Kd+"?",ih="["+Ho+"]?",Zd="(?:"+ko+"(?:"+[Qo,Gr,zr].join("|")+")"+ih+eh+")*",Jd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sh=ih+eh+Zd,kd="(?:"+[jd,Gr,zr].join("|")+")"+sh,qd="(?:"+[Qo+un+"?",un,Gr,zr,Hd].join("|")+")",_d=RegExp(br,"g"),tc=RegExp(un,"g"),Ur=RegExp(Nr+"(?="+Nr+")|"+qd+sh,"g"),ec=RegExp([os+"?"+Zo+"+"+_o+"(?="+[Ko,os,"$"].join("|")+")",$d+"+"+th+"(?="+[Ko,os+qo,"$"].join("|")+")",os+"?"+qo+"+"+_o,os+"+"+th,Qd,Jd,$o,kd].join("|"),"g"),ic=RegExp("["+ko+ln+Xo+Ho+"]"),sc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rc=-1,se={};se[Wt]=se[Bt]=se[ie]=se[Zt]=se[le]=se[fe]=se[Ce]=se[ei]=se[ii]=!0,se[D]=se[z]=se[Kt]=se[H]=se[Gt]=se[Z]=se[k]=se[et]=se[rt]=se[ot]=se[at]=se[Ct]=se[Et]=se[vt]=se[Mt]=!1;var ee={};ee[D]=ee[z]=ee[Kt]=ee[Gt]=ee[H]=ee[Z]=ee[Wt]=ee[Bt]=ee[ie]=ee[Zt]=ee[le]=ee[rt]=ee[ot]=ee[at]=ee[Ct]=ee[Et]=ee[vt]=ee[St]=ee[fe]=ee[Ce]=ee[ei]=ee[ii]=!0,ee[k]=ee[et]=ee[Mt]=!1;var ac={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},oc={"&":"&","<":"<",">":">",'"':""","'":"'"},hc={"&":"&","<":"<",">":">",""":'"',"'":"'"},lc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uc=parseFloat,fc=parseInt,nh=typeof global=="object"&&global&&global.Object===Object&&global,dc=typeof self=="object"&&self&&self.Object===Object&&self,ye=nh||dc||Function("return this")(),Xr=typeof E=="object"&&E&&!E.nodeType&&E,Hi=Xr&&typeof S=="object"&&S&&!S.nodeType&&S,rh=Hi&&Hi.exports===Xr,Vr=rh&&nh.process,Ye=function(){try{var ht=Hi&&Hi.require&&Hi.require("util").types;return ht||Vr&&Vr.binding&&Vr.binding("util")}catch{}}(),ah=Ye&&Ye.isArrayBuffer,oh=Ye&&Ye.isDate,hh=Ye&&Ye.isMap,lh=Ye&&Ye.isRegExp,uh=Ye&&Ye.isSet,fh=Ye&&Ye.isTypedArray;function be(ht,mt,ct){switch(ct.length){case 0:return ht.call(mt);case 1:return ht.call(mt,ct[0]);case 2:return ht.call(mt,ct[0],ct[1]);case 3:return ht.call(mt,ct[0],ct[1],ct[2])}return ht.apply(mt,ct)}function cc(ht,mt,ct,wt){for(var bt=-1,Jt=ht==null?0:ht.length;++bt-1}function Wr(ht,mt,ct){for(var wt=-1,bt=ht==null?0:ht.length;++wt-1;);return ct}function yh(ht,mt){for(var ct=ht.length;ct--&&hs(mt,ht[ct],0)>-1;);return ct}function Cc(ht,mt){for(var ct=ht.length,wt=0;ct--;)ht[ct]===mt&&++wt;return wt}var Ec=Kr(ac),Pc=Kr(oc);function Ac(ht){return"\\"+lc[ht]}function Mc(ht,mt){return ht==null?A:ht[mt]}function ls(ht){return ic.test(ht)}function wc(ht){return sc.test(ht)}function Rc(ht){for(var mt,ct=[];!(mt=ht.next()).done;)ct.push(mt.value);return ct}function Qr(ht){var mt=-1,ct=Array(ht.size);return ht.forEach(function(wt,bt){ct[++mt]=[bt,wt]}),ct}function Th(ht,mt){return function(ct){return ht(mt(ct))}}function Fi(ht,mt){for(var ct=-1,wt=ht.length,bt=0,Jt=[];++ct-1}function pv(P,R){var U=this.__data__,$=Rn(U,P);return $<0?(++this.size,U.push([P,R])):U[$][1]=R,this}gi.prototype.clear=fv,gi.prototype.delete=dv,gi.prototype.get=cv,gi.prototype.has=vv,gi.prototype.set=pv;function mi(P){var R=-1,U=P==null?0:P.length;for(this.clear();++R=R?P:R)),P}function $e(P,R,U,$,q,tt){var it,nt=R&o,lt=R&r,xt=R&n;if(U&&(it=q?U(P,$,q,tt):U(P)),it!==A)return it;if(!ae(P))return P;var yt=Nt(P);if(yt){if(it=yp(P),!nt)return Le(P,it)}else{var Tt=Me(P),At=Tt==et||Tt==st;if(Ni(P))return il(P,nt);if(Tt==at||Tt==D||At&&!q){if(it=lt||At?{}:Sl(P),!nt)return lt?hp(P,Ov(it,P)):op(P,Dh(it,P))}else{if(!ee[Tt])return q?P:{};it=Tp(P,Tt,nt)}}tt||(tt=new ni);var Rt=tt.get(P);if(Rt)return Rt;tt.set(P,it),Ql(P)?P.forEach(function(Dt){it.add($e(Dt,R,U,Dt,P,tt))}):Zl(P)&&P.forEach(function(Dt,Yt){it.set(Yt,$e(Dt,R,U,Yt,P,tt))});var Ot=xt?lt?Ca:Sa:lt?De:Te,Xt=yt?A:Ot(P);return He(Xt||P,function(Dt,Yt){Xt&&(Yt=Dt,Dt=P[Yt]),Ns(it,Yt,$e(Dt,R,U,Yt,P,tt))}),it}function Dv(P){var R=Te(P);return function(U){return Ih(U,P,R)}}function Ih(P,R,U){var $=U.length;if(P==null)return!$;for(P=te(P);$--;){var q=U[$],tt=R[q],it=P[q];if(it===A&&!(q in P)||!tt(it))return!1}return!0}function Bh(P,R,U){if(typeof P!="function")throw new je(c);return Ys(function(){P.apply(A,U)},R)}function Gs(P,R,U,$){var q=-1,tt=fn,it=!0,nt=P.length,lt=[],xt=R.length;if(!nt)return lt;U&&(R=ne(R,Ne(U))),$?(tt=Wr,it=!1):R.length>=I&&(tt=Ls,it=!1,R=new $i(R));t:for(;++qq?0:q+U),$=$===A||$>q?q:Ut($),$<0&&($+=q),$=U>$?0:ql($);U<$;)P[U++]=R;return P}function Nh(P,R){var U=[];return Di(P,function($,q,tt){R($,q,tt)&&U.push($)}),U}function Ee(P,R,U,$,q){var tt=-1,it=P.length;for(U||(U=Cp),q||(q=[]);++tt0&&U(nt)?R>1?Ee(nt,R-1,U,$,q):Ri(q,nt):$||(q[q.length]=nt)}return q}var sa=hl(),Gh=hl(!0);function hi(P,R){return P&&sa(P,R,Te)}function na(P,R){return P&&Gh(P,R,Te)}function Ln(P,R){return wi(R,function(U){return Ci(P[U])})}function Ji(P,R){R=Bi(R,P);for(var U=0,$=R.length;P!=null&&U<$;)P=P[ui(R[U++])];return U&&U==$?P:A}function zh(P,R,U){var $=R(P);return Nt(P)?$:Ri($,U(P))}function we(P){return P==null?P===A?gt:dt:ji&&ji in te(P)?gp(P):Fp(P)}function ra(P,R){return P>R}function bv(P,R){return P!=null&&kt.call(P,R)}function Nv(P,R){return P!=null&&R in te(P)}function Gv(P,R,U){return P>=Ae(R,U)&&P=120&&yt.length>=120)?new $i(it&&yt):A}yt=P[0];var Tt=-1,At=nt[0];t:for(;++Tt-1;)nt!==P&&Sn.call(nt,lt,1),Sn.call(P,lt,1);return P}function Zh(P,R){for(var U=P?R.length:0,$=U-1;U--;){var q=R[U];if(U==$||q!==tt){var tt=q;Si(q)?Sn.call(P,q,1):va(P,q)}}return P}function fa(P,R){return P+Pn(Rh()*(R-P+1))}function Qv(P,R,U,$){for(var q=-1,tt=me(En((R-P)/(U||1)),0),it=ct(tt);tt--;)it[$?tt:++q]=P,P+=U;return it}function da(P,R){var U="";if(!P||R<1||R>G)return U;do R%2&&(U+=P),R=Pn(R/2),R&&(P+=P);while(R);return U}function Vt(P,R){return Fa(Pl(P,R,Ie),P+"")}function kv(P){return Oh(ys(P))}function qv(P,R){var U=ys(P);return Vn(U,Zi(R,0,U.length))}function Xs(P,R,U,$){if(!ae(P))return P;R=Bi(R,P);for(var q=-1,tt=R.length,it=tt-1,nt=P;nt!=null&&++qq?0:q+R),U=U>q?q:U,U<0&&(U+=q),q=R>U?0:U-R>>>0,R>>>=0;for(var tt=ct(q);++$>>1,it=P[tt];it!==null&&!ze(it)&&(U?it<=R:it=I){var xt=R?null:dp(P);if(xt)return cn(xt);it=!1,q=Ls,lt=new $i}else lt=R?[]:nt;t:for(;++$=$?P:Ze(P,R,U)}var el=Yc||function(P){return ye.clearTimeout(P)};function il(P,R){if(R)return P.slice();var U=P.length,$=Eh?Eh(U):new P.constructor(U);return P.copy($),$}function xa(P){var R=new P.constructor(P.byteLength);return new yn(R).set(new yn(P)),R}function sp(P,R){var U=R?xa(P.buffer):P.buffer;return new P.constructor(U,P.byteOffset,P.byteLength)}function np(P){var R=new P.constructor(P.source,Uo.exec(P));return R.lastIndex=P.lastIndex,R}function rp(P){return bs?te(bs.call(P)):{}}function sl(P,R){var U=R?xa(P.buffer):P.buffer;return new P.constructor(U,P.byteOffset,P.length)}function nl(P,R){if(P!==R){var U=P!==A,$=P===null,q=P===P,tt=ze(P),it=R!==A,nt=R===null,lt=R===R,xt=ze(R);if(!nt&&!xt&&!tt&&P>R||tt&&it&<&&!nt&&!xt||$&&it&<||!U&<||!q)return 1;if(!$&&!tt&&!xt&&P=nt)return lt;var xt=U[$];return lt*(xt=="desc"?-1:1)}}return P.index-R.index}function rl(P,R,U,$){for(var q=-1,tt=P.length,it=U.length,nt=-1,lt=R.length,xt=me(tt-it,0),yt=ct(lt+xt),Tt=!$;++nt1?U[q-1]:A,it=q>2?U[2]:A;for(tt=P.length>3&&typeof tt=="function"?(q--,tt):A,it&&Re(U[0],U[1],it)&&(tt=q<3?A:tt,q=1),R=te(R);++$-1?q[tt?R[it]:it]:A}}function fl(P){return Ti(function(R){var U=R.length,$=U,q=Ke.prototype.thru;for(P&&R.reverse();$--;){var tt=R[$];if(typeof tt!="function")throw new je(c);if(q&&!it&&Un(tt)=="wrapper")var it=new Ke([],!0)}for($=it?$:U;++$1&&$t.reverse(),yt&<nt))return!1;var xt=tt.get(P),yt=tt.get(R);if(xt&&yt)return xt==R&&yt==P;var Tt=-1,At=!0,Rt=U&i?new $i:A;for(tt.set(P,R),tt.set(R,P);++Tt1?"& ":"")+R[$],R=R.join(U>2?", ":" "),P.replace(Ed,`{ -/* [wrapped with `+R+`] */ -`)}function Cp(P){return Nt(P)||qi(P)||!!(Mh&&P&&P[Mh])}function Si(P,R){var U=typeof P;return R=R??G,!!R&&(U=="number"||U!="symbol"&&Bd.test(P))&&P>-1&&P%1==0&&P0){if(++R>=M)return arguments[0]}else R=0;return P.apply(A,arguments)}}function Vn(P,R){var U=-1,$=P.length,q=$-1;for(R=R===A?$:R;++U1?P[R-1]:A;return U=typeof U=="function"?(P.pop(),U):A,Nl(P,U)});function Gl(P){var R=_(P);return R.__chain__=!0,R}function I0(P,R){return R(P),P}function Wn(P,R){return R(P)}var B0=Ti(function(P){var R=P.length,U=R?P[0]:0,$=this.__wrapped__,q=function(tt){return ia(tt,P)};return R>1||this.__actions__.length||!($ instanceof Ht)||!Si(U)?this.thru(q):($=$.slice(U,+U+(R?1:0)),$.__actions__.push({func:Wn,args:[q],thisArg:A}),new Ke($,this.__chain__).thru(function(tt){return R&&!tt.length&&tt.push(A),tt}))});function b0(){return Gl(this)}function N0(){return new Ke(this.value(),this.__chain__)}function G0(){this.__values__===A&&(this.__values__=kl(this.value()));var P=this.__index__>=this.__values__.length,R=P?A:this.__values__[this.__index__++];return{done:P,value:R}}function z0(){return this}function U0(P){for(var R,U=this;U instanceof wn;){var $=Ll(U);$.__index__=0,$.__values__=A,R?q.__wrapped__=$:R=$;var q=$;U=U.__wrapped__}return q.__wrapped__=P,R}function X0(){var P=this.__wrapped__;if(P instanceof Ht){var R=P;return this.__actions__.length&&(R=new Ht(this)),R=R.reverse(),R.__actions__.push({func:Wn,args:[La],thisArg:A}),new Ke(R,this.__chain__)}return this.thru(La)}function V0(){return _h(this.__wrapped__,this.__actions__)}var W0=Bn(function(P,R,U){kt.call(P,U)?++P[U]:xi(P,U,1)});function Y0(P,R,U){var $=Nt(P)?dh:Iv;return U&&Re(P,R,U)&&(R=A),$(P,Lt(R,3))}function H0(P,R){var U=Nt(P)?wi:Nh;return U(P,Lt(R,3))}var j0=ul(Ol),K0=ul(Dl);function $0(P,R){return Ee(Yn(P,R),1)}function Z0(P,R){return Ee(Yn(P,R),N)}function J0(P,R,U){return U=U===A?1:Ut(U),Ee(Yn(P,R),U)}function zl(P,R){var U=Nt(P)?He:Di;return U(P,Lt(R,3))}function Ul(P,R){var U=Nt(P)?vc:bh;return U(P,Lt(R,3))}var Q0=Bn(function(P,R,U){kt.call(P,U)?P[U].push(R):xi(P,U,[R])});function k0(P,R,U,$){P=Oe(P)?P:ys(P),U=U&&!$?Ut(U):0;var q=P.length;return U<0&&(U=me(q+U,0)),Zn(P)?U<=q&&P.indexOf(R,U)>-1:!!q&&hs(P,R,U)>-1}var q0=Vt(function(P,R,U){var $=-1,q=typeof R=="function",tt=Oe(P)?ct(P.length):[];return Di(P,function(it){tt[++$]=q?be(R,it,U):zs(it,R,U)}),tt}),_0=Bn(function(P,R,U){xi(P,U,R)});function Yn(P,R){var U=Nt(P)?ne:Wh;return U(P,Lt(R,3))}function tg(P,R,U,$){return P==null?[]:(Nt(R)||(R=R==null?[]:[R]),U=$?A:U,Nt(U)||(U=U==null?[]:[U]),Kh(P,R,U))}var eg=Bn(function(P,R,U){P[U?0:1].push(R)},function(){return[[],[]]});function ig(P,R,U){var $=Nt(P)?Yr:gh,q=arguments.length<3;return $(P,Lt(R,4),U,q,Di)}function sg(P,R,U){var $=Nt(P)?pc:gh,q=arguments.length<3;return $(P,Lt(R,4),U,q,bh)}function ng(P,R){var U=Nt(P)?wi:Nh;return U(P,Kn(Lt(R,3)))}function rg(P){var R=Nt(P)?Oh:kv;return R(P)}function ag(P,R,U){(U?Re(P,R,U):R===A)?R=1:R=Ut(R);var $=Nt(P)?Rv:qv;return $(P,R)}function og(P){var R=Nt(P)?Fv:tp;return R(P)}function hg(P){if(P==null)return 0;if(Oe(P))return Zn(P)?us(P):P.length;var R=Me(P);return R==rt||R==Et?P.size:ha(P).length}function lg(P,R,U){var $=Nt(P)?Hr:ep;return U&&Re(P,R,U)&&(R=A),$(P,Lt(R,3))}var ug=Vt(function(P,R){if(P==null)return[];var U=R.length;return U>1&&Re(P,R[0],R[1])?R=[]:U>2&&Re(R[0],R[1],R[2])&&(R=[R[0]]),Kh(P,Ee(R,1),[])}),Hn=Hc||function(){return ye.Date.now()};function fg(P,R){if(typeof R!="function")throw new je(c);return P=Ut(P),function(){if(--P<1)return R.apply(this,arguments)}}function Xl(P,R,U){return R=U?A:R,R=P&&R==null?P.length:R,yi(P,g,A,A,A,A,R)}function Vl(P,R){var U;if(typeof R!="function")throw new je(c);return P=Ut(P),function(){return--P>0&&(U=R.apply(this,arguments)),P<=1&&(R=A),U}}var Da=Vt(function(P,R,U){var $=h;if(U.length){var q=Fi(U,ms(Da));$|=d}return yi(P,$,R,U,q)}),Wl=Vt(function(P,R,U){var $=h|s;if(U.length){var q=Fi(U,ms(Wl));$|=d}return yi(R,$,P,U,q)});function Yl(P,R,U){R=U?A:R;var $=yi(P,f,A,A,A,A,A,R);return $.placeholder=Yl.placeholder,$}function Hl(P,R,U){R=U?A:R;var $=yi(P,u,A,A,A,A,A,R);return $.placeholder=Hl.placeholder,$}function jl(P,R,U){var $,q,tt,it,nt,lt,xt=0,yt=!1,Tt=!1,At=!0;if(typeof P!="function")throw new je(c);R=Qe(R)||0,ae(U)&&(yt=!!U.leading,Tt="maxWait"in U,tt=Tt?me(Qe(U.maxWait)||0,R):tt,At="trailing"in U?!!U.trailing:At);function Rt(ce){var ai=$,Pi=q;return $=q=A,xt=ce,it=P.apply(Pi,ai),it}function Ot(ce){return xt=ce,nt=Ys(Yt,R),yt?Rt(ce):it}function Xt(ce){var ai=ce-lt,Pi=ce-xt,uu=R-ai;return Tt?Ae(uu,tt-Pi):uu}function Dt(ce){var ai=ce-lt,Pi=ce-xt;return lt===A||ai>=R||ai<0||Tt&&Pi>=tt}function Yt(){var ce=Hn();if(Dt(ce))return $t(ce);nt=Ys(Yt,Xt(ce))}function $t(ce){return nt=A,At&&$?Rt(ce):($=q=A,it)}function Ue(){nt!==A&&el(nt),xt=0,$=lt=q=nt=A}function Fe(){return nt===A?it:$t(Hn())}function Xe(){var ce=Hn(),ai=Dt(ce);if($=arguments,q=this,lt=ce,ai){if(nt===A)return Ot(lt);if(Tt)return el(nt),nt=Ys(Yt,R),Rt(lt)}return nt===A&&(nt=Ys(Yt,R)),it}return Xe.cancel=Ue,Xe.flush=Fe,Xe}var dg=Vt(function(P,R){return Bh(P,1,R)}),cg=Vt(function(P,R,U){return Bh(P,Qe(R)||0,U)});function vg(P){return yi(P,x)}function jn(P,R){if(typeof P!="function"||R!=null&&typeof R!="function")throw new je(c);var U=function(){var $=arguments,q=R?R.apply(this,$):$[0],tt=U.cache;if(tt.has(q))return tt.get(q);var it=P.apply(this,$);return U.cache=tt.set(q,it)||tt,it};return U.cache=new(jn.Cache||mi),U}jn.Cache=mi;function Kn(P){if(typeof P!="function")throw new je(c);return function(){var R=arguments;switch(R.length){case 0:return!P.call(this);case 1:return!P.call(this,R[0]);case 2:return!P.call(this,R[0],R[1]);case 3:return!P.call(this,R[0],R[1],R[2])}return!P.apply(this,R)}}function pg(P){return Vl(2,P)}var gg=ip(function(P,R){R=R.length==1&&Nt(R[0])?ne(R[0],Ne(Lt())):ne(Ee(R,1),Ne(Lt()));var U=R.length;return Vt(function($){for(var q=-1,tt=Ae($.length,U);++q=R}),qi=Uh(function(){return arguments}())?Uh:function(P){return ue(P)&&kt.call(P,"callee")&&!Ah.call(P,"callee")},Nt=ct.isArray,Og=ah?Ne(ah):Uv;function Oe(P){return P!=null&&$n(P.length)&&!Ci(P)}function de(P){return ue(P)&&Oe(P)}function Dg(P){return P===!0||P===!1||ue(P)&&we(P)==H}var Ni=Kc||Ha,Ig=oh?Ne(oh):Xv;function Bg(P){return ue(P)&&P.nodeType===1&&!Hs(P)}function bg(P){if(P==null)return!0;if(Oe(P)&&(Nt(P)||typeof P=="string"||typeof P.splice=="function"||Ni(P)||xs(P)||qi(P)))return!P.length;var R=Me(P);if(R==rt||R==Et)return!P.size;if(Ws(P))return!ha(P).length;for(var U in P)if(kt.call(P,U))return!1;return!0}function Ng(P,R){return Us(P,R)}function Gg(P,R,U){U=typeof U=="function"?U:A;var $=U?U(P,R):A;return $===A?Us(P,R,A,U):!!$}function Ba(P){if(!ue(P))return!1;var R=we(P);return R==k||R==Q||typeof P.message=="string"&&typeof P.name=="string"&&!Hs(P)}function zg(P){return typeof P=="number"&&wh(P)}function Ci(P){if(!ae(P))return!1;var R=we(P);return R==et||R==st||R==W||R==Pt}function $l(P){return typeof P=="number"&&P==Ut(P)}function $n(P){return typeof P=="number"&&P>-1&&P%1==0&&P<=G}function ae(P){var R=typeof P;return P!=null&&(R=="object"||R=="function")}function ue(P){return P!=null&&typeof P=="object"}var Zl=hh?Ne(hh):Wv;function Ug(P,R){return P===R||oa(P,R,Pa(R))}function Xg(P,R,U){return U=typeof U=="function"?U:A,oa(P,R,Pa(R),U)}function Vg(P){return Jl(P)&&P!=+P}function Wg(P){if(Ap(P))throw new bt(b);return Xh(P)}function Yg(P){return P===null}function Hg(P){return P==null}function Jl(P){return typeof P=="number"||ue(P)&&we(P)==ot}function Hs(P){if(!ue(P)||we(P)!=at)return!1;var R=Tn(P);if(R===null)return!0;var U=kt.call(R,"constructor")&&R.constructor;return typeof U=="function"&&U instanceof U&&gn.call(U)==Xc}var ba=lh?Ne(lh):Yv;function jg(P){return $l(P)&&P>=-G&&P<=G}var Ql=uh?Ne(uh):Hv;function Zn(P){return typeof P=="string"||!Nt(P)&&ue(P)&&we(P)==vt}function ze(P){return typeof P=="symbol"||ue(P)&&we(P)==St}var xs=fh?Ne(fh):jv;function Kg(P){return P===A}function $g(P){return ue(P)&&Me(P)==Mt}function Zg(P){return ue(P)&&we(P)==It}var Jg=zn(la),Qg=zn(function(P,R){return P<=R});function kl(P){if(!P)return[];if(Oe(P))return Zn(P)?si(P):Le(P);if(Os&&P[Os])return Rc(P[Os]());var R=Me(P),U=R==rt?Qr:R==Et?cn:ys;return U(P)}function Ei(P){if(!P)return P===0?P:0;if(P=Qe(P),P===N||P===-N){var R=P<0?-1:1;return R*V}return P===P?P:0}function Ut(P){var R=Ei(P),U=R%1;return R===R?U?R-U:R:0}function ql(P){return P?Zi(Ut(P),0,K):0}function Qe(P){if(typeof P=="number")return P;if(ze(P))return j;if(ae(P)){var R=typeof P.valueOf=="function"?P.valueOf():P;P=ae(R)?R+"":R}if(typeof P!="string")return P===0?P:+P;P=mh(P);var U=Od.test(P);return U||Id.test(P)?fc(P.slice(2),U?2:8):Ld.test(P)?j:+P}function _l(P){return li(P,De(P))}function kg(P){return P?Zi(Ut(P),-G,G):P===0?P:0}function Qt(P){return P==null?"":Ge(P)}var qg=ps(function(P,R){if(Ws(R)||Oe(R)){li(R,Te(R),P);return}for(var U in R)kt.call(R,U)&&Ns(P,U,R[U])}),tu=ps(function(P,R){li(R,De(R),P)}),Jn=ps(function(P,R,U,$){li(R,De(R),P,$)}),_g=ps(function(P,R,U,$){li(R,Te(R),P,$)}),tm=Ti(ia);function em(P,R){var U=vs(P);return R==null?U:Dh(U,R)}var im=Vt(function(P,R){P=te(P);var U=-1,$=R.length,q=$>2?R[2]:A;for(q&&Re(R[0],R[1],q)&&($=1);++U<$;)for(var tt=R[U],it=De(tt),nt=-1,lt=it.length;++nt1),tt}),li(P,Ca(P),U),$&&(U=$e(U,o|r|n,cp));for(var q=R.length;q--;)va(U,R[q]);return U});function Tm(P,R){return iu(P,Kn(Lt(R)))}var Sm=Ti(function(P,R){return P==null?{}:Zv(P,R)});function iu(P,R){if(P==null)return{};var U=ne(Ca(P),function($){return[$]});return R=Lt(R),$h(P,U,function($,q){return R($,q[0])})}function Cm(P,R,U){R=Bi(R,P);var $=-1,q=R.length;for(q||(q=1,P=A);++$R){var $=P;P=R,R=$}if(U||P%1||R%1){var q=Rh();return Ae(P+q*(R-P+uc("1e-"+((q+"").length-1))),R)}return fa(P,R)}var Im=gs(function(P,R,U){return R=R.toLowerCase(),P+(U?ru(R):R)});function ru(P){return za(Qt(P).toLowerCase())}function au(P){return P=Qt(P),P&&P.replace(bd,Ec).replace(tc,"")}function Bm(P,R,U){P=Qt(P),R=Ge(R);var $=P.length;U=U===A?$:Zi(Ut(U),0,$);var q=U;return U-=R.length,U>=0&&P.slice(U,q)==R}function bm(P){return P=Qt(P),P&&pd.test(P)?P.replace(Go,Pc):P}function Nm(P){return P=Qt(P),P&&Sd.test(P)?P.replace(Ir,"\\$&"):P}var Gm=gs(function(P,R,U){return P+(U?"-":"")+R.toLowerCase()}),zm=gs(function(P,R,U){return P+(U?" ":"")+R.toLowerCase()}),Um=ll("toLowerCase");function Xm(P,R,U){P=Qt(P),R=Ut(R);var $=R?us(P):0;if(!R||$>=R)return P;var q=(R-$)/2;return Gn(Pn(q),U)+P+Gn(En(q),U)}function Vm(P,R,U){P=Qt(P),R=Ut(R);var $=R?us(P):0;return R&&$>>0,U?(P=Qt(P),P&&(typeof R=="string"||R!=null&&!ba(R))&&(R=Ge(R),!R&&ls(P))?bi(si(P),0,U):P.split(R,U)):[]}var Zm=gs(function(P,R,U){return P+(U?" ":"")+za(R)});function Jm(P,R,U){return P=Qt(P),U=U==null?0:Zi(Ut(U),0,P.length),R=Ge(R),P.slice(U,U+R.length)==R}function Qm(P,R,U){var $=_.templateSettings;U&&Re(P,R,U)&&(R=A),P=Qt(P),R=Jn({},R,$,gl);var q=Jn({},R.imports,$.imports,gl),tt=Te(q),it=Jr(q,tt),nt,lt,xt=0,yt=R.interpolate||hn,Tt="__p += '",At=kr((R.escape||hn).source+"|"+yt.source+"|"+(yt===zo?Fd:hn).source+"|"+(R.evaluate||hn).source+"|$","g"),Rt="//# sourceURL="+(kt.call(R,"sourceURL")?(R.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rc+"]")+` -`;P.replace(At,function(Dt,Yt,$t,Ue,Fe,Xe){return $t||($t=Ue),Tt+=P.slice(xt,Xe).replace(Nd,Ac),Yt&&(nt=!0,Tt+=`' + -__e(`+Yt+`) + -'`),Fe&&(lt=!0,Tt+=`'; -`+Fe+`; -__p += '`),$t&&(Tt+=`' + -((__t = (`+$t+`)) == null ? '' : __t) + -'`),xt=Xe+Dt.length,Dt}),Tt+=`'; -`;var Ot=kt.call(R,"variable")&&R.variable;if(!Ot)Tt=`with (obj) { -`+Tt+` -} -`;else if(wd.test(Ot))throw new bt(m);Tt=(lt?Tt.replace(ci,""):Tt).replace(vi,"$1").replace(pi,"$1;"),Tt="function("+(Ot||"obj")+`) { -`+(Ot?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(nt?", __e = _.escape":"")+(lt?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+Tt+`return __p -}`;var Xt=hu(function(){return Jt(tt,Rt+"return "+Tt).apply(A,it)});if(Xt.source=Tt,Ba(Xt))throw Xt;return Xt}function km(P){return Qt(P).toLowerCase()}function qm(P){return Qt(P).toUpperCase()}function _m(P,R,U){if(P=Qt(P),P&&(U||R===A))return mh(P);if(!P||!(R=Ge(R)))return P;var $=si(P),q=si(R),tt=xh($,q),it=yh($,q)+1;return bi($,tt,it).join("")}function tx(P,R,U){if(P=Qt(P),P&&(U||R===A))return P.slice(0,Sh(P)+1);if(!P||!(R=Ge(R)))return P;var $=si(P),q=yh($,si(R))+1;return bi($,0,q).join("")}function ex(P,R,U){if(P=Qt(P),P&&(U||R===A))return P.replace(Br,"");if(!P||!(R=Ge(R)))return P;var $=si(P),q=xh($,si(R));return bi($,q).join("")}function ix(P,R){var U=T,$=C;if(ae(R)){var q="separator"in R?R.separator:q;U="length"in R?Ut(R.length):U,$="omission"in R?Ge(R.omission):$}P=Qt(P);var tt=P.length;if(ls(P)){var it=si(P);tt=it.length}if(U>=tt)return P;var nt=U-us($);if(nt<1)return $;var lt=it?bi(it,0,nt).join(""):P.slice(0,nt);if(q===A)return lt+$;if(it&&(nt+=lt.length-nt),ba(q)){if(P.slice(nt).search(q)){var xt,yt=lt;for(q.global||(q=kr(q.source,Qt(Uo.exec(q))+"g")),q.lastIndex=0;xt=q.exec(yt);)var Tt=xt.index;lt=lt.slice(0,Tt===A?nt:Tt)}}else if(P.indexOf(Ge(q),nt)!=nt){var At=lt.lastIndexOf(q);At>-1&&(lt=lt.slice(0,At))}return lt+$}function sx(P){return P=Qt(P),P&&vd.test(P)?P.replace(No,Dc):P}var nx=gs(function(P,R,U){return P+(U?" ":"")+R.toUpperCase()}),za=ll("toUpperCase");function ou(P,R,U){return P=Qt(P),R=U?A:R,R===A?wc(P)?bc(P):xc(P):P.match(R)||[]}var hu=Vt(function(P,R){try{return be(P,A,R)}catch(U){return Ba(U)?U:new bt(U)}}),rx=Ti(function(P,R){return He(R,function(U){U=ui(U),xi(P,U,Da(P[U],P))}),P});function ax(P){var R=P==null?0:P.length,U=Lt();return P=R?ne(P,function($){if(typeof $[1]!="function")throw new je(c);return[U($[0]),$[1]]}):[],Vt(function($){for(var q=-1;++qG)return[];var U=K,$=Ae(P,K);R=Lt(R),P-=K;for(var q=Zr($,R);++U0||R<0)?new Ht(U):(P<0?U=U.takeRight(-P):P&&(U=U.drop(P)),R!==A&&(R=Ut(R),U=R<0?U.dropRight(-R):U.take(R-P)),U)},Ht.prototype.takeRightWhile=function(P){return this.reverse().takeWhile(P).reverse()},Ht.prototype.toArray=function(){return this.take(K)},hi(Ht.prototype,function(P,R){var U=/^(?:filter|find|map|reject)|While$/.test(R),$=/^(?:head|last)$/.test(R),q=_[$?"take"+(R=="last"?"Right":""):R],tt=$||/^find/.test(R);q&&(_.prototype[R]=function(){var it=this.__wrapped__,nt=$?[1]:arguments,lt=it instanceof Ht,xt=nt[0],yt=lt||Nt(it),Tt=function(Yt){var $t=q.apply(_,Ri([Yt],nt));return $&&At?$t[0]:$t};yt&&U&&typeof xt=="function"&&xt.length!=1&&(lt=yt=!1);var At=this.__chain__,Rt=!!this.__actions__.length,Ot=tt&&!At,Xt=lt&&!Rt;if(!tt&&yt){it=Xt?it:new Ht(this);var Dt=P.apply(it,nt);return Dt.__actions__.push({func:Wn,args:[Tt],thisArg:A}),new Ke(Dt,At)}return Ot&&Xt?P.apply(this,nt):(Dt=this.thru(Tt),Ot?$?Dt.value()[0]:Dt.value():Dt)})}),He(["pop","push","shift","sort","splice","unshift"],function(P){var R=vn[P],U=/^(?:push|sort|unshift)$/.test(P)?"tap":"thru",$=/^(?:pop|shift)$/.test(P);_.prototype[P]=function(){var q=arguments;if($&&!this.__chain__){var tt=this.value();return R.apply(Nt(tt)?tt:[],q)}return this[U](function(it){return R.apply(Nt(it)?it:[],q)})}}),hi(Ht.prototype,function(P,R){var U=_[R];if(U){var $=U.name+"";kt.call(cs,$)||(cs[$]=[]),cs[$].push({name:R,func:U})}}),cs[bn(A,s).name]=[{name:"wrapper",func:A}],Ht.prototype.clone=sv,Ht.prototype.reverse=nv,Ht.prototype.value=rv,_.prototype.at=B0,_.prototype.chain=b0,_.prototype.commit=N0,_.prototype.next=G0,_.prototype.plant=U0,_.prototype.reverse=X0,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=V0,_.prototype.first=_.prototype.head,Os&&(_.prototype[Os]=z0),_},Li=Nc();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ye._=Li,define(function(){return Li})):Hi?((Hi.exports=Li)._=Li,Xr._=Li):ye._=Li}).call(E)}),sd=class extends Set{constructor(E,S=!1){super(E),this.valuesAsFlags=S}};function qs(E){if(E instanceof Map)return Object.fromEntries([...E.entries()].map(([S,A])=>[S,qs(A)]));if(E instanceof Set)return Array.from(E.values()).map(qs);if(E instanceof sd)return{values:[...E.values()],valuesAsFlags:E.valuesAsFlags};if(typeof E=="object"){let S={};return Object.entries(E).forEach(([A,B])=>{S[A]=qs(B)}),S}else return E}Bo(bo(),1);var xS=Bo(bo(),1);function is(E,S){if(typeof E!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(E)}`);if(typeof S!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(S)}`);let A=(0,xS.cloneDeep)(E);for(let[B,I]of Object.entries(S))typeof I!="object"||I instanceof Set||A[B]===void 0?A[B]=I:A[B]=is(A[B],I);return A}function nd(E,S){if(!(E===void 0||typeof E!="object"))for(let A of Object.keys(E)){if(A===S)return E[A];let B=E[A];if(typeof B=="object"){let I=nd(B,S);if(I!==void 0)return I}}}var ka="@composite:",yS="@inherit:",TS=class{constructor(E,S,A){this.tiledClassToMembersMap=E,this.enumNameToValuesMap=S,this.parserOptions=A,this.memoiser=new Map}flattenMembers(E,S){return this.memoiser.has(E)?{[E]:this.memoiser.get(E)}:(this.memoiser.set(E,S.reduce((A,B)=>re(re({},A),this.flattenMemberProperty(B)),{})),{[E]:this.memoiser.get(E)})}flattenMemberProperty(E){var S;let A=(S=E.propertyType)!=null?S:E.propertytype;if(E.type==="class"){if(!this.memoiser.has(A)){let b=this.tiledClassToMembersMap.get(A).reduce((c,m)=>is(this.flattenMemberProperty(m),c),{});this.memoiser.set(A,b)}let B=this.memoiser.get(A),I=is(B,this.flattenValue(E.value,B));return this.checkIfShouldFlatten(E.name)?I:{[E.name.replace(ka,"")]:I}}else return this.enumNameToValuesMap.has(A)?this.enumNameToValuesMap.get(A).valuesAsFlags?{[E.name]:new Set(E.value.split(",").filter(B=>B!==""))}:{[E.name]:E.value}:{[E.name]:E.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(E,S){return Object.entries(E).reduce((A,[B,I])=>{if(typeof I!="object")return nd(S,B)instanceof Set?is({[B]:new Set(I.split(",").filter(b=>b!==""))},A):is({[B]:I},A);if(this.checkIfShouldFlatten(B))return is(this.flattenValue(I,S),A);{let b=B.replace(ka,"");return is({[b]:this.flattenValue(I,S)},A)}},{})}checkIfShouldFlatten(E){var S;return((S=this.parserOptions)==null?void 0:S.defaultComposite)===!0?E.startsWith(yS):!E.startsWith(ka)}},Uu=Bo(bo(),1),SS=class{constructor(E){this.flattener=E}flattenPropertiesOnObject(E){var S,A,B,I;return Vi(re(re({},this.flattener.memoisedFlattenedProperties.get((S=E.class)!=null?S:E.type)),(A=E.properties)==null?void 0:A.reduce((b,c)=>re(re({},b),this.flattener.flattenMemberProperty(c)),{})),{name:E.name,id:E.id,class:(I=(B=E.class)!=null?B:E.type)!=null?I:null,x:E.x,y:E.y})}flattenPropertiesOnTile(E){var S,A,B,I;return Vi(re(re({},this.flattener.memoisedFlattenedProperties.get((S=E.class)!=null?S:E.type)),(A=E.properties)==null?void 0:A.reduce((b,c)=>re(re({},b),this.flattener.flattenMemberProperty(c)),{})),{id:E.id,class:(I=(B=E.class)!=null?B:E.type)!=null?I:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([E,S])=>[E,(0,Uu.cloneDeep)(S)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([E,S])=>[E,(0,Uu.cloneDeep)(S)]))}toJSON(){return JSON.stringify({customTypes:qs(this.getCustomTypesMap()),enums:qs(this.getEnumsMap())},null,4)}};function CS(E,S){let A=new Map(E.propertyTypes.filter(b=>b.type==="enum").map(b=>[b.name,new sd(b.values,b.valuesAsFlags)])),B=new Map(E.propertyTypes.filter(b=>b.type==="class").map(b=>[b.name,b.members])),I=new TS(B,A,S);return B.forEach((b,c)=>{I.flattenMembers(c,b)}),new SS(I)}var ES={parse:CS},rd=class{constructor(E,S){this.phaserTile=E,this.tiledProject=S}getProperty(E){var S,A;let B={};if(this.tiledProject){let I=ES.parse(this.tiledProject),b=this.getType();if(b){let c=(S=I.getCustomTypesMap())==null?void 0:S.get(b);if(c)for(let[m,t]of Object.entries(c))B[m]=t}}return(A=this.phaserTile.properties[E])!=null?A:B[E]}hasProperty(E){return this.getProperty(E)!=null}getType(){var E,S;return(S=(E=this.phaserTile.tileset)==null?void 0:E.tileData[this.phaserTile.index-1])==null?void 0:S.type}},PS=class{constructor(E,S){this.phaserTilemapLayer=E,this.tiledProject=S}getName(){return this.phaserTilemapLayer.layer.name}getProperty(E){let S=this.phaserTilemapLayer.layer.properties,A=S?.find(B=>B.name==E);return A?.value}hasProperty(E){return this.getProperty(E)!=null}isCharLayer(){return this.hasProperty(sr)}getData(){return this.phaserTilemapLayer.layer.data.map(E=>E.map(S=>new rd(S,this.tiledProject)))}},AS=class{constructor(E,S){this.phaserTilemap=E,this.tiledProject=S;for(let A of this.phaserTilemap.layers)if(A.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${A.name}' has no 'tilemapLayer'. This can happen if you call 'createLayer' with the wrong layer ID.`)}getTileWidth(){return this.phaserTilemap.tileWidth}getTileHeight(){return this.phaserTilemap.tileHeight}getWidth(){return this.phaserTilemap.width}getHeight(){return this.phaserTilemap.height}getOrientation(){return this.phaserTilemap.orientation==Phaser.Tilemaps.Orientation.ISOMETRIC.toString()?"isometric":"orthogonal"}getLayers(){return this.phaserTilemap.layers.map(E=>new PS(E.tilemapLayer,this.tiledProject))}hasTileAt(E,S,A){return!!this.phaserTilemap.hasTileAt(E,S,A)}getTileAt(E,S,A){let B=this.phaserTilemap.getTileAt(E,S,!1,A);if(B)return new rd(B,this.tiledProject)}},ad=class po{constructor(S){this.scene=S,this.geHeadless=new oS(!1),this.isCreatedInternal=!1,po.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${kf}`),po.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(S){return this.geHeadless.getCharLayer(S)}getTransition(S,A){return this.geHeadless.getTransition(S,A)}setTransition(S,A,B){this.geHeadless.setTransition(S,A,B)}create(S,A){this.geHeadless.create(new AS(S,A.tiledProject),A),this.isCreatedInternal=!0,this.gridCharacters=new Map;let B=this.setConfigDefaults(A);this.config=B,this.gridTilemap=new vo(S),this.addCharacters()}getPosition(S){return this.geHeadless.getPosition(S)}move(S,A){this.geHeadless.move(S,A)}moveRandomly(S,A=0,B=-1){this.geHeadless.moveRandomly(S,A,B)}getMovement(S){return this.geHeadless.getMovement(S)}moveTo(S,A,B){return this.geHeadless.moveTo(S,A,B)}stopMovement(S){this.geHeadless.stopMovement(S)}setSpeed(S,A){this.geHeadless.setSpeed(S,A)}getSpeed(S){return this.geHeadless.getSpeed(S)}setContainer(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);I.setContainer(A)}getContainer(S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(S);if(!B)throw this.createCharUnknownErr(S);return B.getContainer()}getOffsetX(S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(S);if(!B)throw this.createCharUnknownErr(S);return B.getOffsetX()}setOffsetX(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);I.setOffsetX(A)}getOffsetY(S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(S);if(!B)throw this.createCharUnknownErr(S);return B.getOffsetY()}setOffsetY(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);I.setOffsetY(A)}collidesWithTiles(S){return this.geHeadless.collidesWithTiles(S)}getWalkingAnimationMapping(S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(S);if(!B)throw this.createCharUnknownErr(S);let I=B.getAnimation();return I?.getWalkingAnimationMapping()}hasLayerOverlay(){var S;return this.initGuard(),!!((S=this.config)!=null&&S.layerOverlay)}setWalkingAnimationMapping(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);let b=I.getAnimation();b?.setWalkingAnimationMapping(A)}update(S,A){if(this.isCreatedInternal&&this.gridCharacters)for(let[B,I]of this.gridCharacters)I.update(A);this.geHeadless.update(S,A)}addCharacter(S){this.geHeadless.addCharacter(S),this.addCharacterInternal(S)}hasCharacter(S){return this.geHeadless.hasCharacter(S)}removeCharacter(S){var A,B;this.initGuard();let I=(A=this.gridCharacters)==null?void 0:A.get(S);if(!I)throw this.createCharUnknownErr(S);I.destroy(),(B=this.gridCharacters)==null||B.delete(S),this.geHeadless.removeCharacter(S)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let S of this.gridCharacters.keys())this.removeCharacter(S);this.geHeadless.removeAllCharacters()}}getAllCharacters(S){return this.geHeadless.getAllCharacters(S)}getLabels(S){return this.geHeadless.getLabels(S)}addLabels(S,A){this.geHeadless.addLabels(S,A)}removeLabels(S,A){this.geHeadless.removeLabels(S,A)}clearLabels(S){this.geHeadless.clearLabels(S)}follow(S,A,B,I){let b;B===void 0?b={distance:0,closestPointIfBlocked:!1}:typeof B=="number"?(b={distance:B,closestPointIfBlocked:!1},I&&(b.closestPointIfBlocked=!0)):b=B,this.geHeadless.follow(S,A,b)}isMoving(S){return this.geHeadless.isMoving(S)}getFacingDirection(S){return this.geHeadless.getFacingDirection(S)}getFacingPosition(S){return this.geHeadless.getFacingPosition(S)}turnTowards(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);I.turnTowards(A),this.geHeadless.turnTowards(S,A)}getCharactersAt(S,A){return this.geHeadless.getCharactersAt(S,A)}setPosition(S,A,B){this.geHeadless.setPosition(S,A,B)}getSprite(S){var A;this.initGuard();let B=(A=this.gridCharacters)==null?void 0:A.get(S);if(!B)throw this.createCharUnknownErr(S);return B.getSprite()}setSprite(S,A){var B;this.initGuard();let I=(B=this.gridCharacters)==null?void 0:B.get(S);if(!I)throw this.createCharUnknownErr(S);A.setOrigin(0,0),I.setSprite(A)}isBlocked(S,A,B=["geDefault"]){return this.geHeadless.isBlocked(S,A,B)}isTileBlocked(S,A){return this.geHeadless.isTileBlocked(S,A)}getCollisionGroups(S){return this.geHeadless.getCollisionGroups(S)}setCollisionGroups(S,A){this.geHeadless.setCollisionGroups(S,A)}getIgnoreCollisionGroups(S){return this.geHeadless.getIgnoreCollisionGroups(S)}setIgnoreCollisionGroups(S,A){this.geHeadless.setIgnoreCollisionGroups(S,A)}getTilePosInDirection(S,A,B){return this.geHeadless.getTilePosInDirection(S,A,B)}findShortestPath(S,A,B={}){return this.geHeadless.findShortestPath(S,A,B)}steppedOn(S,A,B){return this.geHeadless.steppedOn(S,A,B)}characterShifted(){return this.geHeadless.characterShifted()}movementStarted(){return this.geHeadless.movementStarted()}movementStopped(){return this.geHeadless.movementStopped()}directionChanged(){return this.geHeadless.directionChanged()}positionChangeStarted(){return this.geHeadless.positionChangeStarted()}positionChangeFinished(){return this.geHeadless.positionChangeFinished()}getMovementProgress(S){return this.geHeadless.getMovementProgress(S)}rebuildTileCollisionCache(S,A,B,I){this.geHeadless.rebuildTileCollisionCache(S,A,B,I)}addQueueMovements(S,A,B){this.geHeadless.addQueueMovements(S,A,B)}getEnqueuedMovements(S){return this.geHeadless.getEnqueuedMovements(S)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(S){return this.geHeadless.clearEnqueuedMovements(S)}getState(){return{characters:this.geHeadless.getState().characters.map(S=>Vi(re({},S),{offsetX:this.getOffsetX(S.id),offsetY:this.getOffsetY(S.id)}))}}setState(S){if(this.geHeadless.setState(S),this.gridCharacters)for(let A of S.characters){let B=this.gridCharacters.get(A.id);B&&(B.setOffsetX(A.offsetX),B.setOffsetY(A.offsetY))}}getTileCost(S,A,B){return this.initGuard(),this.geHeadless.getTileCost(S,A,B)}setConfigDefaults(S){return re({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1},S)}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var S;(S=this.config)==null||S.characters.forEach(A=>this.addCharacterInternal(A))}createCharUnknownErr(S){return new Error(`Character unknown: ${S}`)}addCharacterInternal(S){var A;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let B=new WT(S,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(A=this.gridCharacters)==null||A.set(S.id,B)}};ad.welcomeMessagePrinted=!1;var MS=ad,wS=MS;/*! Bundled license information: - -tiled-property-flattener/dist/tiled_property_flattener.min.js: - (*! Bundled license information: - - lodash/lodash.js: - (** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - *) - *) -*/class ss{constructor(S,A=4){this.bounds=S,this.capacity=A,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:S,yMin:A,xMax:B,yMax:I}=this.bounds,b=(B-S)/2,c=(I-A)/2,m=S,t=A;this.northeast=new ss({xMin:m+b,xMax:m+2*b,yMin:A,yMax:t+c},this.capacity),this.northwest=new ss({xMin:S,xMax:m+b,yMin:A,yMax:t+c},this.capacity),this.southeast=new ss({xMin:m+b,xMax:m+2*b,yMin:t+c,yMax:t+2*c},this.capacity),this.southwest=new ss({xMin:S,xMax:m+b,yMin:t+c,yMax:t+2*c},this.capacity),this.divided=!0}insert(S){return this.contains(S.bounds)?this.points.length=A&&S.xMax<=I&&S.yMin>=B&&S.yMax<=b}generateCacheKey(S){const{xMin:A,xMax:B,yMin:I,yMax:b}=S;return`${A},${B},${I},${b}`}queryRange(S,A=[]){if(!this.intersects(S))return A;for(const B of this.points)this.isWithinBounds(B.bounds,S)&&A.push(B);return this.divided&&(this.northwest?.queryRange(S,A),this.northeast?.queryRange(S,A),this.southwest?.queryRange(S,A),this.southeast?.queryRange(S,A)),A}query(S,A=[]){const B=`${S.x},${S.y}`,I=this.cache.get(B);if(I)return I;if(!this.intersects({xMin:S.x,xMax:S.x,yMin:S.y,yMax:S.y}))return A;for(const b of this.points)this.isWithinRange(S,b.bounds)&&A.push(b);return this.divided&&(this.northwest?.query(S,A),this.northeast?.query(S,A),this.southwest?.query(S,A),this.southeast?.query(S,A)),this.cache.set(B,A),A}intersects(S){const{xMin:A,yMin:B,xMax:I,yMax:b}=this.bounds;return!(S.xMin>I||S.xMaxb||S.yMax=A.xMin&&S.xMin<=A.xMax&&S.yMax>=A.yMin&&S.yMin<=A.yMax}isWithinRange(S,A){return S.x>=A.xMin&&S.x<=A.xMax&&S.y>=A.yMin&&S.y<=A.yMax}}const RS=({styleClass:E,size:S=32,color:A="#000",onClick:B,...I})=>ut.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:S,height:S,className:E,onClick:B,...I,children:ut.jsx("path",{stroke:A,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11.493 8.757L8.039 5.304 5.374 7.969l3.454 3.453-2.59 2.59 7.797.004-.017-7.784-2.525 2.525zm11.679 2.665l3.454-3.453-2.665-2.665-3.454 3.453-2.525-2.525-.017 7.784 7.797-.004-2.59-2.59zM8.828 20.578l-3.454 3.453 2.665 2.665 3.454-3.453 2.526 2.525.017-7.784-7.797.004 2.589 2.59zm16.934-2.59l-7.797-.004.017 7.784 2.525-2.525 3.454 3.453 2.665-2.665-3.454-3.453 2.59-2.59z"})}),FS=({styleClass:E,size:S=24,color:A="#000",onClick:B,...I})=>ut.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:S,height:S,className:E,onClick:B,...I,children:ut.jsx("path",{stroke:A,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8.5V4m0 0h4.5M4 4l5.5 5.5m10.5-1V4m0 0h-4.5M20 4l-5.5 5.5M4 15.5V20m0 0h4.5M4 20l5.5-5.5m10.5 1V20m0 0h-4.5m4.5 0l-5.5-5.5"})});class od{constructor(S,A,B){this.scene=S,this.gridEngine=A,this.quadtree=B,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers(),this.tooltip=this.scene.add.text(0,0,"Press [F]",{font:"16px Arial",backgroundColor:"#000000"}).setDepth(4).setPadding(3,2,2,3).setVisible(!1)}initializeWASDKeys(){const S=this.scene.input.keyboard;S&&(this.wasdKeys={W:S.addKey(Phaser.Input.Keyboard.KeyCodes.W),A:S.addKey(Phaser.Input.Keyboard.KeyCodes.A),S:S.addKey(Phaser.Input.Keyboard.KeyCodes.S),D:S.addKey(Phaser.Input.Keyboard.KeyCodes.D)})}handleConsume(S){const A=zi(S);A&&A.consumable?(Ai.log(`Consuming item: ${A.name}`),jx(A),fu(A.id)):Ai.log(`Item ${S} is not consumable`)}handleEquip(S){const A=zi(S);A&&(Ai.log(`Equipping item: ${A.name}`),Kx("weapon",A.id))}handleUnequip(S){const A=zi(S);A&&(Ai.log(`Unequipping item: ${A.name}`),$x("weapon"))}handleDiscard(S){Ai.log(`Discarding item: ${S}`),fu(S)}handleView(S){const A=zi(S);if(A&&(Ai.log(`Viewing item: ${A.name} with ${A.slug}`),A.slug)){const B=`https://kbve.com/${A.slug}#${A.name.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")}`;window.open(B,"_blank")}}registerEventHandlers(){jt.on("itemAction",this.handleItemAction.bind(this));//! Broken -jt.on("playerMove",this.handlePlayerMove.bind(this)),jt.on("playerReward",this.handlePlayerReward.bind(this)),jt.on("playerDamage",this.handlePlayerCombatDamage.bind(this))}handleItemAction(S){if(S)switch(Ai.log(`Preparing Action: ${S.itemId} with ${S.action}`),S.action){case"consume":this.handleConsume(S.itemId);break;case"equip":this.handleEquip(S.itemId);break;case"unequip":this.handleUnequip(S.itemId);break;case"discard":this.handleDiscard(S.itemId);break;case"view":this.handleView(S.itemId);break;default:Ai.log(`Unknown action: ${S.action}`)}}handlePlayerReward(S){Ai.log("Rewarding the player"),S&&(jt.emit("notification",{title:"Success",message:S.message,notificationType:_s.success}),Zx(S.item))}handlePlayerCombatDamage(S){S&&(Jx(parseInt(S.damage)),jt.emit("notification",{title:"Danger",message:`You taken ${S.damage} points of damage!`,notificationType:_s.danger}))}handlePlayerMove(S){S&&this.gridEngine.moveTo("player",{x:S.x,y:S.y})}checkForNearbyObjects(){const A=this.gridEngine.getPosition("player"),B=A.x*48,I=A.y*48;this.quadtree.query(A).length>0?this.tooltip.setPosition(B,I-60).setVisible(!0):this.tooltip.setVisible(!1)}handleMovement(){if(!this.cursor)return;const S=this.cursor,A=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const B=this.gridEngine.getPosition("player"),I=this.quadtree.query(B);for(const b of I)b.action()}(S.left.isDown||A.A.isDown)&&(S.up.isDown||A.W.isDown)?this.gridEngine.move("player","up-left"):(S.left.isDown||A.A.isDown)&&(S.down.isDown||A.S.isDown)?this.gridEngine.move("player","down-left"):(S.right.isDown||A.D.isDown)&&(S.up.isDown||A.W.isDown)?this.gridEngine.move("player","up-right"):(S.right.isDown||A.D.isDown)&&(S.down.isDown||A.S.isDown)?this.gridEngine.move("player","down-right"):S.left.isDown||A.A.isDown?this.gridEngine.move("player","left"):S.right.isDown||A.D.isDown?this.gridEngine.move("player","right"):S.up.isDown||A.W.isDown?this.gridEngine.move("player","up"):(S.down.isDown||A.S.isDown)&&this.gridEngine.move("player","down"),this.checkForNearbyObjects()}}function hd(E){return+E[E.length-1]}function ld(E){return E.startsWith("monster_bird_")&&!E.startsWith("monster_bird_shadow")}function ud(E,S,A,B,I){const b=[];for(let c=0;c<10;c++){const m=E.add.sprite(0,0,"monster_bird");m.setCrop(S,A,B,I),m.scale=3,b.push(m)}return b}function fd(E){return ud(E,0,0,61,47)}function dd(E){return ud(E,22,47,16,10)}function cd(E){E.anims.create({key:"bird",frames:E.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class LS extends Fr.Scene{mainMenuButtonImage;mainMenuButtonText;constructor(){super("Preloader")}preload(){this.load.image("mainBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.image("scroll","https://kbve.com/assets/img/fishchip/scroll.webp"),this.load.audio("music","https://kbve.com/assets/img/fishchip/bg.ogg"),this.load.image("creditsBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.audio("type","https://kbve.com/assets/img/fishchip/type.mp3"),this.load.spritesheet("fishing","https://kbve.com/assets/img/fishchip/animate.png",{frameWidth:800,frameHeight:600}),this.load.image("fish","https://kbve.com/assets/img/letter_logo.png"),this.load.image("background","https://kbve.com/assets/img/fishchip/scaled_fish_menu_minigame.webp"),this.load.image("tiles","https://kbve.com/assets/img/fishchip/desert_tileset_1.png"),this.load.image("cloud-city-tiles","/assets/map/cloud_tileset.png"),this.load.tilemapTiledJSON("cloud-city-map-large","/assets/map/cloud_city_large.json"),this.load.tilemapTiledJSON("cloud-city-map","https://kbve.com/assets/img/fishchip/cloud_city.json"),this.load.spritesheet("player","https://kbve.com/assets/img/fishchip/chip_charactersheet_warmer.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("knights","/assets/entity/knights.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("jacko","/assets/entity/jacko.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("monks","/assets/entity/monks.png",{frameWidth:52,frameHeight:72}),Qx()}async create(){await Zs.initializeDatabase(),this.sound.get("music")?.isPlaying||this.sound.add("music",{loop:!0,volume:.1}).play(),this.add.image(480,480,"mainBg").setScale(.1),this.mainMenuButtonImage=this.add.image(480,480,"scroll").setAlpha(.9).setScale(.7,.2).setInteractive({useHandCursor:!0}),this.mainMenuButtonText=this.add.text(480,480,"Start Game",{fontFamily:"Arial Black",fontSize:50,color:"#ffffff",stroke:"#000000",strokeThickness:6}).setOrigin(.5).setInteractive({useHandCursor:!0}),this.mainMenuButtonText.on("pointerdown",()=>{this.scene.start("SandCity")},this)}}let a2=class extends Cs.GameObjects.Sprite{textBubble;tooltip};class OS extends Fr.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"SandCity"});const S={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new ss(S)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),jt.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${kx()}`,notificationType:_s.success})}async create(){const S=this.make.tilemap({key:"cloud-city-map"});S.addTilesetImage("Cloud City","tiles");for(let I=0;I({id:"monster_bird_"+b,sprite:I,startPosition:{x:7,y:7+b},speed:5,collides:!1})),...this.monsterBirdShadows.map((I,b)=>({id:"monster_bird_shadow_"+b,sprite:I,startPosition:{x:7,y:7+b},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(S,B),this.loadRanges(),this.playerController=new od(this,this.gridEngine,this.quadtree),qx(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!",3e3),await Zs.loadCharacter(this,"01J2DT4G871KJ0VNSHCNC5REDM",6,6),await Zs.loadCharacter(this,"01J2HCTMQ58JBMJGW9YA3FBQCG",8,8),await Zs.loadCharacter(this,"01J2HQJBMBGEEMWDBDWATRCY3T",8,15),this.gridEngine.moveRandomly("npc",1500,3),this.gridEngine.moveRandomly("fishNpc",1500,3);for(let I=0;I<10;I++)this.gridEngine.moveRandomly("monster_bird_"+I,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:I,exitTile:b,enterTile:c})=>{ld(I)&&this.gridEngine.moveTo("monster_bird_shadow_"+hd(I),{x:c.x,y:c.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const S=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const A={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};jt.emit("charEvent",A)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const A={message:"Sign does not have much to say.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};jt.emit("charEvent",A)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const A={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};jt.emit("charEvent",A)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const A={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};jt.emit("charEvent",A)}}];for(const A of S)this.quadtree.insert(A)}update(){this.playerController?.handleMovement()}}class h2 extends Cs.GameObjects.Sprite{textBubble}class DS extends Fr.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"CloudCity"});const S={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new ss(S)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57})}create(){const S=this.make.tilemap({key:"cloud-city-map-large"});S.addTilesetImage("cloud_tileset","cloud-city-tiles");for(let I=0;I({id:"monster_bird_"+b,sprite:I,startPosition:{x:7,y:7+b},speed:5,collides:!1})),...this.monsterBirdShadows.map((I,b)=>({id:"monster_bird_shadow_"+b,sprite:I,startPosition:{x:7,y:7+b},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(S,B),this.loadRanges(),this.playerController=new od(this,this.gridEngine,this.quadtree),_x(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let I=0;I<10;I++)this.gridEngine.moveRandomly("monster_bird_"+I,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:I,exitTile:b,enterTile:c})=>{ld(I)&&this.gridEngine.moveTo("monster_bird_shadow_"+hd(I),{x:c.x,y:c.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const S=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const A={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};jt.emit("charEvent",A,1e3)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const I={message:`The Database Response time: ${(await(await fetch("https://api.cryptothrone.com/api/v1/speed")).json()).message.time_ms} ms`,character_name:"Planets Be Scalin",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};jt.emit("charEvent",I,1e3)}catch(A){console.error("Error fetching data:",A);const B={message:"Sign does not have much to say. Failed to fetch response time.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};jt.emit("charEvent",B,1e3)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const A={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};jt.emit("charEvent",A,1e3)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const A={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};jt.emit("charEvent",A,1e3)}}];for(const A of S)this.quadtree.insert(A)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&du(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&du(this.fishNpcSprite)}}const IS=ar.div` - width: 100vw; - height: 100vh; -`;function BS(){const E=pe.useRef(null);return pe.useEffect(()=>{let S=null;if(E.current){const A=E.current,B={title:"CryptoThrone",render:{antialias:!1},scale:{mode:Cs.Scale.FIT,autoCenter:Cs.Scale.CENTER_BOTH,zoom:1},type:Cs.AUTO,transparent:!0,width:window.innerWidth,height:window.innerHeight,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:wS,mapping:"gridEngine"}]},scene:[LS,OS,DS],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!0}},parent:A};S=new Cs.Game(B);const I=()=>{S&&S.scale.resize(window.innerWidth,window.innerHeight)};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I),S&&S.destroy(!0)}}},[]),ut.jsx(IS,{children:ut.jsx("div",{className:"w-full h-full scrollbar-hide",ref:E})})}const Xu=rn({message:""}),bS=()=>{const E=di(Xu);pe.useEffect(()=>{const A=B=>{if(B){Xu.set(B);const I=document.querySelector("#hs-stacked-overlays");I&&(I.classList.remove("hidden"),I.classList.add("open"))}};return jt.on("charEvent",A),()=>{jt.off("charEvent",A)}},[]);const S=()=>{const A=document.querySelector("#hs-stacked-overlays");A&&(A.classList.add("hidden"),A.classList.remove("open"))};return ut.jsx(ut.Fragment,{children:ut.jsx("div",{id:"hs-stacked-overlays",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 hidden size-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:ut.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto",children:ut.jsxs("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover",style:{backgroundImage:`url(${E.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[ut.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[ut.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${E.character_name||"NPC"}`}),ut.jsx("img",{src:E.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),ut.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[ut.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[ut.jsx("h3",{className:"font-bold text-yellow-400",children:""}),ut.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:S,children:[ut.jsx("span",{className:"sr-only",children:"Close"}),ut.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ut.jsx("path",{d:"M18 6 6 18"}),ut.jsx("path",{d:"m6 6 12 12"})]})]})]}),ut.jsx("div",{className:"p-4 overflow-y-auto",children:ut.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:E.message||"No Message"})}),ut.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:ut.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:S,children:[ut.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),ut.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},Vu=({settingKey:E,label:S,collapseIcon:A=RS,expandIcon:B=FS})=>{const I=Gi(E),b=()=>Ts(E,!I);return ut.jsxs("button",{onClick:b,className:"bg-yellow-500 text-white text-sm p-2 rounded ml-2 flex items-center w-20 h-10",children:[I?ut.jsx(B,{className:"w-2"}):ut.jsx(A,{className:"w-4"}),ut.jsx("span",{className:"ml-2 text-xs",children:S})]})},NS=({stats:E})=>{const S=(A,B)=>{const I=typeof A=="string"?parseInt(A,10):A,b=typeof B=="string"?parseInt(B,10):B;return Math.min(I/b*100,100)};return ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),ut.jsxs("div",{className:"mb-2",children:[ut.jsx("p",{className:"text-sm text-green-400",children:`HP: ${E.health||"0"} / ${E.maxHealth}`}),ut.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:ut.jsx("div",{className:"bg-green-400 h-full rounded",style:{width:`${S(E.health,E.maxHealth)}%`}})})]}),ut.jsxs("div",{className:"mb-2",children:[ut.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${E.mana||"0"} / ${E.maxMana}`}),ut.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:ut.jsx("div",{className:"bg-blue-400 h-full rounded",style:{width:`${S(E.mana,E.maxMana)}%`}})})]}),ut.jsxs("div",{className:"mb-2",children:[ut.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${E.energy||"0"} / ${E.maxEnergy}`}),ut.jsx("div",{className:"w-full bg-gray-300 h-4 rounded",children:ut.jsx("div",{className:"bg-yellow-400 h-full rounded",style:{width:`${S(E.energy,E.maxEnergy)}%`}})})]})]})},GS=({settingKey:E,label:S})=>{const A=Gi(E),B=()=>{Ts(E,!A)};return ut.jsxs("label",{className:"flex items-center cursor-pointer",children:[ut.jsx("span",{className:"mr-2 text-sm",children:S}),ut.jsxs("div",{className:"relative",children:[ut.jsx("input",{type:"checkbox",className:"sr-only",checked:A,onChange:B}),ut.jsx("div",{className:"w-10 h-4 bg-gray-400 rounded-full shadow-inner"}),ut.jsx("div",{className:`absolute w-6 h-6 bg-white opacity-75 rounded-full shadow -left-1 -top-1 transition-transform ${A?"transform translate-x-full bg-yellow-500 !opacity-100":""}`})]})]})},zS=(E,S)=>{const A=zi(E);return A?ut.jsxs("div",{style:{top:S.y,left:S.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[ut.jsx("p",{className:"text-sm font-semibold",children:A.name}),ut.jsxs("p",{className:"text-xs",children:["Type: ",A.type]}),ut.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(A.bonuses)]}),ut.jsxs("p",{className:"text-xs",children:["Durability: ",A.durability]}),ut.jsxs("p",{className:"text-xs",children:["Weight: ",A.weight]})]}):null},US=(E,S,A,B)=>ut.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(E).map(I=>{const b=E[I];return XS(b,S,A,B)})}),XS=(E,S,A,B)=>{if(!E)return ut.jsx("li",{className:"text-sm relative flex items-center justify-center border border-gray-500 bg-gray-200",style:{width:"32px",height:"32px"}},`empty-${Math.random()}`);const I=zi(E);return I?ut.jsxs("li",{className:"text-sm relative",onMouseEnter:b=>S(I.id,b),onMouseLeave:A,onClick:b=>B(I.id,b),children:[I.name," (",I.type,") - Bonuses: ",JSON.stringify(I.bonuses)," - Durability: ",I.durability," - Weight: ",I.weight]},I.id):null},VS=(E,S,A,B)=>ut.jsx("ul",{className:"grid grid-cols-8 gap-1",children:E.map((I,b)=>{const c=zi(I);return c?ut.jsx("li",{className:"text-sm relative hover:scale-[1.3] transition ease-in-out duration-100",onMouseEnter:m=>S(c.id,m),onMouseLeave:A,onClick:m=>B(c.id,m),children:ut.jsx("img",{src:c.img,alt:c.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},b):null})}),WS=()=>ut.jsx("div",{className:"transition transform duration-1000 ease-in-out",children:ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Settings"}),ut.jsx("p",{className:"text-sm",children:"Additional settings can go here."}),ut.jsx(GS,{settingKey:"debugMode",label:"Debug Mode"})]})}),YS=()=>{const E=di(ey);di(iy),di(sy),di(ny),pe.useEffect(()=>{const a=v=>{};return jt.on("playerEvent",a),()=>{jt.off("playerEvent",a)}},[]);const S=(a,v)=>{Ts("tooltipItem",{id:a,position:{x:v.clientX+10,y:v.clientY-150}})},A=()=>{Ts("tooltipItem",{...Gi("tooltipItem"),id:null})},B=(a,v)=>{Ts("submenuItem",{id:a,position:{x:v.clientX,y:v.clientY-150}})},I=()=>{Ts("submenuItem",{...Gi("submenuItem"),id:null})},b=(a,v)=>{const o=zi(a);if(o){const r={itemId:o.id,action:v};jt.emit("itemAction",r),I()}};if(!E||!E.stats)return null;const c=Gi("submenuItem"),m=c.id?ty(c.id):[],t=Gi("tooltipItem");return ut.jsxs("div",{className:"fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",children:[ut.jsxs("div",{className:"flex flex-row space-y-2 align-top",children:[ut.jsx(Vu,{settingKey:"isStatsMenuCollapsed",label:"Stats"}),ut.jsx(Vu,{settingKey:"isSettingsMenuCollapsed",label:"Settings"})]}),ut.jsx("div",{className:`transition transform duration-1000 ease-in-out ${Gi("isSettingsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:ut.jsx(WS,{})}),ut.jsxs("div",{className:`transition transform duration-1000 ease-in-out ${Gi("isStatsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:[ut.jsx(NS,{stats:E.stats}),ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),ut.jsx("p",{className:"text-sm",children:E.stats.username||"Guest"})]}),ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),ut.jsx("p",{className:"text-sm",children:""})]}),ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),VS(E.inventory.backpack,S,A,B)]}),ut.jsxs("div",{className:"mb-4",children:[ut.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),US(E.inventory.equipment,S,A,B)]}),t.id&&zS(t.id,t.position),c.id&&ut.jsxs("div",{style:{top:c.position.y,left:c.position.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[ut.jsx("button",{onClick:I,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),ut.jsx("p",{className:"text-sm strong",children:"Actions:"}),ut.jsxs("ul",{className:"text-xs",children:[m.map(a=>ut.jsx("li",{onClick:()=>c.id&&b(c.id,a),className:"cursor-pointer hover:bg-gray-600",children:a.charAt(0).toUpperCase()+a.slice(1)},a)),ut.jsx("li",{onClick:I,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})]})},qa=rn(null),_a=rn(null),HS=()=>{const E=di(qa),[S,A]=pe.useState({x:0,y:0}),B=pe.useRef(null);pe.useEffect(()=>{const t=a=>{a&&(qa.set(a),setTimeout(()=>{A(I(a.coords.x,a.coords.y))},0))};return jt.on("npcInteractionClick",t),()=>{jt.off("npcInteractionClick",t)}},[]);const I=(t,a)=>{const o=B.current;if(!o)return{x:t,y:a};const r=o.getBoundingClientRect();let n=t,e=a;return n+r.width>window.innerWidth-10&&(n=window.innerWidth-r.width-10),e+r.height>window.innerHeight-10&&(e=window.innerHeight-r.height-10),n<10&&(n=10),e<10&&(e=10),{x:n,y:e}},b=t=>{if(E){const a=ry.getActionHandler(t);a&&(a(E),c())}},c=()=>{qa.set(null)},m=()=>{if(!E)return null;const{npcName:t,actions:a,npcId:v}=E,{x:o,y:r}=S;return ut.jsxs("div",{ref:B,className:"absolute bg-zinc-900 border border-yellow-300 rounded-md p-2 z-[100]",style:{left:`${o}px`,top:`${r}px`},children:[ut.jsxs("div",{className:"flex justify-between items-center mb-2",children:[ut.jsx("h3",{className:"font-bold text-sm text-white",children:t}),ut.jsx("button",{onClick:c,className:"text-xs font-bold m-1 text-yellow-300 border rounded-full pl-1 pr-1 hover:text-yellow-500 hover:scale-110",children:"X"})]}),a.map((n,e)=>ut.jsx("button",{onClick:()=>b(n),className:"block w-full text-sm py-1 px-2 mb-1 bg-yellow-500 hover:bg-yellow-400 rounded capitalize",children:n},e)),ut.jsx("button",{onClick:c,className:"block w-full text-xs py-1 px-2 mt-2 bg-red-500 hover:bg-red-600 rounded text-white",children:"Close"})]},v)};return ut.jsx("div",{children:m()})},to=rn(null),eo=rn({}),jS=Rs.memo(({text:E,onComplete:S})=>ut.jsx(Yu,{text:E,onComplete:S})),KS=Rs.memo(({text:E,onComplete:S})=>ut.jsx(Yu,{text:E,onComplete:S})),$S=()=>{const E=di(to),S=di(eo),[A,B]=pe.useState(!1),[I,b]=pe.useState(!1);pe.useEffect(()=>{const m=t=>{if(t){to.set(t);const a=document.querySelector("#hs-stacked-overlays-dialogue");a&&(a.classList.remove("hidden"),a.classList.add("open")),t.npcId&&(Zs.createNPCSession(eo,t.npcId),B(!1),b(!1))}};return jt.on("npcDialogue",m),()=>{jt.off("npcDialogue",m)}},[]);const c=()=>{const m=document.querySelector("#hs-stacked-overlays-dialogue");m&&(m.classList.add("hidden"),m.classList.remove("open")),to.set(null),eo.set({}),B(!1),b(!1)};return ut.jsx(ut.Fragment,{children:ut.jsx("div",{id:"hs-stacked-overlays-dialogue",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 w-full h-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:ut.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all w-full h-full sm:max-w-lg sm:w-full m-3 sm:mx-auto md:min-w-fit",children:ut.jsx("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover min-w-[800px] min-h-[500px]",style:{backgroundImage:`url(${E?.dialogue.backgroundImage||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:E?ut.jsxs(ut.Fragment,{children:[ut.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center relative",children:[ut.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4 p-4 absolute top-2 left-2",children:E.npcId&&S[`${E.npcId}_name`]?S[`${E.npcId}_name`]:"Unknown"}),ut.jsx("img",{src:E.npcId&&S[`${E.npcId}_avatar`]?S[`${E.npcId}_avatar`]:"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md absolute bottom-0 left-0"})]}),ut.jsxs("div",{className:"w-full md:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[ut.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[ut.jsx("h3",{className:"font-bold text-yellow-400 text-shadow-outline-white",children:E.dialogue.title||"Dialogue"}),ut.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays-dialogue",onClick:c,children:[ut.jsx("span",{className:"sr-only",children:"Close"}),ut.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ut.jsx("path",{d:"M18 6 6 18"}),ut.jsx("path",{d:"m6 6 12 12"})]})]})]}),ut.jsx("div",{className:"p-4 overflow-y-auto",children:ut.jsxs("div",{className:"flex flex-col",children:[ut.jsx("div",{className:"flex justify-end",children:ut.jsxs("div",{className:"w-3/4 mt-1 mb-2 text-yellow-400 text-shadow-outline-whites bg-zinc-950/40 rounded-xl p-4 text-right",children:[E.dialogue.playerResponse&&!I&&ut.jsx(KS,{text:`${E.dialogue.playerResponse}`,onComplete:()=>b(!0)}),I&&ut.jsx("div",{children:E.dialogue.playerResponse})]})}),ut.jsx("div",{className:"mt-1 mb-2 text-white bg-zinc-950/40 text-shadow-outline-white rounded-xl p-4 flex w-3/4",children:ut.jsxs("div",{className:"w-full",children:[E.dialogue.message&&I&&!A&&ut.jsx(jS,{text:E.dialogue.message,onComplete:()=>B(!0)}),A&&ut.jsx("div",{children:E.dialogue.message})]})})]})}),ut.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:ut.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays-dialogue",onClick:c,disabled:!I,children:[ut.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),ut.jsx("span",{className:`relative ${I?"":"text-gray-500"}`,children:"Okay."})]})})]})]}):ut.jsx("div",{className:"w-full p-4 rounded-xl flex flex-col items-center justify-center",children:ut.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4 p-4",children:"Loading..."})})})})})})},ZS=()=>{const E=di(_i);pe.useEffect(()=>{const A=B=>{if(B){const I=Date.now()+Math.random(),b={id:I,...B};_i.set([..._i.get(),b]),setTimeout(()=>{_i.set(_i.get().filter(c=>c.id!==I))},5e3)}};return jt.on("notification",A),()=>{jt.off("notification",A)}},[]);const S=A=>{_i.set(_i.get().filter(B=>B.id!==A))};return ut.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(E)&&E.map(A=>ut.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${A.notificationType.color}`,role:"alert",children:ut.jsxs("div",{className:"flex p-4",children:[ut.jsx("img",{src:A.notificationType.imgUrl,alt:A.notificationType.type,className:"flex-shrink-0 size-4"}),ut.jsxs("div",{className:"ms-2",children:[ut.jsx("h3",{className:"text-sm font-bold",children:A.title}),ut.jsx("p",{className:"text-sm",children:A.message})]}),ut.jsx("div",{className:"ms-auto",children:ut.jsxs("button",{type:"button",className:"inline-flex flex-shrink-0 justify-center items-center size-5 rounded-lg text-gray-800 opacity-50 hover:opacity-100 focus:outline-none focus:opacity-100 dark:text-white",onClick:()=>S(A.id),children:[ut.jsx("span",{className:"sr-only",children:"Close"}),ut.jsxs("svg",{className:"flex-shrink-0 size-4 bg-zinc-900",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ut.jsx("path",{d:"M18 6 6 18"}),ut.jsx("path",{d:"m6 6 12 12"})]})]})})]})},A.id))})},JS=()=>{const E=di(_a),[S,A]=pe.useState([]),[B,I]=pe.useState(null);pe.useEffect(()=>{const m=a=>{a&&_a.set(a)},t=a=>{a&&A(a.diceValues)};return jt.on("playerSteal",m),jt.on("diceRollResult",t),()=>{jt.off("playerSteal",m),jt.off("diceRollResult",t)}},[]),pe.useEffect(()=>{S.length>0&&b(S)},[S]);const b=m=>{const t=m.reduce((r,n)=>r+n,0);if(I(t),!E)return;let a="",v="";switch(!0){case t>=24:a="01J27QABD2GPFNRVK69S51HSGB",v=`You successfully stole a ${a}!`;break;case t>=20:a="01J27QN2KZG1RDZW4CE9Q9Z3YQ",v=`You successfully stole a ${a}!`;break;case t>=18:a="01J269PK47V1DWX2S1251DEASD",v=`You successfully stole a ${a}!`;break;case t>=15:a="Blue Shark",v=`You successfully stole a ${a}!`;break;case t>=12:a="Salmon",v=`You successfully stole a ${a}!`;break;case t<=4:jt.emit("notification",{title:"Danger",message:`You crit failed to steal from ${E.npcName}!`,notificationType:_s.danger}),jt.emit("playerDamage",{damage:"5"});break;default:jt.emit("notification",{title:"Danger",message:`You failed to steal from ${E.npcName}!`,notificationType:_s.danger}),jt.emit("playerDamage",{damage:"1"});return}const o=oy(a);o?jt.emit("playerReward",{message:v,item:o}):console.warn("Item not found in ItemDB")},c=()=>{hy([]),A([]),I(null),_a.set(null)};return E?ut.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 bg-zinc-800 bg-opacity-50",children:ut.jsxs("div",{className:"bg-zinc-800 p-4 rounded-lg shadow-lg w-3/4",children:[ut.jsx(QS,{npcName:E.npcName,roll:B}),ut.jsx(qS,{}),ut.jsx(_S,{handleClose:c})]})}):null},QS=({npcName:E,roll:S})=>ut.jsxs("div",{children:[ut.jsx("h2",{className:"text-lg text-yellow-400 font-bold mb-4",children:"Steal Attempt"}),ut.jsxs("p",{className:"mb-4",children:["Roll the dice to steal from ",E,". You need a total of 12 or higher to succeed."]}),S!==null&&ut.jsxs("p",{className:"mb-4",children:["Your roll: ",S]})]}),kS=()=>ut.jsx(ay,{textures:{side1:"/assets/items/set/dice/dice1.png",side2:"/assets/items/set/dice/dice2.png",side3:"/assets/items/set/dice/dice3.png",side4:"/assets/items/set/dice/dice4.png",side5:"/assets/items/set/dice/dice5.png",side6:"/assets/items/set/dice/dice6.png"},styleClass:"h-96",diceCount:4}),qS=pe.memo(kS),_S=({handleClose:E})=>ut.jsx("button",{onClick:E,className:"block w-full py-2 bg-red-500 text-white rounded hover:bg-red-700 mt-2",children:"Close"}),t2=ar.div` - // Your style here -`;function l2(){return ut.jsxs(t2,{children:[ut.jsx(YS,{}),ut.jsxs("div",{className:"flex justify-center items-center h-screen overflow-hidden",children:[ut.jsx($S,{}),ut.jsx(JS,{}),ut.jsx(BS,{}),ut.jsx(ZS,{})]}),ut.jsx(HS,{}),ut.jsx(bS,{})]})}export{l2 as default}; diff --git a/docs/_astro/ConchForm.UCu5_xT9.js b/docs/_astro/ConchForm.DdDcKdtv.js similarity index 97% rename from docs/_astro/ConchForm.UCu5_xT9.js rename to docs/_astro/ConchForm.DdDcKdtv.js index 346ede2..bde6ed2 100644 --- a/docs/_astro/ConchForm.UCu5_xT9.js +++ b/docs/_astro/ConchForm.DdDcKdtv.js @@ -1 +1 @@ -import{S as T,i as A,s as F,e as d,a as y,t as P,c as f,b as I,d as k,g as M,f as H,h as w,B as S,j as a,F as x,k as O,l as u,n as B,o as D,p as j,x as L}from"./index.v-SePH8U.js";function N(c){let e,t,r,i,m,l,b="Ask the Shadow Magic Conch",h,n,q='
',_,p,g,v,C;return{c(){e=d("div"),t=d("img"),m=y(),l=d("h1"),l.textContent=b,h=y(),n=d("form"),n.innerHTML=q,_=y(),p=d("p"),g=P(c[0]),this.h()},l(o){e=f(o,"DIV",{class:!0,style:!0});var s=I(e);t=f(s,"IMG",{src:!0,alt:!0,class:!0,style:!0}),m=k(s),l=f(s,"H1",{class:!0,"data-svelte-h":!0}),M(l)!=="svelte-10z2pn7"&&(l.textContent=b),h=k(s),n=f(s,"FORM",{id:!0,class:!0,"data-svelte-h":!0}),M(n)!=="svelte-1hbkyrw"&&(n.innerHTML=q),_=k(s),p=f(s,"P",{class:!0});var E=I(p);g=H(E,c[0]),E.forEach(w),s.forEach(w),this.h()},h(){S(t.src,r=c[1]?"https://kbve.com/embed/conch/conch_shell_glow.png":"https://kbve.com/embed/conch/conch_shell.png")||a(t,"src",r),a(t,"alt","Conch Shell"),a(t,"class",i="conch-shell "+(c[1]?"rotate":"")+" svelte-19kd8e1"),x(t,"opacity",c[1]?.5:1),a(l,"class","text-3xl font-bold mb-4"),a(n,"id","questionForm"),a(n,"class","w-full max-w-sm"),a(p,"class","answer text-2xl mt-4"),a(e,"class","flex flex-col items-center justify-center min-h-screen bg-cover"),x(e,"background-image","url('https://kbve.com/embed/conch/bg.jpg')")},m(o,s){O(o,e,s),u(e,t),u(e,m),u(e,l),u(e,h),u(e,n),u(e,_),u(e,p),u(p,g),v||(C=B(n,"submit",c[2]),v=!0)},p(o,[s]){s&2&&!S(t.src,r=o[1]?"https://kbve.com/embed/conch/conch_shell_glow.png":"https://kbve.com/embed/conch/conch_shell.png")&&a(t,"src",r),s&2&&i!==(i="conch-shell "+(o[1]?"rotate":"")+" svelte-19kd8e1")&&a(t,"class",i),s&2&&x(t,"opacity",o[1]?.5:1),s&1&&D(g,o[0])},i:j,o:j,d(o){o&&w(e),v=!1,C()}}}function z(c,e,t){let r="",i=!1;async function m(l){l.preventDefault();const b=document.getElementById("questionInput").value;t(1,i=!0);try{const n=await(await fetch("https://rust.kbve.com/api/v1/call_groq",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:b})})).json();t(0,r=n.answer?"Yes":"No")}catch(h){console.error("Error submitting the question:",h),t(0,r="Error! Please try again.")}t(1,i=!1)}return L(()=>{new Audio("https://kbve.com/embed/conch/yes.ogg"),new Audio("https://kbve.com/embed/conch/no.ogg")}),[r,i,m]}class J extends T{constructor(e){super(),A(this,e,z,N,F,{})}}export{J as default}; +import{S as T,i as A,s as F,e as d,a as y,t as P,c as f,b as I,d as k,g as M,f as H,h as w,B as S,j as a,F as x,k as O,l as u,n as B,o as D,p as j,x as L}from"./index.BUYXiDtP.js";function N(c){let e,t,r,i,m,l,b="Ask the Shadow Magic Conch",h,n,q='
',_,p,g,v,C;return{c(){e=d("div"),t=d("img"),m=y(),l=d("h1"),l.textContent=b,h=y(),n=d("form"),n.innerHTML=q,_=y(),p=d("p"),g=P(c[0]),this.h()},l(o){e=f(o,"DIV",{class:!0,style:!0});var s=I(e);t=f(s,"IMG",{src:!0,alt:!0,class:!0,style:!0}),m=k(s),l=f(s,"H1",{class:!0,"data-svelte-h":!0}),M(l)!=="svelte-10z2pn7"&&(l.textContent=b),h=k(s),n=f(s,"FORM",{id:!0,class:!0,"data-svelte-h":!0}),M(n)!=="svelte-1hbkyrw"&&(n.innerHTML=q),_=k(s),p=f(s,"P",{class:!0});var E=I(p);g=H(E,c[0]),E.forEach(w),s.forEach(w),this.h()},h(){S(t.src,r=c[1]?"https://kbve.com/embed/conch/conch_shell_glow.png":"https://kbve.com/embed/conch/conch_shell.png")||a(t,"src",r),a(t,"alt","Conch Shell"),a(t,"class",i="conch-shell "+(c[1]?"rotate":"")+" svelte-19kd8e1"),x(t,"opacity",c[1]?.5:1),a(l,"class","text-3xl font-bold mb-4"),a(n,"id","questionForm"),a(n,"class","w-full max-w-sm"),a(p,"class","answer text-2xl mt-4"),a(e,"class","flex flex-col items-center justify-center min-h-screen bg-cover"),x(e,"background-image","url('https://kbve.com/embed/conch/bg.jpg')")},m(o,s){O(o,e,s),u(e,t),u(e,m),u(e,l),u(e,h),u(e,n),u(e,_),u(e,p),u(p,g),v||(C=B(n,"submit",c[2]),v=!0)},p(o,[s]){s&2&&!S(t.src,r=o[1]?"https://kbve.com/embed/conch/conch_shell_glow.png":"https://kbve.com/embed/conch/conch_shell.png")&&a(t,"src",r),s&2&&i!==(i="conch-shell "+(o[1]?"rotate":"")+" svelte-19kd8e1")&&a(t,"class",i),s&2&&x(t,"opacity",o[1]?.5:1),s&1&&D(g,o[0])},i:j,o:j,d(o){o&&w(e),v=!1,C()}}}function z(c,e,t){let r="",i=!1;async function m(l){l.preventDefault();const b=document.getElementById("questionInput").value;t(1,i=!0);try{const n=await(await fetch("https://rust.kbve.com/api/v1/call_groq",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:b})})).json();t(0,r=n.answer?"Yes":"No")}catch(h){console.error("Error submitting the question:",h),t(0,r="Error! Please try again.")}t(1,i=!1)}return L(()=>{new Audio("https://kbve.com/embed/conch/yes.ogg"),new Audio("https://kbve.com/embed/conch/no.ogg")}),[r,i,m]}class J extends T{constructor(e){super(),A(this,e,z,N,F,{})}}export{J as default}; diff --git a/docs/_astro/JukeboxPlayer.B8Wx8jK4.js b/docs/_astro/JukeboxPlayer.B8Wx8jK4.js deleted file mode 100644 index 9cfea01..0000000 --- a/docs/_astro/JukeboxPlayer.B8Wx8jK4.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as pe,i as me,s as ye,e as _,a as x,t as K,v as ve,c as w,h as d,d as E,b as B,f as R,g as Z,j as m,w as C,l as v,k,n as L,o as te,p as le,q as ge,r as be,u as re,x as _e,y as we}from"./index.v-SePH8U.js";import{g as ke}from"./globals.D0QH3NT1.js";import{e as ce}from"./each.-gASlQSi.js";import{p as X,b as Te}from"./index.DxhZiom7.js";import{t as je}from"./index.BH1EYZ08.js";X("atlas",{plugin:[]},{encode:JSON.stringify,decode:JSON.parse});const oe=X("musicData",{items:[]},{encode:JSON.stringify,decode:JSON.parse}),W=X("tagSettings",{},{encode:JSON.stringify,decode:JSON.parse}),Se=je(async()=>{const o=await fetch("/api/music.json");if(!o.ok)throw new Error("Failed to fetch music data");const a=await o.json();return oe.set(a),a}),xe=[{i:"a",x:0,y:0,w:4,h:16,moved:!1,static:!0},{i:"b",x:4,y:0,w:4,h:16,moved:!1,static:!0},{i:"c",x:8,y:0,w:4,h:16,moved:!1,static:!0},{i:"d",x:4,y:16,w:4,h:4,moved:!1,static:!1},{i:"e",x:4,y:8,w:4,h:4,moved:!1,static:!1},{i:"f",x:8,y:16,w:4,h:4,moved:!1,static:!1},{i:"g",x:4,y:12,w:4,h:4,moved:!1,static:!1},{i:"h",x:8,y:12,w:4,h:4,moved:!1,static:!1},{i:"i",x:0,y:16,w:4,h:4,moved:!1,static:!1},{i:"j",x:8,y:0,w:4,h:16,moved:!1,static:!1}];X("layoutKey",xe,{encode:JSON.stringify,decode:JSON.parse});Te("kbve:");const{document:ue}=ke;function de(o,a,c){const s=o.slice();return s[22]=a[c],s}function he(o){let a,c=o[22]+"",s,h,y,T;function O(){return o[11](o[22])}return{c(){a=_("button"),s=K(c),h=x(),this.h()},l(u){a=w(u,"BUTTON",{class:!0});var f=B(a);s=R(f,c),h=E(f),f.forEach(d),this.h()},h(){m(a,"class","relative z-1 px-3 py-1 text-sm font-medium border rounded-md hover:scale-110 ease-in-out duration-500"),C(a,"opacity-100",o[4][o[22]]),C(a,"opacity-50",!o[4][o[22]])},m(u,f){k(u,a,f),v(a,s),v(a,h),y||(T=L(a,"click",O),y=!0)},p(u,f){o=u,f&16&&c!==(c=o[22]+"")&&te(s,c),f&16&&C(a,"opacity-100",o[4][o[22]]),f&16&&C(a,"opacity-50",!o[4][o[22]])},d(u){u&&d(a),y=!1,T()}}}function Ee(o){let a,c,s,h,y,T,O,u,f,P,V,j,U="Sync",M,S,J="Skip",I,g,D=o[1]?"Disable Force Play":"Enable Force Play",z,A,N,q,b,e=`

To view this video please enable JavaScript, and consider upgrading to a web - browser that - supports HTML5 video

`,l,n,G="Currently Playing Video ID:",Q,H,$,se,F=ce(Object.keys(o[4])),p=[];for(let t=0;tc(4,s=e)),re(o,oe,e=>c(15,h=e));let y,T=!1,O=!1,u="",f=!1,P=!0,V=!1;_e(()=>{O=!0,console.log("Mounted"),j().then(()=>{O&&T&&S()})}),we(()=>{O=!1,y&&y.dispose()});async function j(){try{await new Promise((e,l)=>{const n=document.createElement("script");n.src="https://unpkg.com/video.js/dist/video.min.js",n.onload=e,n.onerror=()=>l(new Error("Failed to load Video.js")),document.head.appendChild(n)}),await new Promise((e,l)=>{const n=document.createElement("script");n.src="https://unpkg.com/videojs-youtube/dist/Youtube.min.js",n.onload=e,n.onerror=()=>l(new Error("Failed to load YouTube plugin")),document.head.appendChild(n)}),T=!0}catch(e){console.error("Error loading scripts:",e)}}async function U(){Se.then(()=>{console.log("Music data has been successfully updated.")}).catch(e=>{console.error("Error updating music data:",e)})}function M(){const e={};h.items.forEach(l=>{l.tags.forEach(n=>{n!=="music"&&(e[n]=!0)})}),W.set(e)}async function S(){if(h.items.length===0)try{await U(),console.log("Music Data Loaded:",h.items)}catch(e){console.error("Failed to fetch music data:",e);return}Object.keys(s).length===0?(console.log("Initializing tags from music data..."),M()):console.log("Tags already initialized:",s),J()}function J(){if(typeof videojs<"u"&&videojs.getTech("youtube")){const e=Oe("yt"),l=I();if(l.length===0&&(!e||!fe(e)))return;const n=e&&fe(e)?e:l[Math.floor(Math.random()*l.length)];y=videojs("video-js",{techOrder:["youtube"],sources:[{type:"video/youtube",src:`https://www.youtube.com/watch?v=${n}`}],youtube:{iv_load_policy:3},controls:!0,autoplay:!0,preload:"auto"}),y.on("pause",()=>{}),y.on("ended",g),c(0,u=n)}else setTimeout(J,100)}function I(){let e=[];return h.items.forEach(l=>{l.tags.some(G=>s[G]===!0)&&(P&&(e=e.concat(l.ytTracks)),V&&(e=e.concat(l.ytSets)))}),e}function g(){const e=I();if(e.length===0)return;const l=e[Math.floor(Math.random()*e.length)];y.src({type:"video/youtube",src:`https://www.youtube.com/watch?v=${l}`}),y.play(),c(0,u=l)}function D(e){const l={...s,[e]:!s[e]};W.set(l)}async function z(){oe.set({items:[]}),W.set({});try{await U(),M(),J(),console.log("Data and tags have been synchronized."),window.location.reload()}catch(e){console.error("Error during synchronization:",e)}}return[u,f,P,V,s,g,D,z,()=>c(2,P=!P),()=>c(3,V=!V),()=>c(1,f=!f),e=>D(e)]}class Je extends pe{constructor(a){super(),me(this,a,Pe,Ee,ye,{})}}export{Je as default}; diff --git a/docs/_astro/JukeboxPlayer.JZvzSQHP.js b/docs/_astro/JukeboxPlayer.JZvzSQHP.js new file mode 100644 index 0000000..5869ec7 --- /dev/null +++ b/docs/_astro/JukeboxPlayer.JZvzSQHP.js @@ -0,0 +1,3 @@ +import{S as pe,i as me,s as ye,e as _,a as x,t as K,v as ve,c as w,h as u,d as E,b as B,f as R,g as Z,j as m,w as C,l as v,k,n as L,o as te,p as le,q as ge,r as be,u as re,x as _e,y as we}from"./index.BUYXiDtP.js";import{e as ce}from"./each.-gASlQSi.js";import{p as X,b as ke}from"./index.DxhZiom7.js";import{t as Te}from"./index.BH1EYZ08.js";const je=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;X("atlas",{plugin:[]},{encode:JSON.stringify,decode:JSON.parse});const oe=X("musicData",{items:[]},{encode:JSON.stringify,decode:JSON.parse}),W=X("tagSettings",{},{encode:JSON.stringify,decode:JSON.parse}),Se=Te(async()=>{const o=await fetch("/api/music.json");if(!o.ok)throw new Error("Failed to fetch music data");const a=await o.json();return oe.set(a),a}),xe=[{i:"a",x:0,y:0,w:4,h:16,moved:!1,static:!0},{i:"b",x:4,y:0,w:4,h:16,moved:!1,static:!0},{i:"c",x:8,y:0,w:4,h:16,moved:!1,static:!0},{i:"d",x:4,y:16,w:4,h:4,moved:!1,static:!1},{i:"e",x:4,y:8,w:4,h:4,moved:!1,static:!1},{i:"f",x:8,y:16,w:4,h:4,moved:!1,static:!1},{i:"g",x:4,y:12,w:4,h:4,moved:!1,static:!1},{i:"h",x:8,y:12,w:4,h:4,moved:!1,static:!1},{i:"i",x:0,y:16,w:4,h:4,moved:!1,static:!1},{i:"j",x:8,y:0,w:4,h:16,moved:!1,static:!1}];X("layoutKey",xe,{encode:JSON.stringify,decode:JSON.parse});ke("kbve:");const{document:de}=je;function ue(o,a,c){const s=o.slice();return s[22]=a[c],s}function fe(o){let a,c=o[22]+"",s,f,y,T;function O(){return o[11](o[22])}return{c(){a=_("button"),s=K(c),f=x(),this.h()},l(d){a=w(d,"BUTTON",{class:!0});var h=B(a);s=R(h,c),f=E(h),h.forEach(u),this.h()},h(){m(a,"class","relative z-1 px-3 py-1 text-sm font-medium border rounded-md hover:scale-110 ease-in-out duration-500"),C(a,"opacity-100",o[4][o[22]]),C(a,"opacity-50",!o[4][o[22]])},m(d,h){k(d,a,h),v(a,s),v(a,f),y||(T=L(a,"click",O),y=!0)},p(d,h){o=d,h&16&&c!==(c=o[22]+"")&&te(s,c),h&16&&C(a,"opacity-100",o[4][o[22]]),h&16&&C(a,"opacity-50",!o[4][o[22]])},d(d){d&&u(a),y=!1,T()}}}function Ee(o){let a,c,s,f,y,T,O,d,h,P,V,j,U="Sync",M,S,J="Skip",I,g,D=o[1]?"Disable Force Play":"Enable Force Play",z,A,N,q,b,e=`

To view this video please enable JavaScript, and consider upgrading to a web + browser that + supports HTML5 video

`,l,n,G="Currently Playing Video ID:",Q,H,$,se,F=ce(Object.keys(o[4])),p=[];for(let t=0;tc(4,s=e)),re(o,oe,e=>c(15,f=e));let y,T=!1,O=!1,d="",h=!1,P=!0,V=!1;_e(()=>{O=!0,console.log("Mounted"),j().then(()=>{O&&T&&S()})}),we(()=>{O=!1,y&&y.dispose()});async function j(){try{await new Promise((e,l)=>{const n=document.createElement("script");n.src="https://unpkg.com/video.js/dist/video.min.js",n.onload=e,n.onerror=()=>l(new Error("Failed to load Video.js")),document.head.appendChild(n)}),await new Promise((e,l)=>{const n=document.createElement("script");n.src="https://unpkg.com/videojs-youtube/dist/Youtube.min.js",n.onload=e,n.onerror=()=>l(new Error("Failed to load YouTube plugin")),document.head.appendChild(n)}),T=!0}catch(e){console.error("Error loading scripts:",e)}}async function U(){Se.then(()=>{console.log("Music data has been successfully updated.")}).catch(e=>{console.error("Error updating music data:",e)})}function M(){const e={};f.items.forEach(l=>{l.tags.forEach(n=>{n!=="music"&&(e[n]=!0)})}),W.set(e)}async function S(){if(f.items.length===0)try{await U(),console.log("Music Data Loaded:",f.items)}catch(e){console.error("Failed to fetch music data:",e);return}Object.keys(s).length===0?(console.log("Initializing tags from music data..."),M()):console.log("Tags already initialized:",s),J()}function J(){if(typeof videojs<"u"&&videojs.getTech("youtube")){const e=Oe("yt"),l=I();if(l.length===0&&(!e||!he(e)))return;const n=e&&he(e)?e:l[Math.floor(Math.random()*l.length)];y=videojs("video-js",{techOrder:["youtube"],sources:[{type:"video/youtube",src:`https://www.youtube.com/watch?v=${n}`}],youtube:{iv_load_policy:3},controls:!0,autoplay:!0,preload:"auto"}),y.on("pause",()=>{}),y.on("ended",g),c(0,d=n)}else setTimeout(J,100)}function I(){let e=[];return f.items.forEach(l=>{l.tags.some(G=>s[G]===!0)&&(P&&(e=e.concat(l.ytTracks)),V&&(e=e.concat(l.ytSets)))}),e}function g(){const e=I();if(e.length===0)return;const l=e[Math.floor(Math.random()*e.length)];y.src({type:"video/youtube",src:`https://www.youtube.com/watch?v=${l}`}),y.play(),c(0,d=l)}function D(e){const l={...s,[e]:!s[e]};W.set(l)}async function z(){oe.set({items:[]}),W.set({});try{await U(),M(),J(),console.log("Data and tags have been synchronized."),window.location.reload()}catch(e){console.error("Error during synchronization:",e)}}return[d,h,P,V,s,g,D,z,()=>c(2,P=!P),()=>c(3,V=!V),()=>c(1,h=!h),e=>D(e)]}class Me extends pe{constructor(a){super(),me(this,a,Pe,Ee,ye,{})}}export{Me as default}; diff --git a/docs/_astro/LeagueMM.B5Xus8e-.js b/docs/_astro/LeagueMM.D0X0v9cE.js similarity index 98% rename from docs/_astro/LeagueMM.B5Xus8e-.js rename to docs/_astro/LeagueMM.D0X0v9cE.js index 723473e..fd70448 100644 --- a/docs/_astro/LeagueMM.B5Xus8e-.js +++ b/docs/_astro/LeagueMM.D0X0v9cE.js @@ -1,4 +1,4 @@ -import{p as z,z as De,r as Ie,s as Me,A as Le,S as qe,i as We,e as b,a as Y,t as x,c as v,b as D,g as me,d as N,h as g,f as T,j as _,B as xe,k as J,l as f,m as oe,n as ee,o as te,C as ie,q as de,u as P,x as Te,D as he,E as pe,F as ae,G as Ve}from"./index.v-SePH8U.js";import{e as F}from"./each.-gASlQSi.js";const O=[];function Ae(l,e){return{subscribe:j(l,e).subscribe}}function j(l,e=z){let t;const s=new Set;function a(r){if(Me(l,r)&&(l=r,t)){const i=!O.length;for(const o of s)o[1](),O.push(o,l);if(i){for(let o=0;o{s.delete(o),s.size===0&&t&&(t(),t=null)}}return{set:a,update:c,subscribe:n}}function _e(l,e,t){const s=!Array.isArray(l),a=s?[l]:l;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const c=e.length<2;return Ae(t,(n,r)=>{let i=!1;const o=[];let m=0,u=z;const y=()=>{if(m)return;u();const M=e(s?o[0]:o,n,r);c?n(M):u=Le(M)?M:z},w=a.map((M,k)=>De(M,U=>{o[k]=U,m&=~(1<{m|=1<{s.delete(o),s.size===0&&t&&(t(),t=null)}}return{set:a,update:c,subscribe:n}}function _e(l,e,t){const s=!Array.isArray(l),a=s?[l]:l;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const c=e.length<2;return Ae(t,(n,r)=>{let i=!1;const o=[];let m=0,u=z;const y=()=>{if(m)return;u();const M=e(s?o[0]:o,n,r);c?n(M):u=Le(M)?M:z},w=a.map((M,k)=>De(M,U=>{o[k]=U,m&=~(1<{m|=1<0&&(a=r[0])}if(!a){d.error(`Loader element with ID or name "${e}" not found.`);return}if(!(a instanceof HTMLElement)){d.error(`Element found by "${e}" is not an HTMLElement.`);return}d.log(`Removing loader element with ID or name "${e}" with duration ${t}ms.`),a.classList.add("opacity-0","transition-opacity",`duration-${t}`),setTimeout(()=>{a.style.display="none",d.log(`Loader element with ID or name "${e}" has been hidden.`),s&&s()},t)}const{document:m}=P;function x(o){let e,t;return{c(){e=O("script"),this.h()},l(s){e=R(s,"SCRIPT",{src:!0});var a=T(e);a.forEach(h),this.h()},h(){j(e.src,t=o[1])||H(e,"src",t),e.async=!0,e.defer=!0},m(s,a){M(s,e,a)},p:u,d(s){s&&h(e)}}}function G(o){let e,t=o[0]&&!window?.hcaptcha&&x(o);return{c(){t&&t.c(),e=y()},l(s){const a=D("svelte-1lq4rqf",m.head);t&&t.l(a),e=y(),a.forEach(h)},m(s,a){t&&t.m(m.head,null),z(m.head,e)},p(s,[a]){s[0]&&!window?.hcaptcha?t?t.p(s,a):(t=x(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:u,o:u,d(s){t&&t.d(s),h(e)}}}function J(o,e,t){const s=B(),a=()=>{l&&i&&c&&hcaptcha.reset(c)},r=n=>{if(l&&i&&c)return hcaptcha.execute(c,n)};let l=!1,i=!1,c;const E={hl:"",sitekey:F,apihost:K,reCaptchaCompat:!0,theme:A.DARK,size:"compact"},S=new URLSearchParams({recaptchacompat:"on",onload:"hcaptchaOnLoad",render:"explicit"}),k=`${E.apihost}?${S.toString()}`;let{baseClasses:f="inline-flex w-full items-center justify-center gap-x-2 rounded-lg px-4 py-1 text-sm font-bold text-neutral-700 focus-visible:ring outline-none transition duration-300"}=e,{borderClasses:C="border border-transparent"}=e,{bgColorClasses:b="bg-yellow-400 dark:focus:outline-none"}=e,{hoverClasses:g="hover:bg-yellow-500"}=e,{fontSizeClasses:_="2xl:text-base"}=e,{disabledClasses:w="disabled:pointer-events-none disabled:opacity-50 disabled:animate-pulse"}=e,{ringClasses:p="ring-zinc-500 dark:ring-zinc-200"}=e;return q(()=>{U({elementIdOrName:"skeleton_login_loader",duration:500}),document.getElementById("astro_error_message")&&document.getElementById("astro_error_message"),window.hcaptchaOnLoad=()=>{s("load"),i=!0},window.onSuccess=n=>{s("success",{token:n})},window.onError=()=>{s("error")},window.onClose=()=>{s("close")},window.onExpired=()=>{s("expired"),a()},s("mount"),t(0,l=!0)}),N(()=>{window.hcaptchaOnLoad=null,window.onSuccess=null,i&&(hcaptcha=null)}),o.$$set=n=>{"baseClasses"in n&&t(4,f=n.baseClasses),"borderClasses"in n&&t(5,C=n.borderClasses),"bgColorClasses"in n&&t(6,b=n.bgColorClasses),"hoverClasses"in n&&t(7,g=n.hoverClasses),"fontSizeClasses"in n&&t(8,_=n.fontSizeClasses),"disabledClasses"in n&&t(9,w=n.disabledClasses),"ringClasses"in n&&t(10,p=n.ringClasses)},[l,k,a,r,f,C,b,g,_,w,p]}class ee extends I{constructor(e){super(),L(this,e,J,G,v,{reset:2,execute:3,baseClasses:4,borderClasses:5,bgColorClasses:6,hoverClasses:7,fontSizeClasses:8,disabledClasses:9,ringClasses:10})}get reset(){return this.$$.ctx[2]}get execute(){return this.$$.ctx[3]}}export{ee as default}; diff --git a/docs/_astro/ResumeApp.8yIrdsGm.js b/docs/_astro/ResumeApp.DTTfIcsY.js similarity index 99% rename from docs/_astro/ResumeApp.8yIrdsGm.js rename to docs/_astro/ResumeApp.DTTfIcsY.js index a5068ed..1ba184c 100644 --- a/docs/_astro/ResumeApp.8yIrdsGm.js +++ b/docs/_astro/ResumeApp.DTTfIcsY.js @@ -1,4 +1,4 @@ -import{S as Cl,i as Al,s as Nl,e as a,a as v,t as E,c as s,b as m,g as He,d as y,f as w,h as b,j as l,k as cl,l as t,m as u,n as d,o as Tl,p as gl,q as vl,r as pl,u as Ul}from"./index.v-SePH8U.js";import{e as kt}from"./each.-gASlQSi.js";import{p as Pl}from"./index.DxhZiom7.js";const yl={basics:{name:"",label:"",image:"",email:"",phone:"",url:"",summary:"",location:{address:"",postalCode:"",city:"",countryCode:"",region:""},profiles:[{network:"",username:"",url:""}]},work:[],volunteer:[],education:[],awards:[],certificates:[],publications:[],skills:[],languages:[],interests:[],references:[],projects:[]},_=Pl("resume",yl,{encode(e){return JSON.stringify(e)},decode(e){try{return JSON.parse(e)}catch{return yl}}}),me=e=>{_.set({..._.get(),basics:{..._.get().basics,...e}})},Il=e=>{_.set({..._.get(),basics:{..._.get().basics,profiles:[..._.get().basics.profiles,e]}})},dl=(e,o)=>{const p=[..._.get().basics.profiles];p[e]={...p[e],...o},_.set({..._.get(),basics:{..._.get().basics,profiles:p}})},Bl=e=>{const o=[..._.get().basics.profiles];o.splice(e,1),_.set({..._.get(),basics:{..._.get().basics,profiles:o}})},Dl=e=>{_.set({..._.get(),work:[..._.get().work,e]})},st=(e,o)=>{const p=[..._.get().work];p[e]={...p[e],...o},_.set({..._.get(),work:p})},Rl=e=>{const o=[..._.get().work];o.splice(e,1),_.set({..._.get(),work:o})};function kl(e,o,p){const T=e.slice();return T[97]=o[p],T[98]=o,T[99]=p,T}function El(e,o,p){const T=e.slice();return T[100]=o[p],T[101]=o,T[99]=p,T}function wl(e){let o,p,T,n,f,g,F,A,X,P,I,C,z,U,O="Remove",D,Y;function ee(){e[35].call(n,e[101],e[99])}function j(){return e[36](e[99],e[100])}function G(){e[37].call(A,e[101],e[99])}function te(){return e[38](e[99],e[100])}function le(){e[39].call(C,e[101],e[99])}function J(){return e[40](e[99],e[100])}function V(){return e[41](e[99])}return{c(){o=a("div"),p=a("label"),T=E(`Network: +import{S as Cl,i as Al,s as Nl,e as a,a as v,t as E,c as s,b as m,g as He,d as y,f as w,h as b,j as l,k as cl,l as t,m as u,n as d,o as Tl,p as gl,q as vl,r as pl,u as Ul}from"./index.BUYXiDtP.js";import{e as kt}from"./each.-gASlQSi.js";import{p as Pl}from"./index.DxhZiom7.js";const yl={basics:{name:"",label:"",image:"",email:"",phone:"",url:"",summary:"",location:{address:"",postalCode:"",city:"",countryCode:"",region:""},profiles:[{network:"",username:"",url:""}]},work:[],volunteer:[],education:[],awards:[],certificates:[],publications:[],skills:[],languages:[],interests:[],references:[],projects:[]},_=Pl("resume",yl,{encode(e){return JSON.stringify(e)},decode(e){try{return JSON.parse(e)}catch{return yl}}}),me=e=>{_.set({..._.get(),basics:{..._.get().basics,...e}})},Il=e=>{_.set({..._.get(),basics:{..._.get().basics,profiles:[..._.get().basics.profiles,e]}})},dl=(e,o)=>{const p=[..._.get().basics.profiles];p[e]={...p[e],...o},_.set({..._.get(),basics:{..._.get().basics,profiles:p}})},Bl=e=>{const o=[..._.get().basics.profiles];o.splice(e,1),_.set({..._.get(),basics:{..._.get().basics,profiles:o}})},Dl=e=>{_.set({..._.get(),work:[..._.get().work,e]})},st=(e,o)=>{const p=[..._.get().work];p[e]={...p[e],...o},_.set({..._.get(),work:p})},Rl=e=>{const o=[..._.get().work];o.splice(e,1),_.set({..._.get(),work:o})};function kl(e,o,p){const T=e.slice();return T[97]=o[p],T[98]=o,T[99]=p,T}function El(e,o,p){const T=e.slice();return T[100]=o[p],T[101]=o,T[99]=p,T}function wl(e){let o,p,T,n,f,g,F,A,X,P,I,C,z,U,O="Remove",D,Y;function ee(){e[35].call(n,e[101],e[99])}function j(){return e[36](e[99],e[100])}function G(){e[37].call(A,e[101],e[99])}function te(){return e[38](e[99],e[100])}function le(){e[39].call(C,e[101],e[99])}function J(){return e[40](e[99],e[100])}function V(){return e[41](e[99])}return{c(){o=a("div"),p=a("label"),T=E(`Network: `),n=a("input"),f=v(),g=a("label"),F=E(`Username: `),A=a("input"),X=v(),P=a("label"),I=E(`URL: `),C=a("input"),z=v(),U=a("button"),U.textContent=O,this.h()},l(B){o=s(B,"DIV",{class:!0});var N=m(o);p=s(N,"LABEL",{class:!0});var W=m(p);T=w(W,`Network: diff --git a/docs/_astro/globals.D0QH3NT1.js b/docs/_astro/globals.D0QH3NT1.js deleted file mode 100644 index c4865b4..0000000 --- a/docs/_astro/globals.D0QH3NT1.js +++ /dev/null @@ -1 +0,0 @@ -const o=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;export{o as g}; diff --git a/docs/_astro/index.BUYXiDtP.js b/docs/_astro/index.BUYXiDtP.js new file mode 100644 index 0000000..337c766 --- /dev/null +++ b/docs/_astro/index.BUYXiDtP.js @@ -0,0 +1 @@ +function $(){}function D(e){return e()}function S(){return Object.create(null)}function g(e){e.forEach(D)}function T(e){return typeof e=="function"}function le(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let b;function ce(e,t){return e===t?!0:(b||(b=document.createElement("a")),b.href=t,e===b.href)}function H(e){return Object.keys(e).length===0}function L(e,...t){if(e==null){for(const i of t)i(void 0);return $}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ue(e,t,n){e.$$.on_destroy.push(L(t,n))}function se(e){return e??""}let x=!1;function P(){x=!0}function I(){x=!1}function M(e,t,n,i){for(;e>1);n(r)<=i?e=r+1:t=r}return e}function z(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const l=[];for(let c=0;c0&&t[n[r]].claim_order<=c?r+1:M(1,r,y=>t[n[y]].claim_order,c))-1;i[l]=n[a]+1;const f=a+1;n[f]=l,r=Math.max(f,r)}const s=[],u=[];let o=t.length-1;for(let l=n[r]+1;l!=0;l=i[l-1]){for(s.push(t[l-1]);o>=l;o--)u.push(t[o]);o--}for(;o>=0;o--)u.push(t[o]);s.reverse(),u.sort((l,c)=>l.claim_order-c.claim_order);for(let l=0,c=0;l=s[c].claim_order;)c++;const a=ce.removeEventListener(t,n,i)}function he(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function me(e){return e.dataset.svelteH}function pe(e){return e===""?null:+e}function U(e){return Array.from(e.childNodes)}function V(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function B(e,t,n,i,r=!1){V(e);const s=(()=>{for(let u=e.claim_info.last_index;u=0;u--){const o=e[u];if(t(o)){const l=n(o);return l===void 0?e.splice(u,1):e[u]=l,r?l===void 0&&e.claim_info.last_index--:e.claim_info.last_index=u,o}}return i()})();return s.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,s}function W(e,t,n,i){return B(e,r=>r.nodeName===t,r=>{const s=[];for(let u=0;ur.removeAttribute(u))},()=>i(t))}function ye(e,t,n){return W(e,t,n,G)}function J(e,t){return B(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>N(t),!0)}function be(e){return J(e," ")}function $e(e,t){t=""+t,e.data!==t&&(e.data=t)}function ge(e,t){e.value=t??""}function xe(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function we(e,t,n){e.classList.toggle(t,!!n)}function Ee(e,t){const n=[];let i=0;for(const r of t.childNodes)if(r.nodeType===8){const s=r.textContent.trim();s===`HEAD_${e}_END`?(i-=1,n.push(r)):s===`HEAD_${e}_START`&&(i+=1,n.push(r))}else i>0&&n.push(r);return n}let p;function m(e){p=e}function O(){if(!p)throw new Error("Function called outside component initialization");return p}function ve(e){O().$$.on_mount.push(e)}function Ne(e){O().$$.on_destroy.push(e)}const _=[],j=[];let h=[];const C=[],K=Promise.resolve();let E=!1;function Q(){E||(E=!0,K.then(q))}function v(e){h.push(e)}const w=new Set;let d=0;function q(){if(d!==0)return;const e=p;do{try{for(;d<_.length;){const t=_[d];d++,m(t),X(t.$$)}}catch(t){throw _.length=0,d=0,t}for(m(null),_.length=0,d=0;j.length;)j.pop()();for(let t=0;te.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),h=t}const Z=new Set;function ee(e,t){e&&e.i&&(Z.delete(e),e.i(t))}function te(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),v(()=>{const s=e.$$.on_mount.map(D).filter(T);e.$$.on_destroy?e.$$.on_destroy.push(...s):g(s),e.$$.on_mount=[]}),r.forEach(v)}function ne(e,t){const n=e.$$;n.fragment!==null&&(Y(n.after_update),g(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function ie(e,t){e.$$.dirty[0]===-1&&(_.push(e),Q(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const A=k.length?k[0]:y;return c.ctx&&r(c.ctx[f],c.ctx[f]=A)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](A),a&&ie(e,f)),y}):[],c.update(),a=!0,g(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){P();const f=U(t.target);c.fragment&&c.fragment.l(f),f.forEach(R)}else c.fragment&&c.fragment.c();t.intro&&ee(e.$$.fragment),te(e,t.target,t.anchor),I(),q()}m(l)}class Ae{$$=void 0;$$set=void 0;$destroy(){ne(this,1),this.$destroy=$}$on(t,n){if(!T(n))return $;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!H(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const re="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(re);export{T as A,ce as B,pe as C,se as D,de as E,xe as F,j as G,Ae as S,ae as a,U as b,ye as c,be as d,G as e,J as f,me as g,R as h,ke as i,he as j,oe as k,F as l,ge as m,_e as n,$e as o,$ as p,fe as q,g as r,le as s,N as t,ue as u,Ee as v,we as w,ve as x,Ne as y,L as z}; diff --git a/docs/_astro/index.v-SePH8U.js b/docs/_astro/index.v-SePH8U.js deleted file mode 100644 index 7cab1d0..0000000 --- a/docs/_astro/index.v-SePH8U.js +++ /dev/null @@ -1 +0,0 @@ -function $(){}function T(e){return e()}function C(){return Object.create(null)}function g(e){e.forEach(T)}function B(e){return typeof e=="function"}function ce(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let b;function se(e,t){return e===t?!0:(b||(b=document.createElement("a")),b.href=t,e===b.href)}function P(e){return Object.keys(e).length===0}function q(e,...t){if(e==null){for(const i of t)i(void 0);return $}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ue(e,t,n){e.$$.on_destroy.push(q(t,n))}function oe(e){return e??""}let x=!1;function L(){x=!0}function I(){x=!1}function M(e,t,n,i){for(;e>1);n(r)<=i?e=r+1:t=r}return e}function z(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const l=[];for(let s=0;s0&&t[n[r]].claim_order<=s?r+1:M(1,r,y=>t[n[y]].claim_order,s))-1;i[l]=n[f]+1;const a=f+1;n[a]=l,r=Math.max(a,r)}const u=[],c=[];let o=t.length-1;for(let l=n[r]+1;l!=0;l=i[l-1]){for(u.push(t[l-1]);o>=l;o--)c.push(t[o]);o--}for(;o>=0;o--)c.push(t[o]);u.reverse(),c.sort((l,s)=>l.claim_order-s.claim_order);for(let l=0,s=0;l=u[s].claim_order;)s++;const f=se.removeEventListener(t,n,i)}function me(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function pe(e){return e.dataset.svelteH}function ye(e){return e===""?null:+e}function U(e){return Array.from(e.childNodes)}function V(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function H(e,t,n,i,r=!1){V(e);const u=(()=>{for(let c=e.claim_info.last_index;c=0;c--){const o=e[c];if(t(o)){const l=n(o);return l===void 0?e.splice(c,1):e[c]=l,r?l===void 0&&e.claim_info.last_index--:e.claim_info.last_index=c,o}}return i()})();return u.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,u}function W(e,t,n,i){return H(e,r=>r.nodeName===t,r=>{const u=[];for(let c=0;cr.removeAttribute(c))},()=>i(t))}function be(e,t,n){return W(e,t,n,G)}function J(e,t){return H(e,n=>n.nodeType===3,n=>{const i=""+t;if(n.data.startsWith(i)){if(n.data.length!==i.length)return n.splitText(i.length)}else n.data=i},()=>k(t),!0)}function $e(e){return J(e," ")}function ge(e,t){t=""+t,e.data!==t&&(e.data=t)}function xe(e,t){e.value=t??""}function ve(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function we(e,t,n){e.classList.toggle(t,!!n)}function K(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}function Ee(e,t){const n=[];let i=0;for(const r of t.childNodes)if(r.nodeType===8){const u=r.textContent.trim();u===`HEAD_${e}_END`?(i-=1,n.push(r)):u===`HEAD_${e}_START`&&(i+=1,n.push(r))}else i>0&&n.push(r);return n}let p;function m(e){p=e}function N(){if(!p)throw new Error("Function called outside component initialization");return p}function ke(e){N().$$.on_mount.push(e)}function Ne(e){N().$$.on_destroy.push(e)}function Ae(){const e=N();return(t,n,{cancelable:i=!1}={})=>{const r=e.$$.callbacks[t];if(r){const u=K(t,n,{cancelable:i});return r.slice().forEach(c=>{c.call(e,u)}),!u.defaultPrevented}return!0}}const _=[],j=[];let h=[];const D=[],Q=Promise.resolve();let w=!1;function X(){w||(w=!0,Q.then(O))}function E(e){h.push(e)}const v=new Set;let d=0;function O(){if(d!==0)return;const e=p;do{try{for(;d<_.length;){const t=_[d];d++,m(t),Y(t.$$)}}catch(t){throw _.length=0,d=0,t}for(m(null),_.length=0,d=0;j.length;)j.pop()();for(let t=0;te.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),h=t}const ee=new Set;function te(e,t){e&&e.i&&(ee.delete(e),e.i(t))}function ne(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),E(()=>{const u=e.$$.on_mount.map(T).filter(B);e.$$.on_destroy?e.$$.on_destroy.push(...u):g(u),e.$$.on_mount=[]}),r.forEach(E)}function ie(e,t){const n=e.$$;n.fragment!==null&&(Z(n.after_update),g(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function re(e,t){e.$$.dirty[0]===-1&&(_.push(e),X(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const S=A.length?A[0]:y;return s.ctx&&r(s.ctx[a],s.ctx[a]=S)&&(!s.skip_bound&&s.bound[a]&&s.bound[a](S),f&&re(e,a)),y}):[],s.update(),f=!0,g(s.before_update),s.fragment=i?i(s.ctx):!1,t.target){if(t.hydrate){L();const a=U(t.target);s.fragment&&s.fragment.l(a),a.forEach(R)}else s.fragment&&s.fragment.c();t.intro&&te(e.$$.fragment),ne(e,t.target,t.anchor),I(),O()}m(l)}class Ce{$$=void 0;$$set=void 0;$destroy(){ie(this,1),this.$destroy=$}$on(t,n){if(!B(n))return $;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!P(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const le="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(le);export{B as A,se as B,ye as C,oe as D,_e as E,ve as F,j as G,Ae as H,Ce as S,de as a,U as b,be as c,$e as d,G as e,J as f,pe as g,R as h,Se as i,me as j,ae as k,F as l,xe as m,he as n,ge as o,$ as p,fe as q,g as r,ce as s,k as t,ue as u,Ee as v,we as w,ke as x,Ne as y,q as z}; diff --git a/docs/_astro/npchandler.B5V8c1BD.js b/docs/_astro/npchandler.B5V8c1BD.js deleted file mode 100644 index 2bb7148..0000000 --- a/docs/_astro/npchandler.B5V8c1BD.js +++ /dev/null @@ -1,3814 +0,0 @@ -import{j as Ai}from"./jsx-runtime.BPj4-Rfu.js";import{r as lt,g as tm,R as jS,c as ny}from"./index.SSXOyoI7.js";import{p as YS}from"./index.DxhZiom7.js";import{t as hi}from"./index.BH1EYZ08.js";function iy(r){return r.type==="ROLL_DICE"}var KS=(r=>(r.DARK="dark",r.LIGHT="light",r))(KS||{});function JS(r,e,t){let n=new Set([...e,void 0]);return r.listen((i,s)=>{n.has(s)&&t(i,s)})}function fv(r,e){return function(){return r.apply(e,arguments)}}const{toString:ZS}=Object.prototype,{getPrototypeOf:nm}=Object,Vh=(r=>e=>{const t=ZS.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ss=r=>(r=r.toLowerCase(),e=>Vh(e)===r),Gh=r=>e=>typeof e===r,{isArray:vl}=Array,fc=Gh("undefined");function $S(r){return r!==null&&!fc(r)&&r.constructor!==null&&!fc(r.constructor)&&br(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const dv=ss("ArrayBuffer");function QS(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&dv(r.buffer),e}const eM=Gh("string"),br=Gh("function"),pv=Gh("number"),Wh=r=>r!==null&&typeof r=="object",tM=r=>r===!0||r===!1,_h=r=>{if(Vh(r)!=="object")return!1;const e=nm(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},nM=ss("Date"),iM=ss("File"),rM=ss("Blob"),sM=ss("FileList"),oM=r=>Wh(r)&&br(r.pipe),aM=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||br(r.append)&&((e=Vh(r))==="formdata"||e==="object"&&br(r.toString)&&r.toString()==="[object FormData]"))},lM=ss("URLSearchParams"),cM=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Uc(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),vl(r))for(n=0,i=r.length;n0;)if(i=t[n],e===i.toLowerCase())return i;return null}const gv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yv=r=>!fc(r)&&r!==gv;function tp(){const{caseless:r}=yv(this)&&this||{},e={},t=(n,i)=>{const s=r&&mv(e,i)||i;_h(e[s])&&_h(n)?e[s]=tp(e[s],n):_h(n)?e[s]=tp({},n):vl(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n(Uc(e,(i,s)=>{t&&br(i)?r[s]=fv(i,t):r[s]=i},{allOwnKeys:n}),r),hM=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),fM=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},dM=(r,e,t,n)=>{let i,s,o;const c={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)o=i[s],(!n||n(o,r,e))&&!c[o]&&(e[o]=r[o],c[o]=!0);r=t!==!1&&nm(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},pM=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},mM=r=>{if(!r)return null;if(vl(r))return r;let e=r.length;if(!pv(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},gM=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&nm(Uint8Array)),yM=(r,e)=>{const n=(r&&r[Symbol.iterator]).call(r);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(r,s[0],s[1])}},vM=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},_M=ss("HTMLFormElement"),xM=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),ry=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),SM=ss("RegExp"),vv=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};Uc(t,(i,s)=>{let o;(o=e(i,s,r))!==!1&&(n[s]=o||i)}),Object.defineProperties(r,n)},MM=r=>{vv(r,(e,t)=>{if(br(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(br(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},wM=(r,e)=>{const t={},n=i=>{i.forEach(s=>{t[s]=!0})};return vl(r)?n(r):n(String(r).split(e)),t},bM=()=>{},EM=(r,e)=>(r=+r,Number.isFinite(r)?r:e),rd="abcdefghijklmnopqrstuvwxyz",sy="0123456789",_v={DIGIT:sy,ALPHA:rd,ALPHA_DIGIT:rd+rd.toUpperCase()+sy},TM=(r=16,e=_v.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function AM(r){return!!(r&&br(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const CM=r=>{const e=new Array(10),t=(n,i)=>{if(Wh(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=vl(n)?[]:{};return Uc(n,(o,c)=>{const u=t(o,i+1);!fc(u)&&(s[c]=u)}),e[i]=void 0,s}}return n};return t(r,0)},RM=ss("AsyncFunction"),PM=r=>r&&(Wh(r)||br(r))&&br(r.then)&&br(r.catch),Ue={isArray:vl,isArrayBuffer:dv,isBuffer:$S,isFormData:aM,isArrayBufferView:QS,isString:eM,isNumber:pv,isBoolean:tM,isObject:Wh,isPlainObject:_h,isUndefined:fc,isDate:nM,isFile:iM,isBlob:rM,isRegExp:SM,isFunction:br,isStream:oM,isURLSearchParams:lM,isTypedArray:gM,isFileList:sM,forEach:Uc,merge:tp,extend:uM,trim:cM,stripBOM:hM,inherits:fM,toFlatObject:dM,kindOf:Vh,kindOfTest:ss,endsWith:pM,toArray:mM,forEachEntry:yM,matchAll:vM,isHTMLForm:_M,hasOwnProperty:ry,hasOwnProp:ry,reduceDescriptors:vv,freezeMethods:MM,toObjectSet:wM,toCamelCase:xM,noop:bM,toFiniteNumber:EM,findKey:mv,global:gv,isContextDefined:yv,ALPHABET:_v,generateString:TM,isSpecCompliantForm:AM,toJSONObject:CM,isAsyncFn:RM,isThenable:PM};function an(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i)}Ue.inherits(an,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ue.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const xv=an.prototype,Sv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Sv[r]={value:r}});Object.defineProperties(an,Sv);Object.defineProperty(xv,"isAxiosError",{value:!0});an.from=(r,e,t,n,i,s)=>{const o=Object.create(xv);return Ue.toFlatObject(r,o,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),an.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,s&&Object.assign(o,s),o};const IM=null;function np(r){return Ue.isPlainObject(r)||Ue.isArray(r)}function Mv(r){return Ue.endsWith(r,"[]")?r.slice(0,-2):r}function oy(r,e,t){return r?r.concat(e).map(function(i,s){return i=Mv(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function LM(r){return Ue.isArray(r)&&!r.some(np)}const NM=Ue.toFlatObject(Ue,{},null,function(e){return/^is[A-Z]/.test(e)});function Xh(r,e,t){if(!Ue.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=Ue.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,M){return!Ue.isUndefined(M[E])});const n=t.metaTokens,i=t.visitor||f,s=t.dots,o=t.indexes,u=(t.Blob||typeof Blob<"u"&&Blob)&&Ue.isSpecCompliantForm(e);if(!Ue.isFunction(i))throw new TypeError("visitor must be a function");function h(x){if(x===null)return"";if(Ue.isDate(x))return x.toISOString();if(!u&&Ue.isBlob(x))throw new an("Blob is not supported. Use a Buffer instead.");return Ue.isArrayBuffer(x)||Ue.isTypedArray(x)?u&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function f(x,E,M){let S=x;if(x&&!M&&typeof x=="object"){if(Ue.endsWith(E,"{}"))E=n?E:E.slice(0,-2),x=JSON.stringify(x);else if(Ue.isArray(x)&&LM(x)||(Ue.isFileList(x)||Ue.endsWith(E,"[]"))&&(S=Ue.toArray(x)))return E=Mv(E),S.forEach(function(T,I){!(Ue.isUndefined(T)||T===null)&&e.append(o===!0?oy([E],I,s):o===null?E:E+"[]",h(T))}),!1}return np(x)?!0:(e.append(oy(M,E,s),h(x)),!1)}const p=[],g=Object.assign(NM,{defaultVisitor:f,convertValue:h,isVisitable:np});function v(x,E){if(!Ue.isUndefined(x)){if(p.indexOf(x)!==-1)throw Error("Circular reference detected in "+E.join("."));p.push(x),Ue.forEach(x,function(S,A){(!(Ue.isUndefined(S)||S===null)&&i.call(e,S,Ue.isString(A)?A.trim():A,E,g))===!0&&v(S,E?E.concat(A):[A])}),p.pop()}}if(!Ue.isObject(r))throw new TypeError("data must be an object");return v(r),e}function ay(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function im(r,e){this._pairs=[],r&&Xh(r,this,e)}const wv=im.prototype;wv.append=function(e,t){this._pairs.push([e,t])};wv.toString=function(e){const t=e?function(n){return e.call(this,n,ay)}:ay;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function DM(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bv(r,e,t){if(!e)return r;const n=t&&t.encode||DM,i=t&&t.serialize;let s;if(i?s=i(e,t):s=Ue.isURLSearchParams(e)?e.toString():new im(e,t).toString(n),s){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class ly{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ue.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Ev={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},OM=typeof URLSearchParams<"u"?URLSearchParams:im,UM=typeof FormData<"u"?FormData:null,FM=typeof Blob<"u"?Blob:null,BM={isBrowser:!0,classes:{URLSearchParams:OM,FormData:UM,Blob:FM},protocols:["http","https","file","blob","url","data"]},Tv=typeof window<"u"&&typeof document<"u",kM=(r=>Tv&&["ReactNative","NativeScript","NS"].indexOf(r)<0)(typeof navigator<"u"&&navigator.product),zM=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",HM=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tv,hasStandardBrowserEnv:kM,hasStandardBrowserWebWorkerEnv:zM},Symbol.toStringTag,{value:"Module"})),$r={...HM,...BM};function VM(r,e){return Xh(r,new $r.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,s){return $r.isNode&&Ue.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function GM(r){return Ue.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function WM(r){const e={},t=Object.keys(r);let n;const i=t.length;let s;for(n=0;n=t.length;return o=!o&&Ue.isArray(i)?i.length:o,u?(Ue.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!c):((!i[o]||!Ue.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],s)&&Ue.isArray(i[o])&&(i[o]=WM(i[o])),!c)}if(Ue.isFormData(r)&&Ue.isFunction(r.entries)){const t={};return Ue.forEachEntry(r,(n,i)=>{e(GM(n),i,t,0)}),t}return null}function XM(r,e,t){if(Ue.isString(r))try{return(e||JSON.parse)(r),Ue.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const rm={transitional:Ev,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=Ue.isObject(e);if(s&&Ue.isHTMLForm(e)&&(e=new FormData(e)),Ue.isFormData(e))return i?JSON.stringify(Av(e)):e;if(Ue.isArrayBuffer(e)||Ue.isBuffer(e)||Ue.isStream(e)||Ue.isFile(e)||Ue.isBlob(e))return e;if(Ue.isArrayBufferView(e))return e.buffer;if(Ue.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return VM(e,this.formSerializer).toString();if((c=Ue.isFileList(e))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Xh(c?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),XM(e)):e}],transformResponse:[function(e){const t=this.transitional||rm.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&Ue.isString(e)&&(n&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?an.from(c,an.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$r.classes.FormData,Blob:$r.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ue.forEach(["delete","get","head","post","put","patch"],r=>{rm.headers[r]={}});const sm=rm,qM=Ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),jM=r=>{const e={};let t,n,i;return r&&r.split(` -`).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!t||e[t]&&qM[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},cy=Symbol("internals");function ql(r){return r&&String(r).trim().toLowerCase()}function xh(r){return r===!1||r==null?r:Ue.isArray(r)?r.map(xh):String(r)}function YM(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const KM=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function sd(r,e,t,n,i){if(Ue.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!Ue.isString(e)){if(Ue.isString(n))return e.indexOf(n)!==-1;if(Ue.isRegExp(n))return n.test(e)}}function JM(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ZM(r,e){const t=Ue.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}class qh{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(c,u,h){const f=ql(u);if(!f)throw new Error("header name must be a non-empty string");const p=Ue.findKey(i,f);(!p||i[p]===void 0||h===!0||h===void 0&&i[p]!==!1)&&(i[p||u]=xh(c))}const o=(c,u)=>Ue.forEach(c,(h,f)=>s(h,f,u));return Ue.isPlainObject(e)||e instanceof this.constructor?o(e,t):Ue.isString(e)&&(e=e.trim())&&!KM(e)?o(jM(e),t):e!=null&&s(t,e,n),this}get(e,t){if(e=ql(e),e){const n=Ue.findKey(this,e);if(n){const i=this[n];if(!t)return i;if(t===!0)return YM(i);if(Ue.isFunction(t))return t.call(this,i,n);if(Ue.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ql(e),e){const n=Ue.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||sd(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let i=!1;function s(o){if(o=ql(o),o){const c=Ue.findKey(n,o);c&&(!t||sd(n,n[c],c,t))&&(delete n[c],i=!0)}}return Ue.isArray(e)?e.forEach(s):s(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const s=t[n];(!e||sd(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const t=this,n={};return Ue.forEach(this,(i,s)=>{const o=Ue.findKey(n,s);if(o){t[o]=xh(i),delete t[s];return}const c=e?JM(s):String(s).trim();c!==s&&delete t[s],t[c]=xh(i),n[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ue.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&Ue.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[cy]=this[cy]={accessors:{}}).accessors,i=this.prototype;function s(o){const c=ql(o);n[c]||(ZM(i,o),n[c]=!0)}return Ue.isArray(e)?e.forEach(s):s(e),this}}qh.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ue.reduceDescriptors(qh.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});Ue.freezeMethods(qh);const ws=qh;function od(r,e){const t=this||sm,n=e||t,i=ws.from(n.headers);let s=n.data;return Ue.forEach(r,function(c){s=c.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Cv(r){return!!(r&&r.__CANCEL__)}function Fc(r,e,t){an.call(this,r??"canceled",an.ERR_CANCELED,e,t),this.name="CanceledError"}Ue.inherits(Fc,an,{__CANCEL__:!0});function $M(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new an("Request failed with status code "+t.status,[an.ERR_BAD_REQUEST,an.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const QM=$r.hasStandardBrowserEnv?{write(r,e,t,n,i,s){const o=[r+"="+encodeURIComponent(e)];Ue.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),Ue.isString(n)&&o.push("path="+n),Ue.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ew(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function tw(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function Rv(r,e){return r&&!ew(e)?tw(r,e):e}const nw=$r.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function i(s){let o=s;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=i(window.location.href),function(o){const c=Ue.isString(o)?i(o):o;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function iw(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function rw(r,e){r=r||10;const t=new Array(r),n=new Array(r);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),f=n[s];o||(o=h),t[i]=u,n[i]=h;let p=s,g=0;for(;p!==i;)g+=t[p++],p=p%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),h-o{const s=i.loaded,o=i.lengthComputable?i.total:void 0,c=s-t,u=n(c),h=s<=o;t=s;const f={loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&h?(o-s)/u:void 0,event:i};f[e?"download":"upload"]=!0,r(f)}}const sw=typeof XMLHttpRequest<"u",ow=sw&&function(r){return new Promise(function(t,n){let i=r.data;const s=ws.from(r.headers).normalize();let{responseType:o,withXSRFToken:c}=r,u;function h(){r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let f;if(Ue.isFormData(i)){if($r.hasStandardBrowserEnv||$r.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((f=s.getContentType())!==!1){const[E,...M]=f?f.split(";").map(S=>S.trim()).filter(Boolean):[];s.setContentType([E||"multipart/form-data",...M].join("; "))}}let p=new XMLHttpRequest;if(r.auth){const E=r.auth.username||"",M=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.set("Authorization","Basic "+btoa(E+":"+M))}const g=Rv(r.baseURL,r.url);p.open(r.method.toUpperCase(),bv(g,r.params,r.paramsSerializer),!0),p.timeout=r.timeout;function v(){if(!p)return;const E=ws.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:r,request:p};$M(function(T){t(T),h()},function(T){n(T),h()},S),p=null}if("onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(n(new an("Request aborted",an.ECONNABORTED,r,p)),p=null)},p.onerror=function(){n(new an("Network Error",an.ERR_NETWORK,r,p)),p=null},p.ontimeout=function(){let M=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||Ev;r.timeoutErrorMessage&&(M=r.timeoutErrorMessage),n(new an(M,S.clarifyTimeoutError?an.ETIMEDOUT:an.ECONNABORTED,r,p)),p=null},$r.hasStandardBrowserEnv&&(c&&Ue.isFunction(c)&&(c=c(r)),c||c!==!1&&nw(g))){const E=r.xsrfHeaderName&&r.xsrfCookieName&&QM.read(r.xsrfCookieName);E&&s.set(r.xsrfHeaderName,E)}i===void 0&&s.setContentType(null),"setRequestHeader"in p&&Ue.forEach(s.toJSON(),function(M,S){p.setRequestHeader(S,M)}),Ue.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),o&&o!=="json"&&(p.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&p.addEventListener("progress",uy(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",uy(r.onUploadProgress)),(r.cancelToken||r.signal)&&(u=E=>{p&&(n(!E||E.type?new Fc(null,r,p):E),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const x=iw(g);if(x&&$r.protocols.indexOf(x)===-1){n(new an("Unsupported protocol "+x+":",an.ERR_BAD_REQUEST,r));return}p.send(i||null)})},ip={http:IM,xhr:ow};Ue.forEach(ip,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const hy=r=>`- ${r}`,aw=r=>Ue.isFunction(r)||r===null||r===!1,Pv={getAdapter:r=>{r=Ue.isArray(r)?r:[r];const{length:e}=r;let t,n;const i={};for(let s=0;s`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : -`+s.map(hy).join(` -`):" "+hy(s[0]):"as no adapter specified";throw new an("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:ip};function ad(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Fc(null,r)}function fy(r){return ad(r),r.headers=ws.from(r.headers),r.data=od.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Pv.getAdapter(r.adapter||sm.adapter)(r).then(function(n){return ad(r),n.data=od.call(r,r.transformResponse,n),n.headers=ws.from(n.headers),n},function(n){return Cv(n)||(ad(r),n&&n.response&&(n.response.data=od.call(r,r.transformResponse,n.response),n.response.headers=ws.from(n.response.headers))),Promise.reject(n)})}const dy=r=>r instanceof ws?r.toJSON():r;function fl(r,e){e=e||{};const t={};function n(h,f,p){return Ue.isPlainObject(h)&&Ue.isPlainObject(f)?Ue.merge.call({caseless:p},h,f):Ue.isPlainObject(f)?Ue.merge({},f):Ue.isArray(f)?f.slice():f}function i(h,f,p){if(Ue.isUndefined(f)){if(!Ue.isUndefined(h))return n(void 0,h,p)}else return n(h,f,p)}function s(h,f){if(!Ue.isUndefined(f))return n(void 0,f)}function o(h,f){if(Ue.isUndefined(f)){if(!Ue.isUndefined(h))return n(void 0,h)}else return n(void 0,f)}function c(h,f,p){if(p in e)return n(h,f);if(p in r)return n(void 0,h)}const u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(h,f)=>i(dy(h),dy(f),!0)};return Ue.forEach(Object.keys(Object.assign({},r,e)),function(f){const p=u[f]||i,g=p(r[f],e[f],f);Ue.isUndefined(g)&&p!==c||(t[f]=g)}),t}const Iv="1.6.7",om={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{om[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});const py={};om.transitional=function(e,t,n){function i(s,o){return"[Axios v"+Iv+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,c)=>{if(e===!1)throw new an(i(o," has been removed"+(t?" in "+t:"")),an.ERR_DEPRECATED);return t&&!py[o]&&(py[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,c):!0}};function lw(r,e,t){if(typeof r!="object")throw new an("options must be an object",an.ERR_BAD_OPTION_VALUE);const n=Object.keys(r);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const c=r[s],u=c===void 0||o(c,s,r);if(u!==!0)throw new an("option "+s+" must be "+u,an.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new an("Unknown option "+s,an.ERR_BAD_OPTION)}}const rp={assertOptions:lw,validators:om},Js=rp.validators;class Ih{constructor(e){this.defaults=e,this.interceptors={request:new ly,response:new ly}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+s):n.stack=s}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=fl(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&rp.assertOptions(n,{silentJSONParsing:Js.transitional(Js.boolean),forcedJSONParsing:Js.transitional(Js.boolean),clarifyTimeoutError:Js.transitional(Js.boolean)},!1),i!=null&&(Ue.isFunction(i)?t.paramsSerializer={serialize:i}:rp.assertOptions(i,{encode:Js.function,serialize:Js.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&Ue.merge(s.common,s[t.method]);s&&Ue.forEach(["delete","get","head","post","put","patch","common"],x=>{delete s[x]}),t.headers=ws.concat(o,s);const c=[];let u=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(t)===!1||(u=u&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let f,p=0,g;if(!u){const x=[fy.bind(this),void 0];for(x.unshift.apply(x,c),x.push.apply(x,h),g=x.length,f=Promise.resolve(t);p{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(c=>{n.subscribe(c),s=c}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,c){n.reason||(n.reason=new Fc(s,o,c),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new am(function(i){e=i}),cancel:e}}}const cw=am;function uw(r){return function(t){return r.apply(null,t)}}function hw(r){return Ue.isObject(r)&&r.isAxiosError===!0}const sp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sp).forEach(([r,e])=>{sp[e]=r});const fw=sp;function Lv(r){const e=new Sh(r),t=fv(Sh.prototype.request,e);return Ue.extend(t,Sh.prototype,e,{allOwnKeys:!0}),Ue.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Lv(fl(r,i))},t}const Cn=Lv(sm);Cn.Axios=Sh;Cn.CanceledError=Fc;Cn.CancelToken=cw;Cn.isCancel=Cv;Cn.VERSION=Iv;Cn.toFormData=Xh;Cn.AxiosError=an;Cn.Cancel=Cn.CanceledError;Cn.all=function(e){return Promise.all(e)};Cn.spread=uw;Cn.isAxiosError=hw;Cn.mergeConfig=fl;Cn.AxiosHeaders=ws;Cn.formToJSON=r=>Av(Ue.isHTMLForm(r)?new FormData(r):r);Cn.getAdapter=Pv.getAdapter;Cn.HttpStatusCode=fw;Cn.default=Cn;const rl="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function dw(r,e,t){for(;r.length=0;n--){const i=r%rl.length;t=rl.charAt(i)+t,r=Math.floor(r/rl.length)}return dw(t,e,rl[0])}function Nv(){const r=Date.now(),e=gw(r,10),t=mw(16);return e+t}const yw={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},vw={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},Dv={},_w={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},xw={username:"Guest",health:"100",mana:"100",energy:"100",maxHealth:"100",maxMana:"100",maxEnergy:"100",armour:"0",agility:"0",strength:"0",intelligence:"0",experience:"0",reputation:"0",faith:"0"},Sw={stats:xw,inventory:vw,state:_w},Mw={tooltipItem:{id:null,position:{x:0,y:0}},submenuItem:{id:null,position:{x:0,y:0}},tooltipNPC:{id:null,position:{x:0,y:0}},isStatsMenuCollapsed:!1,isSettingsMenuCollapsed:!1,debugMode:!1},ww={gamemode:"Idle",action:{type:"ROLL_DICE",diceValues:[],isRolling:!1},textures:{side1:"",side2:"",side3:"",side4:"",side5:"",side6:""}},bw=r=>{hi(async()=>{ki.set({...ki.get(),[r.id]:r})})},Ew=r=>{hi(async()=>{const e=ki.get(),{[r]:t,...n}=e;ki.set(n)})};function da(r,e){return YS(r,e,{encode(t){return JSON.stringify(t)},decode(t){try{return JSON.parse(t)}catch{return e}}})}const Dn=da("playerData",Sw),Z2=da("quest",yw),ki=da("items",Dv),$2=da("notifications",[]),Ov=da("itemDB",Dv),op=da("settings",Mw),dc=da("minigameState",ww),Tw=r=>op.get()[r],Uv=(r,e)=>{hi(async()=>{const t=op.get();op.set({...t,[r]:e})})},Q2=()=>{hi(async()=>{try{const e=(await Cn.get("https://kbve.com/api/itemdb.json")).data,t={};Object.keys(e.key).forEach(n=>{const i=e.key[n];t[i.id]=i,t[i.name]=i}),Ov.set(t)}catch(r){console.error("Failed to reload item database:",r)}})},eI=r=>Ov.get()[r],Aw=r=>{hi(async()=>{const e=Dn.get();e.inventory.backpack.push(r),Dn.set({...e})})},Cw=r=>{const t=ki.get()[r];if(t)return t;console.warn(`Item with ID ${r} not found.`)},tI=r=>{hi(async()=>{const e=Nv(),t={...r,id:e};bw(t),Aw(t.id),_s.emit("notification",{title:"Success",message:`You got a ${t.name}, verified by E Corp ID ${t.id}`,notificationType:Fv.success})})},nI=(r,e)=>{hi(async()=>{const t=Dn.get(),n=ki.get()[e];if(n){const i=t.inventory.equipment[r];if(i){const s=ki.get()[i];s.equipped=!1,ki.set({...ki.get(),[s.id]:s})}n.equipped=!0,ki.set({...ki.get(),[n.id]:n}),t.inventory.equipment[r]=e,Dn.set({...t})}})},iI=r=>{hi(async()=>{const e=Dn.get(),t=e.inventory.equipment[r];if(t){const n=ki.get()[t];n&&(n.equipped=!1,ki.set({...ki.get(),[n.id]:n}),e.inventory.equipment[r]=null,Dn.set({...e}))}})},rI=r=>{hi(async()=>{const e=Dn.get(),t=ki.get()[r];t&&!t.equipped?(e.inventory.backpack=e.inventory.backpack.filter(n=>n!==r),Dn.set({...e}),Ew(r)):_s.emit("notification",{title:"Warning",message:"Cannot remove item that is currently equipped.",notificationType:Fv.warning})})},Rw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.health,10),n=Math.max(t-r,0);e.stats={...e.stats,health:n.toString()},Dn.set({...e})})},Pw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.health,10),n=parseInt(e.stats.maxHealth,10),i=Math.min(t+r,n);e.stats={...e.stats,health:i.toString()},Dn.set({...e})})},Iw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.mana,10),n=Math.max(t-r,0);e.stats={...e.stats,mana:n.toString()},Dn.set({...e})})},Lw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.mana,10),n=parseInt(e.stats.maxMana,10),i=Math.min(t+r,n);e.stats={...e.stats,mana:i.toString()},Dn.set({...e})})},Nw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.energy,10),n=Math.max(t-r,0);e.stats={...e.stats,energy:n.toString()},Dn.set({...e})})},Dw=r=>{hi(async()=>{const e=Dn.get(),t=parseInt(e.stats.energy,10),n=parseInt(e.stats.maxEnergy,10),i=Math.min(t+r,n);e.stats={...e.stats,energy:i.toString()},Dn.set({...e})})},Ow=r=>{if(r.health!==void 0){const e=parseInt(r.health,10);e>0?Pw(e):Rw(Math.abs(e))}if(r.mana!==void 0){const e=parseInt(r.mana,10);e>0?Lw(e):Iw(Math.abs(e))}if(r.energy!==void 0){const e=parseInt(r.energy,10);e>0?Dw(e):Nw(Math.abs(e))}},Uw=async r=>{const e=Nv();hi(async()=>{const t=Dn.get();t.state.activeBoosts[e]={...r,expiry:Date.now()+r.duration*1e3},Dn.set({...t})})},sI=r=>{hi(async()=>{const e=Dn.get(),t=r.bonuses,n={health:t?.health!==void 0?t.health.toString():void 0,mana:t?.mana!==void 0?t.mana.toString():void 0,energy:t?.energy!==void 0?t.energy.toString():void 0};Ow(n),r.boost&&Uw(r.boost),r.action&&console.log(`Action: ${r.action}`),Dn.set({...e})})},oI=r=>{const e=Cw(r);if(!e)return[];const t=["view","discard"];return e.consumable&&t.push("consume"),e.equipped?t.push("unequip"):e.consumable||t.push("equip"),t},Fv={caution:{type:"caution",color:"bg-yellow-200 border-yellow-300 text-yellow-700",imgUrl:"/assets/icons/notification.svg"},warning:{type:"warning",color:"bg-orange-200 border-orange-300 text-orange-700",imgUrl:"/assets/icons/notification.svg"},danger:{type:"danger",color:"bg-red-200 border-red-300 text-red-700",imgUrl:"/assets/icons/notification.svg"},success:{type:"success",color:"bg-green-200 border-green-300 text-green-700",imgUrl:"/assets/icons/notification.svg"},info:{type:"info",color:"bg-blue-200 border-blue-300 text-blue-700",imgUrl:"/assets/icons/notification.svg"}};function Bc(r){try{hi(async()=>{const e=dc.get();dc.set({...e,...r})})}catch(e){console.error("Error updating minigame state:",e)}}function Fw(r){Bc({gamemode:r})}function Bw(r){Bc({action:r})}function kw(r){Bc({textures:r})}function zw(r){const e=dc.get();e.gamemode==="Dice"&&e.action.type==="ROLL_DICE"&&Bc({action:{...e.action,diceValues:r}})}function my(r){const e=dc.get();e.gamemode==="Dice"&&e.action.type==="ROLL_DICE"&&Bc({action:{...e.action,isRolling:r}})}const Hw=()=>{Uv("debugMode",!0)},Vw=()=>{Uv("debugMode",!1)},jh=()=>Tw("debugMode"),Lh=r=>typeof r=="string"?r:JSON.stringify(r,null,2),Gw=r=>{jh()&&console.log(`[DEBUG] ${Lh(r)}`)},Ww=r=>{jh()&&console.warn(`[DEBUG] ${Lh(r)}`)},Xw=(r,e)=>{jh()&&(e instanceof Error?console.error(`[DEBUG] ${Lh(r)} - Error: ${e.message} -${e.stack}`):console.error(`[DEBUG] ${Lh(r)}`))},zt={enable:Hw,disable:Vw,isEnabled:jh,log:Gw,warn:Ww,error:Xw};class qw{constructor(){this.events={},this.lastEmitted=new Map}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e]?.push(t)}off(e,t){this.events[e]&&(this.events[e]=this.events[e]?.filter(n=>n!==t))}emit(e,t,n=0,i){const s=Date.now(),o=this.lastEmitted.get(e)||0;if(s-o>=n){if(!this.events[e])return;this.events[e]?.forEach(c=>c(t)),i&&zt.isEnabled()&&zt.log(`Event: ${String(e)} - Message: ${i}`),zt.isEnabled()&&zt.log(`Event Data: ${String(e)} - Data: ${t?JSON.stringify(t):"No data"}`),this.lastEmitted.set(e,s)}}}const _s=new qw;/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const Yh="161",jw={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Yw={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Bv=0,ap=1,kv=2,Kw=3,zv=0,Kh=1,ac=2,Dr=3,Es=0,Vi=1,Zr=2,bs=0,ra=1,lp=2,cp=3,up=4,Hv=5,oo=100,Vv=101,Gv=102,hp=103,fp=104,Wv=200,Xv=201,qv=202,jv=203,Nh=204,Dh=205,Yv=206,Kv=207,Jv=208,Zv=209,$v=210,Qv=211,e_=212,t_=213,n_=214,i_=0,r_=1,s_=2,pc=3,o_=4,a_=5,l_=6,c_=7,kc=0,u_=1,h_=2,ts=0,f_=1,d_=2,p_=3,lm=4,m_=5,g_=6,dp="attached",y_="detached",Jh=300,Ts=301,uo=302,mc=303,gc=304,_l=306,yc=1e3,Ci=1001,vc=1002,Xn=1003,Oh=1004,Jw=1004,$o=1005,Zw=1005,Un=1006,lc=1007,$w=1007,Qr=1008,Qw=1008,ns=1009,v_=1010,__=1011,Zh=1012,cm=1013,Ss=1014,wr=1015,dl=1016,um=1017,hm=1018,ao=1020,x_=1021,zi=1023,S_=1024,M_=1025,lo=1026,ua=1027,w_=1028,fm=1029,b_=1030,dm=1031,pm=1033,Mh=33776,wh=33777,bh=33778,Eh=33779,pp=35840,mp=35841,gp=35842,yp=35843,mm=36196,vp=37492,_p=37496,xp=37808,Sp=37809,Mp=37810,wp=37811,bp=37812,Ep=37813,Tp=37814,Ap=37815,Cp=37816,Rp=37817,Pp=37818,Ip=37819,Lp=37820,Np=37821,Th=36492,Dp=36494,Op=36495,E_=36283,Up=36284,Fp=36285,Bp=36286,T_=2200,A_=2201,C_=2202,_c=2300,xc=2301,Ah=2302,ea=2400,ta=2401,Sc=2402,$h=2500,gm=2501,eb=0,tb=1,nb=2,ym=3e3,co=3001,R_=3200,P_=3201,fo=0,I_=1,ur="",ti="srgb",rs="srgb-linear",Qh="display-p3",zc="display-p3-linear",Mc="linear",An="srgb",wc="rec709",bc="p3",ib=0,Jo=7680,rb=7681,sb=7682,ob=7683,ab=34055,lb=34056,cb=5386,ub=512,hb=513,fb=514,db=515,pb=516,mb=517,gb=518,kp=519,L_=512,N_=513,D_=514,vm=515,O_=516,U_=517,F_=518,B_=519,Ec=35044,yb=35048,vb=35040,_b=35045,xb=35049,Sb=35041,Mb=35046,wb=35050,bb=35042,Eb="100",zp="300 es",Uh=1035,es=2e3,Tc=2001;class Cs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s>8&255]+bi[r>>16&255]+bi[r>>24&255]+"-"+bi[e&255]+bi[e>>8&255]+"-"+bi[e>>16&15|64]+bi[e>>24&255]+"-"+bi[t&63|128]+bi[t>>8&255]+"-"+bi[t>>16&255]+bi[t>>24&255]+bi[n&255]+bi[n>>8&255]+bi[n>>16&255]+bi[n>>24&255]).toLowerCase()}function Hn(r,e,t){return Math.max(e,Math.min(t,r))}function _m(r,e){return(r%e+e)%e}function Tb(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Ab(r,e,t){return r!==e?(t-r)/(e-r):0}function cc(r,e,t){return(1-t)*r+t*e}function Cb(r,e,t,n){return cc(r,e,1-Math.exp(-t*n))}function Rb(r,e=1){return e-Math.abs(_m(r,e*2)-e)}function Pb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Ib(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function Lb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Nb(r,e){return r+Math.random()*(e-r)}function Db(r){return r*(.5-Math.random())}function Ob(r){r!==void 0&&(gy=r);let e=gy+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Ub(r){return r*sa}function Fb(r){return r*pl}function Hp(r){return(r&r-1)===0&&r!==0}function Bb(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Fh(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function kb(r,e,t,n,i){const s=Math.cos,o=Math.sin,c=s(t/2),u=o(t/2),h=s((e+n)/2),f=o((e+n)/2),p=s((e-n)/2),g=o((e-n)/2),v=s((n-e)/2),x=o((n-e)/2);switch(i){case"XYX":r.set(c*f,u*p,u*g,c*h);break;case"YZY":r.set(u*g,c*f,u*p,c*h);break;case"ZXZ":r.set(u*p,u*g,c*f,c*h);break;case"XZX":r.set(c*f,u*x,u*v,c*h);break;case"YXY":r.set(u*v,c*f,u*x,c*h);break;case"ZYZ":r.set(u*x,u*v,c*f,c*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Hi(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Yt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Ch={DEG2RAD:sa,RAD2DEG:pl,generateUUID:fr,clamp:Hn,euclideanModulo:_m,mapLinear:Tb,inverseLerp:Ab,lerp:cc,damp:Cb,pingpong:Rb,smoothstep:Pb,smootherstep:Ib,randInt:Lb,randFloat:Nb,randFloatSpread:Db,seededRandom:Ob,degToRad:Ub,radToDeg:Fb,isPowerOfTwo:Hp,ceilPowerOfTwo:Bb,floorPowerOfTwo:Fh,setQuaternionFromProperEuler:kb,normalize:Yt,denormalize:Hi};class Be{constructor(e=0,t=0){Be.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Hn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class en{constructor(e,t,n,i,s,o,c,u,h){en.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,u,h)}set(e,t,n,i,s,o,c,u,h){const f=this.elements;return f[0]=e,f[1]=i,f[2]=c,f[3]=t,f[4]=s,f[5]=u,f[6]=n,f[7]=o,f[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[3],u=n[6],h=n[1],f=n[4],p=n[7],g=n[2],v=n[5],x=n[8],E=i[0],M=i[3],S=i[6],A=i[1],T=i[4],I=i[7],z=i[2],U=i[5],F=i[8];return s[0]=o*E+c*A+u*z,s[3]=o*M+c*T+u*U,s[6]=o*S+c*I+u*F,s[1]=h*E+f*A+p*z,s[4]=h*M+f*T+p*U,s[7]=h*S+f*I+p*F,s[2]=g*E+v*A+x*z,s[5]=g*M+v*T+x*U,s[8]=g*S+v*I+x*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],h=e[7],f=e[8];return t*o*f-t*c*h-n*s*f+n*c*u+i*s*h-i*o*u}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],h=e[7],f=e[8],p=f*o-c*h,g=c*u-f*s,v=h*s-o*u,x=t*p+n*g+i*v;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/x;return e[0]=p*E,e[1]=(i*h-f*n)*E,e[2]=(c*n-i*o)*E,e[3]=g*E,e[4]=(f*t-i*u)*E,e[5]=(i*s-c*t)*E,e[6]=v*E,e[7]=(n*u-h*t)*E,e[8]=(o*t-n*s)*E,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,c){const u=Math.cos(s),h=Math.sin(s);return this.set(n*u,n*h,-n*(u*o+h*c)+o+e,-i*h,i*u,-i*(-h*o+u*c)+c+t,0,0,1),this}scale(e,t){return this.premultiply(ld.makeScale(e,t)),this}rotate(e){return this.premultiply(ld.makeRotation(-e)),this}translate(e,t){return this.premultiply(ld.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const ld=new en;function k_(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}const zb={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function sl(r,e){return new zb[r](e)}function Ac(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function z_(){const r=Ac("canvas");return r.style.display="block",r}const yy={};function oa(r){r in yy||(yy[r]=!0,console.warn(r))}const vy=new en().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),_y=new en().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Tu={[rs]:{transfer:Mc,primaries:wc,toReference:r=>r,fromReference:r=>r},[ti]:{transfer:An,primaries:wc,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[zc]:{transfer:Mc,primaries:bc,toReference:r=>r.applyMatrix3(_y),fromReference:r=>r.applyMatrix3(vy)},[Qh]:{transfer:An,primaries:bc,toReference:r=>r.convertSRGBToLinear().applyMatrix3(_y),fromReference:r=>r.applyMatrix3(vy).convertLinearToSRGB()}},Hb=new Set([rs,zc]),yn={enabled:!0,_workingColorSpace:rs,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!Hb.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=Tu[e].toReference,i=Tu[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return Tu[r].primaries},getTransfer:function(r){return r===ur?Mc:Tu[r].transfer}};function hl(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function cd(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let Na;class xm{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Na===void 0&&(Na=Ac("canvas")),Na.width=e.width,Na.height=e.height;const n=Na.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Na}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ac("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Jh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case yc:e.x=e.x-Math.floor(e.x);break;case Ci:e.x=e.x<0?0:1;break;case vc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case yc:e.y=e.y-Math.floor(e.y);break;case Ci:e.y=e.y<0?0:1;break;case vc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return oa("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===ti?co:ym}set encoding(e){oa("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===co?ti:ur}}Bn.DEFAULT_IMAGE=null;Bn.DEFAULT_MAPPING=Jh;Bn.DEFAULT_ANISOTROPY=1;class vn{constructor(e=0,t=0,n=0,i=1){vn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const u=e.elements,h=u[0],f=u[4],p=u[8],g=u[1],v=u[5],x=u[9],E=u[2],M=u[6],S=u[10];if(Math.abs(f-g)<.01&&Math.abs(p-E)<.01&&Math.abs(x-M)<.01){if(Math.abs(f+g)<.1&&Math.abs(p+E)<.1&&Math.abs(x+M)<.1&&Math.abs(h+v+S-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const T=(h+1)/2,I=(v+1)/2,z=(S+1)/2,U=(f+g)/4,F=(p+E)/4,Y=(x+M)/4;return T>I&&T>z?T<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(T),i=U/n,s=F/n):I>z?I<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(I),n=U/i,s=Y/i):z<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(z),n=F/s,i=Y/s),this.set(n,i,s,t),this}let A=Math.sqrt((M-x)*(M-x)+(p-E)*(p-E)+(g-f)*(g-f));return Math.abs(A)<.001&&(A=1),this.x=(M-x)/A,this.y=(p-E)/A,this.z=(g-f)/A,this.w=Math.acos((h+v+S-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class H_ extends Cs{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new vn(0,0,e,t),this.scissorTest=!1,this.viewport=new vn(0,0,e,t);const i={width:e,height:t,depth:1};n.encoding!==void 0&&(oa("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===co?ti:ur),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Un,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new Bn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new na(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fr extends H_{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class ef extends Bn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Xn,this.minFilter=Xn,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Wb extends Fr{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new ef(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class Sm extends Bn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Xn,this.minFilter=Xn,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Xb extends Fr{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Sm(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class qb extends Fr{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,T=1-S*S;if(T>Number.EPSILON){const z=Math.sqrt(T),U=Math.atan2(z,S*A);M=Math.sin(M*U)/z,c=Math.sin(c*U)/z}const I=c*A;if(u=u*M+g*I,h=h*M+v*I,f=f*M+x*I,p=p*M+E*I,M===1-c){const z=1/Math.sqrt(u*u+h*h+f*f+p*p);u*=z,h*=z,f*=z,p*=z}}e[t]=u,e[t+1]=h,e[t+2]=f,e[t+3]=p}static multiplyQuaternionsFlat(e,t,n,i,s,o){const c=n[i],u=n[i+1],h=n[i+2],f=n[i+3],p=s[o],g=s[o+1],v=s[o+2],x=s[o+3];return e[t]=c*x+f*p+u*v-h*g,e[t+1]=u*x+f*g+h*p-c*v,e[t+2]=h*x+f*v+c*g-u*p,e[t+3]=f*x-c*p-u*g-h*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,o=e._order,c=Math.cos,u=Math.sin,h=c(n/2),f=c(i/2),p=c(s/2),g=u(n/2),v=u(i/2),x=u(s/2);switch(o){case"XYZ":this._x=g*f*p+h*v*x,this._y=h*v*p-g*f*x,this._z=h*f*x+g*v*p,this._w=h*f*p-g*v*x;break;case"YXZ":this._x=g*f*p+h*v*x,this._y=h*v*p-g*f*x,this._z=h*f*x-g*v*p,this._w=h*f*p+g*v*x;break;case"ZXY":this._x=g*f*p-h*v*x,this._y=h*v*p+g*f*x,this._z=h*f*x+g*v*p,this._w=h*f*p-g*v*x;break;case"ZYX":this._x=g*f*p-h*v*x,this._y=h*v*p+g*f*x,this._z=h*f*x-g*v*p,this._w=h*f*p+g*v*x;break;case"YZX":this._x=g*f*p+h*v*x,this._y=h*v*p+g*f*x,this._z=h*f*x-g*v*p,this._w=h*f*p-g*v*x;break;case"XZY":this._x=g*f*p-h*v*x,this._y=h*v*p-g*f*x,this._z=h*f*x+g*v*p,this._w=h*f*p+g*v*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],c=t[5],u=t[9],h=t[2],f=t[6],p=t[10],g=n+c+p;if(g>0){const v=.5/Math.sqrt(g+1);this._w=.25/v,this._x=(f-u)*v,this._y=(s-h)*v,this._z=(o-i)*v}else if(n>c&&n>p){const v=2*Math.sqrt(1+n-c-p);this._w=(f-u)/v,this._x=.25*v,this._y=(i+o)/v,this._z=(s+h)/v}else if(c>p){const v=2*Math.sqrt(1+c-n-p);this._w=(s-h)/v,this._x=(i+o)/v,this._y=.25*v,this._z=(u+f)/v}else{const v=2*Math.sqrt(1+p-n-c);this._w=(o-i)/v,this._x=(s+h)/v,this._y=(u+f)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Hn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,c=t._x,u=t._y,h=t._z,f=t._w;return this._x=n*f+o*c+i*h-s*u,this._y=i*f+o*u+s*c-n*h,this._z=s*f+o*h+n*u-i*c,this._w=o*f-n*c-i*u-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let c=o*e._w+n*e._x+i*e._y+s*e._z;if(c<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,c=-c):this.copy(e),c>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const u=1-c*c;if(u<=Number.EPSILON){const v=1-t;return this._w=v*o+t*this._w,this._x=v*n+t*this._x,this._y=v*i+t*this._y,this._z=v*s+t*this._z,this.normalize(),this}const h=Math.sqrt(u),f=Math.atan2(h,c),p=Math.sin((1-t)*f)/h,g=Math.sin(t*f)/h;return this._w=o*p+this._w*g,this._x=n*p+this._x*g,this._y=i*p+this._y*g,this._z=s*p+this._z*g,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class V{constructor(e=0,t=0,n=0){V.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(xy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(xy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,c=e.z,u=e.w,h=2*(o*i-c*n),f=2*(c*t-s*i),p=2*(s*n-o*t);return this.x=t+u*h+o*p-c*f,this.y=n+u*f+c*h-s*p,this.z=i+u*p+s*f-o*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,c=t.y,u=t.z;return this.x=i*u-s*c,this.y=s*o-n*u,this.z=n*c-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return hd.copy(this).projectOnVector(e),this.sub(hd)}reflect(e){return this.sub(hd.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Hn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const hd=new V,xy=new Qi;class Gi{constructor(e=new V(1/0,1/0,1/0),t=new V(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ir),Ir.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(jl),Cu.subVectors(this.max,jl),Da.subVectors(e.a,jl),Oa.subVectors(e.b,jl),Ua.subVectors(e.c,jl),Zs.subVectors(Oa,Da),$s.subVectors(Ua,Oa),zo.subVectors(Da,Ua);let t=[0,-Zs.z,Zs.y,0,-$s.z,$s.y,0,-zo.z,zo.y,Zs.z,0,-Zs.x,$s.z,0,-$s.x,zo.z,0,-zo.x,-Zs.y,Zs.x,0,-$s.y,$s.x,0,-zo.y,zo.x,0];return!fd(t,Da,Oa,Ua,Cu)||(t=[1,0,0,0,1,0,0,0,1],!fd(t,Da,Oa,Ua,Cu))?!1:(Ru.crossVectors(Zs,$s),t=[Ru.x,Ru.y,Ru.z],fd(t,Da,Oa,Ua,Cu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ir).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ir).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(fs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),fs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),fs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),fs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),fs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),fs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),fs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),fs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(fs),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const fs=[new V,new V,new V,new V,new V,new V,new V,new V],Ir=new V,Au=new Gi,Da=new V,Oa=new V,Ua=new V,Zs=new V,$s=new V,zo=new V,jl=new V,Cu=new V,Ru=new V,Ho=new V;function fd(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){Ho.fromArray(r,s);const c=i.x*Math.abs(Ho.x)+i.y*Math.abs(Ho.y)+i.z*Math.abs(Ho.z),u=e.dot(Ho),h=t.dot(Ho),f=n.dot(Ho);if(Math.max(-Math.max(u,h,f),Math.min(u,h,f))>c)return!1}return!0}const jb=new Gi,Yl=new V,dd=new V;class Ri{constructor(e=new V,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):jb.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Yl.subVectors(e,this.center);const t=Yl.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Yl,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(dd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Yl.copy(e.center).add(dd)),this.expandByPoint(Yl.copy(e.center).sub(dd))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ds=new V,pd=new V,Pu=new V,Qs=new V,md=new V,Iu=new V,gd=new V;class xl{constructor(e=new V,t=new V(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ds)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ds.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ds.copy(this.origin).addScaledVector(this.direction,t),ds.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){pd.copy(e).add(t).multiplyScalar(.5),Pu.copy(t).sub(e).normalize(),Qs.copy(this.origin).sub(pd);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Pu),c=Qs.dot(this.direction),u=-Qs.dot(Pu),h=Qs.lengthSq(),f=Math.abs(1-o*o);let p,g,v,x;if(f>0)if(p=o*u-c,g=o*c-u,x=s*f,p>=0)if(g>=-x)if(g<=x){const E=1/f;p*=E,g*=E,v=p*(p+o*g+2*c)+g*(o*p+g+2*u)+h}else g=s,p=Math.max(0,-(o*g+c)),v=-p*p+g*(g+2*u)+h;else g=-s,p=Math.max(0,-(o*g+c)),v=-p*p+g*(g+2*u)+h;else g<=-x?(p=Math.max(0,-(-o*s+c)),g=p>0?-s:Math.min(Math.max(-s,-u),s),v=-p*p+g*(g+2*u)+h):g<=x?(p=0,g=Math.min(Math.max(-s,-u),s),v=g*(g+2*u)+h):(p=Math.max(0,-(o*s+c)),g=p>0?s:Math.min(Math.max(-s,-u),s),v=-p*p+g*(g+2*u)+h);else g=o>0?-s:s,p=Math.max(0,-(o*g+c)),v=-p*p+g*(g+2*u)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(pd).addScaledVector(Pu,g),v}intersectSphere(e,t){ds.subVectors(e.center,this.origin);const n=ds.dot(this.direction),i=ds.dot(ds)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),c=n-o,u=n+o;return u<0?null:c<0?this.at(u,t):this.at(c,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,c,u;const h=1/this.direction.x,f=1/this.direction.y,p=1/this.direction.z,g=this.origin;return h>=0?(n=(e.min.x-g.x)*h,i=(e.max.x-g.x)*h):(n=(e.max.x-g.x)*h,i=(e.min.x-g.x)*h),f>=0?(s=(e.min.y-g.y)*f,o=(e.max.y-g.y)*f):(s=(e.max.y-g.y)*f,o=(e.min.y-g.y)*f),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o=0?(c=(e.min.z-g.z)*p,u=(e.max.z-g.z)*p):(c=(e.max.z-g.z)*p,u=(e.min.z-g.z)*p),n>u||c>i)||((c>n||n!==n)&&(n=c),(u=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ds)!==null}intersectTriangle(e,t,n,i,s){md.subVectors(t,e),Iu.subVectors(n,e),gd.crossVectors(md,Iu);let o=this.direction.dot(gd),c;if(o>0){if(i)return null;c=1}else if(o<0)c=-1,o=-o;else return null;Qs.subVectors(this.origin,e);const u=c*this.direction.dot(Iu.crossVectors(Qs,Iu));if(u<0)return null;const h=c*this.direction.dot(md.cross(Qs));if(h<0||u+h>o)return null;const f=-c*Qs.dot(gd);return f<0?null:this.at(f/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Bt{constructor(e,t,n,i,s,o,c,u,h,f,p,g,v,x,E,M){Bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,c,u,h,f,p,g,v,x,E,M)}set(e,t,n,i,s,o,c,u,h,f,p,g,v,x,E,M){const S=this.elements;return S[0]=e,S[4]=t,S[8]=n,S[12]=i,S[1]=s,S[5]=o,S[9]=c,S[13]=u,S[2]=h,S[6]=f,S[10]=p,S[14]=g,S[3]=v,S[7]=x,S[11]=E,S[15]=M,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Bt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Fa.setFromMatrixColumn(e,0).length(),s=1/Fa.setFromMatrixColumn(e,1).length(),o=1/Fa.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),c=Math.sin(n),u=Math.cos(i),h=Math.sin(i),f=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const g=o*f,v=o*p,x=c*f,E=c*p;t[0]=u*f,t[4]=-u*p,t[8]=h,t[1]=v+x*h,t[5]=g-E*h,t[9]=-c*u,t[2]=E-g*h,t[6]=x+v*h,t[10]=o*u}else if(e.order==="YXZ"){const g=u*f,v=u*p,x=h*f,E=h*p;t[0]=g+E*c,t[4]=x*c-v,t[8]=o*h,t[1]=o*p,t[5]=o*f,t[9]=-c,t[2]=v*c-x,t[6]=E+g*c,t[10]=o*u}else if(e.order==="ZXY"){const g=u*f,v=u*p,x=h*f,E=h*p;t[0]=g-E*c,t[4]=-o*p,t[8]=x+v*c,t[1]=v+x*c,t[5]=o*f,t[9]=E-g*c,t[2]=-o*h,t[6]=c,t[10]=o*u}else if(e.order==="ZYX"){const g=o*f,v=o*p,x=c*f,E=c*p;t[0]=u*f,t[4]=x*h-v,t[8]=g*h+E,t[1]=u*p,t[5]=E*h+g,t[9]=v*h-x,t[2]=-h,t[6]=c*u,t[10]=o*u}else if(e.order==="YZX"){const g=o*u,v=o*h,x=c*u,E=c*h;t[0]=u*f,t[4]=E-g*p,t[8]=x*p+v,t[1]=p,t[5]=o*f,t[9]=-c*f,t[2]=-h*f,t[6]=v*p+x,t[10]=g-E*p}else if(e.order==="XZY"){const g=o*u,v=o*h,x=c*u,E=c*h;t[0]=u*f,t[4]=-p,t[8]=h*f,t[1]=g*p+E,t[5]=o*f,t[9]=v*p-x,t[2]=x*p-v,t[6]=c*f,t[10]=E*p+g}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Yb,e,Kb)}lookAt(e,t,n){const i=this.elements;return lr.subVectors(e,t),lr.lengthSq()===0&&(lr.z=1),lr.normalize(),eo.crossVectors(n,lr),eo.lengthSq()===0&&(Math.abs(n.z)===1?lr.x+=1e-4:lr.z+=1e-4,lr.normalize(),eo.crossVectors(n,lr)),eo.normalize(),Lu.crossVectors(lr,eo),i[0]=eo.x,i[4]=Lu.x,i[8]=lr.x,i[1]=eo.y,i[5]=Lu.y,i[9]=lr.y,i[2]=eo.z,i[6]=Lu.z,i[10]=lr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],c=n[4],u=n[8],h=n[12],f=n[1],p=n[5],g=n[9],v=n[13],x=n[2],E=n[6],M=n[10],S=n[14],A=n[3],T=n[7],I=n[11],z=n[15],U=i[0],F=i[4],Y=i[8],de=i[12],L=i[1],O=i[5],pe=i[9],be=i[13],$=i[2],ye=i[6],me=i[10],Pe=i[14],G=i[3],J=i[7],ee=i[11],ue=i[15];return s[0]=o*U+c*L+u*$+h*G,s[4]=o*F+c*O+u*ye+h*J,s[8]=o*Y+c*pe+u*me+h*ee,s[12]=o*de+c*be+u*Pe+h*ue,s[1]=f*U+p*L+g*$+v*G,s[5]=f*F+p*O+g*ye+v*J,s[9]=f*Y+p*pe+g*me+v*ee,s[13]=f*de+p*be+g*Pe+v*ue,s[2]=x*U+E*L+M*$+S*G,s[6]=x*F+E*O+M*ye+S*J,s[10]=x*Y+E*pe+M*me+S*ee,s[14]=x*de+E*be+M*Pe+S*ue,s[3]=A*U+T*L+I*$+z*G,s[7]=A*F+T*O+I*ye+z*J,s[11]=A*Y+T*pe+I*me+z*ee,s[15]=A*de+T*be+I*Pe+z*ue,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],c=e[5],u=e[9],h=e[13],f=e[2],p=e[6],g=e[10],v=e[14],x=e[3],E=e[7],M=e[11],S=e[15];return x*(+s*u*p-i*h*p-s*c*g+n*h*g+i*c*v-n*u*v)+E*(+t*u*v-t*h*g+s*o*g-i*o*v+i*h*f-s*u*f)+M*(+t*h*p-t*c*v-s*o*p+n*o*v+s*c*f-n*h*f)+S*(-i*c*f-t*u*p+t*c*g+i*o*p-n*o*g+n*u*f)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],c=e[5],u=e[6],h=e[7],f=e[8],p=e[9],g=e[10],v=e[11],x=e[12],E=e[13],M=e[14],S=e[15],A=p*M*h-E*g*h+E*u*v-c*M*v-p*u*S+c*g*S,T=x*g*h-f*M*h-x*u*v+o*M*v+f*u*S-o*g*S,I=f*E*h-x*p*h+x*c*v-o*E*v-f*c*S+o*p*S,z=x*p*u-f*E*u-x*c*g+o*E*g+f*c*M-o*p*M,U=t*A+n*T+i*I+s*z;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const F=1/U;return e[0]=A*F,e[1]=(E*g*s-p*M*s-E*i*v+n*M*v+p*i*S-n*g*S)*F,e[2]=(c*M*s-E*u*s+E*i*h-n*M*h-c*i*S+n*u*S)*F,e[3]=(p*u*s-c*g*s-p*i*h+n*g*h+c*i*v-n*u*v)*F,e[4]=T*F,e[5]=(f*M*s-x*g*s+x*i*v-t*M*v-f*i*S+t*g*S)*F,e[6]=(x*u*s-o*M*s-x*i*h+t*M*h+o*i*S-t*u*S)*F,e[7]=(o*g*s-f*u*s+f*i*h-t*g*h-o*i*v+t*u*v)*F,e[8]=I*F,e[9]=(x*p*s-f*E*s-x*n*v+t*E*v+f*n*S-t*p*S)*F,e[10]=(o*E*s-x*c*s+x*n*h-t*E*h-o*n*S+t*c*S)*F,e[11]=(f*c*s-o*p*s-f*n*h+t*p*h+o*n*v-t*c*v)*F,e[12]=z*F,e[13]=(f*E*i-x*p*i+x*n*g-t*E*g-f*n*M+t*p*M)*F,e[14]=(x*c*i-o*E*i-x*n*u+t*E*u+o*n*M-t*c*M)*F,e[15]=(o*p*i-f*c*i+f*n*u-t*p*u-o*n*g+t*c*g)*F,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,c=e.y,u=e.z,h=s*o,f=s*c;return this.set(h*o+n,h*c-i*u,h*u+i*c,0,h*c+i*u,f*c+n,f*u-i*o,0,h*u-i*c,f*u+i*o,s*u*u+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,c=t._z,u=t._w,h=s+s,f=o+o,p=c+c,g=s*h,v=s*f,x=s*p,E=o*f,M=o*p,S=c*p,A=u*h,T=u*f,I=u*p,z=n.x,U=n.y,F=n.z;return i[0]=(1-(E+S))*z,i[1]=(v+I)*z,i[2]=(x-T)*z,i[3]=0,i[4]=(v-I)*U,i[5]=(1-(g+S))*U,i[6]=(M+A)*U,i[7]=0,i[8]=(x+T)*F,i[9]=(M-A)*F,i[10]=(1-(g+E))*F,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=Fa.set(i[0],i[1],i[2]).length();const o=Fa.set(i[4],i[5],i[6]).length(),c=Fa.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Lr.copy(this);const h=1/s,f=1/o,p=1/c;return Lr.elements[0]*=h,Lr.elements[1]*=h,Lr.elements[2]*=h,Lr.elements[4]*=f,Lr.elements[5]*=f,Lr.elements[6]*=f,Lr.elements[8]*=p,Lr.elements[9]*=p,Lr.elements[10]*=p,t.setFromRotationMatrix(Lr),n.x=s,n.y=o,n.z=c,this}makePerspective(e,t,n,i,s,o,c=es){const u=this.elements,h=2*s/(t-e),f=2*s/(n-i),p=(t+e)/(t-e),g=(n+i)/(n-i);let v,x;if(c===es)v=-(o+s)/(o-s),x=-2*o*s/(o-s);else if(c===Tc)v=-o/(o-s),x=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return u[0]=h,u[4]=0,u[8]=p,u[12]=0,u[1]=0,u[5]=f,u[9]=g,u[13]=0,u[2]=0,u[6]=0,u[10]=v,u[14]=x,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,n,i,s,o,c=es){const u=this.elements,h=1/(t-e),f=1/(n-i),p=1/(o-s),g=(t+e)*h,v=(n+i)*f;let x,E;if(c===es)x=(o+s)*p,E=-2*p;else if(c===Tc)x=s*p,E=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return u[0]=2*h,u[4]=0,u[8]=0,u[12]=-g,u[1]=0,u[5]=2*f,u[9]=0,u[13]=-v,u[2]=0,u[6]=0,u[10]=E,u[14]=-x,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Fa=new V,Lr=new Bt,Yb=new V(0,0,0),Kb=new V(1,1,1),eo=new V,Lu=new V,lr=new V,Sy=new Bt,My=new Qi;class Or{constructor(e=0,t=0,n=0,i=Or.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],c=i[8],u=i[1],h=i[5],f=i[9],p=i[2],g=i[6],v=i[10];switch(t){case"XYZ":this._y=Math.asin(Hn(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-f,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(g,h),this._z=0);break;case"YXZ":this._x=Math.asin(-Hn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(Hn(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-Hn(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(g,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(Hn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,h),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-Hn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(g,h),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-f,v),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Sy.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Sy,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return My.setFromEuler(this),this.setFromQuaternion(My,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Or.DEFAULT_ORDER="XYZ";class aa{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let h=0,f=u.length;h0){i.children=[];for(let c=0;c0){i.animations=[];for(let c=0;c0&&(n.geometries=c),u.length>0&&(n.materials=u),h.length>0&&(n.textures=h),f.length>0&&(n.images=f),p.length>0&&(n.shapes=p),g.length>0&&(n.skeletons=g),v.length>0&&(n.animations=v),x.length>0&&(n.nodes=x)}return n.object=i,n;function o(c){const u=[];for(const h in c){const f=c[h];delete f.metadata,u.push(f)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Nr.subVectors(i,t),ms.subVectors(n,t),yd.subVectors(e,t);const o=Nr.dot(Nr),c=Nr.dot(ms),u=Nr.dot(yd),h=ms.dot(ms),f=ms.dot(yd),p=o*h-c*c;if(p===0)return s.set(0,0,0),null;const g=1/p,v=(h*u-c*f)*g,x=(o*f-c*u)*g;return s.set(1-v-x,x,v)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,gs)===null?!1:gs.x>=0&&gs.y>=0&&gs.x+gs.y<=1}static getInterpolation(e,t,n,i,s,o,c,u){return this.getBarycoord(e,t,n,i,gs)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,gs.x),u.addScaledVector(o,gs.y),u.addScaledVector(c,gs.z),u)}static isFrontFacing(e,t,n,i){return Nr.subVectors(n,t),ms.subVectors(e,t),Nr.cross(ms).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Nr.subVectors(this.c,this.b),ms.subVectors(this.a,this.b),Nr.cross(ms).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return hr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return hr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return hr.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return hr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return hr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,c;ka.subVectors(i,n),za.subVectors(s,n),vd.subVectors(e,n);const u=ka.dot(vd),h=za.dot(vd);if(u<=0&&h<=0)return t.copy(n);_d.subVectors(e,i);const f=ka.dot(_d),p=za.dot(_d);if(f>=0&&p<=f)return t.copy(i);const g=u*p-f*h;if(g<=0&&u>=0&&f<=0)return o=u/(u-f),t.copy(n).addScaledVector(ka,o);xd.subVectors(e,s);const v=ka.dot(xd),x=za.dot(xd);if(x>=0&&v<=x)return t.copy(s);const E=v*h-u*x;if(E<=0&&h>=0&&x<=0)return c=h/(h-x),t.copy(n).addScaledVector(za,c);const M=f*x-v*p;if(M<=0&&p-f>=0&&v-x>=0)return Ay.subVectors(s,i),c=(p-f)/(p-f+(v-x)),t.copy(i).addScaledVector(Ay,c);const S=1/(M+E+g);return o=E*S,c=g*S,t.copy(n).addScaledVector(ka,o).addScaledVector(za,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const V_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},to={h:0,s:0,l:0},Du={h:0,s:0,l:0};function Sd(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class ht{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=ti){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,yn.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=yn.workingColorSpace){return this.r=e,this.g=t,this.b=n,yn.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=yn.workingColorSpace){if(e=_m(e,1),t=Hn(t,0,1),n=Hn(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=Sd(o,s,e+1/3),this.g=Sd(o,s,e),this.b=Sd(o,s,e-1/3)}return yn.toWorkingColorSpace(this,i),this}setStyle(e,t=ti){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],c=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=ti){const n=V_[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=hl(e.r),this.g=hl(e.g),this.b=hl(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ti){return yn.fromWorkingColorSpace(Ei.copy(this),e),Math.round(Hn(Ei.r*255,0,255))*65536+Math.round(Hn(Ei.g*255,0,255))*256+Math.round(Hn(Ei.b*255,0,255))}getHexString(e=ti){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=yn.workingColorSpace){yn.fromWorkingColorSpace(Ei.copy(this),t);const n=Ei.r,i=Ei.g,s=Ei.b,o=Math.max(n,i,s),c=Math.min(n,i,s);let u,h;const f=(c+o)/2;if(c===o)u=0,h=0;else{const p=o-c;switch(h=f<=.5?p/(o+c):p/(2-o-c),o){case n:u=(i-s)/p+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==ra&&(n.blending=this.blending),this.side!==Es&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Nh&&(n.blendSrc=this.blendSrc),this.blendDst!==Dh&&(n.blendDst=this.blendDst),this.blendEquation!==oo&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==pc&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==kp&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Jo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Jo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Jo&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const c in s){const u=s[c];delete u.metadata,o.push(u)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class po extends mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const xs=n1();function n1(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let u=0;u<256;++u){const h=u-127;h<-27?(n[u]=0,n[u|256]=32768,i[u]=24,i[u|256]=24):h<-14?(n[u]=1024>>-h-14,n[u|256]=1024>>-h-14|32768,i[u]=-h-1,i[u|256]=-h-1):h<=15?(n[u]=h+15<<10,n[u|256]=h+15<<10|32768,i[u]=13,i[u|256]=13):h<128?(n[u]=31744,n[u|256]=64512,i[u]=24,i[u|256]=24):(n[u]=31744,n[u|256]=64512,i[u]=13,i[u|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let u=1;u<1024;++u){let h=u<<13,f=0;for(;!(h&8388608);)h<<=1,f-=8388608;h&=-8388609,f+=947912704,s[u]=h|f}for(let u=1024;u<2048;++u)s[u]=939524096+(u-1024<<13);for(let u=1;u<31;++u)o[u]=u<<23;o[31]=1199570944,o[32]=2147483648;for(let u=33;u<63;++u)o[u]=2147483648+(u-32<<23);o[63]=3347054592;for(let u=1;u<64;++u)u!==32&&(c[u]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:c}}function $i(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Hn(r,-65504,65504),xs.floatView[0]=r;const e=xs.uint32View[0],t=e>>23&511;return xs.baseTable[t]+((e&8388607)>>xs.shiftTable[t])}function oc(r){const e=r>>10;return xs.uint32View[0]=xs.mantissaTable[xs.offsetTable[e]+(r&1023)]+xs.exponentTable[e],xs.floatView[0]}const i1={toHalfFloat:$i,fromHalfFloat:oc},Kn=new V,Ou=new Be;class _n{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Ec,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=wr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return oa("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const u=this.parameters;for(const h in u)u[h]!==void 0&&(e[h]=u[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const u in n){const h=n[u];e.data.attributes[u]=h.toJSON(e.data)}const i={};let s=!1;for(const u in this.morphAttributes){const h=this.morphAttributes[u],f=[];for(let p=0,g=h.length;p0&&(i[u]=f,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const h in i){const f=i[h];this.setAttribute(h,f.clone(t))}const s=e.morphAttributes;for(const h in s){const f=[],p=s[h];for(let g=0,v=p.length;g0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))&&(Cy.copy(s).invert(),Vo.copy(e.ray).applyMatrix4(Cy),!(n.boundingBox!==null&&Vo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Vo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,c=s.index,u=s.attributes.position,h=s.attributes.uv,f=s.attributes.uv1,p=s.attributes.normal,g=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let x=0,E=g.length;xt.far?null:{distance:h,point:Vu.clone(),object:r}}function Gu(r,e,t,n,i,s,o,c,u,h){r.getVertexPosition(c,Va),r.getVertexPosition(u,Ga),r.getVertexPosition(h,Wa);const f=f1(r,e,t,n,Va,Ga,Wa,Hu);if(f){i&&(Bu.fromBufferAttribute(i,c),ku.fromBufferAttribute(i,u),zu.fromBufferAttribute(i,h),f.uv=hr.getInterpolation(Hu,Va,Ga,Wa,Bu,ku,zu,new Be)),s&&(Bu.fromBufferAttribute(s,c),ku.fromBufferAttribute(s,u),zu.fromBufferAttribute(s,h),f.uv1=hr.getInterpolation(Hu,Va,Ga,Wa,Bu,ku,zu,new Be),f.uv2=f.uv1),o&&(Py.fromBufferAttribute(o,c),Iy.fromBufferAttribute(o,u),Ly.fromBufferAttribute(o,h),f.normal=hr.getInterpolation(Hu,Va,Ga,Wa,Py,Iy,Ly,new V),f.normal.dot(n.direction)>0&&f.normal.multiplyScalar(-1));const p={a:c,b:u,c:h,normal:new V,materialIndex:0};hr.getNormal(Va,Ga,Wa,p.normal),f.face=p}return f}class pa extends Zt{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const c=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const u=[],h=[],f=[],p=[];let g=0,v=0;x("z","y","x",-1,-1,n,t,e,o,s,0),x("z","y","x",1,-1,n,t,-e,o,s,1),x("x","z","y",1,1,e,n,t,i,o,2),x("x","z","y",1,-1,e,n,-t,i,o,3),x("x","y","z",1,-1,e,t,n,i,s,4),x("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(u),this.setAttribute("position",new vt(h,3)),this.setAttribute("normal",new vt(f,3)),this.setAttribute("uv",new vt(p,2));function x(E,M,S,A,T,I,z,U,F,Y,de){const L=I/F,O=z/Y,pe=I/2,be=z/2,$=U/2,ye=F+1,me=Y+1;let Pe=0,G=0;const J=new V;for(let ee=0;ee0?1:-1,f.push(J.x,J.y,J.z),p.push(Ie/F),p.push(1-ee/Y),Pe+=1}}for(let ee=0;ee0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Hc extends mn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Bt,this.projectionMatrix=new Bt,this.projectionMatrixInverse=new Bt,this.coordinateSystem=es}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const no=new V,Ny=new Be,Dy=new Be;class ui extends Hc{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=pl*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(sa*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return pl*2*Math.atan(Math.tan(sa*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){no.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(no.x,no.y).multiplyScalar(-e/no.z),no.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(no.x,no.y).multiplyScalar(-e/no.z)}getViewSize(e,t){return this.getViewBounds(e,Ny,Dy),t.subVectors(Dy,Ny)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(sa*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const u=o.fullWidth,h=o.fullHeight;s+=o.offsetX*i/u,t-=o.offsetY*n/h,i*=o.width/u,n*=o.height/h}const c=this.filmOffset;c!==0&&(s+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Xa=-90,qa=1;class X_ extends mn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ui(Xa,qa,e,t);i.layers=this.layers,this.add(i);const s=new ui(Xa,qa,e,t);s.layers=this.layers,this.add(s);const o=new ui(Xa,qa,e,t);o.layers=this.layers,this.add(o);const c=new ui(Xa,qa,e,t);c.layers=this.layers,this.add(c);const u=new ui(Xa,qa,e,t);u.layers=this.layers,this.add(u);const h=new ui(Xa,qa,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,o,c,u]=t;for(const h of t)this.remove(h);if(e===es)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(e===Tc)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,c,u,h,f]=this.children,p=e.getRenderTarget(),g=e.getActiveCubeFace(),v=e.getActiveMipmapLevel(),x=e.xr.enabled;e.xr.enabled=!1;const E=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,o),e.setRenderTarget(n,2,i),e.render(t,c),e.setRenderTarget(n,3,i),e.render(t,u),e.setRenderTarget(n,4,i),e.render(t,h),n.texture.generateMipmaps=E,e.setRenderTarget(n,5,i),e.render(t,f),e.setRenderTarget(p,g,v),e.xr.enabled=x,n.texture.needsPMREMUpdate=!0}}class Vc extends Bn{constructor(e,t,n,i,s,o,c,u,h,f){e=e!==void 0?e:[],t=t!==void 0?t:Ts,super(e,t,n,i,s,o,c,u,h,f),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class q_ extends Fr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];t.encoding!==void 0&&(oa("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===co?ti:ur),this.texture=new Vc(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Un}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new pa(5,5,5),s=new Br({name:"CubemapFromEquirect",uniforms:ml(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Vi,blending:bs});s.uniforms.tEquirect.value=t;const o=new Jn(i,s),c=t.minFilter;return t.minFilter===Qr&&(t.minFilter=Un),new X_(1,10,this).update(e,o),t.minFilter=c,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const bd=new V,g1=new V,y1=new en;class so{constructor(e=new V(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=bd.subVectors(n,t).cross(g1.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(bd),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||y1.getNormalMatrix(e),i=this.coplanarPoint(bd).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Go=new Ri,Wu=new V;class Gc{constructor(e=new so,t=new so,n=new so,i=new so,s=new so,o=new so){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(n),c[3].copy(i),c[4].copy(s),c[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=es){const n=this.planes,i=e.elements,s=i[0],o=i[1],c=i[2],u=i[3],h=i[4],f=i[5],p=i[6],g=i[7],v=i[8],x=i[9],E=i[10],M=i[11],S=i[12],A=i[13],T=i[14],I=i[15];if(n[0].setComponents(u-s,g-h,M-v,I-S).normalize(),n[1].setComponents(u+s,g+h,M+v,I+S).normalize(),n[2].setComponents(u+o,g+f,M+x,I+A).normalize(),n[3].setComponents(u-o,g-f,M-x,I-A).normalize(),n[4].setComponents(u-c,g-p,M-E,I-T).normalize(),t===es)n[5].setComponents(u+c,g+p,M+E,I+T).normalize();else if(t===Tc)n[5].setComponents(c,p,E,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Go.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Go.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Go)}intersectsSprite(e){return Go.center.set(0,0,0),Go.radius=.7071067811865476,Go.applyMatrix4(e.matrixWorld),this.intersectsSphere(Go)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Wu.y=i.normal.y>0?e.max.y:e.min.y,Wu.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function j_(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function v1(r,e){const t=e.isWebGL2,n=new WeakMap;function i(h,f){const p=h.array,g=h.usage,v=p.byteLength,x=r.createBuffer();r.bindBuffer(f,x),r.bufferData(f,p,g),h.onUploadCallback();let E;if(p instanceof Float32Array)E=r.FLOAT;else if(p instanceof Uint16Array)if(h.isFloat16BufferAttribute)if(t)E=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else E=r.UNSIGNED_SHORT;else if(p instanceof Int16Array)E=r.SHORT;else if(p instanceof Uint32Array)E=r.UNSIGNED_INT;else if(p instanceof Int32Array)E=r.INT;else if(p instanceof Int8Array)E=r.BYTE;else if(p instanceof Uint8Array)E=r.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)E=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:x,type:E,bytesPerElement:p.BYTES_PER_ELEMENT,version:h.version,size:v}}function s(h,f,p){const g=f.array,v=f._updateRange,x=f.updateRanges;if(r.bindBuffer(p,h),v.count===-1&&x.length===0&&r.bufferSubData(p,0,g),x.length!==0){for(let E=0,M=x.length;E 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,O1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,U1=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,F1=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,B1=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,k1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,z1=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,H1=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,V1=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,G1=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,W1=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,X1=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,q1=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,j1=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Y1=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,K1="gl_FragColor = linearToOutputTexel( gl_FragColor );",J1=` -const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( - vec3( 0.8224621, 0.177538, 0.0 ), - vec3( 0.0331941, 0.9668058, 0.0 ), - vec3( 0.0170827, 0.0723974, 0.9105199 ) -); -const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( - vec3( 1.2249401, - 0.2249404, 0.0 ), - vec3( - 0.0420569, 1.0420571, 0.0 ), - vec3( - 0.0196376, - 0.0786361, 1.0982735 ) -); -vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { - return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); -} -vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { - return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); -} -vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return sRGBTransferOETF( value ); -}`,Z1=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,$1=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,Q1=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,eE=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,tE=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,nE=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,iE=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,rE=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,sE=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,oE=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,aE=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,lE=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,cE=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,uE=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,hE=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,fE=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,dE=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,pE=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,mE=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,gE=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,yE=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,vE=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,_E=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,xE=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,SE=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,ME=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,wE=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,bE=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,EE=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,TE=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,AE=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,CE=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,RE=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,PE=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,IE=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,LE=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,NE=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,DE=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,OE=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,UE=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,FE=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,BE=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,kE=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,zE=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,HE=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,VE=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,GE=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,WE=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,XE=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,qE=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,jE=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,YE=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,KE=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,JE=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,ZE=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,$E=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,QE=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,eT=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,tT=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,nT=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,iT=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,rT=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,sT=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,oT=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,aT=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,lT=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,cT=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,uT=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,hT=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,fT=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,dT=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,pT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,mT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,gT=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,yT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const vT=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,_T=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,xT=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,ST=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,MT=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,wT=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,bT=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,ET=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,TT=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,AT=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,CT=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,RT=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,PT=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,IT=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,LT=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,NT=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,DT=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,OT=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,UT=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,FT=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,BT=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,kT=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,zT=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,HT=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,VT=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,GT=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,WT=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,XT=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,qT=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,jT=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,YT=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,KT=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,JT=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,ZT=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,Jt={alphahash_fragment:_1,alphahash_pars_fragment:x1,alphamap_fragment:S1,alphamap_pars_fragment:M1,alphatest_fragment:w1,alphatest_pars_fragment:b1,aomap_fragment:E1,aomap_pars_fragment:T1,batching_pars_vertex:A1,batching_vertex:C1,begin_vertex:R1,beginnormal_vertex:P1,bsdfs:I1,iridescence_fragment:L1,bumpmap_pars_fragment:N1,clipping_planes_fragment:D1,clipping_planes_pars_fragment:O1,clipping_planes_pars_vertex:U1,clipping_planes_vertex:F1,color_fragment:B1,color_pars_fragment:k1,color_pars_vertex:z1,color_vertex:H1,common:V1,cube_uv_reflection_fragment:G1,defaultnormal_vertex:W1,displacementmap_pars_vertex:X1,displacementmap_vertex:q1,emissivemap_fragment:j1,emissivemap_pars_fragment:Y1,colorspace_fragment:K1,colorspace_pars_fragment:J1,envmap_fragment:Z1,envmap_common_pars_fragment:$1,envmap_pars_fragment:Q1,envmap_pars_vertex:eE,envmap_physical_pars_fragment:fE,envmap_vertex:tE,fog_vertex:nE,fog_pars_vertex:iE,fog_fragment:rE,fog_pars_fragment:sE,gradientmap_pars_fragment:oE,lightmap_fragment:aE,lightmap_pars_fragment:lE,lights_lambert_fragment:cE,lights_lambert_pars_fragment:uE,lights_pars_begin:hE,lights_toon_fragment:dE,lights_toon_pars_fragment:pE,lights_phong_fragment:mE,lights_phong_pars_fragment:gE,lights_physical_fragment:yE,lights_physical_pars_fragment:vE,lights_fragment_begin:_E,lights_fragment_maps:xE,lights_fragment_end:SE,logdepthbuf_fragment:ME,logdepthbuf_pars_fragment:wE,logdepthbuf_pars_vertex:bE,logdepthbuf_vertex:EE,map_fragment:TE,map_pars_fragment:AE,map_particle_fragment:CE,map_particle_pars_fragment:RE,metalnessmap_fragment:PE,metalnessmap_pars_fragment:IE,morphcolor_vertex:LE,morphnormal_vertex:NE,morphtarget_pars_vertex:DE,morphtarget_vertex:OE,normal_fragment_begin:UE,normal_fragment_maps:FE,normal_pars_fragment:BE,normal_pars_vertex:kE,normal_vertex:zE,normalmap_pars_fragment:HE,clearcoat_normal_fragment_begin:VE,clearcoat_normal_fragment_maps:GE,clearcoat_pars_fragment:WE,iridescence_pars_fragment:XE,opaque_fragment:qE,packing:jE,premultiplied_alpha_fragment:YE,project_vertex:KE,dithering_fragment:JE,dithering_pars_fragment:ZE,roughnessmap_fragment:$E,roughnessmap_pars_fragment:QE,shadowmap_pars_fragment:eT,shadowmap_pars_vertex:tT,shadowmap_vertex:nT,shadowmask_pars_fragment:iT,skinbase_vertex:rT,skinning_pars_vertex:sT,skinning_vertex:oT,skinnormal_vertex:aT,specularmap_fragment:lT,specularmap_pars_fragment:cT,tonemapping_fragment:uT,tonemapping_pars_fragment:hT,transmission_fragment:fT,transmission_pars_fragment:dT,uv_pars_fragment:pT,uv_pars_vertex:mT,uv_vertex:gT,worldpos_vertex:yT,background_vert:vT,background_frag:_T,backgroundCube_vert:xT,backgroundCube_frag:ST,cube_vert:MT,cube_frag:wT,depth_vert:bT,depth_frag:ET,distanceRGBA_vert:TT,distanceRGBA_frag:AT,equirect_vert:CT,equirect_frag:RT,linedashed_vert:PT,linedashed_frag:IT,meshbasic_vert:LT,meshbasic_frag:NT,meshlambert_vert:DT,meshlambert_frag:OT,meshmatcap_vert:UT,meshmatcap_frag:FT,meshnormal_vert:BT,meshnormal_frag:kT,meshphong_vert:zT,meshphong_frag:HT,meshphysical_vert:VT,meshphysical_frag:GT,meshtoon_vert:WT,meshtoon_frag:XT,points_vert:qT,points_frag:jT,shadow_vert:YT,shadow_frag:KT,sprite_vert:JT,sprite_frag:ZT},nt={common:{diffuse:{value:new ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new en},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new en}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new en}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new en}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new en},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new en},normalScale:{value:new Be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new en},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new en}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new en}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new en}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0},uvTransform:{value:new en}},sprite:{diffuse:{value:new ht(16777215)},opacity:{value:1},center:{value:new Be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new en},alphaMap:{value:null},alphaMapTransform:{value:new en},alphaTest:{value:0}}},Ur={basic:{uniforms:Bi([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.fog]),vertexShader:Jt.meshbasic_vert,fragmentShader:Jt.meshbasic_frag},lambert:{uniforms:Bi([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new ht(0)}}]),vertexShader:Jt.meshlambert_vert,fragmentShader:Jt.meshlambert_frag},phong:{uniforms:Bi([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new ht(0)},specular:{value:new ht(1118481)},shininess:{value:30}}]),vertexShader:Jt.meshphong_vert,fragmentShader:Jt.meshphong_frag},standard:{uniforms:Bi([nt.common,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.roughnessmap,nt.metalnessmap,nt.fog,nt.lights,{emissive:{value:new ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag},toon:{uniforms:Bi([nt.common,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.gradientmap,nt.fog,nt.lights,{emissive:{value:new ht(0)}}]),vertexShader:Jt.meshtoon_vert,fragmentShader:Jt.meshtoon_frag},matcap:{uniforms:Bi([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,{matcap:{value:null}}]),vertexShader:Jt.meshmatcap_vert,fragmentShader:Jt.meshmatcap_frag},points:{uniforms:Bi([nt.points,nt.fog]),vertexShader:Jt.points_vert,fragmentShader:Jt.points_frag},dashed:{uniforms:Bi([nt.common,nt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Jt.linedashed_vert,fragmentShader:Jt.linedashed_frag},depth:{uniforms:Bi([nt.common,nt.displacementmap]),vertexShader:Jt.depth_vert,fragmentShader:Jt.depth_frag},normal:{uniforms:Bi([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,{opacity:{value:1}}]),vertexShader:Jt.meshnormal_vert,fragmentShader:Jt.meshnormal_frag},sprite:{uniforms:Bi([nt.sprite,nt.fog]),vertexShader:Jt.sprite_vert,fragmentShader:Jt.sprite_frag},background:{uniforms:{uvTransform:{value:new en},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Jt.background_vert,fragmentShader:Jt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Jt.backgroundCube_vert,fragmentShader:Jt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Jt.cube_vert,fragmentShader:Jt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Jt.equirect_vert,fragmentShader:Jt.equirect_frag},distanceRGBA:{uniforms:Bi([nt.common,nt.displacementmap,{referencePosition:{value:new V},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Jt.distanceRGBA_vert,fragmentShader:Jt.distanceRGBA_frag},shadow:{uniforms:Bi([nt.lights,nt.fog,{color:{value:new ht(0)},opacity:{value:1}}]),vertexShader:Jt.shadow_vert,fragmentShader:Jt.shadow_frag}};Ur.physical={uniforms:Bi([Ur.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new en},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new en},clearcoatNormalScale:{value:new Be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new en},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new en},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new en},sheen:{value:0},sheenColor:{value:new ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new en},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new en},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new en},transmissionSamplerSize:{value:new Be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new en},attenuationDistance:{value:0},attenuationColor:{value:new ht(0)},specularColor:{value:new ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new en},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new en},anisotropyVector:{value:new Be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new en}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag};const Xu={r:0,b:0,g:0};function $T(r,e,t,n,i,s,o){const c=new ht(0);let u=s===!0?0:1,h,f,p=null,g=0,v=null;function x(M,S){let A=!1,T=S.isScene===!0?S.background:null;T&&T.isTexture&&(T=(S.backgroundBlurriness>0?t:e).get(T)),T===null?E(c,u):T&&T.isColor&&(E(T,1),A=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||A)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),T&&(T.isCubeTexture||T.mapping===_l)?(f===void 0&&(f=new Jn(new pa(1,1,1),new Br({name:"BackgroundCubeMaterial",uniforms:ml(Ur.backgroundCube.uniforms),vertexShader:Ur.backgroundCube.vertexShader,fragmentShader:Ur.backgroundCube.fragmentShader,side:Vi,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(z,U,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),f.material.uniforms.envMap.value=T,f.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,f.material.toneMapped=yn.getTransfer(T.colorSpace)!==An,(p!==T||g!==T.version||v!==r.toneMapping)&&(f.material.needsUpdate=!0,p=T,g=T.version,v=r.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):T&&T.isTexture&&(h===void 0&&(h=new Jn(new Sl(2,2),new Br({name:"BackgroundMaterial",uniforms:ml(Ur.background.uniforms),vertexShader:Ur.background.vertexShader,fragmentShader:Ur.background.fragmentShader,side:Es,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(h)),h.material.uniforms.t2D.value=T,h.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,h.material.toneMapped=yn.getTransfer(T.colorSpace)!==An,T.matrixAutoUpdate===!0&&T.updateMatrix(),h.material.uniforms.uvTransform.value.copy(T.matrix),(p!==T||g!==T.version||v!==r.toneMapping)&&(h.material.needsUpdate=!0,p=T,g=T.version,v=r.toneMapping),h.layers.enableAll(),M.unshift(h,h.geometry,h.material,0,0,null))}function E(M,S){M.getRGB(Xu,G_(r)),n.buffers.color.setClear(Xu.r,Xu.g,Xu.b,S,o)}return{getClearColor:function(){return c},setClearColor:function(M,S=1){c.set(M),u=S,E(c,u)},getClearAlpha:function(){return u},setClearAlpha:function(M){u=M,E(c,u)},render:x}}function QT(r,e,t,n){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,c={},u=M(null);let h=u,f=!1;function p($,ye,me,Pe,G){let J=!1;if(o){const ee=E(Pe,me,ye);h!==ee&&(h=ee,v(h.object)),J=S($,Pe,me,G),J&&A($,Pe,me,G)}else{const ee=ye.wireframe===!0;(h.geometry!==Pe.id||h.program!==me.id||h.wireframe!==ee)&&(h.geometry=Pe.id,h.program=me.id,h.wireframe=ee,J=!0)}G!==null&&t.update(G,r.ELEMENT_ARRAY_BUFFER),(J||f)&&(f=!1,Y($,ye,me,Pe),G!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(G).buffer))}function g(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function v($){return n.isWebGL2?r.bindVertexArray($):s.bindVertexArrayOES($)}function x($){return n.isWebGL2?r.deleteVertexArray($):s.deleteVertexArrayOES($)}function E($,ye,me){const Pe=me.wireframe===!0;let G=c[$.id];G===void 0&&(G={},c[$.id]=G);let J=G[ye.id];J===void 0&&(J={},G[ye.id]=J);let ee=J[Pe];return ee===void 0&&(ee=M(g()),J[Pe]=ee),ee}function M($){const ye=[],me=[],Pe=[];for(let G=0;G=0){const ve=G[Ie];let Ne=J[Ie];if(Ne===void 0&&(Ie==="instanceMatrix"&&$.instanceMatrix&&(Ne=$.instanceMatrix),Ie==="instanceColor"&&$.instanceColor&&(Ne=$.instanceColor)),ve===void 0||ve.attribute!==Ne||Ne&&ve.data!==Ne.data)return!0;ee++}return h.attributesNum!==ee||h.index!==Pe}function A($,ye,me,Pe){const G={},J=ye.attributes;let ee=0;const ue=me.getAttributes();for(const Ie in ue)if(ue[Ie].location>=0){let ve=J[Ie];ve===void 0&&(Ie==="instanceMatrix"&&$.instanceMatrix&&(ve=$.instanceMatrix),Ie==="instanceColor"&&$.instanceColor&&(ve=$.instanceColor));const Ne={};Ne.attribute=ve,ve&&ve.data&&(Ne.data=ve.data),G[Ie]=Ne,ee++}h.attributes=G,h.attributesNum=ee,h.index=Pe}function T(){const $=h.newAttributes;for(let ye=0,me=$.length;ye=0){let Ke=G[ue];if(Ke===void 0&&(ue==="instanceMatrix"&&$.instanceMatrix&&(Ke=$.instanceMatrix),ue==="instanceColor"&&$.instanceColor&&(Ke=$.instanceColor)),Ke!==void 0){const ve=Ke.normalized,Ne=Ke.itemSize,je=t.get(Ke);if(je===void 0)continue;const st=je.buffer,Mt=je.type,Le=je.bytesPerElement,Nt=n.isWebGL2===!0&&(Mt===r.INT||Mt===r.UNSIGNED_INT||Ke.gpuType===cm);if(Ke.isInterleavedBufferAttribute){const ft=Ke.data,W=ft.stride,Ge=Ke.offset;if(ft.isInstancedInterleavedBuffer){for(let Re=0;Re0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext";let c=t.precision!==void 0?t.precision:"highp";const u=s(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=o||e.has("WEBGL_draw_buffers"),f=t.logarithmicDepthBuffer===!0,p=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),g=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=r.getParameter(r.MAX_TEXTURE_SIZE),x=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),E=r.getParameter(r.MAX_VERTEX_ATTRIBS),M=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),S=r.getParameter(r.MAX_VARYING_VECTORS),A=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),T=g>0,I=o||e.has("OES_texture_float"),z=T&&I,U=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:h,getMaxAnisotropy:i,getMaxPrecision:s,precision:c,logarithmicDepthBuffer:f,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:x,maxAttributes:E,maxVertexUniforms:M,maxVaryings:S,maxFragmentUniforms:A,vertexTextures:T,floatFragmentTextures:I,floatVertexTextures:z,maxSamples:U}}function nA(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new so,c=new en,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(p,g){const v=p.length!==0||g||n!==0||i;return i=g,n=p.length,v},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,g){t=f(p,g,0)},this.setState=function(p,g,v){const x=p.clippingPlanes,E=p.clipIntersection,M=p.clipShadows,S=r.get(p);if(!i||x===null||x.length===0||s&&!M)s?f(null):h();else{const A=s?0:n,T=A*4;let I=S.clippingState||null;u.value=I,I=f(x,g,T,v);for(let z=0;z!==T;++z)I[z]=t[z];S.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=A}};function h(){u.value!==t&&(u.value=t,u.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function f(p,g,v,x){const E=p!==null?p.length:0;let M=null;if(E!==0){if(M=u.value,x!==!0||M===null){const S=v+E*4,A=g.matrixWorldInverse;c.getNormalMatrix(A),(M===null||M.length0){const h=new q_(u.height);return h.fromEquirectangularTexture(r,o),e.set(o,h),o.addEventListener("dispose",i),t(h.texture,o.mapping)}else return null}}return o}function i(o){const c=o.target;c.removeEventListener("dispose",i);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class Wc extends Hc{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,c=i+t,u=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,o=s+h*this.view.width,c-=f*this.view.offsetY,u=c-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,c,u,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ol=4,Oy=[.125,.215,.35,.446,.526,.582],Qo=20,Ed=new Wc,Uy=new ht;let Td=null,Ad=0,Cd=0;const Zo=(1+Math.sqrt(5))/2,ja=1/Zo,Fy=[new V(1,1,1),new V(-1,1,1),new V(1,1,-1),new V(-1,1,-1),new V(0,Zo,ja),new V(0,Zo,-ja),new V(ja,0,Zo),new V(-ja,0,Zo),new V(Zo,ja,0),new V(-Zo,ja,0)];class Vp{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Td=this._renderer.getRenderTarget(),Ad=this._renderer.getActiveCubeFace(),Cd=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=zy(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ky(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?T:0,T,T),f.setRenderTarget(i),E&&f.render(x,c),f.render(e,c)}x.geometry.dispose(),x.material.dispose(),f.toneMapping=g,f.autoClear=p,e.background=M}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Ts||e.mapping===uo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=zy()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ky());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Jn(this._lodPlanes[0],s),c=s.uniforms;c.envMap.value=e;const u=this._cubeSize;qu(t,0,0,3*u,2*u),n.setRenderTarget(t),n.render(o,Ed)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;iQo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${M} samples when the maximum is set to ${Qo}`);const S=[];let A=0;for(let F=0;FT-ol?i-T+ol:0),U=4*(this._cubeSize-I);qu(t,z,U,3*I,2*I),u.setRenderTarget(t),u.render(p,Ed)}}function rA(r){const e=[],t=[],n=[];let i=r;const s=r-ol+1+Oy.length;for(let o=0;or-ol?u=Oy[o-r+ol-1]:o===0&&(u=0),n.push(u);const h=1/(c-2),f=-h,p=1+h,g=[f,f,p,f,p,p,f,f,p,p,f,p],v=6,x=6,E=3,M=2,S=1,A=new Float32Array(E*x*v),T=new Float32Array(M*x*v),I=new Float32Array(S*x*v);for(let U=0;U2?0:-1,de=[F,Y,0,F+2/3,Y,0,F+2/3,Y+1,0,F,Y,0,F+2/3,Y+1,0,F,Y+1,0];A.set(de,E*x*U),T.set(g,M*x*U);const L=[U,U,U,U,U,U];I.set(L,S*x*U)}const z=new Zt;z.setAttribute("position",new _n(A,E)),z.setAttribute("uv",new _n(T,M)),z.setAttribute("faceIndex",new _n(I,S)),e.push(z),i>ol&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function By(r,e,t){const n=new Fr(r,e,t);return n.texture.mapping=_l,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function qu(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function sA(r,e,t){const n=new Float32Array(Qo),i=new V(0,1,0);return new Br({name:"SphericalGaussianBlur",defines:{n:Qo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:bm(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:bs,depthTest:!1,depthWrite:!1})}function ky(){return new Br({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:bm(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:bs,depthTest:!1,depthWrite:!1})}function zy(){return new Br({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:bm(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:bs,depthTest:!1,depthWrite:!1})}function bm(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function oA(r){let e=new WeakMap,t=null;function n(c){if(c&&c.isTexture){const u=c.mapping,h=u===mc||u===gc,f=u===Ts||u===uo;if(h||f)if(c.isRenderTargetTexture&&c.needsPMREMUpdate===!0){c.needsPMREMUpdate=!1;let p=e.get(c);return t===null&&(t=new Vp(r)),p=h?t.fromEquirectangular(c,p):t.fromCubemap(c,p),e.set(c,p),p.texture}else{if(e.has(c))return e.get(c).texture;{const p=c.image;if(h&&p&&p.height>0||f&&p&&i(p)){t===null&&(t=new Vp(r));const g=h?t.fromEquirectangular(c):t.fromCubemap(c);return e.set(c,g),c.addEventListener("dispose",s),g.texture}else return null}}}return c}function i(c){let u=0;const h=6;for(let f=0;fe.maxTextureSize&&(L=Math.ceil(de/e.maxTextureSize),de=e.maxTextureSize);const O=new Float32Array(de*L*4*x),pe=new ef(O,de,L,x);pe.type=wr,pe.needsUpdate=!0;const be=Y*4;for(let ye=0;ye0)return r;const i=e*t;let s=Hy[i];if(s===void 0&&(s=new Float32Array(i),Hy[i]=s),e!==0){n.toArray(s,0);for(let o=1,c=0;o!==e;++o)c+=t,r[o].toArray(s,c)}return s}function ni(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t":" "} ${c}: ${t[o]}`)}return n.join(` -`)}function lC(r){const e=yn.getPrimaries(yn.workingColorSpace),t=yn.getPrimaries(r);let n;switch(e===t?n="":e===bc&&t===wc?n="LinearDisplayP3ToLinearSRGB":e===wc&&t===bc&&(n="LinearSRGBToLinearDisplayP3"),r){case rs:case zc:return[n,"LinearTransferOETF"];case ti:case Qh:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function Yy(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` - -`+i+` - -`+aC(r.getShaderSource(e),o)}else return i}function cC(r,e){const t=lC(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function uC(r,e){let t;switch(e){case f_:t="Linear";break;case d_:t="Reinhard";break;case p_:t="OptimizedCineon";break;case lm:t="ACESFilmic";break;case g_:t="AgX";break;case m_:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function hC(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.alphaToCoverage||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(al).join(` -`)}function fC(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(al).join(` -`)}function dC(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` -`)}function pC(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function Gp(r){return r.replace(mC,yC)}const gC=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function yC(r,e){let t=Jt[e];if(t===void 0){const n=gC.get(e);if(n!==void 0)t=Jt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Gp(t)}const vC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Zy(r){return r.replace(vC,_C)}function _C(r,e,t,n){let i="";for(let s=parseInt(e);s0&&(S+=` -`),A=[v,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E].filter(al).join(` -`),A.length>0&&(A+=` -`)):(S=[$y(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(al).join(` -`),A=[v,$y(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",t.envMap?"#define "+p:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+u:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ts?"#define TONE_MAPPING":"",t.toneMapping!==ts?Jt.tonemapping_pars_fragment:"",t.toneMapping!==ts?uC("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Jt.colorspace_pars_fragment,cC("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(al).join(` -`)),o=Gp(o),o=Ky(o,t),o=Jy(o,t),c=Gp(c),c=Ky(c,t),c=Jy(c,t),o=Zy(o),c=Zy(c),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(T=`#version 300 es -`,S=[x,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+S,A=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===zp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===zp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+A);const I=T+S+o,z=T+A+c,U=jy(i,i.VERTEX_SHADER,I),F=jy(i,i.FRAGMENT_SHADER,z);i.attachShader(M,U),i.attachShader(M,F),t.index0AttributeName!==void 0?i.bindAttribLocation(M,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M);function Y(pe){if(r.debug.checkShaderErrors){const be=i.getProgramInfoLog(M).trim(),$=i.getShaderInfoLog(U).trim(),ye=i.getShaderInfoLog(F).trim();let me=!0,Pe=!0;if(i.getProgramParameter(M,i.LINK_STATUS)===!1)if(me=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,M,U,F);else{const G=Yy(i,U,"vertex"),J=Yy(i,F,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+` - -Material Name: `+pe.name+` -Material Type: `+pe.type+` - -Program Info Log: `+be+` -`+G+` -`+J)}else be!==""?console.warn("THREE.WebGLProgram: Program Info Log:",be):($===""||ye==="")&&(Pe=!1);Pe&&(pe.diagnostics={runnable:me,programLog:be,vertexShader:{log:$,prefix:S},fragmentShader:{log:ye,prefix:A}})}i.deleteShader(U),i.deleteShader(F),de=new Rh(i,M),L=pC(i,M)}let de;this.getUniforms=function(){return de===void 0&&Y(this),de};let L;this.getAttributes=function(){return L===void 0&&Y(this),L};let O=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return O===!1&&(O=i.getProgramParameter(M,sC)),O},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=oC++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=U,this.fragmentShader=F,this}let TC=0;class AC{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new CC(e),t.set(e,n)),n}}class CC{constructor(e){this.id=TC++,this.code=e,this.usedTimes=0}}function RC(r,e,t,n,i,s,o){const c=new aa,u=new AC,h=new Set,f=[],p=i.isWebGL2,g=i.logarithmicDepthBuffer,v=i.vertexTextures;let x=i.precision;const E={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function M(L){return h.add(L),L===0?"uv":`uv${L}`}function S(L,O,pe,be,$){const ye=be.fog,me=$.geometry,Pe=L.isMeshStandardMaterial?be.environment:null,G=(L.isMeshStandardMaterial?t:e).get(L.envMap||Pe),J=G&&G.mapping===_l?G.image.height:null,ee=E[L.type];L.precision!==null&&(x=i.getMaxPrecision(L.precision),x!==L.precision&&console.warn("THREE.WebGLProgram.getParameters:",L.precision,"not supported, using",x,"instead."));const ue=me.morphAttributes.position||me.morphAttributes.normal||me.morphAttributes.color,Ie=ue!==void 0?ue.length:0;let Ke=0;me.morphAttributes.position!==void 0&&(Ke=1),me.morphAttributes.normal!==void 0&&(Ke=2),me.morphAttributes.color!==void 0&&(Ke=3);let ve,Ne,je,st;if(ee){const rn=Ur[ee];ve=rn.vertexShader,Ne=rn.fragmentShader}else ve=L.vertexShader,Ne=L.fragmentShader,u.update(L),je=u.getVertexShaderID(L),st=u.getFragmentShaderID(L);const Mt=r.getRenderTarget(),Le=$.isInstancedMesh===!0,Nt=$.isBatchedMesh===!0,ft=!!L.map,W=!!L.matcap,Ge=!!G,Re=!!L.aoMap,Xe=!!L.lightMap,De=!!L.bumpMap,xt=!!L.normalMap,ot=!!L.displacementMap,k=!!L.emissiveMap,D=!!L.metalnessMap,ce=!!L.roughnessMap,We=L.anisotropy>0,ze=L.clearcoat>0,ke=L.iridescence>0,dt=L.sheen>0,Qe=L.transmission>0,ut=We&&!!L.anisotropyMap,wt=ze&&!!L.clearcoatMap,Ft=ze&&!!L.clearcoatNormalMap,Ve=ze&&!!L.clearcoatRoughnessMap,Kt=ke&&!!L.iridescenceMap,Ht=ke&&!!L.iridescenceThicknessMap,Dt=dt&&!!L.sheenColorMap,yt=dt&&!!L.sheenRoughnessMap,Ce=!!L.specularMap,Ut=!!L.specularColorMap,$t=!!L.specularIntensityMap,fn=Qe&&!!L.transmissionMap,Fe=Qe&&!!L.thicknessMap,ln=!!L.gradientMap,q=!!L.alphaMap,Je=L.alphaTest>0,Ze=!!L.alphaHash,pt=!!L.extensions;let Et=ts;L.toneMapped&&(Mt===null||Mt.isXRRenderTarget===!0)&&(Et=r.toneMapping);const cn={isWebGL2:p,shaderID:ee,shaderType:L.type,shaderName:L.name,vertexShader:ve,fragmentShader:Ne,defines:L.defines,customVertexShaderID:je,customFragmentShaderID:st,isRawShaderMaterial:L.isRawShaderMaterial===!0,glslVersion:L.glslVersion,precision:x,batching:Nt,instancing:Le,instancingColor:Le&&$.instanceColor!==null,supportsVertexTextures:v,outputColorSpace:Mt===null?r.outputColorSpace:Mt.isXRRenderTarget===!0?Mt.texture.colorSpace:rs,alphaToCoverage:!!L.alphaToCoverage,map:ft,matcap:W,envMap:Ge,envMapMode:Ge&&G.mapping,envMapCubeUVHeight:J,aoMap:Re,lightMap:Xe,bumpMap:De,normalMap:xt,displacementMap:v&&ot,emissiveMap:k,normalMapObjectSpace:xt&&L.normalMapType===I_,normalMapTangentSpace:xt&&L.normalMapType===fo,metalnessMap:D,roughnessMap:ce,anisotropy:We,anisotropyMap:ut,clearcoat:ze,clearcoatMap:wt,clearcoatNormalMap:Ft,clearcoatRoughnessMap:Ve,iridescence:ke,iridescenceMap:Kt,iridescenceThicknessMap:Ht,sheen:dt,sheenColorMap:Dt,sheenRoughnessMap:yt,specularMap:Ce,specularColorMap:Ut,specularIntensityMap:$t,transmission:Qe,transmissionMap:fn,thicknessMap:Fe,gradientMap:ln,opaque:L.transparent===!1&&L.blending===ra&&L.alphaToCoverage===!1,alphaMap:q,alphaTest:Je,alphaHash:Ze,combine:L.combine,mapUv:ft&&M(L.map.channel),aoMapUv:Re&&M(L.aoMap.channel),lightMapUv:Xe&&M(L.lightMap.channel),bumpMapUv:De&&M(L.bumpMap.channel),normalMapUv:xt&&M(L.normalMap.channel),displacementMapUv:ot&&M(L.displacementMap.channel),emissiveMapUv:k&&M(L.emissiveMap.channel),metalnessMapUv:D&&M(L.metalnessMap.channel),roughnessMapUv:ce&&M(L.roughnessMap.channel),anisotropyMapUv:ut&&M(L.anisotropyMap.channel),clearcoatMapUv:wt&&M(L.clearcoatMap.channel),clearcoatNormalMapUv:Ft&&M(L.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ve&&M(L.clearcoatRoughnessMap.channel),iridescenceMapUv:Kt&&M(L.iridescenceMap.channel),iridescenceThicknessMapUv:Ht&&M(L.iridescenceThicknessMap.channel),sheenColorMapUv:Dt&&M(L.sheenColorMap.channel),sheenRoughnessMapUv:yt&&M(L.sheenRoughnessMap.channel),specularMapUv:Ce&&M(L.specularMap.channel),specularColorMapUv:Ut&&M(L.specularColorMap.channel),specularIntensityMapUv:$t&&M(L.specularIntensityMap.channel),transmissionMapUv:fn&&M(L.transmissionMap.channel),thicknessMapUv:Fe&&M(L.thicknessMap.channel),alphaMapUv:q&&M(L.alphaMap.channel),vertexTangents:!!me.attributes.tangent&&(xt||We),vertexColors:L.vertexColors,vertexAlphas:L.vertexColors===!0&&!!me.attributes.color&&me.attributes.color.itemSize===4,pointsUvs:$.isPoints===!0&&!!me.attributes.uv&&(ft||q),fog:!!ye,useFog:L.fog===!0,fogExp2:!!ye&&ye.isFogExp2,flatShading:L.flatShading===!0,sizeAttenuation:L.sizeAttenuation===!0,logarithmicDepthBuffer:g,skinning:$.isSkinnedMesh===!0,morphTargets:me.morphAttributes.position!==void 0,morphNormals:me.morphAttributes.normal!==void 0,morphColors:me.morphAttributes.color!==void 0,morphTargetsCount:Ie,morphTextureStride:Ke,numDirLights:O.directional.length,numPointLights:O.point.length,numSpotLights:O.spot.length,numSpotLightMaps:O.spotLightMap.length,numRectAreaLights:O.rectArea.length,numHemiLights:O.hemi.length,numDirLightShadows:O.directionalShadowMap.length,numPointLightShadows:O.pointShadowMap.length,numSpotLightShadows:O.spotShadowMap.length,numSpotLightShadowsWithMaps:O.numSpotLightShadowsWithMaps,numLightProbes:O.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:L.dithering,shadowMapEnabled:r.shadowMap.enabled&&pe.length>0,shadowMapType:r.shadowMap.type,toneMapping:Et,useLegacyLights:r._useLegacyLights,decodeVideoTexture:ft&&L.map.isVideoTexture===!0&&yn.getTransfer(L.map.colorSpace)===An,premultipliedAlpha:L.premultipliedAlpha,doubleSided:L.side===Zr,flipSided:L.side===Vi,useDepthPacking:L.depthPacking>=0,depthPacking:L.depthPacking||0,index0AttributeName:L.index0AttributeName,extensionDerivatives:pt&&L.extensions.derivatives===!0,extensionFragDepth:pt&&L.extensions.fragDepth===!0,extensionDrawBuffers:pt&&L.extensions.drawBuffers===!0,extensionShaderTextureLOD:pt&&L.extensions.shaderTextureLOD===!0,extensionClipCullDistance:pt&&L.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:pt&&L.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionFragDepth:p||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:p||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:p||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:L.customProgramCacheKey()};return cn.vertexUv1s=h.has(1),cn.vertexUv2s=h.has(2),cn.vertexUv3s=h.has(3),h.clear(),cn}function A(L){const O=[];if(L.shaderID?O.push(L.shaderID):(O.push(L.customVertexShaderID),O.push(L.customFragmentShaderID)),L.defines!==void 0)for(const pe in L.defines)O.push(pe),O.push(L.defines[pe]);return L.isRawShaderMaterial===!1&&(T(O,L),I(O,L),O.push(r.outputColorSpace)),O.push(L.customProgramCacheKey),O.join()}function T(L,O){L.push(O.precision),L.push(O.outputColorSpace),L.push(O.envMapMode),L.push(O.envMapCubeUVHeight),L.push(O.mapUv),L.push(O.alphaMapUv),L.push(O.lightMapUv),L.push(O.aoMapUv),L.push(O.bumpMapUv),L.push(O.normalMapUv),L.push(O.displacementMapUv),L.push(O.emissiveMapUv),L.push(O.metalnessMapUv),L.push(O.roughnessMapUv),L.push(O.anisotropyMapUv),L.push(O.clearcoatMapUv),L.push(O.clearcoatNormalMapUv),L.push(O.clearcoatRoughnessMapUv),L.push(O.iridescenceMapUv),L.push(O.iridescenceThicknessMapUv),L.push(O.sheenColorMapUv),L.push(O.sheenRoughnessMapUv),L.push(O.specularMapUv),L.push(O.specularColorMapUv),L.push(O.specularIntensityMapUv),L.push(O.transmissionMapUv),L.push(O.thicknessMapUv),L.push(O.combine),L.push(O.fogExp2),L.push(O.sizeAttenuation),L.push(O.morphTargetsCount),L.push(O.morphAttributeCount),L.push(O.numDirLights),L.push(O.numPointLights),L.push(O.numSpotLights),L.push(O.numSpotLightMaps),L.push(O.numHemiLights),L.push(O.numRectAreaLights),L.push(O.numDirLightShadows),L.push(O.numPointLightShadows),L.push(O.numSpotLightShadows),L.push(O.numSpotLightShadowsWithMaps),L.push(O.numLightProbes),L.push(O.shadowMapType),L.push(O.toneMapping),L.push(O.numClippingPlanes),L.push(O.numClipIntersection),L.push(O.depthPacking)}function I(L,O){c.disableAll(),O.isWebGL2&&c.enable(0),O.supportsVertexTextures&&c.enable(1),O.instancing&&c.enable(2),O.instancingColor&&c.enable(3),O.matcap&&c.enable(4),O.envMap&&c.enable(5),O.normalMapObjectSpace&&c.enable(6),O.normalMapTangentSpace&&c.enable(7),O.clearcoat&&c.enable(8),O.iridescence&&c.enable(9),O.alphaTest&&c.enable(10),O.vertexColors&&c.enable(11),O.vertexAlphas&&c.enable(12),O.vertexUv1s&&c.enable(13),O.vertexUv2s&&c.enable(14),O.vertexUv3s&&c.enable(15),O.vertexTangents&&c.enable(16),O.anisotropy&&c.enable(17),O.alphaHash&&c.enable(18),O.batching&&c.enable(19),L.push(c.mask),c.disableAll(),O.fog&&c.enable(0),O.useFog&&c.enable(1),O.flatShading&&c.enable(2),O.logarithmicDepthBuffer&&c.enable(3),O.skinning&&c.enable(4),O.morphTargets&&c.enable(5),O.morphNormals&&c.enable(6),O.morphColors&&c.enable(7),O.premultipliedAlpha&&c.enable(8),O.shadowMapEnabled&&c.enable(9),O.useLegacyLights&&c.enable(10),O.doubleSided&&c.enable(11),O.flipSided&&c.enable(12),O.useDepthPacking&&c.enable(13),O.dithering&&c.enable(14),O.transmission&&c.enable(15),O.sheen&&c.enable(16),O.opaque&&c.enable(17),O.pointsUvs&&c.enable(18),O.decodeVideoTexture&&c.enable(19),O.alphaToCoverage&&c.enable(20),L.push(c.mask)}function z(L){const O=E[L.type];let pe;if(O){const be=Ur[O];pe=W_.clone(be.uniforms)}else pe=L.uniforms;return pe}function U(L,O){let pe;for(let be=0,$=f.length;be<$;be++){const ye=f[be];if(ye.cacheKey===O){pe=ye,++pe.usedTimes;break}}return pe===void 0&&(pe=new EC(r,O,L,s),f.push(pe)),pe}function F(L){if(--L.usedTimes===0){const O=f.indexOf(L);f[O]=f[f.length-1],f.pop(),L.destroy()}}function Y(L){u.remove(L)}function de(){u.dispose()}return{getParameters:S,getProgramCacheKey:A,getUniforms:z,acquireProgram:U,releaseProgram:F,releaseShaderCache:Y,programs:f,dispose:de}}function PC(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,c){r.get(s)[o]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function IC(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function Qy(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function e0(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(p,g,v,x,E,M){let S=r[e];return S===void 0?(S={id:p.id,object:p,geometry:g,material:v,groupOrder:x,renderOrder:p.renderOrder,z:E,group:M},r[e]=S):(S.id=p.id,S.object=p,S.geometry=g,S.material=v,S.groupOrder=x,S.renderOrder=p.renderOrder,S.z=E,S.group=M),e++,S}function c(p,g,v,x,E,M){const S=o(p,g,v,x,E,M);v.transmission>0?n.push(S):v.transparent===!0?i.push(S):t.push(S)}function u(p,g,v,x,E,M){const S=o(p,g,v,x,E,M);v.transmission>0?n.unshift(S):v.transparent===!0?i.unshift(S):t.unshift(S)}function h(p,g){t.length>1&&t.sort(p||IC),n.length>1&&n.sort(g||Qy),i.length>1&&i.sort(g||Qy)}function f(){for(let p=e,g=r.length;p=s.length?(o=new e0,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function NC(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new V,color:new ht};break;case"SpotLight":t={position:new V,direction:new V,color:new ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new V,color:new ht,distance:0,decay:0};break;case"HemisphereLight":t={direction:new V,skyColor:new ht,groundColor:new ht};break;case"RectAreaLight":t={color:new ht,position:new V,halfWidth:new V,halfHeight:new V};break}return r[e.id]=t,t}}}function DC(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Be,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let OC=0;function UC(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function FC(r,e){const t=new NC,n=DC(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let f=0;f<9;f++)i.probe.push(new V);const s=new V,o=new Bt,c=new Bt;function u(f,p){let g=0,v=0,x=0;for(let pe=0;pe<9;pe++)i.probe[pe].set(0,0,0);let E=0,M=0,S=0,A=0,T=0,I=0,z=0,U=0,F=0,Y=0,de=0;f.sort(UC);const L=p===!0?Math.PI:1;for(let pe=0,be=f.length;pe0&&(e.isWebGL2?r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=nt.LTC_FLOAT_1,i.rectAreaLTC2=nt.LTC_FLOAT_2):(i.rectAreaLTC1=nt.LTC_HALF_1,i.rectAreaLTC2=nt.LTC_HALF_2):r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=nt.LTC_FLOAT_1,i.rectAreaLTC2=nt.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=nt.LTC_HALF_1,i.rectAreaLTC2=nt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=g,i.ambient[1]=v,i.ambient[2]=x;const O=i.hash;(O.directionalLength!==E||O.pointLength!==M||O.spotLength!==S||O.rectAreaLength!==A||O.hemiLength!==T||O.numDirectionalShadows!==I||O.numPointShadows!==z||O.numSpotShadows!==U||O.numSpotMaps!==F||O.numLightProbes!==de)&&(i.directional.length=E,i.spot.length=S,i.rectArea.length=A,i.point.length=M,i.hemi.length=T,i.directionalShadow.length=I,i.directionalShadowMap.length=I,i.pointShadow.length=z,i.pointShadowMap.length=z,i.spotShadow.length=U,i.spotShadowMap.length=U,i.directionalShadowMatrix.length=I,i.pointShadowMatrix.length=z,i.spotLightMatrix.length=U+F-Y,i.spotLightMap.length=F,i.numSpotLightShadowsWithMaps=Y,i.numLightProbes=de,O.directionalLength=E,O.pointLength=M,O.spotLength=S,O.rectAreaLength=A,O.hemiLength=T,O.numDirectionalShadows=I,O.numPointShadows=z,O.numSpotShadows=U,O.numSpotMaps=F,O.numLightProbes=de,i.version=OC++)}function h(f,p){let g=0,v=0,x=0,E=0,M=0;const S=p.matrixWorldInverse;for(let A=0,T=f.length;A=c.length?(u=new t0(r,e),c.push(u)):u=c[o],u}function i(){t=new WeakMap}return{get:n,dispose:i}}class Tm extends mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=R_,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Am extends mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const kC=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,zC=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function HC(r,e,t){let n=new Gc;const i=new Be,s=new Be,o=new vn,c=new Tm({depthPacking:P_}),u=new Am,h={},f=t.maxTextureSize,p={[Es]:Vi,[Vi]:Es,[Zr]:Zr},g=new Br({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Be},radius:{value:4}},vertexShader:kC,fragmentShader:zC}),v=g.clone();v.defines.HORIZONTAL_PASS=1;const x=new Zt;x.setAttribute("position",new _n(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Jn(x,g),M=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Kh;let S=this.type;this.render=function(U,F,Y){if(M.enabled===!1||M.autoUpdate===!1&&M.needsUpdate===!1||U.length===0)return;const de=r.getRenderTarget(),L=r.getActiveCubeFace(),O=r.getActiveMipmapLevel(),pe=r.state;pe.setBlending(bs),pe.buffers.color.setClear(1,1,1,1),pe.buffers.depth.setTest(!0),pe.setScissorTest(!1);const be=S!==Dr&&this.type===Dr,$=S===Dr&&this.type!==Dr;for(let ye=0,me=U.length;yef||i.y>f)&&(i.x>f&&(s.x=Math.floor(f/J.x),i.x=s.x*J.x,G.mapSize.x=s.x),i.y>f&&(s.y=Math.floor(f/J.y),i.y=s.y*J.y,G.mapSize.y=s.y)),G.map===null||be===!0||$===!0){const ue=this.type!==Dr?{minFilter:Xn,magFilter:Xn}:{};G.map!==null&&G.map.dispose(),G.map=new Fr(i.x,i.y,ue),G.map.texture.name=Pe.name+".shadowMap",G.camera.updateProjectionMatrix()}r.setRenderTarget(G.map),r.clear();const ee=G.getViewportCount();for(let ue=0;ue0||F.map&&F.alphaTest>0){const pe=L.uuid,be=F.uuid;let $=h[pe];$===void 0&&($={},h[pe]=$);let ye=$[be];ye===void 0&&(ye=L.clone(),$[be]=ye,F.addEventListener("dispose",z)),L=ye}if(L.visible=F.visible,L.wireframe=F.wireframe,de===Dr?L.side=F.shadowSide!==null?F.shadowSide:F.side:L.side=F.shadowSide!==null?F.shadowSide:p[F.side],L.alphaMap=F.alphaMap,L.alphaTest=F.alphaTest,L.map=F.map,L.clipShadows=F.clipShadows,L.clippingPlanes=F.clippingPlanes,L.clipIntersection=F.clipIntersection,L.displacementMap=F.displacementMap,L.displacementScale=F.displacementScale,L.displacementBias=F.displacementBias,L.wireframeLinewidth=F.wireframeLinewidth,L.linewidth=F.linewidth,Y.isPointLight===!0&&L.isMeshDistanceMaterial===!0){const pe=r.properties.get(L);pe.light=Y}return L}function I(U,F,Y,de,L){if(U.visible===!1)return;if(U.layers.test(F.layers)&&(U.isMesh||U.isLine||U.isPoints)&&(U.castShadow||U.receiveShadow&&L===Dr)&&(!U.frustumCulled||n.intersectsObject(U))){U.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,U.matrixWorld);const be=e.update(U),$=U.material;if(Array.isArray($)){const ye=be.groups;for(let me=0,Pe=ye.length;me=1):ee.indexOf("OpenGL ES")!==-1&&(J=parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]),G=J>=2);let ue=null,Ie={};const Ke=r.getParameter(r.SCISSOR_BOX),ve=r.getParameter(r.VIEWPORT),Ne=new vn().fromArray(Ke),je=new vn().fromArray(ve);function st(q,Je,Ze,pt){const Et=new Uint8Array(4),cn=r.createTexture();r.bindTexture(q,cn),r.texParameteri(q,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(q,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let rn=0;rn"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new WeakMap;let p;const g=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(k,D){return v?new OffscreenCanvas(k,D):Ac("canvas")}function E(k,D,ce,We){let ze=1;if((k.width>We||k.height>We)&&(ze=We/Math.max(k.width,k.height)),ze<1||D===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const ke=D?Fh:Math.floor,dt=ke(ze*k.width),Qe=ke(ze*k.height);p===void 0&&(p=x(dt,Qe));const ut=ce?x(dt,Qe):p;return ut.width=dt,ut.height=Qe,ut.getContext("2d").drawImage(k,0,0,dt,Qe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+dt+"x"+Qe+")."),ut}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function M(k){return Hp(k.width)&&Hp(k.height)}function S(k){return c?!1:k.wrapS!==Ci||k.wrapT!==Ci||k.minFilter!==Xn&&k.minFilter!==Un}function A(k,D){return k.generateMipmaps&&D&&k.minFilter!==Xn&&k.minFilter!==Un}function T(k){r.generateMipmap(k)}function I(k,D,ce,We,ze=!1){if(c===!1)return D;if(k!==null){if(r[k]!==void 0)return r[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let ke=D;if(D===r.RED&&(ce===r.FLOAT&&(ke=r.R32F),ce===r.HALF_FLOAT&&(ke=r.R16F),ce===r.UNSIGNED_BYTE&&(ke=r.R8)),D===r.RED_INTEGER&&(ce===r.UNSIGNED_BYTE&&(ke=r.R8UI),ce===r.UNSIGNED_SHORT&&(ke=r.R16UI),ce===r.UNSIGNED_INT&&(ke=r.R32UI),ce===r.BYTE&&(ke=r.R8I),ce===r.SHORT&&(ke=r.R16I),ce===r.INT&&(ke=r.R32I)),D===r.RG&&(ce===r.FLOAT&&(ke=r.RG32F),ce===r.HALF_FLOAT&&(ke=r.RG16F),ce===r.UNSIGNED_BYTE&&(ke=r.RG8)),D===r.RGBA){const dt=ze?Mc:yn.getTransfer(We);ce===r.FLOAT&&(ke=r.RGBA32F),ce===r.HALF_FLOAT&&(ke=r.RGBA16F),ce===r.UNSIGNED_BYTE&&(ke=dt===An?r.SRGB8_ALPHA8:r.RGBA8),ce===r.UNSIGNED_SHORT_4_4_4_4&&(ke=r.RGBA4),ce===r.UNSIGNED_SHORT_5_5_5_1&&(ke=r.RGB5_A1)}return(ke===r.R16F||ke===r.R32F||ke===r.RG16F||ke===r.RG32F||ke===r.RGBA16F||ke===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ke}function z(k,D,ce){return A(k,ce)===!0||k.isFramebufferTexture&&k.minFilter!==Xn&&k.minFilter!==Un?Math.log2(Math.max(D.width,D.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?D.mipmaps.length:1}function U(k){return k===Xn||k===Oh||k===$o?r.NEAREST:r.LINEAR}function F(k){const D=k.target;D.removeEventListener("dispose",F),de(D),D.isVideoTexture&&f.delete(D)}function Y(k){const D=k.target;D.removeEventListener("dispose",Y),O(D)}function de(k){const D=n.get(k);if(D.__webglInit===void 0)return;const ce=k.source,We=g.get(ce);if(We){const ze=We[D.__cacheKey];ze.usedTimes--,ze.usedTimes===0&&L(k),Object.keys(We).length===0&&g.delete(ce)}n.remove(k)}function L(k){const D=n.get(k);r.deleteTexture(D.__webglTexture);const ce=k.source,We=g.get(ce);delete We[D.__cacheKey],o.memory.textures--}function O(k){const D=k.texture,ce=n.get(k),We=n.get(D);if(We.__webglTexture!==void 0&&(r.deleteTexture(We.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let ze=0;ze<6;ze++){if(Array.isArray(ce.__webglFramebuffer[ze]))for(let ke=0;ke=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+i.maxTextures),pe+=1,k}function ye(k){const D=[];return D.push(k.wrapS),D.push(k.wrapT),D.push(k.wrapR||0),D.push(k.magFilter),D.push(k.minFilter),D.push(k.anisotropy),D.push(k.internalFormat),D.push(k.format),D.push(k.type),D.push(k.generateMipmaps),D.push(k.premultiplyAlpha),D.push(k.flipY),D.push(k.unpackAlignment),D.push(k.colorSpace),D.join()}function me(k,D){const ce=n.get(k);if(k.isVideoTexture&&xt(k),k.isRenderTargetTexture===!1&&k.version>0&&ce.__version!==k.version){const We=k.image;if(We===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(We.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(ce,k,D);return}}t.bindTexture(r.TEXTURE_2D,ce.__webglTexture,r.TEXTURE0+D)}function Pe(k,D){const ce=n.get(k);if(k.version>0&&ce.__version!==k.version){Ne(ce,k,D);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ce.__webglTexture,r.TEXTURE0+D)}function G(k,D){const ce=n.get(k);if(k.version>0&&ce.__version!==k.version){Ne(ce,k,D);return}t.bindTexture(r.TEXTURE_3D,ce.__webglTexture,r.TEXTURE0+D)}function J(k,D){const ce=n.get(k);if(k.version>0&&ce.__version!==k.version){je(ce,k,D);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ce.__webglTexture,r.TEXTURE0+D)}const ee={[yc]:r.REPEAT,[Ci]:r.CLAMP_TO_EDGE,[vc]:r.MIRRORED_REPEAT},ue={[Xn]:r.NEAREST,[Oh]:r.NEAREST_MIPMAP_NEAREST,[$o]:r.NEAREST_MIPMAP_LINEAR,[Un]:r.LINEAR,[lc]:r.LINEAR_MIPMAP_NEAREST,[Qr]:r.LINEAR_MIPMAP_LINEAR},Ie={[L_]:r.NEVER,[B_]:r.ALWAYS,[N_]:r.LESS,[vm]:r.LEQUAL,[D_]:r.EQUAL,[F_]:r.GEQUAL,[O_]:r.GREATER,[U_]:r.NOTEQUAL};function Ke(k,D,ce){if(D.type===wr&&e.has("OES_texture_float_linear")===!1&&(D.magFilter===Un||D.magFilter===lc||D.magFilter===$o||D.magFilter===Qr||D.minFilter===Un||D.minFilter===lc||D.minFilter===$o||D.minFilter===Qr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ce?(r.texParameteri(k,r.TEXTURE_WRAP_S,ee[D.wrapS]),r.texParameteri(k,r.TEXTURE_WRAP_T,ee[D.wrapT]),(k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY)&&r.texParameteri(k,r.TEXTURE_WRAP_R,ee[D.wrapR]),r.texParameteri(k,r.TEXTURE_MAG_FILTER,ue[D.magFilter]),r.texParameteri(k,r.TEXTURE_MIN_FILTER,ue[D.minFilter])):(r.texParameteri(k,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(k,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY)&&r.texParameteri(k,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(D.wrapS!==Ci||D.wrapT!==Ci)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(k,r.TEXTURE_MAG_FILTER,U(D.magFilter)),r.texParameteri(k,r.TEXTURE_MIN_FILTER,U(D.minFilter)),D.minFilter!==Xn&&D.minFilter!==Un&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),D.compareFunction&&(r.texParameteri(k,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(k,r.TEXTURE_COMPARE_FUNC,Ie[D.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const We=e.get("EXT_texture_filter_anisotropic");if(D.magFilter===Xn||D.minFilter!==$o&&D.minFilter!==Qr||D.type===wr&&e.has("OES_texture_float_linear")===!1||c===!1&&D.type===dl&&e.has("OES_texture_half_float_linear")===!1)return;(D.anisotropy>1||n.get(D).__currentAnisotropy)&&(r.texParameterf(k,We.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,i.getMaxAnisotropy())),n.get(D).__currentAnisotropy=D.anisotropy)}}function ve(k,D){let ce=!1;k.__webglInit===void 0&&(k.__webglInit=!0,D.addEventListener("dispose",F));const We=D.source;let ze=g.get(We);ze===void 0&&(ze={},g.set(We,ze));const ke=ye(D);if(ke!==k.__cacheKey){ze[ke]===void 0&&(ze[ke]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ce=!0),ze[ke].usedTimes++;const dt=ze[k.__cacheKey];dt!==void 0&&(ze[k.__cacheKey].usedTimes--,dt.usedTimes===0&&L(D)),k.__cacheKey=ke,k.__webglTexture=ze[ke].texture}return ce}function Ne(k,D,ce){let We=r.TEXTURE_2D;(D.isDataArrayTexture||D.isCompressedArrayTexture)&&(We=r.TEXTURE_2D_ARRAY),D.isData3DTexture&&(We=r.TEXTURE_3D);const ze=ve(k,D),ke=D.source;t.bindTexture(We,k.__webglTexture,r.TEXTURE0+ce);const dt=n.get(ke);if(ke.version!==dt.__version||ze===!0){t.activeTexture(r.TEXTURE0+ce);const Qe=yn.getPrimaries(yn.workingColorSpace),ut=D.colorSpace===ur?null:yn.getPrimaries(D.colorSpace),wt=D.colorSpace===ur||Qe===ut?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,D.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,D.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,D.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,wt);const Ft=S(D)&&M(D.image)===!1;let Ve=E(D.image,Ft,!1,i.maxTextureSize);Ve=ot(D,Ve);const Kt=M(Ve)||c,Ht=s.convert(D.format,D.colorSpace);let Dt=s.convert(D.type),yt=I(D.internalFormat,Ht,Dt,D.colorSpace,D.isVideoTexture);Ke(We,D,Kt);let Ce;const Ut=D.mipmaps,$t=c&&D.isVideoTexture!==!0&&yt!==mm,fn=dt.__version===void 0||ze===!0,Fe=ke.dataReady,ln=z(D,Ve,Kt);if(D.isDepthTexture)yt=r.DEPTH_COMPONENT,c?D.type===wr?yt=r.DEPTH_COMPONENT32F:D.type===Ss?yt=r.DEPTH_COMPONENT24:D.type===ao?yt=r.DEPTH24_STENCIL8:yt=r.DEPTH_COMPONENT16:D.type===wr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),D.format===lo&&yt===r.DEPTH_COMPONENT&&D.type!==Zh&&D.type!==Ss&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),D.type=Ss,Dt=s.convert(D.type)),D.format===ua&&yt===r.DEPTH_COMPONENT&&(yt=r.DEPTH_STENCIL,D.type!==ao&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),D.type=ao,Dt=s.convert(D.type))),fn&&($t?t.texStorage2D(r.TEXTURE_2D,1,yt,Ve.width,Ve.height):t.texImage2D(r.TEXTURE_2D,0,yt,Ve.width,Ve.height,0,Ht,Dt,null));else if(D.isDataTexture)if(Ut.length>0&&Kt){$t&&fn&&t.texStorage2D(r.TEXTURE_2D,ln,yt,Ut[0].width,Ut[0].height);for(let q=0,Je=Ut.length;q>=1,Je>>=1}}else if(Ut.length>0&&Kt){$t&&fn&&t.texStorage2D(r.TEXTURE_2D,ln,yt,Ut[0].width,Ut[0].height);for(let q=0,Je=Ut.length;q0&&Fe++,t.texStorage2D(r.TEXTURE_CUBE_MAP,Fe,Ce,Ve[0].width,Ve[0].height));for(let q=0;q<6;q++)if(Ft){Ut?fn&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+q,0,0,0,Ve[q].width,Ve[q].height,Dt,yt,Ve[q].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+q,0,Ce,Ve[q].width,Ve[q].height,0,Dt,yt,Ve[q].data);for(let Je=0;Je>ke),Ve=Math.max(1,D.height>>ke);ze===r.TEXTURE_3D||ze===r.TEXTURE_2D_ARRAY?t.texImage3D(ze,ke,ut,Ft,Ve,D.depth,0,dt,Qe,null):t.texImage2D(ze,ke,ut,Ft,Ve,0,dt,Qe,null)}t.bindFramebuffer(r.FRAMEBUFFER,k),De(D)?u.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,We,ze,n.get(ce).__webglTexture,0,Xe(D)):(ze===r.TEXTURE_2D||ze>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&ze<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,We,ze,n.get(ce).__webglTexture,ke),t.bindFramebuffer(r.FRAMEBUFFER,null)}function Mt(k,D,ce){if(r.bindRenderbuffer(r.RENDERBUFFER,k),D.depthBuffer&&!D.stencilBuffer){let We=c===!0?r.DEPTH_COMPONENT24:r.DEPTH_COMPONENT16;if(ce||De(D)){const ze=D.depthTexture;ze&&ze.isDepthTexture&&(ze.type===wr?We=r.DEPTH_COMPONENT32F:ze.type===Ss&&(We=r.DEPTH_COMPONENT24));const ke=Xe(D);De(D)?u.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ke,We,D.width,D.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,ke,We,D.width,D.height)}else r.renderbufferStorage(r.RENDERBUFFER,We,D.width,D.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,k)}else if(D.depthBuffer&&D.stencilBuffer){const We=Xe(D);ce&&De(D)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,We,r.DEPTH24_STENCIL8,D.width,D.height):De(D)?u.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,We,r.DEPTH24_STENCIL8,D.width,D.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,D.width,D.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,k)}else{const We=D.isWebGLMultipleRenderTargets===!0?D.texture:[D.texture];for(let ze=0;ze0){ce.__webglFramebuffer[Qe]=[];for(let ut=0;ut0){ce.__webglFramebuffer=[];for(let Qe=0;Qe0&&De(k)===!1){const Qe=ke?D:[D];ce.__webglMultisampledFramebuffer=r.createFramebuffer(),ce.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let ut=0;ut0)for(let ut=0;ut0)for(let ut=0;ut0&&De(k)===!1){const D=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],ce=k.width,We=k.height;let ze=r.COLOR_BUFFER_BIT;const ke=[],dt=k.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Qe=n.get(k),ut=k.isWebGLMultipleRenderTargets===!0;if(ut)for(let wt=0;wt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&D.__useRenderToTexture!==!1}function xt(k){const D=o.render.frame;f.get(k)!==D&&(f.set(k,D),k.update())}function ot(k,D){const ce=k.colorSpace,We=k.format,ze=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===Uh||ce!==rs&&ce!==ur&&(yn.getTransfer(ce)===An?c===!1?e.has("EXT_sRGB")===!0&&We===zi?(k.format=Uh,k.minFilter=Un,k.generateMipmaps=!1):D=xm.sRGBToLinear(D):(We!==zi||ze!==ns)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ce)),D}this.allocateTextureUnit=$,this.resetTextureUnits=be,this.setTexture2D=me,this.setTexture2DArray=Pe,this.setTexture3D=G,this.setTextureCube=J,this.rebindTextures=ft,this.setupRenderTarget=W,this.updateRenderTargetMipmap=Ge,this.updateMultisampleRenderTarget=Re,this.setupDepthRenderbuffer=Nt,this.setupFrameBufferTexture=st,this.useMultisampledRTT=De}function Q_(r,e,t){const n=t.isWebGL2;function i(s,o=ur){let c;const u=yn.getTransfer(o);if(s===ns)return r.UNSIGNED_BYTE;if(s===um)return r.UNSIGNED_SHORT_4_4_4_4;if(s===hm)return r.UNSIGNED_SHORT_5_5_5_1;if(s===v_)return r.BYTE;if(s===__)return r.SHORT;if(s===Zh)return r.UNSIGNED_SHORT;if(s===cm)return r.INT;if(s===Ss)return r.UNSIGNED_INT;if(s===wr)return r.FLOAT;if(s===dl)return n?r.HALF_FLOAT:(c=e.get("OES_texture_half_float"),c!==null?c.HALF_FLOAT_OES:null);if(s===x_)return r.ALPHA;if(s===zi)return r.RGBA;if(s===S_)return r.LUMINANCE;if(s===M_)return r.LUMINANCE_ALPHA;if(s===lo)return r.DEPTH_COMPONENT;if(s===ua)return r.DEPTH_STENCIL;if(s===Uh)return c=e.get("EXT_sRGB"),c!==null?c.SRGB_ALPHA_EXT:null;if(s===w_)return r.RED;if(s===fm)return r.RED_INTEGER;if(s===b_)return r.RG;if(s===dm)return r.RG_INTEGER;if(s===pm)return r.RGBA_INTEGER;if(s===Mh||s===wh||s===bh||s===Eh)if(u===An)if(c=e.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===Mh)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===wh)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===bh)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Eh)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=e.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===Mh)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===wh)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===bh)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Eh)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===pp||s===mp||s===gp||s===yp)if(c=e.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===pp)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===mp)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===gp)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===yp)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===mm)return c=e.get("WEBGL_compressed_texture_etc1"),c!==null?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===vp||s===_p)if(c=e.get("WEBGL_compressed_texture_etc"),c!==null){if(s===vp)return u===An?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===_p)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===xp||s===Sp||s===Mp||s===wp||s===bp||s===Ep||s===Tp||s===Ap||s===Cp||s===Rp||s===Pp||s===Ip||s===Lp||s===Np)if(c=e.get("WEBGL_compressed_texture_astc"),c!==null){if(s===xp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Sp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Mp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===wp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===bp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Ep)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Tp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Ap)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Cp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===Rp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Pp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Ip)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Lp)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Np)return u===An?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Th||s===Dp||s===Op)if(c=e.get("EXT_texture_compression_bptc"),c!==null){if(s===Th)return u===An?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Dp)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Op)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===E_||s===Up||s===Fp||s===Bp)if(c=e.get("EXT_texture_compression_rgtc"),c!==null){if(s===Th)return c.COMPRESSED_RED_RGTC1_EXT;if(s===Up)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Fp)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Bp)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===ao?n?r.UNSIGNED_INT_24_8:(c=e.get("WEBGL_depth_texture"),c!==null?c.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}class ex extends ui{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ll extends mn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const WC={type:"move"};class Pd{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ll,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ll,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new V,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new V),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ll,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new V,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new V),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const c=this._targetRay,u=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){o=!0;for(const E of e.hand.values()){const M=t.getJointPose(E,n),S=this._getHandJoint(h,E);M!==null&&(S.matrix.fromArray(M.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=M.radius),S.visible=M!==null}const f=h.joints["index-finger-tip"],p=h.joints["thumb-tip"],g=f.position.distanceTo(p.position),v=.02,x=.005;h.inputState.pinching&&g>v+x?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&g<=v-x&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(WC)))}return c!==null&&(c.visible=i!==null),u!==null&&(u.visible=s!==null),h!==null&&(h.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new ll;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const XC=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,qC=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class jC{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Bn,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new Br({extensions:{fragDepth:!0},vertexShader:XC,fragmentShader:qC,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Jn(new Sl(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class YC extends Cs{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",u=1,h=null,f=null,p=null,g=null,v=null,x=null;const E=new jC,M=t.getContextAttributes();let S=null,A=null;const T=[],I=[],z=new Be;let U=null;const F=new ui;F.layers.enable(1),F.viewport=new vn;const Y=new ui;Y.layers.enable(2),Y.viewport=new vn;const de=[F,Y],L=new ex;L.layers.enable(1),L.layers.enable(2);let O=null,pe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ve){let Ne=T[ve];return Ne===void 0&&(Ne=new Pd,T[ve]=Ne),Ne.getTargetRaySpace()},this.getControllerGrip=function(ve){let Ne=T[ve];return Ne===void 0&&(Ne=new Pd,T[ve]=Ne),Ne.getGripSpace()},this.getHand=function(ve){let Ne=T[ve];return Ne===void 0&&(Ne=new Pd,T[ve]=Ne),Ne.getHandSpace()};function be(ve){const Ne=I.indexOf(ve.inputSource);if(Ne===-1)return;const je=T[Ne];je!==void 0&&(je.update(ve.inputSource,ve.frame,h||o),je.dispatchEvent({type:ve.type,data:ve.inputSource}))}function $(){i.removeEventListener("select",be),i.removeEventListener("selectstart",be),i.removeEventListener("selectend",be),i.removeEventListener("squeeze",be),i.removeEventListener("squeezestart",be),i.removeEventListener("squeezeend",be),i.removeEventListener("end",$),i.removeEventListener("inputsourceschange",ye);for(let ve=0;ve=0&&(I[st]=null,T[st].disconnect(je))}for(let Ne=0;Ne=I.length){I.push(je),st=Le;break}else if(I[Le]===null){I[Le]=je,st=Le;break}if(st===-1)break}const Mt=T[st];Mt&&Mt.connect(je)}}const me=new V,Pe=new V;function G(ve,Ne,je){me.setFromMatrixPosition(Ne.matrixWorld),Pe.setFromMatrixPosition(je.matrixWorld);const st=me.distanceTo(Pe),Mt=Ne.projectionMatrix.elements,Le=je.projectionMatrix.elements,Nt=Mt[14]/(Mt[10]-1),ft=Mt[14]/(Mt[10]+1),W=(Mt[9]+1)/Mt[5],Ge=(Mt[9]-1)/Mt[5],Re=(Mt[8]-1)/Mt[0],Xe=(Le[8]+1)/Le[0],De=Nt*Re,xt=Nt*Xe,ot=st/(-Re+Xe),k=ot*-Re;Ne.matrixWorld.decompose(ve.position,ve.quaternion,ve.scale),ve.translateX(k),ve.translateZ(ot),ve.matrixWorld.compose(ve.position,ve.quaternion,ve.scale),ve.matrixWorldInverse.copy(ve.matrixWorld).invert();const D=Nt+ot,ce=ft+ot,We=De-k,ze=xt+(st-k),ke=W*ft/ce*D,dt=Ge*ft/ce*D;ve.projectionMatrix.makePerspective(We,ze,ke,dt,D,ce),ve.projectionMatrixInverse.copy(ve.projectionMatrix).invert()}function J(ve,Ne){Ne===null?ve.matrixWorld.copy(ve.matrix):ve.matrixWorld.multiplyMatrices(Ne.matrixWorld,ve.matrix),ve.matrixWorldInverse.copy(ve.matrixWorld).invert()}this.updateCamera=function(ve){if(i===null)return;E.texture!==null&&(ve.near=E.depthNear,ve.far=E.depthFar),L.near=Y.near=F.near=ve.near,L.far=Y.far=F.far=ve.far,(O!==L.near||pe!==L.far)&&(i.updateRenderState({depthNear:L.near,depthFar:L.far}),O=L.near,pe=L.far,F.near=O,F.far=pe,Y.near=O,Y.far=pe,F.updateProjectionMatrix(),Y.updateProjectionMatrix(),ve.updateProjectionMatrix());const Ne=ve.parent,je=L.cameras;J(L,Ne);for(let st=0;st0&&(M.alphaTest.value=S.alphaTest);const A=e.get(S).envMap;if(A&&(M.envMap.value=A,M.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,M.reflectivity.value=S.reflectivity,M.ior.value=S.ior,M.refractionRatio.value=S.refractionRatio),S.lightMap){M.lightMap.value=S.lightMap;const T=r._useLegacyLights===!0?Math.PI:1;M.lightMapIntensity.value=S.lightMapIntensity*T,t(S.lightMap,M.lightMapTransform)}S.aoMap&&(M.aoMap.value=S.aoMap,M.aoMapIntensity.value=S.aoMapIntensity,t(S.aoMap,M.aoMapTransform))}function o(M,S){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,S.map&&(M.map.value=S.map,t(S.map,M.mapTransform))}function c(M,S){M.dashSize.value=S.dashSize,M.totalSize.value=S.dashSize+S.gapSize,M.scale.value=S.scale}function u(M,S,A,T){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,M.size.value=S.size*A,M.scale.value=T*.5,S.map&&(M.map.value=S.map,t(S.map,M.uvTransform)),S.alphaMap&&(M.alphaMap.value=S.alphaMap,t(S.alphaMap,M.alphaMapTransform)),S.alphaTest>0&&(M.alphaTest.value=S.alphaTest)}function h(M,S){M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,M.rotation.value=S.rotation,S.map&&(M.map.value=S.map,t(S.map,M.mapTransform)),S.alphaMap&&(M.alphaMap.value=S.alphaMap,t(S.alphaMap,M.alphaMapTransform)),S.alphaTest>0&&(M.alphaTest.value=S.alphaTest)}function f(M,S){M.specular.value.copy(S.specular),M.shininess.value=Math.max(S.shininess,1e-4)}function p(M,S){S.gradientMap&&(M.gradientMap.value=S.gradientMap)}function g(M,S){M.metalness.value=S.metalness,S.metalnessMap&&(M.metalnessMap.value=S.metalnessMap,t(S.metalnessMap,M.metalnessMapTransform)),M.roughness.value=S.roughness,S.roughnessMap&&(M.roughnessMap.value=S.roughnessMap,t(S.roughnessMap,M.roughnessMapTransform)),e.get(S).envMap&&(M.envMapIntensity.value=S.envMapIntensity)}function v(M,S,A){M.ior.value=S.ior,S.sheen>0&&(M.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),M.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(M.sheenColorMap.value=S.sheenColorMap,t(S.sheenColorMap,M.sheenColorMapTransform)),S.sheenRoughnessMap&&(M.sheenRoughnessMap.value=S.sheenRoughnessMap,t(S.sheenRoughnessMap,M.sheenRoughnessMapTransform))),S.clearcoat>0&&(M.clearcoat.value=S.clearcoat,M.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(M.clearcoatMap.value=S.clearcoatMap,t(S.clearcoatMap,M.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(M.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,t(S.clearcoatRoughnessMap,M.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(M.clearcoatNormalMap.value=S.clearcoatNormalMap,t(S.clearcoatNormalMap,M.clearcoatNormalMapTransform),M.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===Vi&&M.clearcoatNormalScale.value.negate())),S.iridescence>0&&(M.iridescence.value=S.iridescence,M.iridescenceIOR.value=S.iridescenceIOR,M.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],M.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(M.iridescenceMap.value=S.iridescenceMap,t(S.iridescenceMap,M.iridescenceMapTransform)),S.iridescenceThicknessMap&&(M.iridescenceThicknessMap.value=S.iridescenceThicknessMap,t(S.iridescenceThicknessMap,M.iridescenceThicknessMapTransform))),S.transmission>0&&(M.transmission.value=S.transmission,M.transmissionSamplerMap.value=A.texture,M.transmissionSamplerSize.value.set(A.width,A.height),S.transmissionMap&&(M.transmissionMap.value=S.transmissionMap,t(S.transmissionMap,M.transmissionMapTransform)),M.thickness.value=S.thickness,S.thicknessMap&&(M.thicknessMap.value=S.thicknessMap,t(S.thicknessMap,M.thicknessMapTransform)),M.attenuationDistance.value=S.attenuationDistance,M.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(M.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(M.anisotropyMap.value=S.anisotropyMap,t(S.anisotropyMap,M.anisotropyMapTransform))),M.specularIntensity.value=S.specularIntensity,M.specularColor.value.copy(S.specularColor),S.specularColorMap&&(M.specularColorMap.value=S.specularColorMap,t(S.specularColorMap,M.specularColorMapTransform)),S.specularIntensityMap&&(M.specularIntensityMap.value=S.specularIntensityMap,t(S.specularIntensityMap,M.specularIntensityMapTransform))}function x(M,S){S.matcap&&(M.matcap.value=S.matcap)}function E(M,S){const A=e.get(S).light;M.referencePosition.value.setFromMatrixPosition(A.matrixWorld),M.nearDistance.value=A.shadow.camera.near,M.farDistance.value=A.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function JC(r,e,t,n){let i={},s={},o=[];const c=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function u(A,T){const I=T.program;n.uniformBlockBinding(A,I)}function h(A,T){let I=i[A.id];I===void 0&&(x(A),I=f(A),i[A.id]=I,A.addEventListener("dispose",M));const z=T.program;n.updateUBOMapping(A,z);const U=e.render.frame;s[A.id]!==U&&(g(A),s[A.id]=U)}function f(A){const T=p();A.__bindingPointIndex=T;const I=r.createBuffer(),z=A.__size,U=A.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,z,U),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,T,I),I}function p(){for(let A=0;A0&&(I+=z-U),A.__size=I,A.__cache={},this}function E(A){const T={boundary:0,storage:0};return typeof A=="number"||typeof A=="boolean"?(T.boundary=4,T.storage=4):A.isVector2?(T.boundary=8,T.storage=8):A.isVector3||A.isColor?(T.boundary=16,T.storage=12):A.isVector4?(T.boundary=16,T.storage=16):A.isMatrix3?(T.boundary=48,T.storage=48):A.isMatrix4?(T.boundary=64,T.storage=64):A.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",A),T}function M(A){const T=A.target;T.removeEventListener("dispose",M);const I=o.indexOf(T.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[T.id]),delete i[T.id],delete s[T.id]}function S(){for(const A in i)r.deleteBuffer(i[A]);o=[],i={},s={}}return{bind:u,update:h,dispose:S}}class Cm{constructor(e={}){const{canvas:t=z_(),context:n=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:c=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:h=!1,powerPreference:f="default",failIfMajorPerformanceCaveat:p=!1}=e;this.isWebGLRenderer=!0;let g;n!==null?g=n.getContextAttributes().alpha:g=o;const v=new Uint32Array(4),x=new Int32Array(4);let E=null,M=null;const S=[],A=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ti,this._useLegacyLights=!1,this.toneMapping=ts,this.toneMappingExposure=1;const T=this;let I=!1,z=0,U=0,F=null,Y=-1,de=null;const L=new vn,O=new vn;let pe=null;const be=new ht(0);let $=0,ye=t.width,me=t.height,Pe=1,G=null,J=null;const ee=new vn(0,0,ye,me),ue=new vn(0,0,ye,me);let Ie=!1;const Ke=new Gc;let ve=!1,Ne=!1,je=null;const st=new Bt,Mt=new Be,Le=new V,Nt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ft(){return F===null?Pe:1}let W=n;function Ge(B,fe){for(let xe=0;xe{function Ye(){if(we.forEach(function(mt){ot.get(mt).currentProgram.isReady()&&we.delete(mt)}),we.size===0){Se(B);return}setTimeout(Ye,10)}Re.get("KHR_parallel_shader_compile")!==null?Ye():setTimeout(Ye,10)})};let rn=null;function Mn(B){rn&&rn(B)}function Zn(){Xt.stop()}function un(){Xt.start()}const Xt=new j_;Xt.setAnimationLoop(Mn),typeof self<"u"&&Xt.setContext(self),this.setAnimationLoop=function(B){rn=B,Fe.setAnimationLoop(B),B===null?Xt.stop():Xt.start()},Fe.addEventListener("sessionstart",Zn),Fe.addEventListener("sessionend",un),this.render=function(B,fe){if(fe!==void 0&&fe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),fe.parent===null&&fe.matrixWorldAutoUpdate===!0&&fe.updateMatrixWorld(),Fe.enabled===!0&&Fe.isPresenting===!0&&(Fe.cameraAutoUpdate===!0&&Fe.updateCamera(fe),fe=Fe.getCamera()),B.isScene===!0&&B.onBeforeRender(T,B,fe,F),M=wt.get(B,A.length),M.init(),A.push(M),st.multiplyMatrices(fe.projectionMatrix,fe.matrixWorldInverse),Ke.setFromProjectionMatrix(st),Ne=this.localClippingEnabled,ve=Ft.init(this.clippingPlanes,Ne),E=ut.get(B,S.length),E.init(),S.push(E),gn(B,fe,0,T.sortObjects),E.finish(),T.sortObjects===!0&&E.sort(G,J),this.info.render.frame++,ve===!0&&Ft.beginShadows();const xe=M.state.shadowsArray;if(Ve.render(xe,B,fe),ve===!0&&Ft.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Fe.enabled===!1||Fe.isPresenting===!1||Fe.hasDepthSensing()===!1)&&Kt.render(E,B),M.setupLights(T._useLegacyLights),fe.isArrayCamera){const we=fe.cameras;for(let Se=0,Ye=we.length;Se0?M=A[A.length-1]:M=null,S.pop(),S.length>0?E=S[S.length-1]:E=null};function gn(B,fe,xe,we){if(B.visible===!1)return;if(B.layers.test(fe.layers)){if(B.isGroup)xe=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(fe);else if(B.isLight)M.pushLight(B),B.castShadow&&M.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||Ke.intersectsSprite(B)){we&&Le.setFromMatrixPosition(B.matrixWorld).applyMatrix4(st);const mt=ke.update(B),_t=B.material;_t.visible&&E.push(B,mt,_t,xe,Le.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||Ke.intersectsObject(B))){const mt=ke.update(B),_t=B.material;if(we&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),Le.copy(B.boundingSphere.center)):(mt.boundingSphere===null&&mt.computeBoundingSphere(),Le.copy(mt.boundingSphere.center)),Le.applyMatrix4(B.matrixWorld).applyMatrix4(st)),Array.isArray(_t)){const Ct=mt.groups;for(let Rt=0,Lt=Ct.length;Rt0&&Hr(Se,Ye,fe,xe),we&&De.viewport(L.copy(we)),Se.length>0&&Er(Se,fe,xe),Ye.length>0&&Er(Ye,fe,xe),mt.length>0&&Er(mt,fe,xe),De.buffers.depth.setTest(!0),De.buffers.depth.setMask(!0),De.buffers.color.setMask(!0),De.setPolygonOffset(!1)}function Hr(B,fe,xe,we){if((xe.isScene===!0?xe.overrideMaterial:null)!==null)return;const Ye=Xe.isWebGL2;je===null&&(je=new Fr(1,1,{generateMipmaps:!0,type:Re.has("EXT_color_buffer_half_float")?dl:ns,minFilter:Qr,samples:Ye?4:0})),T.getDrawingBufferSize(Mt),Ye?je.setSize(Mt.x,Mt.y):je.setSize(Fh(Mt.x),Fh(Mt.y));const mt=T.getRenderTarget();T.setRenderTarget(je),T.getClearColor(be),$=T.getClearAlpha(),$<1&&T.setClearColor(16777215,.5),T.clear();const _t=T.toneMapping;T.toneMapping=ts,Er(B,xe,we),k.updateMultisampleRenderTarget(je),k.updateRenderTargetMipmap(je);let Ct=!1;for(let Rt=0,Lt=fe.length;Rt0),Ot=!!xe.morphAttributes.position,wn=!!xe.morphAttributes.normal,Rn=!!xe.morphAttributes.color;let xn=ts;we.toneMapped&&(F===null||F.isXRRenderTarget===!0)&&(xn=T.toneMapping);const On=xe.morphAttributes.position||xe.morphAttributes.normal||xe.morphAttributes.color,Pt=On!==void 0?On.length:0,qe=ot.get(we),Pi=M.state.lights;if(ve===!0&&(Ne===!0||B!==de)){const kn=B===de&&we.id===Y;Ft.setState(we,B,kn)}let qt=!1;we.version===qe.__version?(qe.needsLights&&qe.lightsStateVersion!==Pi.state.version||qe.outputColorSpace!==_t||Se.isBatchedMesh&&qe.batching===!1||!Se.isBatchedMesh&&qe.batching===!0||Se.isInstancedMesh&&qe.instancing===!1||!Se.isInstancedMesh&&qe.instancing===!0||Se.isSkinnedMesh&&qe.skinning===!1||!Se.isSkinnedMesh&&qe.skinning===!0||Se.isInstancedMesh&&qe.instancingColor===!0&&Se.instanceColor===null||Se.isInstancedMesh&&qe.instancingColor===!1&&Se.instanceColor!==null||qe.envMap!==Ct||we.fog===!0&&qe.fog!==Ye||qe.numClippingPlanes!==void 0&&(qe.numClippingPlanes!==Ft.numPlanes||qe.numIntersection!==Ft.numIntersection)||qe.vertexAlphas!==Rt||qe.vertexTangents!==Lt||qe.morphTargets!==Ot||qe.morphNormals!==wn||qe.morphColors!==Rn||qe.toneMapping!==xn||Xe.isWebGL2===!0&&qe.morphTargetsCount!==Pt)&&(qt=!0):(qt=!0,qe.__version=we.version);let Pn=qe.currentProgram;qt===!0&&(Pn=Rs(we,fe,Se));let sn=!1,ri=!1,Ln=!1;const Sn=Pn.getUniforms(),Xi=qe.uniforms;if(De.useProgram(Pn.program)&&(sn=!0,ri=!0,Ln=!0),we.id!==Y&&(Y=we.id,ri=!0),sn||de!==B){Sn.setValue(W,"projectionMatrix",B.projectionMatrix),Sn.setValue(W,"viewMatrix",B.matrixWorldInverse);const kn=Sn.map.cameraPosition;kn!==void 0&&kn.setValue(W,Le.setFromMatrixPosition(B.matrixWorld)),Xe.logarithmicDepthBuffer&&Sn.setValue(W,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(we.isMeshPhongMaterial||we.isMeshToonMaterial||we.isMeshLambertMaterial||we.isMeshBasicMaterial||we.isMeshStandardMaterial||we.isShaderMaterial)&&Sn.setValue(W,"isOrthographic",B.isOrthographicCamera===!0),de!==B&&(de=B,ri=!0,Ln=!0)}if(Se.isSkinnedMesh){Sn.setOptional(W,Se,"bindMatrix"),Sn.setOptional(W,Se,"bindMatrixInverse");const kn=Se.skeleton;kn&&(Xe.floatVertexTextures?(kn.boneTexture===null&&kn.computeBoneTexture(),Sn.setValue(W,"boneTexture",kn.boneTexture,k)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Se.isBatchedMesh&&(Sn.setOptional(W,Se,"batchingTexture"),Sn.setValue(W,"batchingTexture",Se._matricesTexture,k));const Vr=xe.morphAttributes;if((Vr.position!==void 0||Vr.normal!==void 0||Vr.color!==void 0&&Xe.isWebGL2===!0)&&Ht.update(Se,xe,Pn),(ri||qe.receiveShadow!==Se.receiveShadow)&&(qe.receiveShadow=Se.receiveShadow,Sn.setValue(W,"receiveShadow",Se.receiveShadow)),we.isMeshGouraudMaterial&&we.envMap!==null&&(Xi.envMap.value=Ct,Xi.flipEnvMap.value=Ct.isCubeTexture&&Ct.isRenderTargetTexture===!1?-1:1),ri&&(Sn.setValue(W,"toneMappingExposure",T.toneMappingExposure),qe.needsLights&&Ps(Xi,Ln),Ye&&we.fog===!0&&Qe.refreshFogUniforms(Xi,Ye),Qe.refreshMaterialUniforms(Xi,we,Pe,me,je),Rh.upload(W,nr(qe),Xi,k)),we.isShaderMaterial&&we.uniformsNeedUpdate===!0&&(Rh.upload(W,nr(qe),Xi,k),we.uniformsNeedUpdate=!1),we.isSpriteMaterial&&Sn.setValue(W,"center",Se.center),Sn.setValue(W,"modelViewMatrix",Se.modelViewMatrix),Sn.setValue(W,"normalMatrix",Se.normalMatrix),Sn.setValue(W,"modelMatrix",Se.matrixWorld),we.isShaderMaterial||we.isRawShaderMaterial){const kn=we.uniformsGroups;for(let as=0,si=kn.length;as0&&k.useMultisampledRTT(B)===!1?Se=ot.get(B).__webglMultisampledFramebuffer:Array.isArray(Lt)?Se=Lt[xe]:Se=Lt,L.copy(B.viewport),O.copy(B.scissor),pe=B.scissorTest}else L.copy(ee).multiplyScalar(Pe).floor(),O.copy(ue).multiplyScalar(Pe).floor(),pe=Ie;if(De.bindFramebuffer(W.FRAMEBUFFER,Se)&&Xe.drawBuffers&&we&&De.drawBuffers(B,Se),De.viewport(L),De.scissor(O),De.setScissorTest(pe),Ye){const Ct=ot.get(B.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_CUBE_MAP_POSITIVE_X+fe,Ct.__webglTexture,xe)}else if(mt){const Ct=ot.get(B.texture),Rt=fe||0;W.framebufferTextureLayer(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,Ct.__webglTexture,xe||0,Rt)}Y=-1},this.readRenderTargetPixels=function(B,fe,xe,we,Se,Ye,mt){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let _t=ot.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&mt!==void 0&&(_t=_t[mt]),_t){De.bindFramebuffer(W.FRAMEBUFFER,_t);try{const Ct=B.texture,Rt=Ct.format,Lt=Ct.type;if(Rt!==zi&&Ce.convert(Rt)!==W.getParameter(W.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Ot=Lt===dl&&(Re.has("EXT_color_buffer_half_float")||Xe.isWebGL2&&Re.has("EXT_color_buffer_float"));if(Lt!==ns&&Ce.convert(Lt)!==W.getParameter(W.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Lt===wr&&(Xe.isWebGL2||Re.has("OES_texture_float")||Re.has("WEBGL_color_buffer_float")))&&!Ot){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}fe>=0&&fe<=B.width-we&&xe>=0&&xe<=B.height-Se&&W.readPixels(fe,xe,we,Se,Ce.convert(Rt),Ce.convert(Lt),Ye)}finally{const Ct=F!==null?ot.get(F).__webglFramebuffer:null;De.bindFramebuffer(W.FRAMEBUFFER,Ct)}}},this.copyFramebufferToTexture=function(B,fe,xe=0){const we=Math.pow(2,-xe),Se=Math.floor(fe.image.width*we),Ye=Math.floor(fe.image.height*we);k.setTexture2D(fe,0),W.copyTexSubImage2D(W.TEXTURE_2D,xe,0,0,B.x,B.y,Se,Ye),De.unbindTexture()},this.copyTextureToTexture=function(B,fe,xe,we=0){const Se=fe.image.width,Ye=fe.image.height,mt=Ce.convert(xe.format),_t=Ce.convert(xe.type);k.setTexture2D(xe,0),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,xe.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,xe.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,xe.unpackAlignment),fe.isDataTexture?W.texSubImage2D(W.TEXTURE_2D,we,B.x,B.y,Se,Ye,mt,_t,fe.image.data):fe.isCompressedTexture?W.compressedTexSubImage2D(W.TEXTURE_2D,we,B.x,B.y,fe.mipmaps[0].width,fe.mipmaps[0].height,mt,fe.mipmaps[0].data):W.texSubImage2D(W.TEXTURE_2D,we,B.x,B.y,mt,_t,fe.image),we===0&&xe.generateMipmaps&&W.generateMipmap(W.TEXTURE_2D),De.unbindTexture()},this.copyTextureToTexture3D=function(B,fe,xe,we,Se=0){if(T.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ye=B.max.x-B.min.x+1,mt=B.max.y-B.min.y+1,_t=B.max.z-B.min.z+1,Ct=Ce.convert(we.format),Rt=Ce.convert(we.type);let Lt;if(we.isData3DTexture)k.setTexture3D(we,0),Lt=W.TEXTURE_3D;else if(we.isDataArrayTexture||we.isCompressedArrayTexture)k.setTexture2DArray(we,0),Lt=W.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,we.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,we.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,we.unpackAlignment);const Ot=W.getParameter(W.UNPACK_ROW_LENGTH),wn=W.getParameter(W.UNPACK_IMAGE_HEIGHT),Rn=W.getParameter(W.UNPACK_SKIP_PIXELS),xn=W.getParameter(W.UNPACK_SKIP_ROWS),On=W.getParameter(W.UNPACK_SKIP_IMAGES),Pt=xe.isCompressedTexture?xe.mipmaps[Se]:xe.image;W.pixelStorei(W.UNPACK_ROW_LENGTH,Pt.width),W.pixelStorei(W.UNPACK_IMAGE_HEIGHT,Pt.height),W.pixelStorei(W.UNPACK_SKIP_PIXELS,B.min.x),W.pixelStorei(W.UNPACK_SKIP_ROWS,B.min.y),W.pixelStorei(W.UNPACK_SKIP_IMAGES,B.min.z),xe.isDataTexture||xe.isData3DTexture?W.texSubImage3D(Lt,Se,fe.x,fe.y,fe.z,Ye,mt,_t,Ct,Rt,Pt.data):xe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),W.compressedTexSubImage3D(Lt,Se,fe.x,fe.y,fe.z,Ye,mt,_t,Ct,Pt.data)):W.texSubImage3D(Lt,Se,fe.x,fe.y,fe.z,Ye,mt,_t,Ct,Rt,Pt),W.pixelStorei(W.UNPACK_ROW_LENGTH,Ot),W.pixelStorei(W.UNPACK_IMAGE_HEIGHT,wn),W.pixelStorei(W.UNPACK_SKIP_PIXELS,Rn),W.pixelStorei(W.UNPACK_SKIP_ROWS,xn),W.pixelStorei(W.UNPACK_SKIP_IMAGES,On),Se===0&&we.generateMipmaps&&W.generateMipmap(Lt),De.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?k.setTextureCube(B,0):B.isData3DTexture?k.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?k.setTexture2DArray(B,0):k.setTexture2D(B,0),De.unbindTexture()},this.resetState=function(){z=0,U=0,F=null,De.reset(),Ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return es}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Qh?"display-p3":"srgb",t.unpackColorSpace=yn.workingColorSpace===zc?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===ti?co:ym}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===co?ti:rs}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class tx extends Cm{}tx.prototype.isWebGL1Renderer=!0;class nf{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ht(e),this.density=t}clone(){return new nf(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class rf{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new ht(e),this.near=t,this.far=n}clone(){return new rf(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Bh extends mn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class sf{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ec,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=fr()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return oa("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:u,point:Zl.clone(),uv:hr.getInterpolation(Zl,ju,Ql,Yu,n0,Id,i0,new Be),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ku(r,e,t,n,i,s){Za.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?($l.x=s*Za.x-i*Za.y,$l.y=i*Za.x+s*Za.y):$l.copy(Za),r.copy(e),r.x+=$l.x,r.y+=$l.y,r.applyMatrix4(nx)}const Ju=new V,r0=new V;class rx extends mn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){Ju.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Ju);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ju.setFromMatrixPosition(e.matrixWorld),r0.setFromMatrixPosition(this.matrixWorld);const n=Ju.distanceTo(r0)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i=n.length&&n.push({start:-1,count:-1,z:-1});const s=n[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const Qa="batchId",io=new Bt,d0=new Bt,iR=new Bt,p0=new Bt,Dd=new Gc,Qu=new Gi,Wo=new Ri,nc=new V,Od=new nR,Ti=new Jn,eh=[];function rR(r,e,t=0){const n=e.itemSize;if(r.isInterleavedBufferAttribute||r.array.constructor!==e.array.constructor){const i=r.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new _n(c,1))}const o=i>65536?new Uint32Array(n):new Uint16Array(n);t.setAttribute(Qa,new _n(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(Qa))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Qa}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(n===Qa)continue;if(!e.hasAttribute(n))throw new Error(`BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const i=e.getAttribute(n),s=t.getAttribute(n);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Gi);const e=this._geometryCount,t=this.boundingBox,n=this._active;t.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,c=this._drawRanges,u=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const h=e.getIndex(),f=h!==null;if(f&&(n===-1?i.indexCount=h.count:i.indexCount=n,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const p=this._visibility,g=this._active,v=this._matricesTexture,x=this._matricesTexture.image.data;p.push(!0),g.push(!0);const E=this._geometryCount;this._geometryCount++,iR.toArray(x,E*16),v.needsUpdate=!0,o.push(i),c.push({start:f?i.indexStart:i.vertexStart,count:-1}),u.push({boxInitialized:!1,box:new Gi,sphereInitialized:!1,sphere:new Ri});const M=this.geometry.getAttribute(Qa);for(let S=0;S=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,i=n.getIndex()!==null,s=n.getIndex(),o=t.getIndex(),c=this._reservedRanges[e];if(i&&o.count>c.indexCount||t.attributes.position.count>c.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const u=c.vertexStart,h=c.vertexCount;for(const v in n.attributes){if(v===Qa)continue;const x=t.getAttribute(v),E=n.getAttribute(v);rR(x,E,u);const M=x.itemSize;for(let S=x.count,A=h;S=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return null;const i=this._bounds[e],s=i.box,o=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const c=o.index,u=o.attributes.position,h=this._drawRanges[e];for(let f=h.start,p=h.start+h.count;f=o||n[e]===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const n=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||n[e]===!1?null:t.fromArray(i,e*16)}setVisibleAt(e,t){const n=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||n[e]===t?this:(n[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,n=this._active,i=this._geometryCount;return e>=i||n[e]===!1?!1:t[e]}raycast(e,t){const n=this._visibility,i=this._active,s=this._drawRanges,o=this._geometryCount,c=this.matrixWorld,u=this.geometry;Ti.material=this.material,Ti.geometry.index=u.index,Ti.geometry.attributes=u.attributes,Ti.geometry.boundingBox===null&&(Ti.geometry.boundingBox=new Gi),Ti.geometry.boundingSphere===null&&(Ti.geometry.boundingSphere=new Ri);for(let h=0;h({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,n,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),c=o===null?1:o.array.BYTES_PER_ELEMENT,u=this._active,h=this._visibility,f=this._multiDrawStarts,p=this._multiDrawCounts,g=this._drawRanges,v=this.perObjectFrustumCulled;v&&(p0.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),Dd.setFromProjectionMatrix(p0,e.coordinateSystem));let x=0;if(this.sortObjects){d0.copy(this.matrixWorld).invert(),nc.setFromMatrixPosition(n.matrixWorld).applyMatrix4(d0);for(let S=0,A=h.length;Su)continue;g.applyMatrix4(this.matrixWorld);const Y=e.ray.origin.distanceTo(g);Ye.far||t.push({distance:Y,point:p.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}else{const S=Math.max(0,o.start),A=Math.min(M.count,o.start+o.count);for(let T=S,I=A-1;Tu)continue;g.applyMatrix4(this.matrixWorld);const U=e.ray.origin.distanceTo(g);Ue.far||t.push({distance:U,point:p.clone().applyMatrix4(this.matrixWorld),index:T,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:h,distanceToRay:Math.sqrt(c),point:u,index:e,face:null,object:o})}}class sR extends Bn{constructor(e,t,n,i,s,o,c,u,h){super(e,t,n,i,s,o,c,u,h),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Un,this.magFilter=s!==void 0?s:Un,this.generateMipmaps=!1;const f=this;function p(){f.needsUpdate=!0,e.requestVideoFrameCallback(p)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(p)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class oR extends Bn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Xn,this.minFilter=Xn,this.generateMipmaps=!1,this.needsUpdate=!0}}class af extends Bn{constructor(e,t,n,i,s,o,c,u,h,f,p,g){super(null,o,c,u,h,f,i,s,p,g),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class aR extends af{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ci}}class lR extends af{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Ts),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class cR extends Bn{constructor(e,t,n,i,s,o,c,u,h){super(e,t,n,i,s,o,c,u,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class kr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let o;t?o=t:o=e*n[s-1];let c=0,u=s-1,h;for(;c<=u;)if(i=Math.floor(c+(u-c)/2),h=n[i]-o,h<0)c=i+1;else if(h>0)u=i-1;else{u=i;break}if(i=u,n[i]===o)return i/(s-1);const f=n[i],g=n[i+1]-f,v=(o-f)/g;return(i+v)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),c=this.getPoint(s),u=t||(o.isVector2?new Be:new V);return u.copy(c).sub(o).normalize(),u}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new V,i=[],s=[],o=[],c=new V,u=new Bt;for(let v=0;v<=e;v++){const x=v/e;i[v]=this.getTangentAt(x,new V)}s[0]=new V,o[0]=new V;let h=Number.MAX_VALUE;const f=Math.abs(i[0].x),p=Math.abs(i[0].y),g=Math.abs(i[0].z);f<=h&&(h=f,n.set(1,0,0)),p<=h&&(h=p,n.set(0,1,0)),g<=h&&n.set(0,0,1),c.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],c),o[0].crossVectors(i[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),c.crossVectors(i[v-1],i[v]),c.length()>Number.EPSILON){c.normalize();const x=Math.acos(Hn(i[v-1].dot(i[v]),-1,1));s[v].applyMatrix4(u.makeRotationAxis(c,x))}o[v].crossVectors(i[v],s[v])}if(t===!0){let v=Math.acos(Hn(s[0].dot(s[e]),-1,1));v/=e,i[0].dot(c.crossVectors(s[0],s[e]))>0&&(v=-v);for(let x=1;x<=e;x++)s[x].applyMatrix4(u.makeRotationAxis(i[x],v*x)),o[x].crossVectors(i[x],s[x])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class lf extends kr{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,c=!1,u=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=c,this.aRotation=u}getPoint(e,t){const n=t||new Be,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(c)/s)+1)*s:u===0&&c===s-1&&(c=s-2,u=1);let h,f;this.closed||c>0?h=i[(c-1)%s]:(rh.subVectors(i[0],i[1]).add(i[0]),h=rh);const p=i[c%s],g=i[(c+1)%s];if(this.closed||c+2i.length-2?i.length-1:o+1],p=i[o>i.length-3?i.length-1:o+2];return n.set(M0(c,u.x,h.x,f.x,p.x),M0(c,u.y,h.y,f.y,p.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const o=i[s]-n,c=this.curves[s],u=c.getLength(),h=u===0?0:1-o/u;return c.getPointAt(h,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const p=h.getPoint(0);p.equals(this.currentPoint)||this.lineTo(p.x,p.y)}this.curves.push(h);const f=h.getPoint(1);return this.currentPoint.copy(f),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xc extends Zt{constructor(e=[new Be(0,-.5),new Be(.5,0),new Be(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Hn(i,0,Math.PI*2);const s=[],o=[],c=[],u=[],h=[],f=1/t,p=new V,g=new Be,v=new V,x=new V,E=new V;let M=0,S=0;for(let A=0;A<=e.length-1;A++)switch(A){case 0:M=e[A+1].x-e[A].x,S=e[A+1].y-e[A].y,v.x=S*1,v.y=-M,v.z=S*0,E.copy(v),v.normalize(),u.push(v.x,v.y,v.z);break;case e.length-1:u.push(E.x,E.y,E.z);break;default:M=e[A+1].x-e[A].x,S=e[A+1].y-e[A].y,v.x=S*1,v.y=-M,v.z=S*0,x.copy(v),v.x+=E.x,v.y+=E.y,v.z+=E.z,v.normalize(),u.push(v.x,v.y,v.z),E.copy(x)}for(let A=0;A<=t;A++){const T=n+A*f*i,I=Math.sin(T),z=Math.cos(T);for(let U=0;U<=e.length-1;U++){p.x=e[U].x*I,p.y=e[U].y,p.z=e[U].x*z,o.push(p.x,p.y,p.z),g.x=A/t,g.y=U/(e.length-1),c.push(g.x,g.y);const F=u[3*U+0]*I,Y=u[3*U+1],de=u[3*U+0]*z;h.push(F,Y,de)}}for(let A=0;A0&&T(!0),t>0&&T(!1)),this.setIndex(f),this.setAttribute("position",new vt(p,3)),this.setAttribute("normal",new vt(g,3)),this.setAttribute("uv",new vt(v,2));function A(){const I=new V,z=new V;let U=0;const F=(t-e)/n;for(let Y=0;Y<=s;Y++){const de=[],L=Y/s,O=L*(t-e)+e;for(let pe=0;pe<=i;pe++){const be=pe/i,$=be*u+c,ye=Math.sin($),me=Math.cos($);z.x=O*ye,z.y=-L*n+M,z.z=O*me,p.push(z.x,z.y,z.z),I.set(ye,F,me).normalize(),g.push(I.x,I.y,I.z),v.push(be,1-L),de.push(x++)}E.push(de)}for(let Y=0;Y.9&&F<.1&&(T<.2&&(o[A+0]+=1),I<.2&&(o[A+2]+=1),z<.2&&(o[A+4]+=1))}}function g(A){s.push(A.x,A.y,A.z)}function v(A,T){const I=A*3;T.x=e[I+0],T.y=e[I+1],T.z=e[I+2]}function x(){const A=new V,T=new V,I=new V,z=new V,U=new Be,F=new Be,Y=new Be;for(let de=0,L=0;de80*t){c=h=r[0],u=f=r[1];for(let x=t;xh&&(h=p),g>f&&(f=g);v=Math.max(h-c,f-u),v=v!==0?32767/v:0}return Rc(s,o,t,c,u,v,0),o}};function gx(r,e,t,n,i){let s,o;if(i===NR(r,e,t,n)>0)for(s=e;s=e;s-=n)o=w0(s,r[s],r[s+1],o);return o&&df(o,o.next)&&(Ic(o),o=o.next),o}function fa(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(df(t,t.next)||Fn(t.prev,t,t.next)===0)){if(Ic(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Rc(r,e,t,n,i,s,o){if(!r)return;!o&&s&&AR(r,n,i,s);let c=r,u,h;for(;r.prev!==r.next;){if(u=r.prev,h=r.next,s?_R(r,n,i,s):vR(r)){e.push(u.i/t|0),e.push(r.i/t|0),e.push(h.i/t|0),Ic(r),r=h.next,c=h.next;continue}if(r=h,r===c){o?o===1?(r=xR(fa(r),e,t),Rc(r,e,t,n,i,s,2)):o===2&&SR(r,e,t,n,i,s):Rc(fa(r),e,t,n,i,s,1);break}}}function vR(r){const e=r.prev,t=r,n=r.next;if(Fn(e,t,n)>=0)return!1;const i=e.x,s=t.x,o=n.x,c=e.y,u=t.y,h=n.y,f=is?i>o?i:o:s>o?s:o,v=c>u?c>h?c:h:u>h?u:h;let x=n.next;for(;x!==e;){if(x.x>=f&&x.x<=g&&x.y>=p&&x.y<=v&&cl(i,c,s,u,o,h,x.x,x.y)&&Fn(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function _R(r,e,t,n){const i=r.prev,s=r,o=r.next;if(Fn(i,s,o)>=0)return!1;const c=i.x,u=s.x,h=o.x,f=i.y,p=s.y,g=o.y,v=cu?c>h?c:h:u>h?u:h,M=f>p?f>g?f:g:p>g?p:g,S=Xp(v,x,e,t,n),A=Xp(E,M,e,t,n);let T=r.prevZ,I=r.nextZ;for(;T&&T.z>=S&&I&&I.z<=A;){if(T.x>=v&&T.x<=E&&T.y>=x&&T.y<=M&&T!==i&&T!==o&&cl(c,f,u,p,h,g,T.x,T.y)&&Fn(T.prev,T,T.next)>=0||(T=T.prevZ,I.x>=v&&I.x<=E&&I.y>=x&&I.y<=M&&I!==i&&I!==o&&cl(c,f,u,p,h,g,I.x,I.y)&&Fn(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;T&&T.z>=S;){if(T.x>=v&&T.x<=E&&T.y>=x&&T.y<=M&&T!==i&&T!==o&&cl(c,f,u,p,h,g,T.x,T.y)&&Fn(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;I&&I.z<=A;){if(I.x>=v&&I.x<=E&&I.y>=x&&I.y<=M&&I!==i&&I!==o&&cl(c,f,u,p,h,g,I.x,I.y)&&Fn(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function xR(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!df(i,s)&&yx(i,n,n.next,s)&&Pc(i,s)&&Pc(s,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),Ic(n),Ic(n.next),n=r=s),n=n.next}while(n!==r);return fa(n)}function SR(r,e,t,n,i,s){let o=r;do{let c=o.next.next;for(;c!==o.prev;){if(o.i!==c.i&&PR(o,c)){let u=vx(o,c);o=fa(o,o.next),u=fa(u,u.next),Rc(o,e,t,n,i,s,0),Rc(u,e,t,n,i,s,0);return}c=c.next}o=o.next}while(o!==r)}function MR(r,e,t,n){const i=[];let s,o,c,u,h;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const g=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(g<=s&&g>n&&(n=g,i=t.x=t.x&&t.x>=u&&s!==t.x&&cl(oi.x||t.x===i.x&&TR(i,t)))&&(i=t,f=p)),t=t.next;while(t!==c);return i}function TR(r,e){return Fn(r.prev,r,e.prev)<0&&Fn(e.next,r,r.next)<0}function AR(r,e,t,n){let i=r;do i.z===0&&(i.z=Xp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,CR(i)}function CR(r){let e,t,n,i,s,o,c,u,h=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,c=0,e=0;e0||u>0&&n;)c!==0&&(u===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,c--):(i=n,n=n.nextZ,u--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,h*=2}while(o>1);return r}function Xp(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function RR(r){let e=r,t=r;do(e.x=(r-o)*(s-c)&&(r-o)*(n-c)>=(t-o)*(e-c)&&(t-o)*(s-c)>=(i-o)*(n-c)}function PR(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!IR(r,e)&&(Pc(r,e)&&Pc(e,r)&&LR(r,e)&&(Fn(r.prev,r,e.prev)||Fn(r,e.prev,e))||df(r,e)&&Fn(r.prev,r,r.next)>0&&Fn(e.prev,e,e.next)>0)}function Fn(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function df(r,e){return r.x===e.x&&r.y===e.y}function yx(r,e,t,n){const i=ch(Fn(r,e,t)),s=ch(Fn(r,e,n)),o=ch(Fn(t,n,r)),c=ch(Fn(t,n,e));return!!(i!==s&&o!==c||i===0&&lh(r,t,e)||s===0&&lh(r,n,e)||o===0&&lh(t,r,n)||c===0&&lh(t,e,n))}function lh(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function ch(r){return r>0?1:r<0?-1:0}function IR(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&yx(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Pc(r,e){return Fn(r.prev,r,r.next)<0?Fn(r,e,r.next)>=0&&Fn(r,r.prev,e)>=0:Fn(r,e,r.prev)<0||Fn(r,r.next,e)<0}function LR(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function vx(r,e){const t=new qp(r.i,r.x,r.y),n=new qp(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function w0(r,e,t,n){const i=new qp(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ic(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function qp(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function NR(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function E0(r,e){for(let t=0;tNumber.EPSILON){const ke=Math.sqrt(We),dt=Math.sqrt(D*D+ce*ce),Qe=Ge.x-k/ke,ut=Ge.y+ot/ke,wt=Re.x-ce/dt,Ft=Re.y+D/dt,Ve=((wt-Qe)*ce-(Ft-ut)*D)/(ot*ce-k*D);Xe=Qe+ot*Ve-W.x,De=ut+k*Ve-W.y;const Kt=Xe*Xe+De*De;if(Kt<=2)return new Be(Xe,De);xt=Math.sqrt(Kt/2)}else{let ke=!1;ot>Number.EPSILON?D>Number.EPSILON&&(ke=!0):ot<-Number.EPSILON?D<-Number.EPSILON&&(ke=!0):Math.sign(k)===Math.sign(ce)&&(ke=!0),ke?(Xe=-k,De=ot,xt=Math.sqrt(We)):(Xe=ot,De=k,xt=Math.sqrt(We/2))}return new Be(Xe/xt,De/xt)}const J=[];for(let W=0,Ge=$.length,Re=Ge-1,Xe=W+1;W=0;W--){const Ge=W/M,Re=v*Math.cos(Ge*Math.PI/2),Xe=x*Math.sin(Ge*Math.PI/2)+E;for(let De=0,xt=$.length;De=0;){const Xe=Re;let De=Re-1;De<0&&(De=W.length-1);for(let xt=0,ot=f+M*2;xt0)&&v.push(T,I,U),(S!==n-1||u0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class wx extends mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ht(16777215),this.specular=new ht(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fo,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class bx extends mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ht(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fo,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Ex extends mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fo,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class Tx extends mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fo,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=kc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ax extends mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ht(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fo,this.normalScale=new Be(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Cx extends Wi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function ia(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Rx(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function Px(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function jp(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let u=0;u!==e;++u)i[o++]=r[c+u]}return i}function Bm(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}function FR(r,e,t,n,i=30){const s=r.clone();s.name=e;const o=[];for(let u=0;u=n)){p.push(h.times[v]);for(let E=0;Es.tracks[u].times[0]&&(c=s.tracks[u].times[0]);for(let u=0;u=c.times[x]){const S=x*p+f,A=S+p-f;E=c.values.slice(S,A)}else{const S=c.createInterpolant(),A=f,T=p-f;S.evaluate(s),E=S.resultBuffer.slice(A,T)}u==="quaternion"&&new Qi().fromArray(E).normalize().conjugate().toArray(E);const M=h.times.length;for(let S=0;S=s)){const c=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let c=0;c!==s;c++){const u=n[c];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,u,o),e=!1;break}o=u}if(i!==void 0&&Rx(i))for(let c=0,u=i.length;c!==u;++c){const h=i[c];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Ah,s=e.length-1;let o=1;for(let c=1;c0){e[o]=e[s];for(let c=s*n,u=o*n,h=0;h!==n;++h)t[u+h]=t[c+h];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}zr.prototype.TimeBufferType=Float32Array;zr.prototype.ValueBufferType=Float32Array;zr.prototype.DefaultInterpolation=xc;class ma extends zr{}ma.prototype.ValueTypeName="bool";ma.prototype.ValueBufferType=Array;ma.prototype.DefaultInterpolation=_c;ma.prototype.InterpolantFactoryMethodLinear=void 0;ma.prototype.InterpolantFactoryMethodSmooth=void 0;class zm extends zr{}zm.prototype.ValueTypeName="color";class Lc extends zr{}Lc.prototype.ValueTypeName="number";class Nx extends Yc{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,u=(n-t)/(i-t);let h=e*c;for(let f=h+c;h!==f;h+=4)Qi.slerpFlat(s,0,o,h-c,o,h,u);return s}}class bl extends zr{InterpolantFactoryMethodLinear(e){return new Nx(this.times,this.values,this.getValueSize(),e)}}bl.prototype.ValueTypeName="quaternion";bl.prototype.DefaultInterpolation=xc;bl.prototype.InterpolantFactoryMethodSmooth=void 0;class ga extends zr{}ga.prototype.ValueTypeName="string";ga.prototype.ValueBufferType=Array;ga.prototype.DefaultInterpolation=_c;ga.prototype.InterpolantFactoryMethodLinear=void 0;ga.prototype.InterpolantFactoryMethodSmooth=void 0;class Nc extends zr{}Nc.prototype.ValueTypeName="vector";class Dc{constructor(e,t=-1,n,i=$h){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=fr(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(HR(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(zr.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c1){const p=f[1];let g=i[p];g||(i[p]=g=[]),g.push(h)}}const o=[];for(const c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(p,g,v,x,E){if(v.length!==0){const M=[],S=[];Bm(v,M,S,x),M.length!==0&&E.push(new p(g,M,S))}},i=[],s=e.name||"default",o=e.fps||30,c=e.blendMode;let u=e.length||-1;const h=e.hierarchy||[];for(let p=0;p{t&&t(s),this.manager.itemEnd(e)},0),s;if(ys[e]!==void 0){ys[e].push({onLoad:t,onProgress:n,onError:i});return}ys[e]=[],ys[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,u=this.responseType;fetch(o).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const f=ys[e],p=h.body.getReader(),g=h.headers.get("Content-Length")||h.headers.get("X-File-Size"),v=g?parseInt(g):0,x=v!==0;let E=0;const M=new ReadableStream({start(S){A();function A(){p.read().then(({done:T,value:I})=>{if(T)S.close();else{E+=I.byteLength;const z=new ProgressEvent("progress",{lengthComputable:x,loaded:E,total:v});for(let U=0,F=f.length;U{switch(u){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(f=>new DOMParser().parseFromString(f,c));case"json":return h.json();default:if(c===void 0)return h.text();{const p=/charset="?([^;"\s]*)"?/i.exec(c),g=p&&p[1]?p[1].toLowerCase():void 0,v=new TextDecoder(g);return h.arrayBuffer().then(x=>v.decode(x))}}}).then(h=>{Ms.add(e,h);const f=ys[e];delete ys[e];for(let p=0,g=f.length;p{const f=ys[e];if(f===void 0)throw this.manager.itemError(e),h;delete ys[e];for(let p=0,g=f.length;p{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class GR extends er{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new As(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){try{t(s.parse(JSON.parse(c)))}catch(u){i?i(u):console.error(u),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new ht().setHex(o.value);break;case"v2":i.uniforms[s].value=new Be().fromArray(o.value);break;case"v3":i.uniforms[s].value=new V().fromArray(o.value);break;case"v4":i.uniforms[s].value=new vn().fromArray(o.value);break;case"m3":i.uniforms[s].value=new en().fromArray(o.value);break;case"m4":i.uniforms[s].value=new Bt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new Be().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Be().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:xx,SpriteMaterial:Rm,RawShaderMaterial:Sx,ShaderMaterial:Br,PointsMaterial:Im,MeshPhysicalMaterial:Mx,MeshStandardMaterial:vs,MeshPhongMaterial:wx,MeshToonMaterial:bx,MeshNormalMaterial:Ex,MeshLambertMaterial:Tx,MeshDepthMaterial:Tm,MeshDistanceMaterial:Am,MeshBasicMaterial:po,MeshMatcapMaterial:Ax,LineDashedMaterial:Cx,LineBasicMaterial:Wi,Material:mi};return new t[e]}}class Yp{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){const u=new Hm(t);s=new Oc(u),s.setCrossOrigin(this.crossOrigin);for(let h=0,f=e.length;h0){i=new Oc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,c=e.length;o{const M=new Gi;M.min.fromArray(E.boxMin),M.max.fromArray(E.boxMax);const S=new Ri;return S.radius=E.sphereRadius,S.center.fromArray(E.sphereCenter),{boxInitialized:E.boxInitialized,box:M,sphereInitialized:E.sphereInitialized,sphere:S}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=h(e.matricesTexture.uuid);break;case"LOD":o=new rx;break;case"Line":o=new ho(c(e.geometry),u(e.material));break;case"LineLoop":o=new lx(c(e.geometry),u(e.material));break;case"LineSegments":o=new os(c(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new cx(c(e.geometry),u(e.material));break;case"Sprite":o=new ix(u(e.material));break;case"Group":o=new ll;break;case"Bone":o=new Pm;break;default:o=new mn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const g=e.children;for(let v=0;v"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ms.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(h=>{t&&t(h),s.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const u=fetch(e,c).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(h){return Ms.add(e,h),t&&t(h),s.manager.itemEnd(e),h}).catch(function(h){i&&i(h),Ms.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Ms.add(e,u),s.manager.itemStart(e)}}let uh;class Gm{static getContext(){return uh===void 0&&(uh=new(window.AudioContext||window.webkitAudioContext)),uh}static setContext(e){uh=e}}class QR extends er{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new As(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(u){try{const h=u.slice(0);Gm.getContext().decodeAudioData(h,function(p){t(p)}).catch(c)}catch(h){c(h)}},n,i);function c(u){i?i(u):console.error(u),s.manager.itemError(e)}}}const N0=new Bt,D0=new Bt,Xo=new Bt;class eP{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ui,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ui,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Xo.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(sa*t.fov*.5)/t.zoom;let c,u;D0.elements[12]=-i,N0.elements[12]=i,c=-o*t.aspect+s,u=o*t.aspect+s,Xo.elements[0]=2*t.near/(u-c),Xo.elements[8]=(u+c)/(u-c),this.cameraL.projectionMatrix.copy(Xo),c=-o*t.aspect-s,u=o*t.aspect-s,Xo.elements[0]=2*t.near/(u-c),Xo.elements[8]=(u+c)/(u-c),this.cameraR.projectionMatrix.copy(Xo)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(D0),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(N0)}}class Wm{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=O0(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=O0();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function O0(){return(typeof performance>"u"?Date:performance).now()}const qo=new V,U0=new Qi,tP=new V,jo=new V;class nP extends mn{constructor(){super(),this.type="AudioListener",this.context=Gm.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Wm}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(qo,U0,tP),jo.set(0,0,-1).applyQuaternion(U0),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(qo.x,i),t.positionY.linearRampToValueAtTime(qo.y,i),t.positionZ.linearRampToValueAtTime(qo.z,i),t.forwardX.linearRampToValueAtTime(jo.x,i),t.forwardY.linearRampToValueAtTime(jo.y,i),t.forwardZ.linearRampToValueAtTime(jo.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(qo.x,qo.y,qo.z),t.setOrientation(jo.x,jo.y,jo.z,n.x,n.y,n.z)}}class qx extends mn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let u=t,h=t+t;u!==h;++u)if(n[u]!==n[u+t]){c.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){Qi.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const o=this._workIndex*s;Qi.multiplyQuaternionsFlat(e,o,e,t,e,n),Qi.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){const o=1-i;for(let c=0;c!==s;++c){const u=t+c;e[u]=e[u]*o+e[n+c]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){const c=t+o;e[c]=e[c]+e[n+o]*i}}}const Xm="\\[\\]\\.:\\/",oP=new RegExp("["+Xm+"]","g"),qm="[^"+Xm+"]",aP="[^"+Xm.replace("\\.","")+"]",lP=/((?:WC+[\/:])*)/.source.replace("WC",qm),cP=/(WCOD+)?/.source.replace("WCOD",aP),uP=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",qm),hP=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",qm),fP=new RegExp("^"+lP+cP+uP+hP+"$"),dP=["material","materials","bones","map"];class pP{constructor(e,t,n){const i=n||hn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class hn{constructor(e,t,n){this.path=t,this.parsedPath=n||hn.parseTrackName(t),this.node=hn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new hn.Composite(e,t,n):new hn(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(oP,"")}static parseTrackName(e){const t=fP.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);dP.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o=s){const p=s++,g=e[p];t[g.uuid]=f,e[f]=g,t[h]=p,e[p]=u;for(let v=0,x=i;v!==x;++v){const E=n[v],M=E[p],S=E[f];E[f]=M,E[p]=S}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,o=e.length;for(let c=0,u=arguments.length;c!==u;++c){const h=arguments[c],f=h.uuid,p=t[f];if(p!==void 0)if(delete t[f],p0&&(t[v.uuid]=p),e[p]=v,e.pop();for(let x=0,E=i;x!==E;++x){const M=n[x];M[p]=M[g],M.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,c=this._parsedPaths,u=this._objects,h=u.length,f=this.nCachedObjects_,p=new Array(h);i=s.length,n[e]=i,o.push(e),c.push(t),s.push(p);for(let g=f,v=u.length;g!==v;++g){const x=u[g];p[g]=new hn(x,e,t)}return p}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,c=o.length-1,u=o[c],h=e[c];t[h]=n,o[n]=u,o.pop(),s[n]=s[c],s.pop(),i[n]=i[c],i.pop()}}}class Yx{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,o=s.length,c=new Array(o),u={endingStart:ea,endingEnd:ea};for(let h=0;h!==o;++h){const f=s[h].createInterpolant(null);c[h]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=c,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=A_,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,o=s/i,c=i/s;e.warp(1,o,t),this.warp(c,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,o=this.timeScale;let c=this._timeScaleInterpolant;c===null&&(c=i._lendControlInterpolant(),this._timeScaleInterpolant=c);const u=c.parameterPositions,h=c.sampleValues;return u[0]=s,u[1]=s+n,h[0]=e/o,h[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*n;u<0||n===0?t=0:(this._startTime=null,t=n*u)}t*=this._updateTimeScale(e);const o=this._updateTime(t),c=this._updateWeight(e);if(c>0){const u=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case gm:for(let f=0,p=u.length;f!==p;++f)u[f].evaluate(o),h[f].accumulateAdditive(c);break;case $h:default:for(let f=0,p=u.length;f!==p;++f)u[f].evaluate(o),h[f].accumulate(i,c)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const o=n===C_;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(n===T_){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const c=Math.floor(i/t);i-=t*c,s+=Math.abs(c);const u=this.repetitions-s;if(u<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(u===1){const h=e<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=ta,i.endingEnd=ta):(e?i.endingStart=this.zeroSlopeAtStart?ta:ea:i.endingStart=Sc,t?i.endingEnd=this.zeroSlopeAtEnd?ta:ea:i.endingEnd=Sc)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const c=o.parameterPositions,u=o.sampleValues;return c[0]=s,u[0]=t,c[1]=s+e,u[1]=n,this}}const gP=new Float32Array(1);class yP extends Cs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,c=e._interpolants,u=n.uuid,h=this._bindingsByRootAndName;let f=h[u];f===void 0&&(f={},h[u]=f);for(let p=0;p!==s;++p){const g=i[p],v=g.name;let x=f[v];if(x!==void 0)++x.referenceCount,o[p]=x;else{if(x=o[p],x!==void 0){x._cacheIndex===null&&(++x.referenceCount,this._addInactiveBinding(x,u,v));continue}const E=t&&t._propertyBindings[p].binding.parsedPath;x=new jx(hn.create(n,v,E),g.ValueTypeName,g.getValueSize()),++x.referenceCount,this._addInactiveBinding(x,u,v),o[p]=x}c[p].resultBuffer=x.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let h=0;h!==n;++h)t[h]._update(i,e,s,o);const c=this._bindings,u=this._nActiveBindings;for(let h=0;h!==u;++h)c[h].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,k0).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const z0=new V,hh=new V;class EP{constructor(e=new V,t=new V){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){z0.subVectors(e,this.start),hh.subVectors(this.end,this.start);const n=hh.dot(hh);let s=hh.dot(z0)/n;return t&&(s=Hn(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const H0=new V;class TP extends mn{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new Zt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,c=1,u=32;o1)for(let p=0;p.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{q0.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(q0,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class kP extends os{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Zt;i.setAttribute("position",new vt(t,3)),i.setAttribute("color",new vt(n,3));const s=new Wi({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new ht,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class zP{constructor(){this.type="ShapePath",this.color=new ht,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Cc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,o){return this.currentPath.bezierCurveTo(e,t,n,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(S){const A=[];for(let T=0,I=S.length;TNumber.EPSILON){if(L<0&&(F=A[U],de=-de,Y=A[z],L=-L),S.yY.y)continue;if(S.y===F.y){if(S.x===F.x)return!0}else{const O=L*(S.x-F.x)-de*(S.y-F.y);if(O===0)return!0;if(O<0)continue;I=!I}}else{if(S.y!==F.y)continue;if(Y.x<=S.x&&S.x<=F.x||F.x<=S.x&&S.x<=Y.x)return!0}}return I}const i=is.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,c,u;const h=[];if(s.length===1)return c=s[0],u=new ca,u.curves=c.curves,h.push(u),h;let f=!i(s[0].getPoints());f=e?!f:f;const p=[],g=[];let v=[],x=0,E;g[x]=void 0,v[x]=[];for(let S=0,A=s.length;S1){let S=!1,A=0;for(let T=0,I=g.length;T0&&S===!1&&(v=p)}let M;for(let S=0,A=g.length;S{const p=typeof h=="function"?h(e):h;if(p!==e){const g=e;e=f?p:Object.assign({},e,p),t.forEach(v=>v(e,g))}},i=()=>e,s=(h,f=i,p=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=f(e);function v(){const x=f(e);if(!p(g,x)){const E=g;h(g=x,E)}}return t.add(v),()=>t.delete(v)},u={setState:n,getState:i,subscribe:(h,f,p)=>f||p?s(h,f,p):(t.add(h),()=>t.delete(h)),destroy:()=>t.clear()};return e=r(n,i,u),u}const GP=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),j0=GP?lt.useEffect:lt.useLayoutEffect;function WP(r){const e=typeof r=="function"?VP(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=lt.useReducer(M=>M+1,0),o=e.getState(),c=lt.useRef(o),u=lt.useRef(n),h=lt.useRef(i),f=lt.useRef(!1),p=lt.useRef();p.current===void 0&&(p.current=n(o));let g,v=!1;(c.current!==o||u.current!==n||h.current!==i||f.current)&&(g=n(o),v=!i(p.current,g)),j0(()=>{v&&(p.current=g),c.current=o,u.current=n,h.current=i,f.current=!1});const x=lt.useRef(o);j0(()=>{const M=()=>{try{const A=e.getState(),T=u.current(A);h.current(p.current,T)||(c.current=A,p.current=T,s())}catch{f.current=!0,s()}},S=e.subscribe(M);return e.getState()!==x.current&&M(),S},[]);const E=v?g:p.current;return lt.useDebugValue(E),E};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[t,e];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},t}var $x={exports:{}},Xd={exports:{}},qd={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Y0;function XP(){return Y0||(Y0=1,function(r){function e(G,J){var ee=G.length;G.push(J);e:for(;0>>1,Ie=G[ue];if(0>>1;uei(Ne,ee))jei(st,Ne)?(G[ue]=st,G[je]=ee,ue=je):(G[ue]=Ne,G[ve]=ee,ue=ve);else if(jei(st,ee))G[ue]=st,G[je]=ee,ue=je;else break e}}return J}function i(G,J){var ee=G.sortIndex-J.sortIndex;return ee!==0?ee:G.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();r.unstable_now=function(){return o.now()-c}}var u=[],h=[],f=1,p=null,g=3,v=!1,x=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var J=t(h);J!==null;){if(J.callback===null)n(h);else if(J.startTime<=G)n(h),J.sortIndex=J.expirationTime,e(u,J);else break;J=t(h)}}function I(G){if(E=!1,T(G),!x)if(t(u)!==null)x=!0,me(z);else{var J=t(h);J!==null&&Pe(I,J.startTime-G)}}function z(G,J){x=!1,E&&(E=!1,S(Y),Y=-1),v=!0;var ee=g;try{for(T(J),p=t(u);p!==null&&(!(p.expirationTime>J)||G&&!O());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,g=p.priorityLevel;var Ie=ue(p.expirationTime<=J);J=r.unstable_now(),typeof Ie=="function"?p.callback=Ie:p===t(u)&&n(u),T(J)}else n(u);p=t(u)}if(p!==null)var Ke=!0;else{var ve=t(h);ve!==null&&Pe(I,ve.startTime-J),Ke=!1}return Ke}finally{p=null,g=ee,v=!1}}var U=!1,F=null,Y=-1,de=5,L=-1;function O(){return!(r.unstable_now()-LG||125ue?(G.sortIndex=ee,e(h,G),t(u)===null&&G===t(h)&&(E?(S(Y),Y=-1):E=!0,Pe(I,ee-ue))):(G.sortIndex=Ie,e(u,G),x||v||(x=!0,me(z))),G},r.unstable_shouldYield=O,r.unstable_wrapCallback=function(G){var J=g;return function(){var ee=g;g=J;try{return G.apply(this,arguments)}finally{g=ee}}}}(qd)),qd}var K0;function qP(){return K0||(K0=1,Xd.exports=XP()),Xd.exports}/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var jP=function(e){var t={},n=lt,i=qP(),s=Object.assign;function o(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,m=1;mre||b[X]!==R[re]){var Ae=` -`+b[X].replace(" at new "," at ");return a.displayName&&Ae.includes("")&&(Ae=Ae.replace("",a.displayName)),Ae}while(1<=X&&0<=re);break}}}finally{Lt=!1,Error.prepareStackTrace=m}return(a=a?a.displayName||a.name:"")?Rt(a):""}var wn=Object.prototype.hasOwnProperty,Rn=[],xn=-1;function On(a){return{current:a}}function Pt(a){0>xn||(a.current=Rn[xn],Rn[xn]=null,xn--)}function qe(a,l){xn++,Rn[xn]=a.current,a.current=l}var Pi={},qt=On(Pi),Pn=On(!1),sn=Pi;function ri(a,l){var m=a.type.contextTypes;if(!m)return Pi;var _=a.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===l)return _.__reactInternalMemoizedMaskedChildContext;var b={},R;for(R in m)b[R]=l[R];return _&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=b),b}function Ln(a){return a=a.childContextTypes,a!=null}function Sn(){Pt(Pn),Pt(qt)}function Xi(a,l,m){if(qt.current!==Pi)throw Error(o(168));qe(qt,l),qe(Pn,m)}function Vr(a,l,m){var _=a.stateNode;if(l=l.childContextTypes,typeof _.getChildContext!="function")return m;_=_.getChildContext();for(var b in _)if(!(b in l))throw Error(o(108,Y(a)||"Unknown",b));return s({},m,_)}function kn(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Pi,sn=qt.current,qe(qt,a),qe(Pn,Pn.current),!0}function as(a,l,m){var _=a.stateNode;if(!_)throw Error(o(169));m?(a=Vr(a,l,sn),_.__reactInternalMemoizedMergedChildContext=a,Pt(Pn),Pt(qt),qe(qt,a)):Pt(Pn),qe(Pn,m)}var si=Math.clz32?Math.clz32:_o,vo=Math.log,Ar=Math.LN2;function _o(a){return a>>>=0,a===0?32:31-(vo(a)/Ar|0)|0}var xo=64,va=4194304;function nn(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Is(a,l){var m=a.pendingLanes;if(m===0)return 0;var _=0,b=a.suspendedLanes,R=a.pingedLanes,X=m&268435455;if(X!==0){var re=X&~b;re!==0?_=nn(re):(R&=X,R!==0&&(_=nn(R)))}else X=m&~b,X!==0?_=nn(X):R!==0&&(_=nn(R));if(_===0)return 0;if(l!==0&&l!==_&&!(l&b)&&(b=_&-_,R=l&-l,b>=R||b===16&&(R&4194240)!==0))return l;if(_&4&&(_|=m&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=_;0m;m++)l.push(a);return l}function Wr(a,l,m){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-si(l),a[l]=m}function Xr(a,l){var m=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var _=a.eventTimes;for(a=a.expirationTimes;0>=X,b-=X,yr=1<<32-si(l)+b|m<dn?(li=Wt,Wt=null):li=Wt.sibling;var pn=It(_e,Wt,Ee[dn],ct);if(pn===null){Wt===null&&(Wt=li);break}a&&Wt&&pn.alternate===null&&l(_e,Wt),ae=R(pn,ae,dn),Qt===null?St=pn:Qt.sibling=pn,Qt=pn,Wt=li}if(dn===Ee.length)return m(_e,Wt),En&&Yr(_e,dn),St;if(Wt===null){for(;dndn?(li=Wt,Wt=null):li=Wt.sibling;var Ks=It(_e,Wt,pn.value,ct);if(Ks===null){Wt===null&&(Wt=li);break}a&&Wt&&Ks.alternate===null&&l(_e,Wt),ae=R(Ks,ae,dn),Qt===null?St=Ks:Qt.sibling=Ks,Qt=Ks,Wt=li}if(pn.done)return m(_e,Wt),En&&Yr(_e,dn),St;if(Wt===null){for(;!pn.done;dn++,pn=Ee.next())pn=Gt(_e,pn.value,ct),pn!==null&&(ae=R(pn,ae,dn),Qt===null?St=pn:Qt.sibling=pn,Qt=pn);return En&&Yr(_e,dn),St}for(Wt=_(_e,Wt);!pn.done;dn++,pn=Ee.next())pn=Tn(Wt,_e,dn,pn.value,ct),pn!==null&&(a&&pn.alternate!==null&&Wt.delete(pn.key===null?dn:pn.key),ae=R(pn,ae,dn),Qt===null?St=pn:Qt.sibling=pn,Qt=pn);return a&&Wt.forEach(function(qS){return l(_e,qS)}),En&&Yr(_e,dn),St}function Sr(_e,ae,Ee,ct){if(typeof Ee=="object"&&Ee!==null&&Ee.type===f&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case u:e:{for(var St=Ee.key,Qt=ae;Qt!==null;){if(Qt.key===St){if(St=Ee.type,St===f){if(Qt.tag===7){m(_e,Qt.sibling),ae=b(Qt,Ee.props.children),ae.return=_e,_e=ae;break e}}else if(Qt.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===T&&Ra(St)===Qt.type){m(_e,Qt.sibling),ae=b(Qt,Ee.props),ae.ref=Gs(_e,Qt,Ee),ae.return=_e,_e=ae;break e}m(_e,Qt);break}else l(_e,Qt);Qt=Qt.sibling}Ee.type===f?(ae=ko(Ee.props.children,_e.mode,ct,Ee.key),ae.return=_e,_e=ae):(ct=bu(Ee.type,Ee.key,Ee.props,null,_e.mode,ct),ct.ref=Gs(_e,ae,Ee),ct.return=_e,_e=ct)}return X(_e);case h:e:{for(Qt=Ee.key;ae!==null;){if(ae.key===Qt)if(ae.tag===4&&ae.stateNode.containerInfo===Ee.containerInfo&&ae.stateNode.implementation===Ee.implementation){m(_e,ae.sibling),ae=b(ae,Ee.children||[]),ae.return=_e,_e=ae;break e}else{m(_e,ae);break}else l(_e,ae);ae=ae.sibling}ae=nd(Ee,_e.mode,ct),ae.return=_e,_e=ae}return X(_e);case T:return Qt=Ee._init,Sr(_e,ae,Qt(Ee._payload),ct)}if(ye(Ee))return bt(_e,ae,Ee,ct);if(U(Ee))return wi(_e,ae,Ee,ct);vr(_e,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,ae!==null&&ae.tag===6?(m(_e,ae.sibling),ae=b(ae,Ee),ae.return=_e,_e=ae):(m(_e,ae),ae=td(Ee,_e.mode,ct),ae.return=_e,_e=ae),X(_e)):m(_e,ae)}return Sr}var Di=us(!0),Ol=us(!1),d={},y=On(d),w=On(d),C=On(d);function P(a){if(a===d)throw Error(o(174));return a}function N(a,l){qe(C,l),qe(w,a),qe(y,d),a=Pe(l),Pt(y),qe(y,a)}function H(){Pt(y),Pt(w),Pt(C)}function j(a){var l=P(C.current),m=P(y.current);l=G(m,a.type,l),m!==l&&(qe(w,a),qe(y,l))}function ne(a){w.current===a&&(Pt(y),Pt(w))}var K=On(0);function oe(a){for(var l=a;l!==null;){if(l.tag===13){var m=l.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||yo(m)||Hr(m)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Z=[];function le(){for(var a=0;am?m:4,a(!0);var _=ie.transition;ie.transition={};try{a(!1),l()}finally{on=m,ie.transition=_}}function ig(){return At().memoizedState}function _S(a,l,m){var _=qs(a);m={lane:_,action:m,hasEagerState:!1,eagerState:null,next:null},rg(a)?sg(l,m):(og(a,l,m),m=Ui(),a=_r(a,_,m),a!==null&&ag(a,l,_))}function xS(a,l,m){var _=qs(a),b={lane:_,action:m,hasEagerState:!1,eagerState:null,next:null};if(rg(a))sg(l,b);else{og(a,l,b);var R=a.alternate;if(a.lanes===0&&(R===null||R.lanes===0)&&(R=l.lastRenderedReducer,R!==null))try{var X=l.lastRenderedState,re=R(X,m);if(b.hasEagerState=!0,b.eagerState=re,mr(re,X))return}catch{}finally{}m=Ui(),a=_r(a,_,m),a!==null&&ag(a,l,_)}}function rg(a){var l=a.alternate;return a===Q||l!==null&&l===Q}function sg(a,l){Te=Me=!0;var m=a.pending;m===null?l.next=l:(l.next=m.next,m.next=l),a.pending=l}function og(a,l,m){jn!==null&&a.mode&1&&!(tn&2)?(a=l.interleaved,a===null?(m.next=m,Yi===null?Yi=[l]:Yi.push(l)):(m.next=a.next,a.next=m),l.interleaved=m):(a=l.pending,a===null?m.next=m:(m.next=a.next,a.next=m),l.pending=m)}function ag(a,l,m){if(m&4194240){var _=l.lanes;_&=a.pendingLanes,m|=_,l.lanes=m,_a(a,m)}}var tu={readContext:yi,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},SS={readContext:yi,useCallback:function(a,l){return Tt().memoizedState=[a,l===void 0?null:l],a},useContext:yi,useEffect:Af,useImperativeHandle:function(a,l,m){return m=m!=null?m.concat([a]):null,Qc(4194308,4,Qm.bind(null,l,a),m)},useLayoutEffect:function(a,l){return Qc(4194308,4,a,l)},useInsertionEffect:function(a,l){return Qc(4,2,a,l)},useMemo:function(a,l){var m=Tt();return l=l===void 0?null:l,a=a(),m.memoizedState=[a,l],a},useReducer:function(a,l,m){var _=Tt();return l=m!==void 0?m(l):l,_.memoizedState=_.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},_.queue=a,a=a.dispatch=_S.bind(null,Q,a),[_.memoizedState,a]},useRef:function(a){var l=Tt();return a={current:a},l.memoizedState=a},useState:No,useDebugValue:Cf,useDeferredValue:function(a){var l=No(a),m=l[0],_=l[1];return Af(function(){var b=ie.transition;ie.transition={};try{_(a)}finally{ie.transition=b}},[a]),m},useTransition:function(){var a=No(!1),l=a[0];return a=vS.bind(null,a[1]),Tt().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,m){var _=Q,b=Tt();if(En){if(m===void 0)throw Error(o(407));m=m()}else{if(m=l(),jn===null)throw Error(o(349));se&30||Qn(_,l,m)}b.memoizedState=m;var R={value:m,getSnapshot:l};return b.queue=R,Af(ai.bind(null,_,R,a),[a]),_.flags|=2048,Ul(9,Lo.bind(null,_,R,m,l),void 0,null),m},useId:function(){var a=Tt(),l=jn.identifierPrefix;if(En){var m=Pr,_=yr;m=(_&~(1<<32-si(_)-1)).toString(32)+m,l=":"+l+"R"+m,m=Oe++,0jf&&(l.flags|=128,_=!0,zl(b,!1),l.lanes=4194304)}else{if(!_)if(a=oe(R),a!==null){if(l.flags|=128,_=!0,a=a.updateQueue,a!==null&&(l.updateQueue=a,l.flags|=4),zl(b,!0),b.tail===null&&b.tailMode==="hidden"&&!R.alternate&&!En)return Mi(l),null}else 2*bn()-b.renderingStartTime>jf&&m!==1073741824&&(l.flags|=128,_=!0,zl(b,!1),l.lanes=4194304);b.isBackwards?(R.sibling=l.child,l.child=R):(a=b.last,a!==null?a.sibling=R:l.child=R,b.last=R)}return b.tail!==null?(l=b.tail,b.rendering=l,b.tail=l.sibling,b.renderingStartTime=bn(),l.sibling=null,a=K.current,qe(K,_?a&1|2:a&1),l):(Mi(l),null);case 22:case 23:return $f(),_=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==_&&(l.flags|=8192),_&&l.mode&1?ar&1073741824&&(Mi(l),ft&&l.subtreeFlags&6&&(l.flags|=8192)):Mi(l),null;case 24:return null;case 25:return null}throw Error(o(156,l.tag))}var TS=c.ReactCurrentOwner,or=!1;function Oi(a,l,m,_){l.child=a===null?Ol(l,null,m,_):Di(l,a.child,m,_)}function mg(a,l,m,_,b){m=m.render;var R=l.ref;return qr(l,b),_=it(a,l,m,_,R,b),m=et(),a!==null&&!or?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,hs(a,l,b)):(En&&m&&Dl(l),l.flags|=1,Oi(a,l,_,b),l.child)}function gg(a,l,m,_,b){if(a===null){var R=m.type;return typeof R=="function"&&!ed(R)&&R.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(l.tag=15,l.type=R,yg(a,l,R,_,b)):(a=bu(m.type,null,_,l,l.mode,b),a.ref=l.ref,a.return=l,l.child=a)}if(R=a.child,!(a.lanes&b)){var X=R.memoizedProps;if(m=m.compare,m=m!==null?m:Ma,m(X,_)&&a.ref===l.ref)return hs(a,l,b)}return l.flags|=1,a=Ys(R,_),a.ref=l.ref,a.return=l,l.child=a}function yg(a,l,m,_,b){if(a!==null&&Ma(a.memoizedProps,_)&&a.ref===l.ref)if(or=!1,(a.lanes&b)!==0)a.flags&131072&&(or=!0);else return l.lanes=a.lanes,hs(a,l,b);return If(a,l,m,_,b)}function vg(a,l,m){var _=l.pendingProps,b=_.children,R=a!==null?a.memoizedState:null;if(_.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null},qe(Pa,ar),ar|=m;else if(m&1073741824)l.memoizedState={baseLanes:0,cachePool:null},_=R!==null?R.baseLanes:m,qe(Pa,ar),ar|=_;else return a=R!==null?R.baseLanes|m:m,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null},l.updateQueue=null,qe(Pa,ar),ar|=a,null;else R!==null?(_=R.baseLanes|m,l.memoizedState=null):_=m,qe(Pa,ar),ar|=_;return Oi(a,l,b,m),l.child}function _g(a,l){var m=l.ref;(a===null&&m!==null||a!==null&&a.ref!==m)&&(l.flags|=512,l.flags|=2097152)}function If(a,l,m,_,b){var R=Ln(m)?sn:qt.current;return R=ri(l,R),qr(l,b),m=it(a,l,m,_,R,b),_=et(),a!==null&&!or?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,hs(a,l,b)):(En&&_&&Dl(l),l.flags|=1,Oi(a,l,m,b),l.child)}function xg(a,l,m,_,b){if(Ln(m)){var R=!0;kn(l)}else R=!1;if(qr(l,b),l.stateNode===null)a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),Ao(l,m,_),Ta(l,m,_,b),_=!0;else if(a===null){var X=l.stateNode,re=l.memoizedProps;X.props=re;var Ae=X.context,$e=m.contextType;typeof $e=="object"&&$e!==null?$e=yi($e):($e=Ln(m)?sn:qt.current,$e=ri(l,$e));var gt=m.getDerivedStateFromProps,Gt=typeof gt=="function"||typeof X.getSnapshotBeforeUpdate=="function";Gt||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(re!==_||Ae!==$e)&&Ea(l,X,_,$e),gr=!1;var It=l.memoizedState;X.state=It,Eo(l,_,X,b),Ae=l.memoizedState,re!==_||It!==Ae||Pn.current||gr?(typeof gt=="function"&&(Rr(l,m,gt,_),Ae=l.memoizedState),(re=gr||ba(l,m,re,_,It,Ae,$e))?(Gt||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount()),typeof X.componentDidMount=="function"&&(l.flags|=4194308)):(typeof X.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=_,l.memoizedState=Ae),X.props=_,X.state=Ae,X.context=$e,_=re):(typeof X.componentDidMount=="function"&&(l.flags|=4194308),_=!1)}else{X=l.stateNode,Bs(a,l),re=l.memoizedProps,$e=l.type===l.elementType?re:Li(l.type,re),X.props=$e,Gt=l.pendingProps,It=X.context,Ae=m.contextType,typeof Ae=="object"&&Ae!==null?Ae=yi(Ae):(Ae=Ln(m)?sn:qt.current,Ae=ri(l,Ae));var Tn=m.getDerivedStateFromProps;(gt=typeof Tn=="function"||typeof X.getSnapshotBeforeUpdate=="function")||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(re!==Gt||It!==Ae)&&Ea(l,X,_,Ae),gr=!1,It=l.memoizedState,X.state=It,Eo(l,_,X,b);var bt=l.memoizedState;re!==Gt||It!==bt||Pn.current||gr?(typeof Tn=="function"&&(Rr(l,m,Tn,_),bt=l.memoizedState),($e=gr||ba(l,m,$e,_,It,bt,Ae)||!1)?(gt||typeof X.UNSAFE_componentWillUpdate!="function"&&typeof X.componentWillUpdate!="function"||(typeof X.componentWillUpdate=="function"&&X.componentWillUpdate(_,bt,Ae),typeof X.UNSAFE_componentWillUpdate=="function"&&X.UNSAFE_componentWillUpdate(_,bt,Ae)),typeof X.componentDidUpdate=="function"&&(l.flags|=4),typeof X.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof X.componentDidUpdate!="function"||re===a.memoizedProps&&It===a.memoizedState||(l.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||re===a.memoizedProps&&It===a.memoizedState||(l.flags|=1024),l.memoizedProps=_,l.memoizedState=bt),X.props=_,X.state=bt,X.context=Ae,_=$e):(typeof X.componentDidUpdate!="function"||re===a.memoizedProps&&It===a.memoizedState||(l.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||re===a.memoizedProps&&It===a.memoizedState||(l.flags|=1024),_=!1)}return Lf(a,l,m,_,R,b)}function Lf(a,l,m,_,b,R){_g(a,l);var X=(l.flags&128)!==0;if(!_&&!X)return b&&as(l,m,!1),hs(a,l,R);_=l.stateNode,TS.current=l;var re=X&&typeof m.getDerivedStateFromError!="function"?null:_.render();return l.flags|=1,a!==null&&X?(l.child=Di(l,a.child,null,R),l.child=Di(l,null,re,R)):Oi(a,l,re,R),l.memoizedState=_.state,b&&as(l,m,!0),l.child}function Sg(a){var l=a.stateNode;l.pendingContext?Xi(a,l.pendingContext,l.pendingContext!==l.context):l.context&&Xi(a,l.context,!1),N(a,l.containerInfo)}function Mg(a,l,m,_,b){return Vs(),Io(b),l.flags|=256,Oi(a,l,m,_),l.child}var ru={dehydrated:null,treeContext:null,retryLane:0};function su(a){return{baseLanes:a,cachePool:null}}function wg(a,l,m){var _=l.pendingProps,b=K.current,R=!1,X=(l.flags&128)!==0,re;if((re=X)||(re=a!==null&&a.memoizedState===null?!1:(b&2)!==0),re?(R=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(b|=1),qe(K,b&1),a===null)return In(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?Hr(a)?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(b=_.children,a=_.fallback,R?(_=l.mode,R=l.child,b={mode:"hidden",children:b},!(_&1)&&R!==null?(R.childLanes=0,R.pendingProps=b):R=Eu(b,_,0,null),a=ko(a,_,m,null),R.return=l,a.return=l,R.sibling=a,l.child=R,l.child.memoizedState=su(m),l.memoizedState=ru,a):Nf(l,b));if(b=a.memoizedState,b!==null){if(re=b.dehydrated,re!==null){if(X)return l.flags&256?(l.flags&=-257,ou(a,l,m,Error(o(422)))):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(R=_.fallback,b=l.mode,_=Eu({mode:"visible",children:_.children},b,0,null),R=ko(R,b,m,null),R.flags|=2,_.return=l,R.return=l,_.sibling=R,l.child=_,l.mode&1&&Di(l,a.child,null,m),l.child.memoizedState=su(m),l.memoizedState=ru,R);if(!(l.mode&1))l=ou(a,l,m,null);else if(Hr(re))l=ou(a,l,m,Error(o(419)));else if(_=(m&a.childLanes)!==0,or||_){if(_=jn,_!==null){switch(m&-m){case 4:R=2;break;case 16:R=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:R=32;break;case 536870912:R=268435456;break;default:R=0}_=R&(_.suspendedLanes|m)?0:R,_!==0&&_!==b.retryLane&&(b.retryLane=_,_r(a,_,-1))}Qf(),l=ou(a,l,m,Error(o(421)))}else yo(re)?(l.flags|=128,l.child=a.child,l=kS.bind(null,a),Er(re,l),l=null):(m=b.treeContext,Ge&&(xi=Tr(re),di=l,En=!0,rr=null,Co=!1,m!==null&&(vi[_i++]=yr,vi[_i++]=Pr,vi[_i++]=cs,yr=m.id,Pr=m.overflow,cs=l)),l=Nf(l,l.pendingProps.children),l.flags|=4096);return l}return R?(_=Eg(a,l,_.children,_.fallback,m),R=l.child,b=a.child.memoizedState,R.memoizedState=b===null?su(m):{baseLanes:b.baseLanes|m,cachePool:null},R.childLanes=a.childLanes&~m,l.memoizedState=ru,_):(m=bg(a,l,_.children,m),l.memoizedState=null,m)}return R?(_=Eg(a,l,_.children,_.fallback,m),R=l.child,b=a.child.memoizedState,R.memoizedState=b===null?su(m):{baseLanes:b.baseLanes|m,cachePool:null},R.childLanes=a.childLanes&~m,l.memoizedState=ru,_):(m=bg(a,l,_.children,m),l.memoizedState=null,m)}function Nf(a,l){return l=Eu({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function bg(a,l,m,_){var b=a.child;return a=b.sibling,m=Ys(b,{mode:"visible",children:m}),!(l.mode&1)&&(m.lanes=_),m.return=l,m.sibling=null,a!==null&&(_=l.deletions,_===null?(l.deletions=[a],l.flags|=16):_.push(a)),l.child=m}function Eg(a,l,m,_,b){var R=l.mode;a=a.child;var X=a.sibling,re={mode:"hidden",children:m};return!(R&1)&&l.child!==a?(m=l.child,m.childLanes=0,m.pendingProps=re,l.deletions=null):(m=Ys(a,re),m.subtreeFlags=a.subtreeFlags&14680064),X!==null?_=Ys(X,_):(_=ko(_,R,b,null),_.flags|=2),_.return=l,m.return=l,m.sibling=_,l.child=m,_}function ou(a,l,m,_){return _!==null&&Io(_),Di(l,a.child,null,m),a=Nf(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function Tg(a,l,m){a.lanes|=l;var _=a.alternate;_!==null&&(_.lanes|=l),Fs(a.return,l,m)}function Df(a,l,m,_,b){var R=a.memoizedState;R===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:_,tail:m,tailMode:b}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=_,R.tail=m,R.tailMode=b)}function Ag(a,l,m){var _=l.pendingProps,b=_.revealOrder,R=_.tail;if(Oi(a,l,_.children,m),_=K.current,_&2)_=_&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Tg(a,m,l);else if(a.tag===19)Tg(a,m,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}_&=1}if(qe(K,_),!(l.mode&1))l.memoizedState=null;else switch(b){case"forwards":for(m=l.child,b=null;m!==null;)a=m.alternate,a!==null&&oe(a)===null&&(b=m),m=m.sibling;m=b,m===null?(b=l.child,l.child=null):(b=m.sibling,m.sibling=null),Df(l,!1,b,m,R);break;case"backwards":for(m=null,b=l.child,l.child=null;b!==null;){if(a=b.alternate,a!==null&&oe(a)===null){l.child=b;break}a=b.sibling,b.sibling=m,m=b,b=a}Df(l,!0,m,null,R);break;case"together":Df(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function hs(a,l,m){if(a!==null&&(l.dependencies=a.dependencies),Ia|=l.lanes,!(m&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(o(153));if(l.child!==null){for(a=l.child,m=Ys(a,a.pendingProps),l.child=m,m.return=l;a.sibling!==null;)a=a.sibling,m=m.sibling=Ys(a,a.pendingProps),m.return=l;m.sibling=null}return l.child}function AS(a,l,m){switch(l.tag){case 3:Sg(l),Vs();break;case 5:j(l);break;case 1:Ln(l.type)&&kn(l);break;case 4:N(l,l.stateNode.containerInfo);break;case 10:Pl(l,l.type._context,l.memoizedProps.value);break;case 13:var _=l.memoizedState;if(_!==null)return _.dehydrated!==null?(qe(K,K.current&1),l.flags|=128,null):m&l.child.childLanes?wg(a,l,m):(qe(K,K.current&1),a=hs(a,l,m),a!==null?a.sibling:null);qe(K,K.current&1);break;case 19:if(_=(m&l.childLanes)!==0,a.flags&128){if(_)return Ag(a,l,m);l.flags|=128}var b=l.memoizedState;if(b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),qe(K,K.current),_)break;return null;case 22:case 23:return l.lanes=0,vg(a,l,m)}return hs(a,l,m)}function CS(a,l){switch(Ca(l),l.tag){case 1:return Ln(l.type)&&Sn(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return H(),Pt(Pn),Pt(qt),le(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return ne(l),null;case 13:if(Pt(K),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(o(340));Vs()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Pt(K),null;case 4:return H(),null;case 10:return Il(l.type._context),null;case 22:case 23:return $f(),null;case 24:return null;default:return null}}var au=!1,Do=!1,RS=typeof WeakSet=="function"?WeakSet:Set,at=null;function lu(a,l){var m=a.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(_){Zi(a,l,_)}else m.current=null}function Of(a,l,m){try{m()}catch(_){Zi(a,l,_)}}var Cg=!1;function PS(a,l){for(J(a.containerInfo),at=l;at!==null;)if(a=at,l=a.child,(a.subtreeFlags&1028)!==0&&l!==null)l.return=a,at=l;else for(;at!==null;){a=at;try{var m=a.alternate;if(a.flags&1024)switch(a.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var _=m.memoizedProps,b=m.memoizedState,R=a.stateNode,X=R.getSnapshotBeforeUpdate(a.elementType===a.type?_:Li(a.type,_),b);R.__reactInternalSnapshotBeforeUpdate=X}break;case 3:ft&&Je(a.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(re){Zi(a,a.return,re)}if(l=a.sibling,l!==null){l.return=a.return,at=l;break}at=a.return}return m=Cg,Cg=!1,m}function Oo(a,l,m){var _=l.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var b=_=_.next;do{if((b.tag&a)===a){var R=b.destroy;b.destroy=void 0,R!==void 0&&Of(l,m,R)}b=b.next}while(b!==_)}}function Hl(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var m=l=l.next;do{if((m.tag&a)===a){var _=m.create;m.destroy=_()}m=m.next}while(m!==l)}}function Uf(a){var l=a.ref;if(l!==null){var m=a.stateNode;switch(a.tag){case 5:a=me(m);break;default:a=m}typeof l=="function"?l(a):l.current=a}}function Rg(a,l,m){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(Ns,l)}catch{}switch(l.tag){case 0:case 11:case 14:case 15:if(a=l.updateQueue,a!==null&&(a=a.lastEffect,a!==null)){var _=a=a.next;do{var b=_,R=b.destroy;b=b.tag,R!==void 0&&(b&2||b&4)&&Of(l,m,R),_=_.next}while(_!==a)}break;case 1:if(lu(l,m),a=l.stateNode,typeof a.componentWillUnmount=="function")try{a.props=l.memoizedProps,a.state=l.memoizedState,a.componentWillUnmount()}catch(X){Zi(l,m,X)}break;case 5:lu(l,m);break;case 4:ft?Og(a,l,m):W&&W&&(l=l.stateNode.containerInfo,m=pt(l),rn(l,m))}}function Pg(a,l,m){for(var _=l;;)if(Rg(a,_,m),_.child===null||ft&&_.tag===4){if(_===l)break;for(;_.sibling===null;){if(_.return===null||_.return===l)return;_=_.return}_.sibling.return=_.return,_=_.sibling}else _.child.return=_,_=_.child}function Ig(a){var l=a.alternate;l!==null&&(a.alternate=null,Ig(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&xt(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Lg(a){return a.tag===5||a.tag===3||a.tag===4}function Ng(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Lg(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Dg(a){if(ft){e:{for(var l=a.return;l!==null;){if(Lg(l))break e;l=l.return}throw Error(o(160))}var m=l;switch(m.tag){case 5:l=m.stateNode,m.flags&32&&($t(l),m.flags&=-33),m=Ng(a),Bf(a,m,l);break;case 3:case 4:l=m.stateNode.containerInfo,m=Ng(a),Ff(a,m,l);break;default:throw Error(o(161))}}}function Ff(a,l,m){var _=a.tag;if(_===5||_===6)a=a.stateNode,l?yt(m,a,l):Ft(m,a);else if(_!==4&&(a=a.child,a!==null))for(Ff(a,l,m),a=a.sibling;a!==null;)Ff(a,l,m),a=a.sibling}function Bf(a,l,m){var _=a.tag;if(_===5||_===6)a=a.stateNode,l?Dt(m,a,l):wt(m,a);else if(_!==4&&(a=a.child,a!==null))for(Bf(a,l,m),a=a.sibling;a!==null;)Bf(a,l,m),a=a.sibling}function Og(a,l,m){for(var _=l,b=!1,R,X;;){if(!b){b=_.return;e:for(;;){if(b===null)throw Error(o(160));switch(R=b.stateNode,b.tag){case 5:X=!1;break e;case 3:R=R.containerInfo,X=!0;break e;case 4:R=R.containerInfo,X=!0;break e}b=b.return}b=!0}if(_.tag===5||_.tag===6)Pg(a,_,m),X?Ut(R,_.stateNode):Ce(R,_.stateNode);else if(_.tag===18)X?Se(R,_.stateNode):we(R,_.stateNode);else if(_.tag===4){if(_.child!==null){R=_.stateNode.containerInfo,X=!0,_.child.return=_,_=_.child;continue}}else if(Rg(a,_,m),_.child!==null){_.child.return=_,_=_.child;continue}if(_===l)break;for(;_.sibling===null;){if(_.return===null||_.return===l)return;_=_.return,_.tag===4&&(b=!1)}_.sibling.return=_.return,_=_.sibling}}function kf(a,l){if(ft){switch(l.tag){case 0:case 11:case 14:case 15:Oo(3,l,l.return),Hl(3,l),Oo(5,l,l.return);return;case 1:return;case 5:var m=l.stateNode;if(m!=null){var _=l.memoizedProps;a=a!==null?a.memoizedProps:_;var b=l.type,R=l.updateQueue;l.updateQueue=null,R!==null&&Ht(m,R,b,a,_,l)}return;case 6:if(l.stateNode===null)throw Error(o(162));m=l.memoizedProps,Ve(l.stateNode,a!==null?a.memoizedProps:m,m);return;case 3:Ge&&a!==null&&a.memoizedState.isDehydrated&&fe(l.stateNode.containerInfo);return;case 12:return;case 13:cu(l);return;case 19:cu(l);return;case 17:return}throw Error(o(163))}switch(l.tag){case 0:case 11:case 14:case 15:Oo(3,l,l.return),Hl(3,l),Oo(5,l,l.return);return;case 12:return;case 13:cu(l);return;case 19:cu(l);return;case 3:Ge&&a!==null&&a.memoizedState.isDehydrated&&fe(l.stateNode.containerInfo);break;case 22:case 23:return}e:if(W){switch(l.tag){case 1:case 5:case 6:break e;case 3:case 4:l=l.stateNode,rn(l.containerInfo,l.pendingChildren);break e}throw Error(o(163))}}function cu(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var m=a.stateNode;m===null&&(m=a.stateNode=new RS),l.forEach(function(_){var b=zS.bind(null,a,_);m.has(_)||(m.add(_),_.then(b,b))})}}function IS(a,l){for(at=l;at!==null;){l=at;var m=l.deletions;if(m!==null)for(var _=0;_";case hu:return":has("+(Vf(a)||"")+")";case fu:return'[role="'+a.value+'"]';case pu:return'"'+a.value+'"';case du:return'[data-testname="'+a.value+'"]';default:throw Error(o(365))}}function zg(a,l){var m=[];a=[a,0];for(var _=0;_b&&(b=X),_&=~R}if(_=b,_=bn()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*NS(_/1960))-_,10<_){a.timeoutHandle=st(Fo.bind(null,a,Ki),_);break}Fo(a,Ki);break;case 5:Fo(a,Ki);break;default:throw Error(o(329))}}}return Ji(a,bn()),a.callbackNode===m?Hg.bind(null,a):null}function Jf(a,l){var m=Wl;return a.current.memoizedState.isDehydrated&&(Uo(a,l).flags|=256),a=wu(a,l),a!==2&&(l=Ki,Ki=m,l!==null&&Zf(l)),a}function Zf(a){Ki===null?Ki=a:Ki.push.apply(Ki,a)}function DS(a){for(var l=a;;){if(l.flags&16384){var m=l.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var _=0;_a?16:a,Xs===null)var _=!1;else{if(a=Xs,Xs=null,_u=0,tn&6)throw Error(o(331));var b=tn;for(tn|=4,at=a.current;at!==null;){var R=at,X=R.child;if(at.flags&16){var re=R.deletions;if(re!==null){for(var Ae=0;Aebn()-qf?Uo(a,0):Xf|=m),Ji(a,l)}function Kg(a,l){l===0&&(a.mode&1?(l=va,va<<=1,!(va&130023424)&&(va=4194304)):l=1);var m=Ui();a=Mu(a,l),a!==null&&(Wr(a,l,m),Ji(a,m))}function kS(a){var l=a.memoizedState,m=0;l!==null&&(m=l.retryLane),Kg(a,m)}function zS(a,l){var m=0;switch(a.tag){case 13:var _=a.stateNode,b=a.memoizedState;b!==null&&(m=b.retryLane);break;case 19:_=a.stateNode;break;default:throw Error(o(314))}_!==null&&_.delete(l),Kg(a,m)}var Jg;Jg=function(a,l,m){if(a!==null)if(a.memoizedProps!==l.pendingProps||Pn.current)or=!0;else{if(!(a.lanes&m)&&!(l.flags&128))return or=!1,AS(a,l,m);or=!!(a.flags&131072)}else or=!1,En&&l.flags&1048576&&Nl(l,Aa,l.index);switch(l.lanes=0,l.tag){case 2:var _=l.type;a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),a=l.pendingProps;var b=ri(l,qt.current);qr(l,m),b=it(null,l,_,a,b,m);var R=et();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Ln(_)?(R=!0,kn(l)):R=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,qn(l),b.updater=zs,l.stateNode=b,b._reactInternals=l,Ta(l,_,a,m),l=Lf(null,l,_,!0,R,m)):(l.tag=0,En&&R&&Dl(l),Oi(null,l,b,m),l=l.child),l;case 16:_=l.elementType;e:{switch(a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),a=l.pendingProps,b=_._init,_=b(_._payload),l.type=_,b=l.tag=VS(_),a=Li(_,a),b){case 0:l=If(null,l,_,a,m);break e;case 1:l=xg(null,l,_,a,m);break e;case 11:l=mg(null,l,_,a,m);break e;case 14:l=gg(null,l,_,Li(_.type,a),m);break e}throw Error(o(306,_,""))}return l;case 0:return _=l.type,b=l.pendingProps,b=l.elementType===_?b:Li(_,b),If(a,l,_,b,m);case 1:return _=l.type,b=l.pendingProps,b=l.elementType===_?b:Li(_,b),xg(a,l,_,b,m);case 3:e:{if(Sg(l),a===null)throw Error(o(387));_=l.pendingProps,R=l.memoizedState,b=R.element,Bs(a,l),Eo(l,_,null,m);var X=l.memoizedState;if(_=X.element,Ge&&R.isDehydrated)if(R={element:_,isDehydrated:!1,cache:X.cache,transitions:X.transitions},l.updateQueue.baseState=R,l.memoizedState=R,l.flags&256){b=Error(o(423)),l=Mg(a,l,_,m,b);break e}else if(_!==b){b=Error(o(424)),l=Mg(a,l,_,m,b);break e}else for(Ge&&(xi=nr(l.stateNode.containerInfo),di=l,En=!0,rr=null,Co=!1),m=Ol(l,null,_,m),l.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Vs(),_===b){l=hs(a,l,m);break e}Oi(a,l,_,m)}l=l.child}return l;case 5:return j(l),a===null&&In(l),_=l.type,b=l.pendingProps,R=a!==null?a.memoizedProps:null,X=b.children,Ne(_,b)?X=null:R!==null&&Ne(_,R)&&(l.flags|=32),_g(a,l),Oi(a,l,X,m),l.child;case 6:return a===null&&In(l),null;case 13:return wg(a,l,m);case 4:return N(l,l.stateNode.containerInfo),_=l.pendingProps,a===null?l.child=Di(l,null,_,m):Oi(a,l,_,m),l.child;case 11:return _=l.type,b=l.pendingProps,b=l.elementType===_?b:Li(_,b),mg(a,l,_,b,m);case 7:return Oi(a,l,l.pendingProps,m),l.child;case 8:return Oi(a,l,l.pendingProps.children,m),l.child;case 12:return Oi(a,l,l.pendingProps.children,m),l.child;case 10:e:{if(_=l.type._context,b=l.pendingProps,R=l.memoizedProps,X=b.value,Pl(l,_,X),R!==null)if(mr(R.value,X)){if(R.children===b.children&&!Pn.current){l=hs(a,l,m);break e}}else for(R=l.child,R!==null&&(R.return=l);R!==null;){var re=R.dependencies;if(re!==null){X=R.child;for(var Ae=re.firstContext;Ae!==null;){if(Ae.context===_){if(R.tag===1){Ae=Ni(-1,m&-m),Ae.tag=2;var $e=R.updateQueue;if($e!==null){$e=$e.shared;var gt=$e.pending;gt===null?Ae.next=Ae:(Ae.next=gt.next,gt.next=Ae),$e.pending=Ae}}R.lanes|=m,Ae=R.alternate,Ae!==null&&(Ae.lanes|=m),Fs(R.return,m,l),re.lanes|=m;break}Ae=Ae.next}}else if(R.tag===10)X=R.type===l.type?null:R.child;else if(R.tag===18){if(X=R.return,X===null)throw Error(o(341));X.lanes|=m,re=X.alternate,re!==null&&(re.lanes|=m),Fs(X,m,l),X=R.sibling}else X=R.child;if(X!==null)X.return=R;else for(X=R;X!==null;){if(X===l){X=null;break}if(R=X.sibling,R!==null){R.return=X.return,X=R;break}X=X.return}R=X}Oi(a,l,b.children,m),l=l.child}return l;case 9:return b=l.type,_=l.pendingProps.children,qr(l,m),b=yi(b),_=_(b),l.flags|=1,Oi(a,l,_,m),l.child;case 14:return _=l.type,b=Li(_,l.pendingProps),b=Li(_.type,b),gg(a,l,_,b,m);case 15:return yg(a,l,l.type,l.pendingProps,m);case 17:return _=l.type,b=l.pendingProps,b=l.elementType===_?b:Li(_,b),a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2),l.tag=1,Ln(_)?(a=!0,kn(l)):a=!1,qr(l,m),Ao(l,_,b),Ta(l,_,b,m),Lf(null,l,_,!0,a,m);case 19:return Ag(a,l,m);case 22:return vg(a,l,m)}throw Error(o(156,l.tag))};function Zg(a,l){return qi(a,l)}function HS(a,l,m,_){this.tag=a,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xr(a,l,m,_){return new HS(a,l,m,_)}function ed(a){return a=a.prototype,!(!a||!a.isReactComponent)}function VS(a){if(typeof a=="function")return ed(a)?1:0;if(a!=null){if(a=a.$$typeof,a===E)return 11;if(a===A)return 14}return 2}function Ys(a,l){var m=a.alternate;return m===null?(m=xr(a.tag,l,a.key,a.mode),m.elementType=a.elementType,m.type=a.type,m.stateNode=a.stateNode,m.alternate=a,a.alternate=m):(m.pendingProps=l,m.type=a.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=a.flags&14680064,m.childLanes=a.childLanes,m.lanes=a.lanes,m.child=a.child,m.memoizedProps=a.memoizedProps,m.memoizedState=a.memoizedState,m.updateQueue=a.updateQueue,l=a.dependencies,m.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},m.sibling=a.sibling,m.index=a.index,m.ref=a.ref,m}function bu(a,l,m,_,b,R){var X=2;if(_=a,typeof a=="function")ed(a)&&(X=1);else if(typeof a=="string")X=5;else e:switch(a){case f:return ko(m.children,b,R,l);case p:X=8,b|=8;break;case g:return a=xr(12,m,l,b|2),a.elementType=g,a.lanes=R,a;case M:return a=xr(13,m,l,b),a.elementType=M,a.lanes=R,a;case S:return a=xr(19,m,l,b),a.elementType=S,a.lanes=R,a;case I:return Eu(m,b,R,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case v:X=10;break e;case x:X=9;break e;case E:X=11;break e;case A:X=14;break e;case T:X=16,_=null;break e}throw Error(o(130,a==null?a:typeof a,""))}return l=xr(X,m,l,b),l.elementType=a,l.type=_,l.lanes=R,l}function ko(a,l,m,_){return a=xr(7,a,_,l),a.lanes=m,a}function Eu(a,l,m,_){return a=xr(22,a,_,l),a.elementType=I,a.lanes=m,a.stateNode={},a}function td(a,l,m){return a=xr(6,a,null,l),a.lanes=m,a}function nd(a,l,m){return l=xr(4,a.children!==null?a.children:[],a.key,l),l.lanes=m,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function GS(a,l,m,_,b){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Le,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gr(0),this.expirationTimes=Gr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gr(0),this.identifierPrefix=_,this.onRecoverableError=b,Ge&&(this.mutableSourceEagerHydrationData=null)}function $g(a,l,m,_,b,R,X,re,Ae){return a=new GS(a,l,m,re,Ae),l===1?(l=1,R===!0&&(l|=8)):l=0,R=xr(3,null,null,l),a.current=R,R.stateNode=a,R.memoizedState={element:_,isDehydrated:m,cache:null,transitions:null},qn(R),a}function Qg(a){if(!a)return Pi;a=a._reactInternals;e:{if(de(a)!==a||a.tag!==1)throw Error(o(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Ln(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(o(171))}if(a.tag===1){var m=a.type;if(Ln(m))return Vr(a,m,l)}return l}function ey(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(o(188)):(a=Object.keys(a).join(","),Error(o(268,a)));return a=pe(l),a===null?null:a.stateNode}function ty(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var m=a.retryLane;a.retryLane=m!==0&&m=$e&&R>=Gt&&b<=gt&&X<=It){a.splice(l,1);break}else if(_!==$e||m.width!==Ae.width||ItX){if(!(R!==Gt||m.height!==Ae.height||gt<_||$e>b)){$e>_&&(Ae.width+=$e-_,Ae.x=_),gtR&&(Ae.height+=Gt-R,Ae.y=R),Itm&&(m=X)),X ")+` - -No matching component was found for: - `)+a.join(" > ")}return null},t.getPublicRootInstance=function(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return me(a.child.stateNode);default:return a.child.stateNode}},t.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:WS,findFiberByHostInstance:a.findFiberByHostInstance||XS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(l.isDisabled||!l.supportsFiber)a=!0;else{try{Ns=l.inject(a),gi=l}catch{}a=!!l.checkDCE}}return a},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(a,l,m,_){if(!D)throw Error(o(363));a=Gf(a,l);var b=ut(a,m,_).disconnect;return{disconnect:function(){b()}}},t.registerMutableSourceForHydration=function(a,l){var m=l._getVersion;m=m(l._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[l,m]:a.mutableSourceEagerHydrationData.push(l,m)},t.runWithPriority=function(a,l){var m=on;try{return on=a,l()}finally{on=m}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(a,l,m,_){var b=l.current,R=Ui(),X=qs(b);return m=Qg(m),l.context===null?l.context=m:l.pendingContext=m,l=Ni(R,X),l.payload={element:a},_=_===void 0?null:_,_!==null&&(l.callback=_),ir(b,l),a=_r(b,X,R),a!==null&&ks(a,b,X),X},t};$x.exports=jP;var YP=$x.exports;const KP=tm(YP);var Qx={exports:{}},eS={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(r){function e(G,J){var ee=G.length;G.push(J);e:for(;0>>1,Ie=G[ue];if(0>>1;uei(Ne,ee))jei(st,Ne)?(G[ue]=st,G[je]=ee,ue=je):(G[ue]=Ne,G[ve]=ee,ue=ve);else if(jei(st,ee))G[ue]=st,G[je]=ee,ue=je;else break e}}return J}function i(G,J){var ee=G.sortIndex-J.sortIndex;return ee!==0?ee:G.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();r.unstable_now=function(){return o.now()-c}}var u=[],h=[],f=1,p=null,g=3,v=!1,x=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var J=t(h);J!==null;){if(J.callback===null)n(h);else if(J.startTime<=G)n(h),J.sortIndex=J.expirationTime,e(u,J);else break;J=t(h)}}function I(G){if(E=!1,T(G),!x)if(t(u)!==null)x=!0,me(z);else{var J=t(h);J!==null&&Pe(I,J.startTime-G)}}function z(G,J){x=!1,E&&(E=!1,S(Y),Y=-1),v=!0;var ee=g;try{for(T(J),p=t(u);p!==null&&(!(p.expirationTime>J)||G&&!O());){var ue=p.callback;if(typeof ue=="function"){p.callback=null,g=p.priorityLevel;var Ie=ue(p.expirationTime<=J);J=r.unstable_now(),typeof Ie=="function"?p.callback=Ie:p===t(u)&&n(u),T(J)}else n(u);p=t(u)}if(p!==null)var Ke=!0;else{var ve=t(h);ve!==null&&Pe(I,ve.startTime-J),Ke=!1}return Ke}finally{p=null,g=ee,v=!1}}var U=!1,F=null,Y=-1,de=5,L=-1;function O(){return!(r.unstable_now()-LG||125ue?(G.sortIndex=ee,e(h,G),t(u)===null&&G===t(h)&&(E?(S(Y),Y=-1):E=!0,Pe(I,ee-ue))):(G.sortIndex=Ie,e(u,G),x||v||(x=!0,me(z))),G},r.unstable_shouldYield=O,r.unstable_wrapCallback=function(G){var J=g;return function(){var ee=g;g=J;try{return G.apply(this,arguments)}finally{g=ee}}}})(eS);Qx.exports=eS;var J0=Qx.exports;const Ym={},JP=r=>void Object.assign(Ym,r);function ZP(r,e){function t(f,{args:p=[],attach:g,...v},x){let E=`${f[0].toUpperCase()}${f.slice(1)}`,M;if(f==="primitive"){if(v.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const S=v.object;M=nl(S,{type:f,root:x,attach:g,primitive:!0})}else{const S=Ym[E];if(!S)throw new Error(`R3F: ${E} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(p))throw new Error("R3F: The args prop must be an array!");M=nl(new S(...p),{type:f,root:x,attach:g,memoizedProps:{args:p}})}return M.__r3f.attach===void 0&&(M instanceof Zt?M.__r3f.attach="geometry":M instanceof mi&&(M.__r3f.attach="material")),E!=="inject"&&Kd(M,v),M}function n(f,p){let g=!1;if(p){var v,x;(v=p.__r3f)!=null&&v.attach?Yd(f,p,p.__r3f.attach):p.isObject3D&&f.isObject3D&&(f.add(p),g=!0),g||(x=f.__r3f)==null||x.objects.push(p),p.__r3f||nl(p,{}),p.__r3f.parent=f,Zp(p),il(p)}}function i(f,p,g){let v=!1;if(p){var x,E;if((x=p.__r3f)!=null&&x.attach)Yd(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){p.parent=f,p.dispatchEvent({type:"added"}),f.dispatchEvent({type:"childadded",child:p});const M=f.children.filter(A=>A!==p),S=M.indexOf(g);f.children=[...M.slice(0,S),p,...M.slice(S)],v=!0}v||(E=f.__r3f)==null||E.objects.push(p),p.__r3f||nl(p,{}),p.__r3f.parent=f,Zp(p),il(p)}}function s(f,p,g=!1){f&&[...f].forEach(v=>o(p,v,g))}function o(f,p,g){if(p){var v,x,E;if(p.__r3f&&(p.__r3f.parent=null),(v=f.__r3f)!=null&&v.objects&&(f.__r3f.objects=f.__r3f.objects.filter(I=>I!==p)),(x=p.__r3f)!=null&&x.attach)tv(f,p,p.__r3f.attach);else if(p.isObject3D&&f.isObject3D){var M;f.remove(p),(M=p.__r3f)!=null&&M.root&&s2(Ph(p),p)}const A=(E=p.__r3f)==null?void 0:E.primitive,T=!A&&(g===void 0?p.dispose!==null:g);if(!A){var S;s((S=p.__r3f)==null?void 0:S.objects,p,T),s(p.children,p,T)}if(delete p.__r3f,T&&p.dispose&&p.type!=="Scene"){const I=()=>{try{p.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?J0.unstable_scheduleCallback(J0.unstable_IdlePriority,I):I()}il(f)}}function c(f,p,g,v){var x;const E=(x=f.__r3f)==null?void 0:x.parent;if(!E)return;const M=t(p,g,f.__r3f.root);if(f.children){for(const S of f.children)S.__r3f&&n(M,S);f.children=f.children.filter(S=>!S.__r3f)}f.__r3f.objects.forEach(S=>n(M,S)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(E,f),M.parent&&(M.__r3f.autoRemovedBeforeAppend=!0),n(E,M),M.raycast&&M.__r3f.eventCount&&Ph(M).getState().internal.interaction.push(M),[v,v.alternate].forEach(S=>{S!==null&&(S.stateNode=M,S.ref&&(typeof S.ref=="function"?S.ref(M):S.ref.current=M))})}const u=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:KP({createInstance:t,removeChild:o,appendChild:n,appendInitialChild:n,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,p)=>{if(!p)return;const g=f.getState().scene;g.__r3f&&(g.__r3f.root=f,n(g,p))},removeChildFromContainer:(f,p)=>{p&&o(f.getState().scene,p)},insertInContainerBefore:(f,p,g)=>{if(!p||!g)return;const v=f.getState().scene;v.__r3f&&i(v,p,g)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var p;return!!((p=f?.__r3f)!=null?p:{}).handlers},prepareUpdate(f,p,g,v){var x;if(((x=f?.__r3f)!=null?x:{}).primitive&&v.object&&v.object!==f)return[!0];{const{args:M=[],children:S,...A}=v,{args:T=[],children:I,...z}=g;if(!Array.isArray(M))throw new Error("R3F: the args prop must be an array!");if(M.some((F,Y)=>F!==T[Y]))return[!0];const U=aS(f,A,z,!0);return U.changes.length?[!1,U]:null}},commitUpdate(f,[p,g],v,x,E,M){p?c(f,v,E,M):Kd(f,g)},commitMount(f,p,g,v){var x;const E=(x=f.__r3f)!=null?x:{};f.raycast&&E.handlers&&E.eventCount&&Ph(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>nl(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var p;const{attach:g,parent:v}=(p=f.__r3f)!=null?p:{};g&&v&&tv(v,f,g),f.isObject3D&&(f.visible=!1),il(f)},unhideInstance(f,p){var g;const{attach:v,parent:x}=(g=f.__r3f)!=null?g:{};v&&x&&Yd(x,f,v),(f.isObject3D&&p.visible==null||p.visible)&&(f.visible=!0),il(f)},createTextInstance:u,hideTextInstance:u,unhideTextInstance:u,getCurrentEventPriority:()=>e?e():ul.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Nn.fun(performance.now)?performance.now:Nn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Nn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Nn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Kd}}var Z0,$0;const jd=r=>"colorSpace"in r||"outputColorSpace"in r,tS=()=>{var r;return(r=Ym.ColorManagement)!=null?r:null},nS=r=>r&&r.isOrthographicCamera,$P=r=>r&&r.hasOwnProperty("current"),Kc=typeof window<"u"&&((Z0=window.document)!=null&&Z0.createElement||(($0=window.navigator)==null?void 0:$0.product)==="ReactNative")?lt.useLayoutEffect:lt.useEffect;function iS(r){const e=lt.useRef(r);return Kc(()=>void(e.current=r),[r]),e}function QP({set:r}){return Kc(()=>(r(new Promise(()=>null)),()=>r(!1)),[r]),null}class rS extends lt.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}rS.getDerivedStateFromError=()=>({error:!0});const sS="__default",Q0=new Map,e2=r=>r&&!!r.memoized&&!!r.changes;function oS(r){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(r)?Math.min(Math.max(r[0],t),r[1]):r}const rc=r=>{var e;return(e=r.__r3f)==null?void 0:e.root.getState()};function Ph(r){let e=r.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const Nn={obj:r=>r===Object(r)&&!Nn.arr(r)&&typeof r!="function",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",boo:r=>typeof r=="boolean",und:r=>r===void 0,arr:r=>Array.isArray(r),equ(r,e,{arrays:t="shallow",objects:n="reference",strict:i=!0}={}){if(typeof r!=typeof e||!!r!=!!e)return!1;if(Nn.str(r)||Nn.num(r))return r===e;const s=Nn.obj(r);if(s&&n==="reference")return r===e;const o=Nn.arr(r);if(o&&t==="reference")return r===e;if((o||s)&&r===e)return!0;let c;for(c in r)if(!(c in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(c in i?e:r)if(!Nn.equ(r[c],e[c],{strict:i,objects:"reference"}))return!1}else for(c in i?e:r)if(r[c]!==e[c])return!1;if(Nn.und(c)){if(o&&r.length===0&&e.length===0||s&&Object.keys(r).length===0&&Object.keys(e).length===0)return!0;if(r!==e)return!1}return!0}};function t2(r){r.dispose&&r.type!=="Scene"&&r.dispose();for(const e in r)e.dispose==null||e.dispose(),delete r[e]}function nl(r,e){const t=r;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},r}function Jp(r,e){let t=r;if(e.includes("-")){const n=e.split("-"),i=n.pop();return t=n.reduce((s,o)=>s[o],r),{target:t,key:i}}else return{target:t,key:e}}const ev=/-\d+$/;function Yd(r,e,t){if(Nn.str(t)){if(ev.test(t)){const s=t.replace(ev,""),{target:o,key:c}=Jp(r,s);Array.isArray(o[c])||(o[c]=[])}const{target:n,key:i}=Jp(r,t);e.__r3f.previousAttach=n[i],n[i]=e}else e.__r3f.previousAttach=t(r,e)}function tv(r,e,t){var n,i;if(Nn.str(t)){const{target:s,key:o}=Jp(r,t),c=e.__r3f.previousAttach;c===void 0?delete s[o]:s[o]=c}else(n=e.__r3f)==null||n.previousAttach==null||n.previousAttach(r,e);(i=e.__r3f)==null||delete i.previousAttach}function aS(r,{children:e,key:t,ref:n,...i},{children:s,key:o,ref:c,...u}={},h=!1){var f;const p=(f=r?.__r3f)!=null?f:{},g=Object.entries(i),v=[];if(h){const E=Object.keys(u);for(let M=0;M{var S;if((S=r.__r3f)!=null&&S.primitive&&E==="object"||Nn.equ(M,u[E]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(E))return v.push([E,M,!0,[]]);let A=[];E.includes("-")&&(A=E.split("-")),v.push([E,M,!1,A]);for(const T in i){const I=i[T];T.startsWith(`${E}-`)&&v.push([T,I,!1,T.split("-")])}});const x={...i};return p.memoizedProps&&p.memoizedProps.args&&(x.args=p.memoizedProps.args),p.memoizedProps&&p.memoizedProps.attach&&(x.attach=p.memoizedProps.attach),{memoized:x,changes:v}}const n2=typeof process<"u"&&!1;function Kd(r,e){var t,n,i;const s=(t=r.__r3f)!=null?t:{},o=s.root,c=(n=o==null||o.getState==null?void 0:o.getState())!=null?n:{},{memoized:u,changes:h}=e2(e)?e:aS(r,e),f=s.eventCount;r.__r3f&&(r.__r3f.memoizedProps=u);for(let g=0;gT[I],r),!(A&&A.set))){const[T,...I]=M.reverse();S=I.reverse().reduce((z,U)=>z[U],r),v=T}if(x===sS+"remove")if(S.constructor){let T=Q0.get(S.constructor);T||(T=new S.constructor,Q0.set(S.constructor,T)),x=T[v]}else x=0;if(E)x?s.handlers[v]=x:delete s.handlers[v],s.eventCount=Object.keys(s.handlers).length;else if(A&&A.set&&(A.copy||A instanceof aa)){if(Array.isArray(x))A.fromArray?A.fromArray(x):A.set(...x);else if(A.copy&&x&&x.constructor&&(n2?A.constructor.name===x.constructor.name:A.constructor===x.constructor))A.copy(x);else if(x!==void 0){const T=A instanceof ht;!T&&A.setScalar?A.setScalar(x):A instanceof aa&&x instanceof aa?A.mask=x.mask:A.set(x),!tS()&&!c.linear&&T&&A.convertSRGBToLinear()}}else if(S[v]=x,S[v]instanceof Bn&&S[v].format===zi&&S[v].type===ns){const T=S[v];jd(T)&&jd(c.gl)?T.colorSpace=c.gl.outputColorSpace:T.encoding=c.gl.outputEncoding}il(r)}if(s.parent&&r.raycast&&f!==s.eventCount){const g=Ph(r).getState().internal,v=g.interaction.indexOf(r);v>-1&&g.interaction.splice(v,1),s.eventCount&&g.interaction.push(r)}return!(h.length===1&&h[0][0]==="onUpdate")&&h.length&&(i=r.__r3f)!=null&&i.parent&&Zp(r),r}function il(r){var e,t;const n=(e=r.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function Zp(r){r.onUpdate==null||r.onUpdate(r)}function i2(r,e){r.manual||(nS(r)?(r.left=e.width/-2,r.right=e.width/2,r.top=e.height/2,r.bottom=e.height/-2):r.aspect=e.width/e.height,r.updateProjectionMatrix(),r.updateMatrixWorld())}function yh(r){return(r.eventObject||r.object).uuid+"/"+r.index+r.instanceId}function r2(){var r;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return ul.DefaultEventPriority;switch((r=e.event)==null?void 0:r.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return ul.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return ul.ContinuousEventPriority;default:return ul.DefaultEventPriority}}function lS(r,e,t,n){const i=t.get(e);i&&(t.delete(e),t.size===0&&(r.delete(n),i.target.releasePointerCapture(n)))}function s2(r,e){const{internal:t}=r.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,i)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((n,i)=>{lS(t.capturedMap,e,n,i)})}function o2(r){function e(u){const{internal:h}=r.getState(),f=u.offsetX-h.initialClick[0],p=u.offsetY-h.initialClick[1];return Math.round(Math.sqrt(f*f+p*p))}function t(u){return u.filter(h=>["Move","Over","Enter","Out","Leave"].some(f=>{var p;return(p=h.__r3f)==null?void 0:p.handlers["onPointer"+f]}))}function n(u,h){const f=r.getState(),p=new Set,g=[],v=h?h(f.internal.interaction):f.internal.interaction;for(let S=0;S{const T=rc(S.object),I=rc(A.object);return!T||!I?S.distance-A.distance:I.events.priority-T.events.priority||S.distance-A.distance}).filter(S=>{const A=yh(S);return p.has(A)?!1:(p.add(A),!0)});f.events.filter&&(E=f.events.filter(E,f));for(const S of E){let A=S.object;for(;A;){var M;(M=A.__r3f)!=null&&M.eventCount&&g.push({...S,eventObject:A}),A=A.parent}}if("pointerId"in u&&f.internal.capturedMap.has(u.pointerId))for(let S of f.internal.capturedMap.get(u.pointerId).values())p.has(yh(S.intersection))||g.push(S.intersection);return g}function i(u,h,f,p){const g=r.getState();if(u.length){const v={stopped:!1};for(const x of u){const E=rc(x.object)||g,{raycaster:M,pointer:S,camera:A,internal:T}=E,I=new V(S.x,S.y,0).unproject(A),z=L=>{var O,pe;return(O=(pe=T.capturedMap.get(L))==null?void 0:pe.has(x.eventObject))!=null?O:!1},U=L=>{const O={intersection:x,target:h.target};T.capturedMap.has(L)?T.capturedMap.get(L).set(x.eventObject,O):T.capturedMap.set(L,new Map([[x.eventObject,O]])),h.target.setPointerCapture(L)},F=L=>{const O=T.capturedMap.get(L);O&&lS(T.capturedMap,x.eventObject,O,L)};let Y={};for(let L in h){let O=h[L];typeof O!="function"&&(Y[L]=O)}let de={...x,...Y,pointer:S,intersections:u,stopped:v.stopped,delta:f,unprojectedPoint:I,ray:M.ray,camera:A,stopPropagation(){const L="pointerId"in h&&T.capturedMap.get(h.pointerId);if((!L||L.has(x.eventObject))&&(de.stopped=v.stopped=!0,T.hovered.size&&Array.from(T.hovered.values()).find(O=>O.eventObject===x.eventObject))){const O=u.slice(0,u.indexOf(x));s([...O,x])}},target:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:F},currentTarget:{hasPointerCapture:z,setPointerCapture:U,releasePointerCapture:F},nativeEvent:h};if(p(de),v.stopped===!0)break}}return u}function s(u){const{internal:h}=r.getState();for(const f of h.hovered.values())if(!u.length||!u.find(p=>p.object===f.object&&p.index===f.index&&p.instanceId===f.instanceId)){const g=f.eventObject.__r3f,v=g?.handlers;if(h.hovered.delete(yh(f)),g!=null&&g.eventCount){const x={...f,intersections:u};v.onPointerOut==null||v.onPointerOut(x),v.onPointerLeave==null||v.onPointerLeave(x)}}}function o(u,h){for(let f=0;fs([]);case"onLostPointerCapture":return h=>{const{internal:f}=r.getState();"pointerId"in h&&f.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(h.pointerId)&&(f.capturedMap.delete(h.pointerId),s([]))})}}return function(f){const{onPointerMissed:p,internal:g}=r.getState();g.lastEvent.current=f;const v=u==="onPointerMove",x=u==="onClick"||u==="onContextMenu"||u==="onDoubleClick",M=n(f,v?t:void 0),S=x?e(f):0;u==="onPointerDown"&&(g.initialClick=[f.offsetX,f.offsetY],g.initialHits=M.map(T=>T.eventObject)),x&&!M.length&&S<=2&&(o(f,g.interaction),p&&p(f)),v&&s(M);function A(T){const I=T.eventObject,z=I.__r3f,U=z?.handlers;if(z!=null&&z.eventCount)if(v){if(U.onPointerOver||U.onPointerEnter||U.onPointerOut||U.onPointerLeave){const F=yh(T),Y=g.hovered.get(F);Y?Y.stopped&&T.stopPropagation():(g.hovered.set(F,T),U.onPointerOver==null||U.onPointerOver(T),U.onPointerEnter==null||U.onPointerEnter(T))}U.onPointerMove==null||U.onPointerMove(T)}else{const F=U[u];F?(!x||g.initialHits.includes(I))&&(o(f,g.interaction.filter(Y=>!g.initialHits.includes(Y))),F(T)):x&&g.initialHits.includes(I)&&o(f,g.interaction.filter(Y=>!g.initialHits.includes(Y)))}}i(M,f,S,A)}}return{handlePointer:c}}const cS=r=>!!(r!=null&&r.render),uS=lt.createContext(null),a2=(r,e)=>{const t=WP((c,u)=>{const h=new V,f=new V,p=new V;function g(S=u().camera,A=f,T=u().size){const{width:I,height:z,top:U,left:F}=T,Y=I/z;A instanceof V?p.copy(A):p.set(...A);const de=S.getWorldPosition(h).distanceTo(p);if(nS(S))return{width:I/S.zoom,height:z/S.zoom,top:U,left:F,factor:1,distance:de,aspect:Y};{const L=S.fov*Math.PI/180,O=2*Math.tan(L/2)*de,pe=O*(I/z);return{width:pe,height:O,top:U,left:F,factor:I/pe,distance:de,aspect:Y}}}let v;const x=S=>c(A=>({performance:{...A.performance,current:S}})),E=new Be;return{set:c,get:u,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(S=1)=>r(u(),S),advance:(S,A)=>e(S,A,u()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Wm,pointer:E,mouse:E,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const S=u();v&&clearTimeout(v),S.performance.current!==S.performance.min&&x(S.performance.min),v=setTimeout(()=>x(u().performance.max),S.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:g},setEvents:S=>c(A=>({...A,events:{...A.events,...S}})),setSize:(S,A,T,I,z)=>{const U=u().camera,F={width:S,height:A,top:I||0,left:z||0,updateStyle:T};c(Y=>({size:F,viewport:{...Y.viewport,...g(U,f,F)}}))},setDpr:S=>c(A=>{const T=oS(S);return{viewport:{...A.viewport,dpr:T,initialDpr:A.viewport.initialDpr||T}}}),setFrameloop:(S="always")=>{const A=u().clock;A.stop(),A.elapsedTime=0,S!=="never"&&(A.start(),A.elapsedTime=0),c(()=>({frameloop:S}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:lt.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(S,A,T)=>{const I=u().internal;return I.priority=I.priority+(A>0?1:0),I.subscribers.push({ref:S,priority:A,store:T}),I.subscribers=I.subscribers.sort((z,U)=>z.priority-U.priority),()=>{const z=u().internal;z!=null&&z.subscribers&&(z.priority=z.priority-(A>0?1:0),z.subscribers=z.subscribers.filter(U=>U.ref!==S))}}}}}),n=t.getState();let i=n.size,s=n.viewport.dpr,o=n.camera;return t.subscribe(()=>{const{camera:c,size:u,viewport:h,gl:f,set:p}=t.getState();if(u.width!==i.width||u.height!==i.height||h.dpr!==s){var g;i=u,s=h.dpr,i2(c,u),f.setPixelRatio(h.dpr);const v=(g=u.updateStyle)!=null?g:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(u.width,u.height,v)}c!==o&&(o=c,p(v=>({viewport:{...v.viewport,...v.viewport.getCurrentViewport(c)}})))}),t.subscribe(c=>r(c)),t};let vh,l2=new Set,c2=new Set,u2=new Set;function Jd(r,e){if(r.size)for(const{callback:t}of r.values())t(e)}function sc(r,e){switch(r){case"before":return Jd(l2,e);case"after":return Jd(c2,e);case"tail":return Jd(u2,e)}}let Zd,$d;function Qd(r,e,t){let n=e.clock.getDelta();for(e.frameloop==="never"&&typeof r=="number"&&(n=r-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=r),Zd=e.internal.subscribers,vh=0;vh0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(n+=Qd(h,s))}if(t=!1,sc("after",h),n===0)return sc("tail",h),e=!1,cancelAnimationFrame(i)}function c(h,f=1){var p;if(!h)return r.forEach(g=>c(g.store.getState(),f));(p=h.gl.xr)!=null&&p.isPresenting||!h.internal.active||h.frameloop==="never"||(f>1?h.internal.frames=Math.min(60,h.internal.frames+f):t?h.internal.frames=2:h.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function u(h,f=!0,p,g){if(f&&sc("before",h),p)Qd(h,p,g);else for(const v of r.values())Qd(h,v.store.getState());f&&sc("after",h)}return{loop:o,invalidate:c,advance:u}}function f2(){const r=lt.useContext(uS);if(!r)throw new Error("R3F: Hooks can only be used within the Canvas component!");return r}function d2(r,e=0){const t=f2(),n=t.getState().internal.subscribe,i=iS(r);return Kc(()=>n(i,e,t),[e,n,t]),null}const yl=new Map,{invalidate:nv,advance:iv}=h2(yl),{reconciler:zh,applyProps:el}=ZP(yl,r2),tl={objects:"shallow",strict:!1},p2=(r,e)=>{const t=typeof r=="function"?r(e):r;return cS(t)?t:new Cm({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...r})};function m2(r,e){const t=typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement;if(e){const{width:n,height:i,top:s,left:o,updateStyle:c=t}=e;return{width:n,height:i,top:s,left:o,updateStyle:c}}else if(typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&r.parentElement){const{width:n,height:i,top:s,left:o}=r.parentElement.getBoundingClientRect();return{width:n,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas)return{width:r.width,height:r.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function g2(r){const e=yl.get(r),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=n||a2(nv,iv),o=t||zh.createContainer(s,ul.ConcurrentRoot,null,!1,null,"",i,null);e||yl.set(r,{fiber:o,store:s});let c,u=!1,h;return{configure(f={}){let{gl:p,size:g,scene:v,events:x,onCreated:E,shadows:M=!1,linear:S=!1,flat:A=!1,legacy:T=!1,orthographic:I=!1,frameloop:z="always",dpr:U=[1,2],performance:F,raycaster:Y,camera:de,onPointerMissed:L}=f,O=s.getState(),pe=O.gl;O.gl||O.set({gl:pe=p2(p,r)});let be=O.raycaster;be||O.set({raycaster:be=new Kx});const{params:$,...ye}=Y||{};if(Nn.equ(ye,be,tl)||el(be,{...ye}),Nn.equ($,be.params,tl)||el(be,{params:{...be.params,...$}}),!O.camera||O.camera===h&&!Nn.equ(h,de,tl)){h=de;const ee=de instanceof Hc,ue=ee?de:I?new Wc(0,0,0,0,.1,1e3):new ui(75,0,.1,1e3);ee||(ue.position.z=5,de&&el(ue,de),!O.camera&&!(de!=null&&de.rotation)&&ue.lookAt(0,0,0)),O.set({camera:ue}),be.camera=ue}if(!O.scene){let ee;v instanceof Bh?ee=v:(ee=new Bh,v&&el(ee,v)),O.set({scene:nl(ee)})}if(!O.xr){var me;const ee=(Ke,ve)=>{const Ne=s.getState();Ne.frameloop!=="never"&&iv(Ke,!0,Ne,ve)},ue=()=>{const Ke=s.getState();Ke.gl.xr.enabled=Ke.gl.xr.isPresenting,Ke.gl.xr.setAnimationLoop(Ke.gl.xr.isPresenting?ee:null),Ke.gl.xr.isPresenting||nv(Ke)},Ie={connect(){const Ke=s.getState().gl;Ke.xr.addEventListener("sessionstart",ue),Ke.xr.addEventListener("sessionend",ue)},disconnect(){const Ke=s.getState().gl;Ke.xr.removeEventListener("sessionstart",ue),Ke.xr.removeEventListener("sessionend",ue)}};typeof((me=pe.xr)==null?void 0:me.addEventListener)=="function"&&Ie.connect(),O.set({xr:Ie})}if(pe.shadowMap){const ee=pe.shadowMap.enabled,ue=pe.shadowMap.type;if(pe.shadowMap.enabled=!!M,Nn.boo(M))pe.shadowMap.type=ac;else if(Nn.str(M)){var Pe;const Ie={basic:zv,percentage:Kh,soft:ac,variance:Dr};pe.shadowMap.type=(Pe=Ie[M])!=null?Pe:ac}else Nn.obj(M)&&Object.assign(pe.shadowMap,M);(ee!==pe.shadowMap.enabled||ue!==pe.shadowMap.type)&&(pe.shadowMap.needsUpdate=!0)}const G=tS();G&&("enabled"in G?G.enabled=!T:"legacyMode"in G&&(G.legacyMode=T)),u||el(pe,{outputEncoding:S?3e3:3001,toneMapping:A?ts:lm}),O.legacy!==T&&O.set(()=>({legacy:T})),O.linear!==S&&O.set(()=>({linear:S})),O.flat!==A&&O.set(()=>({flat:A})),p&&!Nn.fun(p)&&!cS(p)&&!Nn.equ(p,pe,tl)&&el(pe,p),x&&!O.events.handlers&&O.set({events:x(s)});const J=m2(r,g);return Nn.equ(J,O.size,tl)||O.setSize(J.width,J.height,J.updateStyle,J.top,J.left),U&&O.viewport.dpr!==oS(U)&&O.setDpr(U),O.frameloop!==z&&O.setFrameloop(z),O.onPointerMissed||O.set({onPointerMissed:L}),F&&!Nn.equ(F,O.performance,tl)&&O.set(ee=>({performance:{...ee.performance,...F}})),c=E,u=!0,this},render(f){return u||this.configure(),zh.updateContainer(lt.createElement(y2,{store:s,children:f,onCreated:c,rootElement:r}),o,null,()=>{}),s},unmount(){hS(r)}}}function y2({store:r,children:e,onCreated:t,rootElement:n}){return Kc(()=>{const i=r.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),r.getState().events.connected||i.events.connect==null||i.events.connect(n)},[]),lt.createElement(uS.Provider,{value:r},e)}function hS(r,e){const t=yl.get(r),n=t?.fiber;if(n){const i=t?.store.getState();i&&(i.internal.active=!1),zh.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{try{var s,o,c,u;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(c=i.gl)==null||c.forceContextLoss==null||c.forceContextLoss(),(u=i.gl)!=null&&u.xr&&i.xr.disconnect(),t2(i),yl.delete(r),e&&e(r)}catch{}},500)})}}zh.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:lt.version});function Hh(){return Hh=Object.assign?Object.assign.bind():function(r){for(var e=1;e=0?n=setTimeout(u,e-f):(n=null,t||(c=r.apply(s,i),s=i=null))}var h=function(){s=this,i=arguments,o=Date.now();var f=t&&!n;return n||(n=setTimeout(u,e)),f&&(c=r.apply(s,i),s=i=null),c};return h.clear=function(){n&&(clearTimeout(n),n=null)},h.flush=function(){n&&(c=r.apply(s,i),s=i=null,clearTimeout(n),n=null)},h}$p.debounce=$p;var v2=$p;const rv=tm(v2);function _2(r){let{debounce:e,scroll:t,polyfill:n,offsetSize:i}=r===void 0?{debounce:0,scroll:!1,offsetSize:!1}:r;const s=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,c]=lt.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=lt.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),h=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,p=lt.useRef(!1);lt.useEffect(()=>(p.current=!0,()=>void(p.current=!1)));const[g,v,x]=lt.useMemo(()=>{const A=()=>{if(!u.current.element)return;const{left:T,top:I,width:z,height:U,bottom:F,right:Y,x:de,y:L}=u.current.element.getBoundingClientRect(),O={left:T,top:I,width:z,height:U,bottom:F,right:Y,x:de,y:L};u.current.element instanceof HTMLElement&&i&&(O.height=u.current.element.offsetHeight,O.width=u.current.element.offsetWidth),Object.freeze(O),p.current&&!w2(u.current.lastBounds,O)&&c(u.current.lastBounds=O)};return[A,f?rv(A,f):A,h?rv(A,h):A]},[c,i,h,f]);function E(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(A=>A.removeEventListener("scroll",x,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null)}function M(){u.current.element&&(u.current.resizeObserver=new s(x),u.current.resizeObserver.observe(u.current.element),t&&u.current.scrollContainers&&u.current.scrollContainers.forEach(A=>A.addEventListener("scroll",x,{capture:!0,passive:!0})))}const S=A=>{!A||A===u.current.element||(E(),u.current.element=A,u.current.scrollContainers=fS(A),M())};return S2(x,!!t),x2(v),lt.useEffect(()=>{E(),M()},[t,x,v]),lt.useEffect(()=>E,[]),[S,o,g]}function x2(r){lt.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function S2(r,e){lt.useEffect(()=>{if(e){const t=r;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[r,e])}function fS(r){const e=[];if(!r||r===document.body)return e;const{overflow:t,overflowX:n,overflowY:i}=window.getComputedStyle(r);return[t,n,i].some(s=>s==="auto"||s==="scroll")&&e.push(r),[...e,...fS(r.parentElement)]}const M2=["x","y","top","bottom","left","right","width","height"],w2=(r,e)=>M2.every(t=>r[t]===e[t]);var b2=Object.defineProperty,E2=Object.defineProperties,T2=Object.getOwnPropertyDescriptors,sv=Object.getOwnPropertySymbols,A2=Object.prototype.hasOwnProperty,C2=Object.prototype.propertyIsEnumerable,ov=(r,e,t)=>e in r?b2(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,av=(r,e)=>{for(var t in e||(e={}))A2.call(e,t)&&ov(r,t,e[t]);if(sv)for(var t of sv(e))C2.call(e,t)&&ov(r,t,e[t]);return r},R2=(r,e)=>E2(r,T2(e)),lv,cv;typeof window<"u"&&((lv=window.document)!=null&&lv.createElement||((cv=window.navigator)==null?void 0:cv.product)==="ReactNative")?lt.useLayoutEffect:lt.useEffect;function dS(r,e,t){if(!r)return;if(t(r)===!0)return r;let n=e?r.return:r.child;for(;n;){const i=dS(n,e,t);if(i)return i;n=e?null:n.sibling}}function pS(r){try{return Object.defineProperties(r,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return r}}const uv=console.error;console.error=function(){const r=[...arguments].join("");if(r?.startsWith("Warning:")&&r.includes("useContext")){console.error=uv;return}return uv.apply(this,arguments)};const Km=pS(lt.createContext(null));class mS extends lt.Component{render(){return lt.createElement(Km.Provider,{value:this._reactInternals},this.props.children)}}function P2(){const r=lt.useContext(Km);if(r===null)throw new Error("its-fine: useFiber must be called within a !");const e=lt.useId();return lt.useMemo(()=>{for(const n of[r,r?.alternate]){if(!n)continue;const i=dS(n,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[r,e])}function I2(){const r=P2(),[e]=lt.useState(()=>new Map);e.clear();let t=r;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==Km&&!e.has(i)&&e.set(i,lt.useContext(pS(i)))}t=t.return}return e}function L2(){const r=I2();return lt.useMemo(()=>Array.from(r.keys()).reduce((e,t)=>n=>lt.createElement(e,null,lt.createElement(t.Provider,R2(av({},n),{value:r.get(t)}))),e=>lt.createElement(mS,av({},e))),[r])}const ep={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function N2(r){const{handlePointer:e}=o2(r);return{priority:1,enabled:!0,compute(t,n,i){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(ep).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:i}=r.getState();(t=i.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var n;const{set:i,events:s}=r.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((n=s.handlers)!=null?n:[]).forEach(([o,c])=>{const[u,h]=ep[o];t.addEventListener(u,c,{passive:h})})},disconnect:()=>{const{set:t,events:n}=r.getState();if(n.connected){var i;Object.entries((i=n.handlers)!=null?i:[]).forEach(([s,o])=>{if(n&&n.connected instanceof HTMLElement){const[c]=ep[s];n.connected.removeEventListener(c,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const D2=lt.forwardRef(function({children:e,fallback:t,resize:n,style:i,gl:s,events:o=N2,eventSource:c,eventPrefix:u,shadows:h,linear:f,flat:p,legacy:g,orthographic:v,frameloop:x,dpr:E,performance:M,raycaster:S,camera:A,scene:T,onPointerMissed:I,onCreated:z,...U},F){lt.useMemo(()=>JP(HP),[]);const Y=L2(),[de,L]=_2({scroll:!0,debounce:{scroll:50,resize:0},...n}),O=lt.useRef(null),pe=lt.useRef(null);lt.useImperativeHandle(F,()=>O.current);const be=iS(I),[$,ye]=lt.useState(!1),[me,Pe]=lt.useState(!1);if($)throw $;if(me)throw me;const G=lt.useRef(null);Kc(()=>{const ee=O.current;L.width>0&&L.height>0&&ee&&(G.current||(G.current=g2(ee)),G.current.configure({gl:s,events:o,shadows:h,linear:f,flat:p,legacy:g,orthographic:v,frameloop:x,dpr:E,performance:M,raycaster:S,camera:A,scene:T,size:L,onPointerMissed:(...ue)=>be.current==null?void 0:be.current(...ue),onCreated:ue=>{ue.events.connect==null||ue.events.connect(c?$P(c)?c.current:c:pe.current),u&&ue.setEvents({compute:(Ie,Ke)=>{const ve=Ie[u+"X"],Ne=Ie[u+"Y"];Ke.pointer.set(ve/Ke.size.width*2-1,-(Ne/Ke.size.height)*2+1),Ke.raycaster.setFromCamera(Ke.pointer,Ke.camera)}}),z?.(ue)}}),G.current.render(lt.createElement(Y,null,lt.createElement(rS,{set:Pe},lt.createElement(lt.Suspense,{fallback:lt.createElement(QP,{set:ye})},e)))))}),lt.useEffect(()=>{const ee=O.current;if(ee)return()=>hS(ee)},[]);const J=c?"none":"auto";return lt.createElement("div",Hh({ref:pe,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:J,...i}},U),lt.createElement("div",{ref:de,style:{width:"100%",height:"100%"}},lt.createElement("canvas",{ref:O,style:{display:"block"}},t)))}),O2=lt.forwardRef(function(e,t){return lt.createElement(mS,null,lt.createElement(D2,Hh({},e,{ref:t})))});function U2(r,e={}){let t=lt.useCallback(i=>e.keys?JS(r,e.keys,i):r.listen(i),[e.keys,r]),n=r.get.bind(r);return lt.useSyncExternalStore(t,n,n)}const F2=[new Or(-Math.PI/2,-Math.PI/2,-Math.PI/2),new Or(0,Math.PI/2,0),new Or(0,-Math.PI/2,-Math.PI/2),new Or(Math.PI/2,Math.PI,Math.PI),new Or(0,0,-Math.PI/2),new Or(Math.PI,0,0)],B2=({diceValues:r,isRolling:e,textures:t})=>{const n=lt.useRef([]),i=lt.useRef([]);return lt.useEffect(()=>{const s=new Ox,o=new ht(16766720);i.current=[new vs({map:s.load(t.side1),color:o}),new vs({map:s.load(t.side2),color:o}),new vs({map:s.load(t.side3),color:o}),new vs({map:s.load(t.side4),color:o}),new vs({map:s.load(t.side5),color:o}),new vs({map:s.load(t.side6),color:o})],n.current.forEach(c=>{c&&(c.material=i.current)})},[t]),d2(()=>{n.current.forEach((s,o)=>{if(s)if(e)s.rotation.x+=.2,s.rotation.y+=.2;else{const c=F2[r[o]-1];s.rotation.x=Ch.lerp(s.rotation.x,c.x,.1),s.rotation.y=Ch.lerp(s.rotation.y,c.y,.1),s.rotation.z=Ch.lerp(s.rotation.z,c.z,.1)}})}),Ai.jsx(Ai.Fragment,{children:r.map((s,o)=>Ai.jsxs("mesh",{ref:c=>n.current[o]=c,position:[o*2-(r.length-1),0,0],children:[Ai.jsx("boxGeometry",{args:[1,1,1]}),i.current.length===6&&i.current.map((c,u)=>Ai.jsx("meshStandardMaterial",{attach:`material-${u}`,...c},u))]},o))})},lI=({styleClass:r,textures:e,diceCount:t})=>{const n=U2(dc);lt.useEffect(()=>{Fw("Dice"),kw(e),Bw({type:"ROLL_DICE",diceValues:Array(t).fill(1),isRolling:!1})},[e,t]);const i=()=>{my(!0),setTimeout(()=>{const s=Array.from({length:t},()=>Math.floor(Math.random()*6)+1);zw(s),my(!1);const o={diceValues:s};_s.emit("diceRollResult",o)},2e3)};return Ai.jsxs("div",{className:`flex flex-col items-center justify-center p-4 ${r}`,children:[Ai.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Dice Roller"}),Ai.jsxs(O2,{className:"w-full h-full",camera:{position:[0,0,5]},children:[Ai.jsx("ambientLight",{intensity:2.5}),Ai.jsx("pointLight",{position:[10,10,10]}),iy(n.action)&&Ai.jsx(B2,{diceValues:n.action.diceValues,isRolling:n.action.isRolling,textures:n.textures})]}),iy(n.action)&&Ai.jsx("button",{onClick:i,className:`mt-4 p-2 border border-yellow-300 rounded text-yellow-400 hover:scale-110 ${n.action.isRolling?"opacity-50":""}`,disabled:n.action.isRolling,children:"Roll Dice"})]})},k2=({text:r,speed:e=80,onComplete:t})=>{const[n,i]=lt.useState([]),s=lt.useRef([]);return lt.useEffect(()=>{let o,c=0;const u=r.split(/(<\/?span[^>]*>)/g).filter(Boolean),h=[];u.forEach((p,g)=>{if(p.startsWith("/);if(v){const x=v[1];h.push(Ai.jsx("span",{className:x},`span-${g}`))}else h.push(Ai.jsx("span",{},`span-${g}`))}else p.split("").forEach((v,x)=>{h.push(Ai.jsx("span",{children:v},`char-${g}-${x}`))})}),c=0;const f=()=>{c{window.clearTimeout(o)}},[r,e,t]),Ai.jsx("div",{children:n})},cI=jS.memo(k2);class gS extends Phaser.GameObjects.Container{constructor(e,t,n,i){const s=t.x,o=t.y-t.height+10;super(e,s,o),this.sprite=t;const c=150,u=40+i.length*20;this.background=e.add.rectangle(0,0,c,u,0,.7),this.text=e.add.text(0,-u/2+10,n,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=i.map((h,f)=>{const p=e.add.text(0,-u/2+30+f*20,h.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return p.setInteractive({useHandCursor:!0}),p.on("pointerdown",h.callback),p}),this.add(this.background),this.add(this.text),this.buttons.forEach(h=>this.add(h)),this.scene.add.existing(this)}updatePosition(){this.setPosition(this.sprite.x-30,this.sprite.y-this.sprite.height-this.background.height/2+100)}static attachToSprite(e,t,n,i){t.setInteractive(),t.on("pointerover",s=>{const o={npcId:t.name,npcName:n,actions:i.map(u=>u.label),coords:{x:s.x,y:s.y}};if(_s.emit("npcInteraction",o),!t.getData("tooltipMenu")){const u=new gS(e,t,n,i);t.setData("tooltipMenu",u)}const c=t.getData("tooltipMenu");c.setVisible(!0),c.updatePosition()}),t.on("pointerout",()=>{const s=t.getData("tooltipMenu");s&&s.setVisible(!1)})}static updateAllTooltipPositions(e){e.children.list.forEach(t=>{if(t instanceof Phaser.GameObjects.Sprite){const n=t.getData("tooltipMenu");n&&n.updatePosition()}})}}class uI extends Phaser.GameObjects.Sprite{}function hI(r,e,t,n){const c=r.add.graphics();c.fillStyle(16777215,1),c.fillRoundedRect(0,0,200,60,16),c.setDepth(99);const u=r.add.text(100,30,t,{fontFamily:"Arial",fontSize:16,color:"#000000"});u.setOrigin(.5),u.setWordWrapWidth(200-10*2),u.setDepth(100);const h=r.add.container(0,0,[c,u]);return h.setDepth(100),e.messageBubble=h,H2(e),r.time.addEvent({delay:n,callback:()=>{h.destroy(),e.messageBubble===h&&(e.messageBubble=void 0)},callbackScope:r}),h}function fI(r,e,t){const o=r.add.graphics();o.fillStyle(16777215,1),o.fillRoundedRect(0,0,200,60,16),o.setDepth(99);const c=r.add.text(100,30,t,{fontFamily:"Arial",fontSize:16,color:"#000000"});c.setOrigin(.5),c.setWordWrapWidth(200-10*2),c.setDepth(100);const u=r.add.container(0,0,[o,c]);return u.setDepth(100),e.textBubble=u,z2(e),u}function z2(r){const e=r.textBubble;e&&(e.x=r.x,e.y=r.y-r.height-e.height/2)}function H2(r){const e=r.messageBubble;e&&(e.x=r.x,e.y=r.y-r.height-e.height/2)}var yS={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(ny,function(){var t=function(d,y){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,C){w.__proto__=C}||function(w,C){for(var P in C)Object.prototype.hasOwnProperty.call(C,P)&&(w[P]=C[P])})(d,y)},n=function(){return(n=Object.assign||function(d){for(var y,w=1,C=arguments.length;w"u"||s.Promise||(s.Promise=Promise);var h=Object.getPrototypeOf,f={}.hasOwnProperty;function p(d,y){return f.call(d,y)}function g(d,y){typeof y=="function"&&(y=y(h(d))),(typeof Reflect>"u"?o:Reflect.ownKeys)(y).forEach(function(w){x(d,w,y[w])})}var v=Object.defineProperty;function x(d,y,w,C){v(d,y,u(w&&p(w,"get")&&typeof w.get=="function"?{get:w.get,set:w.set,configurable:!0}:{value:w,configurable:!0,writable:!0},C))}function E(d){return{from:function(y){return d.prototype=Object.create(y.prototype),x(d.prototype,"constructor",d),{extend:g.bind(null,d.prototype)}}}}var M=Object.getOwnPropertyDescriptor,S=[].slice;function A(d,y,w){return S.call(d,y,w)}function T(d,y){return y(d)}function I(d){if(!d)throw new Error("Assertion Failed")}function z(d){s.setImmediate?setImmediate(d):setTimeout(d,0)}function U(d,y){if(typeof y=="string"&&p(d,y))return d[y];if(!y)return d;if(typeof y!="string"){for(var w=[],C=0,P=y.length;C"u"?[]:function(){var d=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[d,h(d),d];var y=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[y,h(y),d]}(),dt=Ar[0],oi=Ar[1],Ar=Ar[2],oi=oi&&oi.then,Qe=dt&&dt.constructor,ut=!!Ar,wt=function(d,y){Ut.push([d,y]),Ve&&(queueMicrotask(cn),Ve=!1)},Ft=!0,Ve=!0,Kt=[],Ht=[],Dt=Ge,yt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:W,pgp:!1,env:{},finalize:W},Ce=yt,Ut=[],$t=0,fn=[];function Fe(d){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var y=this._PSD=Ce;if(typeof d!="function"){if(d!==ze)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Je(this,this._value))}this._state=null,this._value=null,++y.ref,function w(C,P){try{P(function(N){if(C._state===null){if(N===C)throw new TypeError("A promise cannot be resolved with itself.");var H=C._lib&&rn();N&&typeof N.then=="function"?w(C,function(j,ne){N instanceof Fe?N._then(j,ne):N.then(j,ne)}):(C._state=!0,C._value=N,Ze(C)),H&&Mn()}},Je.bind(null,C))}catch(N){Je(C,N)}}(this,d)}var ln={get:function(){var d=Ce,y=tr;function w(C,P){var N=this,H=!d.global&&(d!==Ce||y!==tr),j=H&&!dr(),ne=new Fe(function(K,oe){pt(N,new q(we(C,d,H,j),we(P,d,H,j),K,oe,d))});return this._consoleTask&&(ne._consoleTask=this._consoleTask),ne}return w.prototype=ze,w},set:function(d){x(this,"then",d&&d.prototype===ze?ln:{get:function(){return d},set:ln.set})}};function q(d,y,w,C,P){this.onFulfilled=typeof d=="function"?d:null,this.onRejected=typeof y=="function"?y:null,this.resolve=w,this.reject=C,this.psd=P}function Je(d,y){var w,C;Ht.push(y),d._state===null&&(w=d._lib&&rn(),y=Dt(y),d._state=!1,d._value=y,C=d,Kt.some(function(P){return P._value===C._value})||Kt.push(C),Ze(d),w&&Mn())}function Ze(d){var y=d._listeners;d._listeners=[];for(var w=0,C=y.length;w.",Ct="String expected.",Rt=[],Lt="__dbnames",Ot="readonly",wn="readwrite";function Rn(d,y){return d?y?function(){return d.apply(this,arguments)&&y.apply(this,arguments)}:d:y}var xn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function On(d){return typeof d!="string"||/\./.test(d)?function(y){return y}:function(y){return y[d]===void 0&&d in y&&delete(y=be(y))[d],y}}function Pt(){throw Le.Type()}function qe(d,y){try{var w=Pi(d),C=Pi(y);if(w!==C)return w==="Array"?1:C==="Array"?-1:w==="binary"?1:C==="binary"?-1:w==="string"?1:C==="string"?-1:w==="Date"?1:C!=="Date"?NaN:-1;switch(w){case"number":case"Date":case"string":return yMe+Te&&he(Me+le)})})}var ge=Sn(w)&&w.limit===1/0&&(typeof d!="function"||d===Is)&&{index:w.index,range:w.range};return he(0).then(function(){if(0=le})).length!==0?(oe.forEach(function(he){se.push(function(){var ge=Q,Me=he._cfg.dbschema;Us(Z,ge,ie),Us(Z,Me,ie),Q=Z._dbSchema=Me;var Te=Li(ge,Me);Te.add.forEach(function(it){Ds(ie,it[0],it[1].primKey,it[1].indexes)}),Te.change.forEach(function(it){if(it.recreate)throw new Le.Upgrade("Not yet support for changing primary key");var et=ie.objectStore(it.name);it.add.forEach(function(Tt){return Cr(et,Tt)}),it.change.forEach(function(Tt){et.deleteIndex(Tt.name),Cr(et,Tt)}),it.del.forEach(function(Tt){return et.deleteIndex(Tt)})});var Oe=he._cfg.contentUpgrade;if(Oe&&he._cfg.version>le){wo(Z,ie),te._memoizedTables={};var rt=Y(Me);Te.del.forEach(function(it){rt[it]=ge[it]}),ji(Z,[Z.Transaction.prototype]),Sa(Z,[Z.Transaction.prototype],o(rt),rt),te.schema=rt;var He,tt=ue(Oe);return tt&&Tr(),Te=Fe.follow(function(){var it;(He=Oe(te))&&tt&&(it=dr.bind(null,null),He.then(it,it))}),He&&typeof He.then=="function"?Fe.resolve(He):Te.then(function(){return He})}}),se.push(function(ge){var Me,Te,Oe=he._cfg.dbschema;Me=Oe,Te=ge,[].slice.call(Te.db.objectStoreNames).forEach(function(rt){return Me[rt]==null&&Te.db.deleteObjectStore(rt)}),ji(Z,[Z.Transaction.prototype]),Sa(Z,[Z.Transaction.prototype],Z._storeNames,Z._dbSchema),te.schema=Z._dbSchema}),se.push(function(ge){Z.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(Z.idbdb.version/10)===he._cfg.version?(Z.idbdb.deleteObjectStore("$meta"),delete Z._dbSchema.$meta,Z._storeNames=Z._storeNames.filter(function(Me){return Me!=="$meta"})):ge.objectStore("$meta").put(he._cfg.version,"version"))})}),function he(){return se.length?Fe.resolve(se.shift()(te.idbtrans)).then(he):Fe.resolve()}().then(function(){bo(Q,ie)})):Fe.resolve();var Z,le,te,ie,se,Q}).catch(H)):(o(P).forEach(function(oe){Ds(w,oe,P[oe].primKey,P[oe].indexes)}),wo(d,w),void Fe.follow(function(){return d.on.populate.fire(N)}).catch(H));var ne,K})}function Tf(d,y){bo(d._dbSchema,y),y.db.version%10!=0||y.objectStoreNames.contains("$meta")||y.db.createObjectStore("$meta").add(Math.ceil(y.db.version/10-1),"version");var w=Os(0,d.idbdb,y);Us(d,d._dbSchema,y);for(var C=0,P=Li(w,d._dbSchema).change;CMath.pow(2,62)?0:Q.oldVersion,Z=Q<1,d.idbdb=se.result,N&&Tf(d,oe),Ma(d,Q/10,oe,te))},te),se.onsuccess=Xt(function(){oe=null;var Q,he,ge,Me,Te,Oe=d.idbdb=se.result,rt=A(Oe.objectStoreNames);if(0"u"?Fe.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(le){function te(){return indexedDB.databases().finally(le)}ne=setInterval(te,100),te()}).finally(function(){return clearInterval(ne)}):Promise.resolve()).then(j)]).then(function(){return H(),y.onReadyBeingFired=[],Fe.resolve(Yi(function(){return d.on.ready.fire(d.vip)})).then(function le(){if(0y.limit?le.length=y.limit:d.length===y.limit&&le.length=he.limit&&(!he.values||Oe.req.values)&&Co(Oe.req.query.range,he.query.range)}),!1,ge,Me];case"count":return Te=Me.find(function(Oe){return En(Oe.req.query.range,he.query.range)}),[Te,!!Te,ge,Me]}}(y,w,"query",N),oe=K[0],Z=K[1],le=K[2],te=K[3];return oe&&Z?oe.obsSet=N.obsSet:(Z=C.query(N).then(function(ie){var se=ie.result;if(oe&&(oe.res=se),H){for(var Q=0,he=se.length;Q{zt.log(`Texture ${o} loaded successfully.`),this.addNPCToScene(e,s,n,i)}),e.load.start()}else throw new Error(`Sprite with ID ${s.spriteImageId} not found`)}}catch(s){s instanceof Error?zt.error(`Failed to load NPC: ${s.message}`):zt.error("Failed to load NPC:",s)}}addNPCToScene(e,t,n,i){try{zt.log(`Adding NPC to scene: ${JSON.stringify(t)}`),zt.log(`Using sprite key: ${t.spriteKey}`);const s=e.add.sprite(0,0,t.spriteKey);s.scale=t.scale||1.5,s.name=t.id||"Error Missing Name",zt.log(`NPC Sprite created with texture key ${t.spriteKey} at position (${t.startPosition.x}, ${t.startPosition.y})`);const o={id:t.id,sprite:s,walkingAnimationMapping:t.walkingAnimationMapping,startPosition:{x:n??t.startPosition.x,y:i??t.startPosition.y},speed:t.speed};if(zt.log(`Grid engine config: ${JSON.stringify(o)}`),!e.textures.exists(t.spriteKey))throw new Error(`Texture with key ${t.spriteKey} does not exist in the scene`);e.gridEngine.addCharacter(o),zt.log(`NPC added to grid engine with ID ${t.id}`),((u,h,f)=>{const p=e.gridEngine.getPosition(u.name);zt.log(`Attaching NPC events to ${h} at position: ${JSON.stringify(p)}`),q2.attachNPCEvent(u,h,f,{coords:p})})(s,t.name,t.actions.map(u=>({label:u}))),zt.log(`NPC ${t.name} added to scene successfully`)}catch(s){s instanceof Error?zt.error(`Error adding NPC to scene from addNPCToScene: ${s.message}`):zt.error("Error adding NPC to scene:",s)}}async addDialogue(e){await this.dialogues.put(e)}async getDialogue(e){return await this.dialogues.get(e)}async getAllDialogues(){return await this.dialogues.toArray()}async getDialoguesForNPC(e){const t=await this.getNPC(e);if(!t)throw new Error(`NPC with ID ${e} not found`);return(await Promise.all((t.dialogues||[]).map(i=>this.getDialogue(i.dialogueId)))).filter(i=>i!==void 0)}async markDialogueAsRead(e,t){const n=await this.getNPC(e);if(!n)throw new Error(`NPC with ID ${e} not found`);const i=n.dialogues?.find(s=>s.dialogueId===t);i&&(i.read=!0,await this.addNPC(n))}async fetchDialogues(e){try{const n=(await Cn.get(e)).data.key,i=Object.values(n).map(s=>({...s}));await this.dialogues.bulkPut(i)}catch(t){zt.error(`Failed to fetch dialogues from ${e}:`,t)}}async getPrioritizedDialoguesForNPC(e){try{const t=await this.getNPC(e);if(!t)throw new Error(`NPC with ID ${e} not found`);const i=(await Promise.all((t.dialogues||[]).map(async s=>{const o=await this.getDialogue(s.dialogueId);return o?{...o,priority:s.priority,read:s.read}:null}))).filter(s=>s!==null);return i.sort((s,o)=>o.priority-s.priority),i}catch(t){return zt.error(`Failed to get prioritized dialogues for NPC with ID ${e}:`,t),[]}}async getNPCNameById(e){return(await this.getNPC(e))?.name}async getNPCAvatarById(e){const t=await this.getNPC(e);if(t?.avatarImageId)return(await this.getAvatar(t.avatarImageId))?.avatarData}async getNPCSlugById(e){return(await this.getNPC(e))?.slug}async getNPCHealthById(e){try{return(await this.getNPC(e))?.stats?.health}catch(t){zt.error(`Failed to get health for NPC with ID ${e}:`,t);return}}async getNPCManaById(e){try{return(await this.getNPC(e))?.stats?.mana}catch(t){zt.error(`Failed to get mana for NPC with ID ${e}:`,t);return}}async createNPCSession(e,t){try{const n=this.getNPCNameById(t),i=this.getNPCSlugById(t),s=this.getNPCAvatarById(t),o=this.getNPCHealthById(t),c=this.getNPCManaById(t),[u,h,f,p,g]=await Promise.all([n,i,s,o,c]),v={...e.get(),[`${t}_name`]:u||"Unknown",[`${t}_slug`]:h||"Unknown",[`${t}_avatar`]:f?URL.createObjectURL(f):"Unknown",[`${t}_health`]:p||"100",[`${t}_mana`]:g||"100"};e.set(v)}catch{const i={...e.get(),[`${t}_name`]:"Unknown",[`${t}_slug`]:"Unknown",[`${t}_avatar`]:"Unknown",[`${t}_hp`]:"100",[`${t}_mana`]:"100"};e.set(i)}}}const W2=new G2;class X2{constructor(){this.actionHandlers={talk:this.talkToNPC.bind(this),quest:this.questWithNPC.bind(this),trade:this.tradeWithNPC.bind(this),combat:this.startCombat.bind(this),heal:this.healNPC.bind(this),steal:this.stealFromNPC.bind(this),lore:this.loreFromNPC.bind(this)}}getActionHandler(e){return this.actionHandlers[e]}loreFromNPC(e){zt.log(`Pulling up the lore of the NPC with ID: ${e.npcId}`)}questWithNPC(e){zt.log(`Starting quest with NPC with ID: ${e.npcId}`)}healNPC(e){zt.log(`Healing NPC with ID: ${e.npcId}`)}async talkToNPC(e){try{zt.log(`Talking to NPC with ID: ${e.npcId}`);const t=await W2.getPrioritizedDialoguesForNPC(e.npcId);if(zt.log(t),t.length>0){const n=t[0];_s.emit("npcDialogue",{npcId:e.npcId,dialogue:n},1e3)}else zt.log("No dialogues available for this NPC.")}catch(t){zt.error(`Failed to fetch dialogues for NPC with ID ${e.npcId}:`,t)}}tradeWithNPC(e){zt.log(`Trading with NPC with ID: ${e.npcId}`)}moveToNPC(e){const n=e.data?.coords||{x:10,y:15};_s.emit("playerMove",n)}stealFromNPC(e){zt.log(`Attempting to steal from NPC with ID: ${e.npcId}`);const t={npcId:e.npcId,npcName:e.npcName,data:e.data};_s.emit("playerSteal",t)}startCombat(e){zt.log(`Starting combat with NPC with ID: ${e.npcId}`)}checkFish(e){zt.log(`Checking fish for NPC with ID: ${e.npcId}`)}attachNPCEvent(e,t,n,i){e.setInteractive(),e.on("pointerover",s=>{const o={npcId:e.name||"",npcName:t,actions:n.map(c=>c.label),data:i||{},coords:{x:s.x,y:s.y}};_s.emit("npcInteraction",o)}),e.on("pointerout",()=>{}),e.on("pointerdown",s=>{const o={npcId:e.name||"",npcName:t,actions:n.map(c=>c.label),data:i||{},coords:{x:s.x,y:s.y}};zt.log(`Click Registered at X: ${o.coords.x} Y: ${o.coords.y}`),_s.emit("npcInteractionClick",o,1e3)})}}const q2=new X2;export{zw as A,KS as C,zt as D,lI as M,cI as T,sI as a,_s as b,tI as c,Rw as d,nI as e,Q2 as f,Cw as g,W2 as h,Nv as i,hI as j,fI as k,z2 as l,U2 as m,Fv as n,Tw as o,oI as p,Dn as q,rI as r,Uv as s,op as t,iI as u,Z2 as v,ki as w,q2 as x,$2 as y,eI as z}; diff --git a/docs/index.html b/docs/index.html index f7aa6de..9a0c12c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,8 @@ - Welcome to CryptoThrone. + Welcome to CryptoThrone. \ No newline at end of file + \ No newline at end of file