@wwawing/engine 3.13.0-unstable.based-on.3.12.10 → 3.13.0-unstable.based-on.3.12.10.p.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/wwa.js
CHANGED
|
@@ -18,4 +18,4 @@ a.mode.CTRGladman=function(){var t=a.lib.BlockCipherMode.extend();function e(t){
|
|
|
18
18
|
|
|
19
19
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
20
20
|
*/
|
|
21
|
-
function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),_=s.create([0,1518500249,1859775393,2400959708,2840853838]),l=s.create([1352829926,1548603684,1836072691,2053994217,0]),p=n.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var a=e+i,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,n,p,w,v,S,A,T,I,C,O,D=this._hash.words,P=_.words,N=l.words,b=o.words,x=c.words,M=h.words,L=u.words;for(S=r=D[0],A=n=D[1],T=p=D[2],I=w=D[3],C=v=D[4],i=0;i<80;i+=1)O=r+t[e+b[i]]|0,O+=i<16?d(n,p,w)+P[0]:i<32?f(n,p,w)+P[1]:i<48?E(n,p,w)+P[2]:i<64?m(n,p,w)+P[3]:y(n,p,w)+P[4],O=(O=g(O|=0,M[i]))+v|0,r=v,v=w,w=g(p,10),p=n,n=O,O=S+t[e+x[i]]|0,O+=i<16?y(A,T,I)+N[0]:i<32?m(A,T,I)+N[1]:i<48?E(A,T,I)+N[2]:i<64?f(A,T,I)+N[3]:d(A,T,I)+N[4],O=(O=g(O|=0,L[i]))+C|0,S=C,C=I,I=g(T,10),T=A,A=O;O=D[1]+p+I|0,D[1]=D[2]+w+C|0,D[2]=D[3]+v+S|0,D[3]=D[4]+r+A|0,D[4]=D[0]+n+T|0,D[0]=O},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,r=s.words,n=0;n<5;n++){var o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return s},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,i){return t^e^i}function f(t,e,i){return t&e|~t&i}function E(t,e,i){return(t|~e)^i}function m(t,e,i){return t&i|e&~i}function y(t,e,i){return t^(e|~i)}function g(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),a.RIPEMD160)},637:function(t,e,i){var a,s,r,n,o,c,h,u;t.exports=(u=i(359),s=(a=u).lib,r=s.WordArray,n=s.Hasher,o=a.algo,c=[],h=o.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],h=0;h<80;h++){if(h<16)c[h]=0|t[e+h];else{var u=c[h-3]^c[h-8]^c[h-14]^c[h-16];c[h]=u<<1|u>>>31}var _=(a<<5|a>>>27)+o+c[h];_+=h<20?1518500249+(s&r|~s&n):h<40?1859775393+(s^r^n):h<60?(s&r|s&n|r&n)-1894007588:(s^r^n)-899497514,o=n,n=r,r=s<<30|s>>>2,s=a,a=_}i[0]=i[0]+a|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+n|0,i[4]=i[4]+o|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(a+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),a.SHA1=n._createHelper(h),a.HmacSHA1=n._createHmacHelper(h),u.SHA1)},640:function(t,e,i){var a,s,r,n,o,c;t.exports=(c=i(359),i(93),s=(a=c).lib.WordArray,r=a.algo,n=r.SHA256,o=r.SHA224=n.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}}),a.SHA224=n._createHelper(o),a.HmacSHA224=n._createHmacHelper(o),c.SHA224)},93:function(t,e,i){var a;t.exports=(a=i(359),function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],c=[];!function(){function e(e){for(var i=t.sqrt(e),a=2;a<=i;a++)if(!(e%a))return!1;return!0}function i(t){return 4294967296*(t-(0|t))|0}for(var a=2,s=0;s<64;)e(a)&&(s<8&&(o[s]=i(t.pow(a,.5))),c[s]=i(t.pow(a,1/3)),s++),a++}();var h=[],u=n.SHA256=r.extend({_doReset:function(){this._hash=new s.init(o.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],u=i[5],_=i[6],l=i[7],p=0;p<64;p++){if(p<16)h[p]=0|t[e+p];else{var d=h[p-15],f=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,E=h[p-2],m=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;h[p]=f+h[p-7]+m+h[p-16]}var y=a&s^a&r^s&r,g=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),w=l+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&u^~o&_)+c[p]+h[p];l=_,_=u,u=o,o=n+w|0,n=r,r=s,s=a,a=w+(g+y)|0}i[0]=i[0]+a|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+n|0,i[4]=i[4]+o|0,i[5]=i[5]+u|0,i[6]=i[6]+_|0,i[7]=i[7]+l|0},_doFinalize:function(){var e=this._data,i=e.words,a=8*this._nDataBytes,s=8*e.sigBytes;return i[s>>>5]|=128<<24-s%32,i[14+(s+64>>>9<<4)]=t.floor(a/4294967296),i[15+(s+64>>>9<<4)]=a,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(u),e.HmacSHA256=r._createHmacHelper(u)}(Math),a.SHA256)},140:function(t,e,i){var a;t.exports=(a=i(359),i(467),function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.x64.Word,o=e.algo,c=[],h=[],u=[];!function(){for(var t=1,e=0,i=0;i<24;i++){c[t+5*e]=(i+1)*(i+2)/2%64;var a=(2*t+3*e)%5;t=e%5,e=a}for(t=0;t<5;t++)for(e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var s=1,r=0;r<24;r++){for(var o=0,_=0,l=0;l<7;l++){if(1&s){var p=(1<<l)-1;p<32?_^=1<<p:o^=1<<p-32}128&s?s=s<<1^113:s<<=1}u[r]=n.create(o,_)}}();var _=[];!function(){for(var t=0;t<25;t++)_[t]=n.create()}();var l=o.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var i=this._state,a=this.blockSize/2,s=0;s<a;s++){var r=t[e+2*s],n=t[e+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),(D=i[s]).high^=n,D.low^=r}for(var o=0;o<24;o++){for(var l=0;l<5;l++){for(var p=0,d=0,f=0;f<5;f++)p^=(D=i[l+5*f]).high,d^=D.low;var E=_[l];E.high=p,E.low=d}for(l=0;l<5;l++){var m=_[(l+4)%5],y=_[(l+1)%5],g=y.high,w=y.low;for(p=m.high^(g<<1|w>>>31),d=m.low^(w<<1|g>>>31),f=0;f<5;f++)(D=i[l+5*f]).high^=p,D.low^=d}for(var v=1;v<25;v++){var S=(D=i[v]).high,A=D.low,T=c[v];T<32?(p=S<<T|A>>>32-T,d=A<<T|S>>>32-T):(p=A<<T-32|S>>>64-T,d=S<<T-32|A>>>64-T);var I=_[h[v]];I.high=p,I.low=d}var C=_[0],O=i[0];for(C.high=O.high,C.low=O.low,l=0;l<5;l++)for(f=0;f<5;f++){var D=i[v=l+5*f],P=_[v],N=_[(l+1)%5+5*f],b=_[(l+2)%5+5*f];D.high=P.high^~N.high&b.high,D.low=P.low^~N.low&b.low}D=i[0];var x=u[o];D.high^=x.high,D.low^=x.low}},_doFinalize:function(){var e=this._data,i=e.words,a=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;i[a>>>5]|=1<<24-a%32,i[(t.ceil((a+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*i.length,this._process();for(var n=this._state,o=this.cfg.outputLength/8,c=o/8,h=[],u=0;u<c;u++){var _=n[u],l=_.high,p=_.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h.push(p),h.push(l)}return new s.init(h,o)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),a.SHA3)},716:function(t,e,i){var a,s,r,n,o,c,h,u;t.exports=(u=i(359),i(467),i(834),s=(a=u).x64,r=s.Word,n=s.WordArray,o=a.algo,c=o.SHA512,h=o.SHA384=c.extend({_doReset:function(){this._hash=new n.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),a.SHA384=c._createHelper(h),a.HmacSHA384=c._createHmacHelper(h),u.SHA384)},834:function(t,e,i){var a;t.exports=(a=i(359),i(467),function(){var t=a,e=t.lib.Hasher,i=t.x64,s=i.Word,r=i.WordArray,n=t.algo;function o(){return s.create.apply(s,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=o()}();var u=n.SHA512=e.extend({_doReset:function(){this._hash=new r.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],u=i[5],_=i[6],l=i[7],p=a.high,d=a.low,f=s.high,E=s.low,m=r.high,y=r.low,g=n.high,w=n.low,v=o.high,S=o.low,A=u.high,T=u.low,I=_.high,C=_.low,O=l.high,D=l.low,P=p,N=d,b=f,x=E,M=m,L=y,R=g,B=w,U=v,k=S,W=A,V=T,F=I,Y=C,G=O,H=D,K=0;K<80;K++){var j,X,J=h[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=h[K-15],q=Z.high,Q=Z.low,z=(q>>>1|Q<<31)^(q>>>8|Q<<24)^q>>>7,$=(Q>>>1|q<<31)^(Q>>>8|q<<24)^(Q>>>7|q<<25),tt=h[K-2],et=tt.high,it=tt.low,at=(et>>>19|it<<13)^(et<<3|it>>>29)^et>>>6,st=(it>>>19|et<<13)^(it<<3|et>>>29)^(it>>>6|et<<26),rt=h[K-7],nt=rt.high,ot=rt.low,ct=h[K-16],ht=ct.high,ut=ct.low;X=(X=(X=z+nt+((j=$+ot)>>>0<$>>>0?1:0))+at+((j+=st)>>>0<st>>>0?1:0))+ht+((j+=ut)>>>0<ut>>>0?1:0),J.high=X,J.low=j}var _t,lt=U&W^~U&F,pt=k&V^~k&Y,dt=P&b^P&M^b&M,ft=N&x^N&L^x&L,Et=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),mt=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(U>>>14|k<<18)^(U>>>18|k<<14)^(U<<23|k>>>9),gt=(k>>>14|U<<18)^(k>>>18|U<<14)^(k<<23|U>>>9),wt=c[K],vt=wt.high,St=wt.low,At=G+yt+((_t=H+gt)>>>0<H>>>0?1:0),Tt=mt+ft;G=F,H=Y,F=W,Y=V,W=U,V=k,U=R+(At=(At=(At=At+lt+((_t+=pt)>>>0<pt>>>0?1:0))+vt+((_t+=St)>>>0<St>>>0?1:0))+X+((_t+=j)>>>0<j>>>0?1:0))+((k=B+_t|0)>>>0<B>>>0?1:0)|0,R=M,B=L,M=b,L=x,b=P,x=N,P=At+(Et+dt+(Tt>>>0<mt>>>0?1:0))+((N=_t+Tt|0)>>>0<_t>>>0?1:0)|0}d=a.low=d+N,a.high=p+P+(d>>>0<N>>>0?1:0),E=s.low=E+x,s.high=f+b+(E>>>0<x>>>0?1:0),y=r.low=y+L,r.high=m+M+(y>>>0<L>>>0?1:0),w=n.low=w+B,n.high=g+R+(w>>>0<B>>>0?1:0),S=o.low=S+k,o.high=v+U+(S>>>0<k>>>0?1:0),T=u.low=T+V,u.high=A+W+(T>>>0<V>>>0?1:0),C=_.low=C+Y,_.high=I+F+(C>>>0<Y>>>0?1:0),D=l.low=D+H,l.high=O+G+(D>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[30+(a+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(a+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(u),t.HmacSHA512=e._createHmacHelper(u)}(),a.SHA512)},567:function(t,e,i){var a;t.exports=(a=i(359),i(139),i(174),i(844),i(951),function(){var t=a,e=t.lib,i=e.WordArray,s=e.BlockCipher,r=t.algo,n=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],_=r.DES=s.extend({_doReset:function(){for(var t=this._key.words,e=[],i=0;i<56;i++){var a=n[i]-1;e[i]=t[a>>>5]>>>31-a%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var h=s[r]=[],u=c[r];for(i=0;i<24;i++)h[i/6|0]|=e[(o[i]-1+u)%28]<<31-i%6,h[4+(i/6|0)]|=e[28+(o[i+24]-1+u)%28]<<31-i%6;for(h[0]=h[0]<<1|h[0]>>>31,i=1;i<7;i++)h[i]=h[i]>>>4*(i-1)+3;h[7]=h[7]<<5|h[7]>>>27}var _=this._invSubKeys=[];for(i=0;i<16;i++)_[i]=s[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var a=0;a<16;a++){for(var s=i[a],r=this._lBlock,n=this._rBlock,o=0,c=0;c<8;c++)o|=h[c][((n^s[c])&u[c])>>>0];this._lBlock=n,this._rBlock=r^o}var _=this._lBlock;this._lBlock=this._rBlock,this._rBlock=_,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t}function p(t,e){var i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t}t.DES=s._createHelper(_);var d=r.TripleDES=s.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),a=t.length<4?t.slice(0,2):t.slice(2,4),s=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=_.createEncryptor(i.create(e)),this._des2=_.createEncryptor(i.create(a)),this._des3=_.createEncryptor(i.create(s))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=s._createHelper(d)}(),a.TripleDES)},467:function(t,e,i){var a;t.exports=(a=i(359),function(t){var e=a,i=e.lib,s=i.Base,r=i.WordArray,n=e.x64={};n.Word=s.extend({init:function(t,e){this.high=t,this.low=e}}),n.WordArray=s.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:8*e.length},toX32:function(){for(var t=this.words,e=t.length,i=[],a=0;a<e;a++){var s=t[a];i.push(s.high),i.push(s.low)}return r.create(i,this.sigBytes)},clone:function(){for(var t=s.clone.call(this),e=t.words=this.words.slice(0),i=e.length,a=0;a<i;a++)e[a]=e[a].clone();return t}})}(),a)},633:function(){},106:function(){}},e={};function i(a){var s=e[a];if(void 0!==s)return s.exports;var r=e[a]={exports:{}};return t[a].call(r.exports,r,r.exports,i),r.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},t.apply(this,arguments)},e=Object.freeze({CONFIRM_LOAD_SOUND:{code:1,defaultText:"効果音・BGMデータをロードしますか?",mapdataParams:{messageArea:"systemMessage",index:2}},NO_MONEY:{code:101,defaultText:"所持金がたりない。",mapdataParams:{messageArea:"message",index:6}},NO_ITEM:{code:201,mapdataParams:{messageArea:"message",index:7},defaultText:"アイテムを持っていない。"},ITEM_BOX_FULL:{code:202,defaultText:"これ以上、アイテムを持てません。",mapdataParams:{messageArea:"systemMessage",index:1}},ITEM_SELECT_TUTORIAL:{code:203,defaultText:"このアイテムは%HOW_TO_USE_ITEM%ことで使用できます。\n使用できるアイテムは色枠で囲まれます。",mapdataParams:{messageArea:"systemMessage",index:0}},CONFIRM_USE_ITEM:{code:204,defaultText:"このアイテムを使用します。\nよろしいですか?",mapdataParams:{messageArea:"message",index:8}},CANNOT_DAMAGE_MONSTER:{code:301,defaultText:"相手の防御能力が高すぎる!"},CONFIRM_ENTER_URL_GATE:{code:401,defaultText:"他のページにリンクします。\nよろしいですか?",mapdataParams:{messageArea:"message",index:5}},GAME_SPEED_CHANGED:{code:501,defaultText:"移動速度を【%GAME_SPEED_NAME%】に切り替えました。\n%HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)\n速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。"},GAME_SPEED_CHANGE_DISABLED:{code:502,defaultText:"ここでは移動速度を\n変更できません。"}}),a=Object.keys(e),s=a.reduce((function(e,i){var a;return t(t({},e),((a={})[i]=i,a))}),{}),r=e;function n(t){return a.some((function(e){return e===t}))}function o(t){for(var e=0,i=a;e<i.length;e++){var s=i[e];if(r[s].code===t)return s}}var c,h,u,_=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),l=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),p=function(t){function e(e,i,a,s){var r=t.call(this,i,a)||this;return r.energy=e,r.gold=s,r}return _(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t.rates).reduce((function(i,a){return i+t.rates[a]*e[a]}),0)},e}(l),d=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new f(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),f=function(){function t(t,e,i,a,s){if(void 0===a&&(a=0),void 0===s&&(s=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var r=this._wwa.getMapWidth();if(e<0||e>=r||e>=r-1&&a>0||i<0||i>=r||i>=r-1&&s>0)throw new Error("範囲外の座標です!! parts:("+e+", "+i+"), offset:("+a+", "+s+"), mapWidth = "+r);this._partsCoord=new d(e,i),this._offsetCoord=new d(a,s)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(H.H_PARTS_NUM_IN_WINDOW-1))*(H.H_PARTS_NUM_IN_WINDOW-1),i=Math.floor(this._partsCoord.y/(H.V_PARTS_NUM_IN_WINDOW-1))*(H.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,i,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),i=this._wwa.getMapWidth(),a=t.getPartsCoord().clone();return e.x===i-1&&a.x--,e.y===i-1&&a.y--,a.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var i=this._partsCoord;return new t(this._wwa,i.x+S[e],i.y+A[e],0,0)}var a=this._partsCoord.x,s=this._partsCoord.y;return this._offsetCoord.x<0?a--:this._offsetCoord.x>0&&a++,this._offsetCoord.y<0?s--:this._offsetCoord.y>0&&s++,new t(this._wwa,a,s,0,0)},t.prototype.getNextFramePosition=function(e,i,a){var s=this._partsCoord.x,r=this._partsCoord.y,n=this._offsetCoord.x+S[e]*i,o=this._offsetCoord.y+A[e]*a;if(n<0){var c=Math.floor(Math.abs(n)/H.CHIP_SIZE);s-=c,n=(n+c*H.CHIP_SIZE)%H.CHIP_SIZE}if(o<0){var h=Math.floor(Math.abs(o)/H.CHIP_SIZE);r-=h,o=(o+h*H.CHIP_SIZE)%H.CHIP_SIZE}return n>=H.CHIP_SIZE&&(s+=Math.floor(n/H.CHIP_SIZE),n=(n+H.CHIP_SIZE)%H.CHIP_SIZE),o>=H.CHIP_SIZE&&(r+=Math.floor(o/H.CHIP_SIZE),o=(o+H.CHIP_SIZE)%H.CHIP_SIZE),new t(this._wwa,s,r,n,o)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var i=t.getPosition()._partsCoord,a=this._partsCoord.x,s=this._partsCoord.y,r=e?1:0;return i.x<=a&&a<i.x+H.H_PARTS_NUM_IN_WINDOW-r&&i.y<=s&&s<i.y+H.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===H.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===H.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),E=function(t,e,i){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=i.clone()},m=function(t,e,i,a,s){this.partsIDObj=t,this.x=e,this.y=i,this.isStatic=a,this.isFighting=s};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(h||(h={})),function(t){t[t.UNUSED=0]="UNUSED",t[t.LEFT=4]="LEFT",t[t.RIGHT=6]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=8]="UP",t[t.LEFT_DOWN=1]="LEFT_DOWN",t[t.LEFT_UP=7]="LEFT_UP",t[t.RIGHT_DOWN=3]="RIGHT_DOWN",t[t.RIGHT_UP=9]="RIGHT_UP",t[t.NO_DIRECTION=5]="NO_DIRECTION"}(u||(u={}));var y,g,w,v,S=[0,-1,0,1,-1,0,1,-1,0,1],A=[0,1,1,1,0,0,0,-1,-1,-1];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(y||(y={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(g||(g={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(w||(w={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(v||(v={}));var T,I,C,O,D,P,N,b,x,M=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?T.XBOX:t.match(/windows/i)?T.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?T.IOS:T.MACINTOSH:t.match(/iphone|ipad|ipod/i)?T.IOS:t.match(/oculus/i)?T.OCULUS:t.match(/android/i)?T.ANDROID:t.match(/nintendo/i)?T.NINTENDO:t.match(/playstation/i)?T.PLAY_STATION:t.match(/linux/i)?T.LINUX:T.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?C.CHROME:t.match(/firefox/i)?C.FIREFOX:t.match(/safari/i)?C.SAFARI:C.OTHERS},t.prototype.getDevice=function(){switch(this.os){case T.WINDOWS:case T.MACINTOSH:case T.LINUX:return I.PC;case T.IOS:case T.ANDROID:return I.SP;case T.OCULUS:return I.VR;case T.NINTENDO:case T.PLAY_STATION:case T.XBOX:return I.GAME}return I.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(T||(T={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(I||(I={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(O||(O={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(D||(D={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(P||(P={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(N||(N={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(b||(b={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(x||(x={}));var L,R=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MONEY=37]="SET_MONEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.MAP2=61]="MAP2",t[t.SHOW_STR2=62]="SHOW_STR2",t[t.CONSOLE_LOG2=63]="CONSOLE_LOG2",t[t.DELAYBGM=64]="DELAYBGM",t[t.SYSMSG=65]="SYSMSG",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(L||(L={}));var B,U,k,W={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$map2:61,$show_str2:62,$console_log2:63,$delaybgm:64,$sysmsg:65,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(B||(B={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(U||(U={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(k||(k={}));var V,F=[1,2,5,8,10,20],Y=["超低速","低速","準低速","中速","高速","超高速"],G=["energy","strength","defence","gold"],H=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=F.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[F.length-2,F.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10,t}(),K=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),j=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),X=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(V||(V={}));var J,Z,q,Q,z,$,tt,et=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],it=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(J||(J={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(Z||(Z={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(q||(q={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(Q||(Q={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(z||(z={})),function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}($||($={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_B=66]="KEY_B",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_F=70]="KEY_F",t[t.KEY_G=71]="KEY_G",t[t.KEY_H=72]="KEY_H",t[t.KEY_I=73]="KEY_I",t[t.KEY_J=74]="KEY_J",t[t.KEY_K=75]="KEY_K",t[t.KEY_L=76]="KEY_L",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_O=79]="KEY_O",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_R=82]="KEY_R",t[t.KEY_S=83]="KEY_S",t[t.KEY_T=84]="KEY_T",t[t.KEY_U=85]="KEY_U",t[t.KEY_V=86]="KEY_V",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F10=121]="KEY_F10",t[t.KEY_F12=123]="KEY_F12"}(tt||(tt={}));var at,st,rt=function(){function t(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),this._keyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(t.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1,this._keyState[e]=!1,this._prevKeyState[e]=!1,this._prevKeyStateOnControllable[e]=!1,this._keyInputContinueFrameNum[e]=0}return t.prototype.checkHitKey=function(t){var e=this.getKeyState(t);return e===$.KEYDOWN||e===$.KEYPRESS},t.prototype.getKeyState=function(t){return this._prevKeyState[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForControllPlayer=function(t){return this._prevKeyStateOnControllable[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForMessageCheck=function(t){return this._prevKeyState[t]?this._keyState[t]?this._keyInputContinueFrameNum[t]>=H.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?$.KEYPRESS_MESSAGECHANGE:$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},t.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},t.prototype.update=function(){var e;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),e=0;e<t.KEY_BUFFER_MAX;e++)this._keyState[e]&&this._keyInputContinueFrameNum[e]++},t.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},t.prototype.allClear=function(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1},t.KEY_BUFFER_MAX=256,t}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(at||(at={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(st||(st={}));var nt,ot,ct=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===at.MOUSEDOWN||e===at.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?at.NONE:this._prevMouseState?this._mouseState?at.MOUSEPRESS:at.MOUSEUP:this._mouseState?at.MOUSEDOWN:at.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?at.NONE:this._prevMouseStateOnControllable?this._mouseState?at.MOUSEPRESS:at.MOUSEUP:this._mouseState?at.MOUSEDOWN:at.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===st.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(nt||(nt={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(ot||(ot={}));var ht=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,i,a,s,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){i=r[t];var o=this.gamepad.buttons[i];if(!o)return!1;if(a="object"==typeof o?!0===o.pressed:1===o,s=this.triggers[i],this.triggers[i]=a,a&&!s)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,i,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++){i=a[t];var r=this.gamepad.buttons[i];if(!r)return!1;if("object"==typeof r?!0===r.pressed:1===r)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(!this.gamepad)return!1;for(e=i.length,t=0;t<e;t++)switch(i[t]){case nt.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[ot.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[ot.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_UP))return!0;break;case nt.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[ot.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[ot.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_DOWN))return!0;break;case nt.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[ot.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[ot.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_LEFT))return!0;break;case nt.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[ot.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[ot.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,i,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return 0;for(e=a.length,t=0;t<e;t++){i=a[t];var r=this.gamepad.axes[i];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),ut=function(){function t(t){void 0===t&&(t=0),this.lastCalculatedTimeUnixMs=Date.now(),this.lastCalculatedPlayTimeMs=t}return t.prototype.calculateTimeMs=function(){var t=Date.now(),e=t-this.lastCalculatedTimeUnixMs+this.lastCalculatedPlayTimeMs;return this.lastCalculatedTimeUnixMs=t,this.lastCalculatedPlayTimeMs=e,e},t.prototype.calculatePlayTimeFormat=function(){return t.formatPlayTimeText(this.calculateTimeMs()/1e3)},t.formatPlayTimeText=function(t){var e=Math.floor(t);return e>=36e6?"9999:99:99":("000"+(e/60/60|0)).slice(-4)+":"+("0"+(e/60|0)%60).slice(-2)+":"+("0"+e%60).slice(-2)},t}(),_t=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],lt=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],pt=new Set(lt),dt=function(){function t(e,i,a,s,r,n){void 0===i&&(i=!1),void 0===a&&(a=null),void 0===s&&(s=null),void 0===r&&(r=null),void 0===n&&(n=null);var o=this;if(this._enabled=null!==e,this._visible=i,this._onTouchStart=r||null,this._onTouchEnd=n||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=s,this._buttonWrapperElement=a,this._setVisible(i),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility="visible"),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility="visible"),null!==e){var c=function(i){var a=e[i];if(!a)return"continue";var s=i;h._availableButtons.push(s),a.setAttribute("type",i),h._isTouchingButtons[s]={prev:!1,current:!1,next:!1};var r=function(t){t.cancelable&&t.preventDefault()};a.addEventListener("touchstart",(function(t){r(t),o.setTouchInfo(s)})),a.addEventListener("touchcancel",(function(t){r(t),o.allClear()})),t.isMoveButton(s)?(a.addEventListener("touchmove",h._detectMovingMoveButton.bind(h)),a.addEventListener("touchend",h.allMoveClear.bind(h))):a.addEventListener("touchend",(function(t){r(t),o.clearTouchInfo(s)}))},h=this;for(var u in e)c(u);null!==s&&s.addEventListener("touchmove",this._detectMovingMoveButton.bind(this))}}return t.prototype._detectMovingMoveButton=function(t){t.preventDefault(),this.allMoveClear();var e=t.targetTouches.item(0);if(this._moveButtonsElement&&null!==e){var i=this._moveButtonsElement.getBoundingClientRect(),a=document.body.getBoundingClientRect(),s=i.left-a.left+i.width/2,r=i.top-a.top+i.height/2,n=e.pageX-s,o=e.pageY-r;n>=o?n<=-o?this.setTouchInfo("BUTTON_UP"):this.setTouchInfo("BUTTON_RIGHT"):n>=-o?this.setTouchInfo("BUTTON_DOWN"):this.setTouchInfo("BUTTON_LEFT")}},t.prototype._setVisible=function(t){null!==this._moveButtonsElement&&(this._moveButtonsElement.style.display=t?"grid":"none"),null!==this._buttonWrapperElement&&(this._buttonWrapperElement.style.display=t?"grid":"none"),this._visible=t},t.prototype.checkTouchButton=function(t){return!!this._enabled&&"TOUCH"===this.getButtonState(t)},t.prototype.checkTouchingButton=function(t){if(!this._enabled)return!1;var e=this.getButtonState(t);return"TOUCH"===e||"TOUCHING"===e},t.prototype.getButtonState=function(t){var e=this._isTouchingButtons[t];if(!this._enabled||void 0===e)return"NONE";var i=e.prev,a=e.current;return i&&a?"TOUCHING":a?"TOUCH":i?"LEAVE":"NONE"},t.prototype.setTouchInfo=function(t){var e=this._isTouchingButtons[t];this._enabled&&void 0!==e&&(e.next=!0)},t.prototype.clearTouchInfo=function(t){var e=this._isTouchingButtons[t];this._enabled&&void 0!==e&&(e.next=!1)},t.prototype.allMoveClear=function(){var t=this;lt.forEach((function(e){t._availableButtons.includes(e)&&t.clearTouchInfo(e)}))},t.prototype.allClear=function(){var t=this;this._availableButtons.forEach((function(e){if(void 0!==e){var i=t._isTouchingButtons[e];void 0!==i&&(i.next=!1)}}))},t.isMoveButton=function(t){return pt.has(t)},t.prototype.update=function(){var t=this;this._availableButtons.forEach((function(e){var i,a;if(void 0!==e){var s=t._isTouchingButtons[e];if(void 0!==s)switch(t._isTouchingButtons[e].prev=s.current,t._isTouchingButtons[e].current=s.next,t.getButtonState(e)){case"TOUCH":null===(i=t._onTouchStart)||void 0===i||i.call(t,e);break;case"LEAVE":null===(a=t._onTouchEnd)||void 0===a||a.call(t,e)}}}))},t.prototype.toggleVisible=function(){this._setVisible(!this._visible)},t}();function ft(){var t=document.querySelector("meta[name='viewport']"),e=window.innerWidth,i=window.innerHeight,a="user-scalable=no";if(e>i){var s=Math.floor(e/i*456);a="width=".concat(s,",").concat(a)}else e<=i&&(a="width=".concat(576,",").concat(a));null==t||t.setAttribute("content","".concat(a))}var Et,mt=function(t){return document.getElementById(t)},yt=function(t){return document.getElementsByTagName(t)},gt=function(t){return document.querySelector(t)},wt=function(t){return document.querySelector(t)},vt=function(t){return document.querySelectorAll(t)},St=function(t,e){var i,a,s=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return i=t-mt("wwa-wrapper").offsetLeft+s,a=e-mt("wwa-wrapper").offsetTop+r,new d(i,a)},At=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},Tt=function(t){var e="";if(t instanceof Array){for(var i=0;i<t.length;i++)e+=Tt(t[i])+"/";return e}return t+""},It=function(t){return t.split("").reverse().join("")},Ct=function(){function t(t,e,i){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:i}),this._isTransparent=i}return t.prototype.drawCanvas=function(t,e,i,a,s){this.ctx.drawImage(t,H.CHIP_SIZE*e,H.CHIP_SIZE*i,H.CHIP_SIZE,H.CHIP_SIZE,a,s,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,i,a){this._isTransparent?this.ctx.clearRect(t,e,i,a):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,i,a))},t}(),Ot=function(){function t(t,e,i,a){var s;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=a,this._load(),this._frameCoord=i.clone(),this.cpPartsLog=new d(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE);for(var t=1;t<H.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,H.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,H.CHIP_SIZE*t,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE);for(t=1;t<H.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,H.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,H.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var i,a=t.length;for(e=0;e<a;e++){var s=t[e];(i=this._effectCanvases[e])?i.clear():i=this._effectCanvases[e]=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<H.V_PARTS_NUM_IN_WINDOW;r++)for(var n=0;n<H.H_PARTS_NUM_IN_WINDOW;n++)i.drawCanvas(this._image,s.x,s.y,n*H.CHIP_SIZE,r*H.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE,0,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2),0,H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2),H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,i,a){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE,H.CHIP_SIZE,i,a,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,i,a,s,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE*i,H.CHIP_SIZE*a,s,r,H.CHIP_SIZE*i,H.CHIP_SIZE*a)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,i,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,a+H.CHIP_SIZE-s);r>=H.CHIP_SIZE||this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE,H.CHIP_SIZE-r,i,a,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var i=this;return function(a,s,r,n,o){if(!i._isLoaded)throw new Error("No image was loaded.");var c=Math.max(0,e(n,o));c>=H.CHIP_SIZE||t.ctx.drawImage(i._image,H.CHIP_SIZE*a,H.CHIP_SIZE*s+c,H.CHIP_SIZE,H.CHIP_SIZE-c,r,n+c,H.CHIP_SIZE,H.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,i,a,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+H.CHIP_SIZE-e}))(t,e,i,a,s)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,i,a,s){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,i,a,s)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,i,a,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+H.CHIP_SIZE-e}))(e,i,a,s,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,i,a,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,i,a,s,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,i,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s-a);r>=H.CHIP_SIZE||this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e+r,H.CHIP_SIZE,H.CHIP_SIZE-r,i,a+r,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,i,a){this._ctx.clearRect(t,e,i,a)},t.prototype.drawBase=function(t,e,i,a){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,i,a)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),Dt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=F[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(H.H_PARTS_NUM_IN_WINDOW-1),e*(H.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===H.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===H.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),Pt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Nt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),bt=function(t){function e(e){return t.call(this,e)||this}return Pt(e,t),e}(Nt);!function(t){function e(e){return t.call(this,e)||this}Pt(e,t)}(Nt);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(Et||(Et={}));var xt=function(t){function e(e,i,a,s,r,n,o){var c=t.call(this,i)||this;c.itemTransitioningClassName="item-transitioning",c.overwittenItemClassName="item-overwritten",c.overwittenItemSelector=".".concat(c.overwittenItemClassName),c.itemEffectStartTimers=new Array(H.ITEMBOX_SIZE),c._status=s,c._equipStatus=new l(0,0),c._itemBox=new Array(H.ITEMBOX_SIZE),c._itemBoxElement=new Array(H.ITEMBOX_SIZE),c._itemUsingEvent=new Array(H.ITEMBOX_SIZE);for(var h=0;h<c._itemBox.length;h++)c._itemBox[h]=0,c._itemBoxElement[h]=wt("#item"+h+">.item-disp");return c.updateItemBox(),c._energyMax=r,c._dir=u.DOWN,c._isMovingImage=!1,c._wwa=e,c._state=Et.CONTROLLABLE,c._camera=a,c._isPartsEventExecuted=!1,c._energyValueElement=wt("#disp-energy>.status-value-box"),c._strengthValueElement=wt("#disp-strength>.status-value-box"),c._defenceValueElement=wt("#disp-defence>.status-value-box"),c._goldValueElement=wt("#disp-gold>.status-value-box"),c._isReadyToUseItem=!1,c._isClickableItemGot=!1,c._moves=n,c._moveMacroWaitingRemainMoves=0,c._moveObjectAutoExecTimer=0,c.updateStatusValueBox(),c._partsAppeared=!1,c._afterMoveMacroFlag=!1,c._isPreparedForLookingAround=!0,c._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME,c._speedIndex=o,c._messageDelayFrameCount=0,c}return Pt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===Et.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=Et.CONTROLLABLE)}else if(this._state===Et.MOVING){try{var t=this._position.getNextFramePosition(this._dir,F[this._speedIndex],F[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=Et.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._wwa.callMoveUserDefineFunction()),this._position=t}},e.prototype.controll=function(t){var e,i;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,F[this._speedIndex],F[this._speedIndex]),i=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(i)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=Et.CAMERA_MOVING}catch(t){this._state=Et.CONTROLLABLE}return}if(!this.canMoveTo(i))return this._wwa.getMapTypeByPosition(i)===H.MAP_WALL&&this._wwa.checkMap(i.getPartsCoord()),void this._wwa.checkObject(i.getPartsCoord());this._position=e,this._state=Et.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),H.ATR_TYPE)!==H.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==H.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===H.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,H.ATR_MODE)===H.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===H.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,H.ATR_NUMBER)===H.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,H.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==Et.MOVING||this._state==Et.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==H.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==H.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==H.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==H.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===Et.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==H.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==H.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===Et.LOCALGATE_JUMPED||this._state===Et.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=Et.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===Et.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state!==Et.MESSAGE_WAITING&&this._state!==Et.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===Et.MESSAGE_WAITING?this._state=Et.CONTROLLABLE:this._state===Et.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=Et.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=Et.ESTIMATE_WINDOW_WAITING},e.prototype.isWaitingEstimateWindow=function(){return this._state===Et.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===Et.ESTIMATE_WINDOW_WAITING&&(this._state=Et.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=Et.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===Et.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===Et.PASSWORD_WINDOW_WAITING&&(this._state=Et.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===v.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===v.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==Et.LOCALGATE_JUMPED&&this._state!==Et.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===Et.LOCALGATE_JUMPED?Et.CONTROLLABLE:Et.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===Et.MESSAGE_WAITING?Et.LOCALGATE_JUMPED_WITH_MESSAGE:Et.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=H.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME),this._wwa.callJumpGateUserDefineFunction(),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=Et.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=H.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new l(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new l(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,i=function(i){var s=a._itemBoxElement[i],r=gt("#item"+i);if(0===a._itemBox[i])return s.style.backgroundPosition="-40px 0px",a.disposeItemEffect(i,a._itemBoxElement[i],r),"continue";var n=a._wwa.getObjectCropXById(a._itemBox[i]),o=a._wwa.getObjectCropYById(a._itemBox[i]);if(!t||i!==t.insertPos-1)return s.style.backgroundPosition="-"+n+"px -"+o+"px",a.disposeItemEffect(i,a._itemBoxElement[i],r),"continue";var c=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,h=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,u=-c*H.DEFAULT_FRAME_INTERVAL/H.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,_=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=_?t.itemBoxBackgroundImageCoord.x:a._wwa.getObjectCropXById(t.overwrittenObjectId),p=_?t.itemBoxBackgroundImageCoord.y:a._wwa.getObjectCropYById(t.overwrittenObjectId);s.style.left=c+"px",s.style.top=h+"px","number"==typeof a.itemEffectStartTimers[i]&&clearInterval(a.itemEffectStartTimers[i]),a.itemEffectStartTimers[i]=window.setTimeout((function(){e.itemEffectStartTimers[i]=void 0,e.startItemEffect(i,s,r,{target:{x:n,y:o},overwritten:{x:l,y:p}},u)}),H.DEFAULT_FRAME_INTERVAL)},a=this,s=0;s<this._itemBoxElement.length;s++)i(s)},e.prototype.startItemEffect=function(t,e,i,a,s){var r=this,n=i.querySelector(this.overwittenItemSelector);n&&i.removeChild(n);var o=document.createElement("div");o.classList.add(this.overwittenItemClassName),o.style.backgroundPosition="-"+a.overwritten.x+"px -"+a.overwritten.y+"px",o.style.backgroundImage=i.style.backgroundImage,i.appendChild(o),e.style.backgroundPosition="-"+a.target.x+"px -"+a.target.y+"px",e.style.transitionDuration=s+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",i.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,i)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,i){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",i.classList.contains(this.itemTransitioningClassName)&&i.classList.remove(this.itemTransitioningClassName);var a=i.querySelector(this.overwittenItemSelector);a&&i.removeChild(a)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,i,a){var s,r,n;void 0===e&&(e=0),void 0===i&&(i=!1);var o=this._wwa.getObjectAttributeById(t,H.ATR_NUMBER),c=0;if(0===e&&0!==o&&(e=o),0===e){if(0===t)return;if((s=this._getBlankItemPos())===H.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,-1),this._wwa.callGetItemFullUserDefineFunction(),new Error("これ以上、アイテムを持てません。");c=this._itemBox[s-1],this._forceSetItemBox(s,t)}else if(!1===i)if(s=e,n=this._itemBox[s-1],this._wwa.getObjectAttributeById(n,H.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,H.ATR_NUMBER)){if((r=this._getBlankItemPos())===H.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,-1),this._wwa.callGetItemFullUserDefineFunction(),new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,n),this._forceSetItemBox(s,t)}else c=this._itemBox[s-1],this._forceSetItemBox(s,t);else s=e,c=this._itemBox[s-1],this._forceSetItemBox(s,t);this._updateEquipmentStatus(),this.updateItemBox(a?{insertPos:s,itemScreenPixelCoord:a.screenPixelCoord,itemBoxBackgroundImageCoord:a.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new d(H.MAP_WINDOW_WIDTH+(s-1)%3*H.CHIP_SIZE,H.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*H.CHIP_SIZE),overwrittenObjectId:c}:void 0)},e.prototype._forceSetItemBox=function(t,e){var i=this,a=wt("#item"+(t-1)+">.item-click-border"),r=this._wwa.getObjectAttributeById(e,H.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(e,t),this._wwa.callGetItemUserDefineFunction(),0!==e&&r!==w.NORMAL){var n=this._wwa.resolveSystemMessage(s.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||("BLANK"!==n&&this._wwa.generatePageAndReserveExecution(n,!1,!0),this._isClickableItemGot=!0),a.style.display="block",function(t){i._itemUsingEvent[t-1]=function(){(i.isControllable()||i._wwa._messageWindow.isItemMenuChoice())&&(i._wwa._itemMenu.close(),i._wwa._setNextPage(),i._wwa.onselectitem(t))}}(t),a.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return H.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new l(0,0);for(t=0;t<H.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],H.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],H.ATR_DEFENCE));var i=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(i),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<H.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,H.ATR_MODE)!==w.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,H.ATR_MODE)!==w.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=mt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),H.DEFAULT_FRAME_INTERVAL),this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,this._readyToUseItemPos-1),this._wwa.callUseItemUserDefineFunction(),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==H.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],H.ATR_MODE)!==w.NORMAL&&((e=wt("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var i=0;i<H.ITEMBOX_SIZE;i++)if(this._itemBox[i]===t)return this._wwa.getObjectAttributeById(this._itemBox[i],H.ATR_MODE)!==w.NORMAL&&((e=wt("#item"+i+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[i]),e.style.display="none"),this._itemBox[i]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=H.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=H.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=Et.BATTLE},e.prototype.isFighting=function(){return this._state===Et.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===H.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===H.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>H.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(k.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=H.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(k.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,H.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new p(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(v.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(v.OBJECT,0,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,g.OBJECT,this._enemy.partsID),this._state=Et.CONTROLLABLE,this._wwa.generatePageAndReserveExecution(this._enemy.message,!1,!1,this._enemy.partsID,v.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess();var i=this._wwa.resolveSystemMessage(s.CANNOT_DAMAGE_MONSTER);"BLANK"!==i&&this._wwa.generatePageAndReserveExecution(i,!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=Et.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.shouldApplyGameOver({isCalledByMacro:!1})&&this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,H.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),g.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),i=this._camera.getPosition(),a=i.getPartsCoord(),s=i.getOffsetCoord(),r=(t.x-a.x)*H.CHIP_SIZE+e.x-s.x+H.CHIP_SIZE/2,n=(t.y-a.y)*H.CHIP_SIZE+e.y-s.y+H.CHIP_SIZE/2;return new d(r,n)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=H.CHIP_SIZE/F[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(H.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(H.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<H.MIN_SPEED_INDEX||H.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(bt),Mt=function(){function t(t,e,i,a,s,r,n){this._partsID=t,this._position=e,this._imgCoord=i,this._status=a,this._message=s,this._item=r,this._battleEndCallback=n}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),Lt=function(){function t(t,e,i,a,s){this._player=t,this._objectID=e,this._srcPos=i,this._destPos=a,this._dir=s,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,F[t],F[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),Rt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,i,a){this._queue.push(new Lt(this._player,t,e,i,a))},t.prototype.update=function(){for(var t=[],e=[],i=0;i<this._queue.length;i++)this._queue[i].update(),this._queue[i].isAchievedDestination?(t.push(this._queue[i]),this._wwa.setPartsOnPosition(v.OBJECT,0,this._queue[i].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(v.OBJECT,this._queue[i].objID,this._queue[i].destination.getPartsCoord())):e.push(this._queue[i]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}();function Bt(t,e,i){if(void 0===i&&(i=0),"boolean"==typeof t)return t;var a=Ut(t.left,e,i),s=Ut(t.right,e,i);return function(t,e,i){switch(t){case">":return e>i;case"<":return e<i;case">=":return e>=i;case"<=":return e<=i;case"==":return e===i;case"!=":return e!==i;default:return!1}}(t.operator,a,s)}function Ut(t,e,i){switch(void 0===i&&(i=0),t.type){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return e.userVars[t.index];case"MAP":return t.y<0||t.y>=e.map.length||t.x<0||t.x>=e.map[t.y].length?0:e.map[t.y][t.x];case"OBJECT":return t.y<0||t.y>=e.mapObject.length||t.x<0||t.x>=e.mapObject[t.y].length?0:e.mapObject[t.y][t.x];case"ITEM":return t.boxIndex1To12<1||t.boxIndex1To12>12?0:e.itemBox[t.boxIndex1To12-1];case"ITEM_COUNT_ALL":return e.itemBox.filter((function(t){return 0!==t})).length;case"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"X":return e.partsPosition.x;case"Y":return e.partsPosition.y;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"PDIR":return e.playerDirection;case"ID":return e.partsId;case"TYPE":return e.partsType;case"RAND":return Math.floor(Math.random()*Ut(t.argument,e));case"ITEM_COUNT":return e.itemBox.filter((function(i){return i===Ut(t.argument,e)})).length;default:return i}}function kt(t,e,i){switch(t){case"=":return i;case"+":case"+=":return e+i;case"-":case"-=":return e-i;case"*":case"*=":return e*i;case"/":case"/=":return 0===i?0:e/i;case"%":case"%=":return 0===i?0:e%i;default:throw new Error("未定義の演算子です")}}var Wt="-?\\d+",Vt="v\\[".concat(Wt,"\\]"),Ft="v\\[(".concat(Wt,")\\]"),Yt="m\\[".concat(Wt,"\\]\\[").concat(Wt,"\\]"),Gt="m\\[(".concat(Wt,")\\]\\[(").concat(Wt,")\\]"),Ht="o\\[".concat(Wt,"\\]\\[").concat(Wt,"\\]"),Kt="o\\[(".concat(Wt,")\\]\\[(").concat(Wt,")\\]"),jt="ITEM\\[".concat(Wt,"\\]"),Xt="ITEM\\[(".concat(Wt,")\\]"),Jt="".concat(Vt,"|").concat(Yt,"|").concat(Ht,"|").concat(jt),Zt="HP|HPMAX|AT|DF|GD|STEP|PDIR",qt="".concat(Jt,"|").concat(Yt,"|").concat(Ht,"|").concat(jt,"|").concat(Zt),Qt="".concat(Wt,"|").concat(Jt,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|X|Y|PX|PY|ID|TYPE|ITEM_COUNT_ALL","|").concat(Zt),zt="RAND\\((?:".concat(Qt,")\\)"),$t="RAND\\((".concat(Qt,")\\)"),te="ITEM_COUNT\\((?:".concat(Qt,")\\)"),ee="ITEM_COUNT\\((".concat(Qt,")\\)"),ie="".concat(zt,"|").concat(te),ae="".concat(Qt,"|").concat(ie),se="\\+|\\-|\\*|\\/|%",re="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ne="^\\(",oe="\\)$",ce=new RegExp("^".concat(Wt,"$")),he=new RegExp("^".concat(Ft,"$")),ue=new RegExp("^".concat(Gt,"$")),_e=new RegExp("^".concat(Kt,"$")),le=new RegExp("^".concat(Xt,"$")),pe=new RegExp("^".concat($t,"$")),de=new RegExp("".concat(ee,"$")),fe=new RegExp("".concat(ne,"(").concat(qt,")").concat("=","(").concat(ae,")(").concat(se,")(").concat(ae,")").concat(oe)),Ee=new RegExp("".concat(ne,"(").concat(qt,")(").concat(re,")(").concat(ae,")").concat(oe)),me=new RegExp("^(".concat(ae,")(?:(").concat(se,")(").concat(ae,"))?$")),ye=new RegExp("".concat(ne,"(").concat(ae,")(").concat(">|<|<=|>=|==|!=",")(").concat(ae,")").concat(oe));function ge(t){return"RAND"!==t.type&&"ITEM_COUNT"!==t.type}function we(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"X":case"Y":case"PX":case"PY":case"PDIR":case"ID":case"TYPE":case"ITEM_COUNT_ALL":return{type:t};default:var e=t.match(he);if(e)return null===(r=ve(e))?null:{type:"VARIABLE",index:r};var i=t.match(ue);if(i)return null===(a=Se(i))?null:{type:"MAP",x:a[0],y:a[1]};var a,s=t.match(_e);if(s)return null===(a=Se(s))?null:{type:"OBJECT",x:a[0],y:a[1]};var r,n=t.match(le);if(n)return null===(r=ve(n))?null:{type:"ITEM",boxIndex1To12:r};if(t.match(ce)){var o=parseInt(t,10);return null===o||isNaN(o)?null:{type:"NUMBER",rawValue:o}}var c=t.match(pe);if(c)return null!==(h=c.length>=2?we(c[1]):null)&&ge(h)?{type:"RAND",argument:h}:null;var h,u=t.match(de);return u&&(null!==(h=u.length>=2?we(u[1]):null)&&ge(h))?{type:"ITEM_COUNT",argument:h}:null}}function ve(t){var e=t.length>=2?Number(t[1]):null;return null===e||isNaN(e)?null:e}function Se(t){if(t.length<3)return null;var e=Number(t[1]),i=Number(t[2]);return isNaN(e)||isNaN(i)?null:[e,i]}function Ae(t,e){var i;switch(null===(i=we(e))||void 0===i?void 0:i.type){case"VARIABLE":var a=e.match(/^v\[(\d+)\]$/),s=Number(a[1]);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:"variable",index:s,rawValue:t};case"MAP":var r=e.match(/^m\[(\d+)\]\[(\d+)\]$/),n=Number(r[1]),o=Number(r[2]);if(null===n||null===o||isNaN(n)||isNaN(o))throw new Error("背景パーツの添字のパースに失敗しました");return{assignee:"map",x:n,y:o,rawValue:t};case"OBJECT":var c=e.match(/^o\[(\d+)\]\[(\d+)\]$/);n=Number(c[1]),o=Number(c[2]);if(null===n||null===o||isNaN(n)||isNaN(o))throw new Error("物体パーツの添字のパースに失敗しました");return{assignee:"mapObject",x:n,y:o,rawValue:t};case"ITEM":var h=e.match(/^ITEM\[(\d+)\]$/),u=Number(h[1]);if(null===u||isNaN(u))throw new Error("アイテムの添字のパースに失敗しました");return{assignee:"item",boxIndex1to12:u,rawValue:t};case"ITEM_COUNT_ALL":case"ITEM_COUNT":throw new Error("左辺値に所持アイテム数は入れられません");case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":return{assignee:"moveCount",rawValue:t};case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"X":throw new Error("左辺値にパーツX座標は入れられません");case"Y":throw new Error("左辺値にパーツY座標は入れられません");case"ID":throw new Error("左辺値にパーツ番号座標は入れられません");case"TYPE":throw new Error("左辺値にパーツ種別は入れられません");case"PDIR":return{assignee:"playerDirection",rawValue:t};case"RAND":throw new Error("左辺値に乱数は入れられません");default:throw new Error("この文字列から代入操作オブジェクトは生成できません")}}function Te(t){return t.replace(/\s/g,"")}function Ie(t,e,i){return void 0===i&&(i=0),Ut(we(t),e,i)}function Ce(t,e,i){void 0===i&&(i=0);var a=Te(t).match(me);if(null!==a){var s=Ie(a[1],e,i),r=a[3]?Ie(a[3],e,i):void 0,n=a[2];return n&&r?kt(n,s,r):s}throw new Error("マクロ引数のフォーマットを満たしていません: "+t)}function Oe(t){var e=Te(t).match(ye);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var i=we(e[1]),a=we(e[3]);if(i&&a)return{left:i,right:a,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var De=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Pe=function(t,e,i,a,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=i,this.isSystemMessage=a,this.scoreOptions=s,this.extraInfo=r},Ne=function(){},be=function(t){function e(e){void 0===e&&(e=[]);var i=t.call(this)||this;return i.branches=e,i}return De(e,t),e.prototype.appendBranch=function(t){this.branches.push(t)},e.prototype.getLastUnconnectedBranch=function(){for(var t=0,e=this.branches;t<e.length;t++){var i=e[t];if(!i.next)return i}},e.prototype.evaluateAndGetNextNode=function(t){for(var e=0,i=this.branches;e<i.length;e++){var a=i[e];if(!a.descriminant||Bt(a.descriminant,t()))return a.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(Ne),xe=function(t){function e(e,i,a){var s=t.call(this)||this;return s.macro=i,s.next=a,s.messageSegments=s.parseMessage(e),void 0===s.macro&&(s.macro=[]),s}return De(e,t),e.prototype.isEmpty=function(){return this.messageSegments.reduce((function(t,e){return t&&""===e}),!0)},e.prototype.generatePrintableMessage=function(){return this.messageSegments.reduce((function(t,e){var i="string"==typeof e?e:e();return"".concat(t).concat(i)}),"")},e.prototype.appendMessage=function(t,e){void 0===e&&(e=!1),this.messageSegments=this.messageSegments.concat(e?["\n"]:[],this.parseMessage(t))},e.prototype.parseMessage=function(t){return"string"==typeof t?[t]:t},e}(Ne);function Me(t){return void 0===t||(t instanceof be?t.branches.reduce((function(t,e){return t&&Me(e.next)}),!0):t instanceof xe?t.isEmpty()&&Me(t.next):void 0)}var Le=function(t){return t===L.SHOW_STR||t===L.SHOW_STR2||"text"===t||"normalMacro"===t},Re=function(){function t(t,e,i,a,s,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=i,this._triggerPartsPosition=a,this.macroType=s,this.macroArgs=r}return t.prototype.isJunction=function(){return[L.IF,L.ELSE_IF,L.ELSE,L.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case L.IMGPLAYER:return this._executeImgPlayerMacro(),{};case L.IMGYESNO:return this._executeImgYesNoMacro(),{};case L.HPMAX:return this._executeHPMaxMacro(),{};case L.SAVE:return this._executeSaveMacro(),{};case L.ITEM:return this._executeItemMacro(),{};case L.DEFAULT:return this._executeDefaultMacro(),{};case L.OLDMAP:return this._executeOldMapMacro(),{};case L.PARTS:return this._executePartsMacro(),{};case L.MOVE:return this._executeMoveMacro(),{};case L.MAP:return this._executeMapMacro(1),{};case L.DIRMAP:return this._executeDirMapMacro(),{};case L.IMGFRAME:return this._executeImgFrameMacro(),{};case L.IMGBOM:return this._executeImgBomMacro(),{};case L.DELPLAYER:return this._executeDelPlayerMacro(),{};case L.FACE:return this._executeFaceMacro(),{};case L.EFFECT:return this._executeEffectMacro(),{};case L.GAMEOVER:return this._executeGameOverMacro(),{};case L.IMGCLICK:return this._executeImgClickMacro(),{};case L.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case L.EFFITEM:return this._executeEffItemMacro(),{};case L.COLOR:return this._executeColorMacro(),{};case L.WAIT:return this._executeWaitMacro(),{};case L.SOUND:return this._executeSoundMacro(),{};case L.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case L.OLDMOVE:return this._executeOldMoveMacro(),{};case L.JUMPGATE:return this._executeJumpGateMacro(),{};case L.RECPOSITION:return this._executeRecPositionMacro(),{};case L.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case L.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case L.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case L.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case L.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case L.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case L.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case L.SET_AT:return this._executeSetAtMacro(),{};case L.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case L.SET_DF:return this._executeSetDfMacro(),{};case L.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case L.SET_MONEY:return this._executeSetMoneyMacro(),{};case L.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case L.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case L.VAR_SET:return this._executeVarSetMacro(),{};case L.VAR_ADD:return this._executeVarAddMacro(),{};case L.VAR_SUB:return this._executeVarSubMacro(),{};case L.VAR_MUL:return this._executeVarMulMacro(),{};case L.VAR_DIV:return this._executeVarDivMacro(),{};case L.VAR_MOD:return this._executeVarModMacro(),{};case L.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case L.GAME_SPEED:return this._executeGameSpeedMacro(),{};case L.SHOW_STR:case L.SHOW_STR2:case L.IF:return{};case L.LEGACY_IF:return this._executeLegacyIfMacro(),{};case L.ELSE_IF:case L.ELSE:case L.END_IF:return{};case L.SET_SPEED:return this._executeSetSpeedMacro(),{};case L.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case L.HIDE_STATUS:return this._executeHideStatusMacro(),{};case L.VAR_MAP:return this._executeVarMapMacro(),{};case L.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case L.SET:return{isGameOver:this._executeSetMacro().isGameOver};case L.MAP2:return this._executeMapMacro(2),{};case L.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case L.DELAYBGM:return this._executeDelayBgmMacro(),{};case L.SYSMSG:return this._executeSysMsgMacro(),{};default:return console.log("不明なマクロIDが実行されました:"+this.macroType),{}}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),i=0;i<e.length;i++)e[i]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._evaluateIntValue=function(t,e){void 0===e&&(e=0);var i=this.macroArgs[t];if(""===i)return e;var a=Number(i),s=a>=0?Math.floor(a):Math.ceil(a);return isNaN(s)?Ce(i,this._wwa.generateTokenValues({id:this._triggerPartsID,type:this._triggerPartsType,position:this._triggerPartsPosition}),e):s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(t){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);switch(t){case 1:return void this._wwa.outputUserVar(e);case 2:return void console.log("".concat(this.macroArgs[0]," = ").concat(e))}},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(t,e,i)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(t)},t.prototype._executeLegacyIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=0!==this._evaluateIntValue(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this.macroArgs[1],i=this.macroArgs[2],a=this._evaluateIntValue(3,v.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,i,t,a)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new d(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new d(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,v.OBJECT),a=this._evaluateIntValue(3);if(i!==v.OBJECT&&i!==v.MAP)throw new Error("パーツ種別が不明です");if(0!==a&&1!==a&&(a=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,i,!!a)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(t){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),i=this._evaluateIntValue(3,v.OBJECT);if(e<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");if(1===t){var a=this.macroArgs[1],s=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerPartsPosition,a,s,e,i)}else if(2===t){var r=this._evaluateIntValue(1),n=this._evaluateIntValue(2);if(isNaN(r)||isNaN(n))throw new Error("出現先座標が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,"".concat(r),"".concat(n),e,i)}},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,v.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,i)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2);if(e<0||i<0)throw new Error("座標は正でなければなりません。");if(t===U.ENERGY||t===U.STRENGTH||t===U.DEFENCE||t===U.GOLD)this._wwa.setStatusIconCoord(t,new d(e,i));else if(t===U.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new d(e,i));else if(t===U.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:i});else{if(t!==U.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new d(e,i))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new d(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._evaluateIntValue(0),i=this._evaluateIntValue(1),a=this._evaluateIntValue(2),s=this._evaluateIntValue(3),r=this._evaluateIntValue(4),n=this._evaluateIntValue(5);if(e<0||i<0||a<0||s<0||r<0||n<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new E(new d(e,i),new d(a,s),new d(r,n)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],i=1;i<this.macroArgs.length;i+=2){var a,s=this._evaluateIntValue(i);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(i+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((a=this._evaluateIntValue(i+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new d(s,a))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new d(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new d(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");return this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2),a=this._evaluateIntValue(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||i<0||i>255||a<0||a>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,i,a)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(2);var t=parseInt(this.macroArgs[0]),e=parseInt(this.macroArgs[1]);this._wwa.playSound(t,e)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>H.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:{position:this._triggerPartsPosition,id:this._triggerPartsID,type:this._triggerPartsType}})},t.prototype._executeDelayBgmMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setBgmDelay(t)},t.prototype._executeSysMsgMacro=function(){this._concatEmptyArgs(2);var t=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!t)throw new Error("該当するシステムメッセージの定義がありません");var e=""===this.macroArgs[1]?void 0:this.macroArgs[1].replaceAll("\\n","\n");this._wwa.overwriteSystemMessage(t,e)},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return n(t)?t:o(this._evaluateIntValue(0))},t}();var Be,Ue=function(){function t(t,e,i,a,s,r,n){this._wwa=t,this._coord=e,this._width=i,this._height=a,this._isVisible=s,this._parentElement=r,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=n+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),ke=function(t){function e(e,i,a,s,r,n,o){var c=t.call(this,e,new d(i.x,i.y),a,s,r,n,201)||this;return c._cgFileName=o,c._monsterBox=document.createElement("div"),c._monsterBox.style.width=H.CHIP_SIZE+"px",c._monsterBox.style.height=H.CHIP_SIZE+"px",c._monsterBox.style.position="absolute",c._monsterBox.style.left="10px",c._monsterBox.style.top="10px",c._monsterBox.style.backgroundImage="url("+c._cgFileName.replace("(","\\(").replace(")","\\)")+")",c._monsterBox.style.backgroundPosition="0 0",c._element.appendChild(c._monsterBox),c._energyBox=document.createElement("div"),c._energyBox.style.position="absolute",c._energyBox.style.left="80px",c._energyBox.style.top="10px",c._energyBox.textContent="生命力 0",c._element.appendChild(c._energyBox),c._strengthBox=document.createElement("div"),c._strengthBox.style.position="absolute",c._strengthBox.style.left="80px",c._strengthBox.style.top="30px",c._strengthBox.textContent="攻撃力 0",c._element.appendChild(c._strengthBox),c._defenceBox=document.createElement("div"),c._defenceBox.style.position="absolute",c._defenceBox.style.left="180px",c._defenceBox.style.top="30px",c._defenceBox.textContent="防御力 0",c._element.appendChild(c._defenceBox),c._isVisible?c._element.style.display="block":c._element.style.display="none",c}return De(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Ue),We=function(t){function e(e,i,a,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new d(2*H.CHIP_SIZE,30),7*H.CHIP_SIZE,40,a,s,202)||this)._element.style.borderWidth="0",r._element.style.borderRadius="4px",r._element.style.fontSize="20px",r._element.style.lineHeight="40px"):r=t.call(this,e,new d(i.x,i.y),340,30,a,s,202)||this,r._element.style.textAlign="center",r._isVisible?r._element.style.display="block":r._element.style.display="none",r.update(0),r}return De(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Ue);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Be||(Be={}));var Ve=function(){function t(t,e,i,a,s,r,n,o,c,h){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var u=this,_=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=i,this._width=a,this._height=s,this._message="",this._isVisible=n,this._isYesno=o,this._isItemMenu=c,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=h,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+_+")",this._divYesElement.onclick=function(){u._isInputDisable||(t.setYesNoInput(y.YES),u.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+_+")",this._divNoElement.onclick=function(){u._isInputDisable||(t.setYesNoInput(y.NO),u.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),u._isInputDisable=!1,t.userDevice.device){case I.SP:case I.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,i,a){this._x=t,this._y=e,this._width=i,this._height=a,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,i,a,s){var r,n=a.getPartsCoord().substract(s.getPartsCoord()).y;r=t?Be.BOTTOM:e?Be.SCORE:i?Be.CENTER:n>=Math.ceil(H.V_PARTS_NUM_IN_WINDOW/2)?Be.TOP:Be.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Be.CENTER?(this._y=H.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Be.TOP?(this._y=Math.max(20,H.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Be.BOTTOM?(this._y=Math.min(H.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*H.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Be.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setMessage=function(t){this._message=t,this.update()},t.prototype.clear=function(){this._message="",this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),i=0,a="",s=0;s<t.length||0!=i;s++)if(this.isWideChar(t.charAt(s))?i+=2:i+=1,a+=t.charAt(s),i+1>2*H.MSG_STR_WIDTH){"。"!==t.charAt(s+1)&&"、"!==t.charAt(s+1)||(a+=t.charAt(s+1),s++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=a,e.appendChild(r),i=0,a=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===y.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YESP_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NO_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"):this._wwa.getYesNoState()===y.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YES_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NOP_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YES_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NO_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var i=this._message.split("\n");i.forEach((function(e,a){var s;t._wwa.isClassicMode()?s=t.createClassicTextElement(e):(s=document.createElement("span")).textContent=i[a],t._msgWrapperElement.appendChild(s),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,i,a,s,r,n,o,c,h,u,_=this;e=document.createElement("div"),h=(o=document.getElementById("disp-energy")).style.backgroundPosition,u=o.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(i=document.createElement("div")).classList.add("savedata"),i.setAttribute("save_id",p),i.addEventListener("click",(function(t){_.setSaveID(0|t.currentTarget.getAttribute("save_id")),_._save_close=!0,t.preventDefault()})),(a=document.createElement("div")).classList.add("ss"),i.appendChild(a),(s=document.createElement("div")).classList.add("wide-cell-row"),s.style.backgroundPosition=h,s.style.backgroundImage=u,i.appendChild(s),e.appendChild(i),t.flag&&(a.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=K.DATE_LAST_SAVE_TEXT_COLOR),a.appendChild(r),(n=document.createElement("div")).classList.add("status-icon"),n.style.backgroundImage=u,n.style.backgroundPosition="-120px -80px",s.appendChild(n),(c=document.createElement("div")).classList.add("status-value-box"),c.textContent=t.getStatusEnergy(),s.appendChild(c));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,i=document.querySelectorAll(".savedata"),a=i.length,s=0;s<a;s++)e=i[s],t===s?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=H.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+K.QUICK_SAVE_MAX)%K.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Fe=function(){function t(t,e,i){this.id=t,this.imgFileName=e,this.parent=i,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,i){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,i.isNoEffect?this.damageDispElem.textContent="攻撃無効":i.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+i.damage},t}(),Ye=function(){function t(t,e,i){var a,s=this;this._wwa=t,this._imgFileName=e,this._parent=i,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<H.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)a=new Fe(r,this._imgFileName,this._element),this._edes.push(a),this._element.appendChild(a.elem);this._element.addEventListener("click",(function(){s._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var i=0;i<H.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;i++)if(i>=e.length)this._edes[i].hide();else{var a=this._wwa.getObjectAttributeById(e[i],H.ATR_X),s=this._wwa.getObjectAttributeById(e[i],H.ATR_Y),r=new d(a,s),n=this._wwa.getObjectAttributeById(e[i],H.ATR_ENERGY),o=this._wwa.getObjectAttributeById(e[i],H.ATR_STRENGTH),c=this._wwa.getObjectAttributeById(e[i],H.ATR_DEFENCE),h=new p(n,o,c,0),u=He(t,h);this._edes[i].setResult(r,h,u),this._edes[i].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Ge=function(t,e,i){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=i};function He(t,e){var i=e.energy,a=t.strength-e.defence,s=Math.max(0,e.strength-t.defence),r=0,n=0;if(!(a>0))return new Ge(!0,!1,0);for(;;){if(r++,(i-=a)<=0)return new Ge(!1,!1,n);if(n+=s,r>1e4)return new Ge(!1,!0,0)}}var Ke,je=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Xe=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Ke||(Ke={}));var Je=function(){function t(t,e,i){var a=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=i,this.COPIED_MESSAGE_DISPLAY_MS=1e3,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){a._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return je(a,void 0,void 0,(function(){var t=this;return Xe(this,(function(e){switch(e.label){case 0:return[4,navigator.clipboard.writeText(this.password)];case 1:return e.sent(),this._copyButtonElement.textContent="コピーしました",this._copyButtonElement.disabled=!0,setTimeout((function(){t._copyButtonElement&&(t._copyButtonElement.textContent="コピー",t._copyButtonElement.disabled=!1)}),this.COPIED_MESSAGE_DISPLAY_MS),[2]}}))}))})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=Ke.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Ke.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Ke.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline",this._copyButtonElement.style.display="none"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none",this._copyButtonElement.style.display="inline";var i=e.split("\n");this._descriptionElement.textContent="";for(var a=0;a<i.length;a++){var s=document.createElement("span");s.textContent=i[a],this._descriptionElement.appendChild(s),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function Ze(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function qe(t,e,i){var a=document.createElement("style");a.type="text/css",a.setAttribute("id",H.WWA_STYLE_TAG_ID),yt("head")[0].appendChild(a),t.innerHTML=function(t,e){var i=t?'\n <div id="wwa-cover">\n <div id="unstable-version-warning"></div>\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(H.SCREEN_WIDTH,'" height="').concat(H.SCREEN_HEIGHT,'"></canvas>\n </div>'),a=e?'\n <div id="wwa-virtualpad-left">\n <button class="wwa-virtualpad__button" id="wwa-up-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-left-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-right-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-down-button"></button>\n <div class="wwa-virtualpad__hole"></div>\n </div>\n <div id="wwa-virtualpad-right">\n <button class="wwa-virtualpad__button" id="wwa-slow-button">I</button>\n <button class="wwa-virtualpad__button" id="wwa-fast-button">P</button>\n <button class="wwa-virtualpad__button" id="wwa-enter-button">Y</button>\n <button class="wwa-virtualpad__button" id="wwa-esc-button">N</button>\n </div>':"";return'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(i,"\n").concat(a,"\n")}(null!==e,i),null!==e&&(mt("wwa-cover").style.backgroundImage="url(".concat(e,")"),mt("wwa-cover").style.backgroundRepeat="no-repeat",mt("wwa-cover").style.backgroundPosition="0 0")}var Qe=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=H.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=wt(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var i=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(i)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,i,a=null;for(e=0;e<t.COL_MAX;e++)for(i=0;i<t.ROW_MAX;i++)(a=mt(t.DOM_ID_TABLE[i][e])).classList.contains("onpress")&&a.classList.remove("onpress")},t.prototype.openView=function(){this.close();mt(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),ze=i(23);function $e(t){return"^ /".concat(231*t+8310,"P+>A[]")}function ti(t){return(0,ze.MD5)(t).toString()}var ei="map",ii="mapObject",ai="systemMessage",si="userVar",ri={mapAttribute:!0,objectAttribute:!0,message:!0},ni=function(){},oi=function(){function t(){}return t.compress=function(t){var e,i,a={};for(e in t)if(!ri[e]){switch(typeof(i=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===i&&"worldName"!==e)continue;break;case"object":if(null===i){if(this._restartData[e]===i)continue}else if(void 0===(i=this.compressObject(e,i,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}a[e]=i}return a},t.compressObject=function(t,e,i){var a,s,r,n;switch(t){case ei:case ii:var o,c,h,u,_,l,p,d,f,E,m,y,g,w;for(_ in a={},f={},d={},e)for(u in s=e[_],r=i[_],n={},c=-1,s)(p=s[u])!==r[u]&&(n[u]=p,void 0===f[p]&&(f[p]={}),void 0===(m=f[p])[_]&&(m[_]=[]),(g=m[_]).push(Number(u)));for(y in f)for(_ in m=f[y],void 0===d[y]&&(d[y]={}),E=d[y],void 0===a[y]&&(a[y]=[]),c=-1,m)1===(g=m[_]).length?(void 0===E[l=g[0]]&&(E[l]=[]),(w=E[l]).push(Number(_))):(h=(o=Number(_))-c-1,c=o,a[y].push(this.getCompressArray(g),h));for(y in d)for(u in p=Number(y),c=-1,E=d[y])w=E[u],h=(o=Number(u))-c-1,c=o,1===w.length?a[y].push(h,w[0]):a[y].push(h,this.getCompressArray(w));var v=[];for(y in c=-1,a)h=(o=Number(y))-c-1,c=o,v.push(h,a[y]);return this._usingByteFlag&&JSON.stringify(v).length>=this._mapByteLength?this.compressMapAllObject(e,i,this._firstRandomMapObjectUtf8Table[t]):v;case ai:var S;for(t in a={},e)S=e[t],i[t]!==S&&(a[t]=S);break;case si:return this.compressUserVars(e);default:return e}if(0!==Object.keys(a).length)return a},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,i){var a,s,r,n,o,c,h,u,_,l,p,d,f,E,m,y,g=this._restartData.mapWidth,w=new Uint8Array(this._mapByteLength),v=-1;for(r=0,n=0,c=0,h=0,m=0,p=[],E={},_=[],l=[],s=0;s<g;s++)for(a=0;a<g;a++)(u=t[s][a])!==e[s][a]&&(-1===v&&(v=n),w[n]=w[n]|1<<r,c=n,void 0===E[u]&&(E[u]=new ci(u,m++)),E[u].count++),8===++r&&(r=0,n++);for(o in E)p[E[o].index]=E[o];for(d in p.sort(this.idSort),f={},p)f[u=p[d].id]=Number(d),_[d]=u;for(s=0;s<g;s++)for(a=0;a<g;a++)(u=t[s][a])!==e[s][a]&&(l[h++]=f[u]);if(i){for(y=w.length,v=-1,c=0,n=0;n<y;n++)w[n]=w[n]&~i[n],0!==w[n]&&(-1===v&&(v=n),c=n);-1===v&&(v=0,c=0)}return[v,w.subarray(v,c+1),_,this.indexListCompress(l,_.length)]},t.indexListCompress=function(t,e){var i,a,s,r,n,o,c=[];for(r=t.length,a=0,i=0;i<r;i++){for(n=t[i],o=0,s=i+1;s<r&&n===t[s];s++)o++,i=s;switch(o){case 0:c[a++]=n;break;case 1:c[a++]=n,c[a++]=n;break;default:c[a++]=n,c[a++]=e+o}}return c},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,i,a,s,r,n,o,c,h=[];for(e=-1,r=t.length,n=0,s=0;s<r;s++){for(i=(a=t[s])-e,o=0,c=s;c<r-1&&t[c]+1===t[c+1];)c++,o++;o<this.MIN_LOOP_COUNT?h[n++]=i:(s=c,a+=o,h[n++]=0,h[n++]=i,h[n++]=o-this.MIN_LOOP_COUNT),e=a}return h},t.getDecompressArray=function(t){var e,i,a,s,r,n,o,c=[];for(e=-1,r=t.length,s=0,o=0;s<r;s++)if(0===(i=t[s])){for(n=(a=e+(i=t[++s]))+t[++s]+this.MIN_LOOP_COUNT;a<=n;a++)c[o++]=a;e=n}else a=e+i,c[o++]=a,e=a;return c},t.decompress=function(t){var e,i,a;for(i in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(a=t[i])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==a&&(a=this.decompressObject(i,a,e[i]));break;case"function":continue}e[i]=a}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,i){var a;switch(t){case ei:case ii:var s,r,n,o,c,h,u,_;a={},r=-1;var l,p,d=e;if(4===(_=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,i,this._firstRandomMapObjectUtf8Table[t]),i;for(u=0;u<_;u+=2)r=s=r+Number(d[u])+1,c=s,a[s]=d[u+1];for(h in a){for(c=Number(h),_=(d=a[h]).length,l=[],p=[],u=0;u<_;u+=2){var f=d[u],E=d[u+1];f instanceof Array&&(f=this.getDecompressArray(f)),E instanceof Array&&(E=this.getDecompressArray(E)),"object"==typeof f?l.push({x:f,y:E}):p.push({x:f,y:E})}var m;for(m in r=-1,l)if(r=s=r+Number(l[m].y)+1,f=l[m].x,o=String(s),f instanceof Array)for(_=(d=f).length,u=0;u<_;u++)n=String(d[u]),i[o][n]=c;else n=String(f),i[o][n]=c;for(m in r=-1,p)if(r=s=r+Number(p[m].x)+1,E=p[m].y,n=String(s),E instanceof Array)for(_=(d=E).length,u=0;u<_;u++)i[o=String(d[u])][n]=c;else i[o=String(E)][n]=c}return i;case si:return this.decompressUserVars(e);default:if(i);else{if(!e)return;i=i instanceof Array?[]:{}}for(t in e)i[t]=e[t];return i}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var i=e[0],a=e[1];return t[i]=a,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(H.USER_VAR_NUM),e=0;e<H.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,i){var a,s,r,n,o,c,h,u,_,l,p,d=this._restartData.mapWidth,f=new Uint8Array(this._mapByteLength);p=t[0],n=t[2],s=t[3];var E=t[1];if(f.set(E,p),i)for(m=f.length,_=0;_<m;_++)f[_]=f[_]|i[_];r=[];var m,y,g,w,v,S,A=n.length;for(m=s.length,y=0,g=0;y<m;y++){if((o=s[y])>=A)for(w=o-A,v=0;v<w;v++)r[g++]=S;else r[g++]=o;S=o}for(u=0,_=0,l=0,c=0,m=f.length,_=0;_<m;_++)for(u=0;u<8;u++){if(0!=(f[_]&1<<u)){if(void 0===(o=r[c++]))return!1;a=n[o],h=l%d,e[l/d|0][h]=a}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[ii]=this.getChangedUint8Array(e[ii],t[ii])},t.getChangedUint8Array=function(t,e){var i,a,s,r,n=this._restartData.mapWidth,o=new Uint8Array(this._mapByteLength),c=-1;for(s=0,r=0,a=0;a<n;a++)for(i=0;i<n;i++)t[a][i]!==e[a][i]&&(-1===c&&(c=r),o[r]=o[r]|1<<s),8===++s&&(s=0,r++);return o},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var i;if(e)try{if(i=this.decompress(e)[0])return i}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new ni,t}(),ci=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},hi=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=K.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=K.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){mt("cell-load").textContent=j.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,i){var a=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=i,this.flag=!0;var s=document.createElement("img");s.src=t,s.addEventListener("load",(function(){a.flag=!0,a.ctx.drawImage(s,0,0,s.width,s.height,0,0,a.cvs.width,a.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,i,a,s,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,i=this.date.getDate(),a=this.date.getHours(),s=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(i=("0"+i).slice(-2))+" "+(a=("0"+a).slice(-2))+":"+(s=("0"+s).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),ui=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),_i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ui(e,t),e.prototype.save=function(e,i){var a=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,i,this.date),a},e}(hi),li=_i,pi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),di=function(t){function e(){var i=t.call(this)||this;return Object.setPrototypeOf(i,Object.create(e.prototype)),i}return pi(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<K.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,i=0;i<K.QUICK_SAVE_MAX;i++)(e=this[i]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),fi=function(){return fi=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},fi.apply(this,arguments)},Ei=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?fi(fi({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?fi(fi({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},mi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),yi=function(t){function e(i,a,s){void 0===s&&(s=e.prototype);var r=t.call(this)||this;r.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},r.keyPath=["id","url"],Object.setPrototypeOf(r,Object.create(s));for(var n=0;n<K.QUICK_SAVE_MAX;n++)r[n]=new li(n,r);return r.onCheckLoadingSaveData=i,r.onCompleteLoadingSaveData=a,r.createDataBase(),r.selectSaveData(),r}return mi(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(K.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var i=this.indexDBOpen();i.onupgradeneeded=function(e){var a=i.result,s={keyPath:t.keyPath};a.objectStoreNames.contains(K.INDEXEDDB_TABLE_NAME)||a.createObjectStore(K.INDEXEDDB_TABLE_NAME,s).createIndex("url","url",{unique:!1})},i.onsuccess=e.doNotAnything,i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var i=e.transaction(K.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(K.INDEXEDDB_TABLE_NAME)}catch(t){return}return i},e.prototype.makeSaveDataItem=function(t,e,i,a){return{url:location.href,id:t,hash:Di.checkOriginalMapString,image:e.toDataURL(),data:i,date:a,worldName:Di.worldName,mapDataRevisionKey:Di.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var i=t.index("url"),a=IDBKeyRange.only(location.href),s=i.getAll(a);s.onsuccess=function(){e(s.result)}},e.prototype.dbUpdateSaveData=function(t,i,a,s){var r=this,n=this.indexDBOpen();n.onupgradeneeded=e.doNotAnything,n.onsuccess=function(){var o=r.getObjectStore(n.result),c=oi.compress(a),h=r.makeSaveDataItem(t,i,c,s);r.selectDatas[t]=h;var u=o.put(h);u.onsuccess=e.doNotAnything,u.onerror=e.doNotAnything},n.onerror=e.doNotAnything,n.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var i=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=i.getObjectStore(a.result);t.forEach((function(t){e.delete([t,location.href])}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,i=this.indexDBOpen();i.onupgradeneeded=e.doNotAnything,i.onsuccess=function(){var e=t.getObjectStore(i.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var i,a,s,r=[];for(a=e.length,i=0;i<a;i++){var n=e[i];try{s={id:n.id,hash:n.hash,data:n.data,date:n.date,image:n.image,worldName:n.worldName,mapDataRevisionKey:n.mapDataRevisionKey}}catch(t){continue}var o=t.onCheckLoadingSaveData(s.worldName,s.hash,s.mapDataRevisionKey);if(null===o){if(t[s.id]){var c=Ei(oi.decompress(s.data)[0]);t[s.id].saveDataSet(s.image,c,s.date)}}else r.push({id:s.id,cause:o})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var h=r.map((function(t){return t.cause})).filter((function(t,e,i){return i.indexOf(t)===e}));t.onCompleteLoadingSaveData(h)}))},i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(di),gi=yi,wi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),vi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wi(e,t),e}(hi),Si=vi,Ai=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Ti=function(t){function e(){var i=t.call(this)||this;i._saveNo=0,i._lastAutoSaveMove=0,i._autoInterval=K.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(i,Object.create(e.prototype));for(var a=0;a<K.QUICK_SAVE_MAX;a++)i[a]=new Si(a,i);return i._saveNo=0,i._lastAutoSaveMove=0,i}return Ai(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%K.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(di);function Ii(t,e){return(0,ze.MD5)(t+e).toString()}var Ci,Oi=function(){function t(e,i,a,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=i,t.mapDataRevisionKey=Ii(i,a),this._wwaDBSaveList=new gi(s,r),this._wwaLogSaveList=new Ti,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,i){var a=this.list[i];return!!a&&a.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?O.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?O.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?O.CALL_BY_LOG_QUICK_LOAD:O.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?O.CALL_BY_LOG_QUICK_LOAD:t?O.CALL_BY_PASSWORD_LOAD:O.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?mt("cell-save").textContent=j.EMPTY_SAVE:mt("cell-save").textContent=j.QUICK_SAVE},t}(),Di=Oi;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(Ci||(Ci={}));var Pi,Ni=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},bi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},xi=function(){function t(t,e,i,a){var s=this;this.id=t,this.fileName=e,this.audioContext=i,this.audioGain=a,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(s.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=i,this.audioGain=a,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.delayBgmTimeoutId=null,this.load()}return t.prototype.fetchSoundFile=function(){return Ni(this,void 0,void 0,(function(){return bi(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,fetch(this.fileName)];case 1:return[2,t.sent()];case 2:return t.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (fetch)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.getArrayBuffer=function(t){return Ni(this,void 0,void 0,(function(){return bi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t.arrayBuffer()];case 1:return[2,e.sent()];case 2:return e.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (arrayBuffer)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.load=function(t){return void 0===t&&(t=0),Ni(this,void 0,void 0,(function(){var e,i,a=this;return bi(this,(function(s){switch(s.label){case 0:return t>=10?(console.log("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (最大リトライ回数超過)")),this.isExceededMaxRetryCount=!0,[2]):[4,this.fetchSoundFile()];case 1:return(e=s.sent())?0!==e.status&&200!==e.status?(console.warn("サウンド ".concat(this.id," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(e.status)),this.cancelLoad(),[2]):[4,this.getArrayBuffer(e)]:(this.retry(t),[2]);case 2:return(i=s.sent())?(this.audioContext.decodeAudioData(i,(function(e){if(0===e.length)return console.log("サウンド ".concat(a.id," 番の音声ファイルのバッファサイズが 0 です ")),void a.retry(t);a.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;window.setTimeout((function(){return Ni(e,void 0,void 0,(function(){return bi(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(t){var e=this;void 0===t&&(t=0);var i=this.audioContext.createBufferSource();this.bufferSources.push(i),i.buffer=this.audioBuffer,this.isBgm()&&(i.loop=!0),i.connect(this.audioGain);var a=i.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),i.onended=function(){var t=e.bufferSources.indexOf(i);-1!==t&&e.bufferSources.splice(t,1),e.disposeBufferSource(i)},this.delayBgmTimeoutId=window.setTimeout((function(){e.delayBgmTimeoutId=null,i.start()}),t),this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){null!==this.delayBgmTimeoutId&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=k.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isPlaying=function(){return this.hasData()||null!==this.delayBgmTimeoutId},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),Mi=function(t,e){for(var i=new Array(t),a=0;a<i.length;a++)i[a]=new Array(e);return i},Li=function(t){return(t%=256)>=128?t-256:t};function Ri(t,e){var i=function(t){return t[Pi.CHECK]+256*t[Pi.CHECK+1]}(t),a=function(t,e){var i=0;if(t[Pi.VERSION]>=29){for(var a=2;a<e;a++)i+=Li(t[a])*(a%8+1);i=i%65536&65535}return i}(t,e);if(i!==a)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+i+"ですが、実際の和は"+a+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(Pi||(Pi={}));var Bi,Ui,ki=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(Bi||(Bi={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(Ui||(Ui={}));var Wi=function(){function t(t,e,i){this.byteMapData=t,this.eventEmitter=i,Ri(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default",bgmDelayDurationMs:void 0,customSystemMessages:{}}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Pi.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Pi.MAPDATA_TOP:this.currentPosition=Pi.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Bi.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Bi.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?ki.MAP_ATR_MAX:ki.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?ki.OBJ_ATR_MAX:ki.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Bi.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Bi.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Bi.MAP),this._convertAttributeV2toV3(Bi.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,i,a;if(t==Bi.MAP)e=this.wwaData.mapPartsMax,i=this.wwaData.mapAttribute,a=ki.MAP_LOCALGATE;else{if(t!=Bi.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,i=this.wwaData.objectAttribute,a=ki.OBJECT_LOCALGATE}for(var s=0;s<e;s++){for(var r=9;r>=0;r--){var n=255&i[s][20+2*r],o=i[s][20+2*r]>>8,c=255&i[s][20+2*r+1],h=i[s][20+2*r+1]>>8;250===c?c=9e3:c>100&&(c+=9840),250===h?h=9e3:h>100&&(h+=9840),i[s][20+4*r]=n,i[s][20+4*r+3]=o,i[s][20+4*r+1]=c,i[s][20+4*r+2]=h}i[s][ki.ATR_TYPE]===a&&(i[s][ki.ATR_JUMP_X]>100&&(i[s][ki.ATR_JUMP_X]+=9840),i[s][ki.ATR_JUMP_Y]>100&&(i[s][ki.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(Pi.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Pi.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Pi.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Pi.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Pi.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Pi.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Pi.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Pi.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Pi.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Pi.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Pi.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Pi.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Pi.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Pi.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Pi.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Pi.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Pi.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Pi.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Pi.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?Pi.ITEMBOX_TOP:Pi.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(ki.ITEMBOX_SIZE);for(var e=0;e<ki.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var i,a,s;for(s=Mi(this.wwaData.mapWidth,this.wwaData.mapWidth),i=0;i<this.wwaData.mapWidth;i++)for(a=0;a<this.wwaData.mapWidth;a++)this.wwaData.version>29?(s[i][a]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(s[i][a]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(i*this.wwaData.mapWidth+a)%200==0&&this.emitProgress(i*this.wwaData.mapWidth+a,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Bi.MAP?Ui.MAP_LOAD:Ui.OBJ_LOAD),s[i][a]>=e&&(s[i][a]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Bi.MAP?Ui.MAP_LOAD:Ui.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,i){var a,s,r;for(r=Mi(e,i),a=0;a<e;a++)for(s=0;s<i;s++)(a*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(a*i+s,e*i,t===Bi.MAP?Ui.MAP_ATTR:Ui.OBJ_ATTR),s!==ki.ATR_CROP1&&s!==ki.ATR_CROP2?(r[a][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[a][s]=0,this.currentPosition+=2);return this.emitProgress(e*i,e*i,t===Bi.MAP?Ui.MAP_ATTR:Ui.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,Ui.RAND_PARTS)},t.prototype.emitProgress=function(t,e,i){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:i})},t}();var Vi=function(){function t(t,e,i,a){this.wwaData=t,this.compressedMapData=e,this.startPosition=i,this.eventEmitter=a,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:Ui.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:Ui.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(ki.SYSTEM_MESSAGE_NUM);for(e=0;e<ki.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=ki.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=ki.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=ki.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=ki.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=ki.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=ki.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=ki.DEFAULT_DISABLE_SAVE,t.isOldMap=ki.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=ki.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=ki.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=ki.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=ki.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=ki.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=ki.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=ki.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=ki.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=ki.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=ki.DEFAULT_FRAME_COLOR_R,t.frameColorG=ki.DEFAULT_FRAME_COLOR_G,t.frameColorB=ki.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=ki.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=ki.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=ki.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=ki.DEFAULT_STR_COLOR_R,t.fontColorG=ki.DEFAULT_STR_COLOR_G,t.fontColorB=ki.DEFAULT_STR_COLOR_B,t.statusColorR=ki.DEFAULT_STATUS_COLOR_R,t.statusColorG=ki.DEFAULT_STATUS_COLOR_G,t.statusColorB=ki.DEFAULT_STATUS_COLOR_B,t.moves=ki.DEFAULT_MOVES,t.gameSpeedIndex=ki.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(ki.USER_VAR_NUM);for(e=0;e<ki.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t.bgmDelayDurationMs=0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Fi=function(){},Yi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Gi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Hi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Ki=function(t){function e(e){var i=t.call(this)||this;return i.uri=e,i}return Yi(e,t),e.fetch=function(t){return Gi(this,void 0,void 0,(function(){return Hi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(t)];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("マップデータ 「".concat(t,"」の読み込みに失敗しました。\n 通信環境の良いところで再度お試しください。\n ローカルテストの場合は、ブラウザが対応していない可能性があります。"));case 3:return[2]}}))}))},e.handleError=function(t,e){var i="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(i));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(i));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(i))}},e.prototype.request=function(){return Gi(this,void 0,void 0,(function(){var t;return Hi(this,(function(i){switch(i.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=i.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,i.sent()]}}))}))},e}(Fi),ji=i(106),Xi=i.n(ji),Ji=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Zi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},qi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Qi=function(t){function e(e){var i=t.call(this)||this;return i.fileName=e,i}return Ji(e,t),e.prototype.request=function(){return Zi(this,void 0,void 0,(function(){var t=this;return qi(this,(function(e){return[2,new Promise((function(e,i){Xi().readFile(t.fileName,(function(t,a){t&&i(t),e(a.buffer)}))}))]}))}))},e}(Fi),zi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},$i=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},ta=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return zi(this,void 0,void 0,(function(){var t,e,i,a,s,r;return $i(this,(function(n){switch(n.label){case 0:o=this.fileName,t="undefined"!=typeof window?new Ki(o):new Qi(o),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=n.sent())?(i=this.loadMapData(e),this.eventEmitter.dispatch("mapData",i),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return a=n.sent(),s=a.name||"",r=a.message||"",this.eventEmitter.dispatch("error",{name:s,message:r}),[3,4];case 4:return[2]}var o}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),i=function(t){var e,i,a=new Uint8Array(t.length);for(e=0,i=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(a[i++]=t[e],t[e]===t[e+1]){for(var s=t[e+2],r=0;r<s;r++)a[i++]=t[e];e+=2}if(i+255>=a.length){var n=new Uint8Array(a.length+65e3);n.set(a),a=n}}return console.log("EXTRACT DATA = "+i+" "+e),{byteMapData:a,byteMapLength:i,compressedEndPosition:e+3}}(e),a=i.byteMapData,s=i.byteMapLength,r=i.compressedEndPosition,n=new Wi(a,s,this.eventEmitter).extractAllData();return new Vi(n,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),ea=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var i=new CustomEvent(t,{detail:e});this.target.dispatchEvent(i)},t.prototype.addListener=function(t,e){var i=function(t){return e(t.detail)};return this.target.addEventListener(t,i),i},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),ia=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},aa=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},sa=function(t){return ia(void 0,void 0,void 0,(function(){return aa(this,(function(e){return[2,fetch(t).then((function(e){return 200===e.status||304===e.status?{kind:"data",data:e}:{kind:"httpError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。ステータスコード: ").concat(e.status)}})).catch((function(e){return{kind:"connectionError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return ia(void 0,void 0,void 0,(function(){var e,i;return aa(this,(function(a){switch(a.label){case 0:return"data"!==t.kind?[3,2]:(i={kind:"data"},[4,t.data.json()]);case 1:return i.data=a.sent(),e=i,[3,3];case 2:e=t,a.label=3;case 3:return[2,e]}}))}))})).catch((function(e){return{kind:"brokenJson",errorMessage:"ファイル ".concat(t," が壊れています。")}}))]}))}))},ra={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},na="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",oa={5:na,"5module":na+" export import",6:na+" const class extends export import super"},ca=/^in(stanceof)?$/,ha="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ua="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",_a=new RegExp("["+ha+"]"),la=new RegExp("["+ha+ua+"]");ha=ua=null;var pa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],da=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function fa(t,e){for(var i=65536,a=0;a<e.length;a+=2){if((i+=e[a])>t)return!1;if((i+=e[a+1])>=t)return!0}}function Ea(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&_a.test(String.fromCharCode(t)):!1!==e&&fa(t,pa)))}function ma(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&la.test(String.fromCharCode(t)):!1!==e&&(fa(t,pa)||fa(t,da)))))}var ya=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function ga(t,e){return new ya(t,{beforeExpr:!0,binop:e})}var wa={beforeExpr:!0},va={startsExpr:!0},Sa={};function Aa(t,e){return void 0===e&&(e={}),e.keyword=t,Sa[t]=new ya(t,e)}var Ta={num:new ya("num",va),regexp:new ya("regexp",va),string:new ya("string",va),name:new ya("name",va),eof:new ya("eof"),bracketL:new ya("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ya("]"),braceL:new ya("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ya("}"),parenL:new ya("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ya(")"),comma:new ya(",",wa),semi:new ya(";",wa),colon:new ya(":",wa),dot:new ya("."),question:new ya("?",wa),questionDot:new ya("?."),arrow:new ya("=>",wa),template:new ya("template"),invalidTemplate:new ya("invalidTemplate"),ellipsis:new ya("...",wa),backQuote:new ya("`",va),dollarBraceL:new ya("${",{beforeExpr:!0,startsExpr:!0}),eq:new ya("=",{beforeExpr:!0,isAssign:!0}),assign:new ya("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ya("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ya("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ga("||",1),logicalAND:ga("&&",2),bitwiseOR:ga("|",3),bitwiseXOR:ga("^",4),bitwiseAND:ga("&",5),equality:ga("==/!=/===/!==",6),relational:ga("</>/<=/>=",7),bitShift:ga("<</>>/>>>",8),plusMin:new ya("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ga("%",10),star:ga("*",10),slash:ga("/",10),starstar:new ya("**",{beforeExpr:!0}),coalesce:ga("??",1),_break:Aa("break"),_case:Aa("case",wa),_catch:Aa("catch"),_continue:Aa("continue"),_debugger:Aa("debugger"),_default:Aa("default",wa),_do:Aa("do",{isLoop:!0,beforeExpr:!0}),_else:Aa("else",wa),_finally:Aa("finally"),_for:Aa("for",{isLoop:!0}),_function:Aa("function",va),_if:Aa("if"),_return:Aa("return",wa),_switch:Aa("switch"),_throw:Aa("throw",wa),_try:Aa("try"),_var:Aa("var"),_const:Aa("const"),_while:Aa("while",{isLoop:!0}),_with:Aa("with"),_new:Aa("new",{beforeExpr:!0,startsExpr:!0}),_this:Aa("this",va),_super:Aa("super",va),_class:Aa("class",va),_extends:Aa("extends",wa),_export:Aa("export"),_import:Aa("import",va),_null:Aa("null",va),_true:Aa("true",va),_false:Aa("false",va),_in:Aa("in",{beforeExpr:!0,binop:7}),_instanceof:Aa("instanceof",{beforeExpr:!0,binop:7}),_typeof:Aa("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Aa("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Aa("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ia=/\r\n?|\n|\u2028|\u2029/,Ca=new RegExp(Ia.source,"g");function Oa(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var Da=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Pa=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Na=Object.prototype,ba=Na.hasOwnProperty,xa=Na.toString;function Ma(t,e){return ba.call(t,e)}var La=Array.isArray||function(t){return"[object Array]"===xa.call(t)};function Ra(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Ba=function(t,e){this.line=t,this.column=e};Ba.prototype.offset=function(t){return new Ba(this.line,this.column+t)};var Ua=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function ka(t,e){for(var i=1,a=0;;){Ca.lastIndex=a;var s=Ca.exec(t);if(!(s&&s.index<e))return new Ba(i,e-a);++i,a=s.index+s[0].length}}var Wa={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function Va(t){var e={};for(var i in Wa)e[i]=t&&Ma(t,i)?t[i]:Wa[i];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),La(e.onToken)){var a=e.onToken;e.onToken=function(t){return a.push(t)}}return La(e.onComment)&&(e.onComment=function(t,e){return function(i,a,s,r,n,o){var c={type:i?"Block":"Line",value:a,start:s,end:r};t.locations&&(c.loc=new Ua(this,n,o)),t.ranges&&(c.range=[s,r]),e.push(c)}}(e,e.onComment)),e}function Fa(t,e){return 2|(t?4:0)|(e?8:0)}var Ya=function(t,e,i){this.options=t=Va(t),this.sourceFile=t.sourceFile,this.keywords=Ra(oa[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var a="";if(!0!==t.allowReserved){for(var s=t.ecmaVersion;!(a=ra[s]);s--);"module"===t.sourceType&&(a+=" await")}this.reservedWords=Ra(a);var r=(a?a+" ":"")+ra.strict;this.reservedWordsStrict=Ra(r),this.reservedWordsStrictBind=Ra(r+" "+ra.strictBind),this.input=String(e),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ia).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Ta.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},Ga={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Ya.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},Ga.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},Ga.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},Ga.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},Ga.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},Ga.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},Ga.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ya.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},Ya.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,a=0;a<t.length;a++)i=t[a](i);return i},Ya.parse=function(t,e){return new this(e,t).parse()},Ya.parseExpressionAt=function(t,e,i){var a=new this(i,t,e);return a.nextToken(),a.parseExpression()},Ya.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(Ya.prototype,Ga);var Ha=Ya.prototype,Ka=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function ja(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}Ha.strictDirective=function(t){for(;;){Pa.lastIndex=t,t+=Pa.exec(this.input)[0].length;var e=Ka.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2])){Pa.lastIndex=t+e[0].length;var i=Pa.exec(this.input),a=i.index+i[0].length,s=this.input.charAt(a);return";"===s||"}"===s||Ia.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||"!"===s&&"="===this.input.charAt(a+1))}t+=e[0].length,Pa.lastIndex=t,t+=Pa.exec(this.input)[0].length,";"===this.input[t]&&t++}},Ha.eat=function(t){return this.type===t&&(this.next(),!0)},Ha.isContextual=function(t){return this.type===Ta.name&&this.value===t&&!this.containsEsc},Ha.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},Ha.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},Ha.canInsertSemicolon=function(){return this.type===Ta.eof||this.type===Ta.braceR||Ia.test(this.input.slice(this.lastTokEnd,this.start))},Ha.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ha.semicolon=function(){this.eat(Ta.semi)||this.insertSemicolon()||this.unexpected()},Ha.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},Ha.expect=function(t){this.eat(t)||this.unexpected()},Ha.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},Ha.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},Ha.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,a=t.doubleProto;if(!e)return i>=0||a>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},Ha.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Ha.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var Xa=Ya.prototype;Xa.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==Ta.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var a=0,s=Object.keys(this.undefinedExports);a<s.length;a+=1){var r=s[a];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var Ja={kind:"loop"},Za={kind:"switch"};Xa.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Pa.lastIndex=this.pos;var e=Pa.exec(this.input),i=this.pos+e[0].length,a=this.input.charCodeAt(i);if(91===a)return!0;if(t)return!1;if(123===a)return!0;if(Ea(a,!0)){for(var s=i+1;ma(this.input.charCodeAt(s),!0);)++s;var r=this.input.slice(i,s);if(!ca.test(r))return!0}return!1},Xa.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Pa.lastIndex=this.pos;var t=Pa.exec(this.input),e=this.pos+t[0].length;return!(Ia.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&ma(this.input.charAt(e+8)))},Xa.parseStatement=function(t,e,i){var a,s=this.type,r=this.startNode();switch(this.isLet(t)&&(s=Ta._var,a="let"),s){case Ta._break:case Ta._continue:return this.parseBreakContinueStatement(r,s.keyword);case Ta._debugger:return this.parseDebuggerStatement(r);case Ta._do:return this.parseDoStatement(r);case Ta._for:return this.parseForStatement(r);case Ta._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Ta._class:return t&&this.unexpected(),this.parseClass(r,!0);case Ta._if:return this.parseIfStatement(r);case Ta._return:return this.parseReturnStatement(r);case Ta._switch:return this.parseSwitchStatement(r);case Ta._throw:return this.parseThrowStatement(r);case Ta._try:return this.parseTryStatement(r);case Ta._const:case Ta._var:return a=a||this.value,t&&"var"!==a&&this.unexpected(),this.parseVarStatement(r,a);case Ta._while:return this.parseWhileStatement(r);case Ta._with:return this.parseWithStatement(r);case Ta.braceL:return this.parseBlock(!0,r);case Ta.semi:return this.parseEmptyStatement(r);case Ta._export:case Ta._import:if(this.options.ecmaVersion>10&&s===Ta._import){Pa.lastIndex=this.pos;var n=Pa.exec(this.input),o=this.pos+n[0].length,c=this.input.charCodeAt(o);if(40===c||46===c)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Ta._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var h=this.value,u=this.parseExpression();return s===Ta.name&&"Identifier"===u.type&&this.eat(Ta.colon)?this.parseLabeledStatement(r,h,u,t):this.parseExpressionStatement(r,u)}},Xa.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(Ta.semi)||this.insertSemicolon()?t.label=null:this.type!==Ta.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var s=this.labels[a];if(null==t.label||s.name===t.label.name){if(null!=s.kind&&(i||"loop"===s.kind))break;if(t.label&&i)break}}return a===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},Xa.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},Xa.parseDoStatement=function(t){return this.next(),this.labels.push(Ja),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ta._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Ta.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},Xa.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ja),this.enterScope(0),this.expect(Ta.parenL),this.type===Ta.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===Ta._var||this.type===Ta._const||i){var a=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(a,!0,s),this.finishNode(a,"VariableDeclaration"),(this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===a.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Ta._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,a)):(e>-1&&this.unexpected(e),this.parseFor(t,a))}var r=new ja,n=this.parseExpression(!0,r);return this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Ta._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(n,!1,r),this.checkLVal(n),this.parseForIn(t,n)):(this.checkExpressionErrors(r,!0),e>-1&&this.unexpected(e),this.parseFor(t,n))},Xa.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Qa|(i?0:za),!1,e)},Xa.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Ta._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},Xa.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Ta.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},Xa.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Ta.braceL),this.labels.push(Za),this.enterScope(0);for(var i=!1;this.type!==Ta.braceR;)if(this.type===Ta._case||this.type===Ta._default){var a=this.type===Ta._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),a?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Ta.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},Xa.parseThrowStatement=function(t){return this.next(),Ia.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var qa=[];Xa.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Ta._catch){var e=this.startNode();if(this.next(),this.eat(Ta.parenL)){e.param=this.parseBindingAtom();var i="Identifier"===e.param.type;this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(Ta.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Ta._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},Xa.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},Xa.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Ja),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},Xa.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},Xa.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},Xa.parseLabeledStatement=function(t,e,i,a){for(var s=0,r=this.labels;s<r.length;s+=1){r[s].name===e&&this.raise(i.start,"Label '"+e+"' is already declared")}for(var n=this.type.isLoop?"loop":this.type===Ta._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==t.start)break;c.statementStart=this.start,c.kind=n}return this.labels.push({name:e,kind:n,statementStart:this.start}),t.body=this.parseStatement(a?-1===a.indexOf("label")?a+"label":a:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},Xa.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},Xa.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(Ta.braceL),t&&this.enterScope(0);this.type!==Ta.braceR;){var a=this.parseStatement(null);e.body.push(a)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},Xa.parseFor=function(t,e){return t.init=e,this.expect(Ta.semi),t.test=this.type===Ta.semi?null:this.parseExpression(),this.expect(Ta.semi),t.update=this.type===Ta.parenR?null:this.parseExpression(),this.expect(Ta.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},Xa.parseForIn=function(t,e){var i=this.type===Ta._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Ta.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},Xa.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(Ta.eq)?a.init=this.parseMaybeAssign(e):"const"!==i||this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===a.id.type||e&&(this.type===Ta._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(Ta.comma))break}return t},Xa.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)};var Qa=1,za=2;Xa.parseFunction=function(t,e,i,a){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===Ta.star&&e&za&&this.unexpected(),t.generator=this.eat(Ta.star)),this.options.ecmaVersion>=8&&(t.async=!!a),e&Qa&&(t.id=4&e&&this.type!==Ta.name?null:this.parseIdent(),!t.id||e&za||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Fa(t.async,t.generator)),e&Qa||(t.id=this.type===Ta.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(t,e&Qa?"FunctionDeclaration":"FunctionExpression")},Xa.parseFunctionParams=function(t){this.expect(Ta.parenL),t.params=this.parseBindingList(Ta.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Xa.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var a=this.startNode(),s=!1;for(a.body=[],this.expect(Ta.braceL);this.type!==Ta.braceR;){var r=this.parseClassElement(null!==t.superClass);r&&(a.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(s&&this.raise(r.start,"Duplicate constructor in the same class"),s=!0))}return this.strict=i,this.next(),t.body=this.finishNode(a,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},Xa.parseClassElement=function(t){var e=this;if(this.eat(Ta.semi))return null;var i=this.startNode(),a=function(t,a){void 0===a&&(a=!1);var s=e.start,r=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===Ta.parenL||a&&e.canInsertSemicolon())||(i.key&&e.unexpected(),i.computed=!1,i.key=e.startNodeAt(s,r),i.key.name=t,e.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=a("static");var s=this.eat(Ta.star),r=!1;s||(this.options.ecmaVersion>=8&&a("async",!0)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Ta.star)):a("get")?i.kind="get":a("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var n=i.key,o=!1;return i.computed||i.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?i.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),s&&this.raise(n.start,"Constructor can't be a generator"),r&&this.raise(n.start,"Constructor can't be an async method"),i.kind="constructor",o=t),this.parseClassMethod(i,s,r,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},Xa.parseClassMethod=function(t,e,i,a){return t.value=this.parseMethod(e,i,a),this.finishNode(t,"MethodDefinition")},Xa.parseClassId=function(t,e){this.type===Ta.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},Xa.parseClassSuper=function(t){t.superClass=this.eat(Ta._extends)?this.parseExprSubscripts():null},Xa.parseExport=function(t,e){if(this.next(),this.eat(Ta.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Ta.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(Ta._default)){var i;if(this.checkExport(e,"default",this.lastTokStart),this.type===Ta._function||(i=this.isAsyncFunction())){var a=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(a,4|Qa,!1,i)}else if(this.type===Ta._class){var s=this.startNode();t.declaration=this.parseClass(s,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Ta.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,n=t.specifiers;r<n.length;r+=1){var o=n[r];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},Xa.checkExport=function(t,e,i){t&&(Ma(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},Xa.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e.name,e.start);else if("ObjectPattern"===i)for(var a=0,s=e.properties;a<s.length;a+=1){var r=s[a];this.checkPatternExport(t,r)}else if("ArrayPattern"===i)for(var n=0,o=e.elements;n<o.length;n+=1){var c=o[n];c&&this.checkPatternExport(t,c)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(t,e.expression)},Xa.checkVariableExport=function(t,e){if(t)for(var i=0,a=e;i<a.length;i+=1){var s=a[i];this.checkPatternExport(t,s.id)}},Xa.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},Xa.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(Ta.braceL);!this.eat(Ta.braceR);){if(i)i=!1;else if(this.expect(Ta.comma),this.afterTrailingComma(Ta.braceR))break;var a=this.startNode();a.local=this.parseIdent(!0),a.exported=this.eatContextual("as")?this.parseIdent(!0):a.local,this.checkExport(t,a.exported.name,a.exported.start),e.push(this.finishNode(a,"ExportSpecifier"))}return e},Xa.parseImport=function(t){return this.next(),this.type===Ta.string?(t.specifiers=qa,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Ta.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},Xa.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===Ta.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(Ta.comma))return t}if(this.type===Ta.star){var a=this.startNode();return this.next(),this.expectContextual("as"),a.local=this.parseIdent(),this.checkLVal(a.local,2),t.push(this.finishNode(a,"ImportNamespaceSpecifier")),t}for(this.expect(Ta.braceL);!this.eat(Ta.braceR);){if(e)e=!1;else if(this.expect(Ta.comma),this.afterTrailingComma(Ta.braceR))break;var s=this.startNode();s.imported=this.parseIdent(!0),this.eatContextual("as")?s.local=this.parseIdent():(this.checkUnreserved(s.imported),s.local=s.imported),this.checkLVal(s.local,2),t.push(this.finishNode(s,"ImportSpecifier"))}return t},Xa.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},Xa.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var $a=Ya.prototype;$a.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var a=0,s=t.properties;a<s.length;a+=1){var r=s[a];this.toAssignable(r,e),"RestElement"!==r.type||"ArrayPattern"!==r.argument.type&&"ObjectPattern"!==r.argument.type||this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},$a.toAssignableList=function(t,e){for(var i=t.length,a=0;a<i;a++){var s=t[a];s&&this.toAssignable(s,e)}if(i){var r=t[i-1];6===this.options.ecmaVersion&&e&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return t},$a.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},$a.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==Ta.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},$a.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ta.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(Ta.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Ta.braceL:return this.parseObj(!0)}return this.parseIdent()},$a.parseBindingList=function(t,e,i){for(var a=[],s=!0;!this.eat(t);)if(s?s=!1:this.expect(Ta.comma),e&&this.type===Ta.comma)a.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Ta.ellipsis){var r=this.parseRestBinding();this.parseBindingListItem(r),a.push(r),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}var n=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(n),a.push(n)}return a},$a.parseBindingListItem=function(t){return t},$a.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ta.eq))return i;var a=this.startNodeAt(t,e);return a.left=i,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},$a.checkLVal=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Identifier":2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),i&&(Ma(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),0!==e&&5!==e&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var a=0,s=t.properties;a<s.length;a+=1){var r=s[a];this.checkLVal(r,e,i)}break;case"Property":this.checkLVal(t.value,e,i);break;case"ArrayPattern":for(var n=0,o=t.elements;n<o.length;n+=1){var c=o[n];c&&this.checkLVal(c,e,i)}break;case"AssignmentPattern":this.checkLVal(t.left,e,i);break;case"RestElement":this.checkLVal(t.argument,e,i);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,i);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var ts=Ya.prototype;ts.checkPropClash=function(t,e,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var a,s=t.key;switch(s.type){case"Identifier":a=s.name;break;case"Literal":a=String(s.value);break;default:return}var r=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===a&&"init"===r&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);else{var n=e[a="$"+a];if(n)("init"===r?this.strict&&n.init||n.get||n.set:n.init||n[r])&&this.raiseRecoverable(s.start,"Redefinition of property");else n=e[a]={init:!1,get:!1,set:!1};n[r]=!0}}},ts.parseExpression=function(t,e){var i=this.start,a=this.startLoc,s=this.parseMaybeAssign(t,e);if(this.type===Ta.comma){var r=this.startNodeAt(i,a);for(r.expressions=[s];this.eat(Ta.comma);)r.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(r,"SequenceExpression")}return s},ts.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var a=!1,s=-1,r=-1;e?(s=e.parenthesizedAssign,r=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new ja,a=!0);var n=this.start,o=this.startLoc;this.type!==Ta.parenL&&this.type!==Ta.name||(this.potentialArrowAt=this.start);var c=this.parseMaybeConditional(t,e);if(i&&(c=i.call(this,c,n,o)),this.type.isAssign){var h=this.startNodeAt(n,o);return h.operator=this.value,h.left=this.type===Ta.eq?this.toAssignable(c,!1,e):c,a||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=h.left.start&&(e.shorthandAssign=-1),this.checkLVal(c),this.next(),h.right=this.parseMaybeAssign(t),this.finishNode(h,"AssignmentExpression")}return a&&this.checkExpressionErrors(e,!0),s>-1&&(e.parenthesizedAssign=s),r>-1&&(e.trailingComma=r),c},ts.parseMaybeConditional=function(t,e){var i=this.start,a=this.startLoc,s=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return s;if(this.eat(Ta.question)){var r=this.startNodeAt(i,a);return r.test=s,r.consequent=this.parseMaybeAssign(),this.expect(Ta.colon),r.alternate=this.parseMaybeAssign(t),this.finishNode(r,"ConditionalExpression")}return s},ts.parseExprOps=function(t,e){var i=this.start,a=this.startLoc,s=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||s.start===i&&"ArrowFunctionExpression"===s.type?s:this.parseExprOp(s,i,a,-1,t)},ts.parseExprOp=function(t,e,i,a,s){var r=this.type.binop;if(null!=r&&(!s||this.type!==Ta._in)&&r>a){var n=this.type===Ta.logicalOR||this.type===Ta.logicalAND,o=this.type===Ta.coalesce;o&&(r=Ta.logicalAND.binop);var c=this.value;this.next();var h=this.start,u=this.startLoc,_=this.parseExprOp(this.parseMaybeUnary(null,!1),h,u,r,s),l=this.buildBinary(e,i,t,_,c,n||o);return(n&&this.type===Ta.coalesce||o&&(this.type===Ta.logicalOR||this.type===Ta.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(l,e,i,a,s)}return t},ts.buildBinary=function(t,e,i,a,s,r){var n=this.startNodeAt(t,e);return n.left=i,n.operator=s,n.right=a,this.finishNode(n,r?"LogicalExpression":"BinaryExpression")},ts.parseMaybeUnary=function(t,e){var i,a=this.start,s=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),e=!0;else if(this.type.prefix){var r=this.startNode(),n=this.type===Ta.incDec;r.operator=this.value,r.prefix=!0,this.next(),r.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),n?this.checkLVal(r.argument):this.strict&&"delete"===r.operator&&"Identifier"===r.argument.type?this.raiseRecoverable(r.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(r,n?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(a,s);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!e&&this.eat(Ta.starstar)?this.buildBinary(a,s,i,this.parseMaybeUnary(null,!1),"**",!1):i},ts.parseExprSubscripts=function(t){var e=this.start,i=this.startLoc,a=this.parseExprAtom(t);if("ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return a;var s=this.parseSubscripts(a,e,i);return t&&"MemberExpression"===s.type&&(t.parenthesizedAssign>=s.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=s.start&&(t.parenthesizedBind=-1)),s},ts.parseSubscripts=function(t,e,i,a){for(var s=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,r=!1;;){var n=this.parseSubscript(t,e,i,a,s,r);if(n.optional&&(r=!0),n===t||"ArrowFunctionExpression"===n.type){if(r){var o=this.startNodeAt(e,i);o.expression=n,n=this.finishNode(o,"ChainExpression")}return n}t=n}},ts.parseSubscript=function(t,e,i,a,s,r){var n=this.options.ecmaVersion>=11,o=n&&this.eat(Ta.questionDot);a&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(Ta.bracketL);if(c||o&&this.type!==Ta.parenL&&this.type!==Ta.backQuote||this.eat(Ta.dot)){var h=this.startNodeAt(e,i);h.object=t,h.property=c?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),h.computed=!!c,c&&this.expect(Ta.bracketR),n&&(h.optional=o),t=this.finishNode(h,"MemberExpression")}else if(!a&&this.eat(Ta.parenL)){var u=new ja,_=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var d=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,!1,u);if(s&&!o&&!this.canInsertSemicolon()&&this.eat(Ta.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=_,this.awaitPos=l,this.awaitIdentPos=p,this.parseArrowExpression(this.startNodeAt(e,i),d,!0);this.checkExpressionErrors(u,!0),this.yieldPos=_||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var f=this.startNodeAt(e,i);f.callee=t,f.arguments=d,n&&(f.optional=o),t=this.finishNode(f,"CallExpression")}else if(this.type===Ta.backQuote){(o||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var E=this.startNodeAt(e,i);E.tag=t,E.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(E,"TaggedTemplateExpression")}return t},ts.parseExprAtom=function(t){this.type===Ta.slash&&this.readRegexp();var e,i=this.potentialArrowAt===this.start;switch(this.type){case Ta._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),e=this.startNode(),this.next(),this.type!==Ta.parenL||this.allowDirectSuper||this.raise(e.start,"super() call outside constructor of a subclass"),this.type!==Ta.dot&&this.type!==Ta.bracketL&&this.type!==Ta.parenL&&this.unexpected(),this.finishNode(e,"Super");case Ta._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case Ta.name:var a=this.start,s=this.startLoc,r=this.containsEsc,n=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!r&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(Ta._function))return this.parseFunction(this.startNodeAt(a,s),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(Ta.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===Ta.name&&!r)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Ta.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[n],!0)}return n;case Ta.regexp:var o=this.value;return(e=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},e;case Ta.num:case Ta.string:return this.parseLiteral(this.value);case Ta._null:case Ta._true:case Ta._false:return(e=this.startNode()).value=this.type===Ta._null?null:this.type===Ta._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case Ta.parenL:var c=this.start,h=this.parseParenAndDistinguishExpression(i);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),h;case Ta.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(Ta.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case Ta.braceL:return this.parseObj(!1,t);case Ta._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case Ta._class:return this.parseClass(this.startNode(),!1);case Ta._new:return this.parseNew();case Ta.backQuote:return this.parseTemplate();case Ta._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},ts.parseExprImport=function(){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var e=this.parseIdent(!0);switch(this.type){case Ta.parenL:return this.parseDynamicImport(t);case Ta.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}},ts.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(Ta.parenR)){var e=this.start;this.eat(Ta.comma)&&this.eat(Ta.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},ts.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},ts.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},ts.parseParenExpression=function(){this.expect(Ta.parenL);var t=this.parseExpression();return this.expect(Ta.parenR),t},ts.parseParenAndDistinguishExpression=function(t){var e,i=this.start,a=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,n=this.start,o=this.startLoc,c=[],h=!0,u=!1,_=new ja,l=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Ta.parenR;){if(h?h=!1:this.expect(Ta.comma),s&&this.afterTrailingComma(Ta.parenR,!0)){u=!0;break}if(this.type===Ta.ellipsis){r=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,_,this.parseParenItem))}var d=this.start,f=this.startLoc;if(this.expect(Ta.parenR),t&&!this.canInsertSemicolon()&&this.eat(Ta.arrow))return this.checkPatternErrors(_,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=l,this.awaitPos=p,this.parseParenArrowList(i,a,c);c.length&&!u||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(_,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?((e=this.startNodeAt(n,o)).expressions=c,this.finishNodeAt(e,"SequenceExpression",d,f)):e=c[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var E=this.startNodeAt(i,a);return E.expression=e,this.finishNode(E,"ParenthesizedExpression")}return e},ts.parseParenItem=function(t){return t},ts.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)};var es=[];ts.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Ta.dot)){t.meta=e;var i=this.containsEsc;return t.property=this.parseIdent(!0),"target"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"'new.target' can only be used in functions"),this.finishNode(t,"MetaProperty")}var a=this.start,s=this.startLoc,r=this.type===Ta._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),a,s,!0),r&&"ImportExpression"===t.callee.type&&this.raise(a,"Cannot use new with import()"),this.eat(Ta.parenL)?t.arguments=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,!1):t.arguments=es,this.finishNode(t,"NewExpression")},ts.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===Ta.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===Ta.backQuote,this.finishNode(i,"TemplateElement")},ts.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var a=this.parseTemplateElement({isTagged:e});for(i.quasis=[a];!a.tail;)this.type===Ta.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Ta.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(Ta.braceR),i.quasis.push(a=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},ts.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===Ta.name||this.type===Ta.num||this.type===Ta.string||this.type===Ta.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ta.star)&&!Ia.test(this.input.slice(this.lastTokEnd,this.start))},ts.parseObj=function(t,e){var i=this.startNode(),a=!0,s={};for(i.properties=[],this.next();!this.eat(Ta.braceR);){if(a)a=!1;else if(this.expect(Ta.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ta.braceR))break;var r=this.parseProperty(t,e);t||this.checkPropClash(r,s,e),i.properties.push(r)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},ts.parseProperty=function(t,e){var i,a,s,r,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Ta.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===Ta.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,e),this.type===Ta.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(t||e)&&(s=this.start,r=this.startLoc),t||(i=this.eat(Ta.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n)?(a=!0,i=this.options.ecmaVersion>=9&&this.eat(Ta.star),this.parsePropertyName(n,e)):a=!1,this.parsePropertyValue(n,t,i,a,s,r,e,o),this.finishNode(n,"Property")},ts.parsePropertyValue=function(t,e,i,a,s,r,n,o){if((i||a)&&this.type===Ta.colon&&this.unexpected(),this.eat(Ta.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ta.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,a);else if(e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===Ta.comma||this.type===Ta.braceR||this.type===Ta.eq)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||a)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=s),t.kind="init",e?t.value=this.parseMaybeDefault(s,r,t.key):this.type===Ta.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(s,r,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(i||a)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var c="get"===t.kind?0:1;if(t.value.params.length!==c){var h=t.value.start;"get"===t.kind?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},ts.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Ta.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Ta.bracketR),t.key;t.computed=!1}return t.key=this.type===Ta.num||this.type===Ta.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ts.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},ts.parseMethod=function(t,e,i){var a=this.startNode(),s=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=t),this.options.ecmaVersion>=8&&(a.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Fa(e,a.generator)|(i?128:0)),this.expect(Ta.parenL),a.params=this.parseBindingList(Ta.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(a,"FunctionExpression")},ts.parseArrowExpression=function(t,e,i){var a=this.yieldPos,s=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|Fa(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=r,this.finishNode(t,"ArrowFunctionExpression")},ts.parseFunctionBody=function(t,e,i){var a=e&&this.type!==Ta.braceL,s=this.strict,r=!1;if(a)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);s&&!n||(r=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!s&&!r&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,5),t.body=this.parseBlock(!1,void 0,r&&!s),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=o}this.exitScope()},ts.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1){if("Identifier"!==i[e].type)return!1}return!0},ts.checkParams=function(t,e){for(var i={},a=0,s=t.params;a<s.length;a+=1){var r=s[a];this.checkLVal(r,1,e?null:i)}},ts.parseExprList=function(t,e,i,a){for(var s=[],r=!0;!this.eat(t);){if(r)r=!1;else if(this.expect(Ta.comma),e&&this.afterTrailingComma(t))break;var n=void 0;i&&this.type===Ta.comma?n=null:this.type===Ta.ellipsis?(n=this.parseSpread(a),a&&this.type===Ta.comma&&a.trailingComma<0&&(a.trailingComma=this.start)):n=this.parseMaybeAssign(!1,a),s.push(n)}return s},ts.checkUnreserved=function(t){var e=t.start,i=t.end,a=t.name;(this.inGenerator&&"yield"===a&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===a&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(a)&&this.raise(e,"Unexpected keyword '"+a+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(a)&&(this.inAsync||"await"!==a||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+a+"' is reserved"))},ts.parseIdent=function(t,e){var i=this.startNode();return this.type===Ta.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(i,"Identifier"),t||(this.checkUnreserved(i),"await"!==i.name||this.awaitIdentPos||(this.awaitIdentPos=i.start)),i},ts.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===Ta.semi||this.canInsertSemicolon()||this.type!==Ta.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Ta.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},ts.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")};var is=Ya.prototype;is.raise=function(t,e){var i=ka(this.input,t);e+=" ("+i.line+":"+i.column+")";var a=new SyntaxError(e);throw a.pos=t,a.loc=i,a.raisedAt=this.pos,a},is.raiseRecoverable=is.raise,is.curPosition=function(){if(this.options.locations)return new Ba(this.curLine,this.pos-this.lineStart)};var as=Ya.prototype,ss=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};as.enterScope=function(t){this.scopeStack.push(new ss(t))},as.exitScope=function(){this.scopeStack.pop()},as.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},as.declareName=function(t,e,i){var a=!1;if(2===e){var s=this.currentScope();a=s.lexical.indexOf(t)>-1||s.functions.indexOf(t)>-1||s.var.indexOf(t)>-1,s.lexical.push(t),this.inModule&&1&s.flags&&delete this.undefinedExports[t]}else if(4===e){this.currentScope().lexical.push(t)}else if(3===e){var r=this.currentScope();a=this.treatFunctionsAsVar?r.lexical.indexOf(t)>-1:r.lexical.indexOf(t)>-1||r.var.indexOf(t)>-1,r.functions.push(t)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(t)>-1&&!(32&o.flags&&o.lexical[0]===t)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(t)>-1){a=!0;break}if(o.var.push(t),this.inModule&&1&o.flags&&delete this.undefinedExports[t],3&o.flags)break}a&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},as.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},as.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},as.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags)return e}},as.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags&&!(16&e.flags))return e}};var rs=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new Ua(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},ns=Ya.prototype;function os(t,e,i,a){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=a),this.options.ranges&&(t.range[1]=i),t}ns.startNode=function(){return new rs(this,this.start,this.startLoc)},ns.startNodeAt=function(t,e){return new rs(this,t,e)},ns.finishNode=function(t,e){return os.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},ns.finishNodeAt=function(t,e,i,a){return os.call(this,t,e,i,a)};var cs=function(t,e,i,a,s){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=a,this.generator=!!s},hs={b_stat:new cs("{",!1),b_expr:new cs("{",!0),b_tmpl:new cs("${",!1),p_stat:new cs("(",!1),p_expr:new cs("(",!0),q_tmpl:new cs("`",!0,!0,(function(t){return t.tryReadTemplateToken()})),f_stat:new cs("function",!1),f_expr:new cs("function",!0),f_expr_gen:new cs("function",!0,!1,null,!0),f_gen:new cs("function",!1,!1,null,!0)},us=Ya.prototype;us.initialContext=function(){return[hs.b_stat]},us.braceIsBlock=function(t){var e=this.curContext();return e===hs.f_expr||e===hs.f_stat||(t!==Ta.colon||e!==hs.b_stat&&e!==hs.b_expr?t===Ta._return||t===Ta.name&&this.exprAllowed?Ia.test(this.input.slice(this.lastTokEnd,this.start)):t===Ta._else||t===Ta.semi||t===Ta.eof||t===Ta.parenR||t===Ta.arrow||(t===Ta.braceL?e===hs.b_stat:t!==Ta._var&&t!==Ta._const&&t!==Ta.name&&!this.exprAllowed):!e.isExpr)},us.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},us.updateContext=function(t){var e,i=this.type;i.keyword&&t===Ta.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},Ta.parenR.updateContext=Ta.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===hs.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},Ta.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?hs.b_stat:hs.b_expr),this.exprAllowed=!0},Ta.dollarBraceL.updateContext=function(){this.context.push(hs.b_tmpl),this.exprAllowed=!0},Ta.parenL.updateContext=function(t){var e=t===Ta._if||t===Ta._for||t===Ta._with||t===Ta._while;this.context.push(e?hs.p_stat:hs.p_expr),this.exprAllowed=!0},Ta.incDec.updateContext=function(){},Ta._function.updateContext=Ta._class.updateContext=function(t){!t.beforeExpr||t===Ta.semi||t===Ta._else||t===Ta._return&&Ia.test(this.input.slice(this.lastTokEnd,this.start))||(t===Ta.colon||t===Ta.braceL)&&this.curContext()===hs.b_stat?this.context.push(hs.f_stat):this.context.push(hs.f_expr),this.exprAllowed=!1},Ta.backQuote.updateContext=function(){this.curContext()===hs.q_tmpl?this.context.pop():this.context.push(hs.q_tmpl),this.exprAllowed=!1},Ta.star.updateContext=function(t){if(t===Ta._function){var e=this.context.length-1;this.context[e]===hs.f_expr?this.context[e]=hs.f_expr_gen:this.context[e]=hs.f_gen}this.exprAllowed=!0},Ta.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==Ta.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var _s="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ls=_s+" Extended_Pictographic",ps={9:_s,10:ls,11:ls},ds="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",fs="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Es=fs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ms={9:fs,10:Es,11:Es+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ys={};function gs(t){var e=ys[t]={binary:Ra(ps[t]+" "+ds),nonBinary:{General_Category:Ra(ds),Script:Ra(ms[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}gs(9),gs(10),gs(11);var ws=Ya.prototype,vs=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ys[t.options.ecmaVersion>=11?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Ss(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function As(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function Ts(t){return t>=65&&t<=90||t>=97&&t<=122}function Is(t){return Ts(t)||95===t}function Cs(t){return Is(t)||Os(t)}function Os(t){return t>=48&&t<=57}function Ds(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ps(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function Ns(t){return t>=48&&t<=55}vs.prototype.reset=function(t,e,i){var a=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchN=a&&this.parser.options.ecmaVersion>=9},vs.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},vs.prototype.at=function(t,e){void 0===e&&(e=!1);var i=this.source,a=i.length;if(t>=a)return-1;var s=i.charCodeAt(t);if(!e&&!this.switchU||s<=55295||s>=57344||t+1>=a)return s;var r=i.charCodeAt(t+1);return r>=56320&&r<=57343?(s<<10)+r-56613888:s},vs.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i=this.source,a=i.length;if(t>=a)return a;var s,r=i.charCodeAt(t);return!e&&!this.switchU||r<=55295||r>=57344||t+1>=a||(s=i.charCodeAt(t+1))<56320||s>57343?t+1:t+2},vs.prototype.current=function(t){return void 0===t&&(t=!1),this.at(this.pos,t)},vs.prototype.lookahead=function(t){return void 0===t&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},vs.prototype.advance=function(t){void 0===t&&(t=!1),this.pos=this.nextIndex(this.pos,t)},vs.prototype.eat=function(t,e){return void 0===e&&(e=!1),this.current(e)===t&&(this.advance(e),!0)},ws.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,a=0;a<i.length;a++){var s=i.charAt(a);-1===e.indexOf(s)&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(s,a+1)>-1&&this.raise(t.start,"Duplicate regular expression flag")}},ws.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},ws.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1){var a=i[e];-1===t.groupNames.indexOf(a)&&t.raise("Invalid named capture referenced")}},ws.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},ws.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},ws.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!!(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},ws.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},ws.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},ws.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},ws.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var a=0,s=-1;if(this.regexp_eatDecimalDigits(t)&&(a=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue),t.eat(125)))return-1!==s&&s<a&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},ws.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},ws.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},ws.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1},ws.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},ws.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},ws.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},ws.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!As(e)&&(t.lastIntValue=e,t.advance(),!0)},ws.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!As(i);)t.advance();return t.pos!==e},ws.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},ws.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},ws.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},ws.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Ss(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Ss(t.lastIntValue);return!0}return!1},ws.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,a=t.current(i);return t.advance(i),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(a=t.lastIntValue),function(t){return Ea(t,!0)||36===t||95===t}(a)?(t.lastIntValue=a,!0):(t.pos=e,!1)},ws.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,a=t.current(i);return t.advance(i),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(a=t.lastIntValue),function(t){return ma(t,!0)||36===t||95===t||8204===t||8205===t}(a)?(t.lastIntValue=a,!0):(t.pos=e,!1)},ws.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},ws.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},ws.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},ws.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},ws.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},ws.regexp_eatZero=function(t){return 48===t.current()&&!Os(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},ws.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},ws.regexp_eatControlLetter=function(t){var e=t.current();return!!Ts(e)&&(t.lastIntValue=e%32,t.advance(),!0)},ws.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){void 0===e&&(e=!1);var i,a=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(s&&r>=55296&&r<=56319){var n=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(o>=56320&&o<=57343)return t.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}t.pos=n,t.lastIntValue=r}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((i=t.lastIntValue)>=0&&i<=1114111))return!0;s&&t.raise("Invalid unicode escape"),t.pos=a}return!1},ws.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},ws.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},ws.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},ws.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var a=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,a),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,s),!0}return!1},ws.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Ma(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},ws.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},ws.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";Is(e=t.current());)t.lastStringValue+=Ss(e),t.advance();return""!==t.lastStringValue},ws.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Cs(e=t.current());)t.lastStringValue+=Ss(e),t.advance();return""!==t.lastStringValue},ws.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},ws.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},ws.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||-1!==e&&-1!==i||t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},ws.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||Ns(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var a=t.current();return 93!==a&&(t.lastIntValue=a,t.advance(),!0)},ws.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},ws.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!Os(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},ws.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},ws.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Os(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},ws.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Ds(i=t.current());)t.lastIntValue=16*t.lastIntValue+Ps(i),t.advance();return t.pos!==e},ws.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i}else t.lastIntValue=e;return!0}return!1},ws.regexp_eatOctalDigit=function(t){var e=t.current();return Ns(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},ws.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var a=0;a<e;++a){var s=t.current();if(!Ds(s))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+Ps(s),t.advance()}return!0};var bs=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Ua(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},xs=Ya.prototype;function Ms(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}function Ls(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}xs.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new bs(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},xs.getToken=function(){return this.next(),new bs(this)},"undefined"!=typeof Symbol&&(xs[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===Ta.eof,value:e}}}}),xs.curContext=function(){return this.context[this.context.length-1]},xs.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Ta.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},xs.readToken=function(t){return Ea(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},xs.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},xs.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(-1===a&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(Ca.lastIndex=i;(t=Ca.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,a),i,this.pos,e,this.curPosition())},xs.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!Oa(a);)a=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},xs.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&t<14||t>=5760&&Da.test(String.fromCharCode(t))))break t;++this.pos}}},xs.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},xs.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(Ta.ellipsis)):(++this.pos,this.finishToken(Ta.dot))},xs.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(Ta.assign,2):this.finishOp(Ta.slash,1)},xs.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,a=42===t?Ta.star:Ta.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,a=Ta.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(Ta.assign,i+1):this.finishOp(a,i)},xs.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Ta.assign,3);return this.finishOp(124===t?Ta.logicalOR:Ta.logicalAND,2)}return 61===e?this.finishOp(Ta.assign,2):this.finishOp(124===t?Ta.bitwiseOR:Ta.bitwiseAND,1)},xs.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Ta.assign,2):this.finishOp(Ta.bitwiseXOR,1)},xs.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Ia.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Ta.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(Ta.assign,2):this.finishOp(Ta.plusMin,1)},xs.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(Ta.assign,i+1):this.finishOp(Ta.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(Ta.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},xs.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(Ta.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Ta.arrow)):this.finishOp(61===t?Ta.eq:Ta.prefix,1)},xs.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(Ta.questionDot,2)}if(63===e){if(t>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Ta.assign,3);return this.finishOp(Ta.coalesce,2)}}return this.finishOp(Ta.question,1)},xs.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ta.parenL);case 41:return++this.pos,this.finishToken(Ta.parenR);case 59:return++this.pos,this.finishToken(Ta.semi);case 44:return++this.pos,this.finishToken(Ta.comma);case 91:return++this.pos,this.finishToken(Ta.bracketL);case 93:return++this.pos,this.finishToken(Ta.bracketR);case 123:return++this.pos,this.finishToken(Ta.braceL);case 125:return++this.pos,this.finishToken(Ta.braceR);case 58:return++this.pos,this.finishToken(Ta.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ta.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Ta.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ls(t)+"'")},xs.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},xs.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(Ia.test(a)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===a)e=!0;else if("]"===a&&e)e=!1;else if("/"===a&&!e)break;t="\\"===a}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new vs(this));o.reset(i,s,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(s,n)}catch(t){}return this.finishToken(Ta.regexp,{pattern:s,flags:n,value:c})},xs.readInt=function(t,e,i){for(var a=this.options.ecmaVersion>=12&&void 0===e,s=i&&48===this.input.charCodeAt(this.pos),r=this.pos,n=0,o=0,c=0,h=null==e?1/0:e;c<h;++c,++this.pos){var u=this.input.charCodeAt(this.pos),_=void 0;if(a&&95===u)s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===c&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=u;else{if((_=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=t)break;o=u,n=n*t+_}}return a&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=e&&this.pos-r!==e?null:n},xs.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=Ms(this.input.slice(e,this.pos)),++this.pos):Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Ta.num,i)},xs.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===a){var s=Ms(this.input.slice(e,this.pos));return++this.pos,Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Ta.num,s)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==a||i||(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),69!==a&&101!==a||i||(43!==(a=this.input.charCodeAt(++this.pos))&&45!==a||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,n=(r=this.input.slice(e,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(Ta.num,n)},xs.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},xs.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===t)break;92===a?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):(Oa(a,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Ta.string,e)};var Rs={};xs.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==Rs)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},xs.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rs;this.raise(t,e)},xs.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Ta.template&&this.type!==Ta.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(Ta.template,t)):36===i?(this.pos+=2,this.finishToken(Ta.dollarBraceL)):(++this.pos,this.finishToken(Ta.backQuote));if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Oa(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},xs.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(Ta.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},xs.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ls(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t){var i=this.pos-1;return this.invalidStringToken(i,"Invalid escape sequence in template string"),null}default:if(e>=48&&e<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(a,8);return s>255&&(a=a.slice(0,-1),s=parseInt(a,8)),this.pos+=a.length-1,e=this.input.charCodeAt(this.pos),"0"===a&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-a.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Oa(e)?"":String.fromCharCode(e)}},xs.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},xs.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(ma(s,a))this.pos+=s<=65535?1:2;else{if(92!==s)break;this.containsEsc=!0,t+=this.input.slice(i,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(e?Ea:ma)(n,a)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Ls(n),i=this.pos}e=!1}return t+this.input.slice(i,this.pos)},xs.readWord=function(){var t=this.readWord1(),e=Ta.name;return this.keywords.test(t)&&(e=Sa[t]),this.finishToken(e,t)};function Bs(t){return e=t,i={ecmaVersion:2020},Ya.parse(e,i);var e,i}function Us(t){return["Array1D","Array2D","Number","Symbol","UnaryOperation","BinaryOperation","Random","CallDefinedFunction","AnyFunction"].includes(t.type)}function ks(t){switch(t.type){case"Program":return function(t){if(1!==t.body.length)throw new Error("bodyが1以外の場合評価できません。");return ks(t.body[0])}(t);case"ExpressionStatement":return function(t){return ks(t.expression)}(t);case"AssignmentExpression":return function(t){var e=ks(t.left),i=ks(t.right);if(!Us(i))throw new Error("値以外を代入式の右辺に設定できません");if("="===t.operator){if("Array2D"===e.type){if("m"===e.name||"o"===e.name)return{type:"PartsAssignment",partsKind:"m"===e.name?"map":"object",destinationX:e.index0,destinationY:e.index1,value:i};throw new Error("想定していない記号が2次元配列ででてきました")}if("Array1D"===e.type){if("ITEM"===e.name)return{type:"ItemAssignment",itemBoxPosition1to12:e.index0,value:i};if("v"===e.name)return{type:"UserVariableAssignment",index:e.index0,value:i};throw new Error("")}if("Symbol"===e.type){if("m"===e.name||"o"===e.name||"v"===e.name||"ITEM"===e.name)throw new Error("このシンボルには代入できません");if("AT_TOTAL"===e.name)throw new Error('"装備品込みの攻撃力(AT_TOTAL)への代入はできません。"');if("DF_TOTAL"===e.name)throw new Error('"装備品込みの防御力(DF_TOTAL)への代入はできません。"');return{type:"SpecialParameterAssignment",kind:e.name,value:i}}throw"Number"===e.type?new Error("数値には代入できません"):new Error("代入できません")}}(t);case"MemberExpression":return function(t){var e=ks(t.object),i=ks(t.property);if("Symbol"===e.type){if("v"!==e.name&&"m"!==e.name&&"o"!==e.name&&"ITEM"!==e.name)throw new Error("このシンボルは配列にできません");if("Number"===i.type||"Symbol"===i.type||"BinaryOperation"===i.type||"Array1D"===i.type)return{type:"Array1D",name:e.name,index0:i};throw new Error("WWAでは存在しない構文です")}if("Array1D"===e.type){if("ITEM"===e.name||"v"===e.name)throw new Error("この配列は2次元以上にはできません。");if("Number"===i.type||"Symbol"===i.type||"BinaryOperation"===i.type||"Array1D"===i.type)return{type:"Array2D",name:e.name,index0:e.index0,index1:i};throw new Error("WWAでは存在しない構文です")}}(t);case"UnaryExpression":return function(t){var e=ks(t.argument);if("+"!==t.operator&&"-"!==t.operator)throw new Error("未定義の演算子です :"+t.operator);if(!Us(e))throw new Error("単項演算子が適用できません");return{type:"UnaryOperation",operator:t.operator,argument:e}}(t);case"BinaryExpression":return function(t){var e=ks(t.left),i=ks(t.right);if(!Us(e)||!Us(i))throw new Error("左辺または右辺が評価不能です");switch(t.operator){case"+":case"-":case"*":case"/":case"%":case">":case"<":case">=":case"<=":case"==":case"!=":return{type:"BinaryOperation",operator:t.operator,left:e,right:i};default:throw new Error("未定義の演算子です :"+t.operator)}}(t);case"Identifier":return function(t){switch(t.name){case"m":case"o":case"ITEM":case"X":case"Y":case"PX":case"PY":case"v":case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"DF":case"DF_TOTAL":case"GD":case"STEP":case"TIME":case"PDIR":case"i":case"j":case"k":case"LOOPLIMIT":case"ITEM_ID":case"ITEM_POS":return{type:"Symbol",name:t.name};default:throw new Error("未定義のシンボルです :\n"+t.name)}}(t);case"Literal":return function(t){return{type:"Number",value:t.value}}(t);case"CallExpression":return function(t){var e=t.callee.name;switch(e){case"RAND":return function(t){if(t.length<1)throw new Error("RAND関数には引数が必要です。");return{type:"Random",value:ks(t[0])}}(t.arguments);case"JUMPGATE":return function(t){if(t.length<2)throw new Error("RAND関数には引数が2つ必要です。");var e={x:t[0],y:t[1]};return{type:"Jumpgate",x:ks(e.x),y:ks(e.y)}}(t.arguments);case"MSG":case"MESSAGE":return{type:"Msg",value:ks(t.arguments[0])};case"SOUND":case"SAVE":case"LOG":case"ABLE_CHANGE_SPEED":case"SET_SPEED":case"CHANGE_GAMEOVER_POS":case"DEL_PLAYER":case"RESTART_GAME":case"URL_JUMPGATE":case"HIDE_STATUS":case"PARTS":case"EFFECT":case"CHANGE_PLAYER_IMAGE":case"HAS_ITEM":case"REMOVE_ITEM":case"MOVE":case"IS_PLAYER_WAITING_MESSAGE":case"GET_UNIXTIME":case"GET_DATE_YEAR":case"GET_DATE_MONTH":case"GET_DATE_DAY":case"GET_DATE_HOUR":case"GET_DATE_MINUTES":case"CHANGE_SYSMSG":return function(t,e){return{type:"AnyFunction",functionName:e,value:t.map((function(t){return ks(t)}))}}(t.arguments,e);default:return{type:"CallDefinedFunction",functionName:e}}}(t);case"IfStatement":return function(t){var e=ks(t.consequent),i=ks(t.test);return{type:"IfStatement",consequent:e,test:i,alternate:t.alternate?ks(t.alternate):void 0}}(t);case"BlockStatement":return function(t){return{type:"BlockStatement",value:t.body.map((function(t){return ks(t)}))}}(t);case"FunctionDeclaration":return function(t){return{type:"DefinedFunction",functionName:t.id.name,body:ks(t.body)}}(t);case"ForStatement":return function(t){var e=t.body.body.map((function(t){return ks(t)}));return{type:"ForStatement",body:e,init:ks(t.init),test:ks(t.test),update:ks(t.update)}}(t);case"BreakStatement":return function(t){return{type:"Break",label:t.label}}(t);case"ContinueStatement":return function(t){return{type:"Continue",label:t.label}}(t);case"UpdateExpression":return function(t){return{type:"UpdateExpression",operator:t.operator,argument:ks(t.argument)}}(t);default:throw console.log(t),new Error("未定義の AST ノードです :"+t.type)}}Ya.acorn={Parser:Ya,version:"7.4.1",defaultOptions:Wa,Position:Ba,SourceLocation:Ua,getLineInfo:ka,Node:rs,TokenType:ya,tokTypes:Ta,keywordTypes:Sa,TokContext:cs,tokContexts:hs,isIdentifierChar:ma,isIdentifierStart:Ea,Token:bs,isNewLine:Oa,lineBreak:Ia,lineBreakG:Ca,nonASCIIwhitespace:Da};var Ws,Vs=function(){return Vs=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Vs.apply(this,arguments)},Fs=function(){function t(t){this.wwa=t,this.loop_limit=1e5}return t.prototype.setReadOnlyItemValue=function(t,e){this.readonly_value=Vs(Vs({},this.readonly_value),{item_id:t,item_pos:e})},t.prototype.evalWwaNodes=function(t){var e=this;return t.map((function(t){return e.evalWwaNode(t)}))},t.prototype.evalWwaNode=function(t){"BlockStatement"===t.type&&Array.isArray(t.value)&&0===t.value.length||new Ys(this).evalWwaNode(t)},t.prototype.updateLoopLimit=function(t){this.loop_limit=t},t}(),Ys=function(){function t(t){this.generator=t,this.for_id={i:null,j:null,k:null,loopCount:0,break_flag:!1,continue_flag:!1}}return t.prototype.evalWwaNodes=function(t){var e=this;return t.map((function(t){return e.evalWwaNode(t)}))},t.prototype.evalWwaNode=function(t){if(!this.for_id.break_flag&&!this.for_id.continue_flag)switch(t.type){case"UnaryOperation":return this.evalUnaryOperation(t);case"BinaryOperation":return this.evalBinaryOperation(t);case"Symbol":return this.evalSymbol(t);case"Array1D":return this.evalArray1D(t);case"Array2D":return this.evalArray2D(t);case"Number":return this.evalNumber(t);case"UserVariableAssignment":return this.evalSetUserVariable(t);case"SpecialParameterAssignment":return this.evalSetSpecialParameter(t);case"Random":return this.evalRandom(t);case"Jumpgate":return this.evalJumpgate(t);case"Msg":return this.evalMessage(t);case"ItemAssignment":return this.itemAssignment(t);case"IfStatement":return this.ifStatement(t);case"BlockStatement":return this.blockStatement(t);case"PartsAssignment":return this.partsAssignment(t);case"ForStatement":return this.forStateMent(t);case"AnyFunction":return this.evalAnyFunction(t);case"CallDefinedFunction":return this.callDefinedFunction(t);case"Break":return this.breakStatement(t);case"Continue":return this.contunueStatment(t);case"UpdateExpression":return this.updateExpression(t);default:throw new Error("未定義または未実装のノードです")}},t.prototype.callDefinedFunction=function(t){var e=this.generator.wwa.getUserScript(t.functionName);if(null===e)throw new Error("未定義の関数が呼び出されました: ".concat(t.functionName));this.evalWwaNode(e)},t.prototype.updateExpression=function(t){if("Symbol"!==t.argument.type)throw console.log(t),new Error("node.argument.typeがSymbolではありません。:"+t.argument.type);var e=this.evalSymbol(t.argument),i=function(){switch(t.operator){case"++":return e+1;case"--":return e-1;default:throw new Error("想定外のOperatorが渡されました :"+t.operator)}}(),a={type:"SpecialParameterAssignment",kind:t.argument.name,value:{type:"Number",value:i}};this.evalSetSpecialParameter(a)},t.prototype.contunueStatment=function(t){this.for_id.continue_flag=!0},t.prototype.breakStatement=function(t){this.for_id.break_flag=!0},t.prototype.forStateMent=function(t){var e=this,i=t.init;for(function(){switch(i.kind){case"i":if(null!==e.for_id.i)throw new Error("iの値が既に外側のforループで使われています。");break;case"j":if(null!==e.for_id.j)throw new Error("jの値が既に外側のforループで使われています。");break;case"k":if(null!==e.for_id.k)throw new Error("kの値が既に外側のforループで使われています。");break;default:throw new Error("予想外の変数がfor文内で使用されました :"+i.kind)}e.evalWwaNode(t.init)}();this.evalWwaNode(t.test);this.evalWwaNode(t.update)){if(this.for_id.loopCount++,this.for_id.loopCount>this.generator.loop_limit)throw new Error("処理回数が多すぎます!\n上限値は LOOPLIMIT で変えられます。");if(this.for_id.break_flag)break;if(!this.evalWwaNode(t.test))break;this.evalWwaNodes(t.body),this.for_id.continue_flag=!1}switch(this.for_id.break_flag=!1,i.kind){case"i":this.for_id.i=null;break;case"j":this.for_id.j=null;break;case"k":this.for_id.k=null}},t.prototype._checkArgsLength=function(t,e){if(e.value.length<t)throw new Error("関数 ".concat(e.functionName," の引数が不足しています!"))},t.prototype.evalAnyFunction=function(t){var e=this.generator.wwa.getGameStatus();switch(t.functionName){case"SOUND":this._checkArgsLength(1,t);var i=this.evalWwaNode(t.value[0]);this.generator.wwa.playSound(i);break;case"SAVE":this._checkArgsLength(1,t);var a=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.disableSave(a);break;case"LOG":this._checkArgsLength(1,t);var s=this.evalWwaNode(t.value[0]);console.log(s);break;case"ABLE_CHANGE_SPEED":this._checkArgsLength(1,t);var r=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.speedChangeJudge(r);break;case"SET_SPEED":this._checkArgsLength(1,t);var n=Number(this.evalWwaNode(t.value[0]));this.generator.wwa.setPlayerSpeedIndex(n);break;case"CHANGE_GAMEOVER_POS":this._checkArgsLength(2,t);var o={x:Number(this.evalWwaNode(t.value[0])),y:Number(this.evalWwaNode(t.value[1]))};if(o.x<0||o.x>=this.generator.wwa.getMapWidth()||o.y<0||o.y>this.generator.wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this.generator.wwa.setGameOverPosition(new d(o.x,o.y));break;case"DEL_PLAYER":this._checkArgsLength(1,t);var c=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.setDelPlayer(c);break;case"RESTART_GAME":this.generator.wwa.restartGame();break;case"URL_JUMPGATE":throw new Error("URL_JUMPGATE 関数は調整中のためご利用になれません");case"HIDE_STATUS":this._checkArgsLength(2,t);var h=Number(this.evalWwaNode(t.value[0])),u=Boolean(this.evalWwaNode(t.value[1]));this.generator.wwa.hideStatus(h,u);break;case"PARTS":this._checkArgsLength(2,t);var _=Number(this.evalWwaNode(t.value[0])),l=Number(this.evalWwaNode(t.value[1])),p=t.value[2]?Number(this.evalWwaNode(t.value[2])):0,f=!t.value[3]||Boolean(this.evalWwaNode(t.value[3])),E=[v.OBJECT,v.MAP];if(_<0||l<0)throw new Error("パーツ番号が不正です");if(!E.includes(p))throw new Error("パーツ種別が不明です");this.generator.wwa.replaceParts(_,l,p,f);break;case"EFFECT":this._checkArgsLength(1,t);var m=Number(this.evalWwaNode(t.value[0]));if(m<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0===m)return void this.generator.wwa.stopEffect();for(var y=[],g=1;g<t.value.length;g+=2){var w=Number(this.evalWwaNode(t.value[g]));if(w<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(g+1===t.value.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");var S=Number(this.evalWwaNode(t.value[g+1]));if(S<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");y.push(new d(w,S))}this.generator.wwa.setEffect(m,y);break;case"CHANGE_PLAYER_IMAGE":this._checkArgsLength(2,t);var A=Number(this.evalWwaNode(t.value[0])),T=Number(this.evalWwaNode(t.value[1])),I=new d(A,T);this.generator.wwa.setPlayerImgCoord(I);break;case"HAS_ITEM":this._checkArgsLength(1,t);var C=Number(this.evalWwaNode(t.value[0]));return e.itemBox.includes(C);case"REMOVE_ITEM":this._checkArgsLength(1,t);C=Number(this.evalWwaNode(t.value[0]));for(var O=!!t.value[1]&&1===this.evalWwaNode(t.value[1]),D=0;D<e.itemBox.length;D++){if(C===e.itemBox[D]&&(this.generator.wwa.setPlayerGetItem(D+1,0),!O))break}break;case"MOVE":this._checkArgsLength(1,t);var P=Number(this.evalWwaNode(t.value[0]));if(P<=0||P>9)throw Error("MOVEの移動先は2/4/6/8で指定してください!");this.generator.wwa.movePlayer(P),this.generator.wwa.movePlayer(P);break;case"IS_PLAYER_WAITING_MESSAGE":return this.generator.wwa.isPlayerWaitingMessage();case"GET_UNIXTIME":return Math.floor((new Date).getTime()/1e3);case"GET_DATE_YEAR":return(new Date).getFullYear();case"GET_DATE_MONTH":return(new Date).getMonth()+1;case"GET_DATE_DAY":return(new Date).getDate();case"GET_DATE_HOUR":return(new Date).getHours();case"GET_DATE_MINUTES":return(new Date).getMinutes();case"CHANGE_SYSMSG":this._checkArgsLength(1,t);var N=this.evalWwaNode(t.value[0]),b=t.value.length>=2?this.evalWwaNode(t.value[1]):void 0;if(!(h=this.resolveSystemMessageKeyFromMacroArg(N)))throw new Error("このIDのシステムメッセージは未定義です。");if("number"==typeof b||"string"==typeof b||"boolean"==typeof b)this.generator.wwa.overwriteSystemMessage(h,String(b));else{if(null!=b)throw new Error("この値は文字列に変換できないため、システムメッセージを表示できません。");this.generator.wwa.overwriteSystemMessage(h,void 0)}break;default:throw new Error("未定義の関数が指定されました: "+t.functionName)}},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return"string"==typeof t?n(t)?t:void 0:"number"==typeof t?o(t):void 0},t.prototype.partsAssignment=function(t){var e=this.generator.wwa.getGameStatus(),i=this.evalWwaNode(t.destinationX),a=this.evalWwaNode(t.destinationY),s=this.evalWwaNode(t.value),r="map"===t.partsKind?v.MAP:v.OBJECT;this.generator.wwa.appearPartsEval(e.playerCoord,i,a,s,r)},t.prototype.blockStatement=function(t){this.evalWwaNodes(t.value)},t.prototype.ifStatement=function(t){return this.evalWwaNode(t.test)?this.evalWwaNode(t.consequent):t.alternate&&this.evalWwaNode(t.alternate),0},t.prototype.itemAssignment=function(t){var e=this.evalWwaNode(t.itemBoxPosition1to12),i=this.evalWwaNode(t.value);return this.generator.wwa.setPlayerGetItem(e,i),0},t.prototype.evalMessage=function(t){var e=this.evalWwaNode(t.value),i=isNaN(e)?e:e.toString();return this.generator.wwa.reserveMessageDisplayWhenShouldOpen(i),0},t.prototype.evalJumpgate=function(t){var e=this.evalWwaNode(t.x),i=this.evalWwaNode(t.y);if(isNaN(e)||isNaN(i))throw new Error("飛び先の値が数値になっていません。 x=".concat(e," / y=").concat(i));this.generator.wwa.forcedJumpGate(e,i)},t.prototype.evalRandom=function(t){var e=this.evalWwaNode(t.value);return Math.floor(Math.random()*e)},t.prototype.evalSetSpecialParameter=function(t){var e=this.evalWwaNode(t.value);if(!this.generator.wwa||isNaN(e))return 0;switch(t.kind){case"PX":return this.generator.wwa.jumpSpecifiedXPos(e),0;case"PY":return this.generator.wwa.jumpSpecifiedYPos(e),0;case"AT":return this.generator.wwa.setPlayerStatus(B.STRENGTH,e,!1),0;case"DF":return this.generator.wwa.setPlayerStatus(B.DEFENCE,e,!1),0;case"GD":return this.generator.wwa.setPlayerStatus(B.GOLD,e,!1),0;case"HP":return this.generator.wwa.setPlayerStatus(B.ENERGY,e,!1),0;case"HPMAX":return this.generator.wwa.setPlayerEnergyMax(e),0;case"i":return this.for_id.i=this.evalWwaNode(t.value),0;case"j":return this.for_id.j=this.evalWwaNode(t.value),0;case"k":return this.for_id.k=this.evalWwaNode(t.value),0;case"LOOPLIMIT":return this.generator.updateLoopLimit(this.evalWwaNode(t.value)),0;default:return console.error("未実装の要素です: "+t.kind),0}},t.prototype.evalSetUserVariable=function(t){var e=this.evalWwaNode(t.value);if(!this.generator.wwa||isNaN(e))return 0;var i=this.evalWwaNode(t.index);if("number"!=typeof i)throw new Error("代入先の添字が数値になりませんでした");return this.generator.wwa.setUserVar(i,e),0},t.prototype.evalUnaryOperation=function(t){switch(t.operator){case"+":return this.evalWwaNode(t.argument);case"-":return-this.evalWwaNode(t.argument);default:throw new Error("存在しない単項演算子です")}},t.prototype.evalBinaryOperation=function(t){var e=this.evalWwaNode(t.left),i=this.evalWwaNode(t.right);switch(t.operator){case"+":return e+i;case"-":return e-i;case"*":return e*i;case"/":return 0===i?0:Math.floor(e/i);case"%":return 0===i?0:e%i;case">":return e>i;case">=":return e>=i;case"<":return e<i;case"<=":return e<=i;case"==":return e==i;case"!=":return e!=i;default:throw new Error("存在しない単項演算子です")}},t.prototype.evalSymbol=function(t){var e=this.generator.wwa.getGameStatus();switch(t.name){case"X":case"Y":return 0;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"GD":return e.totalStatus.gold;case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"STEP":return e.moveCount;case"TIME":return e.playTime;case"PDIR":return e.playerDirection;case"i":return this.for_id.i;case"j":return this.for_id.j;case"k":return this.for_id.k;case"LOOPLIMIT":return this.generator.loop_limit;case"ITEM_ID":return this.generator.readonly_value.item_id;case"ITEM_POS":return this.generator.readonly_value.item_pos;default:throw new Error("このシンボルは取得できません")}},t.prototype.evalArray1D=function(t){var e=this.evalWwaNode(t.index0);if("number"!=typeof e)throw new Error("添字の計算結果が数値になりませんでした");var i=this.generator.wwa.getGameStatus();switch(t.name){case"v":return this.generator.wwa.getUserVar(e);case"ITEM":if(void 0===i.itemBox[e])throw new Error("ITEMの添字に想定外の値が入っています。: "+e);return i.itemBox[e];default:throw new Error("このシンボルは取得できません")}},t.prototype.evalArray2D=function(t){switch(t.name){case"m":case"o":var e=this.evalWwaNode(t.index0),i=this.evalWwaNode(t.index1),a="o"===t.name?v.OBJECT:v.MAP;return this.generator.wwa.getPartsID(new d(e,i),a);default:throw new Error("このシンボルは取得できません")}},t.prototype.evalNumber=function(t){return t.value},t}(),Gs=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Hs=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Ks=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},js=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Xs=function(t,e,i){if(i||2===arguments.length)for(var a,s=0,r=e.length;s<r;s++)!a&&s in e||(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))};function Js(t,e,i){var a=new X;return a.current=t,a.total=e,a.stage=i,a}var Zs=function(){function t(t,e,i,a,r,n,o,c,_,l,E,m,g){void 0===e&&(e=!1),void 0===o&&(o=""),void 0===c&&(c=!1),void 0===_&&(_=null),void 0===m&&(m=!1),void 0===g&&(g=null);var w,v=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._windowCloseWaitingJumpGateRequest=void 0,this._debugConsoleElement=void 0,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this._playTimeCalculator=void 0,this.userDefinedFunctions={},this.convertWwaNodes=function(t){var e,i=Bs(t);return"Program"===(e=i).type?e.body.map((function(t){return ks(t)})):[ks(e)]},this.mainCaller=function(){return v._main()},this.soundCheckCaller=function(){return v.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return v._keyStore.checkHitKey(tt.KEY_ESC)||v._keyStore.checkHitKey(tt.KEY_SHIFT)||v._keyStore.checkHitKey(tt.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ea(mt("wwa-wrapper")),window.addEventListener("click",(function(t){v._isActive=!1})),mt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),v._isActive=!0})),this._isActive=!0,null===i?(this._hasTitleImg=!1,this._cvsCover=mt("progress-panel"),(w=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?(mt("unstable-version-warning").textContent="この WWA Wing は [不安定版] です。",mt("version").textContent="WWA Wing Ver.3.13.0-unstable.based-on.3.12.10"):this._setLoadingMessage(w,0)}catch(t){}this._dumpElement=_;var S=window.AudioContext||window.webkitAudioContext;S&&(this.audioContext=new S,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var A=new Audio;"no"!==A.canPlayType("audio/mpeg")&&""!==A.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new M,this._isURLGateEnable=e,this._isClassicModeEnable=a,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new p(0,0,0,0),o?"/"!==o[o.length-1]&&(o+="/"):o="./audio/",this._audioDirectory=o,this._bottomButtonType=n?h.GOTO_WWA:h.BATTLE_REPORT;var P=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===I.GAME){if(this.userDevice.os===T.NINTENDO)H.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===C.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case I.VR:case I.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(mt("cell-save").textContent=j.QUICK_SAVE,this._usePassword?mt("cell-load").textContent=j.PASSWORD:mt("cell-load").textContent=j.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:mt("cell-gotowwa").textContent=j.GOTO_WWA;break;case h.BATTLE_REPORT:mt("cell-gotowwa").textContent=j.BATTLE_REPORT;break;case h.GAME_END:mt("cell-gotowwa").textContent=j.GAME_END}this._loadHandler=function(t){var e;v._wwaData=t,v._wwaData.isItemEffectEnabled=r;try{v._hasTitleImg?mt("version").textContent+=" (Map data Ver. "+Math.floor(v._wwaData.version/10)+"."+ +v._wwaData.version%10+")":v._setLoadingMessage(w,1)}catch(t){}var i=mt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(v._wwaData.mapCGName),v._wwaData.mapCGName=i.join("/"),v._playTimeCalculator=new ut,v._restartData=JSON.parse(JSON.stringify(v._wwaData)),v.checkOriginalMapString=v._generateMapDataHash(v._restartData),v.initCSSRule(),v._setProgressBar(Js(0,4,V.GAME_INIT)),v._setLoadingMessage(w,2);var a=new Image;a.src=v._wwaData.mapCGName,a.addEventListener("error",(function(){v._setErrorMessage("画像ファイル「"+v._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",w)}));var n=v._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),o=function(t){t.style.backgroundImage="url("+n+")"};Array.prototype.forEach.call(vt("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(v._wwaData.imgItemboxX*H.CHIP_SIZE,"px -").concat(v._wwaData.imgItemboxY*H.CHIP_SIZE,"px"),t.style.backgroundImage="url("+n+")"})),Array.prototype.forEach.call(vt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+n+")"})),Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+H.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(vt(".item-cell>.item-disp"),o),Array.prototype.forEach.call(vt("div.wide-cell-row>.status-icon"),o),v.setStatusIconCoord(U.ENERGY,new d(v._wwaData.imgStatusEnergyX,v._wwaData.imgStatusEnergyY)),v.setStatusIconCoord(U.STRENGTH,new d(v._wwaData.imgStatusStrengthX,v._wwaData.imgStatusStrengthY)),v.setStatusIconCoord(U.DEFENCE,new d(v._wwaData.imgStatusDefenceX,v._wwaData.imgStatusDefenceY)),v.setStatusIconCoord(U.GOLD,new d(v._wwaData.imgStatusGoldX,v._wwaData.imgStatusGoldY)),v._setProgressBar(Js(1,4,V.GAME_INIT)),v._setLoadingMessage(w,3),v._mapIDTableCreate(),v._replaceAllRandomObjects();var h=(new Date).getTime();console.log("Loading Complete!"+(h-P)+"ms"),v._cvs=mt("wwa-map");var _=v._cvs.getContext("2d",{alpha:!1});_.fillStyle="rgba( 255, 255, 255, 0.5)",_.fillRect(0,0,440,440);var l=new f(v,v._wwaData.playerX,v._wwaData.playerY);v._camera=new Dt(l),v._itemMenu=new Qe;var S=new p(v._wwaData.statusEnergy,v._wwaData.statusStrength,v._wwaData.statusDefence,v._wwaData.statusGold);v._player=new xt(v,l,v._camera,S,v._wwaData.statusEnergyMax,v._wwaData.moves,v._wwaData.gameSpeedIndex),v._objectMovingDataManager=new Rt(v,v._player),v._camera.setPlayer(v._player),v._keyStore=new rt,v._mouseStore=new ct,m?(v._virtualPadButtonElements={BUTTON_ENTER:mt("wwa-enter-button"),BUTTON_ESC:mt("wwa-esc-button"),BUTTON_FAST:mt("wwa-fast-button"),BUTTON_SLOW:mt("wwa-slow-button"),BUTTON_LEFT:mt("wwa-left-button"),BUTTON_UP:mt("wwa-up-button"),BUTTON_RIGHT:mt("wwa-right-button"),BUTTON_DOWN:mt("wwa-down-button")},v._virtualPadStore=new dt(v._virtualPadButtonElements,Ze(),mt("wwa-virtualpad-right"),mt("wwa-virtualpad-left"),v._setVirtualPadTouch.bind(v),v._setVirtualPadLeave.bind(v)),function(t,e){if(null===t)return;var i=document.createElement("button");i.classList.add("wwa-virtualpad-toggle-button"),i.textContent="仮想パッド表示切り替え",i.addEventListener("click",e),t.appendChild(i)}(g,(function(){v._virtualPadStore.toggleVisible()}))):(v._virtualPadButtonElements=null,v._virtualPadStore=new dt({})),v._debugConsoleElement=function(t){if(null===t)return;var e=document.createElement("section");e.setAttribute("id","wwa-debug-console");var i=document.createElement("textarea");i.setAttribute("rows","10"),i.setAttribute("cols","60"),i.textContent='for(i=0; i<5; i++) {\n MSG("i:"+i);\n}';var a=function(t){return t.stopPropagation()};i.addEventListener("keydown",a),i.addEventListener("keypress",a),i.addEventListener("keyup",a),i.classList.add("console-text-area"),e.appendChild(i);var s=document.createElement("button");return s.classList.add("script-running-button"),s.textContent="実行(X)",e.appendChild(s),t.appendChild(e),e}(mt("wwa-debug-console-area")),null===(e=v._debugConsoleElement)||void 0===e||e.querySelector(".script-running-button").addEventListener("click",(function(){v._debugEvalString()})),v._gamePadStore=new ht,v._pages=[],v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._yesNoChoiceCallInfo=O.NONE,v._prevFrameEventExected=!1,v._isLastPage=!1,v._reservedPartsAppearances=[],v._reservedJumpDestination=void 0,v._shouldSetNextPage=!1,v._passwordLoadExecInNextFrame=!1,v._messageWindow=new Ve(v,50,180,340,0,v._wwaData.mapCGName,!1,!0,!1,mt("wwa-wrapper")),v._scoreWindow=new We(v,new d(50,50),!1,mt("wwa-wrapper")),v._wwaSave=new Di(Ws,Ws._wwaData.worldName,Ws._wwaData.worldPassNumber,v._checkSaveDataCompatibility.bind(v),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Ci.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Ci.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Ci.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),v._isDisallowLoadOldSave=c,v._messageWindow.setWWASave(v._wwaSave),oi.setRestartData(v._restartData,v._wwaData),v.clearFaces();var A=mt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof A&&(v._useSuspend=!0,A)){var C=oi.getStartWWAData(A);v._restartData!==C&&(v._applyQuickLoad(C),v._wwaSave.resumeStart())}var N=mt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==N&&v._wwaSave.setAutoSaveInterval(0|Number(N));var b=mt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(v._useLookingAround=!(b&&b.match(/false/i)),v._setProgressBar(Js(2,4,V.GAME_INIT)),v._setLoadingMessage(w,4),window.addEventListener("keydown",(function(t){if(v._isActive){if(v.userDevice.os===T.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setPressInfo(t.keyCode),t.keyCode!==tt.KEY_F5?v._player.isWaitingMessage()?t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_SPACE||t.preventDefault():v._player.isWaitingPasswordWindow()||t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_1&&t.keyCode!==tt.KEY_2&&t.keyCode!==tt.KEY_3&&t.keyCode!==tt.KEY_A&&t.keyCode!==tt.KEY_C&&t.keyCode!==tt.KEY_D&&t.keyCode!==tt.KEY_E&&t.keyCode!==tt.KEY_M&&t.keyCode!==tt.KEY_N&&t.keyCode!==tt.KEY_Q&&t.keyCode!==tt.KEY_S&&t.keyCode!==tt.KEY_W&&t.keyCode!==tt.KEY_X&&t.keyCode!==tt.KEY_Y&&t.keyCode!==tt.KEY_Z&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_F1&&t.keyCode!==tt.KEY_F2&&t.keyCode!==tt.KEY_F3&&t.keyCode!==tt.KEY_F4&&t.keyCode!==tt.KEY_F6&&t.keyCode!==tt.KEY_F7&&t.keyCode!==tt.KEY_F8&&t.keyCode!==tt.KEY_F12&&t.keyCode!==tt.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(v._isActive){if(v.userDevice.os===T.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setReleaseInfo(t.keyCode),t.keyCode===tt.KEY_F5?t.preventDefault():t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_1&&t.keyCode!==tt.KEY_2&&t.keyCode!==tt.KEY_3&&t.keyCode!==tt.KEY_A&&t.keyCode!==tt.KEY_C&&t.keyCode!==tt.KEY_D&&t.keyCode!==tt.KEY_E&&t.keyCode!==tt.KEY_M&&t.keyCode!==tt.KEY_N&&t.keyCode!==tt.KEY_Q&&t.keyCode!==tt.KEY_S&&t.keyCode!==tt.KEY_W&&t.keyCode!==tt.KEY_X&&t.keyCode!==tt.KEY_Y&&t.keyCode!==tt.KEY_Z&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_F1&&t.keyCode!==tt.KEY_F3&&t.keyCode!==tt.KEY_F4&&t.keyCode!==tt.KEY_F6&&t.keyCode!==tt.KEY_F7&&t.keyCode!==tt.KEY_F8&&t.keyCode!==tt.KEY_F9&&t.keyCode!==tt.KEY_F12&&t.keyCode!==tt.KEY_SPACE||v._player.isWaitingMessage()||v._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){v._isActive&&t.preventDefault()})),v._mouseControllerElement=mt("wwa-controller"),v._mouseControllerElement.addEventListener("mousedown",(function(t){if(v._isActive&&1===t.which){if(v._mouseStore.getMouseState()!==at.NONE)return void t.preventDefault();var e=St(t.clientX,t.clientY),i=v._player.getDrawingCenterPosition(),a=e.substract(i),s=Math.abs(a.x),r=Math.abs(a.y),n=void 0,o=!1;if(s<H.CHIP_SIZE&&r<H.CHIP_SIZE){switch(i.x/H.CHIP_SIZE|0){case 0:o=!0,n=u.LEFT;break;case H.H_PARTS_NUM_IN_WINDOW-1:o=!0,n=u.RIGHT}switch(i.y/H.CHIP_SIZE|0){case 0:o=!0,n=u.UP;break;case H.V_PARTS_NUM_IN_WINDOW-1:o=!0,n=u.DOWN}}o||(a.y>0&&r>s?n=u.DOWN:a.y<0&&r>s?n=u.UP:a.x>0&&r<s?n=u.RIGHT:a.x<0&&r<s&&(n=u.LEFT)),v._mouseStore.setPressInfo(n,0)}})),v._mouseControllerElement.addEventListener("mouseleave",(function(t){v._mouseStore.clear()})),v._mouseControllerElement.addEventListener("mouseup",(function(t){v._isActive&&1===t.which&&(v._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(v.audioContext){var x=function(){v.audioContext.createBufferSource().start(0),v._mouseControllerElement.removeEventListener("touchstart",x),x=null};v._mouseControllerElement.addEventListener("touchstart",x)}v._mouseControllerElement.addEventListener("touchstart",(function(t){if(v._isActive)if(v._mouseStore.getMouseState()===at.NONE){for(var e=t.changedTouches,i=e.length,a=0;a<i;a++){var s=e[a],r=St(s.clientX,s.clientY),n=v._player.getDrawingCenterPosition(),o=r.substract(n),c=Math.abs(o.x),h=Math.abs(o.y),_=void 0,l=!1;if(c<H.CHIP_SIZE&&h<H.CHIP_SIZE){switch(n.x/H.CHIP_SIZE|0){case 0:l=!0,_=u.LEFT;break;case H.H_PARTS_NUM_IN_WINDOW-1:l=!0,_=u.RIGHT}switch(n.y/H.CHIP_SIZE|0){case 0:l=!0,_=u.UP;break;case H.V_PARTS_NUM_IN_WINDOW-1:l=!0,_=u.DOWN}}l||(o.y>0&&h>c?_=u.DOWN:o.y<0&&h>c?_=u.UP:o.x>0&&h<c?_=u.RIGHT:o.x<0&&h<c&&(_=u.LEFT)),v._mouseStore.setPressInfo(_,s.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var M=function(t){if(v._isActive)for(var e=0;e<t.changedTouches.length;e++)if(v._mouseStore.getTouchID()===t.changedTouches[e].identifier){v._mouseStore.setReleaseInfo(),t.preventDefault();break}};v._mouseControllerElement.addEventListener("touchend",M),v._mouseControllerElement.addEventListener("touchcancel",M)}mt("button-load").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.QUICK_LOAD)})),mt("button-save").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.QUICK_SAVE)})),mt("button-restart").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.RESTART_GAME)})),mt("button-gotowwa").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(vt(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){v._displayHelp()}))})),v._frameCoord=new d(H.IMGPOS_DEFAULT_FRAME_X,H.IMGPOS_DEFAULT_YESNO_Y),v._battleEffectCoord=new d(H.IMGPOS_DEFAULT_BATTLE_EFFECT_X,H.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),v._battleEstimateWindow=new Ye(v,v._wwaData.mapCGName,mt("wwa-wrapper")),v._passwordWindow=new Je(v,mt("wwa-wrapper"),c),v._monsterWindow=new ke(v,new d(50,180),340,60,!1,mt("wwa-wrapper"),v._wwaData.mapCGName),v._setProgressBar(Js(3,4,V.GAME_INIT)),v._isLoadedSound=!1,v._temporaryInputDisable=!1,v._paintSkipByDoorOpen=!1,v._clearFacesInNextFrame=!1,v._useConsole=!1,v.wwaCustomEvent("wwa_startup"),v._cgManager=new Ot(_,v._wwaData.mapCGName,v._frameCoord,(function(){v._isSkippedSoundMessage=!0;var t=function(){switch(v.userDevice.device){case I.PC:v.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case I.SP:v.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}},e=v.resolveSystemMessage(s.CONFIRM_LOAD_SOUND);if("ON"===e)return v._isLoadedSound=!0,t(),v._setLoadingMessage(w,V.AUDIO),v.loadSound(),void window.requestAnimationFrame(v.soundCheckCaller);if("OFF"===e)return v._isLoadedSound=!1,t(),void v.openGameWindow();if(v._isSkippedSoundMessage=!1,v._hasTitleImg||w.clearRect(0,0,H.SCREEN_WIDTH,H.SCREEN_HEIGHT),v._usePassword){var i=e;E&&(i+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),v._messageWindow.setMessage(i),v._messageWindow.show(),v._setProgressBar(Js(4,4,V.GAME_INIT));var a=setInterval((function(){v._keyStore.update(),v._gamePadStore.update(),v._virtualPadStore.update(),v._yesNoJudgeInNextFrame===y.UNSELECTED&&(v._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||v._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||v._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||v._virtualPadStore.checkTouchButton("BUTTON_ENTER")?v._yesNoJudgeInNextFrame=y.YES:(v._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||v._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||v._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||v._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(v._yesNoJudgeInNextFrame=y.NO)),v._yesNoJudgeInNextFrame===y.YES?(clearInterval(a),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!0,v._setLoadingMessage(w,V.AUDIO),v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)}),H.YESNO_PRESS_DISP_FRAME_NUM*H.DEFAULT_FRAME_INTERVAL)):v._yesNoJudgeInNextFrame===y.NO&&(clearInterval(a),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!1,v.openGameWindow()}),H.YESNO_PRESS_DISP_FRAME_NUM*H.DEFAULT_FRAME_INTERVAL))}),H.DEFAULT_FRAME_INTERVAL)}else clearInterval(a),v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!0,v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)})),v.wwaCustomEvent("wwa_start")};var N=new ea;N.addListener("mapData",(function(t){return v._loadHandler(t)})),N.addListener("progress",(function(t){return v._setProgressBar(t)})),N.addListener("error",(function(t){return v._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,w)})),new ta(t,N).requestAndLoadMapData().then((function(){return Ks(v,void 0,void 0,(function(){var t;return js(this,(function(e){switch(e.label){case 0:return this._canDisplayUserVars=E,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[4,l?sa(l):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[3,2];case 1:t=e.sent(),this.setUserVarStatus(t,l),e.label=2;case 2:return[2]}}))}))})),Ks(v,void 0,void 0,(function(){var t,e,i,a=this;return js(this,(function(s){switch(s.label){case 0:return[4,sa("./script/script_file_list.json")];case 1:return t=s.sent(),e=[],console.log(t),"data"===(null==t?void 0:t.kind)&&Array.isArray(t.data)&&t.data.map((function(t){e.push(function(t){return Gs(void 0,void 0,void 0,(function(){var e;return Hs(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,fetch(t)];case 1:return 200!==(e=i.sent()).status&&304!==e.status?[3,3]:[4,new Response(e.body).text()];case 2:return[2,{kind:"data",data:i.sent()}];case 3:return[2,{kind:"httpError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。ステータスコード: ").concat(e.status)}];case 4:return[3,6];case 5:return[2,{kind:"otherError",errorMessage:i.sent().message}];case 6:return[2]}}))}))}(t))})),[4,Promise.all(e)];case 2:return s.sent().forEach((function(t){try{a.setUsertScript(t)}catch(t){console.error(t.message)}})),(i=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_WWA_START)&&this.evalCalcWwaNodeGenerator.evalWwaNode(i),[2]}}))})),this.evalCalcWwaNodeGenerator=new Fs(this)}return t.prototype.setEvalCalCWwaNodeReadOnlyItemValue=function(t,e){this.evalCalcWwaNodeGenerator.setReadOnlyItemValue(t,e)},t.prototype.callGetItemUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callGetItemFullUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM_FULL;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callUseItemUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_USE_ITEM;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callJumpGateUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_JUMPGATE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callMoveUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_MOVE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.getUserScript=function(t){return this.userDefinedFunctions&&this.userDefinedFunctions[t]||null},t.prototype.setUsertScript=function(t){var e=this;if("data"===t.kind){var i=this.convertWwaNodes(t.data);console.log(i),i.forEach((function(t){if("DefinedFunction"===t.type&&e.userDefinedFunctions){var i=t.functionName;e.userDefinedFunctions[i]=t.body}}))}else console.error(t)},t.prototype.setUserVarStatus=function(t,e){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return this._userVarNameListRequestError=t,void this._updateVarDumpInformationArea(this._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return this._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(e," が正しい形式で書かれていません。")},void this._updateVarDumpInformationArea(this._userVarNameListRequestError.errorMessage,!0);if(this._userVarNameList=this.convertUserVariableNameListToArray(t.data),null!==this._dumpElement)for(var i=function(){var t=s.toString(10);if(!a._userVarNameList[s])return"continue";var e=".var-index".concat(t),i=a._dumpElement.querySelector(e),r=i.querySelector("".concat(e," > div"));r.textContent=a._userVarNameList[s],i.setAttribute("data-labelled-var-index","true"),i.addEventListener("mouseover",(function(){return r.removeAttribute("aria-hidden")})),i.addEventListener("mouseleave",(function(){return r.setAttribute("aria-hidden","true")}))},a=this,s=0;s<H.USER_VAR_NUM;s++)i()}else this._updateVarDumpInformationArea(t.errorMessage,!1)},t.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(H.USER_VAR_NUM),i=0;i<H.USER_VAR_NUM;i++)e[i]=void 0;return Object.keys(t).forEach((function(i){var a=parseInt(i,10);"string"!=typeof t[i]||"string"!=typeof i||isNaN(a)||a<0||a>=H.USER_VAR_NUM||(e[a]=t[i])})),e},t.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=H.LOAD_STAGE_MAX_EXCEPT_AUDIO?(mt("progress-message-container").textContent=t.stage===H.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:et[t.stage],mt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(H.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*H.MAP_WINDOW_WIDTH+"px",mt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(H.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?mt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":mt("progress-message-container").textContent="ゲームデータを読み込んでいます。",mt("progress-bar-audio").style.width=t.current*H.MAP_WINDOW_WIDTH/t.total+"px",mt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},t.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=Z.TITLE+"px "+H.LOADING_FONT,t.fillText(it[0],J.TITLE_X,J.TITLE_Y),t.font=Z.FOOTER+"px "+H.LOADING_FONT,t.fillText("WWA Wing Ver.3.13.0-unstable.based-on.3.12.10",J.FOOTER_X,J.COPYRIGHT_Y);else if(e<=it.length)t.font=Z.LOADING+"px "+H.LOADING_FONT,e>=2&&(t.clearRect(J.LOADING_X,J.LOADING_Y+J.LINE*(e-3),H.SCREEN_WIDTH-J.LOADING_X,J.LINE),t.fillText(it[e-1]+" Complete!",J.LOADING_X,J.LOADING_Y+J.LINE*(e-2))),e<it.length&&t.fillText(it[e],J.LOADING_X,J.LOADING_Y+J.LINE*(e-1)),1==e&&(t.font=Z.FOOTER+"px "+H.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,J.FOOTER_X,J.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",J.FOOTER_X,J.WORLD_Y+J.LINE));else{var i;i=this._isSkippedSoundMessage?J.LOADING_Y+J.LINE*(it.length-1):J.FOOTER_Y,e<=V.AUDIO?t.fillText("Now Sound data Loading .....",J.LOADING_X,i):(t.clearRect(J.LOADING_X,i-J.LINE,H.SCREEN_WIDTH-J.LOADING_X,J.LINE),t.fillText("Now Sound data Loading ..... Complete!",J.LOADING_X,i))}},t.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,H.SCREEN_WIDTH,H.SCREEN_HEIGHT),e.font=Z.ERRROR+"px "+H.LOADING_FONT,t.split("\n").forEach((function(t,i){e.fillText(t,J.ERROR_X,J.ERROR_Y+J.LINE*i)})))},t.prototype.createSoundInstance=function(t){if(0!==t&&t!==k.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new xi(t,e,this.audioContext,this.audioGain)}},t.prototype.loadSound=function(){var t=this;this.sounds=new Array(H.SOUND_MAX+1),this.createSoundInstance(k.DECISION),this.createSoundInstance(k.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var i=this._wwaData.mapAttribute[e][H.ATR_SOUND];this.createSoundInstance(i)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][H.ATR_TYPE]!==H.OBJECT_RANDOM){i=this._wwaData.objectAttribute[e][H.ATR_SOUND];this.createSoundInstance(i)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var i=e.match(/^\$sound=(\d+)/);if(i&&!(i.length<2)){var a=parseInt(i[1],10);!isNaN(a)&&0<a&&a<k.NO_SOUND&&t.createSoundInstance(a)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},t.prototype.checkAllSoundLoaded=function(){var t=0,e=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(tt.KEY_SPACE)===$.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var a=1;a<=H.SOUND_MAX;a++){var s=this.sounds[a];void 0===s||s.isError()||(e++,s.hasData()&&t++)}if(t<e&&!this._soundLoadSkipFlag)return this._setProgressBar(Js(t,e,V.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Js(H.SOUND_MAX,H.SOUND_MAX,V.AUDIO)),this._setLoadingMessage(i,V.FINISH),this.openGameWindow()},t.prototype._setSoundLoadedCheckTimer=function(t){var e=this,i=this.sounds[t];i.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?i.hasData()?(i.play(e._wwaData.bgmDelayDurationMs),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):i.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},t.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},t.prototype.playSound=function(t,e){this._isLoadedSound?t<0||t>=H.SOUND_MAX?console.warn("サウンド番号が範囲外です。"):t>=k.BGM_LB&&this._wwaData.bgm===t||((t===k.NO_SOUND||t>=k.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].isPlaying()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==k.NO_SOUND&&(this.sounds[t].hasData()?t>=k.BGM_LB?(this.sounds[t].play(null!=e?e:this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=t):this.sounds[t].play():t>=k.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t)))):t===k.NO_SOUND?this._wwaData.bgm=0:t>=k.BGM_LB&&(this._wwaData.bgm=t)},t.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();mt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var i=mt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof i&&(this._useSuspend=!0,i)){var a=oi.getStartWWAData(i);this._restartData!==a&&(this._applyQuickLoad(a),this._wwaSave.resumeStart())}setTimeout((function(){mt("wwa-wrapper").removeChild(mt("wwa-cover")),t._main()}),H.SPLASH_SCREEN_DISP_MILLS)},t.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){mt("item"+(t-1)).classList.add("onpress"),this.playSound(k.DECISION);var e=this.resolveSystemMessage(s.CONFIRM_USE_ITEM);if("BLANK"===e){this._player.readyToUseItem(t);var i=this._player.useItem(),a=this.getObjectAttributeById(i,H.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(a),!1,!1,i,v.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(e,!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},t.prototype.onselectbutton=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var a=mt(R[t]);if(this.playSound(k.DECISION),this._itemMenu.close(),a.classList.add("onpress"),t===D.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case O.CALL_BY_QUICK_LOAD:case O.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case O.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case O.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case O.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case O.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case O.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case O.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===D.QUICK_SAVE)this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.generatePageAndReserveExecution("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_QUICK_SAVE));else if(t===D.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_RESTART_GAME;else if(t===D.GOTO_WWA)if(i)this._bottomButtonType!==h.GOTO_WWA&&mt(R[D.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=O.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=O.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},t.prototype.onpasswordloadcalled=function(){this._usePassword?(mt(R[D.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},t.prototype.onpasswordsavecalled=function(){mt(R[D.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_PASSWORD_SAVE)},t.prototype.onpasssuspendsavecalled=function(){mt(R[D.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_SUSPEND)},t.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(k.DECISION),this._itemMenu.openView()},t.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){switch(t){case P.UP:this._player.speedUp();break;case P.DOWN:this._player.speedDown()}var e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CHANGE_SPEED;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e);var i=this.resolveSystemMessage(s.GAME_SPEED_CHANGED);"BLANK"!==i&&this.generatePageAndReserveExecution(i,!1,!0)}else{var a=this.resolveSystemMessage(s.GAME_SPEED_CHANGE_DISABLED);"BLANK"!==a&&this.generatePageAndReserveExecution(a,!1,!0)}},t.prototype.isBattleSpeedIndexForQuickBattle=function(t){return H.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},t.prototype._executeNode=function(t,e){var i,a=this;if(t instanceof xe)return null===(i=t.macro)||void 0===i||i.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),Xs([t],this._executeNode(t.next,e),!0);if(t instanceof be){if(!e)throw new Error("パーツ起因ページによる実行ではないため、Junctionノードの利用を想定していません。");var s=t.evaluateAndGetNextNode((function(){return a.generateTokenValues(e)}));return s?this._executeNode(s,e):[]}return[]},t.prototype._executeNodes=function(t,e){try{return{isError:!1,messages:this._executeNode(t,e)}}catch(t){return{isError:!0}}},t.prototype._main=function(){var t,e=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var i=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return e.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return i&&this._drawAll(),void window.requestAnimationFrame(this.mainCaller);if(this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1),this._pages.length>0&&this._shouldSetNextPage)for(this._shouldSetNextPage=!1;this._pages.length>0;){var a=this._pages.shift(),s=this._executeNodes(a.firstNode,a.extraInfo?{position:a.extraInfo.partsPosition,type:a.extraInfo.partsType,id:a.extraInfo.partsId}:void 0);if(!0===s.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var r=s.messages.filter((function(t){return!t.isEmpty()})),n=Boolean(a.scoreOptions);if(n&&0===r.length&&r.push(new xe("スコアを表示します。")),r.length>0){var o=r.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(o),this._messageWindow.setYesNoChoice(a.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,n,a.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),n&&(this._lastScoreOptions=a.scoreOptions,this.updateScore(a.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=a.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests();break}}if(this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(O.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{var c=this._player.getDir(),h=[NaN,NaN,tt.KEY_DOWN,NaN,tt.KEY_LEFT,NaN,tt.KEY_RIGHT,NaN,tt.KEY_UP,NaN][c];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(tt.KEY_LEFT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_UP)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_RIGHT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_DOWN)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(h)?this._checkTurnKeyPressed()?this._player.setDir(c):(this._player.controll(c),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_DOWN")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(tt.KEY_1)===$.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(tt.KEY_2)===$.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(tt.KEY_3)===$.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(tt.KEY_Q)===$.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(tt.KEY_W)===$.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(tt.KEY_E)===$.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(tt.KEY_A)===$.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(tt.KEY_S)===$.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(tt.KEY_D)===$.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(tt.KEY_Z)===$.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(tt.KEY_X)===$.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(tt.KEY_C)===$.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(tt.KEY_I)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(P.DOWN):this._keyStore.getKeyState(tt.KEY_P)===$.KEYDOWN||this._keyStore.checkHitKey(tt.KEY_F2)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(P.UP):this._keyStore.getKeyState(tt.KEY_F1)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_M)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(tt.KEY_F3)?(this.playSound(k.DECISION),this.onselectbutton(D.QUICK_LOAD,!0)):this._keyStore.checkHitKey(tt.KEY_F4)?(this.playSound(k.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(tt.KEY_F5)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_ZR)?this.onselectbutton(D.QUICK_LOAD):this._keyStore.checkHitKey(tt.KEY_F6)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_ZL)?this.onselectbutton(D.QUICK_SAVE):this._keyStore.checkHitKey(tt.KEY_F7)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_R)?this.onselectbutton(D.RESTART_GAME):this._keyStore.checkHitKey(tt.KEY_F8)?this.onselectbutton(D.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(tt.KEY_F9)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(tt.KEY_V)?this._displayUserVars():this._keyStore.checkHitKey(tt.KEY_X)?this._debugConsoleElement&&this._debugEvalString():(this._keyStore.checkHitKey(tt.KEY_F12)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_Y))&&this._displayHelp()),[{key:tt.KEY_A,func:"CALL_PUSH_A"},{key:tt.KEY_B,func:"CALL_PUSH_B"},{key:tt.KEY_C,func:"CALL_PUSH_C"},{key:tt.KEY_D,func:"CALL_PUSH_D"},{key:tt.KEY_E,func:"CALL_PUSH_E"},{key:tt.KEY_F,func:"CALL_PUSH_F"},{key:tt.KEY_G,func:"CALL_PUSH_G"},{key:tt.KEY_H,func:"CALL_PUSH_H"},{key:tt.KEY_I,func:"CALL_PUSH_I"},{key:tt.KEY_J,func:"CALL_PUSH_J"},{key:tt.KEY_K,func:"CALL_PUSH_K"},{key:tt.KEY_L,func:"CALL_PUSH_L"},{key:tt.KEY_M,func:"CALL_PUSH_M"},{key:tt.KEY_N,func:"CALL_PUSH_N"},{key:tt.KEY_O,func:"CALL_PUSH_O"},{key:tt.KEY_P,func:"CALL_PUSH_P"},{key:tt.KEY_Q,func:"CALL_PUSH_Q"},{key:tt.KEY_R,func:"CALL_PUSH_R"},{key:tt.KEY_S,func:"CALL_PUSH_S"},{key:tt.KEY_T,func:"CALL_PUSH_T"},{key:tt.KEY_U,func:"CALL_PUSH_U"},{key:tt.KEY_V,func:"CALL_PUSH_V"},{key:tt.KEY_W,func:"CALL_PUSH_W"},{key:tt.KEY_X,func:"CALL_PUSH_X"},{key:tt.KEY_Y,func:"CALL_PUSH_Y"},{key:tt.KEY_Z,func:"CALL_PUSH_Z"},{key:tt.KEY_ENTER,func:"CALL_PUSH_ENTER"},{key:tt.KEY_ESC,func:"CALL_PUSH_ESC"},{key:tt.KEY_SPACE,func:"CALL_PUSH_SPACE"},{key:tt.KEY_LEFT,func:"CALL_PUSH_LEFT"},{key:tt.KEY_RIGHT,func:"CALL_PUSH_RIGHT"},{key:tt.KEY_UP,func:"CALL_PUSH_UP"},{key:tt.KEY_DOWN,func:"CALL_PUSH_DOWN"}].forEach((function(t){if(e._keyStore.checkHitKey(t.key)){var i=e.userDefinedFunctions&&e.userDefinedFunctions[t.func];i&&e.evalCalcWwaNodeGenerator.evalWwaNode(i)}}))}this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame()}else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update(),this._player.getPosition().isJustPosition()&&this._dispatchPlayerAndObjectsStopTimeRequests();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(tt.KEY_LEFT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(tt.KEY_UP)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(tt.KEY_RIGHT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(tt.KEY_DOWN)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===y.UNSELECTED&&(this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=y.YES:(this._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=y.NO)),(this._yesNoJudge===y.YES||this._yesNoJudge===y.NO)&&(this.playSound(k.DECISION),this._yesNoDispCounter=H.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(tt.KEY_LEFT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(tt.KEY_UP)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(tt.KEY_RIGHT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(tt.KEY_DOWN)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER"))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var _=0;_<R.length;_++){(f=mt(R[_])).classList.contains("onpress")&&f.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(k.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var l=this._keyStore.getKeyStateForMessageCheck(tt.KEY_ENTER),p=this._keyStore.getKeyStateForMessageCheck(tt.KEY_SPACE),d=this._keyStore.getKeyStateForMessageCheck(tt.KEY_ESC);if(l===$.KEYDOWN||l===$.KEYPRESS_MESSAGECHANGE||p===$.KEYDOWN||p===$.KEYPRESS_MESSAGECHANGE||d===$.KEYDOWN||d===$.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===at.MOUSEDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(_=0;_<R.length;_++){var f;(f=mt(R[_])).classList.contains("onpress")&&f.classList.remove("onpress")}this._setNextPage()}}if(null===(t=this._inlineUserVarViewer)||void 0===t?void 0:t.isVisible){var E=!1;this._keyStore.getKeyState(tt.KEY_DOWN)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,E=!0),this._keyStore.getKeyState(tt.KEY_UP)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,E=!0),this._keyStore.getKeyState(tt.KEY_RIGHT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,E=!0),this._keyStore.getKeyState(tt.KEY_LEFT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,E=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=H.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>H.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=H.USER_VAR_NUM),E&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(tt.KEY_V)===$.KEYDOWN&&this._setNextPage()}}else this._player.isWaitingEstimateWindow()?(this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_SPACE)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._shouldTreatWillMessageDisplay(this._pages)||this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWaitingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var m=this.checkMap();m||this.checkObject(),this._prevFrameEventExected=m}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==y.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=N.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*H.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&mt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&mt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&mt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&mt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&(this._player.decrementMoveObjectAutoExecTimer(),this._player.isWaitingMoveMacro()||this._dispatchPlayerAndObjectsStopTimeRequests()),this._stopUpdateByLoadFlag?this._fadeout((function(){if(e._loadType===N.QUICK_LOAD){e._quickLoad(),e.wwaCustomEvent("wwa_quickload");var t=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_QUICKLOAD;t&&e.evalCalcWwaNodeGenerator.evalWwaNode(t)}else if(e._loadType===N.RESTART_GAME){e.restartGame(),e.wwaCustomEvent("wwa_restert");var i=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_RESTART;i&&e.evalCalcWwaNodeGenerator.evalWwaNode(i)}else if(e._loadType===N.PASSWORD){e._applyQuickLoad(e._passwordSaveExtractData),e._passwordSaveExtractData=void 0,e.wwaCustomEvent("wwa_passwordload");var a=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_PASSWORDLOAD;a&&e.evalCalcWwaNodeGenerator.evalWwaNode(a)}setTimeout(e.mainCaller,H.DEFAULT_FRAME_INTERVAL,e)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(_=0;_<H.USER_VAR_NUM;_++){var g=_.toString(10);this._dumpElement.querySelector(".var".concat(g)).textContent=this._wwaData.userVar[_]+""}var w=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_FRAME;w&&this.evalCalcWwaNodeGenerator.evalWwaNode(w)},t.prototype.vibration=function(t){this._gamePadStore.vibration(t)},t.prototype._drawAll=function(){var t,e,i=this._camera.getPosition().getPartsCoord(),a=this._camera.getPosition().getOffsetCoord(),s=H.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,H.MAP_WINDOW_WIDTH,H.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,H.MAP_WINDOW_WIDTH,H.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var n=this._camera.getPreviousPosition().getPartsCoord(),o=this._camera.getPreviousPosition().getOffsetCoord();s=this._camera.getTransitionStepNum()*H.CHIP_SIZE}var c=!1;if(s!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=s,c=!0),i.x===this._cgManager.cpPartsLog.x&&i.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=i.x,this._cgManager.cpPartsLog.y=i.y,c=!0),c&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(n,o,s,!0),this._drawPlayer(n,o,s,!0),this._drawObjects(n,o,s,!0),this._camera.isFinalStep()))var h=255,u=setInterval((function(){var t=mt("wwa-fader");if((h-=3*H.FADEOUT_SPEED)<=0)return clearInterval(u),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=h/255+""}),20);this._drawMap(i,a,s,!1,c),this._drawPlayer(i,a,s),this._drawObjects(i,a,s,!1,c),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:r.x,e=this._player.isTurn()?this._monster.position.y:r.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,H.CHIP_SIZE*(t-i.x)-a.x,H.CHIP_SIZE*(e-i.y)-a.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},t.prototype._drawMap=function(t,e,i,a,s){if(void 0===a&&(a=!1),void 0===s&&(s=!1),void 0!==t){var r,n=Math.max(0,t.x-1),o=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),c=Math.max(0,t.y-1),h=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW);if(r=0,a)for(var u=n;u<=o;u++)for(var _=c;_<=h;_++){var l=this._wwaData.map[_][u],p=this._wwaData.mapAttribute[l][H.ATR_X]/H.CHIP_SIZE,d=this._wwaData.mapAttribute[l][H.ATR_Y]/H.CHIP_SIZE,f=H.CHIP_SIZE*(u-t.x)-e.x,E=H.CHIP_SIZE*(_-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,f,E,i)}else{for(u=n;u<=o;u++)for(_=c;_<=h;_++){l=this._wwaData.map[_][u];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,s=!0),r++}if(s){this._cgManager.clearBackCanvasWithLowerYLimit(i);for(u=n;u<=o;u++)for(_=c;_<=h;_++){l=this._wwaData.map[_][u],p=this._wwaData.mapAttribute[l][H.ATR_X]/H.CHIP_SIZE,d=this._wwaData.mapAttribute[l][H.ATR_Y]/H.CHIP_SIZE,f=H.CHIP_SIZE*(u-t.x)-e.x,E=H.CHIP_SIZE*(_-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,f,E,i)}}this._cgManager.drawBackCanvas()}}},t.prototype._drawPlayer=function(t,e,i,a){if(void 0===a&&(a=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var s,r=this._player.getPosition().getPartsCoord(),n=this._player.getPosition().getOffsetCoord(),o=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],c=(r.x-t.x)*H.CHIP_SIZE+n.x-e.x,h=(r.y-t.y)*H.CHIP_SIZE+n.y-e.y;if(this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()){s=this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]}else s=this._player.isMovingImage()?this._wwaData.playerImgPosX+o+1:this._wwaData.playerImgPosX+o;a?this._cgManager.drawCanvasWithLowerYLimit(s,this._wwaData.playerImgPosY,c,h,i):this._cgManager.drawCanvasWithUpperYLimit(s,this._wwaData.playerImgPosY,c,h,i)}},t.prototype._drawObjects=function(t,e,i,a,s){if(void 0===a&&(a=!1),void 0===s&&(s=!1),void 0!==t){var r,n,o,c,h,u,_,l,p,f,E,y,g,w,v=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),A=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW),I=0,C=this._animationCounter>H.ANIMATION_REP_HALF_FRAME,O=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(a)for(f=v;f<=S;f++)for(E=A;E<=T;E++)O&&new d(f,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][f],r=new d(0,0),this._wwaData.objectAttribute[y][H.ATR_MOVE]!==b.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new d(f,E)))&&(r=p),h=H.CHIP_SIZE*(f-t.x)+r.x-e.x,u=H.CHIP_SIZE*(E-t.y)+r.y-e.y,n=C||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,_=this._wwaData.objectAttribute[y][H.ATR_TYPE],l=this._wwaData.objectAttribute[y][H.ATR_NUMBER],0===y||this._checkNoDrawObject(new d(f,E),_,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(C?1:0,o,c,h,u,i));else{var D,P,N,x,M,L=[],R=[];for(f=v;f<=S;f++)for(E=A;E<=T;E++)g=y=this._wwaData.mapObject[E][f],_=this._wwaData.objectAttribute[y][H.ATR_TYPE],l=this._wwaData.objectAttribute[y][H.ATR_NUMBER],this._checkNoDrawObject(new d(f,E),_,l)&&(g=0),P=this._wwaData.objectAttribute[y][H.ATR_MOVE]===b.STATIC,0!==g&&(N=!(!O||!new d(f,E).equals(this._monster.position)),P?R.push(new m(y,f,E,P,N)):(L.push(new m(y,f,E,P,N)),g=0),N&&(g=0)),this._cgManager.mapObjectCache[I]!==g&&(this._cgManager.mapObjectCache[I]=g,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(i),Array.prototype.push.apply(L,R)),M=L.length,x=0;x<M;x++)if(f=(D=L[x]).x,E=D.y,y=D.partsIDObj,P=D.isStatic,N=D.isFighting,h=H.CHIP_SIZE*(f-t.x)-e.x,u=H.CHIP_SIZE*(E-t.y)-e.y,P){if(N)continue;for(w=0;w<2;w++)n=!!w||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(w,o,c,h,u,i)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new d(f,E)))&&(h+=p.x,u+=p.y),n=C||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(o,c,h,u,i);this._cgManager.drawObjectCanvas(C?1:0)}}},t.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},t.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},t.prototype._drawFrame=function(){this._cgManager.drawFrame()},t.prototype._checkNoDrawObject=function(t,e,i){var a=this._player.getPosition(),s=a.getPartsCoord();return!(!a.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===H.OBJECT_DOOR&&0===i||(e===H.OBJECT_STATUS||e===H.OBJECT_MESSAGE||e===H.OBJECT_ITEM||e===H.OBJECT_SELL||e===H.OBJECT_BUY||e===H.OBJECT_SELL||e===H.OBJECT_LOCALGATE))},t.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},t.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},t.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},t.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),i=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[i][H.ATR_TYPE]},t.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),i=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[i][H.ATR_TYPE]},t.prototype.getMapAttributeByPosition=function(t,e){var i=t.getPartsCoord(),a=this._wwaData.map[i.y][i.x];return this._wwaData.mapAttribute[a][e]},t.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,H.ATR_STRING)},t.prototype.getObjectAttributeByPosition=function(t,e){var i=t.getPartsCoord(),a=this._wwaData.mapObject[i.y][i.x];return this._wwaData.objectAttribute[a][e]},t.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},t.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},t.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][H.ATR_X]},t.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][H.ATR_Y]},t.prototype.getMessageById=function(t){return this._wwaData.message[t]},t.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},t.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var i=this._wwaData.map[t.y][t.x],a=this._wwaData.mapAttribute[i][H.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(v.MAP)!==i)&&(a===H.MAP_STREET?r=this._execMapStreetEvent(t,i,a):a===H.MAP_WALL?r=this._execMapWallEvent(t,i,a):a===H.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,i,a):a===H.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,i,a)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.MAP,i),r)},t.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var i=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.objectAttribute[i][H.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(v.OBJECT)===i||(a===H.OBJECT_NORMAL?this._execObjectNormalEvent(t,i,a):a===H.OBJECT_MESSAGE?this._execObjectMessageEvent(t,i,a):a===H.OBJECT_MONSTER?this._execObjectMonsterEvent(t,i,a):a===H.OBJECT_ITEM?this._execObjectItemEvent(t,i,a):a===H.OBJECT_DOOR?this._execObjectDoorEvent(t,i,a):a===H.OBJECT_STATUS?this._execObjectStatusEvent(t,i,a):a===H.OBJECT_BUY?this._execObjectBuyEvent(t,i,a):a===H.OBJECT_SELL?this._execObjectSellEvent(t,i,a):a===H.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,i,a):a===H.OBJECT_SCORE?this._execObjectScoreEvent(t,i,a):a===H.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,i,a):a===H.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,i,a),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.OBJECT,i))},t.prototype._execMapStreetEvent=function(t,e,i){var a=this._wwaData.mapAttribute[e][H.ATR_ITEM];if(0!==a&&!this._player.hasItem(a))return!1;this.reserveAppearPartsInNextFrame(t,g.MAP,e);var s=this._wwaData.mapAttribute[e][H.ATR_STRING],r=this._wwaData.message[s],n=this._wwaData.mapAttribute[e][H.ATR_NUMBER];return this._waitFrame+=n*H.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==n},t.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Me(e.firstNode)}),!1)},t.prototype._execMapWallEvent=function(t,e,i){var a=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(a,H.ATR_TYPE);if(0===a||s===H.OBJECT_NORMAL||s===H.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(a,H.ATR_ITEM))||this.getObjectAttributeById(s,H.ATR_MODE)===H.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,g.MAP,e);var r=this._wwaData.mapAttribute[e][H.ATR_STRING],n=this._wwaData.message[r];return this.generatePageAndReserveExecution(n,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),!1}return!1},t.prototype._execMapLocalGateEvent=function(t,e,i){var a=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][H.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][H.ATR_JUMP_Y];return s>H.RELATIVE_COORD_LOWER&&(s=t.x+s-H.RELATIVE_COORD_BIAS),r>H.RELATIVE_COORD_LOWER&&(r=t.y+r-H.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,g.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==a.x||r!==a.y)&&(this.reserveJumpInNextFrame(new f(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),!0)},t.prototype._execMapUrlGateEvent=function(t,e,i){var a=this._wwaData.mapAttribute[e][H.ATR_STRING];if(!this._isURLGateEnable)return!0;var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);if("BLANK"!==r)return this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0],!0;location.href=At(this._wwaData.message[a].split(/\s/g)[0])},t.prototype._execObjectNormalEvent=function(t,e,i){},t.prototype._execObjectMessageEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord(),n=this._wwaData.objectAttribute[e][H.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!1,!1,e,v.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][H.ATR_NUMBER]*H.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this.playSound(n)},t.prototype._execObjectStatusEvent=function(t,e,i){var a=new p(this._wwaData.objectAttribute[e][H.ATR_ENERGY],this._wwaData.objectAttribute[e][H.ATR_STRENGTH],this._wwaData.objectAttribute[e][H.ATR_DEFENCE],this._wwaData.objectAttribute[e][H.ATR_GOLD]),s=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[s],n=this._player.getStatusWithoutEquipments();if(a.strength>H.STATUS_MINUS_BORDER&&n.strength<a.strength-H.STATUS_MINUS_BORDER||a.defence>H.STATUS_MINUS_BORDER&&n.defence<a.defence-H.STATUS_MINUS_BORDER||a.gold>H.STATUS_MINUS_BORDER&&n.gold<a.gold-H.STATUS_MINUS_BORDER)return this.setPartsOnPosition(v.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();a.energy=a.energy>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.energy:a.energy,a.strength=a.strength>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.strength:a.strength,a.defence=a.defence>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.defence:a.defence,a.gold=a.gold>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.gold:a.gold,this._player.addStatusAll(a),this.setStatusChangedEffect(a),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][H.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]))},t.prototype._execObjectMonsterEvent=function(t,e,i){var a=this,s=new d(this._wwaData.objectAttribute[e][H.ATR_X],this._wwaData.objectAttribute[e][H.ATR_Y]),r=new p(this._wwaData.objectAttribute[e][H.ATR_ENERGY],this._wwaData.objectAttribute[e][H.ATR_STRENGTH],this._wwaData.objectAttribute[e][H.ATR_DEFENCE],this._wwaData.objectAttribute[e][H.ATR_GOLD]),n=this._wwaData.message[this._wwaData.objectAttribute[e][H.ATR_STRING]],o=this._wwaData.objectAttribute[e][H.ATR_ITEM];this._monster=new Mt(e,t,s,r,n,o,(function(){a._monsterWindow.hide(),a._dispatchWindowClosedTimeRequests()})),this._player.startBattleWith(this._monster)},t.prototype._execObjectBuyEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectSellEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectItemEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[a];try{var n=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-n.x)*H.CHIP_SIZE,c=(t.y-n.y)*H.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][H.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new d(o,c),itemBoxBackgroundImageCoord:new d(this._wwaData.imgItemboxX*H.CHIP_SIZE,this._wwaData.imgItemboxY*H.CHIP_SIZE)}:void 0),this.setPartsOnPosition(v.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][H.ATR_MODE]||(this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e))}catch(t){var h=this.resolveSystemMessage(s.ITEM_BOX_FULL);"BLANK"!==h&&this.generatePageAndReserveExecution(h,!1,!0)}this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectDoorEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_ITEM],s=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(a)&&(0===this._wwaData.objectAttribute[e][H.ATR_MODE]&&this._player.removeItemByPartsID(a),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this._paintSkipByDoorOpen=!0)},t.prototype._execObjectYesNoChoiceEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectLocalGateEvent=function(t,e,i){var a=this._player.getPosition().getPartsCoord();t.x!==a.x||t.y!==a.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][H.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][H.ATR_JUMP_Y];s>H.RELATIVE_COORD_LOWER&&(s=a.x+s-H.RELATIVE_COORD_BIAS),r>H.RELATIVE_COORD_LOWER&&(r=a.y+r-H.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==a.x||r!==a.y)&&(this.reserveJumpInNextFrame(new f(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]))},t.prototype._execObjectUrlGateEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING];if(this._isURLGateEnable){var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);"BLANK"!==r?(this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0]):location.href=At(this._wwaData.message[a].split(/\s/g)[0])}},t.prototype._execObjectScoreEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[a],!1,!1,e,v.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][H.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][H.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][H.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][H.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var i=this._player.getStatus().calculateScore(e);this._scoreWindow.update(i)}},t.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD]))return"BLANK"!==(o=this.resolveSystemMessage(s.NO_MONEY))&&this._pages.push(new Pe(new xe(o),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(t.x-e.x)*H.CHIP_SIZE,a=(t.y-e.y)*H.CHIP_SIZE,r=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM],n=this._wwaData.objectAttribute[r][H.ATR_NUMBER];try{this._player.addItem(r,n,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new d(i,a),itemBoxBackgroundImageCoord:new d(this._wwaData.imgItemboxX*H.CHIP_SIZE,this._wwaData.imgItemboxY*H.CHIP_SIZE)}:void 0)}catch(t){var o;return"BLANK"!==(o=this.resolveSystemMessage(s.ITEM_BOX_FULL))&&this._pages.push(new Pe(new xe(o),!0,!1,!0)),{}}}var c=new p(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD]);return c.energy=c.energy>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-c.energy:c.energy,this.setStatusChangedEffect(c),this._player.addStatusAll(c),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:g.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},t.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===y.YES){if(this._yesNoChoiceCallInfo===O.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.MAP_URLGATE&&(location.href=At(this._yesNoURL));else if(this._yesNoChoiceCallInfo===O.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.OBJECT_BUY)if(this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]))this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new p(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.OBJECT,this._yesNoChoicePartsID);else{var i=this.resolveSystemMessage(s.NO_ITEM);"BLANK"!==i&&this._pages.push(new Pe(new xe(i),!0,!1,!0))}else if(t===H.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===H.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.CHOICE_YES,this._yesNoChoicePartsID):t===H.OBJECT_URLGATE&&(location.href=At(this._yesNoURL));else this._yesNoChoiceCallInfo===O.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===O.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),mt(R[D.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=N.QUICK_LOAD)):this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(O.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===O.CALL_BY_RESTART_GAME?(mt(R[D.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=N.RESTART_GAME):this._yesNoChoiceCallInfo===O.CALL_BY_END_GAME?(window.history.back(-1),mt(R[D.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===O.CALL_BY_GOTO_WWA?(location.href=At(H.WWA_HOME),mt(R[D.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_LOAD?(mt(R[D.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Ke.LOAD)):this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_SAVE?(mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(O.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Ke.SAVE)):this._yesNoChoiceCallInfo===O.CALL_BY_SUSPEND&&(mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(O.CALL_BY_SUSPEND));this._yesNoJudge=y.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===y.NO){if(this._yesNoChoiceCallInfo===O.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][H.ATR_TYPE],H.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===O.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.OBJECT_BUY||t===H.OBJECT_SELL||(t===H.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.CHOICE_NO,this._yesNoChoicePartsID):H.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===O.CALL_BY_ITEM_USE){mt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===O.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case O.NONE:mt(R[D.QUICK_LOAD]).classList.remove("onpress");break;case O.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=y.UNSELECTED,void this.onpasswordloadcalled();case O.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var a=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=y.UNSELECTED,a){case O.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case O.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=y.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());mt(R[D.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===O.CALL_BY_RESTART_GAME)mt(R[D.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_END_GAME)mt(R[D.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_GOTO_WWA)mt(R[D.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_LOAD)mt(R[D.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_SAVE)mt(R[D.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=y.UNSELECTED,void this.onpasswordsavecalled();mt(R[D.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=y.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._messageWindow.setYesNoChoice(!1)}},t.prototype._dispatchWindowClosedTimeRequests=function(){if(this._windowCloseWaitingJumpGateRequest&&this.forcedJumpGate(this._windowCloseWaitingJumpGateRequest.x,this._windowCloseWaitingJumpGateRequest.y),this._windowCloseWaitingMessageDisplayRequests.length>0){var t=this._windowCloseWaitingMessageDisplayRequests.shift();this.generatePageAndReserveExecution(t,!1,!1)}},t.prototype._dispatchPlayerAndObjectsStopTimeRequests=function(){this._playerAndObjectsStopWaitingGameSpeedChangeRequest&&(this.setPlayerSpeedIndex(this._playerAndObjectsStopWaitingGameSpeedChangeRequest.speedIndex),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0),this._playerAndObjectsStopWaitingMessageDisplayRequests.length>0&&(this.generatePageAndReserveExecution(this._playerAndObjectsStopWaitingMessageDisplayRequests.join("<p>"),!1,!1),this._playerAndObjectsStopWaitingMessageDisplayRequests=[])},t.prototype._clearAllRequests=function(){this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingJumpGateRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[]},t.prototype.reserveMessageDisplayWhenShouldOpen=function(t){this._player.isWaitingMessage()||this._player.isFighting()||this._player.isWaitingPasswordWindow()||this._player.isWaitingEstimateWindow()?this._windowCloseWaitingMessageDisplayRequests.push(t):this._player.isMoving()||this._player.isWaitingMoveMacro()?this._playerAndObjectsStopWaitingMessageDisplayRequests.push(t):this.generatePageAndReserveExecution(t,!1,!1)},t.prototype.generatePageAndReserveExecution=function(t,e,i,a,s,r,n){void 0===a&&(a=0),void 0===s&&(s=v.OBJECT),void 0===r&&(r=new d(0,0)),void 0===n&&(n=void 0);var o=this.generatePagesByRawMessage(t,a,s,r,i,e,n);this._pages=this._pages.concat(o),this._shouldSetNextPage=!0},t.prototype.generatePagesByRawMessage=function(t,e,i,a,s,r,n){var o=this,c=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>").split("\n").map((function(t){if(!t.startsWith("//"))return t.match(/\/\//)?It(It(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//").split("<script>"),h=c[0];if(c.length>1){var u=c[1];this._execEvalString(u)}if(""===h)return n?[new Pe(void 0,!0,!1,!1,n,{partsId:e,partsType:i,partsPosition:a})]:[];var _=h.split(/\<p\>/gi);return _.map((function(t,c){var h=void 0,u=void 0,l=void 0,p={id:e,type:i,position:a},d=o.parseMessageLines(t,e,i,a),f=[];return d.forEach((function(t,e){try{var i=0===e?void 0:d[e-1].type,a=f[f.length-1],s=o.createNewNode(t,!h||!Le(i),{triggerParts:p}),r=o.processConditionalExecuteMacroLine(s,t,a,f);r&&(l=r),i?o.connectOrMergeToPreviousNode(t,i,u,s,a,l,{triggerParts:p}):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new Pe(h,c===_.length-1,0===c&&r,s,0===c&&n,{partsId:e,partsType:i,partsPosition:a})}))},t.prototype.parseMessageLines=function(t,e,i,a){var s=this;return t.split("\n").map((function(t){var r=t.match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)(?:.*))/);if(!r||r.length<2)return t.startsWith("$")?void 0:{type:"text",text:t};var n=function(t,e,i,a,s){var r,n=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==n&&3===n.length||null!==(n=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===n.length))throw new Error("マクロではありません");var o=n[1],c="$".concat(o.toLowerCase()),h="$if"===c&&s.match(/,/)?L.LEGACY_IF:W[c],u=Boolean(h!==L.SHOW_STR&&h!==L.SHOW_STR2),_=(null!==(r=n[2])&&void 0!==r?r:"").split(",").map((function(t){return u?t.trim():t}));return new Re(t,e,i,a,void 0===h?L.UNDEFINED:h,_)}(s,e,i,a,r[1]);switch(n.macroType){case L.IF:case L.ELSE_IF:case L.ELSE:case L.END_IF:case L.SHOW_STR:case L.SHOW_STR2:return{type:n.macroType,text:t,macro:n};default:return{type:"normalMacro",text:t,macro:n}}})).filter(Boolean)},t.prototype.createNewNode=function(t,e,i){switch(t.type){case L.IF:return new be([{descriminant:Oe(t.macro.macroArgs[0])}]);case L.SHOW_STR:case L.SHOW_STR2:return e?new xe(this._generateShowStrString(t.macro.macroArgs,{triggerParts:i.triggerParts,version:t.type===L.SHOW_STR2?2:1})):void 0;case"text":return e?new xe(t.text):void 0;case"normalMacro":return e?new xe("",[t.macro]):void 0;default:return}},t.prototype.processConditionalExecuteMacroLine=function(t,e,i,a){var s=0===a.length;switch(e.type){case L.IF:return void a.push(t);case L.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void i.appendBranch({descriminant:Oe(e.macro.macroArgs[0])});case L.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void i.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case L.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return a.pop()}},t.prototype.connectOrMergeToPreviousNode=function(t,e,i,a,s,r,n){var o=Le(e);switch(e){case L.IF:case L.ELSE_IF:case L.ELSE:if(!a||!s)return;var c=s.getLastUnconnectedBranch();if(!c)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(c.next=a);case L.END_IF:if(!(a&&r instanceof be))return;for(var h=0;h<r.branches.length;h++){var u=r.branches[h].next;u?this.connectToFinalNode(u,a):r.branches[h]=a}return void(r.hasElseBranch()||r.branches.push({next:a,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(o&&i instanceof xe))return;var _=!i.isEmpty();t.type===L.SHOW_STR||t.type===L.SHOW_STR2?i.appendMessage(this._generateShowStrString(t.macro.macroArgs,{triggerParts:n.triggerParts,version:t.type===L.SHOW_STR2?2:1}),_):"text"===t.type?i.appendMessage(t.text,_):"normalMacro"===t.type?i.macro.push(t.macro):i.next=a}},t.prototype.connectToFinalNode=function(t,e){for(var i=t;;)if(i instanceof be&&(i=i.branches[0].next),i instanceof xe){if(!i.next)return void(i.next=e);i=i.next}},t.prototype.appearParts=function(t){var e,i,a,s,r,n,o=t.pos,c=t.triggerType,h=t.triggerPartsId,u=c===g.CHOICE_NO?H.APPERANCE_PARTS_MIN_INDEX_NO:H.APPERANCE_PARTS_MIN_INDEX,_=c===g.CHOICE_YES?H.APPERANCE_PARTS_MAX_INDEX_YES:H.APPERANCE_PARTS_MAX_INDEX;for(c===g.MAP?(h=0===h?this._wwaData.map[o.y][o.x]:h,e=v.MAP):(h=0===h?this._wwaData.mapObject[o.y][o.x]:h,e=v.OBJECT),n=u;n<=_;n++){var l=H.ATR_APPERANCE_BASE+n*H.REL_ATR_APPERANCE_UNIT_LENGTH,p=l+H.REL_ATR_APPERANCE_ID,E=l+H.REL_ATR_APPERANCE_X,m=l+H.REL_ATR_APPERANCE_Y,y=l+H.REL_ATR_APPERANCE_TYPE;if(i=e===v.MAP?this._wwaData.mapAttribute[h][p]:this._wwaData.objectAttribute[h][p],a=e===v.MAP?this._wwaData.mapAttribute[h][y]:this._wwaData.objectAttribute[h][y],s=e===v.MAP?this._wwaData.mapAttribute[h][E]:this._wwaData.objectAttribute[h][E],r=e===v.MAP?this._wwaData.mapAttribute[h][m]:this._wwaData.objectAttribute[h][m],s===H.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>H.RELATIVE_COORD_LOWER&&(s=o.x+s-H.RELATIVE_COORD_BIAS),r===H.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>H.RELATIVE_COORD_LOWER&&(r=o.y+r-H.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new f(this,s,r,0,0),a===v.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var w=new d(s,r);this.setPartsOnPosition(v.MAP,i,w)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");w=new d(s,r);this.setPartsOnPosition(v.OBJECT,i,w),this._replaceRandomObject(new d(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},t.prototype.reserveAppearPartsInNextFrame=function(t,e,i){void 0===i&&(i=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:i})},t.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},t.prototype.appearPartsByDirection=function(t,e,i){var a=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=S[s],n=A[s];this.appearPartsEval(a,(r>=0?"+":"-")+Math.abs(r)*t,(n>=0?"+":"-")+Math.abs(n)*t,e,i)},t.prototype.appearPartsEval=function(t,e,i,a,s){var r,n,o=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=o.x;else if("+"===e[0])r=t.x+parseInt(e.substr(1));else if("-"===e[0])r=t.x-parseInt(e.substr(1));else if(r=parseInt(e),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");if("P"===i||"p"===i)n=o.y;else if("+"===i[0])n=t.y+parseInt(i.substr(1));else if("-"===i[0])n=t.y-parseInt(i.substr(1));else if(n=parseInt(i),isNaN(n))throw new Error("座標として解釈できない文字が含まれています。");try{new f(this,r,n,0,0);if(s===v.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var c=new d(r,n);this.setPartsOnPosition(v.MAP,a,c)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");c=new d(r,n);this.setPartsOnPosition(v.OBJECT,a,c),this._replaceRandomObject(new d(r,n)),r===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},t.prototype.getPartsID=function(t,e){if(t.x<0||t.y<0)throw new Error("想定外の座標が指定されました");return e===v.MAP?this._wwaData.map[t.y][t.x]:this._wwaData.mapObject[t.y][t.x]},t.prototype._replaceRandomObject=function(t){var e,i,a=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[a][H.ATR_TYPE]===H.OBJECT_RANDOM){for(var s=0;s<H.RANDOM_ITERATION_MAX;s++){if(i=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[a][H.ATR_RANDOM_BASE+i])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][H.ATR_TYPE]!==H.OBJECT_RANDOM)break;a=e}this.setPartsOnPosition(v.OBJECT,e,t)}},t.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),i=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),a=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW),r=e;r<=i;r++)for(var n=a;n<=s;n++)this._replaceRandomObject(new d(r,n))},t.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new d(t,e))},t.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=y.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._player.clearMessageWaiting(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._shouldSetNextPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._clearAllRequests(),this._player.jumpTo(new f(this,t,e,0,0));var i=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GAMEOVER;i&&this.evalCalcWwaNodeGenerator.evalWwaNode(i)},t.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},t.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},t.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(mt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=H.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(mt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=H.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof p&&(0!==t.energy&&(mt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=H.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(mt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=H.STATUS_CHANGED_EFFECT_FRAME_NUM)))},t.prototype.setPartsOnPosition=function(t,e,i){var a,s,r=i.y<<z.BITSHIFT|i.x;t===v.MAP?(a=this._wwaData.map[i.y][i.x],e=this.loadMapPartsID(e),a=this.loadMapPartsID(a),this._wwaData.map[i.y][i.x]=e,-1!==(s=this._mapIDTable[a].indexOf(r))&&this._mapIDTable[a].splice(s,1),-1===(s=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(a=this._wwaData.mapObject[i.y][i.x],e=this.loadMapPartsObjectID(e),a=this.loadMapPartsObjectID(a),this._wwaData.mapObject[i.y][i.x]=e,-1!==(s=this._mapObjectIDTable[a].indexOf(r))&&this._mapObjectIDTable[a].splice(s,1),-1===(s=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},t.prototype._countSamePartsLength=function(t,e){var i;for(i=e+1;i<t.length&&t[i]===t[i-1];i++);return i-e},t.prototype._compressMap=function(t){for(var e=[],i=0;i<t.length;i++){e[i]=[];for(var a=0;a<t[i].length;){var s=this._countSamePartsLength(t[i],a);e[i].push([t[i][a],s]),a+=s}}return e},t.prototype._decompressMap=function(t){for(var e=[],i=0;i<t.length;i++){e[i]=[],0;for(var a=0;a<t[i].length;a++)for(var s=t[i][a][1],r=0;r<s;r++)e[i].push(t[i][a][0])}return e},t.prototype._generateMapDataHash=function(t){var e="A",i=0,a=0,s=0;for(s=0;s<t.map.length;s++){for(a=0;a<t.map[s].length;)i=this._countSamePartsLength(t.map[s],a),e+=t.map[s][a]+"|"+i+"/",a+=i;for(a=0;a<t.mapObject[s].length;)i=this._countSamePartsLength(t.mapObject[s],a),e+=t.mapObject[s][a]+"|"+i+"/",a+=i}for(var r=0;r<t.mapAttribute.length;r++)for(var n=0;n<t.mapAttribute[r].length;n++)e+=t.mapAttribute[r][n]+"/";for(var o=0;o<t.objectAttribute.length;o++)for(var c=0;c<t.objectAttribute[o].length;c++)e+=t.objectAttribute[o][c]+"/";return ti(e+="Z")},t.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),i=[];for(var a in t)"map"!==a&&"mapObject"!==a&&"mapCompressed"!==a&&"mapObjectCompressed"!==a&&"mapAttribute"!==a&&"objectAttribute"!==a&&"checkString"!==a&&i.push(a);i.sort();for(var s=0;s<i.length;s++)e+=Tt(t[i[s]]);return ti(e)},t.prototype.compressSystem=function(){return oi},t.prototype._quickSave=function(t){var e,i,a=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_SAVE;a&&this.evalCalcWwaNodeGenerator.evalWwaNode(a);var s,r,n=JSON.parse(JSON.stringify(this._wwaData)),o=this._player.getPosition().getPartsCoord(),c=this._player.getStatusWithoutEquipments();switch(n.itemBox=this._player.getCopyOfItemBox(),n.playerX=o.x,n.playerY=o.y,n.statusEnergyMax=this._player.getEnergyMax(),n.statusEnergy=c.energy,n.statusStrength=c.strength,n.statusDefence=c.defence,n.statusGold=c.gold,n.moves=this._player.getMoveCount(),n.frameCount=this._player.getFrameCount(),n.gameSpeedIndex=this._player.getSpeedIndex(),n.playTime=null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0,t){case O.CALL_BY_LOG_QUICK_SAVE:case O.CALL_BY_QUICK_SAVE:case O.CALL_BY_SUSPEND:break;case O.CALL_BY_PASSWORD_SAVE:n.checkOriginalMapString=this.checkOriginalMapString,n.checkString=this._generateSaveDataHash(n)}switch(n.message=void 0,n.mapAttribute=void 0,n.objectAttribute=void 0,t){case O.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,n),this.wwaCustomEvent("wwa_quicksave",{data:n}),"";case O.CALL_BY_PASSWORD_SAVE:var h=oi.compress(n);h.isCompress=1;var u=JSON.stringify(h);return this.wwaCustomEvent("wwa_passwordsave",{data:n,compress:h}),s=u,r=this._wwaData.worldPassNumber,console.warn(ze.enc.Utf8.parse(s)),ze.AES.encrypt(ze.enc.Utf8.parse(s),$e(r)).toString();case O.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:n,compress:oi.compress(n)});break;case O.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:n}),this._wwaSave.autoSave(this._cvs,n)}},t.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},t.prototype._decodePassword=function(t){var e,i,a,s="",r=void 0;try{e=t,i=this._wwaData.worldPassNumber,s=ze.AES.decrypt(e,$e(i)).toString(ze.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,i){return ze.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,i)).toString(ze.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!s){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var n=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+n)}try{a=JSON.parse(s)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(a.isCompress){delete a.isCompress;var o=oi.decompress(a),c=o[0],h=o[1];return[Ei(c),h]}return[a,{isWorldNameEmpty:!1}]},t.prototype._quickLoad=function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var a,s=!1;if(null!==e){var r=this._decodePassword(e);a=r[0],s=r[1].isWorldNameEmpty}else a=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(a.message=JSON.parse(JSON.stringify(this._restartData.message)),a.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),a.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===a.map&&(a.map=this._decompressMap(a.mapCompressed)),void 0===a.mapObject&&(a.mapObject=this._decompressMap(a.mapObjectCompressed)),delete a.mapCompressed,delete a.mapObjectCompressed,null!==e){if(!s&&a.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(a.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var n=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&a.checkOriginalMapString!==n)throw console.error("Invalid hash","(password)=".concat(a.checkOriginalMapString," (current map)=").concat(n)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return i&&this._applyQuickLoad(a),a},t.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new f(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(k.NO_SOUND):this.playSound(t.bgm,t.bgmDelayDurationMs),this.setImgClick(new d(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._clearAllRequests(),this._playTimeCalculator=new ut(t.playTime),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(U.ENERGY,new d(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(U.STRENGTH,new d(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(U.DEFENCE,new d(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(U.GOLD,new d(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new d(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new d(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},t.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var i=0;i<this._wwaData.mapWidth;i++){var a=i<<z.BITSHIFT|e;t=this._wwaData.map[i][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(a),t=this._wwaData.mapObject[i][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(a)}},t.prototype.restartGame=function(){this._quickLoad(!0)},t.prototype._fadeout=function(t){var e=0,i=H.MAP_WINDOW_WIDTH,a=H.FADEOUT_SPEED,s=mt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=a,(i-=2*a)<=0||2*e>H.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=H.MAP_WINDOW_WIDTH+"px",s.style.height=H.MAP_WINDOW_HEIGHT+"px",s.style.backgroundColor="#808080",clearInterval(r),void t();s.style.width=i+"px",s.style.height=i+"px",s.style.borderWidth=e+"px"}),20)},t.prototype.moveObjects=function(t){var e,i,a,s=this._camera.getPosition(),r=(this._player.getPosition(),s.getPartsCoord(),s.getPartsCoord().x),n=s.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),H.ATR_TYPE)!==H.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),H.ATR_TYPE)!==H.OBJECT_LOCALGATE){for(e=new Array(H.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(H.V_PARTS_NUM_IN_WINDOW+2),a=-1;a<=H.V_PARTS_NUM_IN_WINDOW;a++)for(e[a+1]=new Array(H.H_PARTS_NUM_IN_WINDOW+2),this.hoge[a+1]=new Array(H.H_PARTS_NUM_IN_WINDOW+2),i=-1;i<=H.H_PARTS_NUM_IN_WINDOW;i++)if(n+a<0||n+a>=this._wwaData.mapWidth||r+i<0||r+i>=this._wwaData.mapWidth)e[a+1][i+1]=0,this.hoge[a+1][i+1]=0;else{try{var o=(c=new f(this,r+i,n+a,0,0)).getPartsCoord()}catch(t){e[a+1][i+1]=0,this.hoge[a+1][i+1]=0;continue}this._wwaData.mapObject[o.y][o.x];e[a+1][i+1]=this._wwaData.mapObject[o.y][o.x],this.hoge[a+1][i+1]=-this._wwaData.mapObject[o.y][o.x]}for(i=-1;i<=H.H_PARTS_NUM_IN_WINDOW;i++)if(!(r+i<0||r+i>=this._wwaData.mapWidth))for(a=-1;a<=H.V_PARTS_NUM_IN_WINDOW;a++)if(!(n+a<0||n+a>=this._wwaData.mapWidth)){try{var c;o=(c=new f(this,r+i,n+a,0,0)).getPartsCoord()}catch(t){continue}var h=this._wwaData.mapObject[o.y][o.x];if(0!==h&&this._wwaData.objectAttribute[h][H.ATR_MOVE]!==b.STATIC&&this._wwaData.objectAttribute[h][H.ATR_TYPE]!==H.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[h][H.ATR_TYPE]!==H.OBJECT_RANDOM&&(this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.CHASE_PLAYER||this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.RUN_OUT||this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.HANG_AROUND)){var u=this._wwaData.objectAttribute[h][H.ATR_MOVE];if(u!==b.HANG_AROUND){var _,l=this._getCandidateCoord(t,c,u),p=new d(l.x,o.y),E=new d(o.x,l.y),m=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(o,l,r,n,e,h);else{var y=this._getSecondCandidateMoveMode(t,o,l,p,E,this._wwaData.objectAttribute[h][H.ATR_TYPE]===H.OBJECT_MONSTER,e);y===x.MODE_X?this._setObjectsInNextFrame(o,p,r,n,e,h):y===x.MODE_Y?this._setObjectsInNextFrame(o,E,r,n,e,h):null===(m=this._getThirdCandidate(t,c,l,u,e))||this._wwaData.isOldMove?(_=this._getRandomMoveCoord(t,c,e),this._setObjectsInNextFrame(o,_,r,n,e,h)):this._setObjectsInNextFrame(o,m,r,n,e,h)}}else _=this._getRandomMoveCoord(t,c,e),this._setObjectsInNextFrame(o,_,r,n,e,h)}}}},t.prototype._getCandidateCoord=function(t,e,i){var a=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var s=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var r=a.clone(),n=0,o=0;return i===b.CHASE_PLAYER?(n=a.x>s.x?-1:a.x<s.x?1:0,o=a.y>s.y?-1:a.y<s.y?1:0):i===b.RUN_OUT&&(n=a.x>s.x?1:a.x<s.x?-1:0,o=a.y>s.y?1:a.y<s.y?-1:0),r.x+=n,r.y+=o,r.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.x)),r.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.y)),r},t.prototype._getSecondCandidateMoveMode=function(t,e,i,a,s,r,n){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!r)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||r)?this._objectCanMoveTo(t,a,n)?x.MODE_X:this._objectCanMoveTo(t,s,n)?x.MODE_Y:x.UNDECIDED:this._objectCanMoveTo(t,s,n)?x.MODE_Y:this._objectCanMoveTo(t,a,n)?x.MODE_X:x.UNDECIDED},t.prototype._getThirdCandidate=function(t,e,i,a,s){var r,n=a===b.CHASE_PLAYER?1:a===b.RUN_OUT?-1:0,o=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),c=e.getPartsCoord();if(o.x!==c.x){if(r=new d(i.x,c.y+1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(i.x,c.y-1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x,c.y+1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x,c.y-1*n),this._objectCanMoveTo(t,r,s))return r}if(o.y!==c.y){if(r=new d(c.x+1*n,i.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x-1*n,i.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x+1*n,c.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x-1*n,c.y),this._objectCanMoveTo(t,r,s))return r}return null},t.prototype._getRandomMoveCoord=function(t,e,i){for(var a=e.getPartsCoord(),s=a.clone(),r=this._wwaData.isOldMove?H.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:H.RANDOM_MOVE_ITERATION_NUM,n=0;n<r;n++){var o=[-1,1,0,0,-1,-1,1,1],c=Math.floor(Math.random()*o.length);if(s.x=a.x+o[c],s.y=a.y+[0,0,1,-1,1,-1,1,-1][c],this._objectCanMoveTo(t,s,i))return s}return a},t.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},t.prototype._objectCanMoveTo=function(t,e,i){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var a=this._wwaData.map[e.y][e.x],s=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[a][H.ATR_TYPE],n=this._camera.getPosition(),o=n.getPartsCoord().x,c=n.getPartsCoord().y;if(0===a&&!this.isOldMap()||r===H.MAP_WALL)return!1;var h=e.x-o+1,u=e.y-c+1;if(0<=h&&0<=u&&h<i.length&&u<i.length){if(0!==i[u][h])return!1}else if(0!==s)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},t.prototype._setObjectsInNextFrame=function(t,e,i,a,s,r){var n=e.x-i+1,o=e.y-a+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=n&&n<s.length&&0<=o&&o<s.length&&(s[t.y-a+1][t.x-i+1]=0,s[e.y-a+1][e.x-i+1]=r,this.hoge[e.y-a+1][e.x-i+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},t.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),i=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW-1),a=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(k.DECISION);for(var n=e;n<=i;n++)for(var o=a;o<=s;o++){var c=this._wwaData.mapObject[o][n];this._wwaData.objectAttribute[c][H.ATR_TYPE]===H.OBJECT_MONSTER&&-1===r.indexOf(c)&&r.push(c)}if(this._bottomButtonType===h.BATTLE_REPORT&&mt(R[D.GOTO_WWA]).classList.add("onpress"),0===r.length)return mt(R[D.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1;this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating();var u=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_BATTLE_REPORT;return u&&this.evalCalcWwaNodeGenerator.evalWwaNode(u),!0},t.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),mt(R[D.GOTO_WWA]).classList.remove("onpress"),this._dispatchWindowClosedTimeRequests()},t.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Ke.SAVE)return this._player.clearPasswordWindowWaiting(),void this._dispatchWindowClosedTimeRequests();try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e},t.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){var t="変数一覧\n";this._userVarNameListRequestError&&("noFileSpecified"===this._userVarNameListRequestError.kind?t+=this._userVarNameListRequestError.errorMessage+"\n":(t+="【変数名取得失敗】\n",t+=" すべての変数を名無しとしています。\n",t+=" エラー詳細: ".concat(this._userVarNameListRequestError.errorMessage,"\n")));for(var e=0;e<H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var i=(this._inlineUserVarViewer.topUserVarIndex+e)%H.USER_VAR_NUM,a=this._userVarNameList&&this._userVarNameList[i]?this._userVarNameList[i]:"名無し",s="変数 ".concat(i,": ").concat(a);t+="".concat(s,": ").concat(this._wwaData.userVar[i],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.generatePageAndReserveExecution(t,!1,!0)}},t.prototype._displayHelp=function(){var t;if(this._player.isControllable()){var e=null===(t=this._playTimeCalculator)||void 0===t?void 0:t.calculatePlayTimeFormat(),i="";switch(this.userDevice.device){case I.GAME:switch(this.userDevice.os){case T.NINTENDO:i=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case T.PLAY_STATION:i=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case T.XBOX:i=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case I.SP:case I.VR:return;case I.PC:i=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}i&&this.generatePageAndReserveExecution(i,!1,!0)}},t.prototype._setNextPage=function(){(this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._pages.length)?this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests():this._shouldSetNextPage=!0;this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},t.prototype._hideMessageWindow=function(){var t=this._player.isReadyToUseItem()?this._player.useItem():0,e=this.getObjectAttributeById(t,H.ATR_STRING);return this.clearFaces(),0===e?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting(),{newPageGenerated:!1}):(this.generatePageAndReserveExecution(this.getMessageById(e),!1,!1,t,v.OBJECT,this._player.getPosition().getPartsCoord()),{newPageGenerated:0!==this._pages.length})},t.prototype.getPlayerPositon=function(){return this._player.getPosition()},t.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},t.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},t.prototype.replaceParts=function(t,e,i,a){void 0===i&&(i=v.OBJECT),void 0===a&&(a=!1);var s,r,n,o,c,h,u,_,l=this._camera.getPosition().getPartsCoord(),p=a?Math.max(0,l.x):0,d=a?Math.min(this._wwaData.mapWidth-1,l.x+H.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,f=a?Math.max(0,l.y):0,E=a?Math.min(this._wwaData.mapWidth-1,l.y+H.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(a=0!==p||d!==this._wwaData.mapWidth-1||0!==f||E!==this._wwaData.mapWidth-1,i===v.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),o=this._mapObjectIDTable[t].concat(),(u=this._mapObjectIDTable[t]).length=0,_=this._mapObjectIDTable[e],r=o.length,a)for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,p<=c&&c<=d&&f<=h&&h<=E?(this._wwaData.mapObject[h][c]=e,_.push(s)):u.push(s);else{for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,this._wwaData.mapObject[h][c]=e;Array.prototype.push.apply(_,o)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),o=this._mapIDTable[t].concat(),(u=this._mapIDTable[t]).length=0,_=this._mapIDTable[e],r=o.length,a)for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,p<=c&&c<=d&&f<=h&&h<=E?(this._wwaData.map[h][c]=e,_.push(s)):u.push(s);else{for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,this._wwaData.map[h][c]=e;Array.prototype.push.apply(_,o)}},t.prototype.getYesNoImgCoord=function(){return new d(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},t.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},t.prototype.getPlayerImgCoord=function(){return new d(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},t.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},t.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(this.toValidStatusValue(t))},t.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},t.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},t.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},t.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},t.prototype.isOldMap=function(){return this._wwaData.isOldMap},t.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},t.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},t.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},t.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},t.prototype.setPlayerStatus=function(t,e,i){if(t===B.ENERGY){if(this._player.setEnergy(this.toValidStatusValue(e)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:i}))return this.gameover(),{isGameOver:!0}}else if(t===B.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===B.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===B.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==B.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},t.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},t.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},t.prototype.setStatusIconCoord=function(t,e){var i=e.x*H.CHIP_SIZE,a=e.y*H.CHIP_SIZE,s=function(t){wt("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(i,"px -").concat(a,"px")};switch(t){case U.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case U.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case U.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case U.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},t.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*H.CHIP_SIZE,i=t.y*H.CHIP_SIZE;return Array.prototype.forEach.call(vt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+i+"px"})),t.clone()},t.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},t.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},t.prototype.canInput=function(){return!this._temporaryInputDisable},t.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},t.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},t.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},t.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new d(0,0)))Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+H.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(i){i.style.backgroundImage="url('"+e+"')",i.style.backgroundPosition="-"+t.x*H.CHIP_SIZE+"px -"+t.y*H.CHIP_SIZE+"px"}))}},t.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},t.prototype.clearFaces=function(){this._faces=[]},t.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},t.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},t.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},t.prototype.setBgmDelay=function(t){this._wwaData.bgmDelayDurationMs=t},t.prototype.initCSSRule=function(){this._styleElm=mt(H.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},t.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",i=this._isClassicModeEnable?1:.9,a="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(i,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),s="div#wwa-sidebar",r="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[Q.MESSAGE_WINDOW]=this._sheet.addRule(e,a),this._stylePos[Q.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[Q.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(a," }"),0),this._stylePos[Q.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},t.prototype.changeStyleRule=function(t,e,i,a){t===q.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=i,this._wwaData.frameColorB=a):t===q.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=i,this._wwaData.frameOutColorB=a):t===q.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=i,this._wwaData.fontColorB=a):t===q.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=i,this._wwaData.statusColorB=a),this.updateCSSRule()},t.prototype.showMonsterWindow=function(){this._monsterWindow.show()},t.prototype.isClassicMode=function(){return this._isClassicModeEnable},t.prototype.isConsoleOutputMode=function(){return this._useConsole},t.prototype.forcedJumpGate=function(t,e){this._player.isWaitingMessage()?this._windowCloseWaitingJumpGateRequest={x:t,y:e}:(this._windowCloseWaitingJumpGateRequest=void 0,this._player.jumpTo(new f(this,t,e,0,0)))},t.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(H.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},t.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),i=Math.max(Math.min(e,H.USER_VAR_NUM_MAX_VALUE),H.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(i)?0:i},t.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<H.USER_VAR_NUM&&(0|t)===t},t.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},t.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},t.prototype.recUserPosition=function(t,e){var i=this._player.getPosition().getPartsCoord();this.setUserVar(t,i.x),this.setUserVar(e,i.y)},t.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},t.prototype.jumpSpecifiedXPos=function(t){var e=this._player.getPosition().getPartsCoord();this.forcedJumpGate(t,e.y)},t.prototype.jumpSpecifiedYPos=function(t){var e=this._player.getPosition().getPartsCoord();this.forcedJumpGate(e.x,t)},t.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},t.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},t.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},t.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},t.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},t.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},t.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");return this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})?(this.gameover(),{isGameOver:!0}):{}},t.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},t.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},t.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},t.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},t.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},t.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},t.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},t.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},t.prototype.setUserValRandNum=function(t,e,i){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+i)},t.prototype._generateShowStrString=function(t,e){var i=this;return t.map((function(t){var a=Number(t);return isNaN(a)?null!==Te(t).match(me)?function(){return Ce(t,i.generateTokenValues(e.triggerParts))}:t.replace(/\\n/g,"\n"):function(){return 1===e.version?i._wwaData.userVar[a]:a}}))},t.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},t.prototype.execSetMacro=function(t,e){void 0===t&&(t="");var i=function(t,e){var i=Te(t),a=i.match(fe);if(null!==a){var s=Ie(a[2],e),r=Ie(a[4],e);return Ae(kt(a[3],s,r),a[1])}var n=i.match(Ee);if(null!==n)return s=Ie(n[1],e),r=Ie(n[3],e),Ae(kt(n[2],s,r),n[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this.generateTokenValues(e.triggerParts)),a=i.assignee,s=i.rawValue;switch(a){case"energy":if(this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(s));break;case"variable":if(isNaN(i.index)||!this.isValidUserVarIndex(i.index))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(i.index,this.toAssignableValue(s));break;case"map":this.appearPartsEval(e.triggerParts.position,"".concat(i.x),"".concat(i.y),i.rawValue,v.MAP);break;case"mapObject":this.appearPartsEval(e.triggerParts.position,"".concat(i.x),"".concat(i.y),i.rawValue,v.OBJECT);break;case"item":this.setPlayerGetItem(i.boxIndex1to12,s);break;case"playerDirection":this._player.setDir(s)}return this._player.updateStatusValueBox(),{}},t.prototype.generateTokenValues=function(t){var e,i;return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:t.id,partsType:t.type,partsPosition:t.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}},t.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var i=parseInt(e[0],10),a=parseInt(e[2],10);if(!this.isValidUserVarIndex(i)||!this.isValidUserVarIndex(a))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var s=this._wwaData.userVar[i],r=e[1],n=this._wwaData.userVar[a],o=function(t){return parseInt(t,10)?v.MAP:v.OBJECT};if(this.compareUserVar(s,r,n)){var c=parseInt(e[3],10),h=e[4],u=e[5],_=o(e[6]);this.appearPartsEval(t,h,u,c,_)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],f=o(e[10]);this.appearPartsEval(t,p,d,l,f)}},t.prototype.compareUserVar=function(t,e,i){switch(e){case"==":return t===i;case"!=":return t!==i;case">=":return t>=i;case">":return t>i;case"<=":return t<=i;case"<":return t<i;default:throw new Error("未定義の演算子です: ".concat(e))}},t.prototype.setPlayerSpeedIndex=function(t){if(t<H.MIN_SPEED_INDEX||H.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._player.isMoving()?this._playerAndObjectsStopWaitingGameSpeedChangeRequest={speedIndex:t}:(this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0)},t.prototype.setUserVarPlayTime=function(t){var e,i;this.setUserVar(t,null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0)},t.prototype.hideStatus=function(t,e){if(t<0||t>G.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(G[t],!e),this._player.updateStatusValueBox()},t.prototype.varMap=function(t,e,i,a,s){if(!this.isValidUserVarIndex(a))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[a];if(r<0)throw new Error("負のパーツ番号は指定できません");if(s===v.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(s===v.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,i,r,s)},t.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(vt("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*H.CHIP_SIZE,"px -").concat(t.y*H.CHIP_SIZE,"px")}))},t.prototype._getVirtualPadButton=function(t){if(!_t.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},t.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},t.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},t.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,i,a;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(i=this._wwaData.gamePadButtonItemTable[e]){switch(a=!1,e){case nt.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)&&(a=!0)}if(this._gamePadStore.buttonTrigger(e)&&(a=!0),a&&this.onselectitem(i))return!0}return!1},t.prototype.setGamePadButtonItemTable=function(t,e){var i,a;if(!this._wwaData.gamePadButtonItemTable)for(a in this._wwaData.gamePadButtonItemTable=[],nt)i=a,this._wwaData.gamePadButtonItemTable[i]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},t.prototype._checkSaveDataCompatibility=function(t,e,i){return void 0!==t&&t!==this._wwaData.worldName?Ci.UNMATCHED_WORLD_NAME:i&&i!==Ii(this._wwaData.worldName,this._wwaData.worldPassNumber)?Ci.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Ci.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},t.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},t.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},t.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var i=this._dumpElement.querySelector(".varlist-information");i&&(i.textContent="".concat(e?"【エラー】":"").concat(t))}},t.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},t.prototype.getGameStatus=function(){var t,e;return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:null!==(e=null===(t=this._playTimeCalculator)||void 0===t?void 0:t.calculateTimeMs())&&void 0!==e?e:0,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox()}},t.prototype._debugEvalString=function(){if(this._player.isControllable())try{var t=this._debugConsoleElement.querySelector(".console-text-area");if(!(t instanceof HTMLTextAreaElement))throw new Error("要素 #wwa-debug-console > .console-text-area が textarea 要素でありません");this._execEvalString(t.value)}catch(t){console.error(t),this.generatePageAndReserveExecution("解析中にエラーが発生しました :\n"+t.message,!1,!0)}},t.prototype._execEvalString=function(t){try{var e=this.convertWwaNodes(t);this.evalCalcWwaNodeGenerator.evalWwaNodes(e)}catch(t){console.error(t),this.generatePageAndReserveExecution("解析中にエラーが発生しました :\n"+t.message,!1,!0)}},t.prototype.movePlayer=function(t){this._player.controll(t)},t.prototype.isPlayerWaitingMessage=function(){return this._player.isWaitingMessage()},t.prototype._loadSystemMessage=function(t){if(this._wwaData.customSystemMessages[t])return this._wwaData.customSystemMessages[t];var e=r[t];if(e.mapdataParams)switch(e.mapdataParams.messageArea){case"message":return""===(i=this._wwaData.message[e.mapdataParams.index])?e.defaultText:i;case"systemMessage":var i;return""===(i=this._wwaData.systemMessage[e.mapdataParams.index])?e.defaultText:i;default:throw new Error("システムエラー: システムメッセージの設定がおかしいようです")}return e.defaultText},t.prototype.resolveSystemMessage=function(t){var e=this,i=this._loadSystemMessage(t);switch(t){case s.ITEM_SELECT_TUTORIAL:return i.replaceAll("%HOW_TO_USE_ITEM%",function(){switch(e.userDevice.device){case I.PC:return"右のボックスを選択する";case I.VR:return"右のボックスをクリックする";case I.SP:return"右のボックスをタップする";case I.GAME:switch(e.userDevice.os){case T.NINTENDO:return"Xボタンを押すか、右のボックスをタップする";case T.PLAY_STATION:return"△ボタンを押す";case T.XBOX:return"Yボタンを押す";default:return"右のボックスを選択する"}default:return"右のボックスを選択する"}}());case s.GAME_SPEED_CHANGED:var a=this._player.getSpeedIndex();return i.replaceAll("%GAME_SPEED_NAME%",Y[a]).replaceAll("%HIGH_SPEED_MESSAGE%",this.isBattleSpeedIndexForQuickBattle(a)?"戦闘も速くなります。\n":"").replaceAll("%MAX_SPEED_INDEX%",String(H.MAX_SPEED_INDEX+1)).replaceAll("%GAME_SPEED_INDEX%",String(a+1)).replaceAll("%SPEED_UP_BUTTON%",this.userDevice.os===T.NINTENDO?"+ボタン":"Pキー").replaceAll("%SPEED_DOWN_BUTTON%",this.userDevice.os===T.NINTENDO?"-ボタン":"Iキー");default:return i}},t.prototype.overwriteSystemMessage=function(t,e){this._wwaData.customSystemMessages[t]=e},t}(),qs=!1;function Qs(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(vt("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){qs=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(qs)return qs=!1,t.returnValue=e,e}));var t=mt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),i=null!==e&&null!==e.match(/^true$/i);qe(mt("wwa-wrapper"),t,i);var a=mt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=mt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=mt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),n=null,o="true"===mt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),c=mt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");mt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&o&&(n=function(t){var e=gt(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var i=document.createElement("table"),a=document.createElement("tr"),s=document.createElement("th"),r=document.createElement("button"),n=document.createElement("td");r.textContent="隠す",s.textContent="変数一覧",s.setAttribute("colspan","10"),s.classList.add("varlist-header"),s.appendChild(r),a.appendChild(s),n.setAttribute("colspan","10"),n.classList.add("varlist-information"),n.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",i.appendChild(a),i.appendChild(n);for(var o=null,c=null,h=0;h<H.USER_VAR_NUM;h++){h%10==0&&(null!==o&&(i.appendChild(o),i.appendChild(c)),(o=document.createElement("tr")).classList.add("var-number"),(c=document.createElement("tr")).classList.add("var-val"));var u=document.createElement("th"),_=document.createElement("div");_.textContent="-",_.setAttribute("aria-hidden","true"),u.classList.add("var-index".concat(h));var l=document.createElement("td");u.textContent=h+"",u.appendChild(_),l.classList.add("var".concat(h)),l.textContent="-",o.appendChild(u),c.appendChild(l)}H.USER_VAR_NUM%10!=0&&(i.appendChild(o),i.appendChild(c)),e.appendChild(i);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",n.style.display="none",Array.prototype.forEach.call(i.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(i.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",n.style.display="",Array.prototype.forEach.call(i.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(i.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(r));var h=!0;mt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(h=!1);var u=mt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),_=!1;null!==u&&u.match(/^true$/i)&&(_=!0);var l=!0,p=mt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,f=mt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==f&&f.match(/^true$/i)&&(d=!0);var E,m,y=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");Ze()&&null!==y&&y.match(/^true$/i)&&(E=document.getElementsByTagName("head")[0],(m=document.createElement("meta")).setAttribute("name","viewport"),E.appendChild(m),ft(),window.addEventListener("resize",ft));var g,w=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),v=i&&w?wt(w):null,S=!(null===(g=mt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!g.match(/^true$/i));Ws=new Zs(a,h,t,_,l,d,s,S,n,c,o,i,v)}}"complete"===document.readyState?setTimeout(Qs):window.addEventListener("load",(function(){setTimeout(Qs)}))}()}();
|
|
21
|
+
function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=s.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=s.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=s.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=s.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),_=s.create([0,1518500249,1859775393,2400959708,2840853838]),l=s.create([1352829926,1548603684,1836072691,2053994217,0]),p=n.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var a=e+i,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,n,p,w,v,S,A,T,I,C,O,D=this._hash.words,P=_.words,N=l.words,b=o.words,x=c.words,M=h.words,L=u.words;for(S=r=D[0],A=n=D[1],T=p=D[2],I=w=D[3],C=v=D[4],i=0;i<80;i+=1)O=r+t[e+b[i]]|0,O+=i<16?d(n,p,w)+P[0]:i<32?f(n,p,w)+P[1]:i<48?E(n,p,w)+P[2]:i<64?m(n,p,w)+P[3]:y(n,p,w)+P[4],O=(O=g(O|=0,M[i]))+v|0,r=v,v=w,w=g(p,10),p=n,n=O,O=S+t[e+x[i]]|0,O+=i<16?y(A,T,I)+N[0]:i<32?m(A,T,I)+N[1]:i<48?E(A,T,I)+N[2]:i<64?f(A,T,I)+N[3]:d(A,T,I)+N[4],O=(O=g(O|=0,L[i]))+C|0,S=C,C=I,I=g(T,10),T=A,A=O;O=D[1]+p+I|0,D[1]=D[2]+w+C|0,D[2]=D[3]+v+S|0,D[3]=D[4]+r+A|0,D[4]=D[0]+n+T|0,D[0]=O},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,r=s.words,n=0;n<5;n++){var o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return s},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,i){return t^e^i}function f(t,e,i){return t&e|~t&i}function E(t,e,i){return(t|~e)^i}function m(t,e,i){return t&i|e&~i}function y(t,e,i){return t^(e|~i)}function g(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),a.RIPEMD160)},637:function(t,e,i){var a,s,r,n,o,c,h,u;t.exports=(u=i(359),s=(a=u).lib,r=s.WordArray,n=s.Hasher,o=a.algo,c=[],h=o.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],h=0;h<80;h++){if(h<16)c[h]=0|t[e+h];else{var u=c[h-3]^c[h-8]^c[h-14]^c[h-16];c[h]=u<<1|u>>>31}var _=(a<<5|a>>>27)+o+c[h];_+=h<20?1518500249+(s&r|~s&n):h<40?1859775393+(s^r^n):h<60?(s&r|s&n|r&n)-1894007588:(s^r^n)-899497514,o=n,n=r,r=s<<30|s>>>2,s=a,a=_}i[0]=i[0]+a|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+n|0,i[4]=i[4]+o|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(a+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}}),a.SHA1=n._createHelper(h),a.HmacSHA1=n._createHmacHelper(h),u.SHA1)},640:function(t,e,i){var a,s,r,n,o,c;t.exports=(c=i(359),i(93),s=(a=c).lib.WordArray,r=a.algo,n=r.SHA256,o=r.SHA224=n.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}}),a.SHA224=n._createHelper(o),a.HmacSHA224=n._createHmacHelper(o),c.SHA224)},93:function(t,e,i){var a;t.exports=(a=i(359),function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],c=[];!function(){function e(e){for(var i=t.sqrt(e),a=2;a<=i;a++)if(!(e%a))return!1;return!0}function i(t){return 4294967296*(t-(0|t))|0}for(var a=2,s=0;s<64;)e(a)&&(s<8&&(o[s]=i(t.pow(a,.5))),c[s]=i(t.pow(a,1/3)),s++),a++}();var h=[],u=n.SHA256=r.extend({_doReset:function(){this._hash=new s.init(o.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],u=i[5],_=i[6],l=i[7],p=0;p<64;p++){if(p<16)h[p]=0|t[e+p];else{var d=h[p-15],f=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,E=h[p-2],m=(E<<15|E>>>17)^(E<<13|E>>>19)^E>>>10;h[p]=f+h[p-7]+m+h[p-16]}var y=a&s^a&r^s&r,g=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),w=l+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&u^~o&_)+c[p]+h[p];l=_,_=u,u=o,o=n+w|0,n=r,r=s,s=a,a=w+(g+y)|0}i[0]=i[0]+a|0,i[1]=i[1]+s|0,i[2]=i[2]+r|0,i[3]=i[3]+n|0,i[4]=i[4]+o|0,i[5]=i[5]+u|0,i[6]=i[6]+_|0,i[7]=i[7]+l|0},_doFinalize:function(){var e=this._data,i=e.words,a=8*this._nDataBytes,s=8*e.sigBytes;return i[s>>>5]|=128<<24-s%32,i[14+(s+64>>>9<<4)]=t.floor(a/4294967296),i[15+(s+64>>>9<<4)]=a,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(u),e.HmacSHA256=r._createHmacHelper(u)}(Math),a.SHA256)},140:function(t,e,i){var a;t.exports=(a=i(359),i(467),function(t){var e=a,i=e.lib,s=i.WordArray,r=i.Hasher,n=e.x64.Word,o=e.algo,c=[],h=[],u=[];!function(){for(var t=1,e=0,i=0;i<24;i++){c[t+5*e]=(i+1)*(i+2)/2%64;var a=(2*t+3*e)%5;t=e%5,e=a}for(t=0;t<5;t++)for(e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var s=1,r=0;r<24;r++){for(var o=0,_=0,l=0;l<7;l++){if(1&s){var p=(1<<l)-1;p<32?_^=1<<p:o^=1<<p-32}128&s?s=s<<1^113:s<<=1}u[r]=n.create(o,_)}}();var _=[];!function(){for(var t=0;t<25;t++)_[t]=n.create()}();var l=o.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var i=this._state,a=this.blockSize/2,s=0;s<a;s++){var r=t[e+2*s],n=t[e+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),(D=i[s]).high^=n,D.low^=r}for(var o=0;o<24;o++){for(var l=0;l<5;l++){for(var p=0,d=0,f=0;f<5;f++)p^=(D=i[l+5*f]).high,d^=D.low;var E=_[l];E.high=p,E.low=d}for(l=0;l<5;l++){var m=_[(l+4)%5],y=_[(l+1)%5],g=y.high,w=y.low;for(p=m.high^(g<<1|w>>>31),d=m.low^(w<<1|g>>>31),f=0;f<5;f++)(D=i[l+5*f]).high^=p,D.low^=d}for(var v=1;v<25;v++){var S=(D=i[v]).high,A=D.low,T=c[v];T<32?(p=S<<T|A>>>32-T,d=A<<T|S>>>32-T):(p=A<<T-32|S>>>64-T,d=S<<T-32|A>>>64-T);var I=_[h[v]];I.high=p,I.low=d}var C=_[0],O=i[0];for(C.high=O.high,C.low=O.low,l=0;l<5;l++)for(f=0;f<5;f++){var D=i[v=l+5*f],P=_[v],N=_[(l+1)%5+5*f],b=_[(l+2)%5+5*f];D.high=P.high^~N.high&b.high,D.low=P.low^~N.low&b.low}D=i[0];var x=u[o];D.high^=x.high,D.low^=x.low}},_doFinalize:function(){var e=this._data,i=e.words,a=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;i[a>>>5]|=1<<24-a%32,i[(t.ceil((a+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*i.length,this._process();for(var n=this._state,o=this.cfg.outputLength/8,c=o/8,h=[],u=0;u<c;u++){var _=n[u],l=_.high,p=_.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h.push(p),h.push(l)}return new s.init(h,o)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),a.SHA3)},716:function(t,e,i){var a,s,r,n,o,c,h,u;t.exports=(u=i(359),i(467),i(834),s=(a=u).x64,r=s.Word,n=s.WordArray,o=a.algo,c=o.SHA512,h=o.SHA384=c.extend({_doReset:function(){this._hash=new n.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),a.SHA384=c._createHelper(h),a.HmacSHA384=c._createHmacHelper(h),u.SHA384)},834:function(t,e,i){var a;t.exports=(a=i(359),i(467),function(){var t=a,e=t.lib.Hasher,i=t.x64,s=i.Word,r=i.WordArray,n=t.algo;function o(){return s.create.apply(s,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=o()}();var u=n.SHA512=e.extend({_doReset:function(){this._hash=new r.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var i=this._hash.words,a=i[0],s=i[1],r=i[2],n=i[3],o=i[4],u=i[5],_=i[6],l=i[7],p=a.high,d=a.low,f=s.high,E=s.low,m=r.high,y=r.low,g=n.high,w=n.low,v=o.high,S=o.low,A=u.high,T=u.low,I=_.high,C=_.low,O=l.high,D=l.low,P=p,N=d,b=f,x=E,M=m,L=y,R=g,B=w,U=v,k=S,W=A,V=T,F=I,Y=C,G=O,H=D,K=0;K<80;K++){var j,X,J=h[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=h[K-15],q=Z.high,Q=Z.low,z=(q>>>1|Q<<31)^(q>>>8|Q<<24)^q>>>7,$=(Q>>>1|q<<31)^(Q>>>8|q<<24)^(Q>>>7|q<<25),tt=h[K-2],et=tt.high,it=tt.low,at=(et>>>19|it<<13)^(et<<3|it>>>29)^et>>>6,st=(it>>>19|et<<13)^(it<<3|et>>>29)^(it>>>6|et<<26),rt=h[K-7],nt=rt.high,ot=rt.low,ct=h[K-16],ht=ct.high,ut=ct.low;X=(X=(X=z+nt+((j=$+ot)>>>0<$>>>0?1:0))+at+((j+=st)>>>0<st>>>0?1:0))+ht+((j+=ut)>>>0<ut>>>0?1:0),J.high=X,J.low=j}var _t,lt=U&W^~U&F,pt=k&V^~k&Y,dt=P&b^P&M^b&M,ft=N&x^N&L^x&L,Et=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),mt=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(U>>>14|k<<18)^(U>>>18|k<<14)^(U<<23|k>>>9),gt=(k>>>14|U<<18)^(k>>>18|U<<14)^(k<<23|U>>>9),wt=c[K],vt=wt.high,St=wt.low,At=G+yt+((_t=H+gt)>>>0<H>>>0?1:0),Tt=mt+ft;G=F,H=Y,F=W,Y=V,W=U,V=k,U=R+(At=(At=(At=At+lt+((_t+=pt)>>>0<pt>>>0?1:0))+vt+((_t+=St)>>>0<St>>>0?1:0))+X+((_t+=j)>>>0<j>>>0?1:0))+((k=B+_t|0)>>>0<B>>>0?1:0)|0,R=M,B=L,M=b,L=x,b=P,x=N,P=At+(Et+dt+(Tt>>>0<mt>>>0?1:0))+((N=_t+Tt|0)>>>0<_t>>>0?1:0)|0}d=a.low=d+N,a.high=p+P+(d>>>0<N>>>0?1:0),E=s.low=E+x,s.high=f+b+(E>>>0<x>>>0?1:0),y=r.low=y+L,r.high=m+M+(y>>>0<L>>>0?1:0),w=n.low=w+B,n.high=g+R+(w>>>0<B>>>0?1:0),S=o.low=S+k,o.high=v+U+(S>>>0<k>>>0?1:0),T=u.low=T+V,u.high=A+W+(T>>>0<V>>>0?1:0),C=_.low=C+Y,_.high=I+F+(C>>>0<Y>>>0?1:0),D=l.low=D+H,l.high=O+G+(D>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[30+(a+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(a+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(u),t.HmacSHA512=e._createHmacHelper(u)}(),a.SHA512)},567:function(t,e,i){var a;t.exports=(a=i(359),i(139),i(174),i(844),i(951),function(){var t=a,e=t.lib,i=e.WordArray,s=e.BlockCipher,r=t.algo,n=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],_=r.DES=s.extend({_doReset:function(){for(var t=this._key.words,e=[],i=0;i<56;i++){var a=n[i]-1;e[i]=t[a>>>5]>>>31-a%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var h=s[r]=[],u=c[r];for(i=0;i<24;i++)h[i/6|0]|=e[(o[i]-1+u)%28]<<31-i%6,h[4+(i/6|0)]|=e[28+(o[i+24]-1+u)%28]<<31-i%6;for(h[0]=h[0]<<1|h[0]>>>31,i=1;i<7;i++)h[i]=h[i]>>>4*(i-1)+3;h[7]=h[7]<<5|h[7]>>>27}var _=this._invSubKeys=[];for(i=0;i<16;i++)_[i]=s[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var a=0;a<16;a++){for(var s=i[a],r=this._lBlock,n=this._rBlock,o=0,c=0;c<8;c++)o|=h[c][((n^s[c])&u[c])>>>0];this._lBlock=n,this._rBlock=r^o}var _=this._lBlock;this._lBlock=this._rBlock,this._rBlock=_,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<<t}function p(t,e){var i=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<<t}t.DES=s._createHelper(_);var d=r.TripleDES=s.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),a=t.length<4?t.slice(0,2):t.slice(2,4),s=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=_.createEncryptor(i.create(e)),this._des2=_.createEncryptor(i.create(a)),this._des3=_.createEncryptor(i.create(s))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=s._createHelper(d)}(),a.TripleDES)},467:function(t,e,i){var a;t.exports=(a=i(359),function(t){var e=a,i=e.lib,s=i.Base,r=i.WordArray,n=e.x64={};n.Word=s.extend({init:function(t,e){this.high=t,this.low=e}}),n.WordArray=s.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:8*e.length},toX32:function(){for(var t=this.words,e=t.length,i=[],a=0;a<e;a++){var s=t[a];i.push(s.high),i.push(s.low)}return r.create(i,this.sigBytes)},clone:function(){for(var t=s.clone.call(this),e=t.words=this.words.slice(0),i=e.length,a=0;a<i;a++)e[a]=e[a].clone();return t}})}(),a)},633:function(){},106:function(){}},e={};function i(a){var s=e[a];if(void 0!==s)return s.exports;var r=e[a]={exports:{}};return t[a].call(r.exports,r,r.exports,i),r.exports}i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,{a:e}),e},i.d=function(t,e){for(var a in e)i.o(e,a)&&!i.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},t.apply(this,arguments)},e=Object.freeze({CONFIRM_LOAD_SOUND:{code:1,defaultText:"効果音・BGMデータをロードしますか?",mapdataParams:{messageArea:"systemMessage",index:2}},NO_MONEY:{code:101,defaultText:"所持金がたりない。",mapdataParams:{messageArea:"message",index:6}},NO_ITEM:{code:201,mapdataParams:{messageArea:"message",index:7},defaultText:"アイテムを持っていない。"},ITEM_BOX_FULL:{code:202,defaultText:"これ以上、アイテムを持てません。",mapdataParams:{messageArea:"systemMessage",index:1}},ITEM_SELECT_TUTORIAL:{code:203,defaultText:"このアイテムは%HOW_TO_USE_ITEM%ことで使用できます。\n使用できるアイテムは色枠で囲まれます。",mapdataParams:{messageArea:"systemMessage",index:0}},CONFIRM_USE_ITEM:{code:204,defaultText:"このアイテムを使用します。\nよろしいですか?",mapdataParams:{messageArea:"message",index:8}},CANNOT_DAMAGE_MONSTER:{code:301,defaultText:"相手の防御能力が高すぎる!"},CONFIRM_ENTER_URL_GATE:{code:401,defaultText:"他のページにリンクします。\nよろしいですか?",mapdataParams:{messageArea:"message",index:5}},GAME_SPEED_CHANGED:{code:501,defaultText:"移動速度を【%GAME_SPEED_NAME%】に切り替えました。\n%HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)\n速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。"},GAME_SPEED_CHANGE_DISABLED:{code:502,defaultText:"ここでは移動速度を\n変更できません。"}}),a=Object.keys(e),s=a.reduce((function(e,i){var a;return t(t({},e),((a={})[i]=i,a))}),{}),r=e;function n(t){return a.some((function(e){return e===t}))}function o(t){for(var e=0,i=a;e<i.length;e++){var s=i[e];if(r[s].code===t)return s}}var c,h,u,_=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),l=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),p=function(t){function e(e,i,a,s){var r=t.call(this,i,a)||this;return r.energy=e,r.gold=s,r}return _(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t.rates).reduce((function(i,a){return i+t.rates[a]*e[a]}),0)},e}(l),d=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new f(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),f=function(){function t(t,e,i,a,s){if(void 0===a&&(a=0),void 0===s&&(s=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var r=this._wwa.getMapWidth();if(e<0||e>=r||e>=r-1&&a>0||i<0||i>=r||i>=r-1&&s>0)throw new Error("範囲外の座標です!! parts:("+e+", "+i+"), offset:("+a+", "+s+"), mapWidth = "+r);this._partsCoord=new d(e,i),this._offsetCoord=new d(a,s)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(H.H_PARTS_NUM_IN_WINDOW-1))*(H.H_PARTS_NUM_IN_WINDOW-1),i=Math.floor(this._partsCoord.y/(H.V_PARTS_NUM_IN_WINDOW-1))*(H.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,i,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),i=this._wwa.getMapWidth(),a=t.getPartsCoord().clone();return e.x===i-1&&a.x--,e.y===i-1&&a.y--,a.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var i=this._partsCoord;return new t(this._wwa,i.x+S[e],i.y+A[e],0,0)}var a=this._partsCoord.x,s=this._partsCoord.y;return this._offsetCoord.x<0?a--:this._offsetCoord.x>0&&a++,this._offsetCoord.y<0?s--:this._offsetCoord.y>0&&s++,new t(this._wwa,a,s,0,0)},t.prototype.getNextFramePosition=function(e,i,a){var s=this._partsCoord.x,r=this._partsCoord.y,n=this._offsetCoord.x+S[e]*i,o=this._offsetCoord.y+A[e]*a;if(n<0){var c=Math.floor(Math.abs(n)/H.CHIP_SIZE);s-=c,n=(n+c*H.CHIP_SIZE)%H.CHIP_SIZE}if(o<0){var h=Math.floor(Math.abs(o)/H.CHIP_SIZE);r-=h,o=(o+h*H.CHIP_SIZE)%H.CHIP_SIZE}return n>=H.CHIP_SIZE&&(s+=Math.floor(n/H.CHIP_SIZE),n=(n+H.CHIP_SIZE)%H.CHIP_SIZE),o>=H.CHIP_SIZE&&(r+=Math.floor(o/H.CHIP_SIZE),o=(o+H.CHIP_SIZE)%H.CHIP_SIZE),new t(this._wwa,s,r,n,o)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var i=t.getPosition()._partsCoord,a=this._partsCoord.x,s=this._partsCoord.y,r=e?1:0;return i.x<=a&&a<i.x+H.H_PARTS_NUM_IN_WINDOW-r&&i.y<=s&&s<i.y+H.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===H.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===H.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),E=function(t,e,i){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=i.clone()},m=function(t,e,i,a,s){this.partsIDObj=t,this.x=e,this.y=i,this.isStatic=a,this.isFighting=s};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(h||(h={})),function(t){t[t.UNUSED=0]="UNUSED",t[t.LEFT=4]="LEFT",t[t.RIGHT=6]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=8]="UP",t[t.LEFT_DOWN=1]="LEFT_DOWN",t[t.LEFT_UP=7]="LEFT_UP",t[t.RIGHT_DOWN=3]="RIGHT_DOWN",t[t.RIGHT_UP=9]="RIGHT_UP",t[t.NO_DIRECTION=5]="NO_DIRECTION"}(u||(u={}));var y,g,w,v,S=[0,-1,0,1,-1,0,1,-1,0,1],A=[0,1,1,1,0,0,0,-1,-1,-1];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(y||(y={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(g||(g={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(w||(w={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(v||(v={}));var T,I,C,O,D,P,N,b,x,M=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?T.XBOX:t.match(/windows/i)?T.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?T.IOS:T.MACINTOSH:t.match(/iphone|ipad|ipod/i)?T.IOS:t.match(/oculus/i)?T.OCULUS:t.match(/android/i)?T.ANDROID:t.match(/nintendo/i)?T.NINTENDO:t.match(/playstation/i)?T.PLAY_STATION:t.match(/linux/i)?T.LINUX:T.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?C.CHROME:t.match(/firefox/i)?C.FIREFOX:t.match(/safari/i)?C.SAFARI:C.OTHERS},t.prototype.getDevice=function(){switch(this.os){case T.WINDOWS:case T.MACINTOSH:case T.LINUX:return I.PC;case T.IOS:case T.ANDROID:return I.SP;case T.OCULUS:return I.VR;case T.NINTENDO:case T.PLAY_STATION:case T.XBOX:return I.GAME}return I.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(T||(T={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(I||(I={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(O||(O={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(D||(D={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(P||(P={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(N||(N={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(b||(b={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(x||(x={}));var L,R=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MONEY=37]="SET_MONEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.MAP2=61]="MAP2",t[t.SHOW_STR2=62]="SHOW_STR2",t[t.CONSOLE_LOG2=63]="CONSOLE_LOG2",t[t.DELAYBGM=64]="DELAYBGM",t[t.SYSMSG=65]="SYSMSG",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(L||(L={}));var B,U,k,W={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$map2:61,$show_str2:62,$console_log2:63,$delaybgm:64,$sysmsg:65,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(B||(B={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(U||(U={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(k||(k={}));var V,F=[1,2,5,8,10,20],Y=["超低速","低速","準低速","中速","高速","超高速"],G=["energy","strength","defence","gold"],H=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=F.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[F.length-2,F.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10,t}(),K=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),j=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),X=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(V||(V={}));var J,Z,q,Q,z,$,tt,et=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],it=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(J||(J={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(Z||(Z={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(q||(q={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(Q||(Q={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(z||(z={})),function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}($||($={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_B=66]="KEY_B",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_F=70]="KEY_F",t[t.KEY_G=71]="KEY_G",t[t.KEY_H=72]="KEY_H",t[t.KEY_I=73]="KEY_I",t[t.KEY_J=74]="KEY_J",t[t.KEY_K=75]="KEY_K",t[t.KEY_L=76]="KEY_L",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_O=79]="KEY_O",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_R=82]="KEY_R",t[t.KEY_S=83]="KEY_S",t[t.KEY_T=84]="KEY_T",t[t.KEY_U=85]="KEY_U",t[t.KEY_V=86]="KEY_V",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F10=121]="KEY_F10",t[t.KEY_F12=123]="KEY_F12"}(tt||(tt={}));var at,st,rt=function(){function t(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),this._keyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(t.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1,this._keyState[e]=!1,this._prevKeyState[e]=!1,this._prevKeyStateOnControllable[e]=!1,this._keyInputContinueFrameNum[e]=0}return t.prototype.checkHitKey=function(t){var e=this.getKeyState(t);return e===$.KEYDOWN||e===$.KEYPRESS},t.prototype.getKeyState=function(t){return this._prevKeyState[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForControllPlayer=function(t){return this._prevKeyStateOnControllable[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForMessageCheck=function(t){return this._prevKeyState[t]?this._keyState[t]?this._keyInputContinueFrameNum[t]>=H.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?$.KEYPRESS_MESSAGECHANGE:$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},t.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},t.prototype.update=function(){var e;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),e=0;e<t.KEY_BUFFER_MAX;e++)this._keyState[e]&&this._keyInputContinueFrameNum[e]++},t.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},t.prototype.allClear=function(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1},t.KEY_BUFFER_MAX=256,t}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(at||(at={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(st||(st={}));var nt,ot,ct=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===at.MOUSEDOWN||e===at.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?at.NONE:this._prevMouseState?this._mouseState?at.MOUSEPRESS:at.MOUSEUP:this._mouseState?at.MOUSEDOWN:at.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?at.NONE:this._prevMouseStateOnControllable?this._mouseState?at.MOUSEPRESS:at.MOUSEUP:this._mouseState?at.MOUSEDOWN:at.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===st.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(nt||(nt={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(ot||(ot={}));var ht=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,i,a,s,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){i=r[t];var o=this.gamepad.buttons[i];if(!o)return!1;if(a="object"==typeof o?!0===o.pressed:1===o,s=this.triggers[i],this.triggers[i]=a,a&&!s)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,i,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++){i=a[t];var r=this.gamepad.buttons[i];if(!r)return!1;if("object"==typeof r?!0===r.pressed:1===r)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(!this.gamepad)return!1;for(e=i.length,t=0;t<e;t++)switch(i[t]){case nt.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[ot.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[ot.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_UP))return!0;break;case nt.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[ot.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[ot.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_DOWN))return!0;break;case nt.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[ot.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[ot.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_LEFT))return!0;break;case nt.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[ot.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[ot.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(ot.AXES_CROSS_KEY)||this.buttonPressed(nt.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,i,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return 0;for(e=a.length,t=0;t<e;t++){i=a[t];var r=this.gamepad.axes[i];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),ut=function(){function t(t){void 0===t&&(t=0),this.lastCalculatedTimeUnixMs=Date.now(),this.lastCalculatedPlayTimeMs=t}return t.prototype.calculateTimeMs=function(){var t=Date.now(),e=t-this.lastCalculatedTimeUnixMs+this.lastCalculatedPlayTimeMs;return this.lastCalculatedTimeUnixMs=t,this.lastCalculatedPlayTimeMs=e,e},t.prototype.calculatePlayTimeFormat=function(){return t.formatPlayTimeText(this.calculateTimeMs()/1e3)},t.formatPlayTimeText=function(t){var e=Math.floor(t);return e>=36e6?"9999:99:99":("000"+(e/60/60|0)).slice(-4)+":"+("0"+(e/60|0)%60).slice(-2)+":"+("0"+e%60).slice(-2)},t}(),_t=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],lt=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],pt=new Set(lt),dt=function(){function t(e,i,a,s,r,n){void 0===i&&(i=!1),void 0===a&&(a=null),void 0===s&&(s=null),void 0===r&&(r=null),void 0===n&&(n=null);var o=this;if(this._enabled=null!==e,this._visible=i,this._onTouchStart=r||null,this._onTouchEnd=n||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=s,this._buttonWrapperElement=a,this._setVisible(i),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility="visible"),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility="visible"),null!==e){var c=function(i){var a=e[i];if(!a)return"continue";var s=i;h._availableButtons.push(s),a.setAttribute("type",i),h._isTouchingButtons[s]={prev:!1,current:!1,next:!1};var r=function(t){t.cancelable&&t.preventDefault()};a.addEventListener("touchstart",(function(t){r(t),o.setTouchInfo(s)})),a.addEventListener("touchcancel",(function(t){r(t),o.allClear()})),t.isMoveButton(s)?(a.addEventListener("touchmove",h._detectMovingMoveButton.bind(h)),a.addEventListener("touchend",h.allMoveClear.bind(h))):a.addEventListener("touchend",(function(t){r(t),o.clearTouchInfo(s)}))},h=this;for(var u in e)c(u);null!==s&&s.addEventListener("touchmove",this._detectMovingMoveButton.bind(this))}}return t.prototype._detectMovingMoveButton=function(t){t.preventDefault(),this.allMoveClear();var e=t.targetTouches.item(0);if(this._moveButtonsElement&&null!==e){var i=this._moveButtonsElement.getBoundingClientRect(),a=document.body.getBoundingClientRect(),s=i.left-a.left+i.width/2,r=i.top-a.top+i.height/2,n=e.pageX-s,o=e.pageY-r;n>=o?n<=-o?this.setTouchInfo("BUTTON_UP"):this.setTouchInfo("BUTTON_RIGHT"):n>=-o?this.setTouchInfo("BUTTON_DOWN"):this.setTouchInfo("BUTTON_LEFT")}},t.prototype._setVisible=function(t){null!==this._moveButtonsElement&&(this._moveButtonsElement.style.display=t?"grid":"none"),null!==this._buttonWrapperElement&&(this._buttonWrapperElement.style.display=t?"grid":"none"),this._visible=t},t.prototype.checkTouchButton=function(t){return!!this._enabled&&"TOUCH"===this.getButtonState(t)},t.prototype.checkTouchingButton=function(t){if(!this._enabled)return!1;var e=this.getButtonState(t);return"TOUCH"===e||"TOUCHING"===e},t.prototype.getButtonState=function(t){var e=this._isTouchingButtons[t];if(!this._enabled||void 0===e)return"NONE";var i=e.prev,a=e.current;return i&&a?"TOUCHING":a?"TOUCH":i?"LEAVE":"NONE"},t.prototype.setTouchInfo=function(t){var e=this._isTouchingButtons[t];this._enabled&&void 0!==e&&(e.next=!0)},t.prototype.clearTouchInfo=function(t){var e=this._isTouchingButtons[t];this._enabled&&void 0!==e&&(e.next=!1)},t.prototype.allMoveClear=function(){var t=this;lt.forEach((function(e){t._availableButtons.includes(e)&&t.clearTouchInfo(e)}))},t.prototype.allClear=function(){var t=this;this._availableButtons.forEach((function(e){if(void 0!==e){var i=t._isTouchingButtons[e];void 0!==i&&(i.next=!1)}}))},t.isMoveButton=function(t){return pt.has(t)},t.prototype.update=function(){var t=this;this._availableButtons.forEach((function(e){var i,a;if(void 0!==e){var s=t._isTouchingButtons[e];if(void 0!==s)switch(t._isTouchingButtons[e].prev=s.current,t._isTouchingButtons[e].current=s.next,t.getButtonState(e)){case"TOUCH":null===(i=t._onTouchStart)||void 0===i||i.call(t,e);break;case"LEAVE":null===(a=t._onTouchEnd)||void 0===a||a.call(t,e)}}}))},t.prototype.toggleVisible=function(){this._setVisible(!this._visible)},t}();function ft(){var t=document.querySelector("meta[name='viewport']"),e=window.innerWidth,i=window.innerHeight,a="user-scalable=no";if(e>i){var s=Math.floor(e/i*456);a="width=".concat(s,",").concat(a)}else e<=i&&(a="width=".concat(576,",").concat(a));null==t||t.setAttribute("content","".concat(a))}var Et,mt=function(t){return document.getElementById(t)},yt=function(t){return document.getElementsByTagName(t)},gt=function(t){return document.querySelector(t)},wt=function(t){return document.querySelector(t)},vt=function(t){return document.querySelectorAll(t)},St=function(t,e){var i,a,s=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return i=t-mt("wwa-wrapper").offsetLeft+s,a=e-mt("wwa-wrapper").offsetTop+r,new d(i,a)},At=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},Tt=function(t){var e="";if(t instanceof Array){for(var i=0;i<t.length;i++)e+=Tt(t[i])+"/";return e}return t+""},It=function(t){return t.split("").reverse().join("")},Ct=function(){function t(t,e,i){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:i}),this._isTransparent=i}return t.prototype.drawCanvas=function(t,e,i,a,s){this.ctx.drawImage(t,H.CHIP_SIZE*e,H.CHIP_SIZE*i,H.CHIP_SIZE,H.CHIP_SIZE,a,s,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,i,a){this._isTransparent?this.ctx.clearRect(t,e,i,a):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,i,a))},t}(),Ot=function(){function t(t,e,i,a){var s;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=a,this._load(),this._frameCoord=i.clone(),this.cpPartsLog=new d(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE);for(var t=1;t<H.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,H.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,H.CHIP_SIZE*t,H.MAP_WINDOW_HEIGHT-H.CHIP_SIZE);for(t=1;t<H.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,H.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,H.MAP_WINDOW_WIDTH-H.CHIP_SIZE,H.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var i,a=t.length;for(e=0;e<a;e++){var s=t[e];(i=this._effectCanvases[e])?i.clear():i=this._effectCanvases[e]=new Ct(H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<H.V_PARTS_NUM_IN_WINDOW;r++)for(var n=0;n<H.H_PARTS_NUM_IN_WINDOW;n++)i.drawCanvas(this._image,s.x,s.y,n*H.CHIP_SIZE,r*H.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE,0,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2),0,H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2),H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-1),H.CHIP_SIZE,H.CHIP_SIZE,H.CHIP_SIZE*(H.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,i,a){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE,H.CHIP_SIZE,i,a,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,i,a,s,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE*i,H.CHIP_SIZE*a,s,r,H.CHIP_SIZE*i,H.CHIP_SIZE*a)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,i,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,a+H.CHIP_SIZE-s);r>=H.CHIP_SIZE||this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e,H.CHIP_SIZE,H.CHIP_SIZE-r,i,a,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var i=this;return function(a,s,r,n,o){if(!i._isLoaded)throw new Error("No image was loaded.");var c=Math.max(0,e(n,o));c>=H.CHIP_SIZE||t.ctx.drawImage(i._image,H.CHIP_SIZE*a,H.CHIP_SIZE*s+c,H.CHIP_SIZE,H.CHIP_SIZE-c,r,n+c,H.CHIP_SIZE,H.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,i,a,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+H.CHIP_SIZE-e}))(t,e,i,a,s)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,i,a,s){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,i,a,s)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,i,a,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+H.CHIP_SIZE-e}))(e,i,a,s,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,i,a,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,i,a,s,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW,0,0,H.CHIP_SIZE*H.V_PARTS_NUM_IN_WINDOW,H.CHIP_SIZE*H.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,i,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s-a);r>=H.CHIP_SIZE||this._ctx.drawImage(this._image,H.CHIP_SIZE*t,H.CHIP_SIZE*e+r,H.CHIP_SIZE,H.CHIP_SIZE-r,i,a+r,H.CHIP_SIZE,H.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,i,a){this._ctx.clearRect(t,e,i,a)},t.prototype.drawBase=function(t,e,i,a){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,i,a)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),Dt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=F[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(H.H_PARTS_NUM_IN_WINDOW-1),e*(H.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===H.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===H.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),Pt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Nt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),bt=function(t){function e(e){return t.call(this,e)||this}return Pt(e,t),e}(Nt);!function(t){function e(e){return t.call(this,e)||this}Pt(e,t)}(Nt);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(Et||(Et={}));var xt=function(t){function e(e,i,a,s,r,n,o){var c=t.call(this,i)||this;c.itemTransitioningClassName="item-transitioning",c.overwittenItemClassName="item-overwritten",c.overwittenItemSelector=".".concat(c.overwittenItemClassName),c.itemEffectStartTimers=new Array(H.ITEMBOX_SIZE),c._status=s,c._equipStatus=new l(0,0),c._itemBox=new Array(H.ITEMBOX_SIZE),c._itemBoxElement=new Array(H.ITEMBOX_SIZE),c._itemUsingEvent=new Array(H.ITEMBOX_SIZE);for(var h=0;h<c._itemBox.length;h++)c._itemBox[h]=0,c._itemBoxElement[h]=wt("#item"+h+">.item-disp");return c.updateItemBox(),c._energyMax=r,c._dir=u.DOWN,c._isMovingImage=!1,c._wwa=e,c._state=Et.CONTROLLABLE,c._camera=a,c._isPartsEventExecuted=!1,c._energyValueElement=wt("#disp-energy>.status-value-box"),c._strengthValueElement=wt("#disp-strength>.status-value-box"),c._defenceValueElement=wt("#disp-defence>.status-value-box"),c._goldValueElement=wt("#disp-gold>.status-value-box"),c._isReadyToUseItem=!1,c._isClickableItemGot=!1,c._moves=n,c._moveMacroWaitingRemainMoves=0,c._moveObjectAutoExecTimer=0,c.updateStatusValueBox(),c._partsAppeared=!1,c._afterMoveMacroFlag=!1,c._isPreparedForLookingAround=!0,c._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME,c._speedIndex=o,c._messageDelayFrameCount=0,c}return Pt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===Et.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=Et.CONTROLLABLE)}else if(this._state===Et.MOVING){try{var t=this._position.getNextFramePosition(this._dir,F[this._speedIndex],F[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=Et.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._wwa.callMoveUserDefineFunction()),this._position=t}},e.prototype.controll=function(t){var e,i;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,F[this._speedIndex],F[this._speedIndex]),i=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(i)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=Et.CAMERA_MOVING}catch(t){this._state=Et.CONTROLLABLE}return}if(!this.canMoveTo(i))return this._wwa.getMapTypeByPosition(i)===H.MAP_WALL&&this._wwa.checkMap(i.getPartsCoord()),void this._wwa.checkObject(i.getPartsCoord());this._position=e,this._state=Et.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),H.ATR_TYPE)!==H.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==H.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===H.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,H.ATR_MODE)===H.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===H.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,H.ATR_NUMBER)===H.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,H.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==Et.MOVING||this._state==Et.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==H.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==H.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==H.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==H.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===Et.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==H.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==H.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===Et.LOCALGATE_JUMPED||this._state===Et.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=Et.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===Et.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state!==Et.MESSAGE_WAITING&&this._state!==Et.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===Et.MESSAGE_WAITING?this._state=Et.CONTROLLABLE:this._state===Et.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=Et.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=Et.ESTIMATE_WINDOW_WAITING},e.prototype.isWaitingEstimateWindow=function(){return this._state===Et.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===Et.ESTIMATE_WINDOW_WAITING&&(this._state=Et.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=Et.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===Et.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===Et.PASSWORD_WINDOW_WAITING&&(this._state=Et.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===v.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===v.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==Et.LOCALGATE_JUMPED&&this._state!==Et.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===Et.LOCALGATE_JUMPED?Et.CONTROLLABLE:Et.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===Et.MESSAGE_WAITING?Et.LOCALGATE_JUMPED_WITH_MESSAGE:Et.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=H.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME),this._wwa.callJumpGateUserDefineFunction(),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=Et.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=H.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=H.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new l(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new l(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,i=function(i){var s=a._itemBoxElement[i],r=gt("#item"+i);if(0===a._itemBox[i])return s.style.backgroundPosition="-40px 0px",a.disposeItemEffect(i,a._itemBoxElement[i],r),"continue";var n=a._wwa.getObjectCropXById(a._itemBox[i]),o=a._wwa.getObjectCropYById(a._itemBox[i]);if(!t||i!==t.insertPos-1)return s.style.backgroundPosition="-"+n+"px -"+o+"px",a.disposeItemEffect(i,a._itemBoxElement[i],r),"continue";var c=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,h=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,u=-c*H.DEFAULT_FRAME_INTERVAL/H.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,_=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=_?t.itemBoxBackgroundImageCoord.x:a._wwa.getObjectCropXById(t.overwrittenObjectId),p=_?t.itemBoxBackgroundImageCoord.y:a._wwa.getObjectCropYById(t.overwrittenObjectId);s.style.left=c+"px",s.style.top=h+"px","number"==typeof a.itemEffectStartTimers[i]&&clearInterval(a.itemEffectStartTimers[i]),a.itemEffectStartTimers[i]=window.setTimeout((function(){e.itemEffectStartTimers[i]=void 0,e.startItemEffect(i,s,r,{target:{x:n,y:o},overwritten:{x:l,y:p}},u)}),H.DEFAULT_FRAME_INTERVAL)},a=this,s=0;s<this._itemBoxElement.length;s++)i(s)},e.prototype.startItemEffect=function(t,e,i,a,s){var r=this,n=i.querySelector(this.overwittenItemSelector);n&&i.removeChild(n);var o=document.createElement("div");o.classList.add(this.overwittenItemClassName),o.style.backgroundPosition="-"+a.overwritten.x+"px -"+a.overwritten.y+"px",o.style.backgroundImage=i.style.backgroundImage,i.appendChild(o),e.style.backgroundPosition="-"+a.target.x+"px -"+a.target.y+"px",e.style.transitionDuration=s+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",i.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,i)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,i){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",i.classList.contains(this.itemTransitioningClassName)&&i.classList.remove(this.itemTransitioningClassName);var a=i.querySelector(this.overwittenItemSelector);a&&i.removeChild(a)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,i,a){var s,r,n;void 0===e&&(e=0),void 0===i&&(i=!1);var o=this._wwa.getObjectAttributeById(t,H.ATR_NUMBER),c=0;if(0===e&&0!==o&&(e=o),0===e){if(0===t)return;if((s=this._getBlankItemPos())===H.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,-1),this._wwa.callGetItemFullUserDefineFunction(),new Error("これ以上、アイテムを持てません。");c=this._itemBox[s-1],this._forceSetItemBox(s,t)}else if(!1===i)if(s=e,n=this._itemBox[s-1],this._wwa.getObjectAttributeById(n,H.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,H.ATR_NUMBER)){if((r=this._getBlankItemPos())===H.ITEMBOX_IS_FULL)throw this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,-1),this._wwa.callGetItemFullUserDefineFunction(),new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,n),this._forceSetItemBox(s,t)}else c=this._itemBox[s-1],this._forceSetItemBox(s,t);else s=e,c=this._itemBox[s-1],this._forceSetItemBox(s,t);this._updateEquipmentStatus(),this.updateItemBox(a?{insertPos:s,itemScreenPixelCoord:a.screenPixelCoord,itemBoxBackgroundImageCoord:a.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new d(H.MAP_WINDOW_WIDTH+(s-1)%3*H.CHIP_SIZE,H.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*H.CHIP_SIZE),overwrittenObjectId:c}:void 0)},e.prototype._forceSetItemBox=function(t,e){var i=this,a=wt("#item"+(t-1)+">.item-click-border"),r=this._wwa.getObjectAttributeById(e,H.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(e,t),this._wwa.callGetItemUserDefineFunction(),0!==e&&r!==w.NORMAL){var n=this._wwa.resolveSystemMessage(s.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||("BLANK"!==n&&this._wwa.generatePageAndReserveExecution(n,!1,!0),this._isClickableItemGot=!0),a.style.display="block",function(t){i._itemUsingEvent[t-1]=function(){(i.isControllable()||i._wwa._messageWindow.isItemMenuChoice())&&(i._wwa._itemMenu.close(),i._wwa._setNextPage(),i._wwa.onselectitem(t))}}(t),a.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return H.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new l(0,0);for(t=0;t<H.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],H.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],H.ATR_DEFENCE));var i=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(i),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<H.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,H.ATR_MODE)!==w.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,H.ATR_MODE)!==w.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=mt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),H.DEFAULT_FRAME_INTERVAL),this._wwa.setEvalCalCWwaNodeReadOnlyItemValue(t,this._readyToUseItemPos-1),this._wwa.callUseItemUserDefineFunction(),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==H.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],H.ATR_MODE)!==w.NORMAL&&((e=wt("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var i=0;i<H.ITEMBOX_SIZE;i++)if(this._itemBox[i]===t)return this._wwa.getObjectAttributeById(this._itemBox[i],H.ATR_MODE)!==w.NORMAL&&((e=wt("#item"+i+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[i]),e.style.display="none"),this._itemBox[i]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=H.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=H.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=Et.BATTLE},e.prototype.isFighting=function(){return this._state===Et.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===H.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===H.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>H.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(k.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=H.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(k.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,H.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new p(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(v.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(v.OBJECT,0,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,g.OBJECT,this._enemy.partsID),this._state=Et.CONTROLLABLE,this._wwa.generatePageAndReserveExecution(this._enemy.message,!1,!1,this._enemy.partsID,v.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess();var i=this._wwa.resolveSystemMessage(s.CANNOT_DAMAGE_MONSTER);"BLANK"!==i&&this._wwa.generatePageAndReserveExecution(i,!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=Et.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.shouldApplyGameOver({isCalledByMacro:!1})&&this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,H.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),g.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),i=this._camera.getPosition(),a=i.getPartsCoord(),s=i.getOffsetCoord(),r=(t.x-a.x)*H.CHIP_SIZE+e.x-s.x+H.CHIP_SIZE/2,n=(t.y-a.y)*H.CHIP_SIZE+e.y-s.y+H.CHIP_SIZE/2;return new d(r,n)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=H.CHIP_SIZE/F[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(H.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(H.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<H.MIN_SPEED_INDEX||H.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(bt),Mt=function(){function t(t,e,i,a,s,r,n){this._partsID=t,this._position=e,this._imgCoord=i,this._status=a,this._message=s,this._item=r,this._battleEndCallback=n}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),Lt=function(){function t(t,e,i,a,s){this._player=t,this._objectID=e,this._srcPos=i,this._destPos=a,this._dir=s,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,F[t],F[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),Rt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,i,a){this._queue.push(new Lt(this._player,t,e,i,a))},t.prototype.update=function(){for(var t=[],e=[],i=0;i<this._queue.length;i++)this._queue[i].update(),this._queue[i].isAchievedDestination?(t.push(this._queue[i]),this._wwa.setPartsOnPosition(v.OBJECT,0,this._queue[i].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(v.OBJECT,this._queue[i].objID,this._queue[i].destination.getPartsCoord())):e.push(this._queue[i]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}();function Bt(t,e,i){if(void 0===i&&(i=0),"boolean"==typeof t)return t;var a=Ut(t.left,e,i),s=Ut(t.right,e,i);return function(t,e,i){switch(t){case">":return e>i;case"<":return e<i;case">=":return e>=i;case"<=":return e<=i;case"==":return e===i;case"!=":return e!==i;default:return!1}}(t.operator,a,s)}function Ut(t,e,i){switch(void 0===i&&(i=0),t.type){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return e.userVars[t.index];case"MAP":return t.y<0||t.y>=e.map.length||t.x<0||t.x>=e.map[t.y].length?0:e.map[t.y][t.x];case"OBJECT":return t.y<0||t.y>=e.mapObject.length||t.x<0||t.x>=e.mapObject[t.y].length?0:e.mapObject[t.y][t.x];case"ITEM":return t.boxIndex1To12<1||t.boxIndex1To12>12?0:e.itemBox[t.boxIndex1To12-1];case"ITEM_COUNT_ALL":return e.itemBox.filter((function(t){return 0!==t})).length;case"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"X":return e.partsPosition.x;case"Y":return e.partsPosition.y;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"PDIR":return e.playerDirection;case"ID":return e.partsId;case"TYPE":return e.partsType;case"RAND":return Math.floor(Math.random()*Ut(t.argument,e));case"ITEM_COUNT":return e.itemBox.filter((function(i){return i===Ut(t.argument,e)})).length;default:return i}}function kt(t,e,i){switch(t){case"=":return i;case"+":case"+=":return e+i;case"-":case"-=":return e-i;case"*":case"*=":return e*i;case"/":case"/=":return 0===i?0:e/i;case"%":case"%=":return 0===i?0:e%i;default:throw new Error("未定義の演算子です")}}var Wt="-?\\d+",Vt="v\\[".concat(Wt,"\\]"),Ft="v\\[(".concat(Wt,")\\]"),Yt="m\\[".concat(Wt,"\\]\\[").concat(Wt,"\\]"),Gt="m\\[(".concat(Wt,")\\]\\[(").concat(Wt,")\\]"),Ht="o\\[".concat(Wt,"\\]\\[").concat(Wt,"\\]"),Kt="o\\[(".concat(Wt,")\\]\\[(").concat(Wt,")\\]"),jt="ITEM\\[".concat(Wt,"\\]"),Xt="ITEM\\[(".concat(Wt,")\\]"),Jt="".concat(Vt,"|").concat(Yt,"|").concat(Ht,"|").concat(jt),Zt="HP|HPMAX|AT|DF|GD|STEP|PDIR",qt="".concat(Jt,"|").concat(Yt,"|").concat(Ht,"|").concat(jt,"|").concat(Zt),Qt="".concat(Wt,"|").concat(Jt,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|X|Y|PX|PY|ID|TYPE|ITEM_COUNT_ALL","|").concat(Zt),zt="RAND\\((?:".concat(Qt,")\\)"),$t="RAND\\((".concat(Qt,")\\)"),te="ITEM_COUNT\\((?:".concat(Qt,")\\)"),ee="ITEM_COUNT\\((".concat(Qt,")\\)"),ie="".concat(zt,"|").concat(te),ae="".concat(Qt,"|").concat(ie),se="\\+|\\-|\\*|\\/|%",re="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ne="^\\(",oe="\\)$",ce=new RegExp("^".concat(Wt,"$")),he=new RegExp("^".concat(Ft,"$")),ue=new RegExp("^".concat(Gt,"$")),_e=new RegExp("^".concat(Kt,"$")),le=new RegExp("^".concat(Xt,"$")),pe=new RegExp("^".concat($t,"$")),de=new RegExp("".concat(ee,"$")),fe=new RegExp("".concat(ne,"(").concat(qt,")").concat("=","(").concat(ae,")(").concat(se,")(").concat(ae,")").concat(oe)),Ee=new RegExp("".concat(ne,"(").concat(qt,")(").concat(re,")(").concat(ae,")").concat(oe)),me=new RegExp("^(".concat(ae,")(?:(").concat(se,")(").concat(ae,"))?$")),ye=new RegExp("".concat(ne,"(").concat(ae,")(").concat(">|<|<=|>=|==|!=",")(").concat(ae,")").concat(oe));function ge(t){return"RAND"!==t.type&&"ITEM_COUNT"!==t.type}function we(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"X":case"Y":case"PX":case"PY":case"PDIR":case"ID":case"TYPE":case"ITEM_COUNT_ALL":return{type:t};default:var e=t.match(he);if(e)return null===(r=ve(e))?null:{type:"VARIABLE",index:r};var i=t.match(ue);if(i)return null===(a=Se(i))?null:{type:"MAP",x:a[0],y:a[1]};var a,s=t.match(_e);if(s)return null===(a=Se(s))?null:{type:"OBJECT",x:a[0],y:a[1]};var r,n=t.match(le);if(n)return null===(r=ve(n))?null:{type:"ITEM",boxIndex1To12:r};if(t.match(ce)){var o=parseInt(t,10);return null===o||isNaN(o)?null:{type:"NUMBER",rawValue:o}}var c=t.match(pe);if(c)return null!==(h=c.length>=2?we(c[1]):null)&&ge(h)?{type:"RAND",argument:h}:null;var h,u=t.match(de);return u&&(null!==(h=u.length>=2?we(u[1]):null)&&ge(h))?{type:"ITEM_COUNT",argument:h}:null}}function ve(t){var e=t.length>=2?Number(t[1]):null;return null===e||isNaN(e)?null:e}function Se(t){if(t.length<3)return null;var e=Number(t[1]),i=Number(t[2]);return isNaN(e)||isNaN(i)?null:[e,i]}function Ae(t,e){var i;switch(null===(i=we(e))||void 0===i?void 0:i.type){case"VARIABLE":var a=e.match(/^v\[(\d+)\]$/),s=Number(a[1]);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:"variable",index:s,rawValue:t};case"MAP":var r=e.match(/^m\[(\d+)\]\[(\d+)\]$/),n=Number(r[1]),o=Number(r[2]);if(null===n||null===o||isNaN(n)||isNaN(o))throw new Error("背景パーツの添字のパースに失敗しました");return{assignee:"map",x:n,y:o,rawValue:t};case"OBJECT":var c=e.match(/^o\[(\d+)\]\[(\d+)\]$/);n=Number(c[1]),o=Number(c[2]);if(null===n||null===o||isNaN(n)||isNaN(o))throw new Error("物体パーツの添字のパースに失敗しました");return{assignee:"mapObject",x:n,y:o,rawValue:t};case"ITEM":var h=e.match(/^ITEM\[(\d+)\]$/),u=Number(h[1]);if(null===u||isNaN(u))throw new Error("アイテムの添字のパースに失敗しました");return{assignee:"item",boxIndex1to12:u,rawValue:t};case"ITEM_COUNT_ALL":case"ITEM_COUNT":throw new Error("左辺値に所持アイテム数は入れられません");case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":return{assignee:"moveCount",rawValue:t};case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"X":throw new Error("左辺値にパーツX座標は入れられません");case"Y":throw new Error("左辺値にパーツY座標は入れられません");case"ID":throw new Error("左辺値にパーツ番号座標は入れられません");case"TYPE":throw new Error("左辺値にパーツ種別は入れられません");case"PDIR":return{assignee:"playerDirection",rawValue:t};case"RAND":throw new Error("左辺値に乱数は入れられません");default:throw new Error("この文字列から代入操作オブジェクトは生成できません")}}function Te(t){return t.replace(/\s/g,"")}function Ie(t,e,i){return void 0===i&&(i=0),Ut(we(t),e,i)}function Ce(t,e,i){void 0===i&&(i=0);var a=Te(t).match(me);if(null!==a){var s=Ie(a[1],e,i),r=a[3]?Ie(a[3],e,i):void 0,n=a[2];return n&&r?kt(n,s,r):s}throw new Error("マクロ引数のフォーマットを満たしていません: "+t)}function Oe(t){var e=Te(t).match(ye);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var i=we(e[1]),a=we(e[3]);if(i&&a)return{left:i,right:a,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var De=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Pe=function(t,e,i,a,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=i,this.isSystemMessage=a,this.scoreOptions=s,this.extraInfo=r},Ne=function(){},be=function(t){function e(e){void 0===e&&(e=[]);var i=t.call(this)||this;return i.branches=e,i}return De(e,t),e.prototype.appendBranch=function(t){this.branches.push(t)},e.prototype.getLastUnconnectedBranch=function(){for(var t=0,e=this.branches;t<e.length;t++){var i=e[t];if(!i.next)return i}},e.prototype.evaluateAndGetNextNode=function(t){for(var e=0,i=this.branches;e<i.length;e++){var a=i[e];if(!a.descriminant||Bt(a.descriminant,t()))return a.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(Ne),xe=function(t){function e(e,i,a){var s=t.call(this)||this;return s.macro=i,s.next=a,s.messageSegments=s.parseMessage(e),void 0===s.macro&&(s.macro=[]),s}return De(e,t),e.prototype.isEmpty=function(){return this.messageSegments.reduce((function(t,e){return t&&""===e}),!0)},e.prototype.generatePrintableMessage=function(){return this.messageSegments.reduce((function(t,e){var i="string"==typeof e?e:e();return"".concat(t).concat(i)}),"")},e.prototype.appendMessage=function(t,e){void 0===e&&(e=!1),this.messageSegments=this.messageSegments.concat(e?["\n"]:[],this.parseMessage(t))},e.prototype.parseMessage=function(t){return"string"==typeof t?[t]:t},e}(Ne);function Me(t){return void 0===t||(t instanceof be?t.branches.reduce((function(t,e){return t&&Me(e.next)}),!0):t instanceof xe?t.isEmpty()&&Me(t.next):void 0)}var Le=function(t){return t===L.SHOW_STR||t===L.SHOW_STR2||"text"===t||"normalMacro"===t},Re=function(){function t(t,e,i,a,s,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=i,this._triggerPartsPosition=a,this.macroType=s,this.macroArgs=r}return t.prototype.isJunction=function(){return[L.IF,L.ELSE_IF,L.ELSE,L.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case L.IMGPLAYER:return this._executeImgPlayerMacro(),{};case L.IMGYESNO:return this._executeImgYesNoMacro(),{};case L.HPMAX:return this._executeHPMaxMacro(),{};case L.SAVE:return this._executeSaveMacro(),{};case L.ITEM:return this._executeItemMacro(),{};case L.DEFAULT:return this._executeDefaultMacro(),{};case L.OLDMAP:return this._executeOldMapMacro(),{};case L.PARTS:return this._executePartsMacro(),{};case L.MOVE:return this._executeMoveMacro(),{};case L.MAP:return this._executeMapMacro(1),{};case L.DIRMAP:return this._executeDirMapMacro(),{};case L.IMGFRAME:return this._executeImgFrameMacro(),{};case L.IMGBOM:return this._executeImgBomMacro(),{};case L.DELPLAYER:return this._executeDelPlayerMacro(),{};case L.FACE:return this._executeFaceMacro(),{};case L.EFFECT:return this._executeEffectMacro(),{};case L.GAMEOVER:return this._executeGameOverMacro(),{};case L.IMGCLICK:return this._executeImgClickMacro(),{};case L.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case L.EFFITEM:return this._executeEffItemMacro(),{};case L.COLOR:return this._executeColorMacro(),{};case L.WAIT:return this._executeWaitMacro(),{};case L.SOUND:return this._executeSoundMacro(),{};case L.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case L.OLDMOVE:return this._executeOldMoveMacro(),{};case L.JUMPGATE:return this._executeJumpGateMacro(),{};case L.RECPOSITION:return this._executeRecPositionMacro(),{};case L.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case L.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case L.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case L.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case L.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case L.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case L.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case L.SET_AT:return this._executeSetAtMacro(),{};case L.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case L.SET_DF:return this._executeSetDfMacro(),{};case L.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case L.SET_MONEY:return this._executeSetMoneyMacro(),{};case L.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case L.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case L.VAR_SET:return this._executeVarSetMacro(),{};case L.VAR_ADD:return this._executeVarAddMacro(),{};case L.VAR_SUB:return this._executeVarSubMacro(),{};case L.VAR_MUL:return this._executeVarMulMacro(),{};case L.VAR_DIV:return this._executeVarDivMacro(),{};case L.VAR_MOD:return this._executeVarModMacro(),{};case L.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case L.GAME_SPEED:return this._executeGameSpeedMacro(),{};case L.SHOW_STR:case L.SHOW_STR2:case L.IF:return{};case L.LEGACY_IF:return this._executeLegacyIfMacro(),{};case L.ELSE_IF:case L.ELSE:case L.END_IF:return{};case L.SET_SPEED:return this._executeSetSpeedMacro(),{};case L.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case L.HIDE_STATUS:return this._executeHideStatusMacro(),{};case L.VAR_MAP:return this._executeVarMapMacro(),{};case L.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case L.SET:return{isGameOver:this._executeSetMacro().isGameOver};case L.MAP2:return this._executeMapMacro(2),{};case L.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case L.DELAYBGM:return this._executeDelayBgmMacro(),{};case L.SYSMSG:return this._executeSysMsgMacro(),{};default:return console.log("不明なマクロIDが実行されました:"+this.macroType),{}}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),i=0;i<e.length;i++)e[i]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._evaluateIntValue=function(t,e){void 0===e&&(e=0);var i=this.macroArgs[t];if(""===i)return e;var a=Number(i),s=a>=0?Math.floor(a):Math.ceil(a);return isNaN(s)?Ce(i,this._wwa.generateTokenValues({id:this._triggerPartsID,type:this._triggerPartsType,position:this._triggerPartsPosition}),e):s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(t){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);switch(t){case 1:return void this._wwa.outputUserVar(e);case 2:return void console.log("".concat(this.macroArgs[0]," = ").concat(e))}},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(t,e,i)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(t)},t.prototype._executeLegacyIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=0!==this._evaluateIntValue(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this.macroArgs[1],i=this.macroArgs[2],a=this._evaluateIntValue(3,v.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,i,t,a)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new d(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new d(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,v.OBJECT),a=this._evaluateIntValue(3);if(i!==v.OBJECT&&i!==v.MAP)throw new Error("パーツ種別が不明です");if(0!==a&&1!==a&&(a=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,i,!!a)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(t){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),i=this._evaluateIntValue(3,v.OBJECT);if(e<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");if(1===t){var a=this.macroArgs[1],s=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerPartsPosition,a,s,e,i)}else if(2===t){var r=this._evaluateIntValue(1),n=this._evaluateIntValue(2);if(isNaN(r)||isNaN(n))throw new Error("出現先座標が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,"".concat(r),"".concat(n),e,i)}},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2,v.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(i===v.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,i)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2);if(e<0||i<0)throw new Error("座標は正でなければなりません。");if(t===U.ENERGY||t===U.STRENGTH||t===U.DEFENCE||t===U.GOLD)this._wwa.setStatusIconCoord(t,new d(e,i));else if(t===U.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new d(e,i));else if(t===U.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:i});else{if(t!==U.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new d(e,i))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new d(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._evaluateIntValue(0),i=this._evaluateIntValue(1),a=this._evaluateIntValue(2),s=this._evaluateIntValue(3),r=this._evaluateIntValue(4),n=this._evaluateIntValue(5);if(e<0||i<0||a<0||s<0||r<0||n<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new E(new d(e,i),new d(a,s),new d(r,n)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],i=1;i<this.macroArgs.length;i+=2){var a,s=this._evaluateIntValue(i);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(i+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((a=this._evaluateIntValue(i+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new d(s,a))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new d(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new d(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");return this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),i=this._evaluateIntValue(2),a=this._evaluateIntValue(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||i<0||i>255||a<0||a>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,i,a)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(2);var t=parseInt(this.macroArgs[0]),e=parseInt(this.macroArgs[1]);this._wwa.playSound(t,e)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>H.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:{position:this._triggerPartsPosition,id:this._triggerPartsID,type:this._triggerPartsType}})},t.prototype._executeDelayBgmMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setBgmDelay(t)},t.prototype._executeSysMsgMacro=function(){this._concatEmptyArgs(2);var t=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!t)throw new Error("該当するシステムメッセージの定義がありません");var e=""===this.macroArgs[1]?void 0:this.macroArgs[1].replaceAll("\\n","\n");this._wwa.overwriteSystemMessage(t,e)},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return n(t)?t:o(this._evaluateIntValue(0))},t}();var Be,Ue=function(){function t(t,e,i,a,s,r,n){this._wwa=t,this._coord=e,this._width=i,this._height=a,this._isVisible=s,this._parentElement=r,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=n+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),ke=function(t){function e(e,i,a,s,r,n,o){var c=t.call(this,e,new d(i.x,i.y),a,s,r,n,201)||this;return c._cgFileName=o,c._monsterBox=document.createElement("div"),c._monsterBox.style.width=H.CHIP_SIZE+"px",c._monsterBox.style.height=H.CHIP_SIZE+"px",c._monsterBox.style.position="absolute",c._monsterBox.style.left="10px",c._monsterBox.style.top="10px",c._monsterBox.style.backgroundImage="url("+c._cgFileName.replace("(","\\(").replace(")","\\)")+")",c._monsterBox.style.backgroundPosition="0 0",c._element.appendChild(c._monsterBox),c._energyBox=document.createElement("div"),c._energyBox.style.position="absolute",c._energyBox.style.left="80px",c._energyBox.style.top="10px",c._energyBox.textContent="生命力 0",c._element.appendChild(c._energyBox),c._strengthBox=document.createElement("div"),c._strengthBox.style.position="absolute",c._strengthBox.style.left="80px",c._strengthBox.style.top="30px",c._strengthBox.textContent="攻撃力 0",c._element.appendChild(c._strengthBox),c._defenceBox=document.createElement("div"),c._defenceBox.style.position="absolute",c._defenceBox.style.left="180px",c._defenceBox.style.top="30px",c._defenceBox.textContent="防御力 0",c._element.appendChild(c._defenceBox),c._isVisible?c._element.style.display="block":c._element.style.display="none",c}return De(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Ue),We=function(t){function e(e,i,a,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new d(2*H.CHIP_SIZE,30),7*H.CHIP_SIZE,40,a,s,202)||this)._element.style.borderWidth="0",r._element.style.borderRadius="4px",r._element.style.fontSize="20px",r._element.style.lineHeight="40px"):r=t.call(this,e,new d(i.x,i.y),340,30,a,s,202)||this,r._element.style.textAlign="center",r._isVisible?r._element.style.display="block":r._element.style.display="none",r.update(0),r}return De(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Ue);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Be||(Be={}));var Ve=function(){function t(t,e,i,a,s,r,n,o,c,h){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var u=this,_=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=i,this._width=a,this._height=s,this._message="",this._isVisible=n,this._isYesno=o,this._isItemMenu=c,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=h,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+_+")",this._divYesElement.onclick=function(){u._isInputDisable||(t.setYesNoInput(y.YES),u.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+_+")",this._divNoElement.onclick=function(){u._isInputDisable||(t.setYesNoInput(y.NO),u.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),u._isInputDisable=!1,t.userDevice.device){case I.SP:case I.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,i,a){this._x=t,this._y=e,this._width=i,this._height=a,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,i,a,s){var r,n=a.getPartsCoord().substract(s.getPartsCoord()).y;r=t?Be.BOTTOM:e?Be.SCORE:i?Be.CENTER:n>=Math.ceil(H.V_PARTS_NUM_IN_WINDOW/2)?Be.TOP:Be.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Be.CENTER?(this._y=H.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Be.TOP?(this._y=Math.max(20,H.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Be.BOTTOM?(this._y=Math.min(H.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*H.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Be.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setMessage=function(t){this._message=t,this.update()},t.prototype.clear=function(){this._message="",this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),i=0,a="",s=0;s<t.length||0!=i;s++)if(this.isWideChar(t.charAt(s))?i+=2:i+=1,a+=t.charAt(s),i+1>2*H.MSG_STR_WIDTH){"。"!==t.charAt(s+1)&&"、"!==t.charAt(s+1)||(a+=t.charAt(s+1),s++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=a,e.appendChild(r),i=0,a=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===y.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YESP_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NO_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"):this._wwa.getYesNoState()===y.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YES_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NOP_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_YES_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+H.IMGRELPOS_YESNO_NO_X)*H.CHIP_SIZE+"px -"+e.y*H.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var i=this._message.split("\n");i.forEach((function(e,a){var s;t._wwa.isClassicMode()?s=t.createClassicTextElement(e):(s=document.createElement("span")).textContent=i[a],t._msgWrapperElement.appendChild(s),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,i,a,s,r,n,o,c,h,u,_=this;e=document.createElement("div"),h=(o=document.getElementById("disp-energy")).style.backgroundPosition,u=o.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(i=document.createElement("div")).classList.add("savedata"),i.setAttribute("save_id",p),i.addEventListener("click",(function(t){_.setSaveID(0|t.currentTarget.getAttribute("save_id")),_._save_close=!0,t.preventDefault()})),(a=document.createElement("div")).classList.add("ss"),i.appendChild(a),(s=document.createElement("div")).classList.add("wide-cell-row"),s.style.backgroundPosition=h,s.style.backgroundImage=u,i.appendChild(s),e.appendChild(i),t.flag&&(a.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=K.DATE_LAST_SAVE_TEXT_COLOR),a.appendChild(r),(n=document.createElement("div")).classList.add("status-icon"),n.style.backgroundImage=u,n.style.backgroundPosition="-120px -80px",s.appendChild(n),(c=document.createElement("div")).classList.add("status-value-box"),c.textContent=t.getStatusEnergy(),s.appendChild(c));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,i=document.querySelectorAll(".savedata"),a=i.length,s=0;s<a;s++)e=i[s],t===s?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=H.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+K.QUICK_SAVE_MAX)%K.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Fe=function(){function t(t,e,i){this.id=t,this.imgFileName=e,this.parent=i,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,i){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,i.isNoEffect?this.damageDispElem.textContent="攻撃無効":i.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+i.damage},t}(),Ye=function(){function t(t,e,i){var a,s=this;this._wwa=t,this._imgFileName=e,this._parent=i,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<H.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)a=new Fe(r,this._imgFileName,this._element),this._edes.push(a),this._element.appendChild(a.elem);this._element.addEventListener("click",(function(){s._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var i=0;i<H.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;i++)if(i>=e.length)this._edes[i].hide();else{var a=this._wwa.getObjectAttributeById(e[i],H.ATR_X),s=this._wwa.getObjectAttributeById(e[i],H.ATR_Y),r=new d(a,s),n=this._wwa.getObjectAttributeById(e[i],H.ATR_ENERGY),o=this._wwa.getObjectAttributeById(e[i],H.ATR_STRENGTH),c=this._wwa.getObjectAttributeById(e[i],H.ATR_DEFENCE),h=new p(n,o,c,0),u=He(t,h);this._edes[i].setResult(r,h,u),this._edes[i].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Ge=function(t,e,i){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=i};function He(t,e){var i=e.energy,a=t.strength-e.defence,s=Math.max(0,e.strength-t.defence),r=0,n=0;if(!(a>0))return new Ge(!0,!1,0);for(;;){if(r++,(i-=a)<=0)return new Ge(!1,!1,n);if(n+=s,r>1e4)return new Ge(!1,!0,0)}}var Ke,je=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Xe=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Ke||(Ke={}));var Je=function(){function t(t,e,i){var a=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=i,this.COPIED_MESSAGE_DISPLAY_MS=1e3,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){a._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return je(a,void 0,void 0,(function(){var t=this;return Xe(this,(function(e){switch(e.label){case 0:return[4,navigator.clipboard.writeText(this.password)];case 1:return e.sent(),this._copyButtonElement.textContent="コピーしました",this._copyButtonElement.disabled=!0,setTimeout((function(){t._copyButtonElement&&(t._copyButtonElement.textContent="コピー",t._copyButtonElement.disabled=!1)}),this.COPIED_MESSAGE_DISPLAY_MS),[2]}}))}))})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=Ke.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Ke.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Ke.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline",this._copyButtonElement.style.display="none"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none",this._copyButtonElement.style.display="inline";var i=e.split("\n");this._descriptionElement.textContent="";for(var a=0;a<i.length;a++){var s=document.createElement("span");s.textContent=i[a],this._descriptionElement.appendChild(s),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function Ze(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function qe(t,e,i){var a=document.createElement("style");a.type="text/css",a.setAttribute("id",H.WWA_STYLE_TAG_ID),yt("head")[0].appendChild(a),t.innerHTML=function(t,e){var i=t?'\n <div id="wwa-cover">\n <div id="unstable-version-warning"></div>\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(H.SCREEN_WIDTH,'" height="').concat(H.SCREEN_HEIGHT,'"></canvas>\n </div>'),a=e?'\n <div id="wwa-virtualpad-left">\n <button class="wwa-virtualpad__button" id="wwa-up-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-left-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-right-button"></button>\n <button class="wwa-virtualpad__button" id="wwa-down-button"></button>\n <div class="wwa-virtualpad__hole"></div>\n </div>\n <div id="wwa-virtualpad-right">\n <button class="wwa-virtualpad__button" id="wwa-slow-button">I</button>\n <button class="wwa-virtualpad__button" id="wwa-fast-button">P</button>\n <button class="wwa-virtualpad__button" id="wwa-enter-button">Y</button>\n <button class="wwa-virtualpad__button" id="wwa-esc-button">N</button>\n </div>':"";return'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(i,"\n").concat(a,"\n")}(null!==e,i),null!==e&&(mt("wwa-cover").style.backgroundImage="url(".concat(e,")"),mt("wwa-cover").style.backgroundRepeat="no-repeat",mt("wwa-cover").style.backgroundPosition="0 0")}var Qe=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=H.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=wt(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var i=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(i)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,i,a=null;for(e=0;e<t.COL_MAX;e++)for(i=0;i<t.ROW_MAX;i++)(a=mt(t.DOM_ID_TABLE[i][e])).classList.contains("onpress")&&a.classList.remove("onpress")},t.prototype.openView=function(){this.close();mt(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),ze=i(23);function $e(t){return"^ /".concat(231*t+8310,"P+>A[]")}function ti(t){return(0,ze.MD5)(t).toString()}var ei="map",ii="mapObject",ai="systemMessage",si="userVar",ri={mapAttribute:!0,objectAttribute:!0,message:!0},ni=function(){},oi=function(){function t(){}return t.compress=function(t){var e,i,a={};for(e in t)if(!ri[e]){switch(typeof(i=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===i&&"worldName"!==e)continue;break;case"object":if(null===i){if(this._restartData[e]===i)continue}else if(void 0===(i=this.compressObject(e,i,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}a[e]=i}return a},t.compressObject=function(t,e,i){var a,s,r,n;switch(t){case ei:case ii:var o,c,h,u,_,l,p,d,f,E,m,y,g,w;for(_ in a={},f={},d={},e)for(u in s=e[_],r=i[_],n={},c=-1,s)(p=s[u])!==r[u]&&(n[u]=p,void 0===f[p]&&(f[p]={}),void 0===(m=f[p])[_]&&(m[_]=[]),(g=m[_]).push(Number(u)));for(y in f)for(_ in m=f[y],void 0===d[y]&&(d[y]={}),E=d[y],void 0===a[y]&&(a[y]=[]),c=-1,m)1===(g=m[_]).length?(void 0===E[l=g[0]]&&(E[l]=[]),(w=E[l]).push(Number(_))):(h=(o=Number(_))-c-1,c=o,a[y].push(this.getCompressArray(g),h));for(y in d)for(u in p=Number(y),c=-1,E=d[y])w=E[u],h=(o=Number(u))-c-1,c=o,1===w.length?a[y].push(h,w[0]):a[y].push(h,this.getCompressArray(w));var v=[];for(y in c=-1,a)h=(o=Number(y))-c-1,c=o,v.push(h,a[y]);return this._usingByteFlag&&JSON.stringify(v).length>=this._mapByteLength?this.compressMapAllObject(e,i,this._firstRandomMapObjectUtf8Table[t]):v;case ai:var S;for(t in a={},e)S=e[t],i[t]!==S&&(a[t]=S);break;case si:return this.compressUserVars(e);default:return e}if(0!==Object.keys(a).length)return a},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,i){var a,s,r,n,o,c,h,u,_,l,p,d,f,E,m,y,g=this._restartData.mapWidth,w=new Uint8Array(this._mapByteLength),v=-1;for(r=0,n=0,c=0,h=0,m=0,p=[],E={},_=[],l=[],s=0;s<g;s++)for(a=0;a<g;a++)(u=t[s][a])!==e[s][a]&&(-1===v&&(v=n),w[n]=w[n]|1<<r,c=n,void 0===E[u]&&(E[u]=new ci(u,m++)),E[u].count++),8===++r&&(r=0,n++);for(o in E)p[E[o].index]=E[o];for(d in p.sort(this.idSort),f={},p)f[u=p[d].id]=Number(d),_[d]=u;for(s=0;s<g;s++)for(a=0;a<g;a++)(u=t[s][a])!==e[s][a]&&(l[h++]=f[u]);if(i){for(y=w.length,v=-1,c=0,n=0;n<y;n++)w[n]=w[n]&~i[n],0!==w[n]&&(-1===v&&(v=n),c=n);-1===v&&(v=0,c=0)}return[v,w.subarray(v,c+1),_,this.indexListCompress(l,_.length)]},t.indexListCompress=function(t,e){var i,a,s,r,n,o,c=[];for(r=t.length,a=0,i=0;i<r;i++){for(n=t[i],o=0,s=i+1;s<r&&n===t[s];s++)o++,i=s;switch(o){case 0:c[a++]=n;break;case 1:c[a++]=n,c[a++]=n;break;default:c[a++]=n,c[a++]=e+o}}return c},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,i,a,s,r,n,o,c,h=[];for(e=-1,r=t.length,n=0,s=0;s<r;s++){for(i=(a=t[s])-e,o=0,c=s;c<r-1&&t[c]+1===t[c+1];)c++,o++;o<this.MIN_LOOP_COUNT?h[n++]=i:(s=c,a+=o,h[n++]=0,h[n++]=i,h[n++]=o-this.MIN_LOOP_COUNT),e=a}return h},t.getDecompressArray=function(t){var e,i,a,s,r,n,o,c=[];for(e=-1,r=t.length,s=0,o=0;s<r;s++)if(0===(i=t[s])){for(n=(a=e+(i=t[++s]))+t[++s]+this.MIN_LOOP_COUNT;a<=n;a++)c[o++]=a;e=n}else a=e+i,c[o++]=a,e=a;return c},t.decompress=function(t){var e,i,a;for(i in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(a=t[i])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==a&&(a=this.decompressObject(i,a,e[i]));break;case"function":continue}e[i]=a}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,i){var a;switch(t){case ei:case ii:var s,r,n,o,c,h,u,_;a={},r=-1;var l,p,d=e;if(4===(_=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,i,this._firstRandomMapObjectUtf8Table[t]),i;for(u=0;u<_;u+=2)r=s=r+Number(d[u])+1,c=s,a[s]=d[u+1];for(h in a){for(c=Number(h),_=(d=a[h]).length,l=[],p=[],u=0;u<_;u+=2){var f=d[u],E=d[u+1];f instanceof Array&&(f=this.getDecompressArray(f)),E instanceof Array&&(E=this.getDecompressArray(E)),"object"==typeof f?l.push({x:f,y:E}):p.push({x:f,y:E})}var m;for(m in r=-1,l)if(r=s=r+Number(l[m].y)+1,f=l[m].x,o=String(s),f instanceof Array)for(_=(d=f).length,u=0;u<_;u++)n=String(d[u]),i[o][n]=c;else n=String(f),i[o][n]=c;for(m in r=-1,p)if(r=s=r+Number(p[m].x)+1,E=p[m].y,n=String(s),E instanceof Array)for(_=(d=E).length,u=0;u<_;u++)i[o=String(d[u])][n]=c;else i[o=String(E)][n]=c}return i;case si:return this.decompressUserVars(e);default:if(i);else{if(!e)return;i=i instanceof Array?[]:{}}for(t in e)i[t]=e[t];return i}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var i=e[0],a=e[1];return t[i]=a,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(H.USER_VAR_NUM),e=0;e<H.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,i){var a,s,r,n,o,c,h,u,_,l,p,d=this._restartData.mapWidth,f=new Uint8Array(this._mapByteLength);p=t[0],n=t[2],s=t[3];var E=t[1];if(f.set(E,p),i)for(m=f.length,_=0;_<m;_++)f[_]=f[_]|i[_];r=[];var m,y,g,w,v,S,A=n.length;for(m=s.length,y=0,g=0;y<m;y++){if((o=s[y])>=A)for(w=o-A,v=0;v<w;v++)r[g++]=S;else r[g++]=o;S=o}for(u=0,_=0,l=0,c=0,m=f.length,_=0;_<m;_++)for(u=0;u<8;u++){if(0!=(f[_]&1<<u)){if(void 0===(o=r[c++]))return!1;a=n[o],h=l%d,e[l/d|0][h]=a}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[ii]=this.getChangedUint8Array(e[ii],t[ii])},t.getChangedUint8Array=function(t,e){var i,a,s,r,n=this._restartData.mapWidth,o=new Uint8Array(this._mapByteLength),c=-1;for(s=0,r=0,a=0;a<n;a++)for(i=0;i<n;i++)t[a][i]!==e[a][i]&&(-1===c&&(c=r),o[r]=o[r]|1<<s),8===++s&&(s=0,r++);return o},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var i;if(e)try{if(i=this.decompress(e)[0])return i}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new ni,t}(),ci=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},hi=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=K.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=K.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){mt("cell-load").textContent=j.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,i){var a=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=i,this.flag=!0;var s=document.createElement("img");s.src=t,s.addEventListener("load",(function(){a.flag=!0,a.ctx.drawImage(s,0,0,s.width,s.height,0,0,a.cvs.width,a.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,i,a,s,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,i=this.date.getDate(),a=this.date.getHours(),s=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(i=("0"+i).slice(-2))+" "+(a=("0"+a).slice(-2))+":"+(s=("0"+s).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),ui=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),_i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ui(e,t),e.prototype.save=function(e,i){var a=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,i,this.date),a},e}(hi),li=_i,pi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),di=function(t){function e(){var i=t.call(this)||this;return Object.setPrototypeOf(i,Object.create(e.prototype)),i}return pi(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<K.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,i=0;i<K.QUICK_SAVE_MAX;i++)(e=this[i]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),fi=function(){return fi=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},fi.apply(this,arguments)},Ei=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?fi(fi({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?fi(fi({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},mi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),yi=function(t){function e(i,a,s){void 0===s&&(s=e.prototype);var r=t.call(this)||this;r.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},r.keyPath=["id","url"],Object.setPrototypeOf(r,Object.create(s));for(var n=0;n<K.QUICK_SAVE_MAX;n++)r[n]=new li(n,r);return r.onCheckLoadingSaveData=i,r.onCompleteLoadingSaveData=a,r.createDataBase(),r.selectSaveData(),r}return mi(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(K.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var i=this.indexDBOpen();i.onupgradeneeded=function(e){var a=i.result,s={keyPath:t.keyPath};a.objectStoreNames.contains(K.INDEXEDDB_TABLE_NAME)||a.createObjectStore(K.INDEXEDDB_TABLE_NAME,s).createIndex("url","url",{unique:!1})},i.onsuccess=e.doNotAnything,i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var i=e.transaction(K.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(K.INDEXEDDB_TABLE_NAME)}catch(t){return}return i},e.prototype.makeSaveDataItem=function(t,e,i,a){return{url:location.href,id:t,hash:Di.checkOriginalMapString,image:e.toDataURL(),data:i,date:a,worldName:Di.worldName,mapDataRevisionKey:Di.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var i=t.index("url"),a=IDBKeyRange.only(location.href),s=i.getAll(a);s.onsuccess=function(){e(s.result)}},e.prototype.dbUpdateSaveData=function(t,i,a,s){var r=this,n=this.indexDBOpen();n.onupgradeneeded=e.doNotAnything,n.onsuccess=function(){var o=r.getObjectStore(n.result),c=oi.compress(a),h=r.makeSaveDataItem(t,i,c,s);r.selectDatas[t]=h;var u=o.put(h);u.onsuccess=e.doNotAnything,u.onerror=e.doNotAnything},n.onerror=e.doNotAnything,n.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var i=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=i.getObjectStore(a.result);t.forEach((function(t){e.delete([t,location.href])}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,i=this.indexDBOpen();i.onupgradeneeded=e.doNotAnything,i.onsuccess=function(){var e=t.getObjectStore(i.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var i,a,s,r=[];for(a=e.length,i=0;i<a;i++){var n=e[i];try{s={id:n.id,hash:n.hash,data:n.data,date:n.date,image:n.image,worldName:n.worldName,mapDataRevisionKey:n.mapDataRevisionKey}}catch(t){continue}var o=t.onCheckLoadingSaveData(s.worldName,s.hash,s.mapDataRevisionKey);if(null===o){if(t[s.id]){var c=Ei(oi.decompress(s.data)[0]);t[s.id].saveDataSet(s.image,c,s.date)}}else r.push({id:s.id,cause:o})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var h=r.map((function(t){return t.cause})).filter((function(t,e,i){return i.indexOf(t)===e}));t.onCompleteLoadingSaveData(h)}))},i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(di),gi=yi,wi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),vi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wi(e,t),e}(hi),Si=vi,Ai=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Ti=function(t){function e(){var i=t.call(this)||this;i._saveNo=0,i._lastAutoSaveMove=0,i._autoInterval=K.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(i,Object.create(e.prototype));for(var a=0;a<K.QUICK_SAVE_MAX;a++)i[a]=new Si(a,i);return i._saveNo=0,i._lastAutoSaveMove=0,i}return Ai(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%K.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(di);function Ii(t,e){return(0,ze.MD5)(t+e).toString()}var Ci,Oi=function(){function t(e,i,a,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=i,t.mapDataRevisionKey=Ii(i,a),this._wwaDBSaveList=new gi(s,r),this._wwaLogSaveList=new Ti,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,i){var a=this.list[i];return!!a&&a.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?O.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?O.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?O.CALL_BY_LOG_QUICK_LOAD:O.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?O.CALL_BY_LOG_QUICK_LOAD:t?O.CALL_BY_PASSWORD_LOAD:O.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?mt("cell-save").textContent=j.EMPTY_SAVE:mt("cell-save").textContent=j.QUICK_SAVE},t}(),Di=Oi;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(Ci||(Ci={}));var Pi,Ni=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},bi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},xi=function(){function t(t,e,i,a){var s=this;this.id=t,this.fileName=e,this.audioContext=i,this.audioGain=a,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(s.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=i,this.audioGain=a,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.delayBgmTimeoutId=null,this.load()}return t.prototype.fetchSoundFile=function(){return Ni(this,void 0,void 0,(function(){return bi(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,fetch(this.fileName)];case 1:return[2,t.sent()];case 2:return t.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (fetch)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.getArrayBuffer=function(t){return Ni(this,void 0,void 0,(function(){return bi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t.arrayBuffer()];case 1:return[2,e.sent()];case 2:return e.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (arrayBuffer)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.load=function(t){return void 0===t&&(t=0),Ni(this,void 0,void 0,(function(){var e,i,a=this;return bi(this,(function(s){switch(s.label){case 0:return t>=10?(console.log("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (最大リトライ回数超過)")),this.isExceededMaxRetryCount=!0,[2]):[4,this.fetchSoundFile()];case 1:return(e=s.sent())?0!==e.status&&200!==e.status?(console.warn("サウンド ".concat(this.id," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(e.status)),this.cancelLoad(),[2]):[4,this.getArrayBuffer(e)]:(this.retry(t),[2]);case 2:return(i=s.sent())?(this.audioContext.decodeAudioData(i,(function(e){if(0===e.length)return console.log("サウンド ".concat(a.id," 番の音声ファイルのバッファサイズが 0 です ")),void a.retry(t);a.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;window.setTimeout((function(){return Ni(e,void 0,void 0,(function(){return bi(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(t){var e=this;void 0===t&&(t=0);var i=this.audioContext.createBufferSource();this.bufferSources.push(i),i.buffer=this.audioBuffer,this.isBgm()&&(i.loop=!0),i.connect(this.audioGain);var a=i.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),i.onended=function(){var t=e.bufferSources.indexOf(i);-1!==t&&e.bufferSources.splice(t,1),e.disposeBufferSource(i)},this.delayBgmTimeoutId=window.setTimeout((function(){e.delayBgmTimeoutId=null,i.start()}),t),this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){null!==this.delayBgmTimeoutId&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=k.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isPlaying=function(){return this.hasData()||null!==this.delayBgmTimeoutId},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),Mi=function(t,e){for(var i=new Array(t),a=0;a<i.length;a++)i[a]=new Array(e);return i},Li=function(t){return(t%=256)>=128?t-256:t};function Ri(t,e){var i=function(t){return t[Pi.CHECK]+256*t[Pi.CHECK+1]}(t),a=function(t,e){var i=0;if(t[Pi.VERSION]>=29){for(var a=2;a<e;a++)i+=Li(t[a])*(a%8+1);i=i%65536&65535}return i}(t,e);if(i!==a)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+i+"ですが、実際の和は"+a+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(Pi||(Pi={}));var Bi,Ui,ki=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(Bi||(Bi={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(Ui||(Ui={}));var Wi=function(){function t(t,e,i){this.byteMapData=t,this.eventEmitter=i,Ri(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default",bgmDelayDurationMs:void 0,customSystemMessages:{}}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Pi.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Pi.MAPDATA_TOP:this.currentPosition=Pi.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Bi.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Bi.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?ki.MAP_ATR_MAX:ki.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?ki.OBJ_ATR_MAX:ki.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Bi.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Bi.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Bi.MAP),this._convertAttributeV2toV3(Bi.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,i,a;if(t==Bi.MAP)e=this.wwaData.mapPartsMax,i=this.wwaData.mapAttribute,a=ki.MAP_LOCALGATE;else{if(t!=Bi.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,i=this.wwaData.objectAttribute,a=ki.OBJECT_LOCALGATE}for(var s=0;s<e;s++){for(var r=9;r>=0;r--){var n=255&i[s][20+2*r],o=i[s][20+2*r]>>8,c=255&i[s][20+2*r+1],h=i[s][20+2*r+1]>>8;250===c?c=9e3:c>100&&(c+=9840),250===h?h=9e3:h>100&&(h+=9840),i[s][20+4*r]=n,i[s][20+4*r+3]=o,i[s][20+4*r+1]=c,i[s][20+4*r+2]=h}i[s][ki.ATR_TYPE]===a&&(i[s][ki.ATR_JUMP_X]>100&&(i[s][ki.ATR_JUMP_X]+=9840),i[s][ki.ATR_JUMP_Y]>100&&(i[s][ki.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(Pi.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Pi.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Pi.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Pi.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Pi.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Pi.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Pi.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Pi.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Pi.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Pi.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Pi.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Pi.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Pi.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Pi.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Pi.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Pi.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Pi.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Pi.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Pi.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?Pi.ITEMBOX_TOP:Pi.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(ki.ITEMBOX_SIZE);for(var e=0;e<ki.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var i,a,s;for(s=Mi(this.wwaData.mapWidth,this.wwaData.mapWidth),i=0;i<this.wwaData.mapWidth;i++)for(a=0;a<this.wwaData.mapWidth;a++)this.wwaData.version>29?(s[i][a]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(s[i][a]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(i*this.wwaData.mapWidth+a)%200==0&&this.emitProgress(i*this.wwaData.mapWidth+a,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Bi.MAP?Ui.MAP_LOAD:Ui.OBJ_LOAD),s[i][a]>=e&&(s[i][a]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Bi.MAP?Ui.MAP_LOAD:Ui.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,i){var a,s,r;for(r=Mi(e,i),a=0;a<e;a++)for(s=0;s<i;s++)(a*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(a*i+s,e*i,t===Bi.MAP?Ui.MAP_ATTR:Ui.OBJ_ATTR),s!==ki.ATR_CROP1&&s!==ki.ATR_CROP2?(r[a][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[a][s]=0,this.currentPosition+=2);return this.emitProgress(e*i,e*i,t===Bi.MAP?Ui.MAP_ATTR:Ui.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,Ui.RAND_PARTS)},t.prototype.emitProgress=function(t,e,i){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:i})},t}();var Vi=function(){function t(t,e,i,a){this.wwaData=t,this.compressedMapData=e,this.startPosition=i,this.eventEmitter=a,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:Ui.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:Ui.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(ki.SYSTEM_MESSAGE_NUM);for(e=0;e<ki.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=ki.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=ki.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=ki.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=ki.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=ki.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=ki.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=ki.DEFAULT_DISABLE_SAVE,t.isOldMap=ki.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=ki.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=ki.IMGPOS_DEFAULT_STATUS_X+ki.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=ki.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=ki.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=ki.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=ki.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=ki.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=ki.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=ki.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=ki.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=ki.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=ki.DEFAULT_FRAME_COLOR_R,t.frameColorG=ki.DEFAULT_FRAME_COLOR_G,t.frameColorB=ki.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=ki.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=ki.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=ki.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=ki.DEFAULT_STR_COLOR_R,t.fontColorG=ki.DEFAULT_STR_COLOR_G,t.fontColorB=ki.DEFAULT_STR_COLOR_B,t.statusColorR=ki.DEFAULT_STATUS_COLOR_R,t.statusColorG=ki.DEFAULT_STATUS_COLOR_G,t.statusColorB=ki.DEFAULT_STATUS_COLOR_B,t.moves=ki.DEFAULT_MOVES,t.gameSpeedIndex=ki.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(ki.USER_VAR_NUM);for(e=0;e<ki.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t.bgmDelayDurationMs=0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Fi=function(){},Yi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Gi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Hi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Ki=function(t){function e(e){var i=t.call(this)||this;return i.uri=e,i}return Yi(e,t),e.fetch=function(t){return Gi(this,void 0,void 0,(function(){return Hi(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(t)];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("マップデータ 「".concat(t,"」の読み込みに失敗しました。\n 通信環境の良いところで再度お試しください。\n ローカルテストの場合は、ブラウザが対応していない可能性があります。"));case 3:return[2]}}))}))},e.handleError=function(t,e){var i="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(i));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(i));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(i))}},e.prototype.request=function(){return Gi(this,void 0,void 0,(function(){var t;return Hi(this,(function(i){switch(i.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=i.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,i.sent()]}}))}))},e}(Fi),ji=i(106),Xi=i.n(ji),Ji=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Zi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},qi=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Qi=function(t){function e(e){var i=t.call(this)||this;return i.fileName=e,i}return Ji(e,t),e.prototype.request=function(){return Zi(this,void 0,void 0,(function(){var t=this;return qi(this,(function(e){return[2,new Promise((function(e,i){Xi().readFile(t.fileName,(function(t,a){t&&i(t),e(a.buffer)}))}))]}))}))},e}(Fi),zi=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},$i=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},ta=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return zi(this,void 0,void 0,(function(){var t,e,i,a,s,r;return $i(this,(function(n){switch(n.label){case 0:o=this.fileName,t="undefined"!=typeof window?new Ki(o):new Qi(o),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=n.sent())?(i=this.loadMapData(e),this.eventEmitter.dispatch("mapData",i),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return a=n.sent(),s=a.name||"",r=a.message||"",this.eventEmitter.dispatch("error",{name:s,message:r}),[3,4];case 4:return[2]}var o}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),i=function(t){var e,i,a=new Uint8Array(t.length);for(e=0,i=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(a[i++]=t[e],t[e]===t[e+1]){for(var s=t[e+2],r=0;r<s;r++)a[i++]=t[e];e+=2}if(i+255>=a.length){var n=new Uint8Array(a.length+65e3);n.set(a),a=n}}return console.log("EXTRACT DATA = "+i+" "+e),{byteMapData:a,byteMapLength:i,compressedEndPosition:e+3}}(e),a=i.byteMapData,s=i.byteMapLength,r=i.compressedEndPosition,n=new Wi(a,s,this.eventEmitter).extractAllData();return new Vi(n,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),ea=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var i=new CustomEvent(t,{detail:e});this.target.dispatchEvent(i)},t.prototype.addListener=function(t,e){var i=function(t){return e(t.detail)};return this.target.addEventListener(t,i),i},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),ia=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},aa=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},sa=function(t){return ia(void 0,void 0,void 0,(function(){return aa(this,(function(e){return[2,fetch(t).then((function(e){return 200===e.status||304===e.status?{kind:"data",data:e}:{kind:"httpError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。ステータスコード: ").concat(e.status)}})).catch((function(e){return{kind:"connectionError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return ia(void 0,void 0,void 0,(function(){var e,i;return aa(this,(function(a){switch(a.label){case 0:return"data"!==t.kind?[3,2]:(i={kind:"data"},[4,t.data.json()]);case 1:return i.data=a.sent(),e=i,[3,3];case 2:e=t,a.label=3;case 3:return[2,e]}}))}))})).catch((function(e){return{kind:"brokenJson",errorMessage:"ファイル ".concat(t," が壊れています。")}}))]}))}))},ra={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},na="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",oa={5:na,"5module":na+" export import",6:na+" const class extends export import super"},ca=/^in(stanceof)?$/,ha="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ua="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",_a=new RegExp("["+ha+"]"),la=new RegExp("["+ha+ua+"]");ha=ua=null;var pa=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],da=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function fa(t,e){for(var i=65536,a=0;a<e.length;a+=2){if((i+=e[a])>t)return!1;if((i+=e[a+1])>=t)return!0}}function Ea(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&_a.test(String.fromCharCode(t)):!1!==e&&fa(t,pa)))}function ma(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&la.test(String.fromCharCode(t)):!1!==e&&(fa(t,pa)||fa(t,da)))))}var ya=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function ga(t,e){return new ya(t,{beforeExpr:!0,binop:e})}var wa={beforeExpr:!0},va={startsExpr:!0},Sa={};function Aa(t,e){return void 0===e&&(e={}),e.keyword=t,Sa[t]=new ya(t,e)}var Ta={num:new ya("num",va),regexp:new ya("regexp",va),string:new ya("string",va),name:new ya("name",va),eof:new ya("eof"),bracketL:new ya("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new ya("]"),braceL:new ya("{",{beforeExpr:!0,startsExpr:!0}),braceR:new ya("}"),parenL:new ya("(",{beforeExpr:!0,startsExpr:!0}),parenR:new ya(")"),comma:new ya(",",wa),semi:new ya(";",wa),colon:new ya(":",wa),dot:new ya("."),question:new ya("?",wa),questionDot:new ya("?."),arrow:new ya("=>",wa),template:new ya("template"),invalidTemplate:new ya("invalidTemplate"),ellipsis:new ya("...",wa),backQuote:new ya("`",va),dollarBraceL:new ya("${",{beforeExpr:!0,startsExpr:!0}),eq:new ya("=",{beforeExpr:!0,isAssign:!0}),assign:new ya("_=",{beforeExpr:!0,isAssign:!0}),incDec:new ya("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new ya("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ga("||",1),logicalAND:ga("&&",2),bitwiseOR:ga("|",3),bitwiseXOR:ga("^",4),bitwiseAND:ga("&",5),equality:ga("==/!=/===/!==",6),relational:ga("</>/<=/>=",7),bitShift:ga("<</>>/>>>",8),plusMin:new ya("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ga("%",10),star:ga("*",10),slash:ga("/",10),starstar:new ya("**",{beforeExpr:!0}),coalesce:ga("??",1),_break:Aa("break"),_case:Aa("case",wa),_catch:Aa("catch"),_continue:Aa("continue"),_debugger:Aa("debugger"),_default:Aa("default",wa),_do:Aa("do",{isLoop:!0,beforeExpr:!0}),_else:Aa("else",wa),_finally:Aa("finally"),_for:Aa("for",{isLoop:!0}),_function:Aa("function",va),_if:Aa("if"),_return:Aa("return",wa),_switch:Aa("switch"),_throw:Aa("throw",wa),_try:Aa("try"),_var:Aa("var"),_const:Aa("const"),_while:Aa("while",{isLoop:!0}),_with:Aa("with"),_new:Aa("new",{beforeExpr:!0,startsExpr:!0}),_this:Aa("this",va),_super:Aa("super",va),_class:Aa("class",va),_extends:Aa("extends",wa),_export:Aa("export"),_import:Aa("import",va),_null:Aa("null",va),_true:Aa("true",va),_false:Aa("false",va),_in:Aa("in",{beforeExpr:!0,binop:7}),_instanceof:Aa("instanceof",{beforeExpr:!0,binop:7}),_typeof:Aa("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Aa("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Aa("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ia=/\r\n?|\n|\u2028|\u2029/,Ca=new RegExp(Ia.source,"g");function Oa(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var Da=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Pa=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Na=Object.prototype,ba=Na.hasOwnProperty,xa=Na.toString;function Ma(t,e){return ba.call(t,e)}var La=Array.isArray||function(t){return"[object Array]"===xa.call(t)};function Ra(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}var Ba=function(t,e){this.line=t,this.column=e};Ba.prototype.offset=function(t){return new Ba(this.line,this.column+t)};var Ua=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function ka(t,e){for(var i=1,a=0;;){Ca.lastIndex=a;var s=Ca.exec(t);if(!(s&&s.index<e))return new Ba(i,e-a);++i,a=s.index+s[0].length}}var Wa={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function Va(t){var e={};for(var i in Wa)e[i]=t&&Ma(t,i)?t[i]:Wa[i];if(e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),La(e.onToken)){var a=e.onToken;e.onToken=function(t){return a.push(t)}}return La(e.onComment)&&(e.onComment=function(t,e){return function(i,a,s,r,n,o){var c={type:i?"Block":"Line",value:a,start:s,end:r};t.locations&&(c.loc=new Ua(this,n,o)),t.ranges&&(c.range=[s,r]),e.push(c)}}(e,e.onComment)),e}function Fa(t,e){return 2|(t?4:0)|(e?8:0)}var Ya=function(t,e,i){this.options=t=Va(t),this.sourceFile=t.sourceFile,this.keywords=Ra(oa[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var a="";if(!0!==t.allowReserved){for(var s=t.ecmaVersion;!(a=ra[s]);s--);"module"===t.sourceType&&(a+=" await")}this.reservedWords=Ra(a);var r=(a?a+" ":"")+ra.strict;this.reservedWordsStrict=Ra(r),this.reservedWordsStrictBind=Ra(r+" "+ra.strictBind),this.input=String(e),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ia).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=Ta.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},Ga={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Ya.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},Ga.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},Ga.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},Ga.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},Ga.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},Ga.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},Ga.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ya.prototype.inNonArrowFunction=function(){return(2&this.currentThisScope().flags)>0},Ya.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,a=0;a<t.length;a++)i=t[a](i);return i},Ya.parse=function(t,e){return new this(e,t).parse()},Ya.parseExpressionAt=function(t,e,i){var a=new this(i,t,e);return a.nextToken(),a.parseExpression()},Ya.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(Ya.prototype,Ga);var Ha=Ya.prototype,Ka=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function ja(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}Ha.strictDirective=function(t){for(;;){Pa.lastIndex=t,t+=Pa.exec(this.input)[0].length;var e=Ka.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2])){Pa.lastIndex=t+e[0].length;var i=Pa.exec(this.input),a=i.index+i[0].length,s=this.input.charAt(a);return";"===s||"}"===s||Ia.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||"!"===s&&"="===this.input.charAt(a+1))}t+=e[0].length,Pa.lastIndex=t,t+=Pa.exec(this.input)[0].length,";"===this.input[t]&&t++}},Ha.eat=function(t){return this.type===t&&(this.next(),!0)},Ha.isContextual=function(t){return this.type===Ta.name&&this.value===t&&!this.containsEsc},Ha.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},Ha.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},Ha.canInsertSemicolon=function(){return this.type===Ta.eof||this.type===Ta.braceR||Ia.test(this.input.slice(this.lastTokEnd,this.start))},Ha.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ha.semicolon=function(){this.eat(Ta.semi)||this.insertSemicolon()||this.unexpected()},Ha.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},Ha.expect=function(t){this.eat(t)||this.unexpected()},Ha.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},Ha.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,"Parenthesized pattern")}},Ha.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,a=t.doubleProto;if(!e)return i>=0||a>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},Ha.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Ha.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var Xa=Ya.prototype;Xa.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==Ta.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var a=0,s=Object.keys(this.undefinedExports);a<s.length;a+=1){var r=s[a];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")};var Ja={kind:"loop"},Za={kind:"switch"};Xa.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Pa.lastIndex=this.pos;var e=Pa.exec(this.input),i=this.pos+e[0].length,a=this.input.charCodeAt(i);if(91===a)return!0;if(t)return!1;if(123===a)return!0;if(Ea(a,!0)){for(var s=i+1;ma(this.input.charCodeAt(s),!0);)++s;var r=this.input.slice(i,s);if(!ca.test(r))return!0}return!1},Xa.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Pa.lastIndex=this.pos;var t=Pa.exec(this.input),e=this.pos+t[0].length;return!(Ia.test(this.input.slice(this.pos,e))||"function"!==this.input.slice(e,e+8)||e+8!==this.input.length&&ma(this.input.charAt(e+8)))},Xa.parseStatement=function(t,e,i){var a,s=this.type,r=this.startNode();switch(this.isLet(t)&&(s=Ta._var,a="let"),s){case Ta._break:case Ta._continue:return this.parseBreakContinueStatement(r,s.keyword);case Ta._debugger:return this.parseDebuggerStatement(r);case Ta._do:return this.parseDoStatement(r);case Ta._for:return this.parseForStatement(r);case Ta._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!t);case Ta._class:return t&&this.unexpected(),this.parseClass(r,!0);case Ta._if:return this.parseIfStatement(r);case Ta._return:return this.parseReturnStatement(r);case Ta._switch:return this.parseSwitchStatement(r);case Ta._throw:return this.parseThrowStatement(r);case Ta._try:return this.parseTryStatement(r);case Ta._const:case Ta._var:return a=a||this.value,t&&"var"!==a&&this.unexpected(),this.parseVarStatement(r,a);case Ta._while:return this.parseWhileStatement(r);case Ta._with:return this.parseWithStatement(r);case Ta.braceL:return this.parseBlock(!0,r);case Ta.semi:return this.parseEmptyStatement(r);case Ta._export:case Ta._import:if(this.options.ecmaVersion>10&&s===Ta._import){Pa.lastIndex=this.pos;var n=Pa.exec(this.input),o=this.pos+n[0].length,c=this.input.charCodeAt(o);if(40===c||46===c)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===Ta._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!t);var h=this.value,u=this.parseExpression();return s===Ta.name&&"Identifier"===u.type&&this.eat(Ta.colon)?this.parseLabeledStatement(r,h,u,t):this.parseExpressionStatement(r,u)}},Xa.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(Ta.semi)||this.insertSemicolon()?t.label=null:this.type!==Ta.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var s=this.labels[a];if(null==t.label||s.name===t.label.name){if(null!=s.kind&&(i||"loop"===s.kind))break;if(t.label&&i)break}}return a===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},Xa.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},Xa.parseDoStatement=function(t){return this.next(),this.labels.push(Ja),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(Ta._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(Ta.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},Xa.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ja),this.enterScope(0),this.expect(Ta.parenL),this.type===Ta.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===Ta._var||this.type===Ta._const||i){var a=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(a,!0,s),this.finishNode(a,"VariableDeclaration"),(this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===a.declarations.length?(this.options.ecmaVersion>=9&&(this.type===Ta._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,a)):(e>-1&&this.unexpected(e),this.parseFor(t,a))}var r=new ja,n=this.parseExpression(!0,r);return this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===Ta._in?e>-1&&this.unexpected(e):t.await=e>-1),this.toAssignable(n,!1,r),this.checkLVal(n),this.parseForIn(t,n)):(this.checkExpressionErrors(r,!0),e>-1&&this.unexpected(e),this.parseFor(t,n))},Xa.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,Qa|(i?0:za),!1,e)},Xa.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(Ta._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},Xa.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(Ta.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},Xa.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(Ta.braceL),this.labels.push(Za),this.enterScope(0);for(var i=!1;this.type!==Ta.braceR;)if(this.type===Ta._case||this.type===Ta._default){var a=this.type===Ta._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),a?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(Ta.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},Xa.parseThrowStatement=function(t){return this.next(),Ia.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var qa=[];Xa.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===Ta._catch){var e=this.startNode();if(this.next(),this.eat(Ta.parenL)){e.param=this.parseBindingAtom();var i="Identifier"===e.param.type;this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(Ta.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0);e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(Ta._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},Xa.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},Xa.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(Ja),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},Xa.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},Xa.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},Xa.parseLabeledStatement=function(t,e,i,a){for(var s=0,r=this.labels;s<r.length;s+=1){r[s].name===e&&this.raise(i.start,"Label '"+e+"' is already declared")}for(var n=this.type.isLoop?"loop":this.type===Ta._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==t.start)break;c.statementStart=this.start,c.kind=n}return this.labels.push({name:e,kind:n,statementStart:this.start}),t.body=this.parseStatement(a?-1===a.indexOf("label")?a+"label":a:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},Xa.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},Xa.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(Ta.braceL),t&&this.enterScope(0);this.type!==Ta.braceR;){var a=this.parseStatement(null);e.body.push(a)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},Xa.parseFor=function(t,e){return t.init=e,this.expect(Ta.semi),t.test=this.type===Ta.semi?null:this.parseExpression(),this.expect(Ta.semi),t.update=this.type===Ta.parenR?null:this.parseExpression(),this.expect(Ta.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},Xa.parseForIn=function(t,e){var i=this.type===Ta._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(Ta.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},Xa.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var a=this.startNode();if(this.parseVarId(a,i),this.eat(Ta.eq)?a.init=this.parseMaybeAssign(e):"const"!==i||this.type===Ta._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===a.id.type||e&&(this.type===Ta._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(Ta.comma))break}return t},Xa.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)};var Qa=1,za=2;Xa.parseFunction=function(t,e,i,a){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===Ta.star&&e&za&&this.unexpected(),t.generator=this.eat(Ta.star)),this.options.ecmaVersion>=8&&(t.async=!!a),e&Qa&&(t.id=4&e&&this.type!==Ta.name?null:this.parseIdent(),!t.id||e&za||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Fa(t.async,t.generator)),e&Qa||(t.id=this.type===Ta.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(t,e&Qa?"FunctionDeclaration":"FunctionExpression")},Xa.parseFunctionParams=function(t){this.expect(Ta.parenL),t.params=this.parseBindingList(Ta.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Xa.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var a=this.startNode(),s=!1;for(a.body=[],this.expect(Ta.braceL);this.type!==Ta.braceR;){var r=this.parseClassElement(null!==t.superClass);r&&(a.body.push(r),"MethodDefinition"===r.type&&"constructor"===r.kind&&(s&&this.raise(r.start,"Duplicate constructor in the same class"),s=!0))}return this.strict=i,this.next(),t.body=this.finishNode(a,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},Xa.parseClassElement=function(t){var e=this;if(this.eat(Ta.semi))return null;var i=this.startNode(),a=function(t,a){void 0===a&&(a=!1);var s=e.start,r=e.startLoc;return!!e.eatContextual(t)&&(!(e.type===Ta.parenL||a&&e.canInsertSemicolon())||(i.key&&e.unexpected(),i.computed=!1,i.key=e.startNodeAt(s,r),i.key.name=t,e.finishNode(i.key,"Identifier"),!1))};i.kind="method",i.static=a("static");var s=this.eat(Ta.star),r=!1;s||(this.options.ecmaVersion>=8&&a("async",!0)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(Ta.star)):a("get")?i.kind="get":a("set")&&(i.kind="set")),i.key||this.parsePropertyName(i);var n=i.key,o=!1;return i.computed||i.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?i.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==i.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),s&&this.raise(n.start,"Constructor can't be a generator"),r&&this.raise(n.start,"Constructor can't be an async method"),i.kind="constructor",o=t),this.parseClassMethod(i,s,r,o),"get"===i.kind&&0!==i.value.params.length&&this.raiseRecoverable(i.value.start,"getter should have no params"),"set"===i.kind&&1!==i.value.params.length&&this.raiseRecoverable(i.value.start,"setter should have exactly one param"),"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params"),i},Xa.parseClassMethod=function(t,e,i,a){return t.value=this.parseMethod(e,i,a),this.finishNode(t,"MethodDefinition")},Xa.parseClassId=function(t,e){this.type===Ta.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},Xa.parseClassSuper=function(t){t.superClass=this.eat(Ta._extends)?this.parseExprSubscripts():null},Xa.parseExport=function(t,e){if(this.next(),this.eat(Ta.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==Ta.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");if(this.eat(Ta._default)){var i;if(this.checkExport(e,"default",this.lastTokStart),this.type===Ta._function||(i=this.isAsyncFunction())){var a=this.startNode();this.next(),i&&this.next(),t.declaration=this.parseFunction(a,4|Qa,!1,i)}else if(this.type===Ta._class){var s=this.startNode();t.declaration=this.parseClass(s,"nullableID")}else t.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(t,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==Ta.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,n=t.specifiers;r<n.length;r+=1){var o=n[r];this.checkUnreserved(o.local),this.checkLocalExport(o.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},Xa.checkExport=function(t,e,i){t&&(Ma(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},Xa.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e.name,e.start);else if("ObjectPattern"===i)for(var a=0,s=e.properties;a<s.length;a+=1){var r=s[a];this.checkPatternExport(t,r)}else if("ArrayPattern"===i)for(var n=0,o=e.elements;n<o.length;n+=1){var c=o[n];c&&this.checkPatternExport(t,c)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(t,e.expression)},Xa.checkVariableExport=function(t,e){if(t)for(var i=0,a=e;i<a.length;i+=1){var s=a[i];this.checkPatternExport(t,s.id)}},Xa.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},Xa.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(Ta.braceL);!this.eat(Ta.braceR);){if(i)i=!1;else if(this.expect(Ta.comma),this.afterTrailingComma(Ta.braceR))break;var a=this.startNode();a.local=this.parseIdent(!0),a.exported=this.eatContextual("as")?this.parseIdent(!0):a.local,this.checkExport(t,a.exported.name,a.exported.start),e.push(this.finishNode(a,"ExportSpecifier"))}return e},Xa.parseImport=function(t){return this.next(),this.type===Ta.string?(t.specifiers=qa,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===Ta.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},Xa.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===Ta.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(Ta.comma))return t}if(this.type===Ta.star){var a=this.startNode();return this.next(),this.expectContextual("as"),a.local=this.parseIdent(),this.checkLVal(a.local,2),t.push(this.finishNode(a,"ImportNamespaceSpecifier")),t}for(this.expect(Ta.braceL);!this.eat(Ta.braceR);){if(e)e=!1;else if(this.expect(Ta.comma),this.afterTrailingComma(Ta.braceR))break;var s=this.startNode();s.imported=this.parseIdent(!0),this.eatContextual("as")?s.local=this.parseIdent():(this.checkUnreserved(s.imported),s.local=s.imported),this.checkLVal(s.local,2),t.push(this.finishNode(s,"ImportSpecifier"))}return t},Xa.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},Xa.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var $a=Ya.prototype;$a.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var a=0,s=t.properties;a<s.length;a+=1){var r=s[a];this.toAssignable(r,e),"RestElement"!==r.type||"ArrayPattern"!==r.argument.type&&"ObjectPattern"!==r.argument.type||this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},$a.toAssignableList=function(t,e){for(var i=t.length,a=0;a<i;a++){var s=t[a];s&&this.toAssignable(s,e)}if(i){var r=t[i-1];6===this.options.ecmaVersion&&e&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return t},$a.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},$a.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==Ta.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},$a.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Ta.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(Ta.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case Ta.braceL:return this.parseObj(!0)}return this.parseIdent()},$a.parseBindingList=function(t,e,i){for(var a=[],s=!0;!this.eat(t);)if(s?s=!1:this.expect(Ta.comma),e&&this.type===Ta.comma)a.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===Ta.ellipsis){var r=this.parseRestBinding();this.parseBindingListItem(r),a.push(r),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}var n=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(n),a.push(n)}return a},$a.parseBindingListItem=function(t){return t},$a.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Ta.eq))return i;var a=this.startNodeAt(t,e);return a.left=i,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},$a.checkLVal=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Identifier":2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),i&&(Ma(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),0!==e&&5!==e&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var a=0,s=t.properties;a<s.length;a+=1){var r=s[a];this.checkLVal(r,e,i)}break;case"Property":this.checkLVal(t.value,e,i);break;case"ArrayPattern":for(var n=0,o=t.elements;n<o.length;n+=1){var c=o[n];c&&this.checkLVal(c,e,i)}break;case"AssignmentPattern":this.checkLVal(t.left,e,i);break;case"RestElement":this.checkLVal(t.argument,e,i);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,i);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}};var ts=Ya.prototype;ts.checkPropClash=function(t,e,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var a,s=t.key;switch(s.type){case"Identifier":a=s.name;break;case"Literal":a=String(s.value);break;default:return}var r=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===a&&"init"===r&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),e.proto=!0);else{var n=e[a="$"+a];if(n)("init"===r?this.strict&&n.init||n.get||n.set:n.init||n[r])&&this.raiseRecoverable(s.start,"Redefinition of property");else n=e[a]={init:!1,get:!1,set:!1};n[r]=!0}}},ts.parseExpression=function(t,e){var i=this.start,a=this.startLoc,s=this.parseMaybeAssign(t,e);if(this.type===Ta.comma){var r=this.startNodeAt(i,a);for(r.expressions=[s];this.eat(Ta.comma);)r.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(r,"SequenceExpression")}return s},ts.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var a=!1,s=-1,r=-1;e?(s=e.parenthesizedAssign,r=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new ja,a=!0);var n=this.start,o=this.startLoc;this.type!==Ta.parenL&&this.type!==Ta.name||(this.potentialArrowAt=this.start);var c=this.parseMaybeConditional(t,e);if(i&&(c=i.call(this,c,n,o)),this.type.isAssign){var h=this.startNodeAt(n,o);return h.operator=this.value,h.left=this.type===Ta.eq?this.toAssignable(c,!1,e):c,a||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=h.left.start&&(e.shorthandAssign=-1),this.checkLVal(c),this.next(),h.right=this.parseMaybeAssign(t),this.finishNode(h,"AssignmentExpression")}return a&&this.checkExpressionErrors(e,!0),s>-1&&(e.parenthesizedAssign=s),r>-1&&(e.trailingComma=r),c},ts.parseMaybeConditional=function(t,e){var i=this.start,a=this.startLoc,s=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return s;if(this.eat(Ta.question)){var r=this.startNodeAt(i,a);return r.test=s,r.consequent=this.parseMaybeAssign(),this.expect(Ta.colon),r.alternate=this.parseMaybeAssign(t),this.finishNode(r,"ConditionalExpression")}return s},ts.parseExprOps=function(t,e){var i=this.start,a=this.startLoc,s=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||s.start===i&&"ArrowFunctionExpression"===s.type?s:this.parseExprOp(s,i,a,-1,t)},ts.parseExprOp=function(t,e,i,a,s){var r=this.type.binop;if(null!=r&&(!s||this.type!==Ta._in)&&r>a){var n=this.type===Ta.logicalOR||this.type===Ta.logicalAND,o=this.type===Ta.coalesce;o&&(r=Ta.logicalAND.binop);var c=this.value;this.next();var h=this.start,u=this.startLoc,_=this.parseExprOp(this.parseMaybeUnary(null,!1),h,u,r,s),l=this.buildBinary(e,i,t,_,c,n||o);return(n&&this.type===Ta.coalesce||o&&(this.type===Ta.logicalOR||this.type===Ta.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(l,e,i,a,s)}return t},ts.buildBinary=function(t,e,i,a,s,r){var n=this.startNodeAt(t,e);return n.left=i,n.operator=s,n.right=a,this.finishNode(n,r?"LogicalExpression":"BinaryExpression")},ts.parseMaybeUnary=function(t,e){var i,a=this.start,s=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),e=!0;else if(this.type.prefix){var r=this.startNode(),n=this.type===Ta.incDec;r.operator=this.value,r.prefix=!0,this.next(),r.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),n?this.checkLVal(r.argument):this.strict&&"delete"===r.operator&&"Identifier"===r.argument.type?this.raiseRecoverable(r.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(r,n?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(a,s);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!e&&this.eat(Ta.starstar)?this.buildBinary(a,s,i,this.parseMaybeUnary(null,!1),"**",!1):i},ts.parseExprSubscripts=function(t){var e=this.start,i=this.startLoc,a=this.parseExprAtom(t);if("ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return a;var s=this.parseSubscripts(a,e,i);return t&&"MemberExpression"===s.type&&(t.parenthesizedAssign>=s.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=s.start&&(t.parenthesizedBind=-1)),s},ts.parseSubscripts=function(t,e,i,a){for(var s=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,r=!1;;){var n=this.parseSubscript(t,e,i,a,s,r);if(n.optional&&(r=!0),n===t||"ArrowFunctionExpression"===n.type){if(r){var o=this.startNodeAt(e,i);o.expression=n,n=this.finishNode(o,"ChainExpression")}return n}t=n}},ts.parseSubscript=function(t,e,i,a,s,r){var n=this.options.ecmaVersion>=11,o=n&&this.eat(Ta.questionDot);a&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(Ta.bracketL);if(c||o&&this.type!==Ta.parenL&&this.type!==Ta.backQuote||this.eat(Ta.dot)){var h=this.startNodeAt(e,i);h.object=t,h.property=c?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),h.computed=!!c,c&&this.expect(Ta.bracketR),n&&(h.optional=o),t=this.finishNode(h,"MemberExpression")}else if(!a&&this.eat(Ta.parenL)){var u=new ja,_=this.yieldPos,l=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var d=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,!1,u);if(s&&!o&&!this.canInsertSemicolon()&&this.eat(Ta.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=_,this.awaitPos=l,this.awaitIdentPos=p,this.parseArrowExpression(this.startNodeAt(e,i),d,!0);this.checkExpressionErrors(u,!0),this.yieldPos=_||this.yieldPos,this.awaitPos=l||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var f=this.startNodeAt(e,i);f.callee=t,f.arguments=d,n&&(f.optional=o),t=this.finishNode(f,"CallExpression")}else if(this.type===Ta.backQuote){(o||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var E=this.startNodeAt(e,i);E.tag=t,E.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(E,"TaggedTemplateExpression")}return t},ts.parseExprAtom=function(t){this.type===Ta.slash&&this.readRegexp();var e,i=this.potentialArrowAt===this.start;switch(this.type){case Ta._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),e=this.startNode(),this.next(),this.type!==Ta.parenL||this.allowDirectSuper||this.raise(e.start,"super() call outside constructor of a subclass"),this.type!==Ta.dot&&this.type!==Ta.bracketL&&this.type!==Ta.parenL&&this.unexpected(),this.finishNode(e,"Super");case Ta._this:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case Ta.name:var a=this.start,s=this.startLoc,r=this.containsEsc,n=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!r&&"async"===n.name&&!this.canInsertSemicolon()&&this.eat(Ta._function))return this.parseFunction(this.startNodeAt(a,s),0,!1,!0);if(i&&!this.canInsertSemicolon()){if(this.eat(Ta.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[n],!1);if(this.options.ecmaVersion>=8&&"async"===n.name&&this.type===Ta.name&&!r)return n=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(Ta.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[n],!0)}return n;case Ta.regexp:var o=this.value;return(e=this.parseLiteral(o.value)).regex={pattern:o.pattern,flags:o.flags},e;case Ta.num:case Ta.string:return this.parseLiteral(this.value);case Ta._null:case Ta._true:case Ta._false:return(e=this.startNode()).value=this.type===Ta._null?null:this.type===Ta._true,e.raw=this.type.keyword,this.next(),this.finishNode(e,"Literal");case Ta.parenL:var c=this.start,h=this.parseParenAndDistinguishExpression(i);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(h)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),h;case Ta.bracketL:return e=this.startNode(),this.next(),e.elements=this.parseExprList(Ta.bracketR,!0,!0,t),this.finishNode(e,"ArrayExpression");case Ta.braceL:return this.parseObj(!1,t);case Ta._function:return e=this.startNode(),this.next(),this.parseFunction(e,0);case Ta._class:return this.parseClass(this.startNode(),!1);case Ta._new:return this.parseNew();case Ta.backQuote:return this.parseTemplate();case Ta._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},ts.parseExprImport=function(){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var e=this.parseIdent(!0);switch(this.type){case Ta.parenL:return this.parseDynamicImport(t);case Ta.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}},ts.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(Ta.parenR)){var e=this.start;this.eat(Ta.comma)&&this.eat(Ta.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},ts.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},ts.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},ts.parseParenExpression=function(){this.expect(Ta.parenL);var t=this.parseExpression();return this.expect(Ta.parenR),t},ts.parseParenAndDistinguishExpression=function(t){var e,i=this.start,a=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var r,n=this.start,o=this.startLoc,c=[],h=!0,u=!1,_=new ja,l=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==Ta.parenR;){if(h?h=!1:this.expect(Ta.comma),s&&this.afterTrailingComma(Ta.parenR,!0)){u=!0;break}if(this.type===Ta.ellipsis){r=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,_,this.parseParenItem))}var d=this.start,f=this.startLoc;if(this.expect(Ta.parenR),t&&!this.canInsertSemicolon()&&this.eat(Ta.arrow))return this.checkPatternErrors(_,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=l,this.awaitPos=p,this.parseParenArrowList(i,a,c);c.length&&!u||this.unexpected(this.lastTokStart),r&&this.unexpected(r),this.checkExpressionErrors(_,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?((e=this.startNodeAt(n,o)).expressions=c,this.finishNodeAt(e,"SequenceExpression",d,f)):e=c[0]}else e=this.parseParenExpression();if(this.options.preserveParens){var E=this.startNodeAt(i,a);return E.expression=e,this.finishNode(E,"ParenthesizedExpression")}return e},ts.parseParenItem=function(t){return t},ts.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)};var es=[];ts.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode(),e=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(Ta.dot)){t.meta=e;var i=this.containsEsc;return t.property=this.parseIdent(!0),"target"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(t.start,"'new.target' can only be used in functions"),this.finishNode(t,"MetaProperty")}var a=this.start,s=this.startLoc,r=this.type===Ta._import;return t.callee=this.parseSubscripts(this.parseExprAtom(),a,s,!0),r&&"ImportExpression"===t.callee.type&&this.raise(a,"Cannot use new with import()"),this.eat(Ta.parenL)?t.arguments=this.parseExprList(Ta.parenR,this.options.ecmaVersion>=8,!1):t.arguments=es,this.finishNode(t,"NewExpression")},ts.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===Ta.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===Ta.backQuote,this.finishNode(i,"TemplateElement")},ts.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var a=this.parseTemplateElement({isTagged:e});for(i.quasis=[a];!a.tail;)this.type===Ta.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(Ta.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(Ta.braceR),i.quasis.push(a=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},ts.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===Ta.name||this.type===Ta.num||this.type===Ta.string||this.type===Ta.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Ta.star)&&!Ia.test(this.input.slice(this.lastTokEnd,this.start))},ts.parseObj=function(t,e){var i=this.startNode(),a=!0,s={};for(i.properties=[],this.next();!this.eat(Ta.braceR);){if(a)a=!1;else if(this.expect(Ta.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Ta.braceR))break;var r=this.parseProperty(t,e);t||this.checkPropClash(r,s,e),i.properties.push(r)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},ts.parseProperty=function(t,e){var i,a,s,r,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(Ta.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===Ta.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(this.type===Ta.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0&&(e.parenthesizedBind=this.start)),n.argument=this.parseMaybeAssign(!1,e),this.type===Ta.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(t||e)&&(s=this.start,r=this.startLoc),t||(i=this.eat(Ta.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n)?(a=!0,i=this.options.ecmaVersion>=9&&this.eat(Ta.star),this.parsePropertyName(n,e)):a=!1,this.parsePropertyValue(n,t,i,a,s,r,e,o),this.finishNode(n,"Property")},ts.parsePropertyValue=function(t,e,i,a,s,r,n,o){if((i||a)&&this.type===Ta.colon&&this.unexpected(),this.eat(Ta.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Ta.parenL)e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,a);else if(e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===Ta.comma||this.type===Ta.braceR||this.type===Ta.eq)this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||a)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=s),t.kind="init",e?t.value=this.parseMaybeDefault(s,r,t.key):this.type===Ta.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(s,r,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected();else{(i||a)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var c="get"===t.kind?0:1;if(t.value.params.length!==c){var h=t.value.start;"get"===t.kind?this.raiseRecoverable(h,"getter should have no params"):this.raiseRecoverable(h,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")}},ts.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(Ta.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(Ta.bracketR),t.key;t.computed=!1}return t.key=this.type===Ta.num||this.type===Ta.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ts.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},ts.parseMethod=function(t,e,i){var a=this.startNode(),s=this.yieldPos,r=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=t),this.options.ecmaVersion>=8&&(a.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Fa(e,a.generator)|(i?128:0)),this.expect(Ta.parenL),a.params=this.parseBindingList(Ta.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0),this.yieldPos=s,this.awaitPos=r,this.awaitIdentPos=n,this.finishNode(a,"FunctionExpression")},ts.parseArrowExpression=function(t,e,i){var a=this.yieldPos,s=this.awaitPos,r=this.awaitIdentPos;return this.enterScope(16|Fa(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=r,this.finishNode(t,"ArrowFunctionExpression")},ts.parseFunctionBody=function(t,e,i){var a=e&&this.type!==Ta.braceL,s=this.strict,r=!1;if(a)t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1);else{var n=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);s&&!n||(r=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(t,!s&&!r&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,5),t.body=this.parseBlock(!1,void 0,r&&!s),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=o}this.exitScope()},ts.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1){if("Identifier"!==i[e].type)return!1}return!0},ts.checkParams=function(t,e){for(var i={},a=0,s=t.params;a<s.length;a+=1){var r=s[a];this.checkLVal(r,1,e?null:i)}},ts.parseExprList=function(t,e,i,a){for(var s=[],r=!0;!this.eat(t);){if(r)r=!1;else if(this.expect(Ta.comma),e&&this.afterTrailingComma(t))break;var n=void 0;i&&this.type===Ta.comma?n=null:this.type===Ta.ellipsis?(n=this.parseSpread(a),a&&this.type===Ta.comma&&a.trailingComma<0&&(a.trailingComma=this.start)):n=this.parseMaybeAssign(!1,a),s.push(n)}return s},ts.checkUnreserved=function(t){var e=t.start,i=t.end,a=t.name;(this.inGenerator&&"yield"===a&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===a&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(a)&&this.raise(e,"Unexpected keyword '"+a+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,i).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(a)&&(this.inAsync||"await"!==a||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+a+"' is reserved"))},ts.parseIdent=function(t,e){var i=this.startNode();return this.type===Ta.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(i,"Identifier"),t||(this.checkUnreserved(i),"await"!==i.name||this.awaitIdentPos||(this.awaitIdentPos=i.start)),i},ts.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===Ta.semi||this.canInsertSemicolon()||this.type!==Ta.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(Ta.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},ts.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")};var is=Ya.prototype;is.raise=function(t,e){var i=ka(this.input,t);e+=" ("+i.line+":"+i.column+")";var a=new SyntaxError(e);throw a.pos=t,a.loc=i,a.raisedAt=this.pos,a},is.raiseRecoverable=is.raise,is.curPosition=function(){if(this.options.locations)return new Ba(this.curLine,this.pos-this.lineStart)};var as=Ya.prototype,ss=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};as.enterScope=function(t){this.scopeStack.push(new ss(t))},as.exitScope=function(){this.scopeStack.pop()},as.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},as.declareName=function(t,e,i){var a=!1;if(2===e){var s=this.currentScope();a=s.lexical.indexOf(t)>-1||s.functions.indexOf(t)>-1||s.var.indexOf(t)>-1,s.lexical.push(t),this.inModule&&1&s.flags&&delete this.undefinedExports[t]}else if(4===e){this.currentScope().lexical.push(t)}else if(3===e){var r=this.currentScope();a=this.treatFunctionsAsVar?r.lexical.indexOf(t)>-1:r.lexical.indexOf(t)>-1||r.var.indexOf(t)>-1,r.functions.push(t)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(t)>-1&&!(32&o.flags&&o.lexical[0]===t)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(t)>-1){a=!0;break}if(o.var.push(t),this.inModule&&1&o.flags&&delete this.undefinedExports[t],3&o.flags)break}a&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},as.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},as.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},as.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags)return e}},as.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags&&!(16&e.flags))return e}};var rs=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new Ua(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},ns=Ya.prototype;function os(t,e,i,a){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=a),this.options.ranges&&(t.range[1]=i),t}ns.startNode=function(){return new rs(this,this.start,this.startLoc)},ns.startNodeAt=function(t,e){return new rs(this,t,e)},ns.finishNode=function(t,e){return os.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},ns.finishNodeAt=function(t,e,i,a){return os.call(this,t,e,i,a)};var cs=function(t,e,i,a,s){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=a,this.generator=!!s},hs={b_stat:new cs("{",!1),b_expr:new cs("{",!0),b_tmpl:new cs("${",!1),p_stat:new cs("(",!1),p_expr:new cs("(",!0),q_tmpl:new cs("`",!0,!0,(function(t){return t.tryReadTemplateToken()})),f_stat:new cs("function",!1),f_expr:new cs("function",!0),f_expr_gen:new cs("function",!0,!1,null,!0),f_gen:new cs("function",!1,!1,null,!0)},us=Ya.prototype;us.initialContext=function(){return[hs.b_stat]},us.braceIsBlock=function(t){var e=this.curContext();return e===hs.f_expr||e===hs.f_stat||(t!==Ta.colon||e!==hs.b_stat&&e!==hs.b_expr?t===Ta._return||t===Ta.name&&this.exprAllowed?Ia.test(this.input.slice(this.lastTokEnd,this.start)):t===Ta._else||t===Ta.semi||t===Ta.eof||t===Ta.parenR||t===Ta.arrow||(t===Ta.braceL?e===hs.b_stat:t!==Ta._var&&t!==Ta._const&&t!==Ta.name&&!this.exprAllowed):!e.isExpr)},us.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},us.updateContext=function(t){var e,i=this.type;i.keyword&&t===Ta.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},Ta.parenR.updateContext=Ta.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===hs.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},Ta.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?hs.b_stat:hs.b_expr),this.exprAllowed=!0},Ta.dollarBraceL.updateContext=function(){this.context.push(hs.b_tmpl),this.exprAllowed=!0},Ta.parenL.updateContext=function(t){var e=t===Ta._if||t===Ta._for||t===Ta._with||t===Ta._while;this.context.push(e?hs.p_stat:hs.p_expr),this.exprAllowed=!0},Ta.incDec.updateContext=function(){},Ta._function.updateContext=Ta._class.updateContext=function(t){!t.beforeExpr||t===Ta.semi||t===Ta._else||t===Ta._return&&Ia.test(this.input.slice(this.lastTokEnd,this.start))||(t===Ta.colon||t===Ta.braceL)&&this.curContext()===hs.b_stat?this.context.push(hs.f_stat):this.context.push(hs.f_expr),this.exprAllowed=!1},Ta.backQuote.updateContext=function(){this.curContext()===hs.q_tmpl?this.context.pop():this.context.push(hs.q_tmpl),this.exprAllowed=!1},Ta.star.updateContext=function(t){if(t===Ta._function){var e=this.context.length-1;this.context[e]===hs.f_expr?this.context[e]=hs.f_expr_gen:this.context[e]=hs.f_gen}this.exprAllowed=!0},Ta.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==Ta.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var _s="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ls=_s+" Extended_Pictographic",ps={9:_s,10:ls,11:ls},ds="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",fs="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Es=fs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ms={9:fs,10:Es,11:Es+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ys={};function gs(t){var e=ys[t]={binary:Ra(ps[t]+" "+ds),nonBinary:{General_Category:Ra(ds),Script:Ra(ms[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}gs(9),gs(10),gs(11);var ws=Ya.prototype,vs=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ys[t.options.ecmaVersion>=11?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function Ss(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function As(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function Ts(t){return t>=65&&t<=90||t>=97&&t<=122}function Is(t){return Ts(t)||95===t}function Cs(t){return Is(t)||Os(t)}function Os(t){return t>=48&&t<=57}function Ds(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function Ps(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function Ns(t){return t>=48&&t<=55}vs.prototype.reset=function(t,e,i){var a=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchN=a&&this.parser.options.ecmaVersion>=9},vs.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},vs.prototype.at=function(t,e){void 0===e&&(e=!1);var i=this.source,a=i.length;if(t>=a)return-1;var s=i.charCodeAt(t);if(!e&&!this.switchU||s<=55295||s>=57344||t+1>=a)return s;var r=i.charCodeAt(t+1);return r>=56320&&r<=57343?(s<<10)+r-56613888:s},vs.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i=this.source,a=i.length;if(t>=a)return a;var s,r=i.charCodeAt(t);return!e&&!this.switchU||r<=55295||r>=57344||t+1>=a||(s=i.charCodeAt(t+1))<56320||s>57343?t+1:t+2},vs.prototype.current=function(t){return void 0===t&&(t=!1),this.at(this.pos,t)},vs.prototype.lookahead=function(t){return void 0===t&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},vs.prototype.advance=function(t){void 0===t&&(t=!1),this.pos=this.nextIndex(this.pos,t)},vs.prototype.eat=function(t,e){return void 0===e&&(e=!1),this.current(e)===t&&(this.advance(e),!0)},ws.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,a=0;a<i.length;a++){var s=i.charAt(a);-1===e.indexOf(s)&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(s,a+1)>-1&&this.raise(t.start,"Duplicate regular expression flag")}},ws.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&t.groupNames.length>0&&(t.switchN=!0,this.regexp_pattern(t))},ws.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1){var a=i[e];-1===t.groupNames.indexOf(a)&&t.raise("Invalid named capture referenced")}},ws.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},ws.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},ws.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!!(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},ws.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},ws.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},ws.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},ws.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var a=0,s=-1;if(this.regexp_eatDecimalDigits(t)&&(a=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue),t.eat(125)))return-1!==s&&s<a&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},ws.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},ws.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},ws.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1},ws.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},ws.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},ws.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},ws.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!As(e)&&(t.lastIntValue=e,t.advance(),!0)},ws.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!As(i);)t.advance();return t.pos!==e},ws.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e)&&(t.advance(),!0)},ws.regexp_groupSpecifier=function(t){if(t.eat(63)){if(this.regexp_eatGroupName(t))return-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),void t.groupNames.push(t.lastStringValue);t.raise("Invalid group")}},ws.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},ws.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=Ss(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=Ss(t.lastIntValue);return!0}return!1},ws.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,a=t.current(i);return t.advance(i),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(a=t.lastIntValue),function(t){return Ea(t,!0)||36===t||95===t}(a)?(t.lastIntValue=a,!0):(t.pos=e,!1)},ws.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,a=t.current(i);return t.advance(i),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(a=t.lastIntValue),function(t){return ma(t,!0)||36===t||95===t||8204===t||8205===t}(a)?(t.lastIntValue=a,!0):(t.pos=e,!1)},ws.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},ws.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},ws.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},ws.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},ws.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},ws.regexp_eatZero=function(t){return 48===t.current()&&!Os(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},ws.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},ws.regexp_eatControlLetter=function(t){var e=t.current();return!!Ts(e)&&(t.lastIntValue=e%32,t.advance(),!0)},ws.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){void 0===e&&(e=!1);var i,a=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var r=t.lastIntValue;if(s&&r>=55296&&r<=56319){var n=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(o>=56320&&o<=57343)return t.lastIntValue=1024*(r-55296)+(o-56320)+65536,!0}t.pos=n,t.lastIntValue=r}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&((i=t.lastIntValue)>=0&&i<=1114111))return!0;s&&t.raise("Invalid unicode escape"),t.pos=a}return!1},ws.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e)&&(t.lastIntValue=e,t.advance(),!0)},ws.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},ws.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&this.options.ecmaVersion>=9&&(80===e||112===e)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},ws.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var a=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,a),!0}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,s),!0}return!1},ws.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Ma(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},ws.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},ws.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";Is(e=t.current());)t.lastStringValue+=Ss(e),t.advance();return""!==t.lastStringValue},ws.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";Cs(e=t.current());)t.lastStringValue+=Ss(e),t.advance();return""!==t.lastStringValue},ws.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},ws.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},ws.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||-1!==e&&-1!==i||t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},ws.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||Ns(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var a=t.current();return 93!==a&&(t.lastIntValue=a,t.advance(),!0)},ws.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},ws.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!Os(e)&&95!==e)&&(t.lastIntValue=e%32,t.advance(),!0)},ws.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},ws.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Os(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},ws.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Ds(i=t.current());)t.lastIntValue=16*t.lastIntValue+Ps(i),t.advance();return t.pos!==e},ws.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i}else t.lastIntValue=e;return!0}return!1},ws.regexp_eatOctalDigit=function(t){var e=t.current();return Ns(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},ws.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var a=0;a<e;++a){var s=t.current();if(!Ds(s))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+Ps(s),t.advance()}return!0};var bs=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Ua(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},xs=Ya.prototype;function Ms(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}function Ls(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}xs.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new bs(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},xs.getToken=function(){return this.next(),new bs(this)},"undefined"!=typeof Symbol&&(xs[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===Ta.eof,value:e}}}}),xs.curContext=function(){return this.context[this.context.length-1]},xs.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(Ta.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},xs.readToken=function(t){return Ea(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},xs.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||t>=57344?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},xs.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(-1===a&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(Ca.lastIndex=i;(t=Ca.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,a),i,this.pos,e,this.curPosition())},xs.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!Oa(a);)a=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},xs.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&t<14||t>=5760&&Da.test(String.fromCharCode(t))))break t;++this.pos}}},xs.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},xs.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(Ta.ellipsis)):(++this.pos,this.finishToken(Ta.dot))},xs.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(Ta.assign,2):this.finishOp(Ta.slash,1)},xs.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,a=42===t?Ta.star:Ta.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,a=Ta.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(Ta.assign,i+1):this.finishOp(a,i)},xs.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Ta.assign,3);return this.finishOp(124===t?Ta.logicalOR:Ta.logicalAND,2)}return 61===e?this.finishOp(Ta.assign,2):this.finishOp(124===t?Ta.bitwiseOR:Ta.bitwiseAND,1)},xs.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(Ta.assign,2):this.finishOp(Ta.bitwiseXOR,1)},xs.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Ia.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(Ta.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(Ta.assign,2):this.finishOp(Ta.plusMin,1)},xs.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(Ta.assign,i+1):this.finishOp(Ta.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(Ta.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},xs.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(Ta.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(Ta.arrow)):this.finishOp(61===t?Ta.eq:Ta.prefix,1)},xs.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(Ta.questionDot,2)}if(63===e){if(t>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(Ta.assign,3);return this.finishOp(Ta.coalesce,2)}}return this.finishOp(Ta.question,1)},xs.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Ta.parenL);case 41:return++this.pos,this.finishToken(Ta.parenR);case 59:return++this.pos,this.finishToken(Ta.semi);case 44:return++this.pos,this.finishToken(Ta.comma);case 91:return++this.pos,this.finishToken(Ta.bracketL);case 93:return++this.pos,this.finishToken(Ta.bracketR);case 123:return++this.pos,this.finishToken(Ta.braceL);case 125:return++this.pos,this.finishToken(Ta.braceR);case 58:return++this.pos,this.finishToken(Ta.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Ta.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(Ta.prefix,1)}this.raise(this.pos,"Unexpected character '"+Ls(t)+"'")},xs.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},xs.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(Ia.test(a)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===a)e=!0;else if("]"===a&&e)e=!1;else if("/"===a&&!e)break;t="\\"===a}++this.pos}var s=this.input.slice(i,this.pos);++this.pos;var r=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new vs(this));o.reset(i,s,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(s,n)}catch(t){}return this.finishToken(Ta.regexp,{pattern:s,flags:n,value:c})},xs.readInt=function(t,e,i){for(var a=this.options.ecmaVersion>=12&&void 0===e,s=i&&48===this.input.charCodeAt(this.pos),r=this.pos,n=0,o=0,c=0,h=null==e?1/0:e;c<h;++c,++this.pos){var u=this.input.charCodeAt(this.pos),_=void 0;if(a&&95===u)s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===c&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=u;else{if((_=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0)>=t)break;o=u,n=n*t+_}}return a&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=e&&this.pos-r!==e?null:n},xs.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=Ms(this.input.slice(e,this.pos)),++this.pos):Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Ta.num,i)},xs.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===a){var s=Ms(this.input.slice(e,this.pos));return++this.pos,Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(Ta.num,s)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==a||i||(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),69!==a&&101!==a||i||(43!==(a=this.input.charCodeAt(++this.pos))&&45!==a||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),Ea(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r,n=(r=this.input.slice(e,this.pos),i?parseInt(r,8):parseFloat(r.replace(/_/g,"")));return this.finishToken(Ta.num,n)},xs.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},xs.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===t)break;92===a?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):(Oa(a,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(Ta.string,e)};var Rs={};xs.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==Rs)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},xs.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Rs;this.raise(t,e)},xs.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==Ta.template&&this.type!==Ta.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(Ta.template,t)):36===i?(this.pos+=2,this.finishToken(Ta.dollarBraceL)):(++this.pos,this.finishToken(Ta.backQuote));if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Oa(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},xs.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(Ta.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},xs.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ls(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t){var i=this.pos-1;return this.invalidStringToken(i,"Invalid escape sequence in template string"),null}default:if(e>=48&&e<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(a,8);return s>255&&(a=a.slice(0,-1),s=parseInt(a,8)),this.pos+=a.length-1,e=this.input.charCodeAt(this.pos),"0"===a&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-a.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Oa(e)?"":String.fromCharCode(e)}},xs.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},xs.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(ma(s,a))this.pos+=s<=65535?1:2;else{if(92!==s)break;this.containsEsc=!0,t+=this.input.slice(i,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(e?Ea:ma)(n,a)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=Ls(n),i=this.pos}e=!1}return t+this.input.slice(i,this.pos)},xs.readWord=function(){var t=this.readWord1(),e=Ta.name;return this.keywords.test(t)&&(e=Sa[t]),this.finishToken(e,t)};function Bs(t){return e=t,i={ecmaVersion:2020},Ya.parse(e,i);var e,i}function Us(t){return["Array1D","Array2D","Number","Symbol","UnaryOperation","BinaryOperation","Random","CallDefinedFunction","AnyFunction"].includes(t.type)}function ks(t){switch(t.type){case"Program":return function(t){if(1!==t.body.length)throw new Error("bodyが1以外の場合評価できません。");return ks(t.body[0])}(t);case"ExpressionStatement":return function(t){return ks(t.expression)}(t);case"AssignmentExpression":return function(t){var e=ks(t.left),i=ks(t.right);if(!Us(i))throw new Error("値以外を代入式の右辺に設定できません");if("="===t.operator){if("Array2D"===e.type){if("m"===e.name||"o"===e.name)return{type:"PartsAssignment",partsKind:"m"===e.name?"map":"object",destinationX:e.index0,destinationY:e.index1,value:i};throw new Error("想定していない記号が2次元配列ででてきました")}if("Array1D"===e.type){if("ITEM"===e.name)return{type:"ItemAssignment",itemBoxPosition1to12:e.index0,value:i};if("v"===e.name)return{type:"UserVariableAssignment",index:e.index0,value:i};throw new Error("")}if("Symbol"===e.type){if("m"===e.name||"o"===e.name||"v"===e.name||"ITEM"===e.name)throw new Error("このシンボルには代入できません");if("AT_TOTAL"===e.name)throw new Error('"装備品込みの攻撃力(AT_TOTAL)への代入はできません。"');if("DF_TOTAL"===e.name)throw new Error('"装備品込みの防御力(DF_TOTAL)への代入はできません。"');return{type:"SpecialParameterAssignment",kind:e.name,value:i}}throw"Number"===e.type?new Error("数値には代入できません"):new Error("代入できません")}}(t);case"MemberExpression":return function(t){var e=ks(t.object),i=ks(t.property);if("Symbol"===e.type){if("v"!==e.name&&"m"!==e.name&&"o"!==e.name&&"ITEM"!==e.name)throw new Error("このシンボルは配列にできません");if("Number"===i.type||"Symbol"===i.type||"BinaryOperation"===i.type||"Array1D"===i.type)return{type:"Array1D",name:e.name,index0:i};throw new Error("WWAでは存在しない構文です")}if("Array1D"===e.type){if("ITEM"===e.name||"v"===e.name)throw new Error("この配列は2次元以上にはできません。");if("Number"===i.type||"Symbol"===i.type||"BinaryOperation"===i.type||"Array1D"===i.type)return{type:"Array2D",name:e.name,index0:e.index0,index1:i};throw new Error("WWAでは存在しない構文です")}}(t);case"UnaryExpression":return function(t){var e=ks(t.argument);if("+"!==t.operator&&"-"!==t.operator)throw new Error("未定義の演算子です :"+t.operator);if(!Us(e))throw new Error("単項演算子が適用できません");return{type:"UnaryOperation",operator:t.operator,argument:e}}(t);case"BinaryExpression":return function(t){var e=ks(t.left),i=ks(t.right);if(!Us(e)||!Us(i))throw new Error("左辺または右辺が評価不能です");switch(t.operator){case"+":case"-":case"*":case"/":case"%":case">":case"<":case">=":case"<=":case"==":case"!=":return{type:"BinaryOperation",operator:t.operator,left:e,right:i};default:throw new Error("未定義の演算子です :"+t.operator)}}(t);case"Identifier":return function(t){switch(t.name){case"m":case"o":case"ITEM":case"X":case"Y":case"PX":case"PY":case"v":case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"DF":case"DF_TOTAL":case"GD":case"STEP":case"TIME":case"PDIR":case"i":case"j":case"k":case"LOOPLIMIT":case"ITEM_ID":case"ITEM_POS":return{type:"Symbol",name:t.name};default:throw new Error("未定義のシンボルです :\n"+t.name)}}(t);case"Literal":return function(t){return{type:"Number",value:t.value}}(t);case"CallExpression":return function(t){var e=t.callee.name;switch(e){case"RAND":return function(t){if(t.length<1)throw new Error("RAND関数には引数が必要です。");return{type:"Random",value:ks(t[0])}}(t.arguments);case"JUMPGATE":return function(t){if(t.length<2)throw new Error("RAND関数には引数が2つ必要です。");var e={x:t[0],y:t[1]};return{type:"Jumpgate",x:ks(e.x),y:ks(e.y)}}(t.arguments);case"MSG":case"MESSAGE":return{type:"Msg",value:ks(t.arguments[0])};case"SOUND":case"SAVE":case"LOG":case"ABLE_CHANGE_SPEED":case"SET_SPEED":case"CHANGE_GAMEOVER_POS":case"DEL_PLAYER":case"RESTART_GAME":case"URL_JUMPGATE":case"HIDE_STATUS":case"PARTS":case"EFFECT":case"CHANGE_PLAYER_IMAGE":case"HAS_ITEM":case"REMOVE_ITEM":case"MOVE":case"IS_PLAYER_WAITING_MESSAGE":case"GET_UNIXTIME":case"GET_DATE_YEAR":case"GET_DATE_MONTH":case"GET_DATE_DAY":case"GET_DATE_HOUR":case"GET_DATE_MINUTES":case"CHANGE_SYSMSG":return function(t,e){return{type:"AnyFunction",functionName:e,value:t.map((function(t){return ks(t)}))}}(t.arguments,e);default:return{type:"CallDefinedFunction",functionName:e}}}(t);case"IfStatement":return function(t){var e=ks(t.consequent),i=ks(t.test);return{type:"IfStatement",consequent:e,test:i,alternate:t.alternate?ks(t.alternate):void 0}}(t);case"BlockStatement":return function(t){return{type:"BlockStatement",value:t.body.map((function(t){return ks(t)}))}}(t);case"FunctionDeclaration":return function(t){return{type:"DefinedFunction",functionName:t.id.name,body:ks(t.body)}}(t);case"ForStatement":return function(t){var e=t.body.body.map((function(t){return ks(t)}));return{type:"ForStatement",body:e,init:ks(t.init),test:ks(t.test),update:ks(t.update)}}(t);case"BreakStatement":return function(t){return{type:"Break",label:t.label}}(t);case"ContinueStatement":return function(t){return{type:"Continue",label:t.label}}(t);case"UpdateExpression":return function(t){return{type:"UpdateExpression",operator:t.operator,argument:ks(t.argument)}}(t);case"LogicalExpression":return function(t){return{type:"LogicalExpression",operator:t.operator,left:ks(t.left),right:ks(t.right)}}(t);default:throw console.log(t),new Error("未定義の AST ノードです :"+t.type)}}Ya.acorn={Parser:Ya,version:"7.4.1",defaultOptions:Wa,Position:Ba,SourceLocation:Ua,getLineInfo:ka,Node:rs,TokenType:ya,tokTypes:Ta,keywordTypes:Sa,TokContext:cs,tokContexts:hs,isIdentifierChar:ma,isIdentifierStart:Ea,Token:bs,isNewLine:Oa,lineBreak:Ia,lineBreakG:Ca,nonASCIIwhitespace:Da};var Ws,Vs=function(){return Vs=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Vs.apply(this,arguments)},Fs=function(){function t(t){this.wwa=t,this.loop_limit=1e5}return t.prototype.setReadOnlyItemValue=function(t,e){this.readonly_value=Vs(Vs({},this.readonly_value),{item_id:t,item_pos:e})},t.prototype.evalWwaNodes=function(t){var e=this;return t.map((function(t){return e.evalWwaNode(t)}))},t.prototype.evalWwaNode=function(t){"BlockStatement"===t.type&&Array.isArray(t.value)&&0===t.value.length||new Ys(this).evalWwaNode(t)},t.prototype.updateLoopLimit=function(t){this.loop_limit=t},t}(),Ys=function(){function t(t){this.generator=t,this.for_id={i:null,j:null,k:null,loopCount:0,break_flag:!1,continue_flag:!1}}return t.prototype.evalWwaNodes=function(t){var e=this;return t.map((function(t){return e.evalWwaNode(t)}))},t.prototype.evalWwaNode=function(t){if(!this.for_id.break_flag&&!this.for_id.continue_flag)switch(t.type){case"UnaryOperation":return this.evalUnaryOperation(t);case"BinaryOperation":return this.evalBinaryOperation(t);case"Symbol":return this.evalSymbol(t);case"Array1D":return this.evalArray1D(t);case"Array2D":return this.evalArray2D(t);case"Number":return this.evalNumber(t);case"UserVariableAssignment":return this.evalSetUserVariable(t);case"SpecialParameterAssignment":return this.evalSetSpecialParameter(t);case"Random":return this.evalRandom(t);case"Jumpgate":return this.evalJumpgate(t);case"Msg":return this.evalMessage(t);case"ItemAssignment":return this.itemAssignment(t);case"IfStatement":return this.ifStatement(t);case"BlockStatement":return this.blockStatement(t);case"PartsAssignment":return this.partsAssignment(t);case"ForStatement":return this.forStateMent(t);case"AnyFunction":return this.evalAnyFunction(t);case"CallDefinedFunction":return this.callDefinedFunction(t);case"Break":return this.breakStatement(t);case"Continue":return this.contunueStatment(t);case"UpdateExpression":return this.updateExpression(t);case"LogicalExpression":return this.logicalExpression(t);default:throw new Error("未定義または未実装のノードです")}},t.prototype.callDefinedFunction=function(t){var e=this.generator.wwa.getUserScript(t.functionName);if(null===e)throw new Error("未定義の関数が呼び出されました: ".concat(t.functionName));this.evalWwaNode(e)},t.prototype.updateExpression=function(t){if("Symbol"!==t.argument.type)throw console.log(t),new Error("node.argument.typeがSymbolではありません。:"+t.argument.type);var e=this.evalSymbol(t.argument),i=function(){switch(t.operator){case"++":return e+1;case"--":return e-1;default:throw new Error("想定外のOperatorが渡されました :"+t.operator)}}(),a={type:"SpecialParameterAssignment",kind:t.argument.name,value:{type:"Number",value:i}};this.evalSetSpecialParameter(a)},t.prototype.logicalExpression=function(t){var e=this.evalWwaNode(t.left),i=this.evalWwaNode(t.right);switch(t.operator){case"||":return e||i;case"&&":return e&&i;default:throw new Error("存在しない論理式です!: "+t.operator)}},t.prototype.contunueStatment=function(t){this.for_id.continue_flag=!0},t.prototype.breakStatement=function(t){this.for_id.break_flag=!0},t.prototype.forStateMent=function(t){var e=this,i=t.init;for(function(){switch(i.kind){case"i":if(null!==e.for_id.i)throw new Error("iの値が既に外側のforループで使われています。");break;case"j":if(null!==e.for_id.j)throw new Error("jの値が既に外側のforループで使われています。");break;case"k":if(null!==e.for_id.k)throw new Error("kの値が既に外側のforループで使われています。");break;default:throw new Error("予想外の変数がfor文内で使用されました :"+i.kind)}e.evalWwaNode(t.init)}();this.evalWwaNode(t.test);this.evalWwaNode(t.update)){if(this.for_id.loopCount++,this.for_id.loopCount>this.generator.loop_limit)throw new Error("処理回数が多すぎます!\n上限値は LOOPLIMIT で変えられます。");if(this.for_id.break_flag)break;if(!this.evalWwaNode(t.test))break;this.evalWwaNodes(t.body),this.for_id.continue_flag=!1}switch(this.for_id.break_flag=!1,i.kind){case"i":this.for_id.i=null;break;case"j":this.for_id.j=null;break;case"k":this.for_id.k=null}},t.prototype._checkArgsLength=function(t,e){if(e.value.length<t)throw new Error("関数 ".concat(e.functionName," の引数が不足しています!"))},t.prototype.evalAnyFunction=function(t){var e=this.generator.wwa.getGameStatus();switch(t.functionName){case"SOUND":this._checkArgsLength(1,t);var i=this.evalWwaNode(t.value[0]);this.generator.wwa.playSound(i);break;case"SAVE":this._checkArgsLength(1,t);var a=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.disableSave(a);break;case"LOG":this._checkArgsLength(1,t);var s=this.evalWwaNode(t.value[0]);console.log(s);break;case"ABLE_CHANGE_SPEED":this._checkArgsLength(1,t);var r=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.speedChangeJudge(r);break;case"SET_SPEED":this._checkArgsLength(1,t);var n=Number(this.evalWwaNode(t.value[0]));this.generator.wwa.setPlayerSpeedIndex(n);break;case"CHANGE_GAMEOVER_POS":this._checkArgsLength(2,t);var o={x:Number(this.evalWwaNode(t.value[0])),y:Number(this.evalWwaNode(t.value[1]))};if(o.x<0||o.x>=this.generator.wwa.getMapWidth()||o.y<0||o.y>this.generator.wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this.generator.wwa.setGameOverPosition(new d(o.x,o.y));break;case"DEL_PLAYER":this._checkArgsLength(1,t);var c=Boolean(this.evalWwaNode(t.value[0]));this.generator.wwa.setDelPlayer(c);break;case"RESTART_GAME":this.generator.wwa.restartGame();break;case"URL_JUMPGATE":throw new Error("URL_JUMPGATE 関数は調整中のためご利用になれません");case"HIDE_STATUS":this._checkArgsLength(2,t);var h=Number(this.evalWwaNode(t.value[0])),u=Boolean(this.evalWwaNode(t.value[1]));this.generator.wwa.hideStatus(h,u);break;case"PARTS":this._checkArgsLength(2,t);var _=Number(this.evalWwaNode(t.value[0])),l=Number(this.evalWwaNode(t.value[1])),p=t.value[2]?Number(this.evalWwaNode(t.value[2])):0,f=!t.value[3]||Boolean(this.evalWwaNode(t.value[3])),E=[v.OBJECT,v.MAP];if(_<0||l<0)throw new Error("パーツ番号が不正です");if(!E.includes(p))throw new Error("パーツ種別が不明です");this.generator.wwa.replaceParts(_,l,p,f);break;case"EFFECT":this._checkArgsLength(1,t);var m=Number(this.evalWwaNode(t.value[0]));if(m<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0===m)return void this.generator.wwa.stopEffect();for(var y=[],g=1;g<t.value.length;g+=2){var w=Number(this.evalWwaNode(t.value[g]));if(w<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(g+1===t.value.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");var S=Number(this.evalWwaNode(t.value[g+1]));if(S<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");y.push(new d(w,S))}this.generator.wwa.setEffect(m,y);break;case"CHANGE_PLAYER_IMAGE":this._checkArgsLength(2,t);var A=Number(this.evalWwaNode(t.value[0])),T=Number(this.evalWwaNode(t.value[1])),I=new d(A,T);this.generator.wwa.setPlayerImgCoord(I);break;case"HAS_ITEM":this._checkArgsLength(1,t);var C=Number(this.evalWwaNode(t.value[0]));return e.itemBox.includes(C);case"REMOVE_ITEM":this._checkArgsLength(1,t);C=Number(this.evalWwaNode(t.value[0]));for(var O=!!t.value[1]&&1===this.evalWwaNode(t.value[1]),D=0;D<e.itemBox.length;D++){if(C===e.itemBox[D]&&(this.generator.wwa.setPlayerGetItem(D+1,0),!O))break}break;case"MOVE":this._checkArgsLength(1,t);var P=Number(this.evalWwaNode(t.value[0]));if(P<=0||P>9)throw Error("MOVEの移動先は2/4/6/8で指定してください!");this.generator.wwa.movePlayer(P),this.generator.wwa.movePlayer(P);break;case"IS_PLAYER_WAITING_MESSAGE":return this.generator.wwa.isPlayerWaitingMessage();case"GET_UNIXTIME":return Math.floor((new Date).getTime()/1e3);case"GET_DATE_YEAR":return(new Date).getFullYear();case"GET_DATE_MONTH":return(new Date).getMonth()+1;case"GET_DATE_DAY":return(new Date).getDate();case"GET_DATE_HOUR":return(new Date).getHours();case"GET_DATE_MINUTES":return(new Date).getMinutes();case"CHANGE_SYSMSG":this._checkArgsLength(1,t);var N=this.evalWwaNode(t.value[0]),b=t.value.length>=2?this.evalWwaNode(t.value[1]):void 0;if(!(h=this.resolveSystemMessageKeyFromMacroArg(N)))throw new Error("このIDのシステムメッセージは未定義です。");if("number"==typeof b||"string"==typeof b||"boolean"==typeof b)this.generator.wwa.overwriteSystemMessage(h,String(b));else{if(null!=b)throw new Error("この値は文字列に変換できないため、システムメッセージを表示できません。");this.generator.wwa.overwriteSystemMessage(h,void 0)}break;default:throw new Error("未定義の関数が指定されました: "+t.functionName)}},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return"string"==typeof t?n(t)?t:void 0:"number"==typeof t?o(t):void 0},t.prototype.partsAssignment=function(t){var e=this.generator.wwa.getGameStatus(),i=this.evalWwaNode(t.destinationX),a=this.evalWwaNode(t.destinationY),s=this.evalWwaNode(t.value),r="map"===t.partsKind?v.MAP:v.OBJECT;this.generator.wwa.appearPartsEval(e.playerCoord,i,a,s,r)},t.prototype.blockStatement=function(t){this.evalWwaNodes(t.value)},t.prototype.ifStatement=function(t){return this.evalWwaNode(t.test)?this.evalWwaNode(t.consequent):t.alternate&&this.evalWwaNode(t.alternate),0},t.prototype.itemAssignment=function(t){var e=this.evalWwaNode(t.itemBoxPosition1to12),i=this.evalWwaNode(t.value);return this.generator.wwa.setPlayerGetItem(e,i),0},t.prototype.evalMessage=function(t){var e=this.evalWwaNode(t.value),i=isNaN(e)?e:e.toString();return this.generator.wwa.reserveMessageDisplayWhenShouldOpen(i),0},t.prototype.evalJumpgate=function(t){var e=this.evalWwaNode(t.x),i=this.evalWwaNode(t.y);if(isNaN(e)||isNaN(i))throw new Error("飛び先の値が数値になっていません。 x=".concat(e," / y=").concat(i));this.generator.wwa.forcedJumpGate(e,i)},t.prototype.evalRandom=function(t){var e=this.evalWwaNode(t.value);return Math.floor(Math.random()*e)},t.prototype.evalSetSpecialParameter=function(t){var e=this.evalWwaNode(t.value);if(!this.generator.wwa||isNaN(e))return 0;switch(t.kind){case"PX":return this.generator.wwa.jumpSpecifiedXPos(e),0;case"PY":return this.generator.wwa.jumpSpecifiedYPos(e),0;case"AT":return this.generator.wwa.setPlayerStatus(B.STRENGTH,e,!1),0;case"DF":return this.generator.wwa.setPlayerStatus(B.DEFENCE,e,!1),0;case"GD":return this.generator.wwa.setPlayerStatus(B.GOLD,e,!1),0;case"HP":return this.generator.wwa.setPlayerStatus(B.ENERGY,e,!1),0;case"HPMAX":return this.generator.wwa.setPlayerEnergyMax(e),0;case"i":return this.for_id.i=this.evalWwaNode(t.value),0;case"j":return this.for_id.j=this.evalWwaNode(t.value),0;case"k":return this.for_id.k=this.evalWwaNode(t.value),0;case"LOOPLIMIT":return this.generator.updateLoopLimit(this.evalWwaNode(t.value)),0;default:return console.error("未実装の要素です: "+t.kind),0}},t.prototype.evalSetUserVariable=function(t){var e=this.evalWwaNode(t.value);if(!this.generator.wwa||isNaN(e))return 0;var i=this.evalWwaNode(t.index);if("number"!=typeof i)throw new Error("代入先の添字が数値になりませんでした");return this.generator.wwa.setUserVar(i,e),0},t.prototype.evalUnaryOperation=function(t){switch(t.operator){case"+":return this.evalWwaNode(t.argument);case"-":return-this.evalWwaNode(t.argument);default:throw new Error("存在しない単項演算子です")}},t.prototype.evalBinaryOperation=function(t){var e=this.evalWwaNode(t.left),i=this.evalWwaNode(t.right);switch(t.operator){case"+":return e+i;case"-":return e-i;case"*":return e*i;case"/":return 0===i?0:Math.floor(e/i);case"%":return 0===i?0:e%i;case">":return e>i;case">=":return e>=i;case"<":return e<i;case"<=":return e<=i;case"==":return e==i;case"!=":return e!=i;default:throw new Error("存在しない単項演算子です")}},t.prototype.evalSymbol=function(t){var e=this.generator.wwa.getGameStatus();switch(t.name){case"X":case"Y":return 0;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"GD":return e.totalStatus.gold;case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"STEP":return e.moveCount;case"TIME":return e.playTime;case"PDIR":return e.playerDirection;case"i":return this.for_id.i;case"j":return this.for_id.j;case"k":return this.for_id.k;case"LOOPLIMIT":return this.generator.loop_limit;case"ITEM_ID":return this.generator.readonly_value.item_id;case"ITEM_POS":return this.generator.readonly_value.item_pos;default:throw new Error("このシンボルは取得できません")}},t.prototype.evalArray1D=function(t){var e=this.evalWwaNode(t.index0);if("number"!=typeof e)throw new Error("添字の計算結果が数値になりませんでした");var i=this.generator.wwa.getGameStatus();switch(t.name){case"v":return this.generator.wwa.getUserVar(e);case"ITEM":if(void 0===i.itemBox[e])throw new Error("ITEMの添字に想定外の値が入っています。: "+e);return i.itemBox[e];default:throw new Error("このシンボルは取得できません")}},t.prototype.evalArray2D=function(t){switch(t.name){case"m":case"o":var e=this.evalWwaNode(t.index0),i=this.evalWwaNode(t.index1),a="o"===t.name?v.OBJECT:v.MAP;return this.generator.wwa.getPartsID(new d(e,i),a);default:throw new Error("このシンボルは取得できません")}},t.prototype.evalNumber=function(t){return t.value},t}(),Gs=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},Hs=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Ks=function(t,e,i,a){return new(i||(i=Promise))((function(s,r){function n(t){try{c(a.next(t))}catch(t){r(t)}}function o(t){try{c(a.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}c((a=a.apply(t,e||[])).next())}))},js=function(t,e){var i,a,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(c){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(n=0)),n;)try{if(i=1,a&&(s=2&o[0]?a.return:o[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;switch(a=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!(s=n.trys,(s=s.length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(6===o[0]&&n.label<s[1]){n.label=s[1],s=o;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(o);break}s[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],a=0}finally{i=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},Xs=function(t,e,i){if(i||2===arguments.length)for(var a,s=0,r=e.length;s<r;s++)!a&&s in e||(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))};function Js(t,e,i){var a=new X;return a.current=t,a.total=e,a.stage=i,a}var Zs=function(){function t(t,e,i,a,r,n,o,c,_,l,E,m,g){void 0===e&&(e=!1),void 0===o&&(o=""),void 0===c&&(c=!1),void 0===_&&(_=null),void 0===m&&(m=!1),void 0===g&&(g=null);var w,v=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._windowCloseWaitingJumpGateRequest=void 0,this._debugConsoleElement=void 0,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this._playTimeCalculator=void 0,this.userDefinedFunctions={},this.convertWwaNodes=function(t){var e,i=Bs(t);return"Program"===(e=i).type?e.body.map((function(t){return ks(t)})):[ks(e)]},this.mainCaller=function(){return v._main()},this.soundCheckCaller=function(){return v.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return v._keyStore.checkHitKey(tt.KEY_ESC)||v._keyStore.checkHitKey(tt.KEY_SHIFT)||v._keyStore.checkHitKey(tt.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ea(mt("wwa-wrapper")),window.addEventListener("click",(function(t){v._isActive=!1})),mt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),v._isActive=!0})),this._isActive=!0,null===i?(this._hasTitleImg=!1,this._cvsCover=mt("progress-panel"),(w=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?(mt("unstable-version-warning").textContent="この WWA Wing は [不安定版] です。",mt("version").textContent="WWA Wing Ver.3.13.0-unstable.based-on.3.12.10.p.1"):this._setLoadingMessage(w,0)}catch(t){}this._dumpElement=_;var S=window.AudioContext||window.webkitAudioContext;S&&(this.audioContext=new S,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var A=new Audio;"no"!==A.canPlayType("audio/mpeg")&&""!==A.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new M,this._isURLGateEnable=e,this._isClassicModeEnable=a,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new p(0,0,0,0),o?"/"!==o[o.length-1]&&(o+="/"):o="./audio/",this._audioDirectory=o,this._bottomButtonType=n?h.GOTO_WWA:h.BATTLE_REPORT;var P=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===I.GAME){if(this.userDevice.os===T.NINTENDO)H.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===C.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case I.VR:case I.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(mt("cell-save").textContent=j.QUICK_SAVE,this._usePassword?mt("cell-load").textContent=j.PASSWORD:mt("cell-load").textContent=j.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:mt("cell-gotowwa").textContent=j.GOTO_WWA;break;case h.BATTLE_REPORT:mt("cell-gotowwa").textContent=j.BATTLE_REPORT;break;case h.GAME_END:mt("cell-gotowwa").textContent=j.GAME_END}this._loadHandler=function(t){var e;v._wwaData=t,v._wwaData.isItemEffectEnabled=r;try{v._hasTitleImg?mt("version").textContent+=" (Map data Ver. "+Math.floor(v._wwaData.version/10)+"."+ +v._wwaData.version%10+")":v._setLoadingMessage(w,1)}catch(t){}var i=mt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(v._wwaData.mapCGName),v._wwaData.mapCGName=i.join("/"),v._playTimeCalculator=new ut,v._restartData=JSON.parse(JSON.stringify(v._wwaData)),v.checkOriginalMapString=v._generateMapDataHash(v._restartData),v.initCSSRule(),v._setProgressBar(Js(0,4,V.GAME_INIT)),v._setLoadingMessage(w,2);var a=new Image;a.src=v._wwaData.mapCGName,a.addEventListener("error",(function(){v._setErrorMessage("画像ファイル「"+v._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",w)}));var n=v._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),o=function(t){t.style.backgroundImage="url("+n+")"};Array.prototype.forEach.call(vt("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(v._wwaData.imgItemboxX*H.CHIP_SIZE,"px -").concat(v._wwaData.imgItemboxY*H.CHIP_SIZE,"px"),t.style.backgroundImage="url("+n+")"})),Array.prototype.forEach.call(vt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+n+")"})),Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+H.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(vt(".item-cell>.item-disp"),o),Array.prototype.forEach.call(vt("div.wide-cell-row>.status-icon"),o),v.setStatusIconCoord(U.ENERGY,new d(v._wwaData.imgStatusEnergyX,v._wwaData.imgStatusEnergyY)),v.setStatusIconCoord(U.STRENGTH,new d(v._wwaData.imgStatusStrengthX,v._wwaData.imgStatusStrengthY)),v.setStatusIconCoord(U.DEFENCE,new d(v._wwaData.imgStatusDefenceX,v._wwaData.imgStatusDefenceY)),v.setStatusIconCoord(U.GOLD,new d(v._wwaData.imgStatusGoldX,v._wwaData.imgStatusGoldY)),v._setProgressBar(Js(1,4,V.GAME_INIT)),v._setLoadingMessage(w,3),v._mapIDTableCreate(),v._replaceAllRandomObjects();var h=(new Date).getTime();console.log("Loading Complete!"+(h-P)+"ms"),v._cvs=mt("wwa-map");var _=v._cvs.getContext("2d",{alpha:!1});_.fillStyle="rgba( 255, 255, 255, 0.5)",_.fillRect(0,0,440,440);var l=new f(v,v._wwaData.playerX,v._wwaData.playerY);v._camera=new Dt(l),v._itemMenu=new Qe;var S=new p(v._wwaData.statusEnergy,v._wwaData.statusStrength,v._wwaData.statusDefence,v._wwaData.statusGold);v._player=new xt(v,l,v._camera,S,v._wwaData.statusEnergyMax,v._wwaData.moves,v._wwaData.gameSpeedIndex),v._objectMovingDataManager=new Rt(v,v._player),v._camera.setPlayer(v._player),v._keyStore=new rt,v._mouseStore=new ct,m?(v._virtualPadButtonElements={BUTTON_ENTER:mt("wwa-enter-button"),BUTTON_ESC:mt("wwa-esc-button"),BUTTON_FAST:mt("wwa-fast-button"),BUTTON_SLOW:mt("wwa-slow-button"),BUTTON_LEFT:mt("wwa-left-button"),BUTTON_UP:mt("wwa-up-button"),BUTTON_RIGHT:mt("wwa-right-button"),BUTTON_DOWN:mt("wwa-down-button")},v._virtualPadStore=new dt(v._virtualPadButtonElements,Ze(),mt("wwa-virtualpad-right"),mt("wwa-virtualpad-left"),v._setVirtualPadTouch.bind(v),v._setVirtualPadLeave.bind(v)),function(t,e){if(null===t)return;var i=document.createElement("button");i.classList.add("wwa-virtualpad-toggle-button"),i.textContent="仮想パッド表示切り替え",i.addEventListener("click",e),t.appendChild(i)}(g,(function(){v._virtualPadStore.toggleVisible()}))):(v._virtualPadButtonElements=null,v._virtualPadStore=new dt({})),v._debugConsoleElement=function(t){if(null===t)return;var e=document.createElement("section");e.setAttribute("id","wwa-debug-console");var i=document.createElement("textarea");i.setAttribute("rows","10"),i.setAttribute("cols","60"),i.textContent='if(v[0] ==0 || AT == 80) {\n MSG("HOGE");\n}';var a=function(t){return t.stopPropagation()};i.addEventListener("keydown",a),i.addEventListener("keypress",a),i.addEventListener("keyup",a),i.classList.add("console-text-area"),e.appendChild(i);var s=document.createElement("button");return s.classList.add("script-running-button"),s.textContent="実行(X)",e.appendChild(s),t.appendChild(e),e}(mt("wwa-debug-console-area")),null===(e=v._debugConsoleElement)||void 0===e||e.querySelector(".script-running-button").addEventListener("click",(function(){v._debugEvalString()})),v._gamePadStore=new ht,v._pages=[],v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._yesNoChoiceCallInfo=O.NONE,v._prevFrameEventExected=!1,v._isLastPage=!1,v._reservedPartsAppearances=[],v._reservedJumpDestination=void 0,v._shouldSetNextPage=!1,v._passwordLoadExecInNextFrame=!1,v._messageWindow=new Ve(v,50,180,340,0,v._wwaData.mapCGName,!1,!0,!1,mt("wwa-wrapper")),v._scoreWindow=new We(v,new d(50,50),!1,mt("wwa-wrapper")),v._wwaSave=new Di(Ws,Ws._wwaData.worldName,Ws._wwaData.worldPassNumber,v._checkSaveDataCompatibility.bind(v),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Ci.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Ci.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Ci.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),v._isDisallowLoadOldSave=c,v._messageWindow.setWWASave(v._wwaSave),oi.setRestartData(v._restartData,v._wwaData),v.clearFaces();var A=mt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof A&&(v._useSuspend=!0,A)){var C=oi.getStartWWAData(A);v._restartData!==C&&(v._applyQuickLoad(C),v._wwaSave.resumeStart())}var N=mt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==N&&v._wwaSave.setAutoSaveInterval(0|Number(N));var b=mt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(v._useLookingAround=!(b&&b.match(/false/i)),v._setProgressBar(Js(2,4,V.GAME_INIT)),v._setLoadingMessage(w,4),window.addEventListener("keydown",(function(t){if(v._isActive){if(v.userDevice.os===T.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setPressInfo(t.keyCode),t.keyCode!==tt.KEY_F5?v._player.isWaitingMessage()?t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_SPACE||t.preventDefault():v._player.isWaitingPasswordWindow()||t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_1&&t.keyCode!==tt.KEY_2&&t.keyCode!==tt.KEY_3&&t.keyCode!==tt.KEY_A&&t.keyCode!==tt.KEY_C&&t.keyCode!==tt.KEY_D&&t.keyCode!==tt.KEY_E&&t.keyCode!==tt.KEY_M&&t.keyCode!==tt.KEY_N&&t.keyCode!==tt.KEY_Q&&t.keyCode!==tt.KEY_S&&t.keyCode!==tt.KEY_W&&t.keyCode!==tt.KEY_X&&t.keyCode!==tt.KEY_Y&&t.keyCode!==tt.KEY_Z&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_F1&&t.keyCode!==tt.KEY_F2&&t.keyCode!==tt.KEY_F3&&t.keyCode!==tt.KEY_F4&&t.keyCode!==tt.KEY_F6&&t.keyCode!==tt.KEY_F7&&t.keyCode!==tt.KEY_F8&&t.keyCode!==tt.KEY_F12&&t.keyCode!==tt.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(v._isActive){if(v.userDevice.os===T.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setReleaseInfo(t.keyCode),t.keyCode===tt.KEY_F5?t.preventDefault():t.keyCode!==tt.KEY_DOWN&&t.keyCode!==tt.KEY_LEFT&&t.keyCode!==tt.KEY_RIGHT&&t.keyCode!==tt.KEY_UP&&t.keyCode!==tt.KEY_SHIFT&&t.keyCode!==tt.KEY_ENTER&&t.keyCode!==tt.KEY_1&&t.keyCode!==tt.KEY_2&&t.keyCode!==tt.KEY_3&&t.keyCode!==tt.KEY_A&&t.keyCode!==tt.KEY_C&&t.keyCode!==tt.KEY_D&&t.keyCode!==tt.KEY_E&&t.keyCode!==tt.KEY_M&&t.keyCode!==tt.KEY_N&&t.keyCode!==tt.KEY_Q&&t.keyCode!==tt.KEY_S&&t.keyCode!==tt.KEY_W&&t.keyCode!==tt.KEY_X&&t.keyCode!==tt.KEY_Y&&t.keyCode!==tt.KEY_Z&&t.keyCode!==tt.KEY_ESC&&t.keyCode!==tt.KEY_F1&&t.keyCode!==tt.KEY_F3&&t.keyCode!==tt.KEY_F4&&t.keyCode!==tt.KEY_F6&&t.keyCode!==tt.KEY_F7&&t.keyCode!==tt.KEY_F8&&t.keyCode!==tt.KEY_F9&&t.keyCode!==tt.KEY_F12&&t.keyCode!==tt.KEY_SPACE||v._player.isWaitingMessage()||v._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){v._isActive&&t.preventDefault()})),v._mouseControllerElement=mt("wwa-controller"),v._mouseControllerElement.addEventListener("mousedown",(function(t){if(v._isActive&&1===t.which){if(v._mouseStore.getMouseState()!==at.NONE)return void t.preventDefault();var e=St(t.clientX,t.clientY),i=v._player.getDrawingCenterPosition(),a=e.substract(i),s=Math.abs(a.x),r=Math.abs(a.y),n=void 0,o=!1;if(s<H.CHIP_SIZE&&r<H.CHIP_SIZE){switch(i.x/H.CHIP_SIZE|0){case 0:o=!0,n=u.LEFT;break;case H.H_PARTS_NUM_IN_WINDOW-1:o=!0,n=u.RIGHT}switch(i.y/H.CHIP_SIZE|0){case 0:o=!0,n=u.UP;break;case H.V_PARTS_NUM_IN_WINDOW-1:o=!0,n=u.DOWN}}o||(a.y>0&&r>s?n=u.DOWN:a.y<0&&r>s?n=u.UP:a.x>0&&r<s?n=u.RIGHT:a.x<0&&r<s&&(n=u.LEFT)),v._mouseStore.setPressInfo(n,0)}})),v._mouseControllerElement.addEventListener("mouseleave",(function(t){v._mouseStore.clear()})),v._mouseControllerElement.addEventListener("mouseup",(function(t){v._isActive&&1===t.which&&(v._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(v.audioContext){var x=function(){v.audioContext.createBufferSource().start(0),v._mouseControllerElement.removeEventListener("touchstart",x),x=null};v._mouseControllerElement.addEventListener("touchstart",x)}v._mouseControllerElement.addEventListener("touchstart",(function(t){if(v._isActive)if(v._mouseStore.getMouseState()===at.NONE){for(var e=t.changedTouches,i=e.length,a=0;a<i;a++){var s=e[a],r=St(s.clientX,s.clientY),n=v._player.getDrawingCenterPosition(),o=r.substract(n),c=Math.abs(o.x),h=Math.abs(o.y),_=void 0,l=!1;if(c<H.CHIP_SIZE&&h<H.CHIP_SIZE){switch(n.x/H.CHIP_SIZE|0){case 0:l=!0,_=u.LEFT;break;case H.H_PARTS_NUM_IN_WINDOW-1:l=!0,_=u.RIGHT}switch(n.y/H.CHIP_SIZE|0){case 0:l=!0,_=u.UP;break;case H.V_PARTS_NUM_IN_WINDOW-1:l=!0,_=u.DOWN}}l||(o.y>0&&h>c?_=u.DOWN:o.y<0&&h>c?_=u.UP:o.x>0&&h<c?_=u.RIGHT:o.x<0&&h<c&&(_=u.LEFT)),v._mouseStore.setPressInfo(_,s.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var M=function(t){if(v._isActive)for(var e=0;e<t.changedTouches.length;e++)if(v._mouseStore.getTouchID()===t.changedTouches[e].identifier){v._mouseStore.setReleaseInfo(),t.preventDefault();break}};v._mouseControllerElement.addEventListener("touchend",M),v._mouseControllerElement.addEventListener("touchcancel",M)}mt("button-load").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.QUICK_LOAD)})),mt("button-save").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.QUICK_SAVE)})),mt("button-restart").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.RESTART_GAME)})),mt("button-gotowwa").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(D.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(vt(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){v._displayHelp()}))})),v._frameCoord=new d(H.IMGPOS_DEFAULT_FRAME_X,H.IMGPOS_DEFAULT_YESNO_Y),v._battleEffectCoord=new d(H.IMGPOS_DEFAULT_BATTLE_EFFECT_X,H.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),v._battleEstimateWindow=new Ye(v,v._wwaData.mapCGName,mt("wwa-wrapper")),v._passwordWindow=new Je(v,mt("wwa-wrapper"),c),v._monsterWindow=new ke(v,new d(50,180),340,60,!1,mt("wwa-wrapper"),v._wwaData.mapCGName),v._setProgressBar(Js(3,4,V.GAME_INIT)),v._isLoadedSound=!1,v._temporaryInputDisable=!1,v._paintSkipByDoorOpen=!1,v._clearFacesInNextFrame=!1,v._useConsole=!1,v.wwaCustomEvent("wwa_startup"),v._cgManager=new Ot(_,v._wwaData.mapCGName,v._frameCoord,(function(){v._isSkippedSoundMessage=!0;var t=function(){switch(v.userDevice.device){case I.PC:v.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case I.SP:v.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}},e=v.resolveSystemMessage(s.CONFIRM_LOAD_SOUND);if("ON"===e)return v._isLoadedSound=!0,t(),v._setLoadingMessage(w,V.AUDIO),v.loadSound(),void window.requestAnimationFrame(v.soundCheckCaller);if("OFF"===e)return v._isLoadedSound=!1,t(),void v.openGameWindow();if(v._isSkippedSoundMessage=!1,v._hasTitleImg||w.clearRect(0,0,H.SCREEN_WIDTH,H.SCREEN_HEIGHT),v._usePassword){var i=e;E&&(i+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),v._messageWindow.setMessage(i),v._messageWindow.show(),v._setProgressBar(Js(4,4,V.GAME_INIT));var a=setInterval((function(){v._keyStore.update(),v._gamePadStore.update(),v._virtualPadStore.update(),v._yesNoJudgeInNextFrame===y.UNSELECTED&&(v._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||v._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||v._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||v._virtualPadStore.checkTouchButton("BUTTON_ENTER")?v._yesNoJudgeInNextFrame=y.YES:(v._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||v._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||v._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||v._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(v._yesNoJudgeInNextFrame=y.NO)),v._yesNoJudgeInNextFrame===y.YES?(clearInterval(a),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!0,v._setLoadingMessage(w,V.AUDIO),v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)}),H.YESNO_PRESS_DISP_FRAME_NUM*H.DEFAULT_FRAME_INTERVAL)):v._yesNoJudgeInNextFrame===y.NO&&(clearInterval(a),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!1,v.openGameWindow()}),H.YESNO_PRESS_DISP_FRAME_NUM*H.DEFAULT_FRAME_INTERVAL))}),H.DEFAULT_FRAME_INTERVAL)}else clearInterval(a),v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=y.UNSELECTED,v._yesNoJudgeInNextFrame=y.UNSELECTED,v._isLoadedSound=!0,v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)})),v.wwaCustomEvent("wwa_start")};var N=new ea;N.addListener("mapData",(function(t){return v._loadHandler(t)})),N.addListener("progress",(function(t){return v._setProgressBar(t)})),N.addListener("error",(function(t){return v._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,w)})),new ta(t,N).requestAndLoadMapData().then((function(){return Ks(v,void 0,void 0,(function(){var t;return js(this,(function(e){switch(e.label){case 0:return this._canDisplayUserVars=E,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[4,l?sa(l):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[3,2];case 1:t=e.sent(),this.setUserVarStatus(t,l),e.label=2;case 2:return[2]}}))}))})),Ks(v,void 0,void 0,(function(){var t,e,i,a=this;return js(this,(function(s){switch(s.label){case 0:return[4,sa("./script/script_file_list.json")];case 1:return t=s.sent(),e=[],console.log(t),"data"===(null==t?void 0:t.kind)&&Array.isArray(t.data)&&t.data.map((function(t){e.push(function(t){return Gs(void 0,void 0,void 0,(function(){var e;return Hs(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,fetch(t)];case 1:return 200!==(e=i.sent()).status&&304!==e.status?[3,3]:[4,new Response(e.body).text()];case 2:return[2,{kind:"data",data:i.sent()}];case 3:return[2,{kind:"httpError",errorMessage:"ファイル ".concat(t," が読み込めませんでした。ステータスコード: ").concat(e.status)}];case 4:return[3,6];case 5:return[2,{kind:"otherError",errorMessage:i.sent().message}];case 6:return[2]}}))}))}(t))})),[4,Promise.all(e)];case 2:return s.sent().forEach((function(t){try{a.setUsertScript(t)}catch(t){console.error(t.message)}})),(i=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_WWA_START)&&this.evalCalcWwaNodeGenerator.evalWwaNode(i),[2]}}))})),this.evalCalcWwaNodeGenerator=new Fs(this)}return t.prototype.setEvalCalCWwaNodeReadOnlyItemValue=function(t,e){this.evalCalcWwaNodeGenerator.setReadOnlyItemValue(t,e)},t.prototype.callGetItemUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callGetItemFullUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GET_ITEM_FULL;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callUseItemUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_USE_ITEM;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callJumpGateUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_JUMPGATE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.callMoveUserDefineFunction=function(){var t=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_MOVE;t&&this.evalCalcWwaNodeGenerator.evalWwaNode(t)},t.prototype.getUserScript=function(t){return this.userDefinedFunctions&&this.userDefinedFunctions[t]||null},t.prototype.setUsertScript=function(t){var e=this;if("data"===t.kind){var i=this.convertWwaNodes(t.data);console.log(i),i.forEach((function(t){if("DefinedFunction"===t.type&&e.userDefinedFunctions){var i=t.functionName;e.userDefinedFunctions[i]=t.body}}))}else console.error(t)},t.prototype.setUserVarStatus=function(t,e){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return this._userVarNameListRequestError=t,void this._updateVarDumpInformationArea(this._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return this._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(e," が正しい形式で書かれていません。")},void this._updateVarDumpInformationArea(this._userVarNameListRequestError.errorMessage,!0);if(this._userVarNameList=this.convertUserVariableNameListToArray(t.data),null!==this._dumpElement)for(var i=function(){var t=s.toString(10);if(!a._userVarNameList[s])return"continue";var e=".var-index".concat(t),i=a._dumpElement.querySelector(e),r=i.querySelector("".concat(e," > div"));r.textContent=a._userVarNameList[s],i.setAttribute("data-labelled-var-index","true"),i.addEventListener("mouseover",(function(){return r.removeAttribute("aria-hidden")})),i.addEventListener("mouseleave",(function(){return r.setAttribute("aria-hidden","true")}))},a=this,s=0;s<H.USER_VAR_NUM;s++)i()}else this._updateVarDumpInformationArea(t.errorMessage,!1)},t.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(H.USER_VAR_NUM),i=0;i<H.USER_VAR_NUM;i++)e[i]=void 0;return Object.keys(t).forEach((function(i){var a=parseInt(i,10);"string"!=typeof t[i]||"string"!=typeof i||isNaN(a)||a<0||a>=H.USER_VAR_NUM||(e[a]=t[i])})),e},t.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=H.LOAD_STAGE_MAX_EXCEPT_AUDIO?(mt("progress-message-container").textContent=t.stage===H.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:et[t.stage],mt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(H.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*H.MAP_WINDOW_WIDTH+"px",mt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(H.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?mt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":mt("progress-message-container").textContent="ゲームデータを読み込んでいます。",mt("progress-bar-audio").style.width=t.current*H.MAP_WINDOW_WIDTH/t.total+"px",mt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},t.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=Z.TITLE+"px "+H.LOADING_FONT,t.fillText(it[0],J.TITLE_X,J.TITLE_Y),t.font=Z.FOOTER+"px "+H.LOADING_FONT,t.fillText("WWA Wing Ver.3.13.0-unstable.based-on.3.12.10.p.1",J.FOOTER_X,J.COPYRIGHT_Y);else if(e<=it.length)t.font=Z.LOADING+"px "+H.LOADING_FONT,e>=2&&(t.clearRect(J.LOADING_X,J.LOADING_Y+J.LINE*(e-3),H.SCREEN_WIDTH-J.LOADING_X,J.LINE),t.fillText(it[e-1]+" Complete!",J.LOADING_X,J.LOADING_Y+J.LINE*(e-2))),e<it.length&&t.fillText(it[e],J.LOADING_X,J.LOADING_Y+J.LINE*(e-1)),1==e&&(t.font=Z.FOOTER+"px "+H.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,J.FOOTER_X,J.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",J.FOOTER_X,J.WORLD_Y+J.LINE));else{var i;i=this._isSkippedSoundMessage?J.LOADING_Y+J.LINE*(it.length-1):J.FOOTER_Y,e<=V.AUDIO?t.fillText("Now Sound data Loading .....",J.LOADING_X,i):(t.clearRect(J.LOADING_X,i-J.LINE,H.SCREEN_WIDTH-J.LOADING_X,J.LINE),t.fillText("Now Sound data Loading ..... Complete!",J.LOADING_X,i))}},t.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,H.SCREEN_WIDTH,H.SCREEN_HEIGHT),e.font=Z.ERRROR+"px "+H.LOADING_FONT,t.split("\n").forEach((function(t,i){e.fillText(t,J.ERROR_X,J.ERROR_Y+J.LINE*i)})))},t.prototype.createSoundInstance=function(t){if(0!==t&&t!==k.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new xi(t,e,this.audioContext,this.audioGain)}},t.prototype.loadSound=function(){var t=this;this.sounds=new Array(H.SOUND_MAX+1),this.createSoundInstance(k.DECISION),this.createSoundInstance(k.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var i=this._wwaData.mapAttribute[e][H.ATR_SOUND];this.createSoundInstance(i)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][H.ATR_TYPE]!==H.OBJECT_RANDOM){i=this._wwaData.objectAttribute[e][H.ATR_SOUND];this.createSoundInstance(i)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var i=e.match(/^\$sound=(\d+)/);if(i&&!(i.length<2)){var a=parseInt(i[1],10);!isNaN(a)&&0<a&&a<k.NO_SOUND&&t.createSoundInstance(a)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},t.prototype.checkAllSoundLoaded=function(){var t=0,e=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(tt.KEY_SPACE)===$.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var a=1;a<=H.SOUND_MAX;a++){var s=this.sounds[a];void 0===s||s.isError()||(e++,s.hasData()&&t++)}if(t<e&&!this._soundLoadSkipFlag)return this._setProgressBar(Js(t,e,V.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Js(H.SOUND_MAX,H.SOUND_MAX,V.AUDIO)),this._setLoadingMessage(i,V.FINISH),this.openGameWindow()},t.prototype._setSoundLoadedCheckTimer=function(t){var e=this,i=this.sounds[t];i.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?i.hasData()?(i.play(e._wwaData.bgmDelayDurationMs),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):i.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},t.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},t.prototype.playSound=function(t,e){this._isLoadedSound?t<0||t>=H.SOUND_MAX?console.warn("サウンド番号が範囲外です。"):t>=k.BGM_LB&&this._wwaData.bgm===t||((t===k.NO_SOUND||t>=k.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].isPlaying()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==k.NO_SOUND&&(this.sounds[t].hasData()?t>=k.BGM_LB?(this.sounds[t].play(null!=e?e:this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=t):this.sounds[t].play():t>=k.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t)))):t===k.NO_SOUND?this._wwaData.bgm=0:t>=k.BGM_LB&&(this._wwaData.bgm=t)},t.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();mt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var i=mt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof i&&(this._useSuspend=!0,i)){var a=oi.getStartWWAData(i);this._restartData!==a&&(this._applyQuickLoad(a),this._wwaSave.resumeStart())}setTimeout((function(){mt("wwa-wrapper").removeChild(mt("wwa-cover")),t._main()}),H.SPLASH_SCREEN_DISP_MILLS)},t.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){mt("item"+(t-1)).classList.add("onpress"),this.playSound(k.DECISION);var e=this.resolveSystemMessage(s.CONFIRM_USE_ITEM);if("BLANK"===e){this._player.readyToUseItem(t);var i=this._player.useItem(),a=this.getObjectAttributeById(i,H.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(a),!1,!1,i,v.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(e,!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},t.prototype.onselectbutton=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var a=mt(R[t]);if(this.playSound(k.DECISION),this._itemMenu.close(),a.classList.add("onpress"),t===D.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case O.CALL_BY_QUICK_LOAD:case O.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case O.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case O.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case O.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case O.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case O.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case O.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===D.QUICK_SAVE)this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.generatePageAndReserveExecution("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_QUICK_SAVE));else if(t===D.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_RESTART_GAME;else if(t===D.GOTO_WWA)if(i)this._bottomButtonType!==h.GOTO_WWA&&mt(R[D.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=O.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=O.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},t.prototype.onpasswordloadcalled=function(){this._usePassword?(mt(R[D.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},t.prototype.onpasswordsavecalled=function(){mt(R[D.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_PASSWORD_SAVE)},t.prototype.onpasssuspendsavecalled=function(){mt(R[D.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=O.CALL_BY_SUSPEND)},t.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(k.DECISION),this._itemMenu.openView()},t.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){switch(t){case P.UP:this._player.speedUp();break;case P.DOWN:this._player.speedDown()}var e=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_CHANGE_SPEED;e&&this.evalCalcWwaNodeGenerator.evalWwaNode(e);var i=this.resolveSystemMessage(s.GAME_SPEED_CHANGED);"BLANK"!==i&&this.generatePageAndReserveExecution(i,!1,!0)}else{var a=this.resolveSystemMessage(s.GAME_SPEED_CHANGE_DISABLED);"BLANK"!==a&&this.generatePageAndReserveExecution(a,!1,!0)}},t.prototype.isBattleSpeedIndexForQuickBattle=function(t){return H.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},t.prototype._executeNode=function(t,e){var i,a=this;if(t instanceof xe)return null===(i=t.macro)||void 0===i||i.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),Xs([t],this._executeNode(t.next,e),!0);if(t instanceof be){if(!e)throw new Error("パーツ起因ページによる実行ではないため、Junctionノードの利用を想定していません。");var s=t.evaluateAndGetNextNode((function(){return a.generateTokenValues(e)}));return s?this._executeNode(s,e):[]}return[]},t.prototype._executeNodes=function(t,e){try{return{isError:!1,messages:this._executeNode(t,e)}}catch(t){return{isError:!0}}},t.prototype._main=function(){var t,e=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var i=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return e.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return i&&this._drawAll(),void window.requestAnimationFrame(this.mainCaller);if(this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1),this._pages.length>0&&this._shouldSetNextPage)for(this._shouldSetNextPage=!1;this._pages.length>0;){var a=this._pages.shift(),s=this._executeNodes(a.firstNode,a.extraInfo?{position:a.extraInfo.partsPosition,type:a.extraInfo.partsType,id:a.extraInfo.partsId}:void 0);if(!0===s.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var r=s.messages.filter((function(t){return!t.isEmpty()})),n=Boolean(a.scoreOptions);if(n&&0===r.length&&r.push(new xe("スコアを表示します。")),r.length>0){var o=r.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(o),this._messageWindow.setYesNoChoice(a.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,n,a.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),n&&(this._lastScoreOptions=a.scoreOptions,this.updateScore(a.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=a.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests();break}}if(this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(O.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{var c=this._player.getDir(),h=[NaN,NaN,tt.KEY_DOWN,NaN,tt.KEY_LEFT,NaN,tt.KEY_RIGHT,NaN,tt.KEY_UP,NaN][c];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(tt.KEY_LEFT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_UP)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_RIGHT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(tt.KEY_DOWN)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===at.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(h)?this._checkTurnKeyPressed()?this._player.setDir(c):(this._player.controll(c),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(tt.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(nt.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_DOWN")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(tt.KEY_1)===$.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(tt.KEY_2)===$.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(tt.KEY_3)===$.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(tt.KEY_Q)===$.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(tt.KEY_W)===$.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(tt.KEY_E)===$.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(tt.KEY_A)===$.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(tt.KEY_S)===$.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(tt.KEY_D)===$.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(tt.KEY_Z)===$.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(tt.KEY_X)===$.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(tt.KEY_C)===$.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(tt.KEY_I)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(P.DOWN):this._keyStore.getKeyState(tt.KEY_P)===$.KEYDOWN||this._keyStore.checkHitKey(tt.KEY_F2)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(P.UP):this._keyStore.getKeyState(tt.KEY_F1)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_M)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(tt.KEY_F3)?(this.playSound(k.DECISION),this.onselectbutton(D.QUICK_LOAD,!0)):this._keyStore.checkHitKey(tt.KEY_F4)?(this.playSound(k.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(tt.KEY_F5)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_ZR)?this.onselectbutton(D.QUICK_LOAD):this._keyStore.checkHitKey(tt.KEY_F6)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_ZL)?this.onselectbutton(D.QUICK_SAVE):this._keyStore.checkHitKey(tt.KEY_F7)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_R)?this.onselectbutton(D.RESTART_GAME):this._keyStore.checkHitKey(tt.KEY_F8)?this.onselectbutton(D.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(tt.KEY_F9)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(tt.KEY_V)?this._displayUserVars():this._keyStore.checkHitKey(tt.KEY_X)?this._debugConsoleElement&&this._debugEvalString():(this._keyStore.checkHitKey(tt.KEY_F12)||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_Y))&&this._displayHelp()),[{key:tt.KEY_A,func:"CALL_PUSH_A"},{key:tt.KEY_B,func:"CALL_PUSH_B"},{key:tt.KEY_C,func:"CALL_PUSH_C"},{key:tt.KEY_D,func:"CALL_PUSH_D"},{key:tt.KEY_E,func:"CALL_PUSH_E"},{key:tt.KEY_F,func:"CALL_PUSH_F"},{key:tt.KEY_G,func:"CALL_PUSH_G"},{key:tt.KEY_H,func:"CALL_PUSH_H"},{key:tt.KEY_I,func:"CALL_PUSH_I"},{key:tt.KEY_J,func:"CALL_PUSH_J"},{key:tt.KEY_K,func:"CALL_PUSH_K"},{key:tt.KEY_L,func:"CALL_PUSH_L"},{key:tt.KEY_M,func:"CALL_PUSH_M"},{key:tt.KEY_N,func:"CALL_PUSH_N"},{key:tt.KEY_O,func:"CALL_PUSH_O"},{key:tt.KEY_P,func:"CALL_PUSH_P"},{key:tt.KEY_Q,func:"CALL_PUSH_Q"},{key:tt.KEY_R,func:"CALL_PUSH_R"},{key:tt.KEY_S,func:"CALL_PUSH_S"},{key:tt.KEY_T,func:"CALL_PUSH_T"},{key:tt.KEY_U,func:"CALL_PUSH_U"},{key:tt.KEY_V,func:"CALL_PUSH_V"},{key:tt.KEY_W,func:"CALL_PUSH_W"},{key:tt.KEY_X,func:"CALL_PUSH_X"},{key:tt.KEY_Y,func:"CALL_PUSH_Y"},{key:tt.KEY_Z,func:"CALL_PUSH_Z"},{key:tt.KEY_ENTER,func:"CALL_PUSH_ENTER"},{key:tt.KEY_ESC,func:"CALL_PUSH_ESC"},{key:tt.KEY_SPACE,func:"CALL_PUSH_SPACE"},{key:tt.KEY_LEFT,func:"CALL_PUSH_LEFT"},{key:tt.KEY_RIGHT,func:"CALL_PUSH_RIGHT"},{key:tt.KEY_UP,func:"CALL_PUSH_UP"},{key:tt.KEY_DOWN,func:"CALL_PUSH_DOWN"}].forEach((function(t){if(e._keyStore.checkHitKey(t.key)){var i=e.userDefinedFunctions&&e.userDefinedFunctions[t.func];i&&e.evalCalcWwaNodeGenerator.evalWwaNode(i)}}))}this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame()}else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update(),this._player.getPosition().isJustPosition()&&this._dispatchPlayerAndObjectsStopTimeRequests();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(tt.KEY_LEFT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(tt.KEY_UP)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(tt.KEY_RIGHT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(tt.KEY_DOWN)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===y.UNSELECTED&&(this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=y.YES:(this._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=y.NO)),(this._yesNoJudge===y.YES||this._yesNoJudge===y.NO)&&(this.playSound(k.DECISION),this._yesNoDispCounter=H.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(tt.KEY_LEFT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(tt.KEY_UP)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(tt.KEY_RIGHT)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(tt.KEY_DOWN)||this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER"))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(tt.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var _=0;_<R.length;_++){(f=mt(R[_])).classList.contains("onpress")&&f.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(k.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var l=this._keyStore.getKeyStateForMessageCheck(tt.KEY_ENTER),p=this._keyStore.getKeyStateForMessageCheck(tt.KEY_SPACE),d=this._keyStore.getKeyStateForMessageCheck(tt.KEY_ESC);if(l===$.KEYDOWN||l===$.KEYPRESS_MESSAGECHANGE||p===$.KEYDOWN||p===$.KEYPRESS_MESSAGECHANGE||d===$.KEYDOWN||d===$.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===at.MOUSEDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(_=0;_<R.length;_++){var f;(f=mt(R[_])).classList.contains("onpress")&&f.classList.remove("onpress")}this._setNextPage()}}if(null===(t=this._inlineUserVarViewer)||void 0===t?void 0:t.isVisible){var E=!1;this._keyStore.getKeyState(tt.KEY_DOWN)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,E=!0),this._keyStore.getKeyState(tt.KEY_UP)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,E=!0),this._keyStore.getKeyState(tt.KEY_RIGHT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,E=!0),this._keyStore.getKeyState(tt.KEY_LEFT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,E=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=H.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>H.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=H.USER_VAR_NUM),E&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(tt.KEY_V)===$.KEYDOWN&&this._setNextPage()}}else this._player.isWaitingEstimateWindow()?(this._keyStore.getKeyState(tt.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(tt.KEY_SPACE)===$.KEYDOWN||this._gamePadStore.buttonTrigger(nt.BUTTON_INDEX_A,nt.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._shouldTreatWillMessageDisplay(this._pages)||this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWaitingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var m=this.checkMap();m||this.checkObject(),this._prevFrameEventExected=m}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==y.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=N.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*H.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&mt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&mt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&mt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&mt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&(this._player.decrementMoveObjectAutoExecTimer(),this._player.isWaitingMoveMacro()||this._dispatchPlayerAndObjectsStopTimeRequests()),this._stopUpdateByLoadFlag?this._fadeout((function(){if(e._loadType===N.QUICK_LOAD){e._quickLoad(),e.wwaCustomEvent("wwa_quickload");var t=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_QUICKLOAD;t&&e.evalCalcWwaNodeGenerator.evalWwaNode(t)}else if(e._loadType===N.RESTART_GAME){e.restartGame(),e.wwaCustomEvent("wwa_restert");var i=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_RESTART;i&&e.evalCalcWwaNodeGenerator.evalWwaNode(i)}else if(e._loadType===N.PASSWORD){e._applyQuickLoad(e._passwordSaveExtractData),e._passwordSaveExtractData=void 0,e.wwaCustomEvent("wwa_passwordload");var a=e.userDefinedFunctions&&e.userDefinedFunctions.CALL_PASSWORDLOAD;a&&e.evalCalcWwaNodeGenerator.evalWwaNode(a)}setTimeout(e.mainCaller,H.DEFAULT_FRAME_INTERVAL,e)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(_=0;_<H.USER_VAR_NUM;_++){var g=_.toString(10);this._dumpElement.querySelector(".var".concat(g)).textContent=this._wwaData.userVar[_]+""}var w=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_FRAME;w&&this.evalCalcWwaNodeGenerator.evalWwaNode(w)},t.prototype.vibration=function(t){this._gamePadStore.vibration(t)},t.prototype._drawAll=function(){var t,e,i=this._camera.getPosition().getPartsCoord(),a=this._camera.getPosition().getOffsetCoord(),s=H.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,H.MAP_WINDOW_WIDTH,H.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,H.MAP_WINDOW_WIDTH,H.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var n=this._camera.getPreviousPosition().getPartsCoord(),o=this._camera.getPreviousPosition().getOffsetCoord();s=this._camera.getTransitionStepNum()*H.CHIP_SIZE}var c=!1;if(s!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=s,c=!0),i.x===this._cgManager.cpPartsLog.x&&i.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=i.x,this._cgManager.cpPartsLog.y=i.y,c=!0),c&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(n,o,s,!0),this._drawPlayer(n,o,s,!0),this._drawObjects(n,o,s,!0),this._camera.isFinalStep()))var h=255,u=setInterval((function(){var t=mt("wwa-fader");if((h-=3*H.FADEOUT_SPEED)<=0)return clearInterval(u),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=h/255+""}),20);this._drawMap(i,a,s,!1,c),this._drawPlayer(i,a,s),this._drawObjects(i,a,s,!1,c),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:r.x,e=this._player.isTurn()?this._monster.position.y:r.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,H.CHIP_SIZE*(t-i.x)-a.x,H.CHIP_SIZE*(e-i.y)-a.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},t.prototype._drawMap=function(t,e,i,a,s){if(void 0===a&&(a=!1),void 0===s&&(s=!1),void 0!==t){var r,n=Math.max(0,t.x-1),o=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),c=Math.max(0,t.y-1),h=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW);if(r=0,a)for(var u=n;u<=o;u++)for(var _=c;_<=h;_++){var l=this._wwaData.map[_][u],p=this._wwaData.mapAttribute[l][H.ATR_X]/H.CHIP_SIZE,d=this._wwaData.mapAttribute[l][H.ATR_Y]/H.CHIP_SIZE,f=H.CHIP_SIZE*(u-t.x)-e.x,E=H.CHIP_SIZE*(_-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,f,E,i)}else{for(u=n;u<=o;u++)for(_=c;_<=h;_++){l=this._wwaData.map[_][u];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,s=!0),r++}if(s){this._cgManager.clearBackCanvasWithLowerYLimit(i);for(u=n;u<=o;u++)for(_=c;_<=h;_++){l=this._wwaData.map[_][u],p=this._wwaData.mapAttribute[l][H.ATR_X]/H.CHIP_SIZE,d=this._wwaData.mapAttribute[l][H.ATR_Y]/H.CHIP_SIZE,f=H.CHIP_SIZE*(u-t.x)-e.x,E=H.CHIP_SIZE*(_-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,f,E,i)}}this._cgManager.drawBackCanvas()}}},t.prototype._drawPlayer=function(t,e,i,a){if(void 0===a&&(a=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var s,r=this._player.getPosition().getPartsCoord(),n=this._player.getPosition().getOffsetCoord(),o=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],c=(r.x-t.x)*H.CHIP_SIZE+n.x-e.x,h=(r.y-t.y)*H.CHIP_SIZE+n.y-e.y;if(this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()){s=this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]}else s=this._player.isMovingImage()?this._wwaData.playerImgPosX+o+1:this._wwaData.playerImgPosX+o;a?this._cgManager.drawCanvasWithLowerYLimit(s,this._wwaData.playerImgPosY,c,h,i):this._cgManager.drawCanvasWithUpperYLimit(s,this._wwaData.playerImgPosY,c,h,i)}},t.prototype._drawObjects=function(t,e,i,a,s){if(void 0===a&&(a=!1),void 0===s&&(s=!1),void 0!==t){var r,n,o,c,h,u,_,l,p,f,E,y,g,w,v=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),A=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW),I=0,C=this._animationCounter>H.ANIMATION_REP_HALF_FRAME,O=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(a)for(f=v;f<=S;f++)for(E=A;E<=T;E++)O&&new d(f,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][f],r=new d(0,0),this._wwaData.objectAttribute[y][H.ATR_MOVE]!==b.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new d(f,E)))&&(r=p),h=H.CHIP_SIZE*(f-t.x)+r.x-e.x,u=H.CHIP_SIZE*(E-t.y)+r.y-e.y,n=C||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,_=this._wwaData.objectAttribute[y][H.ATR_TYPE],l=this._wwaData.objectAttribute[y][H.ATR_NUMBER],0===y||this._checkNoDrawObject(new d(f,E),_,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(C?1:0,o,c,h,u,i));else{var D,P,N,x,M,L=[],R=[];for(f=v;f<=S;f++)for(E=A;E<=T;E++)g=y=this._wwaData.mapObject[E][f],_=this._wwaData.objectAttribute[y][H.ATR_TYPE],l=this._wwaData.objectAttribute[y][H.ATR_NUMBER],this._checkNoDrawObject(new d(f,E),_,l)&&(g=0),P=this._wwaData.objectAttribute[y][H.ATR_MOVE]===b.STATIC,0!==g&&(N=!(!O||!new d(f,E).equals(this._monster.position)),P?R.push(new m(y,f,E,P,N)):(L.push(new m(y,f,E,P,N)),g=0),N&&(g=0)),this._cgManager.mapObjectCache[I]!==g&&(this._cgManager.mapObjectCache[I]=g,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(i),Array.prototype.push.apply(L,R)),M=L.length,x=0;x<M;x++)if(f=(D=L[x]).x,E=D.y,y=D.partsIDObj,P=D.isStatic,N=D.isFighting,h=H.CHIP_SIZE*(f-t.x)-e.x,u=H.CHIP_SIZE*(E-t.y)-e.y,P){if(N)continue;for(w=0;w<2;w++)n=!!w||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(w,o,c,h,u,i)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new d(f,E)))&&(h+=p.x,u+=p.y),n=C||0===this._wwaData.objectAttribute[y][H.ATR_X2]&&0===this._wwaData.objectAttribute[y][H.ATR_Y2],o=this._wwaData.objectAttribute[y][n?H.ATR_X:H.ATR_X2]/H.CHIP_SIZE,c=this._wwaData.objectAttribute[y][n?H.ATR_Y:H.ATR_Y2]/H.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(o,c,h,u,i);this._cgManager.drawObjectCanvas(C?1:0)}}},t.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},t.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},t.prototype._drawFrame=function(){this._cgManager.drawFrame()},t.prototype._checkNoDrawObject=function(t,e,i){var a=this._player.getPosition(),s=a.getPartsCoord();return!(!a.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===H.OBJECT_DOOR&&0===i||(e===H.OBJECT_STATUS||e===H.OBJECT_MESSAGE||e===H.OBJECT_ITEM||e===H.OBJECT_SELL||e===H.OBJECT_BUY||e===H.OBJECT_SELL||e===H.OBJECT_LOCALGATE))},t.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},t.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},t.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},t.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),i=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[i][H.ATR_TYPE]},t.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),i=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[i][H.ATR_TYPE]},t.prototype.getMapAttributeByPosition=function(t,e){var i=t.getPartsCoord(),a=this._wwaData.map[i.y][i.x];return this._wwaData.mapAttribute[a][e]},t.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,H.ATR_STRING)},t.prototype.getObjectAttributeByPosition=function(t,e){var i=t.getPartsCoord(),a=this._wwaData.mapObject[i.y][i.x];return this._wwaData.objectAttribute[a][e]},t.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},t.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},t.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][H.ATR_X]},t.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][H.ATR_Y]},t.prototype.getMessageById=function(t){return this._wwaData.message[t]},t.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},t.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var i=this._wwaData.map[t.y][t.x],a=this._wwaData.mapAttribute[i][H.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(v.MAP)!==i)&&(a===H.MAP_STREET?r=this._execMapStreetEvent(t,i,a):a===H.MAP_WALL?r=this._execMapWallEvent(t,i,a):a===H.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,i,a):a===H.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,i,a)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.MAP,i),r)},t.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var i=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.objectAttribute[i][H.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(v.OBJECT)===i||(a===H.OBJECT_NORMAL?this._execObjectNormalEvent(t,i,a):a===H.OBJECT_MESSAGE?this._execObjectMessageEvent(t,i,a):a===H.OBJECT_MONSTER?this._execObjectMonsterEvent(t,i,a):a===H.OBJECT_ITEM?this._execObjectItemEvent(t,i,a):a===H.OBJECT_DOOR?this._execObjectDoorEvent(t,i,a):a===H.OBJECT_STATUS?this._execObjectStatusEvent(t,i,a):a===H.OBJECT_BUY?this._execObjectBuyEvent(t,i,a):a===H.OBJECT_SELL?this._execObjectSellEvent(t,i,a):a===H.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,i,a):a===H.OBJECT_SCORE?this._execObjectScoreEvent(t,i,a):a===H.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,i,a):a===H.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,i,a),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.OBJECT,i))},t.prototype._execMapStreetEvent=function(t,e,i){var a=this._wwaData.mapAttribute[e][H.ATR_ITEM];if(0!==a&&!this._player.hasItem(a))return!1;this.reserveAppearPartsInNextFrame(t,g.MAP,e);var s=this._wwaData.mapAttribute[e][H.ATR_STRING],r=this._wwaData.message[s],n=this._wwaData.mapAttribute[e][H.ATR_NUMBER];return this._waitFrame+=n*H.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==n},t.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Me(e.firstNode)}),!1)},t.prototype._execMapWallEvent=function(t,e,i){var a=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(a,H.ATR_TYPE);if(0===a||s===H.OBJECT_NORMAL||s===H.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(a,H.ATR_ITEM))||this.getObjectAttributeById(s,H.ATR_MODE)===H.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,g.MAP,e);var r=this._wwaData.mapAttribute[e][H.ATR_STRING],n=this._wwaData.message[r];return this.generatePageAndReserveExecution(n,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),!1}return!1},t.prototype._execMapLocalGateEvent=function(t,e,i){var a=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][H.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][H.ATR_JUMP_Y];return s>H.RELATIVE_COORD_LOWER&&(s=t.x+s-H.RELATIVE_COORD_BIAS),r>H.RELATIVE_COORD_LOWER&&(r=t.y+r-H.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,g.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==a.x||r!==a.y)&&(this.reserveJumpInNextFrame(new f(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][H.ATR_SOUND]),!0)},t.prototype._execMapUrlGateEvent=function(t,e,i){var a=this._wwaData.mapAttribute[e][H.ATR_STRING];if(!this._isURLGateEnable)return!0;var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);if("BLANK"!==r)return this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0],!0;location.href=At(this._wwaData.message[a].split(/\s/g)[0])},t.prototype._execObjectNormalEvent=function(t,e,i){},t.prototype._execObjectMessageEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord(),n=this._wwaData.objectAttribute[e][H.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!1,!1,e,v.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][H.ATR_NUMBER]*H.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this.playSound(n)},t.prototype._execObjectStatusEvent=function(t,e,i){var a=new p(this._wwaData.objectAttribute[e][H.ATR_ENERGY],this._wwaData.objectAttribute[e][H.ATR_STRENGTH],this._wwaData.objectAttribute[e][H.ATR_DEFENCE],this._wwaData.objectAttribute[e][H.ATR_GOLD]),s=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[s],n=this._player.getStatusWithoutEquipments();if(a.strength>H.STATUS_MINUS_BORDER&&n.strength<a.strength-H.STATUS_MINUS_BORDER||a.defence>H.STATUS_MINUS_BORDER&&n.defence<a.defence-H.STATUS_MINUS_BORDER||a.gold>H.STATUS_MINUS_BORDER&&n.gold<a.gold-H.STATUS_MINUS_BORDER)return this.setPartsOnPosition(v.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();a.energy=a.energy>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.energy:a.energy,a.strength=a.strength>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.strength:a.strength,a.defence=a.defence>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.defence:a.defence,a.gold=a.gold>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-a.gold:a.gold,this._player.addStatusAll(a),this.setStatusChangedEffect(a),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][H.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]))},t.prototype._execObjectMonsterEvent=function(t,e,i){var a=this,s=new d(this._wwaData.objectAttribute[e][H.ATR_X],this._wwaData.objectAttribute[e][H.ATR_Y]),r=new p(this._wwaData.objectAttribute[e][H.ATR_ENERGY],this._wwaData.objectAttribute[e][H.ATR_STRENGTH],this._wwaData.objectAttribute[e][H.ATR_DEFENCE],this._wwaData.objectAttribute[e][H.ATR_GOLD]),n=this._wwaData.message[this._wwaData.objectAttribute[e][H.ATR_STRING]],o=this._wwaData.objectAttribute[e][H.ATR_ITEM];this._monster=new Mt(e,t,s,r,n,o,(function(){a._monsterWindow.hide(),a._dispatchWindowClosedTimeRequests()})),this._player.startBattleWith(this._monster)},t.prototype._execObjectBuyEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectSellEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectItemEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[a];try{var n=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-n.x)*H.CHIP_SIZE,c=(t.y-n.y)*H.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][H.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new d(o,c),itemBoxBackgroundImageCoord:new d(this._wwaData.imgItemboxX*H.CHIP_SIZE,this._wwaData.imgItemboxY*H.CHIP_SIZE)}:void 0),this.setPartsOnPosition(v.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][H.ATR_MODE]||(this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e))}catch(t){var h=this.resolveSystemMessage(s.ITEM_BOX_FULL);"BLANK"!==h&&this.generatePageAndReserveExecution(h,!1,!0)}this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectDoorEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_ITEM],s=this._wwaData.objectAttribute[e][H.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(a)&&(0===this._wwaData.objectAttribute[e][H.ATR_MODE]&&this._player.removeItemByPartsID(a),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),this._paintSkipByDoorOpen=!0)},t.prototype._execObjectYesNoChoiceEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING],s=this._wwaData.message[a],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,v.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype._execObjectLocalGateEvent=function(t,e,i){var a=this._player.getPosition().getPartsCoord();t.x!==a.x||t.y!==a.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][H.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][H.ATR_JUMP_Y];s>H.RELATIVE_COORD_LOWER&&(s=a.x+s-H.RELATIVE_COORD_BIAS),r>H.RELATIVE_COORD_LOWER&&(r=a.y+r-H.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,g.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==a.x||r!==a.y)&&(this.reserveJumpInNextFrame(new f(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND]))},t.prototype._execObjectUrlGateEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING];if(this._isURLGateEnable){var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);"BLANK"!==r?(this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=O.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0]):location.href=At(this._wwaData.message[a].split(/\s/g)[0])}},t.prototype._execObjectScoreEvent=function(t,e,i){var a=this._wwaData.objectAttribute[e][H.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[a],!1,!1,e,v.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][H.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][H.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][H.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][H.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][H.ATR_SOUND])},t.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var i=this._player.getStatus().calculateScore(e);this._scoreWindow.update(i)}},t.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD]))return"BLANK"!==(o=this.resolveSystemMessage(s.NO_MONEY))&&this._pages.push(new Pe(new xe(o),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(t.x-e.x)*H.CHIP_SIZE,a=(t.y-e.y)*H.CHIP_SIZE,r=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM],n=this._wwaData.objectAttribute[r][H.ATR_NUMBER];try{this._player.addItem(r,n,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new d(i,a),itemBoxBackgroundImageCoord:new d(this._wwaData.imgItemboxX*H.CHIP_SIZE,this._wwaData.imgItemboxY*H.CHIP_SIZE)}:void 0)}catch(t){var o;return"BLANK"!==(o=this.resolveSystemMessage(s.ITEM_BOX_FULL))&&this._pages.push(new Pe(new xe(o),!0,!1,!0)),{}}}var c=new p(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD]);return c.energy=c.energy>H.STATUS_MINUS_BORDER?H.STATUS_MINUS_BORDER-c.energy:c.energy,this.setStatusChangedEffect(c),this._player.addStatusAll(c),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:g.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},t.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===y.YES){if(this._yesNoChoiceCallInfo===O.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.MAP_URLGATE&&(location.href=At(this._yesNoURL));else if(this._yesNoChoiceCallInfo===O.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.OBJECT_BUY)if(this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]))this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new p(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.OBJECT,this._yesNoChoicePartsID);else{var i=this.resolveSystemMessage(s.NO_ITEM);"BLANK"!==i&&this._pages.push(new Pe(new xe(i),!0,!1,!0))}else if(t===H.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===H.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.CHOICE_YES,this._yesNoChoicePartsID):t===H.OBJECT_URLGATE&&(location.href=At(this._yesNoURL));else this._yesNoChoiceCallInfo===O.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===O.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),mt(R[D.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=N.QUICK_LOAD)):this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(O.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===O.CALL_BY_RESTART_GAME?(mt(R[D.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=N.RESTART_GAME):this._yesNoChoiceCallInfo===O.CALL_BY_END_GAME?(window.history.back(-1),mt(R[D.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===O.CALL_BY_GOTO_WWA?(location.href=At(H.WWA_HOME),mt(R[D.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_LOAD?(mt(R[D.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Ke.LOAD)):this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_SAVE?(mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(O.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Ke.SAVE)):this._yesNoChoiceCallInfo===O.CALL_BY_SUSPEND&&(mt(R[D.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(O.CALL_BY_SUSPEND));this._yesNoJudge=y.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===y.NO){if(this._yesNoChoiceCallInfo===O.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][H.ATR_TYPE],H.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===O.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][H.ATR_TYPE])===H.OBJECT_BUY||t===H.OBJECT_SELL||(t===H.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,g.CHOICE_NO,this._yesNoChoicePartsID):H.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===O.CALL_BY_ITEM_USE){mt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===O.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case O.NONE:mt(R[D.QUICK_LOAD]).classList.remove("onpress");break;case O.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=y.UNSELECTED,void this.onpasswordloadcalled();case O.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var a=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=y.UNSELECTED,a){case O.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case O.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===O.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=y.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());mt(R[D.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===O.CALL_BY_RESTART_GAME)mt(R[D.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_END_GAME)mt(R[D.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_GOTO_WWA)mt(R[D.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_LOAD)mt(R[D.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_PASSWORD_SAVE)mt(R[D.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===O.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=y.UNSELECTED,void this.onpasswordsavecalled();mt(R[D.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=y.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._messageWindow.setYesNoChoice(!1)}},t.prototype._dispatchWindowClosedTimeRequests=function(){if(this._windowCloseWaitingJumpGateRequest&&this.forcedJumpGate(this._windowCloseWaitingJumpGateRequest.x,this._windowCloseWaitingJumpGateRequest.y),this._windowCloseWaitingMessageDisplayRequests.length>0){var t=this._windowCloseWaitingMessageDisplayRequests.shift();this.generatePageAndReserveExecution(t,!1,!1)}},t.prototype._dispatchPlayerAndObjectsStopTimeRequests=function(){this._playerAndObjectsStopWaitingGameSpeedChangeRequest&&(this.setPlayerSpeedIndex(this._playerAndObjectsStopWaitingGameSpeedChangeRequest.speedIndex),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0),this._playerAndObjectsStopWaitingMessageDisplayRequests.length>0&&(this.generatePageAndReserveExecution(this._playerAndObjectsStopWaitingMessageDisplayRequests.join("<p>"),!1,!1),this._playerAndObjectsStopWaitingMessageDisplayRequests=[])},t.prototype._clearAllRequests=function(){this._playerAndObjectsStopWaitingMessageDisplayRequests=[],this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0,this._windowCloseWaitingJumpGateRequest=void 0,this._windowCloseWaitingMessageDisplayRequests=[]},t.prototype.reserveMessageDisplayWhenShouldOpen=function(t){this._player.isWaitingMessage()||this._player.isFighting()||this._player.isWaitingPasswordWindow()||this._player.isWaitingEstimateWindow()?this._windowCloseWaitingMessageDisplayRequests.push(t):this._player.isMoving()||this._player.isWaitingMoveMacro()?this._playerAndObjectsStopWaitingMessageDisplayRequests.push(t):this.generatePageAndReserveExecution(t,!1,!1)},t.prototype.generatePageAndReserveExecution=function(t,e,i,a,s,r,n){void 0===a&&(a=0),void 0===s&&(s=v.OBJECT),void 0===r&&(r=new d(0,0)),void 0===n&&(n=void 0);var o=this.generatePagesByRawMessage(t,a,s,r,i,e,n);this._pages=this._pages.concat(o),this._shouldSetNextPage=!0},t.prototype.generatePagesByRawMessage=function(t,e,i,a,s,r,n){var o=this,c=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>").split("\n").map((function(t){if(!t.startsWith("//"))return t.match(/\/\//)?It(It(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//").split("<script>"),h=c[0];if(c.length>1){var u=c[1];this._execEvalString(u)}if(""===h)return n?[new Pe(void 0,!0,!1,!1,n,{partsId:e,partsType:i,partsPosition:a})]:[];var _=h.split(/\<p\>/gi);return _.map((function(t,c){var h=void 0,u=void 0,l=void 0,p={id:e,type:i,position:a},d=o.parseMessageLines(t,e,i,a),f=[];return d.forEach((function(t,e){try{var i=0===e?void 0:d[e-1].type,a=f[f.length-1],s=o.createNewNode(t,!h||!Le(i),{triggerParts:p}),r=o.processConditionalExecuteMacroLine(s,t,a,f);r&&(l=r),i?o.connectOrMergeToPreviousNode(t,i,u,s,a,l,{triggerParts:p}):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new Pe(h,c===_.length-1,0===c&&r,s,0===c&&n,{partsId:e,partsType:i,partsPosition:a})}))},t.prototype.parseMessageLines=function(t,e,i,a){var s=this;return t.split("\n").map((function(t){var r=t.match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)(?:.*))/);if(!r||r.length<2)return t.startsWith("$")?void 0:{type:"text",text:t};var n=function(t,e,i,a,s){var r,n=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==n&&3===n.length||null!==(n=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===n.length))throw new Error("マクロではありません");var o=n[1],c="$".concat(o.toLowerCase()),h="$if"===c&&s.match(/,/)?L.LEGACY_IF:W[c],u=Boolean(h!==L.SHOW_STR&&h!==L.SHOW_STR2),_=(null!==(r=n[2])&&void 0!==r?r:"").split(",").map((function(t){return u?t.trim():t}));return new Re(t,e,i,a,void 0===h?L.UNDEFINED:h,_)}(s,e,i,a,r[1]);switch(n.macroType){case L.IF:case L.ELSE_IF:case L.ELSE:case L.END_IF:case L.SHOW_STR:case L.SHOW_STR2:return{type:n.macroType,text:t,macro:n};default:return{type:"normalMacro",text:t,macro:n}}})).filter(Boolean)},t.prototype.createNewNode=function(t,e,i){switch(t.type){case L.IF:return new be([{descriminant:Oe(t.macro.macroArgs[0])}]);case L.SHOW_STR:case L.SHOW_STR2:return e?new xe(this._generateShowStrString(t.macro.macroArgs,{triggerParts:i.triggerParts,version:t.type===L.SHOW_STR2?2:1})):void 0;case"text":return e?new xe(t.text):void 0;case"normalMacro":return e?new xe("",[t.macro]):void 0;default:return}},t.prototype.processConditionalExecuteMacroLine=function(t,e,i,a){var s=0===a.length;switch(e.type){case L.IF:return void a.push(t);case L.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void i.appendBranch({descriminant:Oe(e.macro.macroArgs[0])});case L.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void i.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case L.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return a.pop()}},t.prototype.connectOrMergeToPreviousNode=function(t,e,i,a,s,r,n){var o=Le(e);switch(e){case L.IF:case L.ELSE_IF:case L.ELSE:if(!a||!s)return;var c=s.getLastUnconnectedBranch();if(!c)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(c.next=a);case L.END_IF:if(!(a&&r instanceof be))return;for(var h=0;h<r.branches.length;h++){var u=r.branches[h].next;u?this.connectToFinalNode(u,a):r.branches[h]=a}return void(r.hasElseBranch()||r.branches.push({next:a,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(o&&i instanceof xe))return;var _=!i.isEmpty();t.type===L.SHOW_STR||t.type===L.SHOW_STR2?i.appendMessage(this._generateShowStrString(t.macro.macroArgs,{triggerParts:n.triggerParts,version:t.type===L.SHOW_STR2?2:1}),_):"text"===t.type?i.appendMessage(t.text,_):"normalMacro"===t.type?i.macro.push(t.macro):i.next=a}},t.prototype.connectToFinalNode=function(t,e){for(var i=t;;)if(i instanceof be&&(i=i.branches[0].next),i instanceof xe){if(!i.next)return void(i.next=e);i=i.next}},t.prototype.appearParts=function(t){var e,i,a,s,r,n,o=t.pos,c=t.triggerType,h=t.triggerPartsId,u=c===g.CHOICE_NO?H.APPERANCE_PARTS_MIN_INDEX_NO:H.APPERANCE_PARTS_MIN_INDEX,_=c===g.CHOICE_YES?H.APPERANCE_PARTS_MAX_INDEX_YES:H.APPERANCE_PARTS_MAX_INDEX;for(c===g.MAP?(h=0===h?this._wwaData.map[o.y][o.x]:h,e=v.MAP):(h=0===h?this._wwaData.mapObject[o.y][o.x]:h,e=v.OBJECT),n=u;n<=_;n++){var l=H.ATR_APPERANCE_BASE+n*H.REL_ATR_APPERANCE_UNIT_LENGTH,p=l+H.REL_ATR_APPERANCE_ID,E=l+H.REL_ATR_APPERANCE_X,m=l+H.REL_ATR_APPERANCE_Y,y=l+H.REL_ATR_APPERANCE_TYPE;if(i=e===v.MAP?this._wwaData.mapAttribute[h][p]:this._wwaData.objectAttribute[h][p],a=e===v.MAP?this._wwaData.mapAttribute[h][y]:this._wwaData.objectAttribute[h][y],s=e===v.MAP?this._wwaData.mapAttribute[h][E]:this._wwaData.objectAttribute[h][E],r=e===v.MAP?this._wwaData.mapAttribute[h][m]:this._wwaData.objectAttribute[h][m],s===H.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>H.RELATIVE_COORD_LOWER&&(s=o.x+s-H.RELATIVE_COORD_BIAS),r===H.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>H.RELATIVE_COORD_LOWER&&(r=o.y+r-H.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new f(this,s,r,0,0),a===v.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var w=new d(s,r);this.setPartsOnPosition(v.MAP,i,w)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");w=new d(s,r);this.setPartsOnPosition(v.OBJECT,i,w),this._replaceRandomObject(new d(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},t.prototype.reserveAppearPartsInNextFrame=function(t,e,i){void 0===i&&(i=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:i})},t.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},t.prototype.appearPartsByDirection=function(t,e,i){var a=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=S[s],n=A[s];this.appearPartsEval(a,(r>=0?"+":"-")+Math.abs(r)*t,(n>=0?"+":"-")+Math.abs(n)*t,e,i)},t.prototype.appearPartsEval=function(t,e,i,a,s){var r,n,o=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=o.x;else if("+"===e[0])r=t.x+parseInt(e.substr(1));else if("-"===e[0])r=t.x-parseInt(e.substr(1));else if(r=parseInt(e),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");if("P"===i||"p"===i)n=o.y;else if("+"===i[0])n=t.y+parseInt(i.substr(1));else if("-"===i[0])n=t.y-parseInt(i.substr(1));else if(n=parseInt(i),isNaN(n))throw new Error("座標として解釈できない文字が含まれています。");try{new f(this,r,n,0,0);if(s===v.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var c=new d(r,n);this.setPartsOnPosition(v.MAP,a,c)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");c=new d(r,n);this.setPartsOnPosition(v.OBJECT,a,c),this._replaceRandomObject(new d(r,n)),r===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},t.prototype.getPartsID=function(t,e){if(t.x<0||t.y<0)throw new Error("想定外の座標が指定されました");return e===v.MAP?this._wwaData.map[t.y][t.x]:this._wwaData.mapObject[t.y][t.x]},t.prototype._replaceRandomObject=function(t){var e,i,a=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[a][H.ATR_TYPE]===H.OBJECT_RANDOM){for(var s=0;s<H.RANDOM_ITERATION_MAX;s++){if(i=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[a][H.ATR_RANDOM_BASE+i])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][H.ATR_TYPE]!==H.OBJECT_RANDOM)break;a=e}this.setPartsOnPosition(v.OBJECT,e,t)}},t.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),i=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW),a=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW),r=e;r<=i;r++)for(var n=a;n<=s;n++)this._replaceRandomObject(new d(r,n))},t.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new d(t,e))},t.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=y.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=O.NONE,this._player.clearMessageWaiting(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._shouldSetNextPage=!1,this._reservedPartsAppearances=[],this._reservedJumpDestination=void 0,this._clearAllRequests(),this._player.jumpTo(new f(this,t,e,0,0));var i=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_GAMEOVER;i&&this.evalCalcWwaNodeGenerator.evalWwaNode(i)},t.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},t.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},t.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(mt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=H.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(mt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=H.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof p&&(0!==t.energy&&(mt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=H.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(mt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=H.STATUS_CHANGED_EFFECT_FRAME_NUM)))},t.prototype.setPartsOnPosition=function(t,e,i){var a,s,r=i.y<<z.BITSHIFT|i.x;t===v.MAP?(a=this._wwaData.map[i.y][i.x],e=this.loadMapPartsID(e),a=this.loadMapPartsID(a),this._wwaData.map[i.y][i.x]=e,-1!==(s=this._mapIDTable[a].indexOf(r))&&this._mapIDTable[a].splice(s,1),-1===(s=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(a=this._wwaData.mapObject[i.y][i.x],e=this.loadMapPartsObjectID(e),a=this.loadMapPartsObjectID(a),this._wwaData.mapObject[i.y][i.x]=e,-1!==(s=this._mapObjectIDTable[a].indexOf(r))&&this._mapObjectIDTable[a].splice(s,1),-1===(s=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},t.prototype._countSamePartsLength=function(t,e){var i;for(i=e+1;i<t.length&&t[i]===t[i-1];i++);return i-e},t.prototype._compressMap=function(t){for(var e=[],i=0;i<t.length;i++){e[i]=[];for(var a=0;a<t[i].length;){var s=this._countSamePartsLength(t[i],a);e[i].push([t[i][a],s]),a+=s}}return e},t.prototype._decompressMap=function(t){for(var e=[],i=0;i<t.length;i++){e[i]=[],0;for(var a=0;a<t[i].length;a++)for(var s=t[i][a][1],r=0;r<s;r++)e[i].push(t[i][a][0])}return e},t.prototype._generateMapDataHash=function(t){var e="A",i=0,a=0,s=0;for(s=0;s<t.map.length;s++){for(a=0;a<t.map[s].length;)i=this._countSamePartsLength(t.map[s],a),e+=t.map[s][a]+"|"+i+"/",a+=i;for(a=0;a<t.mapObject[s].length;)i=this._countSamePartsLength(t.mapObject[s],a),e+=t.mapObject[s][a]+"|"+i+"/",a+=i}for(var r=0;r<t.mapAttribute.length;r++)for(var n=0;n<t.mapAttribute[r].length;n++)e+=t.mapAttribute[r][n]+"/";for(var o=0;o<t.objectAttribute.length;o++)for(var c=0;c<t.objectAttribute[o].length;c++)e+=t.objectAttribute[o][c]+"/";return ti(e+="Z")},t.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),i=[];for(var a in t)"map"!==a&&"mapObject"!==a&&"mapCompressed"!==a&&"mapObjectCompressed"!==a&&"mapAttribute"!==a&&"objectAttribute"!==a&&"checkString"!==a&&i.push(a);i.sort();for(var s=0;s<i.length;s++)e+=Tt(t[i[s]]);return ti(e)},t.prototype.compressSystem=function(){return oi},t.prototype._quickSave=function(t){var e,i,a=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_SAVE;a&&this.evalCalcWwaNodeGenerator.evalWwaNode(a);var s,r,n=JSON.parse(JSON.stringify(this._wwaData)),o=this._player.getPosition().getPartsCoord(),c=this._player.getStatusWithoutEquipments();switch(n.itemBox=this._player.getCopyOfItemBox(),n.playerX=o.x,n.playerY=o.y,n.statusEnergyMax=this._player.getEnergyMax(),n.statusEnergy=c.energy,n.statusStrength=c.strength,n.statusDefence=c.defence,n.statusGold=c.gold,n.moves=this._player.getMoveCount(),n.frameCount=this._player.getFrameCount(),n.gameSpeedIndex=this._player.getSpeedIndex(),n.playTime=null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0,t){case O.CALL_BY_LOG_QUICK_SAVE:case O.CALL_BY_QUICK_SAVE:case O.CALL_BY_SUSPEND:break;case O.CALL_BY_PASSWORD_SAVE:n.checkOriginalMapString=this.checkOriginalMapString,n.checkString=this._generateSaveDataHash(n)}switch(n.message=void 0,n.mapAttribute=void 0,n.objectAttribute=void 0,t){case O.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,n),this.wwaCustomEvent("wwa_quicksave",{data:n}),"";case O.CALL_BY_PASSWORD_SAVE:var h=oi.compress(n);h.isCompress=1;var u=JSON.stringify(h);return this.wwaCustomEvent("wwa_passwordsave",{data:n,compress:h}),s=u,r=this._wwaData.worldPassNumber,console.warn(ze.enc.Utf8.parse(s)),ze.AES.encrypt(ze.enc.Utf8.parse(s),$e(r)).toString();case O.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:n,compress:oi.compress(n)});break;case O.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:n}),this._wwaSave.autoSave(this._cvs,n)}},t.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},t.prototype._decodePassword=function(t){var e,i,a,s="",r=void 0;try{e=t,i=this._wwaData.worldPassNumber,s=ze.AES.decrypt(e,$e(i)).toString(ze.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,i){return ze.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,i)).toString(ze.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!s){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var n=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+n)}try{a=JSON.parse(s)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(a.isCompress){delete a.isCompress;var o=oi.decompress(a),c=o[0],h=o[1];return[Ei(c),h]}return[a,{isWorldNameEmpty:!1}]},t.prototype._quickLoad=function(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var a,s=!1;if(null!==e){var r=this._decodePassword(e);a=r[0],s=r[1].isWorldNameEmpty}else a=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(a.message=JSON.parse(JSON.stringify(this._restartData.message)),a.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),a.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===a.map&&(a.map=this._decompressMap(a.mapCompressed)),void 0===a.mapObject&&(a.mapObject=this._decompressMap(a.mapObjectCompressed)),delete a.mapCompressed,delete a.mapObjectCompressed,null!==e){if(!s&&a.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(a.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var n=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&a.checkOriginalMapString!==n)throw console.error("Invalid hash","(password)=".concat(a.checkOriginalMapString," (current map)=").concat(n)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return i&&this._applyQuickLoad(a),a},t.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new f(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(k.NO_SOUND):this.playSound(t.bgm,t.bgmDelayDurationMs),this.setImgClick(new d(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._clearAllRequests(),this._playTimeCalculator=new ut(t.playTime),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(U.ENERGY,new d(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(U.STRENGTH,new d(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(U.DEFENCE,new d(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(U.GOLD,new d(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new d(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new d(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},t.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var i=0;i<this._wwaData.mapWidth;i++){var a=i<<z.BITSHIFT|e;t=this._wwaData.map[i][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(a),t=this._wwaData.mapObject[i][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(a)}},t.prototype.restartGame=function(){this._quickLoad(!0)},t.prototype._fadeout=function(t){var e=0,i=H.MAP_WINDOW_WIDTH,a=H.FADEOUT_SPEED,s=mt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=a,(i-=2*a)<=0||2*e>H.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=H.MAP_WINDOW_WIDTH+"px",s.style.height=H.MAP_WINDOW_HEIGHT+"px",s.style.backgroundColor="#808080",clearInterval(r),void t();s.style.width=i+"px",s.style.height=i+"px",s.style.borderWidth=e+"px"}),20)},t.prototype.moveObjects=function(t){var e,i,a,s=this._camera.getPosition(),r=(this._player.getPosition(),s.getPartsCoord(),s.getPartsCoord().x),n=s.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),H.ATR_TYPE)!==H.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),H.ATR_TYPE)!==H.OBJECT_LOCALGATE){for(e=new Array(H.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(H.V_PARTS_NUM_IN_WINDOW+2),a=-1;a<=H.V_PARTS_NUM_IN_WINDOW;a++)for(e[a+1]=new Array(H.H_PARTS_NUM_IN_WINDOW+2),this.hoge[a+1]=new Array(H.H_PARTS_NUM_IN_WINDOW+2),i=-1;i<=H.H_PARTS_NUM_IN_WINDOW;i++)if(n+a<0||n+a>=this._wwaData.mapWidth||r+i<0||r+i>=this._wwaData.mapWidth)e[a+1][i+1]=0,this.hoge[a+1][i+1]=0;else{try{var o=(c=new f(this,r+i,n+a,0,0)).getPartsCoord()}catch(t){e[a+1][i+1]=0,this.hoge[a+1][i+1]=0;continue}this._wwaData.mapObject[o.y][o.x];e[a+1][i+1]=this._wwaData.mapObject[o.y][o.x],this.hoge[a+1][i+1]=-this._wwaData.mapObject[o.y][o.x]}for(i=-1;i<=H.H_PARTS_NUM_IN_WINDOW;i++)if(!(r+i<0||r+i>=this._wwaData.mapWidth))for(a=-1;a<=H.V_PARTS_NUM_IN_WINDOW;a++)if(!(n+a<0||n+a>=this._wwaData.mapWidth)){try{var c;o=(c=new f(this,r+i,n+a,0,0)).getPartsCoord()}catch(t){continue}var h=this._wwaData.mapObject[o.y][o.x];if(0!==h&&this._wwaData.objectAttribute[h][H.ATR_MOVE]!==b.STATIC&&this._wwaData.objectAttribute[h][H.ATR_TYPE]!==H.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[h][H.ATR_TYPE]!==H.OBJECT_RANDOM&&(this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.CHASE_PLAYER||this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.RUN_OUT||this._wwaData.objectAttribute[h][H.ATR_MOVE]===b.HANG_AROUND)){var u=this._wwaData.objectAttribute[h][H.ATR_MOVE];if(u!==b.HANG_AROUND){var _,l=this._getCandidateCoord(t,c,u),p=new d(l.x,o.y),E=new d(o.x,l.y),m=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(o,l,r,n,e,h);else{var y=this._getSecondCandidateMoveMode(t,o,l,p,E,this._wwaData.objectAttribute[h][H.ATR_TYPE]===H.OBJECT_MONSTER,e);y===x.MODE_X?this._setObjectsInNextFrame(o,p,r,n,e,h):y===x.MODE_Y?this._setObjectsInNextFrame(o,E,r,n,e,h):null===(m=this._getThirdCandidate(t,c,l,u,e))||this._wwaData.isOldMove?(_=this._getRandomMoveCoord(t,c,e),this._setObjectsInNextFrame(o,_,r,n,e,h)):this._setObjectsInNextFrame(o,m,r,n,e,h)}}else _=this._getRandomMoveCoord(t,c,e),this._setObjectsInNextFrame(o,_,r,n,e,h)}}}},t.prototype._getCandidateCoord=function(t,e,i){var a=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var s=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var r=a.clone(),n=0,o=0;return i===b.CHASE_PLAYER?(n=a.x>s.x?-1:a.x<s.x?1:0,o=a.y>s.y?-1:a.y<s.y?1:0):i===b.RUN_OUT&&(n=a.x>s.x?1:a.x<s.x?-1:0,o=a.y>s.y?1:a.y<s.y?-1:0),r.x+=n,r.y+=o,r.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.x)),r.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.y)),r},t.prototype._getSecondCandidateMoveMode=function(t,e,i,a,s,r,n){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!r)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||r)?this._objectCanMoveTo(t,a,n)?x.MODE_X:this._objectCanMoveTo(t,s,n)?x.MODE_Y:x.UNDECIDED:this._objectCanMoveTo(t,s,n)?x.MODE_Y:this._objectCanMoveTo(t,a,n)?x.MODE_X:x.UNDECIDED},t.prototype._getThirdCandidate=function(t,e,i,a,s){var r,n=a===b.CHASE_PLAYER?1:a===b.RUN_OUT?-1:0,o=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),c=e.getPartsCoord();if(o.x!==c.x){if(r=new d(i.x,c.y+1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(i.x,c.y-1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x,c.y+1*n),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x,c.y-1*n),this._objectCanMoveTo(t,r,s))return r}if(o.y!==c.y){if(r=new d(c.x+1*n,i.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x-1*n,i.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x+1*n,c.y),this._objectCanMoveTo(t,r,s))return r;if(r=new d(c.x-1*n,c.y),this._objectCanMoveTo(t,r,s))return r}return null},t.prototype._getRandomMoveCoord=function(t,e,i){for(var a=e.getPartsCoord(),s=a.clone(),r=this._wwaData.isOldMove?H.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:H.RANDOM_MOVE_ITERATION_NUM,n=0;n<r;n++){var o=[-1,1,0,0,-1,-1,1,1],c=Math.floor(Math.random()*o.length);if(s.x=a.x+o[c],s.y=a.y+[0,0,1,-1,1,-1,1,-1][c],this._objectCanMoveTo(t,s,i))return s}return a},t.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},t.prototype._objectCanMoveTo=function(t,e,i){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var a=this._wwaData.map[e.y][e.x],s=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[a][H.ATR_TYPE],n=this._camera.getPosition(),o=n.getPartsCoord().x,c=n.getPartsCoord().y;if(0===a&&!this.isOldMap()||r===H.MAP_WALL)return!1;var h=e.x-o+1,u=e.y-c+1;if(0<=h&&0<=u&&h<i.length&&u<i.length){if(0!==i[u][h])return!1}else if(0!==s)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},t.prototype._setObjectsInNextFrame=function(t,e,i,a,s,r){var n=e.x-i+1,o=e.y-a+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=n&&n<s.length&&0<=o&&o<s.length&&(s[t.y-a+1][t.x-i+1]=0,s[e.y-a+1][e.x-i+1]=r,this.hoge[e.y-a+1][e.x-i+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},t.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),i=Math.min(this._wwaData.mapWidth-1,t.x+H.H_PARTS_NUM_IN_WINDOW-1),a=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+H.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(k.DECISION);for(var n=e;n<=i;n++)for(var o=a;o<=s;o++){var c=this._wwaData.mapObject[o][n];this._wwaData.objectAttribute[c][H.ATR_TYPE]===H.OBJECT_MONSTER&&-1===r.indexOf(c)&&r.push(c)}if(this._bottomButtonType===h.BATTLE_REPORT&&mt(R[D.GOTO_WWA]).classList.add("onpress"),0===r.length)return mt(R[D.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1;this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating();var u=this.userDefinedFunctions&&this.userDefinedFunctions.CALL_BATTLE_REPORT;return u&&this.evalCalcWwaNodeGenerator.evalWwaNode(u),!0},t.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),mt(R[D.GOTO_WWA]).classList.remove("onpress"),this._dispatchWindowClosedTimeRequests()},t.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Ke.SAVE)return this._player.clearPasswordWindowWaiting(),void this._dispatchWindowClosedTimeRequests();try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),this._dispatchWindowClosedTimeRequests(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e},t.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){var t="変数一覧\n";this._userVarNameListRequestError&&("noFileSpecified"===this._userVarNameListRequestError.kind?t+=this._userVarNameListRequestError.errorMessage+"\n":(t+="【変数名取得失敗】\n",t+=" すべての変数を名無しとしています。\n",t+=" エラー詳細: ".concat(this._userVarNameListRequestError.errorMessage,"\n")));for(var e=0;e<H.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var i=(this._inlineUserVarViewer.topUserVarIndex+e)%H.USER_VAR_NUM,a=this._userVarNameList&&this._userVarNameList[i]?this._userVarNameList[i]:"名無し",s="変数 ".concat(i,": ").concat(a);t+="".concat(s,": ").concat(this._wwaData.userVar[i],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.generatePageAndReserveExecution(t,!1,!0)}},t.prototype._displayHelp=function(){var t;if(this._player.isControllable()){var e=null===(t=this._playTimeCalculator)||void 0===t?void 0:t.calculatePlayTimeFormat(),i="";switch(this.userDevice.device){case I.GAME:switch(this.userDevice.os){case T.NINTENDO:i=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10.p.1\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case T.PLAY_STATION:i=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10.p.1\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case T.XBOX:i=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10.p.1\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case I.SP:case I.VR:return;case I.PC:i=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n 現在の移動回数:"+this._player.getMoveCount()+"\n"+(e?" プレイ時間:"+e+"\n":"")+" WWA Wing バージョン:3.13.0-unstable.based-on.3.12.10.p.1\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}i&&this.generatePageAndReserveExecution(i,!1,!0)}},t.prototype._setNextPage=function(){(this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._pages.length)?this._hideMessageWindow().newPageGenerated||this._dispatchWindowClosedTimeRequests():this._shouldSetNextPage=!0;this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},t.prototype._hideMessageWindow=function(){var t=this._player.isReadyToUseItem()?this._player.useItem():0,e=this.getObjectAttributeById(t,H.ATR_STRING);return this.clearFaces(),0===e?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting(),{newPageGenerated:!1}):(this.generatePageAndReserveExecution(this.getMessageById(e),!1,!1,t,v.OBJECT,this._player.getPosition().getPartsCoord()),{newPageGenerated:0!==this._pages.length})},t.prototype.getPlayerPositon=function(){return this._player.getPosition()},t.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},t.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},t.prototype.replaceParts=function(t,e,i,a){void 0===i&&(i=v.OBJECT),void 0===a&&(a=!1);var s,r,n,o,c,h,u,_,l=this._camera.getPosition().getPartsCoord(),p=a?Math.max(0,l.x):0,d=a?Math.min(this._wwaData.mapWidth-1,l.x+H.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,f=a?Math.max(0,l.y):0,E=a?Math.min(this._wwaData.mapWidth-1,l.y+H.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(a=0!==p||d!==this._wwaData.mapWidth-1||0!==f||E!==this._wwaData.mapWidth-1,i===v.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),o=this._mapObjectIDTable[t].concat(),(u=this._mapObjectIDTable[t]).length=0,_=this._mapObjectIDTable[e],r=o.length,a)for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,p<=c&&c<=d&&f<=h&&h<=E?(this._wwaData.mapObject[h][c]=e,_.push(s)):u.push(s);else{for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,this._wwaData.mapObject[h][c]=e;Array.prototype.push.apply(_,o)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),o=this._mapIDTable[t].concat(),(u=this._mapIDTable[t]).length=0,_=this._mapIDTable[e],r=o.length,a)for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,p<=c&&c<=d&&f<=h&&h<=E?(this._wwaData.map[h][c]=e,_.push(s)):u.push(s);else{for(n=0;n<r;n++)c=(s=o[n])&z.BITMASK,h=s>>>z.BITSHIFT&z.BITMASK,this._wwaData.map[h][c]=e;Array.prototype.push.apply(_,o)}},t.prototype.getYesNoImgCoord=function(){return new d(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},t.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},t.prototype.getPlayerImgCoord=function(){return new d(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},t.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},t.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(this.toValidStatusValue(t))},t.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},t.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},t.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},t.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},t.prototype.isOldMap=function(){return this._wwaData.isOldMap},t.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},t.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},t.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},t.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},t.prototype.setPlayerStatus=function(t,e,i){if(t===B.ENERGY){if(this._player.setEnergy(this.toValidStatusValue(e)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:i}))return this.gameover(),{isGameOver:!0}}else if(t===B.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===B.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===B.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==B.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},t.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},t.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},t.prototype.setStatusIconCoord=function(t,e){var i=e.x*H.CHIP_SIZE,a=e.y*H.CHIP_SIZE,s=function(t){wt("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(i,"px -").concat(a,"px")};switch(t){case U.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case U.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case U.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case U.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},t.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*H.CHIP_SIZE,i=t.y*H.CHIP_SIZE;return Array.prototype.forEach.call(vt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+i+"px"})),t.clone()},t.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},t.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},t.prototype.canInput=function(){return!this._temporaryInputDisable},t.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},t.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},t.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},t.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new d(0,0)))Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+H.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(vt(".item-cell>.item-click-border"),(function(i){i.style.backgroundImage="url('"+e+"')",i.style.backgroundPosition="-"+t.x*H.CHIP_SIZE+"px -"+t.y*H.CHIP_SIZE+"px"}))}},t.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},t.prototype.clearFaces=function(){this._faces=[]},t.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},t.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},t.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},t.prototype.setBgmDelay=function(t){this._wwaData.bgmDelayDurationMs=t},t.prototype.initCSSRule=function(){this._styleElm=mt(H.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},t.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",i=this._isClassicModeEnable?1:.9,a="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(i,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),s="div#wwa-sidebar",r="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[Q.MESSAGE_WINDOW]=this._sheet.addRule(e,a),this._stylePos[Q.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[Q.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(a," }"),0),this._stylePos[Q.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},t.prototype.changeStyleRule=function(t,e,i,a){t===q.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=i,this._wwaData.frameColorB=a):t===q.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=i,this._wwaData.frameOutColorB=a):t===q.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=i,this._wwaData.fontColorB=a):t===q.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=i,this._wwaData.statusColorB=a),this.updateCSSRule()},t.prototype.showMonsterWindow=function(){this._monsterWindow.show()},t.prototype.isClassicMode=function(){return this._isClassicModeEnable},t.prototype.isConsoleOutputMode=function(){return this._useConsole},t.prototype.forcedJumpGate=function(t,e){this._player.isWaitingMessage()?this._windowCloseWaitingJumpGateRequest={x:t,y:e}:(this._windowCloseWaitingJumpGateRequest=void 0,this._player.jumpTo(new f(this,t,e,0,0)))},t.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(H.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},t.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),i=Math.max(Math.min(e,H.USER_VAR_NUM_MAX_VALUE),H.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(i)?0:i},t.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<H.USER_VAR_NUM&&(0|t)===t},t.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},t.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},t.prototype.recUserPosition=function(t,e){var i=this._player.getPosition().getPartsCoord();this.setUserVar(t,i.x),this.setUserVar(e,i.y)},t.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},t.prototype.jumpSpecifiedXPos=function(t){var e=this._player.getPosition().getPartsCoord();this.forcedJumpGate(t,e.y)},t.prototype.jumpSpecifiedYPos=function(t){var e=this._player.getPosition().getPartsCoord();this.forcedJumpGate(e.x,t)},t.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},t.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},t.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},t.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},t.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},t.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},t.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");return this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})?(this.gameover(),{isGameOver:!0}):{}},t.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},t.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},t.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},t.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},t.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},t.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},t.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},t.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},t.prototype.setUserValRandNum=function(t,e,i){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+i)},t.prototype._generateShowStrString=function(t,e){var i=this;return t.map((function(t){var a=Number(t);return isNaN(a)?null!==Te(t).match(me)?function(){return Ce(t,i.generateTokenValues(e.triggerParts))}:t.replace(/\\n/g,"\n"):function(){return 1===e.version?i._wwaData.userVar[a]:a}}))},t.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},t.prototype.execSetMacro=function(t,e){void 0===t&&(t="");var i=function(t,e){var i=Te(t),a=i.match(fe);if(null!==a){var s=Ie(a[2],e),r=Ie(a[4],e);return Ae(kt(a[3],s,r),a[1])}var n=i.match(Ee);if(null!==n)return s=Ie(n[1],e),r=Ie(n[3],e),Ae(kt(n[2],s,r),n[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this.generateTokenValues(e.triggerParts)),a=i.assignee,s=i.rawValue;switch(a){case"energy":if(this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(s));break;case"variable":if(isNaN(i.index)||!this.isValidUserVarIndex(i.index))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(i.index,this.toAssignableValue(s));break;case"map":this.appearPartsEval(e.triggerParts.position,"".concat(i.x),"".concat(i.y),i.rawValue,v.MAP);break;case"mapObject":this.appearPartsEval(e.triggerParts.position,"".concat(i.x),"".concat(i.y),i.rawValue,v.OBJECT);break;case"item":this.setPlayerGetItem(i.boxIndex1to12,s);break;case"playerDirection":this._player.setDir(s)}return this._player.updateStatusValueBox(),{}},t.prototype.generateTokenValues=function(t){var e,i;return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:t.id,partsType:t.type,partsPosition:t.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}},t.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var i=parseInt(e[0],10),a=parseInt(e[2],10);if(!this.isValidUserVarIndex(i)||!this.isValidUserVarIndex(a))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var s=this._wwaData.userVar[i],r=e[1],n=this._wwaData.userVar[a],o=function(t){return parseInt(t,10)?v.MAP:v.OBJECT};if(this.compareUserVar(s,r,n)){var c=parseInt(e[3],10),h=e[4],u=e[5],_=o(e[6]);this.appearPartsEval(t,h,u,c,_)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],f=o(e[10]);this.appearPartsEval(t,p,d,l,f)}},t.prototype.compareUserVar=function(t,e,i){switch(e){case"==":return t===i;case"!=":return t!==i;case">=":return t>=i;case">":return t>i;case"<=":return t<=i;case"<":return t<i;default:throw new Error("未定義の演算子です: ".concat(e))}},t.prototype.setPlayerSpeedIndex=function(t){if(t<H.MIN_SPEED_INDEX||H.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._player.isMoving()?this._playerAndObjectsStopWaitingGameSpeedChangeRequest={speedIndex:t}:(this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t),this._playerAndObjectsStopWaitingGameSpeedChangeRequest=void 0)},t.prototype.setUserVarPlayTime=function(t){var e,i;this.setUserVar(t,null!==(i=null===(e=this._playTimeCalculator)||void 0===e?void 0:e.calculateTimeMs())&&void 0!==i?i:0)},t.prototype.hideStatus=function(t,e){if(t<0||t>G.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(G[t],!e),this._player.updateStatusValueBox()},t.prototype.varMap=function(t,e,i,a,s){if(!this.isValidUserVarIndex(a))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[a];if(r<0)throw new Error("負のパーツ番号は指定できません");if(s===v.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(s===v.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,i,r,s)},t.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(vt("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*H.CHIP_SIZE,"px -").concat(t.y*H.CHIP_SIZE,"px")}))},t.prototype._getVirtualPadButton=function(t){if(!_t.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},t.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},t.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},t.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,i,a;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(i=this._wwaData.gamePadButtonItemTable[e]){switch(a=!1,e){case nt.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_LEFT)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_RIGHT)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_UP)&&(a=!0);break;case nt.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(nt.BUTTON_CROSS_KEY_DOWN)&&(a=!0)}if(this._gamePadStore.buttonTrigger(e)&&(a=!0),a&&this.onselectitem(i))return!0}return!1},t.prototype.setGamePadButtonItemTable=function(t,e){var i,a;if(!this._wwaData.gamePadButtonItemTable)for(a in this._wwaData.gamePadButtonItemTable=[],nt)i=a,this._wwaData.gamePadButtonItemTable[i]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},t.prototype._checkSaveDataCompatibility=function(t,e,i){return void 0!==t&&t!==this._wwaData.worldName?Ci.UNMATCHED_WORLD_NAME:i&&i!==Ii(this._wwaData.worldName,this._wwaData.worldPassNumber)?Ci.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Ci.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},t.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},t.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},t.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var i=this._dumpElement.querySelector(".varlist-information");i&&(i.textContent="".concat(e?"【エラー】":"").concat(t))}},t.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},t.prototype.getGameStatus=function(){var t,e;return{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:null!==(e=null===(t=this._playTimeCalculator)||void 0===t?void 0:t.calculateTimeMs())&&void 0!==e?e:0,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox()}},t.prototype._debugEvalString=function(){if(this._player.isControllable())try{var t=this._debugConsoleElement.querySelector(".console-text-area");if(!(t instanceof HTMLTextAreaElement))throw new Error("要素 #wwa-debug-console > .console-text-area が textarea 要素でありません");this._execEvalString(t.value)}catch(t){console.error(t),this.generatePageAndReserveExecution("解析中にエラーが発生しました :\n"+t.message,!1,!0)}},t.prototype._execEvalString=function(t){try{var e=this.convertWwaNodes(t);this.evalCalcWwaNodeGenerator.evalWwaNodes(e)}catch(t){console.error(t),this.generatePageAndReserveExecution("解析中にエラーが発生しました :\n"+t.message,!1,!0)}},t.prototype.movePlayer=function(t){this._player.controll(t)},t.prototype.isPlayerWaitingMessage=function(){return this._player.isWaitingMessage()},t.prototype._loadSystemMessage=function(t){if(this._wwaData.customSystemMessages[t])return this._wwaData.customSystemMessages[t];var e=r[t];if(e.mapdataParams)switch(e.mapdataParams.messageArea){case"message":return""===(i=this._wwaData.message[e.mapdataParams.index])?e.defaultText:i;case"systemMessage":var i;return""===(i=this._wwaData.systemMessage[e.mapdataParams.index])?e.defaultText:i;default:throw new Error("システムエラー: システムメッセージの設定がおかしいようです")}return e.defaultText},t.prototype.resolveSystemMessage=function(t){var e=this,i=this._loadSystemMessage(t);switch(t){case s.ITEM_SELECT_TUTORIAL:return i.replaceAll("%HOW_TO_USE_ITEM%",function(){switch(e.userDevice.device){case I.PC:return"右のボックスを選択する";case I.VR:return"右のボックスをクリックする";case I.SP:return"右のボックスをタップする";case I.GAME:switch(e.userDevice.os){case T.NINTENDO:return"Xボタンを押すか、右のボックスをタップする";case T.PLAY_STATION:return"△ボタンを押す";case T.XBOX:return"Yボタンを押す";default:return"右のボックスを選択する"}default:return"右のボックスを選択する"}}());case s.GAME_SPEED_CHANGED:var a=this._player.getSpeedIndex();return i.replaceAll("%GAME_SPEED_NAME%",Y[a]).replaceAll("%HIGH_SPEED_MESSAGE%",this.isBattleSpeedIndexForQuickBattle(a)?"戦闘も速くなります。\n":"").replaceAll("%MAX_SPEED_INDEX%",String(H.MAX_SPEED_INDEX+1)).replaceAll("%GAME_SPEED_INDEX%",String(a+1)).replaceAll("%SPEED_UP_BUTTON%",this.userDevice.os===T.NINTENDO?"+ボタン":"Pキー").replaceAll("%SPEED_DOWN_BUTTON%",this.userDevice.os===T.NINTENDO?"-ボタン":"Iキー");default:return i}},t.prototype.overwriteSystemMessage=function(t,e){this._wwaData.customSystemMessages[t]=e},t}(),qs=!1;function Qs(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(vt("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){qs=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(qs)return qs=!1,t.returnValue=e,e}));var t=mt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),i=null!==e&&null!==e.match(/^true$/i);qe(mt("wwa-wrapper"),t,i);var a=mt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=mt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=mt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),n=null,o="true"===mt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),c=mt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");mt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&o&&(n=function(t){var e=gt(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var i=document.createElement("table"),a=document.createElement("tr"),s=document.createElement("th"),r=document.createElement("button"),n=document.createElement("td");r.textContent="隠す",s.textContent="変数一覧",s.setAttribute("colspan","10"),s.classList.add("varlist-header"),s.appendChild(r),a.appendChild(s),n.setAttribute("colspan","10"),n.classList.add("varlist-information"),n.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",i.appendChild(a),i.appendChild(n);for(var o=null,c=null,h=0;h<H.USER_VAR_NUM;h++){h%10==0&&(null!==o&&(i.appendChild(o),i.appendChild(c)),(o=document.createElement("tr")).classList.add("var-number"),(c=document.createElement("tr")).classList.add("var-val"));var u=document.createElement("th"),_=document.createElement("div");_.textContent="-",_.setAttribute("aria-hidden","true"),u.classList.add("var-index".concat(h));var l=document.createElement("td");u.textContent=h+"",u.appendChild(_),l.classList.add("var".concat(h)),l.textContent="-",o.appendChild(u),c.appendChild(l)}H.USER_VAR_NUM%10!=0&&(i.appendChild(o),i.appendChild(c)),e.appendChild(i);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",n.style.display="none",Array.prototype.forEach.call(i.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(i.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",n.style.display="",Array.prototype.forEach.call(i.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(i.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(r));var h=!0;mt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(h=!1);var u=mt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),_=!1;null!==u&&u.match(/^true$/i)&&(_=!0);var l=!0,p=mt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,f=mt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==f&&f.match(/^true$/i)&&(d=!0);var E,m,y=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");Ze()&&null!==y&&y.match(/^true$/i)&&(E=document.getElementsByTagName("head")[0],(m=document.createElement("meta")).setAttribute("name","viewport"),E.appendChild(m),ft(),window.addEventListener("resize",ft));var g,w=mt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),v=i&&w?wt(w):null,S=!(null===(g=mt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!g.match(/^true$/i));Ws=new Zs(a,h,t,_,l,d,s,S,n,c,o,i,v)}}"complete"===document.readyState?setTimeout(Qs):window.addEventListener("load",(function(){setTimeout(Qs)}))}()}();
|