@wwawing/engine 3.11.5 → 3.11.6

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.
Files changed (2) hide show
  1. package/lib/wwa.js +1 -1
  2. package/package.json +11 -11
package/lib/wwa.js CHANGED
@@ -18,4 +18,4 @@ i.mode.CTRGladman=function(){var t=i.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=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.algo,n=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]),_=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]),c=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]),h=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]),u=s.create([0,1518500249,1859775393,2400959708,2840853838]),l=s.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=0;a<16;a++){var i=e+a,s=t[i];t[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,o,p,g,A,S,v,T,I,O,D,C=this._hash.words,P=u.words,N=l.words,M=n.words,b=_.words,R=c.words,L=h.words;for(S=r=C[0],v=o=C[1],T=p=C[2],I=g=C[3],O=A=C[4],a=0;a<80;a+=1)D=r+t[e+M[a]]|0,D+=a<16?d(o,p,g)+P[0]:a<32?E(o,p,g)+P[1]:a<48?f(o,p,g)+P[2]:a<64?w(o,p,g)+P[3]:y(o,p,g)+P[4],D=(D=m(D|=0,R[a]))+A|0,r=A,A=g,g=m(p,10),p=o,o=D,D=S+t[e+b[a]]|0,D+=a<16?y(v,T,I)+N[0]:a<32?w(v,T,I)+N[1]:a<48?f(v,T,I)+N[2]:a<64?E(v,T,I)+N[3]:d(v,T,I)+N[4],D=(D=m(D|=0,L[a]))+O|0,S=O,O=I,I=m(T,10),T=v,v=D;D=C[1]+p+I|0,C[1]=C[2]+g+O|0,C[2]=C[3]+A+S|0,C[3]=C[4]+r+v|0,C[4]=C[0]+o+T|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,r=s.words,o=0;o<5;o++){var n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return s},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,a){return t^e^a}function E(t,e,a){return t&e|~t&a}function f(t,e,a){return(t|~e)^a}function w(t,e,a){return t&a|e&~a}function y(t,e,a){return t^(e|~a)}function m(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),i.RIPEMD160)},637:function(t,e,a){var i,s,r,o,n,_,c,h;t.exports=(h=a(359),s=(i=h).lib,r=s.WordArray,o=s.Hasher,n=i.algo,_=[],c=n.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],c=0;c<80;c++){if(c<16)_[c]=0|t[e+c];else{var h=_[c-3]^_[c-8]^_[c-14]^_[c-16];_[c]=h<<1|h>>>31}var u=(i<<5|i>>>27)+n+_[c];u+=c<20?1518500249+(s&r|~s&o):c<40?1859775393+(s^r^o):c<60?(s&r|s&o|r&o)-1894007588:(s^r^o)-899497514,n=o,o=r,r=s<<30|s>>>2,s=i,i=u}a[0]=a[0]+i|0,a[1]=a[1]+s|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(a/4294967296),e[15+(i+64>>>9<<4)]=a,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=o._createHelper(c),i.HmacSHA1=o._createHmacHelper(c),h.SHA1)},640:function(t,e,a){var i,s,r,o,n,_;t.exports=(_=a(359),a(93),s=(i=_).lib.WordArray,r=i.algo,o=r.SHA256,n=r.SHA224=o.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=o._createHelper(n),i.HmacSHA224=o._createHmacHelper(n),_.SHA224)},93:function(t,e,a){var i;t.exports=(i=a(359),function(t){var e=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.algo,n=[],_=[];!function(){function e(e){for(var a=t.sqrt(e),i=2;i<=a;i++)if(!(e%i))return!1;return!0}function a(t){return 4294967296*(t-(0|t))|0}for(var i=2,s=0;s<64;)e(i)&&(s<8&&(n[s]=a(t.pow(i,.5))),_[s]=a(t.pow(i,1/3)),s++),i++}();var c=[],h=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(n.slice(0))},_doProcessBlock:function(t,e){for(var a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,f=c[p-2],w=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+w+c[p-16]}var y=i&s^i&r^s&r,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&h^~n&u)+_[p]+c[p];l=u,u=h,h=n,n=o+g|0,o=r,r=s,s=i,i=g+(m+y)|0}a[0]=a[0]+i|0,a[1]=a[1]+s|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0,a[5]=a[5]+h|0,a[6]=a[6]+u|0,a[7]=a[7]+l|0},_doFinalize:function(){var e=this._data,a=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;return a[s>>>5]|=128<<24-s%32,a[14+(s+64>>>9<<4)]=t.floor(i/4294967296),a[15+(s+64>>>9<<4)]=i,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(h),e.HmacSHA256=r._createHmacHelper(h)}(Math),i.SHA256)},140:function(t,e,a){var i;t.exports=(i=a(359),a(467),function(t){var e=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.x64.Word,n=e.algo,_=[],c=[],h=[];!function(){for(var t=1,e=0,a=0;a<24;a++){_[t+5*e]=(a+1)*(a+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var s=1,r=0;r<24;r++){for(var n=0,u=0,l=0;l<7;l++){if(1&s){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&s?s=s<<1^113:s<<=1}h[r]=o.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=o.create()}();var l=n.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var a=this._state,i=this.blockSize/2,s=0;s<i;s++){var r=t[e+2*s],o=t[e+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(C=a[s]).high^=o,C.low^=r}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=a[l+5*E]).high,d^=C.low;var f=u[l];f.high=p,f.low=d}for(l=0;l<5;l++){var w=u[(l+4)%5],y=u[(l+1)%5],m=y.high,g=y.low;for(p=w.high^(m<<1|g>>>31),d=w.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=a[A]).high,v=C.low,T=_[A];T<32?(p=S<<T|v>>>32-T,d=v<<T|S>>>32-T):(p=v<<T-32|S>>>64-T,d=S<<T-32|v>>>64-T);var I=u[c[A]];I.high=p,I.low=d}var O=u[0],D=a[0];for(O.high=D.high,O.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=a[A=l+5*E],P=u[A],N=u[(l+1)%5+5*E],M=u[(l+2)%5+5*E];C.high=P.high^~N.high&M.high,C.low=P.low^~N.low&M.low}C=a[0];var b=h[n];C.high^=b.high,C.low^=b.low}},_doFinalize:function(){var e=this._data,a=e.words,i=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;a[i>>>5]|=1<<24-i%32,a[(t.ceil((i+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*a.length,this._process();for(var o=this._state,n=this.cfg.outputLength/8,_=n/8,c=[],h=0;h<_;h++){var u=o[h],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new s.init(c,n)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),a=0;a<25;a++)e[a]=e[a].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),i.SHA3)},716:function(t,e,a){var i,s,r,o,n,_,c,h;t.exports=(h=a(359),a(467),a(834),s=(i=h).x64,r=s.Word,o=s.WordArray,n=i.algo,_=n.SHA512,c=n.SHA384=_.extend({_doReset:function(){this._hash=new o.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=_._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=_._createHelper(c),i.HmacSHA384=_._createHmacHelper(c),h.SHA384)},834:function(t,e,a){var i;t.exports=(i=a(359),a(467),function(){var t=i,e=t.lib.Hasher,a=t.x64,s=a.Word,r=a.WordArray,o=t.algo;function n(){return s.create.apply(s,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=n()}();var h=o.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 a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=i.high,d=i.low,E=s.high,f=s.low,w=r.high,y=r.low,m=o.high,g=o.low,A=n.high,S=n.low,v=h.high,T=h.low,I=u.high,O=u.low,D=l.high,C=l.low,P=p,N=d,M=E,b=f,R=w,L=y,x=m,B=g,U=A,W=S,Y=v,F=T,k=I,G=O,V=D,H=C,K=0;K<80;K++){var j,X,J=c[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=c[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=c[K-2],et=tt.high,at=tt.low,it=(et>>>19|at<<13)^(et<<3|at>>>29)^et>>>6,st=(at>>>19|et<<13)^(at<<3|et>>>29)^(at>>>6|et<<26),rt=c[K-7],ot=rt.high,nt=rt.low,_t=c[K-16],ct=_t.high,ht=_t.low;X=(X=(X=z+ot+((j=$+nt)>>>0<$>>>0?1:0))+it+((j+=st)>>>0<st>>>0?1:0))+ct+((j+=ht)>>>0<ht>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&k,pt=W&F^~W&G,dt=P&M^P&R^M&R,Et=N&b^N&L^b&L,ft=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),wt=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),mt=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[K],At=gt.high,St=gt.low,vt=V+yt+((ut=H+mt)>>>0<H>>>0?1:0),Tt=wt+Et;V=k,H=G,k=Y,G=F,Y=U,F=W,U=x+(vt=(vt=(vt=vt+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=B+ut|0)>>>0<B>>>0?1:0)|0,x=R,B=L,R=M,L=b,M=P,b=N,P=vt+(ft+dt+(Tt>>>0<wt>>>0?1:0))+((N=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=i.low=d+N,i.high=p+P+(d>>>0<N>>>0?1:0),f=s.low=f+b,s.high=E+M+(f>>>0<b>>>0?1:0),y=r.low=y+L,r.high=w+R+(y>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),T=h.low=T+F,h.high=v+Y+(T>>>0<F>>>0?1:0),O=u.low=O+G,u.high=I+k+(O>>>0<G>>>0?1:0),C=l.low=C+H,l.high=D+V+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(a/4294967296),e[31+(i+128>>>10<<5)]=a,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(h),t.HmacSHA512=e._createHmacHelper(h)}(),i.SHA512)},567:function(t,e,a){var i;t.exports=(i=a(359),a(139),a(174),a(844),a(951),function(){var t=i,e=t.lib,a=e.WordArray,s=e.BlockCipher,r=t.algo,o=[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],n=[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],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{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}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=s.extend({_doReset:function(){for(var t=this._key.words,e=[],a=0;a<56;a++){var i=o[a]-1;e[a]=t[i>>>5]>>>31-i%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var c=s[r]=[],h=_[r];for(a=0;a<24;a++)c[a/6|0]|=e[(n[a]-1+h)%28]<<31-a%6,c[4+(a/6|0)]|=e[28+(n[a+24]-1+h)%28]<<31-a%6;for(c[0]=c[0]<<1|c[0]>>>31,a=1;a<7;a++)c[a]=c[a]>>>4*(a-1)+3;c[7]=c[7]<<5|c[7]>>>27}var u=this._invSubKeys=[];for(a=0;a<16;a++)u[a]=s[15-a]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,a){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 i=0;i<16;i++){for(var s=a[i],r=this._lBlock,o=this._rBlock,n=0,_=0;_<8;_++)n|=c[_][((o^s[_])&h[_])>>>0];this._lBlock=o,this._rBlock=r^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,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 a=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=a,this._lBlock^=a<<t}function p(t,e){var a=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=a,this._rBlock^=a<<t}t.DES=s._createHelper(u);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),i=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=u.createEncryptor(a.create(e)),this._des2=u.createEncryptor(a.create(i)),this._des3=u.createEncryptor(a.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)}(),i.TripleDES)},467:function(t,e,a){var i;t.exports=(i=a(359),function(t){var e=i,a=e.lib,s=a.Base,r=a.WordArray,o=e.x64={};o.Word=s.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=s.extend({init:function(e,a){e=this.words=e||[],this.sigBytes=a!=t?a:8*e.length},toX32:function(){for(var t=this.words,e=t.length,a=[],i=0;i<e;i++){var s=t[i];a.push(s.high),a.push(s.low)}return r.create(a,this.sigBytes)},clone:function(){for(var t=s.clone.call(this),e=t.words=this.words.slice(0),a=e.length,i=0;i<a;i++)e[i]=e[i].clone();return t}})}(),i)},633:function(){},106:function(){}},e={};function a(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!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"}(t||(t={})),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_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",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"}(e||(e={}));var i,s,r=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var a=this.getKeyState(e);return a===t.KEYDOWN||a===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(i||(i={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(s||(s={}));var o,n,_=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())===i.MOUSEDOWN||e===i.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?i.NONE:this._prevMouseState?this._mouseState?i.MOUSEPRESS:i.MOUSEUP:this._mouseState?i.MOUSEDOWN:i.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?i.NONE:this._prevMouseStateOnControllable?this._mouseState?i.MOUSEPRESS:i.MOUSEUP:this._mouseState?i.MOUSEDOWN:i.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===s.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"}(o||(o={})),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"}(n||(n={}));var c,h,u,l=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,a,i,s,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){a=r[t];var n=this.gamepad.buttons[a];if(!n)return!1;if(i="object"==typeof n?!0===n.pressed:1===n,s=this.triggers[a],this.triggers[a]=i,i&&!s)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,a,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(!this.gamepad)return!1;for(e=i.length,t=0;t<e;t++){a=i[t];var r=this.gamepad.buttons[a];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,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++)switch(a[t]){case o.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_UP))return!0;break;case o.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_DOWN))return!0;break;case o.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_LEFT))return!0;break;case o.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.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,a,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(!this.gamepad)return 0;for(e=i.length,t=0;t<e;t++){a=i[t];var r=this.gamepad.axes[a];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),p=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},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 a(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),d=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}(),E=function(t){function e(e,a,i,s){var r=t.call(this,a,i)||this;return r.energy=e,r.gold=s,r}return p(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(a,i){return a+t.rates[i]*e[i]}),0)},e}(d),f=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 w(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}(),w=function(){function t(t,e,a,i,s){if(void 0===i&&(i=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&&i>0||a<0||a>=r||a>=r-1&&s>0)throw new Error("範囲外の座標です!! parts:("+e+", "+a+"), offset:("+i+", "+s+"), mapWidth = "+r);this._partsCoord=new f(e,a),this._offsetCoord=new f(i,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/(q.H_PARTS_NUM_IN_WINDOW-1))*(q.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(q.V_PARTS_NUM_IN_WINDOW-1))*(q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,a,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),a=this._wwa.getMapWidth(),i=t.getPartsCoord().clone();return e.x===a-1&&i.x--,e.y===a-1&&i.y--,i.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var a=this._partsCoord;return new t(this._wwa,a.x+T[e],a.y+I[e],0,0)}var i=this._partsCoord.x,s=this._partsCoord.y;return this._offsetCoord.x<0?i--:this._offsetCoord.x>0&&i++,this._offsetCoord.y<0?s--:this._offsetCoord.y>0&&s++,new t(this._wwa,i,s,0,0)},t.prototype.getNextFramePosition=function(e,a,i){var s=this._partsCoord.x,r=this._partsCoord.y,o=this._offsetCoord.x+T[e]*a,n=this._offsetCoord.y+I[e]*i;if(o<0){var _=Math.floor(Math.abs(o)/q.CHIP_SIZE);s-=_,o=(o+_*q.CHIP_SIZE)%q.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/q.CHIP_SIZE);r-=c,n=(n+c*q.CHIP_SIZE)%q.CHIP_SIZE}return o>=q.CHIP_SIZE&&(s+=Math.floor(o/q.CHIP_SIZE),o=(o+q.CHIP_SIZE)%q.CHIP_SIZE),n>=q.CHIP_SIZE&&(r+=Math.floor(n/q.CHIP_SIZE),n=(n+q.CHIP_SIZE)%q.CHIP_SIZE),new t(this._wwa,s,r,o,n)},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 a=t.getPosition()._partsCoord,i=this._partsCoord.x,s=this._partsCoord.y,r=e?1:0;return a.x<=i&&i<a.x+q.H_PARTS_NUM_IN_WINDOW-r&&a.y<=s&&s<a.y+q.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),y=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},m=function(t,e,a,i,s){this.partsIDObj=t,this.x=e,this.y=a,this.isStatic=i,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.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,v,T=[-1,1,0,0,-1,-1,1,1,0],I=[0,0,1,-1,1,-1,1,-1,0],O=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),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"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(v||(v={}));var C,P,N,M,b,R,L,x,B,U=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)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?N.CHROME:t.match(/firefox/i)?N.FIREFOX:t.match(/safari/i)?N.SAFARI:N.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return P.PC;case C.IOS:case C.ANDROID:return P.SP;case C.OCULUS:return P.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return P.GAME}return P.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"}(C||(C={})),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"}(P||(P={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(N||(N={})),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"}(M||(M={})),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"}(b||(b={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(R||(R={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(L||(L={})),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"}(x||(x={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(B||(B={}));var W,Y,F,k=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),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.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(F||(F={}));var G,V,H,K={"":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,$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"}(G||(G={})),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"}(V||(V={})),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"}(H||(H={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],q=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=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.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}(),Q=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}(),z=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}(),$=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"}(j||(j={}));var tt,et,at,it,st,rt=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],ot=["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"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),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"}(at||(at={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(it||(it={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(st||(st={}));var nt=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],_t=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ct=new Set(_t),ht=function(){function t(e,a,i,s,r,o){void 0===a&&(a=!1),void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=null),void 0===o&&(o=null);var n=this;if(this._enabled=null!==e,this._visible=a,this._onTouchStart=r||null,this._onTouchEnd=o||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=s,this._buttonWrapperElement=i,this._setVisible(a),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility="visible"),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility="visible"),null!==e){var _=function(a){var i=e[a];if(!i)return"continue";var s=a;c._availableButtons.push(s),i.setAttribute("type",a),c._isTouchingButtons[s]={prev:!1,current:!1,next:!1};var r=function(t){t.cancelable&&t.preventDefault()};i.addEventListener("touchstart",(function(t){r(t),n.setTouchInfo(s)})),i.addEventListener("touchcancel",(function(t){r(t),n.allClear()})),t.isMoveButton(s)?(i.addEventListener("touchmove",c._detectMovingMoveButton.bind(c)),i.addEventListener("touchend",c.allMoveClear.bind(c))):i.addEventListener("touchend",(function(t){r(t),n.clearTouchInfo(s)}))},c=this;for(var h in e)_(h);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 a=this._moveButtonsElement.getBoundingClientRect(),i=document.body.getBoundingClientRect(),s=a.left-i.left+a.width/2,r=a.top-i.top+a.height/2,o=e.pageX-s,n=e.pageY-r;o>=n?o<=-n?this.setTouchInfo("BUTTON_UP"):this.setTouchInfo("BUTTON_RIGHT"):o>=-n?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 a=e.prev,i=e.current;return a&&i?"TOUCHING":i?"TOUCH":a?"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;_t.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 a=t._isTouchingButtons[e];void 0!==a&&(a.next=!1)}}))},t.isMoveButton=function(t){return ct.has(t)},t.prototype.update=function(){var t=this;this._availableButtons.forEach((function(e){var a,i;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===(a=t._onTouchStart)||void 0===a||a.call(t,e);break;case"LEAVE":null===(i=t._onTouchEnd)||void 0===i||i.call(t,e)}}}))},t.prototype.toggleVisible=function(){this._setVisible(!this._visible)},t}();function ut(){var t=document.querySelector("meta[name='viewport']"),e=window.innerWidth,a=window.innerHeight,i="user-scalable=no";if(e>a){var s=Math.floor(e/a*456);i="width=".concat(s,",").concat(i)}else e<=a&&(i="width=".concat(576,",").concat(i));null==t||t.setAttribute("content","".concat(i))}var lt,pt=function(t){return document.getElementById(t)},dt=function(t){return document.querySelector(t)},Et=function(t){return document.querySelector(t)},ft=function(t){return document.querySelectorAll(t)},wt=function(t,e){var a,i,s=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return a=t-pt("wwa-wrapper").offsetLeft+s,i=e-pt("wwa-wrapper").offsetTop+r,new f(a,i)},yt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},mt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=mt(t[a])+"/";return e}return t+""},gt=function(t){return t.split("").reverse().join("")},At=function(){function t(t,e,a){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:a}),this._isTransparent=a}return t.prototype.drawCanvas=function(t,e,a,i,s){this.ctx.drawImage(t,q.CHIP_SIZE*e,q.CHIP_SIZE*a,q.CHIP_SIZE,q.CHIP_SIZE,i,s,q.CHIP_SIZE,q.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,a,i){this._isTransparent?this.ctx.clearRect(t,e,a,i):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,a,i))},t}(),St=function(){function t(t,e,a,i){var s;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=i,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new f(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,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE);for(var t=1;t<q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,q.CHIP_SIZE*t,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE);for(t=1;t<q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var a,i=t.length;for(e=0;e<i;e++){var s=t[e];(a=this._effectCanvases[e])?a.clear():a=this._effectCanvases[e]=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<q.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<q.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,s.x,s.y,o*q.CHIP_SIZE,r*q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE,0,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2),0,q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2),q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE,q.CHIP_SIZE,a,i,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,a,i,s,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE*a,q.CHIP_SIZE*i,s,r,q.CHIP_SIZE*a,q.CHIP_SIZE*i)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,a,i,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,i+q.CHIP_SIZE-s);r>=q.CHIP_SIZE||this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE,q.CHIP_SIZE-r,a,i,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var a=this;return function(i,s,r,o,n){if(!a._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(o,n));_>=q.CHIP_SIZE||t.ctx.drawImage(a._image,q.CHIP_SIZE*i,q.CHIP_SIZE*s+_,q.CHIP_SIZE,q.CHIP_SIZE-_,r,o+_,q.CHIP_SIZE,q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+q.CHIP_SIZE-e}))(t,e,a,i,s)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,a,i,s)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,a,i,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+q.CHIP_SIZE-e}))(e,a,i,s,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,a,i,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,a,i,s,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.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,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.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,a,i,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s-i);r>=q.CHIP_SIZE||this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e+r,q.CHIP_SIZE,q.CHIP_SIZE-r,a,i+r,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,a,i){this._ctx.clearRect(t,e,a,i)},t.prototype.drawBase=function(t,e,a,i){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,a,i)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),vt=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=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(q.H_PARTS_NUM_IN_WINDOW-1),e*(q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===q.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===q.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}(),Tt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),It=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),Ot=function(t){function e(e){return t.call(this,e)||this}return Tt(e,t),e}(It);!function(t){function e(e){return t.call(this,e)||this}Tt(e,t)}(It);!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"}(lt||(lt={}));var Dt=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,a)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(q.ITEMBOX_SIZE),_._status=s,_._equipStatus=new d(0,0),_._itemBox=new Array(q.ITEMBOX_SIZE),_._itemBoxElement=new Array(q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(q.ITEMBOX_SIZE);for(var c=0;c<_._itemBox.length;c++)_._itemBox[c]=0,_._itemBoxElement[c]=Et("#item"+c+">.item-disp");return _.updateItemBox(),_._energyMax=r,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=lt.CONTROLLABLE,_._camera=i,_._isPartsEventExecuted=!1,_._energyValueElement=Et("#disp-energy>.status-value-box"),_._strengthValueElement=Et("#disp-strength>.status-value-box"),_._defenceValueElement=Et("#disp-defence>.status-value-box"),_._goldValueElement=Et("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=o,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return Tt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===lt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=lt.CONTROLLABLE)}else if(this._state===lt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=lt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,a;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),a=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(a)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=lt.CAMERA_MOVING}catch(t){this._state=lt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===q.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=lt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),q.ATR_TYPE)!==q.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)!==q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,q.ATR_MODE)===q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,q.ATR_NUMBER)===q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==lt.MOVING||this._state==lt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==q.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==q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==q.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===lt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==q.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===lt.LOCALGATE_JUMPED||this._state===lt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=lt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===lt.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!==lt.MESSAGE_WAITING&&this._state!==lt.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===lt.MESSAGE_WAITING?this._state=lt.CONTROLLABLE:this._state===lt.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=lt.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=lt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===lt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===lt.ESTIMATE_WINDOW_WAITING&&(this._state=lt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=lt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===lt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===lt.PASSWORD_WINDOW_WAITING&&(this._state=lt.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!==lt.LOCALGATE_JUMPED&&this._state!==lt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===lt.LOCALGATE_JUMPED?lt.CONTROLLABLE:lt.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===lt.MESSAGE_WAITING?lt.LOCALGATE_JUMPED_WITH_MESSAGE:lt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=q.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=q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=lt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=q.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 d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(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,a=function(a){var s=i._itemBoxElement[a],r=dt("#item"+a);if(0===i._itemBox[a])return s.style.backgroundPosition="-40px 0px",i.disposeItemEffect(a,i._itemBoxElement[a],r),"continue";var o=i._wwa.getObjectCropXById(i._itemBox[a]),n=i._wwa.getObjectCropYById(i._itemBox[a]);if(!t||a!==t.insertPos-1)return s.style.backgroundPosition="-"+o+"px -"+n+"px",i.disposeItemEffect(a,i._itemBoxElement[a],r),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,c=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,h=-_*q.DEFAULT_FRAME_INTERVAL/q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:i._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:i._wwa.getObjectCropYById(t.overwrittenObjectId);s.style.left=_+"px",s.style.top=c+"px","number"==typeof i.itemEffectStartTimers[a]&&clearInterval(i.itemEffectStartTimers[a]),i.itemEffectStartTimers[a]=window.setTimeout((function(){e.itemEffectStartTimers[a]=void 0,e.startItemEffect(a,s,r,{target:{x:o,y:n},overwritten:{x:l,y:p}},h)}),q.DEFAULT_FRAME_INTERVAL)},i=this,s=0;s<this._itemBoxElement.length;s++)a(s)},e.prototype.startItemEffect=function(t,e,a,i,s){var r=this,o=a.querySelector(this.overwittenItemSelector);o&&a.removeChild(o);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+i.overwritten.x+"px -"+i.overwritten.y+"px",n.style.backgroundImage=a.style.backgroundImage,a.appendChild(n),e.style.backgroundPosition="-"+i.target.x+"px -"+i.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",a.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,a)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,a){"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",a.classList.contains(this.itemTransitioningClassName)&&a.classList.remove(this.itemTransitioningClassName);var i=a.querySelector(this.overwittenItemSelector);i&&a.removeChild(i)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,a,i){var s,r,o;void 0===e&&(e=0),void 0===a&&(a=!1);var n=this._wwa.getObjectAttributeById(t,q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((s=this._getBlankItemPos())===q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[s-1],this._forceSetItemBox(s,t)}else if(!1===a)if(s=e,o=this._itemBox[s-1],this._wwa.getObjectAttributeById(o,q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,q.ATR_NUMBER)){if((r=this._getBlankItemPos())===q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,o),this._forceSetItemBox(s,t)}else _=this._itemBox[s-1],this._forceSetItemBox(s,t);else s=e,_=this._itemBox[s-1],this._forceSetItemBox(s,t);this._updateEquipmentStatus(),this.updateItemBox(i?{insertPos:s,itemScreenPixelCoord:i.screenPixelCoord,itemBoxBackgroundImageCoord:i.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new f(q.MAP_WINDOW_WIDTH+(s-1)%3*q.CHIP_SIZE,q.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,i=Et("#item"+(t-1)+">.item-click-border"),s=this._wwa.getObjectAttributeById(e,q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&s!==S.NORMAL){var r=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==r){var o="";switch(this._wwa.userDevice.device){case P.PC:o="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.VR:o="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.SP:o="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:o="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:o="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:o="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.generatePageAndReserveExecution(""===r?o:r,!1,!0)}this._isClickableItemGot=!0}i.style.display="block",function(t){a._itemUsingEvent[t-1]=function(){(a.isControllable()||a._wwa._messageWindow.isItemMenuChoice())&&(a._wwa._itemMenu.close(),a._wwa._setNextPage(),a._wwa.onselectitem(t))}}(t),i.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 q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],q.ATR_DEFENCE));var a=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(a),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<q.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,q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=pt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],q.ATR_MODE)!==S.NORMAL&&((e=Et("#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 a=0;a<q.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],q.ATR_MODE)!==S.NORMAL&&((e=Et("#item"+a+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[a]),e.style.display="none"),this._itemBox[a]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=q.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=q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=lt.BATTLE},e.prototype.isFighting=function(){return this._state===lt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(H.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(H.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,q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(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,A.OBJECT,this._enemy.partsID),this._state=lt.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(),this._wwa.generatePageAndReserveExecution("相手の防御能力が高すぎる!",!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=lt.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,q.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),A.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(),a=this._camera.getPosition(),i=a.getPartsCoord(),s=a.getOffsetCoord(),r=(t.x-i.x)*q.CHIP_SIZE+e.x-s.x+q.CHIP_SIZE/2,o=(t.y-i.y)*q.CHIP_SIZE+e.y-s.y+q.CHIP_SIZE/2;return new f(r,o)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},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=q.CHIP_SIZE/X[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(q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<q.MIN_SPEED_INDEX||q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(Ot),Ct=function(){function t(t,e,a,i,s,r,o){this._partsID=t,this._position=e,this._imgCoord=a,this._status=i,this._message=s,this._item=r,this._battleEndCallback=o}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}(),Pt=function(){function t(t,e,a,i,s){this._player=t,this._objectID=e,this._srcPos=a,this._destPos=i,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,X[t],X[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}(),Nt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,a,i){this._queue.push(new Pt(this._player,t,e,a,i))},t.prototype.update=function(){for(var t=[],e=[],a=0;a<this._queue.length;a++)this._queue[a].update(),this._queue[a].isAchievedDestination?(t.push(this._queue[a]),this._wwa.setPartsOnPosition(v.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(v.OBJECT,this._queue[a].objID,this._queue[a].destination.getPartsCoord())):e.push(this._queue[a]);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 Mt(t,e){if("boolean"==typeof t)return t;var a=bt(t.left,e),i=bt(t.right,e);return function(t,e,a){switch(t){case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a;case"==":return e===a;case"!=":return e!==a;default:return!1}}(t.operator,a,i)}function bt(t,e){switch(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"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"RAND":return Math.floor(Math.random()*bt(t.argument,e));default:return 0}}function Rt(t,e,a){switch(t){case"=":return a;case"+":case"+=":return e+a;case"-":case"-=":return e-a;case"*":case"*=":return e*a;case"/":case"/=":return 0===a?0:e/a;case"%":case"%=":return 0===a?0:e%a;default:throw new Error("未定義の演算子です")}}var Lt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),xt=function(t,e,a,i,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=a,this.isSystemMessage=i,this.scoreOptions=s,this.extraInfo=r},Bt=function(){},Ut=function(t){function e(e){void 0===e&&(e=[]);var a=t.call(this)||this;return a.branches=e,a}return Lt(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 a=e[t];if(!a.next)return a}},e.prototype.evaluateAndGetNextNode=function(t){for(var e=0,a=this.branches;e<a.length;e++){var i=a[e];if(!i.descriminant||Mt(i.descriminant,t()))return i.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(Bt),Wt=function(t){function e(e,a,i){var s=t.call(this)||this;return s.macro=a,s.next=i,s.messageSegments=s.parseMessage(e),void 0===s.macro&&(s.macro=[]),s}return Lt(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 a="string"==typeof e?e:e();return"".concat(t).concat(a)}),"")},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}(Bt);function Yt(t){return void 0===t||(t instanceof Ut?t.branches.reduce((function(t,e){return t&&Yt(e.next)}),!0):t instanceof Wt?t.isEmpty()&&Yt(t.next):void 0)}var Ft=function(t){return t===F.SHOW_STR||"text"===t||"normalMacro"===t},kt=function(){function t(t,e,a,i,s,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=a,this._triggerPartsPosition=i,this.macroType=s,this.macroArgs=r}return t.prototype.isJunction=function(){return[F.IF,F.ELSE_IF,F.ELSE,F.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case F.IMGPLAYER:return this._executeImgPlayerMacro(),{};case F.IMGYESNO:return this._executeImgYesNoMacro(),{};case F.HPMAX:return this._executeHPMaxMacro(),{};case F.SAVE:return this._executeSaveMacro(),{};case F.ITEM:return this._executeItemMacro(),{};case F.DEFAULT:return this._executeDefaultMacro(),{};case F.OLDMAP:return this._executeOldMapMacro(),{};case F.PARTS:return this._executePartsMacro(),{};case F.MOVE:return this._executeMoveMacro(),{};case F.MAP:return this._executeMapMacro(),{};case F.DIRMAP:return this._executeDirMapMacro(),{};case F.IMGFRAME:return this._executeImgFrameMacro(),{};case F.IMGBOM:return this._executeImgBomMacro(),{};case F.DELPLAYER:return this._executeDelPlayerMacro(),{};case F.FACE:return this._executeFaceMacro(),{};case F.EFFECT:return this._executeEffectMacro(),{};case F.GAMEOVER:return this._executeGameOverMacro(),{};case F.IMGCLICK:return this._executeImgClickMacro(),{};case F.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case F.EFFITEM:return this._executeEffItemMacro(),{};case F.COLOR:return this._executeColorMacro(),{};case F.WAIT:return this._executeWaitMacro(),{};case F.SOUND:return this._executeSoundMacro(),{};case F.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case F.OLDMOVE:return this._executeOldMoveMacro(),{};case F.JUMPGATE:return this._executeJumpGateMacro(),{};case F.RECPOSITION:return this._executeRecPositionMacro(),{};case F.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case F.CONSOLE_LOG:return this._executeConsoleLogMacro(),{};case F.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case F.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case F.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case F.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case F.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case F.SET_AT:return this._executeSetAtMacro(),{};case F.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case F.SET_DF:return this._executeSetDfMacro(),{};case F.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case F.SET_MONEY:return this._executeSetMoneyMacro(),{};case F.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case F.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case F.VAR_SET:return this._executeVarSetMacro(),{};case F.VAR_ADD:return this._executeVarAddMacro(),{};case F.VAR_SUB:return this._executeVarSubMacro(),{};case F.VAR_MUL:return this._executeVarMulMacro(),{};case F.VAR_DIV:return this._executeVarDivMacro(),{};case F.VAR_MOD:return this._executeVarModMacro(),{};case F.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case F.GAME_SPEED:return this._executeGameSpeedMacro(),{};case F.SHOW_STR:case F.IF:return{};case F.LEGACY_IF:return this._executeLegacyIfMacro(),{};case F.ELSE_IF:case F.ELSE:case F.END_IF:return{};case F.SET_SPEED:return this._executeSetSpeedMacro(),{};case F.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case F.HIDE_STATUS:return this._executeHideStatusMacro(),{};case F.VAR_MAP:return this._executeVarMapMacro(),{};case F.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case F.SET:return{isGameOver:this._executeSetMacro().isGameOver};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),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var a=parseInt(this.macroArgs[t]);return isNaN(a)?e:a},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(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._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(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._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._parseInt(3,v.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,a,t,i)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new f(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new f(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,v.OBJECT),i=this._parseInt(3);if(a!==v.OBJECT&&a!==v.MAP)throw new Error("パーツ種別が不明です");if(0!==i&&1!==i&&(i=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===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,a,!!i)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._parseInt(3,v.OBJECT);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.appearPartsEval(this._triggerPartsPosition,e,a,t,i)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,v.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===v.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,a)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===V.ENERGY||t===V.STRENGTH||t===V.DEFENCE||t===V.GOLD)this._wwa.setStatusIconCoord(t,new f(e,a));else if(t===V.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new f(e,a));else if(t===V.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==V.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new f(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new f(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),a=this._parseInt(1),i=this._parseInt(2),s=this._parseInt(3),r=this._parseInt(4),o=this._parseInt(5);if(e<0||a<0||i<0||s<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new y(new f(e,a),new f(i,s),new f(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var i,s=this._parseInt(a);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((i=this._parseInt(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new f(s,i))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new f(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new f(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(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._parseInt(0),e=this._parseInt(1),a=this._parseInt(2),i=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||a<0||a>255||i<0||i>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,a,i)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0])},t}();var Gt,Vt=function(){function t(t,e,a,i,s,r,o){this._wwa=t,this._coord=e,this._width=a,this._height=i,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=o+"",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}(),Ht=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,e,new f(a.x,a.y),i,s,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=q.CHIP_SIZE+"px",_._monsterBox.style.height=q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Lt(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}(Vt),Kt=function(t){function e(e,a,i,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new f(2*q.CHIP_SIZE,30),7*q.CHIP_SIZE,40,i,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 f(a.x,a.y),340,30,i,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 Lt(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}(Vt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Gt||(Gt={}));var jt=function(){function t(t,e,a,i,s,r,o,n,_,c){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var h=this,u=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=a,this._width=i,this._height=s,this._message="",this._isVisible=o,this._isYesno=n,this._isItemMenu=_,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=c,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.YES),h.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case P.SP:case P.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,a,i){this._x=t,this._y=e,this._width=a,this._height=i,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,a,i,s){var r,o=i.getPartsCoord().substract(s.getPartsCoord()).y;r=t?Gt.BOTTOM:e?Gt.SCORE:a?Gt.CENTER:o>=Math.ceil(q.V_PARTS_NUM_IN_WINDOW/2)?Gt.TOP:Gt.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Gt.CENTER?(this._y=q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Gt.TOP?(this._y=Math.max(20,q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Gt.BOTTOM?(this._y=Math.min(q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Gt.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"),a=0,i="",s=0;s<t.length||0!=a;s++)if(this.isWideChar(t.charAt(s))?a+=2:a+=1,i+=t.charAt(s),a+1>2*q.MSG_STR_WIDTH){"。"!==t.charAt(s+1)&&"、"!==t.charAt(s+1)||(i+=t.charAt(s+1),s++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=i,e.appendChild(r),a=0,i=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YESP_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NO_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YES_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NOP_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YES_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NO_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var a=this._message.split("\n");a.forEach((function(e,i){var s;t._wwa.isClassicMode()?s=t.createClassicTextElement(e):(s=document.createElement("span")).textContent=a[i],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,a,i,s,r,o,n,_,c,h,u=this;e=document.createElement("div"),c=(n=document.getElementById("disp-energy")).style.backgroundPosition,h=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(a=document.createElement("div")).classList.add("savedata"),a.setAttribute("save_id",p),a.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(i=document.createElement("div")).classList.add("ss"),a.appendChild(i),(s=document.createElement("div")).classList.add("wide-cell-row"),s.style.backgroundPosition=c,s.style.backgroundImage=h,a.appendChild(s),e.appendChild(a),t.flag&&(i.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=Q.DATE_LAST_SAVE_TEXT_COLOR),i.appendChild(r),(o=document.createElement("div")).classList.add("status-icon"),o.style.backgroundImage=h,o.style.backgroundPosition="-120px -80px",s.appendChild(o),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),s.appendChild(_));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,a=document.querySelectorAll(".savedata"),i=a.length,s=0;s<i;s++)e=a[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=q.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+Q.QUICK_SAVE_MAX)%Q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Xt=function(){function t(t,e,a){this.id=t,this.imgFileName=e,this.parent=a,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,a){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,a.isNoEffect?this.damageDispElem.textContent="攻撃無効":a.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+a.damage},t}(),Jt=function(){function t(t,e,a){var i,s=this;this._wwa=t,this._imgFileName=e,this._parent=a,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)i=new Xt(r,this._imgFileName,this._element),this._edes.push(i),this._element.appendChild(i.elem);this._element.addEventListener("click",(function(){s._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var a=0;a<q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var i=this._wwa.getObjectAttributeById(e[a],q.ATR_X),s=this._wwa.getObjectAttributeById(e[a],q.ATR_Y),r=new f(i,s),o=this._wwa.getObjectAttributeById(e[a],q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],q.ATR_DEFENCE),c=new E(o,n,_,0),h=qt(t,c);this._edes[a].setResult(r,c,h),this._edes[a].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Zt=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function qt(t,e){var a=e.energy,i=t.strength-e.defence,s=Math.max(0,e.strength-t.defence),r=0,o=0;if(!(i>0))return new Zt(!0,!1,0);for(;;){if(r++,(a-=i)<=0)return new Zt(!1,!1,o);if(o+=s,r>1e4)return new Zt(!1,!0,0)}}var Qt,zt=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},$t=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Qt||(Qt={}));var te=function(){function t(t,e,a){var i=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=a,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){i._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(){i._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){i._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return zt(i,void 0,void 0,(function(){var t=this;return $t(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=Qt.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===Qt.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===Qt.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 a=e.split("\n");this._descriptionElement.textContent="";for(var i=0;i<a.length;i++){var s=document.createElement("span");s.textContent=a[i],this._descriptionElement.appendChild(s),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function ee(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function ae(t,e,a){var i,s=document.createElement("style");s.type="text/css",s.setAttribute("id",q.WWA_STYLE_TAG_ID),(i="head",document.getElementsByTagName(i))[0].appendChild(s),t.innerHTML=function(t,e){var a=t?'\n <div id="wwa-cover">\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(q.SCREEN_WIDTH,'" height="').concat(q.SCREEN_HEIGHT,'"></canvas>\n </div>'),i=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(a,"\n").concat(i,"\n")}(null!==e,a),null!==e&&(pt("wwa-cover").style.backgroundImage="url(".concat(e,")"),pt("wwa-cover").style.backgroundRepeat="no-repeat",pt("wwa-cover").style.backgroundPosition="0 0")}var ie=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=q.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=Et(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(a)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,a,i=null;for(e=0;e<t.COL_MAX;e++)for(a=0;a<t.ROW_MAX;a++)(i=pt(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&i.classList.remove("onpress")},t.prototype.openView=function(){this.close();pt(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}(),se=a(23);function re(t){return"^ /".concat(231*t+8310,"P+>A[]")}function oe(t){return(0,se.MD5)(t).toString()}var ne="map",_e="mapObject",ce="systemMessage",he="userVar",ue={mapAttribute:!0,objectAttribute:!0,message:!0},le=function(){},pe=function(){function t(){}return t.compress=function(t){var e,a,i={};for(e in t)if(!ue[e]){switch(typeof(a=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===a&&"worldName"!==e)continue;break;case"object":if(null===a){if(this._restartData[e]===a)continue}else if(void 0===(a=this.compressObject(e,a,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}i[e]=a}return i},t.compressObject=function(t,e,a){var i,s,r,o;switch(t){case ne:case _e:var n,_,c,h,u,l,p,d,E,f,w,y,m,g;for(u in i={},E={},d={},e)for(h in s=e[u],r=a[u],o={},_=-1,s)(p=s[h])!==r[h]&&(o[h]=p,void 0===E[p]&&(E[p]={}),void 0===(w=E[p])[u]&&(w[u]=[]),(m=w[u]).push(Number(h)));for(y in E)for(u in w=E[y],void 0===d[y]&&(d[y]={}),f=d[y],void 0===i[y]&&(i[y]=[]),_=-1,w)1===(m=w[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,i[y].push(this.getCompressArray(m),c));for(y in d)for(h in p=Number(y),_=-1,f=d[y])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?i[y].push(c,g[0]):i[y].push(c,this.getCompressArray(g));var A=[];for(y in _=-1,i)c=(n=Number(y))-_-1,_=n,A.push(c,i[y]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):A;case ce:var S;for(t in i={},e)S=e[t],a[t]!==S&&(i[t]=S);break;case he:return this.compressUserVars(e);default:return e}if(0!==Object.keys(i).length)return i},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,a){var i,s,r,o,n,_,c,h,u,l,p,d,E,f,w,y,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(r=0,o=0,_=0,c=0,w=0,p=[],f={},u=[],l=[],s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(-1===A&&(A=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new de(h,w++)),f[h].count++),8===++r&&(r=0,o++);for(n in f)p[f[n].index]=f[n];for(d in p.sort(this.idSort),E={},p)E[h=p[d].id]=Number(d),u[d]=h;for(s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(l[c++]=E[h]);if(a){for(y=g.length,A=-1,_=0,o=0;o<y;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===A&&(A=o),_=o);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var a,i,s,r,o,n,_=[];for(r=t.length,i=0,a=0;a<r;a++){for(o=t[a],n=0,s=a+1;s<r&&o===t[s];s++)n++,a=s;switch(n){case 0:_[i++]=o;break;case 1:_[i++]=o,_[i++]=o;break;default:_[i++]=o,_[i++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,a,i,s,r,o,n,_,c=[];for(e=-1,r=t.length,o=0,s=0;s<r;s++){for(a=(i=t[s])-e,n=0,_=s;_<r-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?c[o++]=a:(s=_,i+=n,c[o++]=0,c[o++]=a,c[o++]=n-this.MIN_LOOP_COUNT),e=i}return c},t.getDecompressArray=function(t){var e,a,i,s,r,o,n,_=[];for(e=-1,r=t.length,s=0,n=0;s<r;s++)if(0===(a=t[s])){for(o=(i=e+(a=t[++s]))+t[++s]+this.MIN_LOOP_COUNT;i<=o;i++)_[n++]=i;e=o}else i=e+a,_[n++]=i,e=i;return _},t.decompress=function(t){var e,a,i;for(a in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(i=t[a])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==i&&(i=this.decompressObject(a,i,e[a]));break;case"function":continue}e[a]=i}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,a){var i;switch(t){case ne:case _e:var s,r,o,n,_,c,h,u;i={},r=-1;var l,p,d=e;if(4===(u=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,a,this._firstRandomMapObjectUtf8Table[t]),a;for(h=0;h<u;h+=2)r=s=r+Number(d[h])+1,_=s,i[s]=d[h+1];for(c in i){for(_=Number(c),u=(d=i[c]).length,l=[],p=[],h=0;h<u;h+=2){var E=d[h],f=d[h+1];E instanceof Array&&(E=this.getDecompressArray(E)),f instanceof Array&&(f=this.getDecompressArray(f)),"object"==typeof E?l.push({x:E,y:f}):p.push({x:E,y:f})}var w;for(w in r=-1,l)if(r=s=r+Number(l[w].y)+1,E=l[w].x,n=String(s),E instanceof Array)for(u=(d=E).length,h=0;h<u;h++)o=String(d[h]),a[n][o]=_;else o=String(E),a[n][o]=_;for(w in r=-1,p)if(r=s=r+Number(p[w].x)+1,f=p[w].y,o=String(s),f instanceof Array)for(u=(d=f).length,h=0;h<u;h++)a[n=String(d[h])][o]=_;else a[n=String(f)][o]=_}return a;case he:return this.decompressUserVars(e);default:if(a);else{if(!e)return;a=a instanceof Array?[]:{}}for(t in e)a[t]=e[t];return a}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var a=e[0],i=e[1];return t[a]=i,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(q.USER_VAR_NUM),e=0;e<q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,a){var i,s,r,o,n,_,c,h,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],o=t[2],s=t[3];var f=t[1];if(E.set(f,p),a)for(w=E.length,u=0;u<w;u++)E[u]=E[u]|a[u];r=[];var w,y,m,g,A,S,v=o.length;for(w=s.length,y=0,m=0;y<w;y++){if((n=s[y])>=v)for(g=n-v,A=0;A<g;A++)r[m++]=S;else r[m++]=n;S=n}for(h=0,u=0,l=0,_=0,w=E.length,u=0;u<w;u++)for(h=0;h<8;h++){if(0!=(E[u]&1<<h)){if(void 0===(n=r[_++]))return!1;i=o[n],c=l%d,e[l/d|0][c]=i}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[_e]=this.getChangedUint8Array(e[_e],t[_e])},t.getChangedUint8Array=function(t,e){var a,i,s,r,o=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(s=0,r=0,i=0;i<o;i++)for(a=0;a<o;a++)t[i][a]!==e[i][a]&&(-1===_&&(_=r),n[r]=n[r]|1<<s),8===++s&&(s=0,r++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var a;if(e)try{if(a=this.decompress(e)[0])return a}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 le,t}(),de=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},Ee=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=Q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=Q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){pt("cell-load").textContent=z.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,a){var i=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=a,this.flag=!0;var s=document.createElement("img");s.src=t,s.addEventListener("load",(function(){i.flag=!0,i.ctx.drawImage(s,0,0,s.width,s.height,0,0,i.cvs.width,i.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,a,i,s,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,a=this.date.getDate(),i=this.date.getHours(),s=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(a=("0"+a).slice(-2))+" "+(i=("0"+i).slice(-2))+":"+(s=("0"+s).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),fe=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.save=function(e,a){var i=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,a,this.date),i},e}(Ee),ye=we,me=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),ge=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return me(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<Q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<Q.QUICK_SAVE_MAX;a++)(e=this[a]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),Ae=function(){return Ae=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var s in e=arguments[a])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Ae.apply(this,arguments)},Se=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?Ae(Ae({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?Ae(Ae({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},ve=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Te=function(t){function e(a,i,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 o=0;o<Q.QUICK_SAVE_MAX;o++)r[o]=new ye(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=i,r.createDataBase(),r.selectSaveData(),r}return ve(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(Q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var a=this.indexDBOpen();a.onupgradeneeded=function(e){var i=a.result,s={keyPath:t.keyPath};i.objectStoreNames.contains(Q.INDEXEDDB_TABLE_NAME)||i.createObjectStore(Q.INDEXEDDB_TABLE_NAME,s).createIndex("url","url",{unique:!1})},a.onsuccess=e.doNotAnything,a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var a=e.transaction(Q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(Q.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,i){return{url:location.href,id:t,hash:Re.checkOriginalMapString,image:e.toDataURL(),data:a,date:i,worldName:Re.worldName,mapDataRevisionKey:Re.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var a=t.index("url"),i=IDBKeyRange.only(location.href),s=a.getAll(i);s.onsuccess=function(){e(s.result)}},e.prototype.dbUpdateSaveData=function(t,a,i,s){var r=this,o=this.indexDBOpen();o.onupgradeneeded=e.doNotAnything,o.onsuccess=function(){var n=r.getObjectStore(o.result),_=pe.compress(i),c=r.makeSaveDataItem(t,a,_,s);r.selectDatas[t]=c;var h=n.put(c);h.onsuccess=e.doNotAnything,h.onerror=e.doNotAnything},o.onerror=e.doNotAnything,o.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var a=this,i=this.indexDBOpen();i.onupgradeneeded=e.doNotAnything,i.onsuccess=function(){var e=a.getObjectStore(i.result);t.forEach((function(t){e.delete([t,location.href])}))},i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=t.getObjectStore(a.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var a,i,s,r=[];for(i=e.length,a=0;a<i;a++){var o=e[a];try{s={id:o.id,hash:o.hash,data:o.data,date:o.date,image:o.image,worldName:o.worldName,mapDataRevisionKey:o.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(s.worldName,s.hash,s.mapDataRevisionKey);if(null===n){if(t[s.id]){var _=Se(pe.decompress(s.data)[0]);t[s.id].saveDataSet(s.image,_,s.date)}}else r.push({id:s.id,cause:n})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var c=r.map((function(t){return t.cause})).filter((function(t,e,a){return a.indexOf(t)===e}));t.onCompleteLoadingSaveData(c)}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(ge),Ie=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ie(e,t),e}(Ee),De=Oe,Ce=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Pe=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=Q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var i=0;i<Q.QUICK_SAVE_MAX;i++)a[i]=new De(i,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return Ce(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%Q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ge);function Ne(t,e){return(0,se.MD5)(t+e).toString()}var Me,be=function(){function t(e,a,i,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=Ne(a,i),this._wwaDBSaveList=new Te(s,r),this._wwaLogSaveList=new Pe,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,a){var i=this.list[a];return!!i&&i.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?M.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?M.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?M.CALL_BY_LOG_QUICK_LOAD:M.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?M.CALL_BY_LOG_QUICK_LOAD:t?M.CALL_BY_PASSWORD_LOAD:M.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?pt("cell-save").textContent=z.EMPTY_SAVE:pt("cell-save").textContent=z.QUICK_SAVE},t}(),Re=be;!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"}(Me||(Me={}));var Le,xe=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},Be=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ue=function(){function t(t,e,a,i){var s=this;this.id=t,this.fileName=e,this.audioContext=a,this.audioGain=i,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(s.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=a,this.audioGain=i,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.load()}return t.prototype.fetchSoundFile=function(){return xe(this,void 0,void 0,(function(){return Be(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 xe(this,void 0,void 0,(function(){return Be(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),xe(this,void 0,void 0,(function(){var e,a,i=this;return Be(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(a=s.sent())?(this.audioContext.decodeAudioData(a,(function(e){if(0===e.length)return console.log("サウンド ".concat(i.id," 番の音声ファイルのバッファサイズが 0 です ")),void i.retry(t);i.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;setTimeout((function(){return xe(e,void 0,void 0,(function(){return Be(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(){var t=this,e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var a=e.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),e.start(),e.onended=function(){var a=t.bufferSources.indexOf(e);-1!==a&&t.bufferSources.splice(a,1),t.disposeBufferSource(e)},this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=H.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),We=function(t,e){for(var a=new Array(t),i=0;i<a.length;i++)a[i]=new Array(e);return a};function Ye(t,e){var a=function(t){return t[Le.CHECK]+256*t[Le.CHECK+1]}(t),i=function(t,e){var a,i=0;if(t[Le.VERSION]>=29){for(var s=2;s<e;s++)i+=(a=t[s],((a%=256)>=128?a-256:a)*(s%8+1));i=i%65536&65535}return i}(t,e);if(a!==i)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+a+"ですが、実際の和は"+i+"でした。")}!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"}(Le||(Le={}));var Fe,ke,Ge=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"}(Fe||(Fe={})),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"}(ke||(ke={}));var Ve=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Ye(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"}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Le.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Le.MAPDATA_TOP:this.currentPosition=Le.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Fe.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Fe.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ge.MAP_ATR_MAX:Ge.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ge.OBJ_ATR_MAX:Ge.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Fe.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Fe.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Fe.MAP),this._convertAttributeV2toV3(Fe.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,i;if(t==Fe.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,i=Ge.MAP_LOCALGATE;else{if(t!=Fe.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,i=Ge.OBJECT_LOCALGATE}for(var s=0;s<e;s++){for(var r=9;r>=0;r--){var o=255&a[s][20+2*r],n=a[s][20+2*r]>>8,_=255&a[s][20+2*r+1],c=a[s][20+2*r+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===c?c=9e3:c>100&&(c+=9840),a[s][20+4*r]=o,a[s][20+4*r+3]=n,a[s][20+4*r+1]=_,a[s][20+4*r+2]=c}a[s][Ge.ATR_TYPE]===i&&(a[s][Ge.ATR_JUMP_X]>100&&(a[s][Ge.ATR_JUMP_X]+=9840),a[s][Ge.ATR_JUMP_Y]>100&&(a[s][Ge.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(Le.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Le.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Le.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Le.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Le.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Le.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Le.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Le.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Le.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Le.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Le.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Le.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Le.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Le.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Le.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Le.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Le.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Le.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Le.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?Le.ITEMBOX_TOP:Le.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ge.ITEMBOX_SIZE);for(var e=0;e<Ge.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,i,s;for(s=We(this.wwaData.mapWidth,this.wwaData.mapWidth),a=0;a<this.wwaData.mapWidth;a++)for(i=0;i<this.wwaData.mapWidth;i++)this.wwaData.version>29?(s[a][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(s[a][i]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(a*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(a*this.wwaData.mapWidth+i,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Fe.MAP?ke.MAP_LOAD:ke.OBJ_LOAD),s[a][i]>=e&&(s[a][i]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Fe.MAP?ke.MAP_LOAD:ke.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,a){var i,s,r;for(r=We(e,a),i=0;i<e;i++)for(s=0;s<a;s++)(i*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(i*a+s,e*a,t===Fe.MAP?ke.MAP_ATTR:ke.OBJ_ATTR),s!==Ge.ATR_CROP1&&s!==Ge.ATR_CROP2?(r[i][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[i][s]=0,this.currentPosition+=2);return this.emitProgress(e*a,e*a,t===Fe.MAP?ke.MAP_ATTR:ke.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,ke.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var He=function(){function t(t,e,a,i){this.wwaData=t,this.compressedMapData=e,this.startPosition=a,this.eventEmitter=i,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:ke.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:ke.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(Ge.SYSTEM_MESSAGE_NUM);for(e=0;e<Ge.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ge.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ge.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ge.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ge.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ge.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ge.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ge.DEFAULT_DISABLE_SAVE,t.isOldMap=Ge.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ge.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ge.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ge.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ge.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ge.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ge.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ge.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ge.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ge.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ge.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ge.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ge.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ge.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ge.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ge.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ge.DEFAULT_STR_COLOR_R,t.fontColorG=Ge.DEFAULT_STR_COLOR_G,t.fontColorB=Ge.DEFAULT_STR_COLOR_B,t.statusColorR=Ge.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ge.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ge.DEFAULT_STATUS_COLOR_B,t.moves=Ge.DEFAULT_MOVES,t.gameSpeedIndex=Ge.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ge.USER_VAR_NUM);for(e=0;e<Ge.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},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}(),Ke=function(){},je=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Xe=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},Je=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ze=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return je(e,t),e.fetch=function(t){return Xe(this,void 0,void 0,(function(){return Je(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 a="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(a));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(a));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(a))}},e.prototype.request=function(){return Xe(this,void 0,void 0,(function(){var t;return Je(this,(function(a){switch(a.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=a.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,a.sent()]}}))}))},e}(Ke),qe=a(106),Qe=a.n(qe),ze=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),$e=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},ta=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},ea=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return ze(e,t),e.prototype.request=function(){return $e(this,void 0,void 0,(function(){var t=this;return ta(this,(function(e){return[2,new Promise((function(e,a){Qe().readFile(t.fileName,(function(t,i){t&&a(t),e(i.buffer)}))}))]}))}))},e}(Ke),aa=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},ia=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},sa=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return aa(this,void 0,void 0,(function(){var t,e,a,i,s,r;return ia(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new Ze(n):new ea(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=o.sent())?(a=this.loadMapData(e),this.eventEmitter.dispatch("mapData",a),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return i=o.sent(),s=i.name||"",r=i.message||"",this.eventEmitter.dispatch("error",{name:s,message:r}),[3,4];case 4:return[2]}var n}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),a=function(t){var e,a,i=new Uint8Array(t.length);for(e=0,a=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(i[a++]=t[e],t[e]===t[e+1]){for(var s=t[e+2],r=0;r<s;r++)i[a++]=t[e];e+=2}if(a+255>=i.length){var o=new Uint8Array(i.length+65e3);o.set(i),i=o}}return console.log("EXTRACT DATA = "+a+" "+e),{byteMapData:i,byteMapLength:a,compressedEndPosition:e+3}}(e),i=a.byteMapData,s=a.byteMapLength,r=a.compressedEndPosition,o=new Ve(i,s,this.eventEmitter).extractAllData();return new He(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),ra=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var a=new CustomEvent(t,{detail:e});this.target.dispatchEvent(a)},t.prototype.addListener=function(t,e){var a=function(t){return e(t.detail)};return this.target.addEventListener(t,a),a},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),oa=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},na=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},_a="-?\\d+",ca="v\\[".concat(_a,"\\]"),ha="v\\[(".concat(_a,")\\]"),ua="HP|HPMAX|AT|DF|GD|STEP",la="".concat(ca,"|").concat(ua),pa="".concat(_a,"|").concat(ca,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|PX|PY","|").concat(ua),da="RAND\\((?:".concat(pa,")\\)"),Ea="RAND\\((".concat(pa,")\\)"),fa="".concat(da),wa="".concat(pa,"|").concat(fa),ya="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ma="^\\(",ga="\\)$",Aa=new RegExp("^".concat(_a,"$")),Sa=new RegExp("^".concat(ha,"$")),va=new RegExp("^".concat(Ea,"$")),Ta=new RegExp("".concat(ma,"(").concat(la,")").concat("=","(").concat(wa,")(").concat("\\+|\\-|\\*|\\/|%",")(").concat(wa,")").concat(ga)),Ia=new RegExp("".concat(ma,"(").concat(la,")(").concat(ya,")(").concat(wa,")").concat(ga)),Oa=new RegExp("".concat(ma,"(").concat(wa,")(").concat(">|<|<=|>=|==|!=",")(").concat(wa,")").concat(ga));function Da(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"PX":case"PY":return{type:t};default:var e=t.match(Sa);if(e){var a=e.length>=2?parseInt(e[1],10):null;return null===a||isNaN(a)?null:{type:"VARIABLE",index:a}}if(t.match(Aa)){var i=parseInt(t,10);return null===i||isNaN(i)?null:{type:"NUMBER",rawValue:i}}var s=t.match(va);if(s){var r=s.length>=2?Da(s[1]):null;return null!==r&&"RAND"!==r.type?{type:"RAND",argument:r}:null}return null}}function Ca(t,e){var a;switch(null===(a=Da(e))||void 0===a?void 0:a.type){case"VARIABLE":var i=e.match(/^v\[(\d+)\]$/),s=parseInt(i[1],10);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:s,rawValue:t};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"RAND":throw new Error("左辺値に乱数は入れられません")}}function Pa(t){return t.replace(/\s/g,"")}function Na(t,e){return bt(Da(t),e)}function Ma(t){var e=Pa(t).match(Oa);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var a=Da(e[1]),i=Da(e[3]);if(a&&i)return{left:a,right:i,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var ba,Ra=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},La=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},xa=function(t,e,a){if(a||2===arguments.length)for(var i,s=0,r=e.length;s<r;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))};function Ba(t,e,a){var i=new $;return i.current=t,i.total=e,i.stage=a,i}var Ua=function(){function a(a,s,n,c,p,d,y,m,A,S,v,T,I){void 0===s&&(s=!1),void 0===y&&(y=""),void 0===m&&(m=!1),void 0===A&&(A=null),void 0===T&&(T=!1),void 0===I&&(I=null);var O,D=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return D._main()},this.soundCheckCaller=function(){return D.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return D._keyStore.checkHitKey(e.KEY_ESC)||D._keyStore.checkHitKey(e.KEY_SHIFT)||D._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ra(pt("wwa-wrapper")),window.addEventListener("click",(function(t){D._isActive=!1})),pt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),D._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=pt("progress-panel"),(O=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?pt("version").textContent="WWA Wing Ver.3.11.5":this._setLoadingMessage(O,0)}catch(t){}this._dumpElement=A;var R=window.AudioContext||window.webkitAudioContext;R&&(this.audioContext=new R,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var L=new Audio;"no"!==L.canPlayType("audio/mpeg")&&""!==L.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=s,this._isClassicModeEnable=c,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),y?"/"!==y[y.length-1]&&(y+="/"):y="./audio/",this._audioDirectory=y,this._bottomButtonType=d?h.GOTO_WWA:h.BATTLE_REPORT;var x=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===P.GAME){if(this.userDevice.os===C.NINTENDO)q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===N.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case P.VR:case P.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(pt("cell-save").textContent=z.QUICK_SAVE,this._usePassword?pt("cell-load").textContent=z.PASSWORD:pt("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:pt("cell-gotowwa").textContent=z.GOTO_WWA;break;case h.BATTLE_REPORT:pt("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case h.GAME_END:pt("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(a){D._wwaData=a,D._wwaData.isItemEffectEnabled=p;try{D._hasTitleImg?pt("version").textContent+=" (Map data Ver. "+Math.floor(D._wwaData.version/10)+"."+ +D._wwaData.version%10+")":D._setLoadingMessage(O,1)}catch(t){}var s=pt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");s.pop(),s.push(D._wwaData.mapCGName),D._wwaData.mapCGName=s.join("/"),D._startTime=(new Date).getTime(),D._restartData=JSON.parse(JSON.stringify(D._wwaData)),D.checkOriginalMapString=D._generateMapDataHash(D._restartData),D.initCSSRule(),D._setProgressBar(Ba(0,4,j.GAME_INIT)),D._setLoadingMessage(O,2);var n=new Image;n.src=D._wwaData.mapCGName,n.addEventListener("error",(function(){D._setErrorMessage("画像ファイル「"+D._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",O)}));var c=D._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),h=function(t){t.style.backgroundImage="url("+c+")"};Array.prototype.forEach.call(ft("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(D._wwaData.imgItemboxX*q.CHIP_SIZE,"px -").concat(D._wwaData.imgItemboxY*q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ft("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ft(".item-cell>.item-disp"),h),Array.prototype.forEach.call(ft("div.wide-cell-row>.status-icon"),h),D.setStatusIconCoord(V.ENERGY,new f(D._wwaData.imgStatusEnergyX,D._wwaData.imgStatusEnergyY)),D.setStatusIconCoord(V.STRENGTH,new f(D._wwaData.imgStatusStrengthX,D._wwaData.imgStatusStrengthY)),D.setStatusIconCoord(V.DEFENCE,new f(D._wwaData.imgStatusDefenceX,D._wwaData.imgStatusDefenceY)),D.setStatusIconCoord(V.GOLD,new f(D._wwaData.imgStatusGoldX,D._wwaData.imgStatusGoldY)),D._setProgressBar(Ba(1,4,j.GAME_INIT)),D._setLoadingMessage(O,3),D._mapIDTableCreate(),D._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-x)+"ms"),D._cvs=pt("wwa-map");var y=D._cvs.getContext("2d",{alpha:!1});y.fillStyle="rgba( 255, 255, 255, 0.5)",y.fillRect(0,0,440,440);var A=new w(D,D._wwaData.playerX,D._wwaData.playerY);D._camera=new vt(A),D._itemMenu=new ie;var S=new E(D._wwaData.statusEnergy,D._wwaData.statusStrength,D._wwaData.statusDefence,D._wwaData.statusGold);D._player=new Dt(D,A,D._camera,S,D._wwaData.statusEnergyMax,D._wwaData.moves,D._wwaData.gameSpeedIndex),D._objectMovingDataManager=new Nt(D,D._player),D._camera.setPlayer(D._player),D._keyStore=new r,D._mouseStore=new _,T?(D._virtualPadButtonElements={BUTTON_ENTER:pt("wwa-enter-button"),BUTTON_ESC:pt("wwa-esc-button"),BUTTON_FAST:pt("wwa-fast-button"),BUTTON_SLOW:pt("wwa-slow-button"),BUTTON_LEFT:pt("wwa-left-button"),BUTTON_UP:pt("wwa-up-button"),BUTTON_RIGHT:pt("wwa-right-button"),BUTTON_DOWN:pt("wwa-down-button")},D._virtualPadStore=new ht(D._virtualPadButtonElements,ee(),pt("wwa-virtualpad-right"),pt("wwa-virtualpad-left"),D._setVirtualPadTouch.bind(D),D._setVirtualPadLeave.bind(D)),function(t,e){if(null===t)return;var a=document.createElement("button");a.classList.add("wwa-virtualpad-toggle-button"),a.textContent="仮想パッド表示切り替え",a.addEventListener("click",e),t.appendChild(a)}(I,(function(){D._virtualPadStore.toggleVisible()}))):(D._virtualPadButtonElements=null,D._virtualPadStore=new ht({})),D._gamePadStore=new l,D._pages=[],D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._yesNoChoiceCallInfo=M.NONE,D._prevFrameEventExected=!1,D._isLastPage=!1,D._reservedPartsAppearances=[],D._reservedJumpDestination=void 0,D._shouldSetNextPage=!1,D._passwordLoadExecInNextFrame=!1,D._messageWindow=new jt(D,50,180,340,0,D._wwaData.mapCGName,!1,!0,!1,pt("wwa-wrapper")),D._scoreWindow=new Kt(D,new f(50,50),!1,pt("wwa-wrapper")),D._wwaSave=new Re(ba,ba._wwaData.worldName,ba._wwaData.worldPassNumber,D._checkSaveDataCompatibility.bind(D),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Me.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Me.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Me.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),D._isDisallowLoadOldSave=m,D._messageWindow.setWWASave(D._wwaSave),pe.setRestartData(D._restartData,D._wwaData),D.clearFaces();var N=pt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof N&&(D._useSuspend=!0,N)){var R=pe.getStartWWAData(N);D._restartData!==R&&(D._applyQuickLoad(R),D._wwaSave.resumeStart())}var L=pt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==L&&D._wwaSave.setAutoSaveInterval(0|Number(L));var B=pt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(D._useLookingAround=!(B&&B.match(/false/i)),D._setProgressBar(Ba(2,4,j.GAME_INIT)),D._setLoadingMessage(O,4),window.addEventListener("keydown",(function(t){if(D._isActive){if(D.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();D._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?D._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():D._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(D._isActive){if(D.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();D._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||D._player.isWaitingMessage()||D._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){D._keyStore.allClear(),D._mouseStore.clear(),D._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){D._keyStore.allClear(),D._mouseStore.clear(),D._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){D._isActive&&t.preventDefault()})),D._mouseControllerElement=pt("wwa-controller"),D._mouseControllerElement.addEventListener("mousedown",(function(t){if(D._isActive&&1===t.which){if(D._mouseStore.getMouseState()!==i.NONE)return void t.preventDefault();var e=wt(t.clientX,t.clientY),a=D._player.getDrawingCenterPosition(),s=e.substract(a),r=Math.abs(s.x),o=Math.abs(s.y),n=void 0,_=!1;if(r<q.CHIP_SIZE&&o<q.CHIP_SIZE){switch(a.x/q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(a.y/q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(s.y>0&&o>r?n=u.DOWN:s.y<0&&o>r?n=u.UP:s.x>0&&o<r?n=u.RIGHT:s.x<0&&o<r&&(n=u.LEFT)),D._mouseStore.setPressInfo(n,0)}})),D._mouseControllerElement.addEventListener("mouseleave",(function(t){D._mouseStore.clear()})),D._mouseControllerElement.addEventListener("mouseup",(function(t){D._isActive&&1===t.which&&(D._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(D.audioContext){var U=function(){D.audioContext.createBufferSource().start(0),D._mouseControllerElement.removeEventListener("touchstart",U),U=null};D._mouseControllerElement.addEventListener("touchstart",U)}D._mouseControllerElement.addEventListener("touchstart",(function(t){if(D._isActive)if(D._mouseStore.getMouseState()===i.NONE){for(var e=t.changedTouches,a=e.length,s=0;s<a;s++){var r=e[s],o=wt(r.clientX,r.clientY),n=D._player.getDrawingCenterPosition(),_=o.substract(n),c=Math.abs(_.x),h=Math.abs(_.y),l=void 0,p=!1;if(c<q.CHIP_SIZE&&h<q.CHIP_SIZE){switch(n.x/q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&h>c?l=u.DOWN:_.y<0&&h>c?l=u.UP:_.x>0&&h<c?l=u.RIGHT:_.x<0&&h<c&&(l=u.LEFT)),D._mouseStore.setPressInfo(l,r.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var W=function(t){if(D._isActive)for(var e=0;e<t.changedTouches.length;e++)if(D._mouseStore.getTouchID()===t.changedTouches[e].identifier){D._mouseStore.setReleaseInfo(),t.preventDefault();break}};D._mouseControllerElement.addEventListener("touchend",W),D._mouseControllerElement.addEventListener("touchcancel",W)}pt("button-load").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.QUICK_LOAD)})),pt("button-save").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.QUICK_SAVE)})),pt("button-restart").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.RESTART_GAME)})),pt("button-gotowwa").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ft(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){D._displayHelp()}))})),D._frameCoord=new f(q.IMGPOS_DEFAULT_FRAME_X,q.IMGPOS_DEFAULT_YESNO_Y),D._battleEffectCoord=new f(q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),D._battleEstimateWindow=new Jt(D,D._wwaData.mapCGName,pt("wwa-wrapper")),D._passwordWindow=new te(D,pt("wwa-wrapper"),m),D._monsterWindow=new Ht(D,new f(50,180),340,60,!1,pt("wwa-wrapper"),D._wwaData.mapCGName),D._setProgressBar(Ba(3,4,j.GAME_INIT)),D._isLoadedSound=!1,D._temporaryInputDisable=!1,D._paintSkipByDoorOpen=!1,D._clearFacesInNextFrame=!1,D._useConsole=!1,D.wwaCustomEvent("wwa_startup"),D._cgManager=new St(y,D._wwaData.mapCGName,D._frameCoord,(function(){D._isSkippedSoundMessage=!0;var a=function(){switch(D.userDevice.device){case P.PC:D.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case P.SP:D.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===D._wwaData.systemMessage[Y.LOAD_SE])return D._isLoadedSound=!0,a(),D._setLoadingMessage(O,j.AUDIO),D.loadSound(),void window.requestAnimationFrame(D.soundCheckCaller);if("OFF"===D._wwaData.systemMessage[Y.LOAD_SE])return D._isLoadedSound=!1,a(),void D.openGameWindow();if(D._isSkippedSoundMessage=!1,D._hasTitleImg||O.clearRect(0,0,q.SCREEN_WIDTH,q.SCREEN_HEIGHT),D._usePassword){var i="効果音・BGMデータをロードしますか?";v&&(i+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),D._messageWindow.setMessage(""===D._wwaData.systemMessage[Y.LOAD_SE]?i:D._wwaData.systemMessage[Y.LOAD_SE]),D._messageWindow.show(),D._setProgressBar(Ba(4,4,j.GAME_INIT));var s=setInterval((function(){D._keyStore.update(),D._gamePadStore.update(),D._virtualPadStore.update(),D._yesNoJudgeInNextFrame===g.UNSELECTED&&(D._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||D._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||D._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||D._virtualPadStore.checkTouchButton("BUTTON_ENTER")?D._yesNoJudgeInNextFrame=g.YES:(D._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||D._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||D._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||D._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(D._yesNoJudgeInNextFrame=g.NO)),D._yesNoJudgeInNextFrame===g.YES?(clearInterval(s),D._messageWindow.update(),D._yesNoJudge=D._yesNoJudgeInNextFrame,D._messageWindow.setInputDisable(),setTimeout((function(){D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!0,D._setLoadingMessage(O,j.AUDIO),D.loadSound(),window.requestAnimationFrame(D.soundCheckCaller)}),q.YESNO_PRESS_DISP_FRAME_NUM*q.DEFAULT_FRAME_INTERVAL)):D._yesNoJudgeInNextFrame===g.NO&&(clearInterval(s),D._messageWindow.update(),D._yesNoJudge=D._yesNoJudgeInNextFrame,D._messageWindow.setInputDisable(),setTimeout((function(){D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!1,D.openGameWindow()}),q.YESNO_PRESS_DISP_FRAME_NUM*q.DEFAULT_FRAME_INTERVAL))}),q.DEFAULT_FRAME_INTERVAL)}else clearInterval(s),D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!0,D.loadSound(),window.requestAnimationFrame(D.soundCheckCaller)})),D.wwaCustomEvent("wwa_start")};var B=new ra;B.addListener("mapData",(function(t){return D._loadHandler(t)})),B.addListener("progress",(function(t){return D._setProgressBar(t)})),B.addListener("error",(function(t){return D._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,O)})),new sa(a,B).requestAndLoadMapData().then((function(){return Ra(D,void 0,void 0,(function(){return La(this,(function(t){return this._canDisplayUserVars=v,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,S?(e=S,oa(void 0,void 0,void 0,(function(){return na(this,(function(t){return[2,fetch(e).then((function(t){return 200===t.status||304===t.status?{kind:"data",data:t}:{kind:"httpError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。ステータスコード: ").concat(t.status)}})).catch((function(t){return{kind:"connectionError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return oa(void 0,void 0,void 0,(function(){var e,a;return na(this,(function(i){switch(i.label){case 0:return"data"!==t.kind?[3,2]:(a={kind:"data"},[4,t.data.json()]);case 1:return a.data=i.sent(),e=a,[3,3];case 2:e=t,i.label=3;case 3:return[2,e]}}))}))})).catch((function(t){return{kind:"brokenJson",errorMessage:"ファイル ".concat(e," が壊れています。")}}))]}))}))):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[2,void 0];var e}))}))})).then((function(t){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return D._userVarNameListRequestError=t,void D._updateVarDumpInformationArea(D._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return D._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(S," が正しい形式で書かれていません。")},void D._updateVarDumpInformationArea(D._userVarNameListRequestError.errorMessage,!0);if(D._userVarNameList=D.convertUserVariableNameListToArray(t.data),null!==D._dumpElement)for(var e=function(){var t=a.toString(10);if(!D._userVarNameList[a])return"continue";var e=".var-index".concat(t),i=D._dumpElement.querySelector(e),s=i.querySelector("".concat(e," > div"));s.textContent=D._userVarNameList[a],i.setAttribute("data-labelled-var-index","true"),i.addEventListener("mouseover",(function(){return s.removeAttribute("aria-hidden")})),i.addEventListener("mouseleave",(function(){return s.setAttribute("aria-hidden","true")}))},a=0;a<q.USER_VAR_NUM;a++)e()}else D._updateVarDumpInformationArea(t.errorMessage,!1)}))}return a.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(q.USER_VAR_NUM),a=0;a<q.USER_VAR_NUM;a++)e[a]=void 0;return Object.keys(t).forEach((function(a){var i=parseInt(a,10);"string"!=typeof t[a]||"string"!=typeof a||isNaN(i)||i<0||i>=q.USER_VAR_NUM||(e[i]=t[a])})),e},a.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(pt("progress-message-container").textContent=t.stage===q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:rt[t.stage],pt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*q.MAP_WINDOW_WIDTH+"px",pt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?pt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":pt("progress-message-container").textContent="ゲームデータを読み込んでいます。",pt("progress-bar-audio").style.width=t.current*q.MAP_WINDOW_WIDTH/t.total+"px",pt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},a.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+q.LOADING_FONT,t.fillText(ot[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+q.LOADING_FONT,t.fillText("WWA Wing Ver.3.11.5",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=ot.length)t.font=et.LOADING+"px "+q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(ot[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<ot.length&&t.fillText(ot[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var a;a=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(ot.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,a):(t.clearRect(tt.LOADING_X,a-tt.LINE,q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,a))}},a.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,q.SCREEN_WIDTH,q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+q.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*a)})))},a.prototype.createSoundInstance=function(t){if(0!==t&&t!==H.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ue(t,e,this.audioContext,this.audioGain)}},a.prototype.loadSound=function(){var t=this;this.sounds=new Array(q.SOUND_MAX+1),this.createSoundInstance(H.DECISION),this.createSoundInstance(H.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][q.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][q.ATR_TYPE]!==q.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][q.ATR_SOUND];this.createSoundInstance(a)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var a=e.match(/^\$sound=(\d+)/);if(a&&!(a.length<2)){var i=parseInt(a[1],10);!isNaN(i)&&0<i&&i<H.NO_SOUND&&t.createSoundInstance(i)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},a.prototype.checkAllSoundLoaded=function(){var a=0,i=0;if(!this._hasTitleImg)var s=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var r=1;r<=q.SOUND_MAX;r++){var o=this.sounds[r];void 0===o||o.isError()||(i++,o.hasData()&&a++)}if(a<i&&!this._soundLoadSkipFlag)return this._setProgressBar(Ba(a,i,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Ba(q.SOUND_MAX,q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(s,j.FINISH),this.openGameWindow()},a.prototype._setSoundLoadedCheckTimer=function(t){var e=this,a=this.sounds[t];a.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?a.hasData()?(a.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},a.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},a.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=H.BGM_LB&&this._wwaData.bgm===t))if((t===H.NO_SOUND||t>=H.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].hasData()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==H.NO_SOUND)this.sounds[t].hasData()?t>=H.BGM_LB?(this.sounds[t].play(),this._wwaData.bgm=t):this.sounds[t].play():t>=H.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===H.NO_SOUND?this._wwaData.bgm=0:t>=H.BGM_LB&&(this._wwaData.bgm=t)},a.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();pt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=pt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var i=pe.getStartWWAData(a);this._restartData!==i&&(this._applyQuickLoad(i),this._wwaSave.resumeStart())}setTimeout((function(){pt("wwa-wrapper").removeChild(pt("wwa-cover")),t._main()}),q.SPLASH_SCREEN_DISP_MILLS)},a.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(pt("item"+(t-1)).classList.add("onpress"),this.playSound(H.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),a=this.getObjectAttributeById(e,q.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(a),!1,!1,e,v.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},a.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var i=pt(k[t]);if(this.playSound(H.DECISION),this._itemMenu.close(),i.classList.add("onpress"),t===b.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case M.CALL_BY_QUICK_LOAD:case M.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case M.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case M.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case M.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case M.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case M.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case M.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===b.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=M.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_QUICK_SAVE));else if(t===b.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_RESTART_GAME;else if(t===b.GOTO_WWA)if(a)this._bottomButtonType!==h.GOTO_WWA&&pt(k[b.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=M.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=M.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},a.prototype.onpasswordloadcalled=function(){this._usePassword?(pt(k[b.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},a.prototype.onpasswordsavecalled=function(){pt(k[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_PASSWORD_SAVE)},a.prototype.onpasssuspendsavecalled=function(){pt(k[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_SUSPEND)},a.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(H.DECISION),this._itemMenu.openView()},a.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,a;if(e=t===R.UP?this._player.speedUp():this._player.speedDown(),a="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)a+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else a+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.generatePageAndReserveExecution(a,!1,!0)}else this.generatePageAndReserveExecution("ここでは移動速度を\n変更できません。",!1,!0)},a.prototype.isBattleSpeedIndexForQuickBattle=function(t){return q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},a.prototype._executeNode=function(t){var e;if(t instanceof Wt)return null===(e=t.macro)||void 0===e||e.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),xa([t],this._executeNode(t.next),!0);if(t instanceof Ut){var a=t.evaluateAndGetNextNode(this._generateTokenValues.bind(this));return a?this._executeNode(a):[]}return[]},a.prototype._executeNodes=function(t){try{return{isError:!1,messages:this._executeNode(t)}}catch(t){return{isError:!0}}},a.prototype._main=function(){var a,s=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var r=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return s.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return r&&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 n=this._pages.shift(),_=this._executeNodes(n.firstNode);if(!0===_.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var c=_.messages.filter((function(t){return!t.isEmpty()}));if(n.scoreOptions&&0===c.length&&c.push(new Wt("スコアを表示します。")),c.length>0){var h=c.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(h),this._messageWindow.setYesNoChoice(n.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),n.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),n.scoreOptions&&(this._lastScoreOptions=n.scoreOptions,this.updateScore(n.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=n.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow();break}}this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount();this._player.getPosition();var l=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(M.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[l])?this._checkTurnKeyPressed()?this._player.setDir(l):(this._player.controll(l),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.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(o.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(o.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(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(R.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(R.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(H.DECISION),this.onselectbutton(b.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(H.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZR)?this.onselectbutton(b.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZL)?this.onselectbutton(b.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_R)?this.onselectbutton(b.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(b.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(e.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_Y))&&this._displayHelp()),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();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(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(H.DECISION),this._yesNoDispCounter=q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.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(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var p=0;p<k.length;p++){(w=pt(k[p])).classList.contains("onpress")&&w.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(H.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var d=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),E=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),f=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(d===t.KEYDOWN||d===t.KEYPRESS_MESSAGECHANGE||E===t.KEYDOWN||E===t.KEYPRESS_MESSAGECHANGE||f===t.KEYDOWN||f===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===i.MOUSEDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(p=0;p<k.length;p++){var w;(w=pt(k[p])).classList.contains("onpress")&&w.classList.remove("onpress")}this._setNextPage()}}if(null===(a=this._inlineUserVarViewer)||void 0===a?void 0:a.isVisible){var y=!1;this._keyStore.getKeyState(e.KEY_DOWN)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,y=!0),this._keyStore.getKeyState(e.KEY_UP)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,y=!0),this._keyStore.getKeyState(e.KEY_RIGHT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._keyStore.getKeyState(e.KEY_LEFT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=q.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>q.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=q.USER_VAR_NUM),y&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(e.KEY_V)===t.KEYDOWN&&this._setNextPage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.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.isWatingEstimateWindow()||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!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.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*q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&pt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&pt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&pt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&pt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){s._loadType===L.QUICK_LOAD?(s._quickLoad(),s.wwaCustomEvent("wwa_quickload")):s._loadType===L.RESTART_GAME?(s._restartGame(),s.wwaCustomEvent("wwa_restert")):s._loadType===L.PASSWORD&&(s._applyQuickLoad(s._passwordSaveExtractData),s._passwordSaveExtractData=void 0,s.wwaCustomEvent("wwa_passwordload")),setTimeout(s.mainCaller,q.DEFAULT_FRAME_INTERVAL,s)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(p=0;p<q.USER_VAR_NUM;p++){var A=p.toString(10);this._dumpElement.querySelector(".var".concat(A)).textContent=this._wwaData.userVar[p]+""}},a.prototype.vibration=function(t){this._gamePadStore.vibration(t)},a.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),i=this._camera.getPosition().getOffsetCoord(),s=q.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,q.MAP_WINDOW_WIDTH,q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,q.MAP_WINDOW_WIDTH,q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var o=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();s=this._camera.getTransitionStepNum()*q.CHIP_SIZE}var _=!1;if(s!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=s,_=!0),a.x===this._cgManager.cpPartsLog.x&&a.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=a.x,this._cgManager.cpPartsLog.y=a.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,n,s,!0),this._drawPlayer(o,n,s,!0),this._drawObjects(o,n,s,!0),this._camera.isFinalStep()))var c=255,h=setInterval((function(){var t=pt("wwa-fader");if((c-=3*q.FADEOUT_SPEED)<=0)return clearInterval(h),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=c/255+""}),20);this._drawMap(a,i,s,!1,_),this._drawPlayer(a,i,s),this._drawObjects(a,i,s,!1,_),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,q.CHIP_SIZE*(t-a.x)-i.x,q.CHIP_SIZE*(e-a.y)-i.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},a.prototype._drawMap=function(t,e,a,i,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),void 0!==t){var r,o=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW);if(r=0,i)for(var h=o;h<=n;h++)for(var u=_;u<=c;u++){var l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][q.ATR_X]/q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][q.ATR_Y]/q.CHIP_SIZE,E=q.CHIP_SIZE*(h-t.x)-e.x,f=q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,f,a)}else{for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,s=!0),r++}if(s){this._cgManager.clearBackCanvasWithLowerYLimit(a);for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][q.ATR_X]/q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][q.ATR_Y]/q.CHIP_SIZE,E=q.CHIP_SIZE*(h-t.x)-e.x,f=q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},a.prototype._drawPlayer=function(t,e,a,i){if(void 0===i&&(i=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var s,r=this._player.getPosition().getPartsCoord(),o=this._player.getPosition().getOffsetCoord(),n=O[this._player.getDir()],_=(r.x-t.x)*q.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*q.CHIP_SIZE+o.y-e.y;Math.abs(o.x),Math.abs(o.y),this._player.getDir();s=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,i?this._cgManager.drawCanvasWithLowerYLimit(s,this._wwaData.playerImgPosY,_,c,a):this._cgManager.drawCanvasWithUpperYLimit(s,this._wwaData.playerImgPosY,_,c,a)}},a.prototype._drawObjects=function(t,e,a,i,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),void 0!==t){var r,o,n,_,c,h,u,l,p,d,E,w,y,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),v=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW),I=0,O=this._animationCounter>q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(i)for(d=A;d<=S;d++)for(E=v;E<=T;E++)D&&new f(d,E).equals(this._monster.position)||(w=this._wwaData.mapObject[E][d],r=new f(0,0),this._wwaData.objectAttribute[w][q.ATR_MOVE]!==x.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(r=p),c=q.CHIP_SIZE*(d-t.x)+r.x-e.x,h=q.CHIP_SIZE*(E-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,u=this._wwaData.objectAttribute[w][q.ATR_TYPE],l=this._wwaData.objectAttribute[w][q.ATR_NUMBER],0===w||this._checkNoDrawObject(new f(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,P,N,M,b,R=[],L=[];for(d=A;d<=S;d++)for(E=v;E<=T;E++)y=w=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[w][q.ATR_TYPE],l=this._wwaData.objectAttribute[w][q.ATR_NUMBER],this._checkNoDrawObject(new f(d,E),u,l)&&(y=0),P=this._wwaData.objectAttribute[w][q.ATR_MOVE]===x.STATIC,0!==y&&(N=!(!D||!new f(d,E).equals(this._monster.position)),P?L.push(new m(w,d,E,P,N)):(R.push(new m(w,d,E,P,N)),y=0),N&&(y=0)),this._cgManager.mapObjectCache[I]!==y&&(this._cgManager.mapObjectCache[I]=y,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(R,L)),b=R.length,M=0;M<b;M++)if(d=(C=R[M]).x,E=C.y,w=C.partsIDObj,P=C.isStatic,N=C.isFighting,c=q.CHIP_SIZE*(d-t.x)-e.x,h=q.CHIP_SIZE*(E-t.y)-e.y,P){if(N)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(c+=p.x,h+=p.y),o=O||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},a.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)}},a.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)},a.prototype._drawFrame=function(){this._cgManager.drawFrame()},a.prototype._checkNoDrawObject=function(t,e,a){var i=this._player.getPosition(),s=i.getPartsCoord();return!(!i.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===q.OBJECT_DOOR&&0===a||(e===q.OBJECT_STATUS||e===q.OBJECT_MESSAGE||e===q.OBJECT_ITEM||e===q.OBJECT_SELL||e===q.OBJECT_BUY||e===q.OBJECT_SELL||e===q.OBJECT_LOCALGATE))},a.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},a.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},a.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},a.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][q.ATR_TYPE]},a.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][q.ATR_TYPE]},a.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[i][e]},a.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,q.ATR_STRING)},a.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[i][e]},a.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},a.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},a.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][q.ATR_X]},a.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][q.ATR_Y]},a.prototype.getMessageById=function(t){return this._wwaData.message[t]},a.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},a.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],i=this._wwaData.mapAttribute[a][q.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(v.MAP)!==a)&&(i===q.MAP_STREET?r=this._execMapStreetEvent(t,a,i):i===q.MAP_WALL?r=this._execMapWallEvent(t,a,i):i===q.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,i):i===q.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,i)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.MAP,a),r)},a.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.mapObject[t.y][t.x],i=this._wwaData.objectAttribute[a][q.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(v.OBJECT)===a||(i===q.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,i):i===q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,i):i===q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,i):i===q.OBJECT_ITEM?this._execObjectItemEvent(t,a,i):i===q.OBJECT_DOOR?this._execObjectDoorEvent(t,a,i):i===q.OBJECT_STATUS?this._execObjectStatusEvent(t,a,i):i===q.OBJECT_BUY?this._execObjectBuyEvent(t,a,i):i===q.OBJECT_SELL?this._execObjectSellEvent(t,a,i):i===q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,i):i===q.OBJECT_SCORE?this._execObjectScoreEvent(t,a,i):i===q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,i):i===q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,i),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.OBJECT,a))},a.prototype._execMapStreetEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][q.ATR_ITEM];if(0!==i&&!this._player.hasItem(i))return!1;this.reserveAppearPartsInNextFrame(t,A.MAP,e);var s=this._wwaData.mapAttribute[e][q.ATR_STRING],r=this._wwaData.message[s],o=this._wwaData.mapAttribute[e][q.ATR_NUMBER];return this._waitFrame+=o*q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==o},a.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Yt(e.firstNode)}),!1)},a.prototype._execMapWallEvent=function(t,e,a){var i=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(i,q.ATR_TYPE);if(0===i||s===q.OBJECT_NORMAL||s===q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(i,q.ATR_ITEM))||this.getObjectAttributeById(s,q.ATR_MODE)===q.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,A.MAP,e);var r=this._wwaData.mapAttribute[e][q.ATR_STRING],o=this._wwaData.message[r];return this.generatePageAndReserveExecution(o,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),!1}return!1},a.prototype._execMapLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][q.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][q.ATR_JUMP_Y];return s>q.RELATIVE_COORD_LOWER&&(s=t.x+s-q.RELATIVE_COORD_BIAS),r>q.RELATIVE_COORD_LOWER&&(r=t.y+r-q.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,A.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new w(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),!0)},a.prototype._execMapUrlGateEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.generatePageAndReserveExecution(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=M.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0],!0):void(location.href=yt(this._wwaData.message[i].split(/\s/g)[0])))},a.prototype._execObjectNormalEvent=function(t,e,a){},a.prototype._execObjectMessageEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][q.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][q.ATR_NUMBER]*q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),this.playSound(o)},a.prototype._execObjectStatusEvent=function(t,e,a){var i=new E(this._wwaData.objectAttribute[e][q.ATR_ENERGY],this._wwaData.objectAttribute[e][q.ATR_STRENGTH],this._wwaData.objectAttribute[e][q.ATR_DEFENCE],this._wwaData.objectAttribute[e][q.ATR_GOLD]),s=this._wwaData.objectAttribute[e][q.ATR_STRING],r=this._wwaData.message[s],o=this._player.getStatusWithoutEquipments();if(i.strength>q.STATUS_MINUS_BORDER&&o.strength<i.strength-q.STATUS_MINUS_BORDER||i.defence>q.STATUS_MINUS_BORDER&&o.defence<i.defence-q.STATUS_MINUS_BORDER||i.gold>q.STATUS_MINUS_BORDER&&o.gold<i.gold-q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(v.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();i.energy=i.energy>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.energy:i.energy,i.strength=i.strength>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.strength:i.strength,i.defence=i.defence>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.defence:i.defence,i.gold=i.gold>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.gold:i.gold,this._player.addStatusAll(i),this.setStatusChangedEffect(i),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][q.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,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]))},a.prototype._execObjectMonsterEvent=function(t,e,a){var i=this,s=new f(this._wwaData.objectAttribute[e][q.ATR_X],this._wwaData.objectAttribute[e][q.ATR_Y]),r=new E(this._wwaData.objectAttribute[e][q.ATR_ENERGY],this._wwaData.objectAttribute[e][q.ATR_STRENGTH],this._wwaData.objectAttribute[e][q.ATR_DEFENCE],this._wwaData.objectAttribute[e][q.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][q.ATR_STRING]],n=this._wwaData.objectAttribute[e][q.ATR_ITEM];this._monster=new Ct(e,t,s,r,o,n,(function(){i._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},a.prototype._execObjectBuyEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectSellEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectItemEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i];try{var r=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-r.x)*q.CHIP_SIZE,n=(t.y-r.y)*q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(o,n),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*q.CHIP_SIZE,this._wwaData.imgItemboxY*q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(v.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][q.ATR_MODE]||(this.generatePageAndReserveExecution(s,!1,!1,e,v.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.generatePageAndReserveExecution(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectDoorEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_ITEM],s=this._wwaData.objectAttribute[e][q.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(i)&&(0===this._wwaData.objectAttribute[e][q.ATR_MODE]&&this._player.removeItemByPartsID(i),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},a.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord();t.x!==i.x||t.y!==i.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][q.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][q.ATR_JUMP_Y];s>q.RELATIVE_COORD_LOWER&&(s=i.x+s-q.RELATIVE_COORD_BIAS),r>q.RELATIVE_COORD_LOWER&&(r=i.y+r-q.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new w(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]))},a.prototype._execObjectUrlGateEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.generatePageAndReserveExecution(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=M.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0]):location.href=yt(this._wwaData.message[i].split(/\s/g)[0]))},a.prototype._execObjectScoreEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[i],!1,!1,e,v.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][q.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var a=this._player.getStatus().calculateScore(e);this._scoreWindow.update(a)}},a.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD]))return"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._pages.push(new xt(new Wt(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY]),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),a=(t.x-e.x)*q.CHIP_SIZE,i=(t.y-e.y)*q.CHIP_SIZE,s=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM],r=this._wwaData.objectAttribute[s][q.ATR_NUMBER];try{this._player.addItem(s,r,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(a,i),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*q.CHIP_SIZE,this._wwaData.imgItemboxY*q.CHIP_SIZE)}:void 0)}catch(t){return"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._pages.push(new xt(new Wt(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM]),!0,!1,!0)),{}}}var o=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD]);return o.energy=o.energy>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-o.energy:o.energy,this.setStatusChangedEffect(o),this._player.addStatusAll(o),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:A.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},a.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===M.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.MAP_URLGATE&&(location.href=yt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===M.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._pages.push(new xt(new Wt(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM]),!0,!1,!0));else if(t===q.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===q.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===q.OBJECT_URLGATE&&(location.href=yt(this._yesNoURL));else this._yesNoChoiceCallInfo===M.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===M.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),pt(k[b.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.QUICK_LOAD)):this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(M.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===M.CALL_BY_RESTART_GAME?(pt(k[b.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=L.RESTART_GAME):this._yesNoChoiceCallInfo===M.CALL_BY_END_GAME?(window.history.back(-1),pt(k[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===M.CALL_BY_GOTO_WWA?(location.href=yt(q.WWA_HOME),pt(k[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_LOAD?(pt(k[b.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Qt.LOAD)):this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_SAVE?(pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(M.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Qt.SAVE)):this._yesNoChoiceCallInfo===M.CALL_BY_SUSPEND&&(pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(M.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===M.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][q.ATR_TYPE],q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===M.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.OBJECT_BUY||t===q.OBJECT_SELL||(t===q.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===M.CALL_BY_ITEM_USE){pt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===M.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case M.NONE:pt(k[b.QUICK_LOAD]).classList.remove("onpress");break;case M.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case M.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var a=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,a){case M.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case M.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());pt(k[b.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===M.CALL_BY_RESTART_GAME)pt(k[b.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_END_GAME)pt(k[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_GOTO_WWA)pt(k[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_LOAD)pt(k[b.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_SAVE)pt(k[b.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();pt(k[b.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.NONE,this._messageWindow.setYesNoChoice(!1)}},a.prototype.generatePageAndReserveExecution=function(t,e,a,i,s,r,o){void 0===i&&(i=0),void 0===s&&(s=v.OBJECT),void 0===r&&(r=new f(0,0)),void 0===o&&(o=void 0);var n=this.generatePagesByRawMessage(t,i,s,r,a,e,o);this._pages=this._pages.concat(n),this._shouldSetNextPage=!0},a.prototype.generatePagesByRawMessage=function(t,e,a,i,s,r,o){var n=this,_=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(/\/\//)?gt(gt(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//");if(""===_)return o?[new xt(void 0,!0,!1,!1,o,{partsId:e,partsType:a})]:[];var c=_.split(/\<p\>/gi);return c.map((function(t,_){var h=void 0,u=void 0,l=void 0,p=n.parseMessageLines(t,e,a,i),d=[];return p.forEach((function(t,e){try{var a=0===e?void 0:p[e-1].type,i=d[d.length-1],s=n.createNewNode(t,!h||!Ft(a)),r=n.processConditionalExecuteMacroLine(s,t,i,d);r&&(l=r),a?n.connectOrMergeToPreviousNode(t,a,u,s,i,l):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new xt(h,_===c.length-1,0===_&&r,s,0===_&&o,{partsId:e,partsType:a})}))},a.prototype.parseMessageLines=function(t,e,a,i){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 o=function(t,e,a,i,s){var r=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==r&&3===r.length||null!==(r=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===r.length))throw new Error("マクロではありません");var o=r[1],n="$".concat(o.toLowerCase()),_="$if"===n&&s.match(/,/)?F.LEGACY_IF:K[n],c=r[2]?r[2]:"";return void 0===_?new kt(t,e,a,i,F.UNDEFINED,c.split(",")):new kt(t,e,a,i,_,c.split(",").map((function(t){return t.trim()})))}(s,e,a,i,r[1]);switch(o.macroType){case F.IF:case F.ELSE_IF:case F.ELSE:case F.END_IF:case F.SHOW_STR:return{type:o.macroType,text:t,macro:o};default:return{type:"normalMacro",text:t,macro:o}}})).filter(Boolean)},a.prototype.createNewNode=function(t,e){switch(t.type){case F.IF:return new Ut([{descriminant:Ma(t.macro.macroArgs[0])}]);case F.SHOW_STR:return e?new Wt(this._generateShowStrString(t.macro.macroArgs)):void 0;case"text":return e?new Wt(t.text):void 0;case"normalMacro":return e?new Wt("",[t.macro]):void 0;default:return}},a.prototype.processConditionalExecuteMacroLine=function(t,e,a,i){var s=0===i.length;switch(e.type){case F.IF:return void i.push(t);case F.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void a.appendBranch({descriminant:Ma(e.macro.macroArgs[0])});case F.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void a.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case F.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return i.pop()}},a.prototype.connectOrMergeToPreviousNode=function(t,e,a,i,s,r){var o=Ft(e);switch(e){case F.IF:case F.ELSE_IF:case F.ELSE:if(!i||!s)return;var n=s.getLastUnconnectedBranch();if(!n)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(n.next=i);case F.END_IF:if(!(i&&r instanceof Ut))return;for(var _=0;_<r.branches.length;_++){var c=r.branches[_].next;c?this.connectToFinalNode(c,i):r.branches[_]=i}return void(r.hasElseBranch()||r.branches.push({next:i,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(o&&a instanceof Wt))return;var h=!a.isEmpty();t.type===F.SHOW_STR?a.appendMessage(this._generateShowStrString(t.macro.macroArgs),h):"text"===t.type?a.appendMessage(t.text,h):"normalMacro"===t.type?a.macro.push(t.macro):a.next=i}},a.prototype.connectToFinalNode=function(t,e){for(var a=t;;)if(a instanceof Ut&&(a=a.branches[0].next),a instanceof Wt){if(!a.next)return void(a.next=e);a=a.next}},a.prototype.appearParts=function(t){var e,a,i,s,r,o,n=t.pos,_=t.triggerType,c=t.triggerPartsId,h=_===A.CHOICE_NO?q.APPERANCE_PARTS_MIN_INDEX_NO:q.APPERANCE_PARTS_MIN_INDEX,u=_===A.CHOICE_YES?q.APPERANCE_PARTS_MAX_INDEX_YES:q.APPERANCE_PARTS_MAX_INDEX;for(_===A.MAP?(c=0===c?this._wwaData.map[n.y][n.x]:c,e=v.MAP):(c=0===c?this._wwaData.mapObject[n.y][n.x]:c,e=v.OBJECT),o=h;o<=u;o++){var l=q.ATR_APPERANCE_BASE+o*q.REL_ATR_APPERANCE_UNIT_LENGTH,p=l+q.REL_ATR_APPERANCE_ID,d=l+q.REL_ATR_APPERANCE_X,E=l+q.REL_ATR_APPERANCE_Y,y=l+q.REL_ATR_APPERANCE_TYPE;if(a=e===v.MAP?this._wwaData.mapAttribute[c][p]:this._wwaData.objectAttribute[c][p],i=e===v.MAP?this._wwaData.mapAttribute[c][y]:this._wwaData.objectAttribute[c][y],s=e===v.MAP?this._wwaData.mapAttribute[c][d]:this._wwaData.objectAttribute[c][d],r=e===v.MAP?this._wwaData.mapAttribute[c][E]:this._wwaData.objectAttribute[c][E],s===q.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>q.RELATIVE_COORD_LOWER&&(s=n.x+s-q.RELATIVE_COORD_BIAS),r===q.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>q.RELATIVE_COORD_LOWER&&(r=n.y+r-q.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new w(this,s,r,0,0),i===v.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var m=new f(s,r);this.setPartsOnPosition(v.MAP,a,m)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");m=new f(s,r);this.setPartsOnPosition(v.OBJECT,a,m),this._replaceRandomObject(new f(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},a.prototype.reserveAppearPartsInNextFrame=function(t,e,a){void 0===a&&(a=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:a})},a.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},a.prototype.appearPartsByDirection=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=T[s],o=I[s];this.appearPartsEval(i,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},a.prototype.appearPartsEval=function(t,e,a,i,s){var r,o,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=n.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"===a||"p"===a)o=n.y;else if("+"===a[0])o=t.y+parseInt(a.substr(1));else if("-"===a[0])o=t.y-parseInt(a.substr(1));else if(o=parseInt(a),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");try{new w(this,r,o,0,0);if(s===v.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new f(r,o);this.setPartsOnPosition(v.MAP,i,_)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new f(r,o);this.setPartsOnPosition(v.OBJECT,i,_),this._replaceRandomObject(new f(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},a.prototype._replaceRandomObject=function(t){var e,a,i=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[i][q.ATR_TYPE]===q.OBJECT_RANDOM){for(var s=0;s<q.RANDOM_ITERATION_MAX;s++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[i][q.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][q.ATR_TYPE]!==q.OBJECT_RANDOM)break;i=e}this.setPartsOnPosition(v.OBJECT,e,t)}},a.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),a=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),i=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=i;o<=s;o++)this._replaceRandomObject(new f(r,o))},a.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new f(t,e))},a.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=g.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.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._player.jumpTo(new w(this,t,e,0,0))},a.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},a.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},a.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(pt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(pt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(pt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(pt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},a.prototype.setPartsOnPosition=function(t,e,a){var i,s,r=a.y<<st.BITSHIFT|a.x;t===v.MAP?(i=this._wwaData.map[a.y][a.x],e=this.loadMapPartsID(e),i=this.loadMapPartsID(i),this._wwaData.map[a.y][a.x]=e,-1!==(s=this._mapIDTable[i].indexOf(r))&&this._mapIDTable[i].splice(s,1),-1===(s=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(i=this._wwaData.mapObject[a.y][a.x],e=this.loadMapPartsObjectID(e),i=this.loadMapPartsObjectID(i),this._wwaData.mapObject[a.y][a.x]=e,-1!==(s=this._mapObjectIDTable[i].indexOf(r))&&this._mapObjectIDTable[i].splice(s,1),-1===(s=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},a.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},a.prototype._compressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[];for(var i=0;i<t[a].length;){var s=this._countSamePartsLength(t[a],i);e[a].push([t[a][i],s]),i+=s}}return e},a.prototype._decompressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[],0;for(var i=0;i<t[a].length;i++)for(var s=t[a][i][1],r=0;r<s;r++)e[a].push(t[a][i][0])}return e},a.prototype._generateMapDataHash=function(t){var e="A",a=0,i=0,s=0;for(s=0;s<t.map.length;s++){for(i=0;i<t.map[s].length;)a=this._countSamePartsLength(t.map[s],i),e+=t.map[s][i]+"|"+a+"/",i+=a;for(i=0;i<t.mapObject[s].length;)a=this._countSamePartsLength(t.mapObject[s],i),e+=t.mapObject[s][i]+"|"+a+"/",i+=a}for(var r=0;r<t.mapAttribute.length;r++)for(var o=0;o<t.mapAttribute[r].length;o++)e+=t.mapAttribute[r][o]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return oe(e+="Z")},a.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),a=[];for(var i in t)"map"!==i&&"mapObject"!==i&&"mapCompressed"!==i&&"mapObjectCompressed"!==i&&"mapAttribute"!==i&&"objectAttribute"!==i&&"checkString"!==i&&a.push(i);a.sort();for(var s=0;s<a.length;s++)e+=mt(t[a[s]]);return oe(e)},a.prototype.compressSystem=function(){return pe},a.prototype._quickSave=function(t){var e,a,i=JSON.parse(JSON.stringify(this._wwaData)),s=this._player.getPosition().getPartsCoord(),r=this._player.getStatusWithoutEquipments();switch(i.itemBox=this._player.getCopyOfItemBox(),i.playerX=s.x,i.playerY=s.y,i.statusEnergyMax=this._player.getEnergyMax(),i.statusEnergy=r.energy,i.statusStrength=r.strength,i.statusDefence=r.defence,i.statusGold=r.gold,i.moves=this._player.getMoveCount(),i.frameCount=this._player.getFrameCount(),i.gameSpeedIndex=this._player.getSpeedIndex(),t){case M.CALL_BY_LOG_QUICK_SAVE:case M.CALL_BY_QUICK_SAVE:case M.CALL_BY_SUSPEND:break;case M.CALL_BY_PASSWORD_SAVE:i.checkOriginalMapString=this.checkOriginalMapString,i.checkString=this._generateSaveDataHash(i)}switch(i.message=void 0,i.mapAttribute=void 0,i.objectAttribute=void 0,t){case M.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,i),this.wwaCustomEvent("wwa_quicksave",{data:i}),"";case M.CALL_BY_PASSWORD_SAVE:var o=pe.compress(i);o.isCompress=1;var n=JSON.stringify(o);return this.wwaCustomEvent("wwa_passwordsave",{data:i,compress:o}),e=n,a=this._wwaData.worldPassNumber,console.warn(se.enc.Utf8.parse(e)),se.AES.encrypt(se.enc.Utf8.parse(e),re(a)).toString();case M.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:i,compress:pe.compress(i)});break;case M.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:i}),this._wwaSave.autoSave(this._cvs,i)}},a.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},a.prototype._decodePassword=function(t){var e,a,i,s="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,s=se.AES.decrypt(e,re(a)).toString(se.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,a){return se.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(se.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!s){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var o=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+o)}try{i=JSON.parse(s)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(i.isCompress){delete i.isCompress;var n=pe.decompress(i),_=n[0],c=n[1];return[Se(_),c]}return[i,{isWorldNameEmpty:!1}]},a.prototype._quickLoad=function(t,e,a){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===a&&(a=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var i,s=!1;if(null!==e){var r=this._decodePassword(e);i=r[0],s=r[1].isWorldNameEmpty}else i=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(i.message=JSON.parse(JSON.stringify(this._restartData.message)),i.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),i.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===i.map&&(i.map=this._decompressMap(i.mapCompressed)),void 0===i.mapObject&&(i.mapObject=this._decompressMap(i.mapObjectCompressed)),delete i.mapCompressed,delete i.mapObjectCompressed,null!==e){if(!s&&i.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(i.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var o=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&i.checkOriginalMapString!==o)throw console.error("Invalid hash","(password)=".concat(i.checkOriginalMapString," (current map)=").concat(o)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return a&&this._applyQuickLoad(i),i},a.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 w(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(H.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new f(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(V.ENERGY,new f(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(V.STRENGTH,new f(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(V.DEFENCE,new f(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(V.GOLD,new f(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new f(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new f(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},a.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 a=0;a<this._wwaData.mapWidth;a++){var i=a<<st.BITSHIFT|e;t=this._wwaData.map[a][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(i),t=this._wwaData.mapObject[a][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(i)}},a.prototype._restartGame=function(){this._quickLoad(!0)},a.prototype._fadeout=function(t){var e=0,a=q.MAP_WINDOW_WIDTH,i=q.FADEOUT_SPEED,s=pt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=i,(a-=2*i)<=0||2*e>q.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=q.MAP_WINDOW_WIDTH+"px",s.style.height=q.MAP_WINDOW_HEIGHT+"px",s.style.backgroundColor="#808080",clearInterval(r),void t();s.style.width=a+"px",s.style.height=a+"px",s.style.borderWidth=e+"px"}),20)},a.prototype.moveObjects=function(t){var e,a,i,s=this._camera.getPosition(),r=(this._player.getPosition(),s.getPartsCoord(),s.getPartsCoord().x),o=s.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),q.ATR_TYPE)!==q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),q.ATR_TYPE)!==q.OBJECT_LOCALGATE){for(e=new Array(q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(q.V_PARTS_NUM_IN_WINDOW+2),i=-1;i<=q.V_PARTS_NUM_IN_WINDOW;i++)for(e[i+1]=new Array(q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[i+1]=new Array(q.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=q.H_PARTS_NUM_IN_WINDOW;a++)if(o+i<0||o+i>=this._wwaData.mapWidth||r+a<0||r+a>=this._wwaData.mapWidth)e[i+1][a+1]=0,this.hoge[i+1][a+1]=0;else{try{var n=(_=new w(this,r+a,o+i,0,0)).getPartsCoord()}catch(t){e[i+1][a+1]=0,this.hoge[i+1][a+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[i+1][a+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[i+1][a+1]=-this._wwaData.mapObject[n.y][n.x]}for(a=-1;a<=q.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(i=-1;i<=q.V_PARTS_NUM_IN_WINDOW;i++)if(!(o+i<0||o+i>=this._wwaData.mapWidth)){try{var _;n=(_=new w(this,r+a,o+i,0,0)).getPartsCoord()}catch(t){continue}var c=this._wwaData.mapObject[n.y][n.x];if(0!==c&&this._wwaData.objectAttribute[c][q.ATR_MOVE]!==x.STATIC&&this._wwaData.objectAttribute[c][q.ATR_TYPE]!==q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][q.ATR_TYPE]!==q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.CHASE_PLAYER||this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.RUN_OUT||this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][q.ATR_MOVE];if(h!==x.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,h),p=new f(l.x,n.y),d=new f(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,r,o,e,c);else{var y=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[c][q.ATR_TYPE]===q.OBJECT_MONSTER,e);y===B.MODE_X?this._setObjectsInNextFrame(n,p,r,o,e,c):y===B.MODE_Y?this._setObjectsInNextFrame(n,d,r,o,e,c):null===(E=this._getThirdCandidate(t,_,l,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,E,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},a.prototype._getCandidateCoord=function(t,e,a){var i=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=i.clone(),o=0,n=0;return a===x.CHASE_PLAYER?(o=i.x>s.x?-1:i.x<s.x?1:0,n=i.y>s.y?-1:i.y<s.y?1:0):a===x.RUN_OUT&&(o=i.x>s.x?1:i.x<s.x?-1:0,n=i.y>s.y?1:i.y<s.y?-1:0),r.x+=o,r.y+=n,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},a.prototype._getSecondCandidateMoveMode=function(t,e,a,i,s,r,o){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,i,o)?B.MODE_X:this._objectCanMoveTo(t,s,o)?B.MODE_Y:B.UNDECIDED:this._objectCanMoveTo(t,s,o)?B.MODE_Y:this._objectCanMoveTo(t,i,o)?B.MODE_X:B.UNDECIDED},a.prototype._getThirdCandidate=function(t,e,a,i,s){var r,o=i===x.CHASE_PLAYER?1:i===x.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new f(a.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(a.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r}if(n.y!==_.y){if(r=new f(_.x+1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x-1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x+1*o,_.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x-1*o,_.y),this._objectCanMoveTo(t,r,s))return r}return null},a.prototype._getRandomMoveCoord=function(t,e,a){for(var i=e.getPartsCoord(),s=i.clone(),r=this._wwaData.isOldMove?q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:q.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=Math.floor(8*Math.random());if(s.x=i.x+T[n],s.y=i.y+I[n],this._objectCanMoveTo(t,s,a))return s}return i},a.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},a.prototype._objectCanMoveTo=function(t,e,a){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var i=this._wwaData.map[e.y][e.x],s=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[i][q.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===i&&!this.isOldMap()||r===q.MAP_WALL)return!1;var c=e.x-n+1,h=e.y-_+1;if(0<=c&&0<=h&&c<a.length&&h<a.length){if(0!==a[h][c])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},a.prototype._setObjectsInNextFrame=function(t,e,a,i,s,r){var o=e.x-a+1,n=e.y-i+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=o&&o<s.length&&0<=n&&n<s.length&&(s[t.y-i+1][t.x-a+1]=0,s[e.y-i+1][e.x-a+1]=r,this.hoge[e.y-i+1][e.x-a+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},a.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW-1),i=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(H.DECISION);for(var o=e;o<=a;o++)for(var n=i;n<=s;n++){var _=this._wwaData.mapObject[n][o];this._wwaData.objectAttribute[_][q.ATR_TYPE]===q.OBJECT_MONSTER&&-1===r.indexOf(_)&&r.push(_)}return this._bottomButtonType===h.BATTLE_REPORT&&pt(k[b.GOTO_WWA]).classList.add("onpress"),0===r.length?(pt(k[b.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},a.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),pt(k[b.GOTO_WWA]).classList.remove("onpress")},a.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Qt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},a.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){this.setNowPlayTime();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<q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%q.USER_VAR_NUM,i=this._userVarNameList&&this._userVarNameList[a]?this._userVarNameList[a]:"名無し",s="変数 ".concat(a,": ").concat(i);t+="".concat(s,": ").concat(this._wwaData.userVar[a],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.generatePageAndReserveExecution(t,!1,!0)}},a.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case P.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.11.5\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.5\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.5\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case P.SP:case P.VR:return;case P.PC:t=" 【操作方法】\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  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.5\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.generatePageAndReserveExecution(t,!1,!0)}},a.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():this._shouldSetNextPage=!0,this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},a.prototype._hideMessageWindow=function(){var t=0;this._player.isReadyToUseItem()&&(t=this._player.useItem());var e=this.getObjectAttributeById(t,q.ATR_STRING);this.clearFaces(),0===e?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.generatePageAndReserveExecution(this.getMessageById(e),!1,!1,t,v.OBJECT,this._player.getPosition().getPartsCoord())},a.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},a.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},a.prototype.replaceParts=function(t,e,a,i){void 0===a&&(a=v.OBJECT),void 0===i&&(i=!1);var s,r,o,n,_,c,h,u,l=this._camera.getPosition().getPartsCoord(),p=i?Math.max(0,l.x):0,d=i?Math.min(this._wwaData.mapWidth-1,l.x+q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=i?Math.max(0,l.y):0,f=i?Math.min(this._wwaData.mapWidth-1,l.y+q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(i=0!==p||d!==this._wwaData.mapWidth-1||0!==E||f!==this._wwaData.mapWidth-1,a===v.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(h=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],r=n.length,i)for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.mapObject[c][_]=e,u.push(s)):h.push(s);else{for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,this._wwaData.mapObject[c][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(h=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],r=n.length,i)for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.map[c][_]=e,u.push(s)):h.push(s);else{for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},a.prototype.getYesNoImgCoord=function(){return new f(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},a.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},a.prototype.getPlayerImgCoord=function(){return new f(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},a.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},a.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},a.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},a.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},a.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},a.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},a.prototype.isOldMap=function(){return this._wwaData.isOldMap},a.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},a.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},a.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},a.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},a.prototype.setPlayerStatus=function(t,e,a){if(t===G.ENERGY){if(this._player.setEnergy(e),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a}))return this.gameover(),{isGameOver:!0}}else if(t===G.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===G.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===G.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},a.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},a.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},a.prototype.setStatusIconCoord=function(t,e){var a=e.x*q.CHIP_SIZE,i=e.y*q.CHIP_SIZE,s=function(t){Et("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(i,"px")};switch(t){case V.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case V.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case V.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case V.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},a.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*q.CHIP_SIZE,a=t.y*q.CHIP_SIZE;return Array.prototype.forEach.call(ft("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},a.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},a.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},a.prototype.canInput=function(){return!this._temporaryInputDisable},a.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},a.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},a.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},a.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new f(0,0)))Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*q.CHIP_SIZE+"px -"+t.y*q.CHIP_SIZE+"px"}))}},a.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())},a.prototype.clearFaces=function(){this._faces=[]},a.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},a.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},a.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}},a.prototype.initCSSRule=function(){this._styleElm=pt(q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},a.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",a=this._isClassicModeEnable?1:.9,i="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(a,");\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[it.MESSAGE_WINDOW]=this._sheet.addRule(e,i),this._stylePos[it.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[it.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(i," }"),0),this._stylePos[it.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},a.prototype.changeStyleRule=function(t,e,a,i){t===at.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=i):t===at.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=i):t===at.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=i):t===at.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=i),this.updateCSSRule()},a.prototype.showMonsterWindow=function(){this._monsterWindow.show()},a.prototype.isClassicMode=function(){return this._isClassicModeEnable},a.prototype.isConsoleOutputMode=function(){return this._useConsole},a.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new w(this,t,e,0,0))},a.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},a.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,q.USER_VAR_NUM_MAX_VALUE),q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},a.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<q.USER_VAR_NUM&&(0|t)===t},a.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},a.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},a.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},a.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},a.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},a.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},a.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},a.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)}},a.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)}},a.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},a.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}):{}},a.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},a.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},a.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},a.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},a.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},a.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},a.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},a.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},a.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},a.prototype._generateShowStrString=function(t){var e=this;return t.map((function(t){var a=parseInt(t,10);return isNaN(a)?Da(t)?function(){return Na(t,e._generateTokenValues())}:t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[a]}}))},a.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},a.prototype.execSetMacro=function(t){void 0===t&&(t="");var e=function(t,e){var a=Pa(t),i=a.match(Ta);if(null!==i){var s=Na(i[2],e),r=Na(i[4],e);return Ca(Rt(i[3],s,r),i[1])}var o=a.match(Ia);if(null!==o)return s=Na(o[1],e),r=Na(o[3],e),Ca(Rt(o[2],s,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this._generateTokenValues()),a=e.assignee,i=e.rawValue;switch(a){case"energy":if(this._player.setEnergy(this.toValidStatusValue(i)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(i));break;case"strength":this._player.setStrength(this.toValidStatusValue(i));break;case"defence":this._player.setDefence(this.toValidStatusValue(i));break;case"gold":this._player.setGold(this.toValidStatusValue(i));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(i));break;default:if(isNaN(a)||!this.isValidUserVarIndex(a))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a,this.toAssignableValue(i))}return this._player.updateStatusValueBox(),{}},a.prototype._generateTokenValues=function(){return this.setNowPlayTime(),{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._wwaData.playTime,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord()}},a.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var a=parseInt(e[0],10),i=parseInt(e[2],10);if(!this.isValidUserVarIndex(a)||!this.isValidUserVarIndex(i))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var s=this._wwaData.userVar[a],r=e[1],o=this._wwaData.userVar[i],n=function(t){return parseInt(t,10)?v.MAP:v.OBJECT};if(this.compareUserVar(s,r,o)){var _=parseInt(e[3],10),c=e[4],h=e[5],u=n(e[6]);this.appearPartsEval(t,c,h,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},a.prototype.compareUserVar=function(t,e,a){switch(e){case"==":return t===a;case"!=":return t!==a;case">=":return t>=a;case">":return t>a;case"<=":return t<=a;case"<":return t<a;default:throw new Error("未定義の演算子です: ".concat(e))}},a.prototype.setPlayerSpeedIndex=function(t){if(t<q.MIN_SPEED_INDEX||q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},a.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},a.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},a.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},a.prototype.varMap=function(t,e,a,i,s){if(!this.isValidUserVarIndex(i))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[i];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,a,r,s)},a.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ft("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*q.CHIP_SIZE,"px -").concat(t.y*q.CHIP_SIZE,"px")}))},a.prototype._getVirtualPadButton=function(t){if(!nt.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},a.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},a.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},a.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,i;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(i=!1,e){case o.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)&&(i=!0);break;case o.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)&&(i=!0);break;case o.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)&&(i=!0);break;case o.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)&&(i=!0)}if(this._gamePadStore.buttonTrigger(e)&&(i=!0),i&&this.onselectitem(a))return!0}return!1},a.prototype.setGamePadButtonItemTable=function(t,e){var a,i;if(!this._wwaData.gamePadButtonItemTable)for(i in this._wwaData.gamePadButtonItemTable=[],o)a=i,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},a.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?Me.UNMATCHED_WORLD_NAME:a&&a!==Ne(this._wwaData.worldName,this._wwaData.worldPassNumber)?Me.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Me.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},a.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("存在しないステータスが与えられました")}},a.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("存在しないステータスが与えられました")}},a.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},a.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},a}(),Wa=!1;function Ya(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(ft("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Wa=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Wa)return Wa=!1,t.returnValue=e,e}));var t=pt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),a=null!==e&&null!==e.match(/^true$/i);ae(pt("wwa-wrapper"),t,a);var i=pt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=pt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=pt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),o=null,n="true"===pt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),_=pt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");pt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&n&&(o=function(t){var e=dt(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var a=document.createElement("table"),i=document.createElement("tr"),s=document.createElement("th"),r=document.createElement("button"),o=document.createElement("td");r.textContent="隠す",s.textContent="変数一覧",s.setAttribute("colspan","10"),s.classList.add("varlist-header"),s.appendChild(r),i.appendChild(s),o.setAttribute("colspan","10"),o.classList.add("varlist-information"),o.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",a.appendChild(i),a.appendChild(o);for(var n=null,_=null,c=0;c<q.USER_VAR_NUM;c++){c%10==0&&(null!==n&&(a.appendChild(n),a.appendChild(_)),(n=document.createElement("tr")).classList.add("var-number"),(_=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),u=document.createElement("div");u.textContent="-",u.setAttribute("aria-hidden","true"),h.classList.add("var-index".concat(c));var l=document.createElement("td");h.textContent=c+"",h.appendChild(u),l.classList.add("var".concat(c)),l.textContent="-",n.appendChild(h),_.appendChild(l)}q.USER_VAR_NUM%10!=0&&(a.appendChild(n),a.appendChild(_)),e.appendChild(a);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",o.style.display="none",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",o.style.display="",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(r));var c=!0;pt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(c=!1);var h=pt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),u=!1;null!==h&&h.match(/^true$/i)&&(u=!0);var l=!0,p=pt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,E=pt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==E&&E.match(/^true$/i)&&(d=!0);var f,w,y=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");ee()&&null!==y&&y.match(/^true$/i)&&(f=document.getElementsByTagName("head")[0],(w=document.createElement("meta")).setAttribute("name","viewport"),f.appendChild(w),ut(),window.addEventListener("resize",ut));var m,g=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),A=a&&g?Et(g):null,S=!(null===(m=pt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!m.match(/^true$/i));ba=new Ua(i,c,t,u,l,d,s,S,o,_,n,a,A)}}"complete"===document.readyState?setTimeout(Ya):window.addEventListener("load",(function(){setTimeout(Ya)}))}()}();
21
+ function(t){var e=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.algo,n=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]),_=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]),c=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]),h=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]),u=s.create([0,1518500249,1859775393,2400959708,2840853838]),l=s.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=r.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=0;a<16;a++){var i=e+a,s=t[i];t[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r,o,p,g,A,S,v,T,I,O,D,C=this._hash.words,P=u.words,N=l.words,M=n.words,b=_.words,R=c.words,L=h.words;for(S=r=C[0],v=o=C[1],T=p=C[2],I=g=C[3],O=A=C[4],a=0;a<80;a+=1)D=r+t[e+M[a]]|0,D+=a<16?d(o,p,g)+P[0]:a<32?E(o,p,g)+P[1]:a<48?f(o,p,g)+P[2]:a<64?w(o,p,g)+P[3]:y(o,p,g)+P[4],D=(D=m(D|=0,R[a]))+A|0,r=A,A=g,g=m(p,10),p=o,o=D,D=S+t[e+b[a]]|0,D+=a<16?y(v,T,I)+N[0]:a<32?w(v,T,I)+N[1]:a<48?f(v,T,I)+N[2]:a<64?E(v,T,I)+N[3]:d(v,T,I)+N[4],D=(D=m(D|=0,L[a]))+O|0,S=O,O=I,I=m(T,10),T=v,v=D;D=C[1]+p+I|0,C[1]=C[2]+g+O|0,C[2]=C[3]+A+S|0,C[3]=C[4]+r+v|0,C[4]=C[0]+o+T|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(e.length+1),this._process();for(var s=this._hash,r=s.words,o=0;o<5;o++){var n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return s},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,a){return t^e^a}function E(t,e,a){return t&e|~t&a}function f(t,e,a){return(t|~e)^a}function w(t,e,a){return t&a|e&~a}function y(t,e,a){return t^(e|~a)}function m(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),i.RIPEMD160)},637:function(t,e,a){var i,s,r,o,n,_,c,h;t.exports=(h=a(359),s=(i=h).lib,r=s.WordArray,o=s.Hasher,n=i.algo,_=[],c=n.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],c=0;c<80;c++){if(c<16)_[c]=0|t[e+c];else{var h=_[c-3]^_[c-8]^_[c-14]^_[c-16];_[c]=h<<1|h>>>31}var u=(i<<5|i>>>27)+n+_[c];u+=c<20?1518500249+(s&r|~s&o):c<40?1859775393+(s^r^o):c<60?(s&r|s&o|r&o)-1894007588:(s^r^o)-899497514,n=o,o=r,r=s<<30|s>>>2,s=i,i=u}a[0]=a[0]+i|0,a[1]=a[1]+s|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(a/4294967296),e[15+(i+64>>>9<<4)]=a,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=o._createHelper(c),i.HmacSHA1=o._createHmacHelper(c),h.SHA1)},640:function(t,e,a){var i,s,r,o,n,_;t.exports=(_=a(359),a(93),s=(i=_).lib.WordArray,r=i.algo,o=r.SHA256,n=r.SHA224=o.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=o._createHelper(n),i.HmacSHA224=o._createHmacHelper(n),_.SHA224)},93:function(t,e,a){var i;t.exports=(i=a(359),function(t){var e=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.algo,n=[],_=[];!function(){function e(e){for(var a=t.sqrt(e),i=2;i<=a;i++)if(!(e%i))return!1;return!0}function a(t){return 4294967296*(t-(0|t))|0}for(var i=2,s=0;s<64;)e(i)&&(s<8&&(n[s]=a(t.pow(i,.5))),_[s]=a(t.pow(i,1/3)),s++),i++}();var c=[],h=o.SHA256=r.extend({_doReset:function(){this._hash=new s.init(n.slice(0))},_doProcessBlock:function(t,e){for(var a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,f=c[p-2],w=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+w+c[p-16]}var y=i&s^i&r^s&r,m=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&h^~n&u)+_[p]+c[p];l=u,u=h,h=n,n=o+g|0,o=r,r=s,s=i,i=g+(m+y)|0}a[0]=a[0]+i|0,a[1]=a[1]+s|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0,a[5]=a[5]+h|0,a[6]=a[6]+u|0,a[7]=a[7]+l|0},_doFinalize:function(){var e=this._data,a=e.words,i=8*this._nDataBytes,s=8*e.sigBytes;return a[s>>>5]|=128<<24-s%32,a[14+(s+64>>>9<<4)]=t.floor(i/4294967296),a[15+(s+64>>>9<<4)]=i,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(h),e.HmacSHA256=r._createHmacHelper(h)}(Math),i.SHA256)},140:function(t,e,a){var i;t.exports=(i=a(359),a(467),function(t){var e=i,a=e.lib,s=a.WordArray,r=a.Hasher,o=e.x64.Word,n=e.algo,_=[],c=[],h=[];!function(){for(var t=1,e=0,a=0;a<24;a++){_[t+5*e]=(a+1)*(a+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var s=1,r=0;r<24;r++){for(var n=0,u=0,l=0;l<7;l++){if(1&s){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&s?s=s<<1^113:s<<=1}h[r]=o.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=o.create()}();var l=n.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var a=this._state,i=this.blockSize/2,s=0;s<i;s++){var r=t[e+2*s],o=t[e+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(C=a[s]).high^=o,C.low^=r}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=a[l+5*E]).high,d^=C.low;var f=u[l];f.high=p,f.low=d}for(l=0;l<5;l++){var w=u[(l+4)%5],y=u[(l+1)%5],m=y.high,g=y.low;for(p=w.high^(m<<1|g>>>31),d=w.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=a[A]).high,v=C.low,T=_[A];T<32?(p=S<<T|v>>>32-T,d=v<<T|S>>>32-T):(p=v<<T-32|S>>>64-T,d=S<<T-32|v>>>64-T);var I=u[c[A]];I.high=p,I.low=d}var O=u[0],D=a[0];for(O.high=D.high,O.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=a[A=l+5*E],P=u[A],N=u[(l+1)%5+5*E],M=u[(l+2)%5+5*E];C.high=P.high^~N.high&M.high,C.low=P.low^~N.low&M.low}C=a[0];var b=h[n];C.high^=b.high,C.low^=b.low}},_doFinalize:function(){var e=this._data,a=e.words,i=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;a[i>>>5]|=1<<24-i%32,a[(t.ceil((i+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*a.length,this._process();for(var o=this._state,n=this.cfg.outputLength/8,_=n/8,c=[],h=0;h<_;h++){var u=o[h],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new s.init(c,n)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),a=0;a<25;a++)e[a]=e[a].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),i.SHA3)},716:function(t,e,a){var i,s,r,o,n,_,c,h;t.exports=(h=a(359),a(467),a(834),s=(i=h).x64,r=s.Word,o=s.WordArray,n=i.algo,_=n.SHA512,c=n.SHA384=_.extend({_doReset:function(){this._hash=new o.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=_._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=_._createHelper(c),i.HmacSHA384=_._createHmacHelper(c),h.SHA384)},834:function(t,e,a){var i;t.exports=(i=a(359),a(467),function(){var t=i,e=t.lib.Hasher,a=t.x64,s=a.Word,r=a.WordArray,o=t.algo;function n(){return s.create.apply(s,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=n()}();var h=o.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 a=this._hash.words,i=a[0],s=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=i.high,d=i.low,E=s.high,f=s.low,w=r.high,y=r.low,m=o.high,g=o.low,A=n.high,S=n.low,v=h.high,T=h.low,I=u.high,O=u.low,D=l.high,C=l.low,P=p,N=d,M=E,b=f,R=w,L=y,x=m,B=g,U=A,W=S,Y=v,F=T,k=I,G=O,V=D,H=C,K=0;K<80;K++){var j,X,J=c[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=c[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=c[K-2],et=tt.high,at=tt.low,it=(et>>>19|at<<13)^(et<<3|at>>>29)^et>>>6,st=(at>>>19|et<<13)^(at<<3|et>>>29)^(at>>>6|et<<26),rt=c[K-7],ot=rt.high,nt=rt.low,_t=c[K-16],ct=_t.high,ht=_t.low;X=(X=(X=z+ot+((j=$+nt)>>>0<$>>>0?1:0))+it+((j+=st)>>>0<st>>>0?1:0))+ct+((j+=ht)>>>0<ht>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&k,pt=W&F^~W&G,dt=P&M^P&R^M&R,Et=N&b^N&L^b&L,ft=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),wt=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),mt=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[K],At=gt.high,St=gt.low,vt=V+yt+((ut=H+mt)>>>0<H>>>0?1:0),Tt=wt+Et;V=k,H=G,k=Y,G=F,Y=U,F=W,U=x+(vt=(vt=(vt=vt+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=B+ut|0)>>>0<B>>>0?1:0)|0,x=R,B=L,R=M,L=b,M=P,b=N,P=vt+(ft+dt+(Tt>>>0<wt>>>0?1:0))+((N=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=i.low=d+N,i.high=p+P+(d>>>0<N>>>0?1:0),f=s.low=f+b,s.high=E+M+(f>>>0<b>>>0?1:0),y=r.low=y+L,r.high=w+R+(y>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),T=h.low=T+F,h.high=v+Y+(T>>>0<F>>>0?1:0),O=u.low=O+G,u.high=I+k+(O>>>0<G>>>0?1:0),C=l.low=C+H,l.high=D+V+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(a/4294967296),e[31+(i+128>>>10<<5)]=a,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(h),t.HmacSHA512=e._createHmacHelper(h)}(),i.SHA512)},567:function(t,e,a){var i;t.exports=(i=a(359),a(139),a(174),a(844),a(951),function(){var t=i,e=t.lib,a=e.WordArray,s=e.BlockCipher,r=t.algo,o=[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],n=[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],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{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}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=s.extend({_doReset:function(){for(var t=this._key.words,e=[],a=0;a<56;a++){var i=o[a]-1;e[a]=t[i>>>5]>>>31-i%32&1}for(var s=this._subKeys=[],r=0;r<16;r++){var c=s[r]=[],h=_[r];for(a=0;a<24;a++)c[a/6|0]|=e[(n[a]-1+h)%28]<<31-a%6,c[4+(a/6|0)]|=e[28+(n[a+24]-1+h)%28]<<31-a%6;for(c[0]=c[0]<<1|c[0]>>>31,a=1;a<7;a++)c[a]=c[a]>>>4*(a-1)+3;c[7]=c[7]<<5|c[7]>>>27}var u=this._invSubKeys=[];for(a=0;a<16;a++)u[a]=s[15-a]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,a){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 i=0;i<16;i++){for(var s=a[i],r=this._lBlock,o=this._rBlock,n=0,_=0;_<8;_++)n|=c[_][((o^s[_])&h[_])>>>0];this._lBlock=o,this._rBlock=r^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,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 a=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=a,this._lBlock^=a<<t}function p(t,e){var a=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=a,this._rBlock^=a<<t}t.DES=s._createHelper(u);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),i=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=u.createEncryptor(a.create(e)),this._des2=u.createEncryptor(a.create(i)),this._des3=u.createEncryptor(a.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)}(),i.TripleDES)},467:function(t,e,a){var i;t.exports=(i=a(359),function(t){var e=i,a=e.lib,s=a.Base,r=a.WordArray,o=e.x64={};o.Word=s.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=s.extend({init:function(e,a){e=this.words=e||[],this.sigBytes=a!=t?a:8*e.length},toX32:function(){for(var t=this.words,e=t.length,a=[],i=0;i<e;i++){var s=t[i];a.push(s.high),a.push(s.low)}return r.create(a,this.sigBytes)},clone:function(){for(var t=s.clone.call(this),e=t.words=this.words.slice(0),a=e.length,i=0;i<a;i++)e[i]=e[i].clone();return t}})}(),i)},633:function(){},106:function(){}},e={};function a(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!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"}(t||(t={})),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_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",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"}(e||(e={}));var i,s,r=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var a=this.getKeyState(e);return a===t.KEYDOWN||a===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(i||(i={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(s||(s={}));var o,n,_=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())===i.MOUSEDOWN||e===i.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?i.NONE:this._prevMouseState?this._mouseState?i.MOUSEPRESS:i.MOUSEUP:this._mouseState?i.MOUSEDOWN:i.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?i.NONE:this._prevMouseStateOnControllable?this._mouseState?i.MOUSEPRESS:i.MOUSEUP:this._mouseState?i.MOUSEDOWN:i.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===s.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"}(o||(o={})),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"}(n||(n={}));var c,h,u,l=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,a,i,s,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){a=r[t];var n=this.gamepad.buttons[a];if(!n)return!1;if(i="object"==typeof n?!0===n.pressed:1===n,s=this.triggers[a],this.triggers[a]=i,i&&!s)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,a,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(!this.gamepad)return!1;for(e=i.length,t=0;t<e;t++){a=i[t];var r=this.gamepad.buttons[a];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,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++)switch(a[t]){case o.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_UP))return!0;break;case o.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_DOWN))return!0;break;case o.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_LEFT))return!0;break;case o.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.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,a,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(!this.gamepad)return 0;for(e=i.length,t=0;t<e;t++){a=i[t];var r=this.gamepad.axes[a];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),p=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},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 a(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),d=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}(),E=function(t){function e(e,a,i,s){var r=t.call(this,a,i)||this;return r.energy=e,r.gold=s,r}return p(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(a,i){return a+t.rates[i]*e[i]}),0)},e}(d),f=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 w(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}(),w=function(){function t(t,e,a,i,s){if(void 0===i&&(i=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&&i>0||a<0||a>=r||a>=r-1&&s>0)throw new Error("範囲外の座標です!! parts:("+e+", "+a+"), offset:("+i+", "+s+"), mapWidth = "+r);this._partsCoord=new f(e,a),this._offsetCoord=new f(i,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/(q.H_PARTS_NUM_IN_WINDOW-1))*(q.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(q.V_PARTS_NUM_IN_WINDOW-1))*(q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,a,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),a=this._wwa.getMapWidth(),i=t.getPartsCoord().clone();return e.x===a-1&&i.x--,e.y===a-1&&i.y--,i.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var a=this._partsCoord;return new t(this._wwa,a.x+T[e],a.y+I[e],0,0)}var i=this._partsCoord.x,s=this._partsCoord.y;return this._offsetCoord.x<0?i--:this._offsetCoord.x>0&&i++,this._offsetCoord.y<0?s--:this._offsetCoord.y>0&&s++,new t(this._wwa,i,s,0,0)},t.prototype.getNextFramePosition=function(e,a,i){var s=this._partsCoord.x,r=this._partsCoord.y,o=this._offsetCoord.x+T[e]*a,n=this._offsetCoord.y+I[e]*i;if(o<0){var _=Math.floor(Math.abs(o)/q.CHIP_SIZE);s-=_,o=(o+_*q.CHIP_SIZE)%q.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/q.CHIP_SIZE);r-=c,n=(n+c*q.CHIP_SIZE)%q.CHIP_SIZE}return o>=q.CHIP_SIZE&&(s+=Math.floor(o/q.CHIP_SIZE),o=(o+q.CHIP_SIZE)%q.CHIP_SIZE),n>=q.CHIP_SIZE&&(r+=Math.floor(n/q.CHIP_SIZE),n=(n+q.CHIP_SIZE)%q.CHIP_SIZE),new t(this._wwa,s,r,o,n)},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 a=t.getPosition()._partsCoord,i=this._partsCoord.x,s=this._partsCoord.y,r=e?1:0;return a.x<=i&&i<a.x+q.H_PARTS_NUM_IN_WINDOW-r&&a.y<=s&&s<a.y+q.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),y=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},m=function(t,e,a,i,s){this.partsIDObj=t,this.x=e,this.y=a,this.isStatic=i,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.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,v,T=[-1,1,0,0,-1,-1,1,1,0],I=[0,0,1,-1,1,-1,1,-1,0],O=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),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"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(v||(v={}));var C,P,N,M,b,R,L,x,B,U=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)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?N.CHROME:t.match(/firefox/i)?N.FIREFOX:t.match(/safari/i)?N.SAFARI:N.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return P.PC;case C.IOS:case C.ANDROID:return P.SP;case C.OCULUS:return P.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return P.GAME}return P.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"}(C||(C={})),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"}(P||(P={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(N||(N={})),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"}(M||(M={})),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"}(b||(b={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(R||(R={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(L||(L={})),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"}(x||(x={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(B||(B={}));var W,Y,F,k=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),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.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(F||(F={}));var G,V,H,K={"":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,$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"}(G||(G={})),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"}(V||(V={})),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"}(H||(H={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],q=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=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.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}(),Q=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}(),z=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}(),$=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"}(j||(j={}));var tt,et,at,it,st,rt=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],ot=["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"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),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"}(at||(at={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(it||(it={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(st||(st={}));var nt=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],_t=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ct=new Set(_t),ht=function(){function t(e,a,i,s,r,o){void 0===a&&(a=!1),void 0===i&&(i=null),void 0===s&&(s=null),void 0===r&&(r=null),void 0===o&&(o=null);var n=this;if(this._enabled=null!==e,this._visible=a,this._onTouchStart=r||null,this._onTouchEnd=o||null,this._availableButtons=[],this._isTouchingButtons={},this._moveButtonsElement=s,this._buttonWrapperElement=i,this._setVisible(a),this._moveButtonsElement&&(this._moveButtonsElement.style.visibility="visible"),this._buttonWrapperElement&&(this._buttonWrapperElement.style.visibility="visible"),null!==e){var _=function(a){var i=e[a];if(!i)return"continue";var s=a;c._availableButtons.push(s),i.setAttribute("type",a),c._isTouchingButtons[s]={prev:!1,current:!1,next:!1};var r=function(t){t.cancelable&&t.preventDefault()};i.addEventListener("touchstart",(function(t){r(t),n.setTouchInfo(s)})),i.addEventListener("touchcancel",(function(t){r(t),n.allClear()})),t.isMoveButton(s)?(i.addEventListener("touchmove",c._detectMovingMoveButton.bind(c)),i.addEventListener("touchend",c.allMoveClear.bind(c))):i.addEventListener("touchend",(function(t){r(t),n.clearTouchInfo(s)}))},c=this;for(var h in e)_(h);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 a=this._moveButtonsElement.getBoundingClientRect(),i=document.body.getBoundingClientRect(),s=a.left-i.left+a.width/2,r=a.top-i.top+a.height/2,o=e.pageX-s,n=e.pageY-r;o>=n?o<=-n?this.setTouchInfo("BUTTON_UP"):this.setTouchInfo("BUTTON_RIGHT"):o>=-n?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 a=e.prev,i=e.current;return a&&i?"TOUCHING":i?"TOUCH":a?"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;_t.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 a=t._isTouchingButtons[e];void 0!==a&&(a.next=!1)}}))},t.isMoveButton=function(t){return ct.has(t)},t.prototype.update=function(){var t=this;this._availableButtons.forEach((function(e){var a,i;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===(a=t._onTouchStart)||void 0===a||a.call(t,e);break;case"LEAVE":null===(i=t._onTouchEnd)||void 0===i||i.call(t,e)}}}))},t.prototype.toggleVisible=function(){this._setVisible(!this._visible)},t}();function ut(){var t=document.querySelector("meta[name='viewport']"),e=window.innerWidth,a=window.innerHeight,i="user-scalable=no";if(e>a){var s=Math.floor(e/a*456);i="width=".concat(s,",").concat(i)}else e<=a&&(i="width=".concat(576,",").concat(i));null==t||t.setAttribute("content","".concat(i))}var lt,pt=function(t){return document.getElementById(t)},dt=function(t){return document.querySelector(t)},Et=function(t){return document.querySelector(t)},ft=function(t){return document.querySelectorAll(t)},wt=function(t,e){var a,i,s=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return a=t-pt("wwa-wrapper").offsetLeft+s,i=e-pt("wwa-wrapper").offsetTop+r,new f(a,i)},yt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},mt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=mt(t[a])+"/";return e}return t+""},gt=function(t){return t.split("").reverse().join("")},At=function(){function t(t,e,a){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:a}),this._isTransparent=a}return t.prototype.drawCanvas=function(t,e,a,i,s){this.ctx.drawImage(t,q.CHIP_SIZE*e,q.CHIP_SIZE*a,q.CHIP_SIZE,q.CHIP_SIZE,i,s,q.CHIP_SIZE,q.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,a,i){this._isTransparent?this.ctx.clearRect(t,e,a,i):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,a,i))},t}(),St=function(){function t(t,e,a,i){var s;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=i,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new f(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,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE);for(var t=1;t<q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,q.CHIP_SIZE*t,q.MAP_WINDOW_HEIGHT-q.CHIP_SIZE);for(t=1;t<q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,q.MAP_WINDOW_WIDTH-q.CHIP_SIZE,q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var a,i=t.length;for(e=0;e<i;e++){var s=t[e];(a=this._effectCanvases[e])?a.clear():a=this._effectCanvases[e]=new At(q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<q.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<q.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,s.x,s.y,o*q.CHIP_SIZE,r*q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE,0,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2),0,q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2),q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-1),q.CHIP_SIZE,q.CHIP_SIZE,q.CHIP_SIZE*(q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE,q.CHIP_SIZE,a,i,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,a,i,s,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE*a,q.CHIP_SIZE*i,s,r,q.CHIP_SIZE*a,q.CHIP_SIZE*i)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,a,i,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,i+q.CHIP_SIZE-s);r>=q.CHIP_SIZE||this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e,q.CHIP_SIZE,q.CHIP_SIZE-r,a,i,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var a=this;return function(i,s,r,o,n){if(!a._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(o,n));_>=q.CHIP_SIZE||t.ctx.drawImage(a._image,q.CHIP_SIZE*i,q.CHIP_SIZE*s+_,q.CHIP_SIZE,q.CHIP_SIZE-_,r,o+_,q.CHIP_SIZE,q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+q.CHIP_SIZE-e}))(t,e,a,i,s)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,a,i,s)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,a,i,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+q.CHIP_SIZE-e}))(e,a,i,s,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,a,i,s,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,a,i,s,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.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,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.H_PARTS_NUM_IN_WINDOW,0,0,q.CHIP_SIZE*q.V_PARTS_NUM_IN_WINDOW,q.CHIP_SIZE*q.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,a,i,s){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s-i);r>=q.CHIP_SIZE||this._ctx.drawImage(this._image,q.CHIP_SIZE*t,q.CHIP_SIZE*e+r,q.CHIP_SIZE,q.CHIP_SIZE-r,a,i+r,q.CHIP_SIZE,q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,a,i){this._ctx.clearRect(t,e,a,i)},t.prototype.drawBase=function(t,e,a,i){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,a,i)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),vt=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=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(q.H_PARTS_NUM_IN_WINDOW-1),e*(q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===q.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===q.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}(),Tt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),It=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),Ot=function(t){function e(e){return t.call(this,e)||this}return Tt(e,t),e}(It);!function(t){function e(e){return t.call(this,e)||this}Tt(e,t)}(It);!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"}(lt||(lt={}));var Dt=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,a)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(q.ITEMBOX_SIZE),_._status=s,_._equipStatus=new d(0,0),_._itemBox=new Array(q.ITEMBOX_SIZE),_._itemBoxElement=new Array(q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(q.ITEMBOX_SIZE);for(var c=0;c<_._itemBox.length;c++)_._itemBox[c]=0,_._itemBoxElement[c]=Et("#item"+c+">.item-disp");return _.updateItemBox(),_._energyMax=r,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=lt.CONTROLLABLE,_._camera=i,_._isPartsEventExecuted=!1,_._energyValueElement=Et("#disp-energy>.status-value-box"),_._strengthValueElement=Et("#disp-strength>.status-value-box"),_._defenceValueElement=Et("#disp-defence>.status-value-box"),_._goldValueElement=Et("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=o,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return Tt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===lt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=lt.CONTROLLABLE)}else if(this._state===lt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=lt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,a;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),a=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(a)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=lt.CAMERA_MOVING}catch(t){this._state=lt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===q.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=lt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),q.ATR_TYPE)!==q.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)!==q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,q.ATR_MODE)===q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,q.ATR_NUMBER)===q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==lt.MOVING||this._state==lt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==q.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==q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==q.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===lt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==q.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===lt.LOCALGATE_JUMPED||this._state===lt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=lt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===lt.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!==lt.MESSAGE_WAITING&&this._state!==lt.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===lt.MESSAGE_WAITING?this._state=lt.CONTROLLABLE:this._state===lt.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=lt.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=lt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===lt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===lt.ESTIMATE_WINDOW_WAITING&&(this._state=lt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=lt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===lt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===lt.PASSWORD_WINDOW_WAITING&&(this._state=lt.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!==lt.LOCALGATE_JUMPED&&this._state!==lt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===lt.LOCALGATE_JUMPED?lt.CONTROLLABLE:lt.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===lt.MESSAGE_WAITING?lt.LOCALGATE_JUMPED_WITH_MESSAGE:lt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=q.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=q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=lt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=q.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 d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(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,a=function(a){var s=i._itemBoxElement[a],r=dt("#item"+a);if(0===i._itemBox[a])return s.style.backgroundPosition="-40px 0px",i.disposeItemEffect(a,i._itemBoxElement[a],r),"continue";var o=i._wwa.getObjectCropXById(i._itemBox[a]),n=i._wwa.getObjectCropYById(i._itemBox[a]);if(!t||a!==t.insertPos-1)return s.style.backgroundPosition="-"+o+"px -"+n+"px",i.disposeItemEffect(a,i._itemBoxElement[a],r),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,c=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,h=-_*q.DEFAULT_FRAME_INTERVAL/q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:i._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:i._wwa.getObjectCropYById(t.overwrittenObjectId);s.style.left=_+"px",s.style.top=c+"px","number"==typeof i.itemEffectStartTimers[a]&&clearInterval(i.itemEffectStartTimers[a]),i.itemEffectStartTimers[a]=window.setTimeout((function(){e.itemEffectStartTimers[a]=void 0,e.startItemEffect(a,s,r,{target:{x:o,y:n},overwritten:{x:l,y:p}},h)}),q.DEFAULT_FRAME_INTERVAL)},i=this,s=0;s<this._itemBoxElement.length;s++)a(s)},e.prototype.startItemEffect=function(t,e,a,i,s){var r=this,o=a.querySelector(this.overwittenItemSelector);o&&a.removeChild(o);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+i.overwritten.x+"px -"+i.overwritten.y+"px",n.style.backgroundImage=a.style.backgroundImage,a.appendChild(n),e.style.backgroundPosition="-"+i.target.x+"px -"+i.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",a.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,a)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,a){"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",a.classList.contains(this.itemTransitioningClassName)&&a.classList.remove(this.itemTransitioningClassName);var i=a.querySelector(this.overwittenItemSelector);i&&a.removeChild(i)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,a,i){var s,r,o;void 0===e&&(e=0),void 0===a&&(a=!1);var n=this._wwa.getObjectAttributeById(t,q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((s=this._getBlankItemPos())===q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[s-1],this._forceSetItemBox(s,t)}else if(!1===a)if(s=e,o=this._itemBox[s-1],this._wwa.getObjectAttributeById(o,q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,q.ATR_NUMBER)){if((r=this._getBlankItemPos())===q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,o),this._forceSetItemBox(s,t)}else _=this._itemBox[s-1],this._forceSetItemBox(s,t);else s=e,_=this._itemBox[s-1],this._forceSetItemBox(s,t);this._updateEquipmentStatus(),this.updateItemBox(i?{insertPos:s,itemScreenPixelCoord:i.screenPixelCoord,itemBoxBackgroundImageCoord:i.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new f(q.MAP_WINDOW_WIDTH+(s-1)%3*q.CHIP_SIZE,q.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,i=Et("#item"+(t-1)+">.item-click-border"),s=this._wwa.getObjectAttributeById(e,q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&s!==S.NORMAL){var r=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==r){var o="";switch(this._wwa.userDevice.device){case P.PC:o="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.VR:o="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.SP:o="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:o="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:o="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:o="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.generatePageAndReserveExecution(""===r?o:r,!1,!0)}this._isClickableItemGot=!0}i.style.display="block",function(t){a._itemUsingEvent[t-1]=function(){(a.isControllable()||a._wwa._messageWindow.isItemMenuChoice())&&(a._wwa._itemMenu.close(),a._wwa._setNextPage(),a._wwa.onselectitem(t))}}(t),i.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 q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],q.ATR_DEFENCE));var a=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(a),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<q.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,q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=pt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],q.ATR_MODE)!==S.NORMAL&&((e=Et("#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 a=0;a<q.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],q.ATR_MODE)!==S.NORMAL&&((e=Et("#item"+a+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[a]),e.style.display="none"),this._itemBox[a]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=q.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=q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=lt.BATTLE},e.prototype.isFighting=function(){return this._state===lt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(H.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(H.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,q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(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,A.OBJECT,this._enemy.partsID),this._state=lt.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(),this._wwa.generatePageAndReserveExecution("相手の防御能力が高すぎる!",!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=lt.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,q.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),A.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(),a=this._camera.getPosition(),i=a.getPartsCoord(),s=a.getOffsetCoord(),r=(t.x-i.x)*q.CHIP_SIZE+e.x-s.x+q.CHIP_SIZE/2,o=(t.y-i.y)*q.CHIP_SIZE+e.y-s.y+q.CHIP_SIZE/2;return new f(r,o)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},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=q.CHIP_SIZE/X[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(q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<q.MIN_SPEED_INDEX||q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(Ot),Ct=function(){function t(t,e,a,i,s,r,o){this._partsID=t,this._position=e,this._imgCoord=a,this._status=i,this._message=s,this._item=r,this._battleEndCallback=o}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}(),Pt=function(){function t(t,e,a,i,s){this._player=t,this._objectID=e,this._srcPos=a,this._destPos=i,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,X[t],X[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}(),Nt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,a,i){this._queue.push(new Pt(this._player,t,e,a,i))},t.prototype.update=function(){for(var t=[],e=[],a=0;a<this._queue.length;a++)this._queue[a].update(),this._queue[a].isAchievedDestination?(t.push(this._queue[a]),this._wwa.setPartsOnPosition(v.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(v.OBJECT,this._queue[a].objID,this._queue[a].destination.getPartsCoord())):e.push(this._queue[a]);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 Mt(t,e){if("boolean"==typeof t)return t;var a=bt(t.left,e),i=bt(t.right,e);return function(t,e,a){switch(t){case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a;case"==":return e===a;case"!=":return e!==a;default:return!1}}(t.operator,a,i)}function bt(t,e){switch(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"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"RAND":return Math.floor(Math.random()*bt(t.argument,e));default:return 0}}function Rt(t,e,a){switch(t){case"=":return a;case"+":case"+=":return e+a;case"-":case"-=":return e-a;case"*":case"*=":return e*a;case"/":case"/=":return 0===a?0:e/a;case"%":case"%=":return 0===a?0:e%a;default:throw new Error("未定義の演算子です")}}var Lt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),xt=function(t,e,a,i,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=a,this.isSystemMessage=i,this.scoreOptions=s,this.extraInfo=r},Bt=function(){},Ut=function(t){function e(e){void 0===e&&(e=[]);var a=t.call(this)||this;return a.branches=e,a}return Lt(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 a=e[t];if(!a.next)return a}},e.prototype.evaluateAndGetNextNode=function(t){for(var e=0,a=this.branches;e<a.length;e++){var i=a[e];if(!i.descriminant||Mt(i.descriminant,t()))return i.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(Bt),Wt=function(t){function e(e,a,i){var s=t.call(this)||this;return s.macro=a,s.next=i,s.messageSegments=s.parseMessage(e),void 0===s.macro&&(s.macro=[]),s}return Lt(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 a="string"==typeof e?e:e();return"".concat(t).concat(a)}),"")},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}(Bt);function Yt(t){return void 0===t||(t instanceof Ut?t.branches.reduce((function(t,e){return t&&Yt(e.next)}),!0):t instanceof Wt?t.isEmpty()&&Yt(t.next):void 0)}var Ft=function(t){return t===F.SHOW_STR||"text"===t||"normalMacro"===t},kt=function(){function t(t,e,a,i,s,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=a,this._triggerPartsPosition=i,this.macroType=s,this.macroArgs=r}return t.prototype.isJunction=function(){return[F.IF,F.ELSE_IF,F.ELSE,F.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case F.IMGPLAYER:return this._executeImgPlayerMacro(),{};case F.IMGYESNO:return this._executeImgYesNoMacro(),{};case F.HPMAX:return this._executeHPMaxMacro(),{};case F.SAVE:return this._executeSaveMacro(),{};case F.ITEM:return this._executeItemMacro(),{};case F.DEFAULT:return this._executeDefaultMacro(),{};case F.OLDMAP:return this._executeOldMapMacro(),{};case F.PARTS:return this._executePartsMacro(),{};case F.MOVE:return this._executeMoveMacro(),{};case F.MAP:return this._executeMapMacro(),{};case F.DIRMAP:return this._executeDirMapMacro(),{};case F.IMGFRAME:return this._executeImgFrameMacro(),{};case F.IMGBOM:return this._executeImgBomMacro(),{};case F.DELPLAYER:return this._executeDelPlayerMacro(),{};case F.FACE:return this._executeFaceMacro(),{};case F.EFFECT:return this._executeEffectMacro(),{};case F.GAMEOVER:return this._executeGameOverMacro(),{};case F.IMGCLICK:return this._executeImgClickMacro(),{};case F.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case F.EFFITEM:return this._executeEffItemMacro(),{};case F.COLOR:return this._executeColorMacro(),{};case F.WAIT:return this._executeWaitMacro(),{};case F.SOUND:return this._executeSoundMacro(),{};case F.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case F.OLDMOVE:return this._executeOldMoveMacro(),{};case F.JUMPGATE:return this._executeJumpGateMacro(),{};case F.RECPOSITION:return this._executeRecPositionMacro(),{};case F.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case F.CONSOLE_LOG:return this._executeConsoleLogMacro(),{};case F.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case F.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case F.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case F.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case F.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case F.SET_AT:return this._executeSetAtMacro(),{};case F.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case F.SET_DF:return this._executeSetDfMacro(),{};case F.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case F.SET_MONEY:return this._executeSetMoneyMacro(),{};case F.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case F.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case F.VAR_SET:return this._executeVarSetMacro(),{};case F.VAR_ADD:return this._executeVarAddMacro(),{};case F.VAR_SUB:return this._executeVarSubMacro(),{};case F.VAR_MUL:return this._executeVarMulMacro(),{};case F.VAR_DIV:return this._executeVarDivMacro(),{};case F.VAR_MOD:return this._executeVarModMacro(),{};case F.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case F.GAME_SPEED:return this._executeGameSpeedMacro(),{};case F.SHOW_STR:case F.IF:return{};case F.LEGACY_IF:return this._executeLegacyIfMacro(),{};case F.ELSE_IF:case F.ELSE:case F.END_IF:return{};case F.SET_SPEED:return this._executeSetSpeedMacro(),{};case F.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case F.HIDE_STATUS:return this._executeHideStatusMacro(),{};case F.VAR_MAP:return this._executeVarMapMacro(),{};case F.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case F.SET:return{isGameOver:this._executeSetMacro().isGameOver};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),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var a=parseInt(this.macroArgs[t]);return isNaN(a)?e:a},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(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._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(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._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._parseInt(3,v.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,a,t,i)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new f(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new f(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,v.OBJECT),i=this._parseInt(3);if(a!==v.OBJECT&&a!==v.MAP)throw new Error("パーツ種別が不明です");if(0!==i&&1!==i&&(i=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===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,a,!!i)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._parseInt(3,v.OBJECT);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.appearPartsEval(this._triggerPartsPosition,e,a,t,i)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,v.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===v.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,a)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===V.ENERGY||t===V.STRENGTH||t===V.DEFENCE||t===V.GOLD)this._wwa.setStatusIconCoord(t,new f(e,a));else if(t===V.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new f(e,a));else if(t===V.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==V.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new f(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new f(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),a=this._parseInt(1),i=this._parseInt(2),s=this._parseInt(3),r=this._parseInt(4),o=this._parseInt(5);if(e<0||a<0||i<0||s<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new y(new f(e,a),new f(i,s),new f(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var i,s=this._parseInt(a);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((i=this._parseInt(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new f(s,i))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new f(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new f(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(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._parseInt(0),e=this._parseInt(1),a=this._parseInt(2),i=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||a<0||a>255||i<0||i>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,a,i)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0])},t}();var Gt,Vt=function(){function t(t,e,a,i,s,r,o){this._wwa=t,this._coord=e,this._width=a,this._height=i,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=o+"",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}(),Ht=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,e,new f(a.x,a.y),i,s,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=q.CHIP_SIZE+"px",_._monsterBox.style.height=q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Lt(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}(Vt),Kt=function(t){function e(e,a,i,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new f(2*q.CHIP_SIZE,30),7*q.CHIP_SIZE,40,i,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 f(a.x,a.y),340,30,i,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 Lt(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}(Vt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Gt||(Gt={}));var jt=function(){function t(t,e,a,i,s,r,o,n,_,c){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var h=this,u=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=a,this._width=i,this._height=s,this._message="",this._isVisible=o,this._isYesno=n,this._isItemMenu=_,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=c,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.YES),h.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case P.SP:case P.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,a,i){this._x=t,this._y=e,this._width=a,this._height=i,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,a,i,s){var r,o=i.getPartsCoord().substract(s.getPartsCoord()).y;r=t?Gt.BOTTOM:e?Gt.SCORE:a?Gt.CENTER:o>=Math.ceil(q.V_PARTS_NUM_IN_WINDOW/2)?Gt.TOP:Gt.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Gt.CENTER?(this._y=q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Gt.TOP?(this._y=Math.max(20,q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Gt.BOTTOM?(this._y=Math.min(q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Gt.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"),a=0,i="",s=0;s<t.length||0!=a;s++)if(this.isWideChar(t.charAt(s))?a+=2:a+=1,i+=t.charAt(s),a+1>2*q.MSG_STR_WIDTH){"。"!==t.charAt(s+1)&&"、"!==t.charAt(s+1)||(i+=t.charAt(s+1),s++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=i,e.appendChild(r),a=0,i=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YESP_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NO_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YES_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NOP_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_YES_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+q.IMGRELPOS_YESNO_NO_X)*q.CHIP_SIZE+"px -"+e.y*q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var a=this._message.split("\n");a.forEach((function(e,i){var s;t._wwa.isClassicMode()?s=t.createClassicTextElement(e):(s=document.createElement("span")).textContent=a[i],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,a,i,s,r,o,n,_,c,h,u=this;e=document.createElement("div"),c=(n=document.getElementById("disp-energy")).style.backgroundPosition,h=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(a=document.createElement("div")).classList.add("savedata"),a.setAttribute("save_id",p),a.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(i=document.createElement("div")).classList.add("ss"),a.appendChild(i),(s=document.createElement("div")).classList.add("wide-cell-row"),s.style.backgroundPosition=c,s.style.backgroundImage=h,a.appendChild(s),e.appendChild(a),t.flag&&(i.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=Q.DATE_LAST_SAVE_TEXT_COLOR),i.appendChild(r),(o=document.createElement("div")).classList.add("status-icon"),o.style.backgroundImage=h,o.style.backgroundPosition="-120px -80px",s.appendChild(o),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),s.appendChild(_));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,a=document.querySelectorAll(".savedata"),i=a.length,s=0;s<i;s++)e=a[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=q.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+Q.QUICK_SAVE_MAX)%Q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Xt=function(){function t(t,e,a){this.id=t,this.imgFileName=e,this.parent=a,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,a){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,a.isNoEffect?this.damageDispElem.textContent="攻撃無効":a.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+a.damage},t}(),Jt=function(){function t(t,e,a){var i,s=this;this._wwa=t,this._imgFileName=e,this._parent=a,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)i=new Xt(r,this._imgFileName,this._element),this._edes.push(i),this._element.appendChild(i.elem);this._element.addEventListener("click",(function(){s._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var a=0;a<q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var i=this._wwa.getObjectAttributeById(e[a],q.ATR_X),s=this._wwa.getObjectAttributeById(e[a],q.ATR_Y),r=new f(i,s),o=this._wwa.getObjectAttributeById(e[a],q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],q.ATR_DEFENCE),c=new E(o,n,_,0),h=qt(t,c);this._edes[a].setResult(r,c,h),this._edes[a].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Zt=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function qt(t,e){var a=e.energy,i=t.strength-e.defence,s=Math.max(0,e.strength-t.defence),r=0,o=0;if(!(i>0))return new Zt(!0,!1,0);for(;;){if(r++,(a-=i)<=0)return new Zt(!1,!1,o);if(o+=s,r>1e4)return new Zt(!1,!0,0)}}var Qt,zt=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},$t=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Qt||(Qt={}));var te=function(){function t(t,e,a){var i=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=a,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){i._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(){i._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){i._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return zt(i,void 0,void 0,(function(){var t=this;return $t(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=Qt.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===Qt.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===Qt.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 a=e.split("\n");this._descriptionElement.textContent="";for(var i=0;i<a.length;i++){var s=document.createElement("span");s.textContent=a[i],this._descriptionElement.appendChild(s),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function ee(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function ae(t,e,a){var i,s=document.createElement("style");s.type="text/css",s.setAttribute("id",q.WWA_STYLE_TAG_ID),(i="head",document.getElementsByTagName(i))[0].appendChild(s),t.innerHTML=function(t,e){var a=t?'\n <div id="wwa-cover">\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(q.SCREEN_WIDTH,'" height="').concat(q.SCREEN_HEIGHT,'"></canvas>\n </div>'),i=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(a,"\n").concat(i,"\n")}(null!==e,a),null!==e&&(pt("wwa-cover").style.backgroundImage="url(".concat(e,")"),pt("wwa-cover").style.backgroundRepeat="no-repeat",pt("wwa-cover").style.backgroundPosition="0 0")}var ie=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=q.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=Et(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(a)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,a,i=null;for(e=0;e<t.COL_MAX;e++)for(a=0;a<t.ROW_MAX;a++)(i=pt(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&i.classList.remove("onpress")},t.prototype.openView=function(){this.close();pt(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}(),se=a(23);function re(t){return"^ /".concat(231*t+8310,"P+>A[]")}function oe(t){return(0,se.MD5)(t).toString()}var ne="map",_e="mapObject",ce="systemMessage",he="userVar",ue={mapAttribute:!0,objectAttribute:!0,message:!0},le=function(){},pe=function(){function t(){}return t.compress=function(t){var e,a,i={};for(e in t)if(!ue[e]){switch(typeof(a=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===a&&"worldName"!==e)continue;break;case"object":if(null===a){if(this._restartData[e]===a)continue}else if(void 0===(a=this.compressObject(e,a,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}i[e]=a}return i},t.compressObject=function(t,e,a){var i,s,r,o;switch(t){case ne:case _e:var n,_,c,h,u,l,p,d,E,f,w,y,m,g;for(u in i={},E={},d={},e)for(h in s=e[u],r=a[u],o={},_=-1,s)(p=s[h])!==r[h]&&(o[h]=p,void 0===E[p]&&(E[p]={}),void 0===(w=E[p])[u]&&(w[u]=[]),(m=w[u]).push(Number(h)));for(y in E)for(u in w=E[y],void 0===d[y]&&(d[y]={}),f=d[y],void 0===i[y]&&(i[y]=[]),_=-1,w)1===(m=w[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,i[y].push(this.getCompressArray(m),c));for(y in d)for(h in p=Number(y),_=-1,f=d[y])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?i[y].push(c,g[0]):i[y].push(c,this.getCompressArray(g));var A=[];for(y in _=-1,i)c=(n=Number(y))-_-1,_=n,A.push(c,i[y]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):A;case ce:var S;for(t in i={},e)S=e[t],a[t]!==S&&(i[t]=S);break;case he:return this.compressUserVars(e);default:return e}if(0!==Object.keys(i).length)return i},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,a){var i,s,r,o,n,_,c,h,u,l,p,d,E,f,w,y,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(r=0,o=0,_=0,c=0,w=0,p=[],f={},u=[],l=[],s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(-1===A&&(A=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new de(h,w++)),f[h].count++),8===++r&&(r=0,o++);for(n in f)p[f[n].index]=f[n];for(d in p.sort(this.idSort),E={},p)E[h=p[d].id]=Number(d),u[d]=h;for(s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(l[c++]=E[h]);if(a){for(y=g.length,A=-1,_=0,o=0;o<y;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===A&&(A=o),_=o);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var a,i,s,r,o,n,_=[];for(r=t.length,i=0,a=0;a<r;a++){for(o=t[a],n=0,s=a+1;s<r&&o===t[s];s++)n++,a=s;switch(n){case 0:_[i++]=o;break;case 1:_[i++]=o,_[i++]=o;break;default:_[i++]=o,_[i++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,a,i,s,r,o,n,_,c=[];for(e=-1,r=t.length,o=0,s=0;s<r;s++){for(a=(i=t[s])-e,n=0,_=s;_<r-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?c[o++]=a:(s=_,i+=n,c[o++]=0,c[o++]=a,c[o++]=n-this.MIN_LOOP_COUNT),e=i}return c},t.getDecompressArray=function(t){var e,a,i,s,r,o,n,_=[];for(e=-1,r=t.length,s=0,n=0;s<r;s++)if(0===(a=t[s])){for(o=(i=e+(a=t[++s]))+t[++s]+this.MIN_LOOP_COUNT;i<=o;i++)_[n++]=i;e=o}else i=e+a,_[n++]=i,e=i;return _},t.decompress=function(t){var e,a,i;for(a in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(i=t[a])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==i&&(i=this.decompressObject(a,i,e[a]));break;case"function":continue}e[a]=i}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,a){var i;switch(t){case ne:case _e:var s,r,o,n,_,c,h,u;i={},r=-1;var l,p,d=e;if(4===(u=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,a,this._firstRandomMapObjectUtf8Table[t]),a;for(h=0;h<u;h+=2)r=s=r+Number(d[h])+1,_=s,i[s]=d[h+1];for(c in i){for(_=Number(c),u=(d=i[c]).length,l=[],p=[],h=0;h<u;h+=2){var E=d[h],f=d[h+1];E instanceof Array&&(E=this.getDecompressArray(E)),f instanceof Array&&(f=this.getDecompressArray(f)),"object"==typeof E?l.push({x:E,y:f}):p.push({x:E,y:f})}var w;for(w in r=-1,l)if(r=s=r+Number(l[w].y)+1,E=l[w].x,n=String(s),E instanceof Array)for(u=(d=E).length,h=0;h<u;h++)o=String(d[h]),a[n][o]=_;else o=String(E),a[n][o]=_;for(w in r=-1,p)if(r=s=r+Number(p[w].x)+1,f=p[w].y,o=String(s),f instanceof Array)for(u=(d=f).length,h=0;h<u;h++)a[n=String(d[h])][o]=_;else a[n=String(f)][o]=_}return a;case he:return this.decompressUserVars(e);default:if(a);else{if(!e)return;a=a instanceof Array?[]:{}}for(t in e)a[t]=e[t];return a}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var a=e[0],i=e[1];return t[a]=i,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(q.USER_VAR_NUM),e=0;e<q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,a){var i,s,r,o,n,_,c,h,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],o=t[2],s=t[3];var f=t[1];if(E.set(f,p),a)for(w=E.length,u=0;u<w;u++)E[u]=E[u]|a[u];r=[];var w,y,m,g,A,S,v=o.length;for(w=s.length,y=0,m=0;y<w;y++){if((n=s[y])>=v)for(g=n-v,A=0;A<g;A++)r[m++]=S;else r[m++]=n;S=n}for(h=0,u=0,l=0,_=0,w=E.length,u=0;u<w;u++)for(h=0;h<8;h++){if(0!=(E[u]&1<<h)){if(void 0===(n=r[_++]))return!1;i=o[n],c=l%d,e[l/d|0][c]=i}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[_e]=this.getChangedUint8Array(e[_e],t[_e])},t.getChangedUint8Array=function(t,e){var a,i,s,r,o=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(s=0,r=0,i=0;i<o;i++)for(a=0;a<o;a++)t[i][a]!==e[i][a]&&(-1===_&&(_=r),n[r]=n[r]|1<<s),8===++s&&(s=0,r++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var a;if(e)try{if(a=this.decompress(e)[0])return a}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 le,t}(),de=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},Ee=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=Q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=Q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){pt("cell-load").textContent=z.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,a){var i=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=a,this.flag=!0;var s=document.createElement("img");s.src=t,s.addEventListener("load",(function(){i.flag=!0,i.ctx.drawImage(s,0,0,s.width,s.height,0,0,i.cvs.width,i.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,a,i,s,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,a=this.date.getDate(),i=this.date.getHours(),s=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(a=("0"+a).slice(-2))+" "+(i=("0"+i).slice(-2))+":"+(s=("0"+s).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),fe=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fe(e,t),e.prototype.save=function(e,a){var i=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,a,this.date),i},e}(Ee),ye=we,me=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),ge=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return me(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<Q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<Q.QUICK_SAVE_MAX;a++)(e=this[a]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),Ae=function(){return Ae=Object.assign||function(t){for(var e,a=1,i=arguments.length;a<i;a++)for(var s in e=arguments[a])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},Ae.apply(this,arguments)},Se=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?Ae(Ae({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?Ae(Ae({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},ve=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Te=function(t){function e(a,i,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 o=0;o<Q.QUICK_SAVE_MAX;o++)r[o]=new ye(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=i,r.createDataBase(),r.selectSaveData(),r}return ve(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(Q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var a=this.indexDBOpen();a.onupgradeneeded=function(e){var i=a.result,s={keyPath:t.keyPath};i.objectStoreNames.contains(Q.INDEXEDDB_TABLE_NAME)||i.createObjectStore(Q.INDEXEDDB_TABLE_NAME,s).createIndex("url","url",{unique:!1})},a.onsuccess=e.doNotAnything,a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var a=e.transaction(Q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(Q.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,i){return{url:location.href,id:t,hash:Re.checkOriginalMapString,image:e.toDataURL(),data:a,date:i,worldName:Re.worldName,mapDataRevisionKey:Re.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var a=t.index("url"),i=IDBKeyRange.only(location.href),s=a.getAll(i);s.onsuccess=function(){e(s.result)}},e.prototype.dbUpdateSaveData=function(t,a,i,s){var r=this,o=this.indexDBOpen();o.onupgradeneeded=e.doNotAnything,o.onsuccess=function(){var n=r.getObjectStore(o.result),_=pe.compress(i),c=r.makeSaveDataItem(t,a,_,s);r.selectDatas[t]=c;var h=n.put(c);h.onsuccess=e.doNotAnything,h.onerror=e.doNotAnything},o.onerror=e.doNotAnything,o.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var a=this,i=this.indexDBOpen();i.onupgradeneeded=e.doNotAnything,i.onsuccess=function(){var e=a.getObjectStore(i.result);t.forEach((function(t){e.delete([t,location.href])}))},i.onerror=e.doNotAnything,i.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=t.getObjectStore(a.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var a,i,s,r=[];for(i=e.length,a=0;a<i;a++){var o=e[a];try{s={id:o.id,hash:o.hash,data:o.data,date:o.date,image:o.image,worldName:o.worldName,mapDataRevisionKey:o.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(s.worldName,s.hash,s.mapDataRevisionKey);if(null===n){if(t[s.id]){var _=Se(pe.decompress(s.data)[0]);t[s.id].saveDataSet(s.image,_,s.date)}}else r.push({id:s.id,cause:n})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var c=r.map((function(t){return t.cause})).filter((function(t,e,a){return a.indexOf(t)===e}));t.onCompleteLoadingSaveData(c)}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(ge),Ie=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ie(e,t),e}(Ee),De=Oe,Ce=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Pe=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=Q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var i=0;i<Q.QUICK_SAVE_MAX;i++)a[i]=new De(i,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return Ce(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%Q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ge);function Ne(t,e){return(0,se.MD5)(t+e).toString()}var Me,be=function(){function t(e,a,i,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=Ne(a,i),this._wwaDBSaveList=new Te(s,r),this._wwaLogSaveList=new Pe,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,a){var i=this.list[a];return!!i&&i.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?M.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?M.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?M.CALL_BY_LOG_QUICK_LOAD:M.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?M.CALL_BY_LOG_QUICK_LOAD:t?M.CALL_BY_PASSWORD_LOAD:M.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?pt("cell-save").textContent=z.EMPTY_SAVE:pt("cell-save").textContent=z.QUICK_SAVE},t}(),Re=be;!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"}(Me||(Me={}));var Le,xe=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},Be=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ue=function(){function t(t,e,a,i){var s=this;this.id=t,this.fileName=e,this.audioContext=a,this.audioGain=i,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(s.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=a,this.audioGain=i,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.load()}return t.prototype.fetchSoundFile=function(){return xe(this,void 0,void 0,(function(){return Be(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 xe(this,void 0,void 0,(function(){return Be(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),xe(this,void 0,void 0,(function(){var e,a,i=this;return Be(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(a=s.sent())?(this.audioContext.decodeAudioData(a,(function(e){if(0===e.length)return console.log("サウンド ".concat(i.id," 番の音声ファイルのバッファサイズが 0 です ")),void i.retry(t);i.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;setTimeout((function(){return xe(e,void 0,void 0,(function(){return Be(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(){var t=this,e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var a=e.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),e.start(),e.onended=function(){var a=t.bufferSources.indexOf(e);-1!==a&&t.bufferSources.splice(a,1),t.disposeBufferSource(e)},this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=H.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),We=function(t,e){for(var a=new Array(t),i=0;i<a.length;i++)a[i]=new Array(e);return a};function Ye(t,e){var a=function(t){return t[Le.CHECK]+256*t[Le.CHECK+1]}(t),i=function(t,e){var a,i=0;if(t[Le.VERSION]>=29){for(var s=2;s<e;s++)i+=(a=t[s],((a%=256)>=128?a-256:a)*(s%8+1));i=i%65536&65535}return i}(t,e);if(a!==i)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+a+"ですが、実際の和は"+i+"でした。")}!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"}(Le||(Le={}));var Fe,ke,Ge=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"}(Fe||(Fe={})),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"}(ke||(ke={}));var Ve=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Ye(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"}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Le.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Le.MAPDATA_TOP:this.currentPosition=Le.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Fe.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Fe.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ge.MAP_ATR_MAX:Ge.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ge.OBJ_ATR_MAX:Ge.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Fe.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Fe.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Fe.MAP),this._convertAttributeV2toV3(Fe.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,i;if(t==Fe.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,i=Ge.MAP_LOCALGATE;else{if(t!=Fe.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,i=Ge.OBJECT_LOCALGATE}for(var s=0;s<e;s++){for(var r=9;r>=0;r--){var o=255&a[s][20+2*r],n=a[s][20+2*r]>>8,_=255&a[s][20+2*r+1],c=a[s][20+2*r+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===c?c=9e3:c>100&&(c+=9840),a[s][20+4*r]=o,a[s][20+4*r+3]=n,a[s][20+4*r+1]=_,a[s][20+4*r+2]=c}a[s][Ge.ATR_TYPE]===i&&(a[s][Ge.ATR_JUMP_X]>100&&(a[s][Ge.ATR_JUMP_X]+=9840),a[s][Ge.ATR_JUMP_Y]>100&&(a[s][Ge.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(Le.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Le.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Le.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Le.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Le.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Le.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Le.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Le.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Le.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Le.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Le.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Le.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Le.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Le.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Le.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Le.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Le.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Le.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Le.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?Le.ITEMBOX_TOP:Le.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ge.ITEMBOX_SIZE);for(var e=0;e<Ge.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,i,s;for(s=We(this.wwaData.mapWidth,this.wwaData.mapWidth),a=0;a<this.wwaData.mapWidth;a++)for(i=0;i<this.wwaData.mapWidth;i++)this.wwaData.version>29?(s[a][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(s[a][i]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(a*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(a*this.wwaData.mapWidth+i,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Fe.MAP?ke.MAP_LOAD:ke.OBJ_LOAD),s[a][i]>=e&&(s[a][i]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Fe.MAP?ke.MAP_LOAD:ke.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,a){var i,s,r;for(r=We(e,a),i=0;i<e;i++)for(s=0;s<a;s++)(i*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(i*a+s,e*a,t===Fe.MAP?ke.MAP_ATTR:ke.OBJ_ATTR),s!==Ge.ATR_CROP1&&s!==Ge.ATR_CROP2?(r[i][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[i][s]=0,this.currentPosition+=2);return this.emitProgress(e*a,e*a,t===Fe.MAP?ke.MAP_ATTR:ke.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,ke.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var He=function(){function t(t,e,a,i){this.wwaData=t,this.compressedMapData=e,this.startPosition=a,this.eventEmitter=i,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:ke.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:ke.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(Ge.SYSTEM_MESSAGE_NUM);for(e=0;e<Ge.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ge.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ge.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ge.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ge.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ge.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ge.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ge.DEFAULT_DISABLE_SAVE,t.isOldMap=Ge.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ge.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ge.IMGPOS_DEFAULT_STATUS_X+Ge.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ge.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ge.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ge.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ge.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ge.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ge.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ge.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ge.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ge.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ge.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ge.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ge.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ge.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ge.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ge.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ge.DEFAULT_STR_COLOR_R,t.fontColorG=Ge.DEFAULT_STR_COLOR_G,t.fontColorB=Ge.DEFAULT_STR_COLOR_B,t.statusColorR=Ge.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ge.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ge.DEFAULT_STATUS_COLOR_B,t.moves=Ge.DEFAULT_MOVES,t.gameSpeedIndex=Ge.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ge.USER_VAR_NUM);for(e=0;e<Ge.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},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}(),Ke=function(){},je=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),Xe=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},Je=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ze=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return je(e,t),e.fetch=function(t){return Xe(this,void 0,void 0,(function(){return Je(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 a="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(a));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(a));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(a))}},e.prototype.request=function(){return Xe(this,void 0,void 0,(function(){var t;return Je(this,(function(a){switch(a.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=a.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,a.sent()]}}))}))},e}(Ke),qe=a(106),Qe=a.n(qe),ze=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),$e=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},ta=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},ea=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return ze(e,t),e.prototype.request=function(){return $e(this,void 0,void 0,(function(){var t=this;return ta(this,(function(e){return[2,new Promise((function(e,a){Qe().readFile(t.fileName,(function(t,i){t&&a(t),e(i.buffer)}))}))]}))}))},e}(Ke),aa=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},ia=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},sa=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return aa(this,void 0,void 0,(function(){var t,e,a,i,s,r;return ia(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new Ze(n):new ea(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=o.sent())?(a=this.loadMapData(e),this.eventEmitter.dispatch("mapData",a),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return i=o.sent(),s=i.name||"",r=i.message||"",this.eventEmitter.dispatch("error",{name:s,message:r}),[3,4];case 4:return[2]}var n}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),a=function(t){var e,a,i=new Uint8Array(t.length);for(e=0,a=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(i[a++]=t[e],t[e]===t[e+1]){for(var s=t[e+2],r=0;r<s;r++)i[a++]=t[e];e+=2}if(a+255>=i.length){var o=new Uint8Array(i.length+65e3);o.set(i),i=o}}return console.log("EXTRACT DATA = "+a+" "+e),{byteMapData:i,byteMapLength:a,compressedEndPosition:e+3}}(e),i=a.byteMapData,s=a.byteMapLength,r=a.compressedEndPosition,o=new Ve(i,s,this.eventEmitter).extractAllData();return new He(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),ra=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var a=new CustomEvent(t,{detail:e});this.target.dispatchEvent(a)},t.prototype.addListener=function(t,e){var a=function(t){return e(t.detail)};return this.target.addEventListener(t,a),a},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),oa=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},na=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},_a="-?\\d+",ca="v\\[".concat(_a,"\\]"),ha="v\\[(".concat(_a,")\\]"),ua="HP|HPMAX|AT|DF|GD|STEP",la="".concat(ca,"|").concat(ua),pa="".concat(_a,"|").concat(ca,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|PX|PY","|").concat(ua),da="RAND\\((?:".concat(pa,")\\)"),Ea="RAND\\((".concat(pa,")\\)"),fa="".concat(da),wa="".concat(pa,"|").concat(fa),ya="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ma="^\\(",ga="\\)$",Aa=new RegExp("^".concat(_a,"$")),Sa=new RegExp("^".concat(ha,"$")),va=new RegExp("^".concat(Ea,"$")),Ta=new RegExp("".concat(ma,"(").concat(la,")").concat("=","(").concat(wa,")(").concat("\\+|\\-|\\*|\\/|%",")(").concat(wa,")").concat(ga)),Ia=new RegExp("".concat(ma,"(").concat(la,")(").concat(ya,")(").concat(wa,")").concat(ga)),Oa=new RegExp("".concat(ma,"(").concat(wa,")(").concat(">|<|<=|>=|==|!=",")(").concat(wa,")").concat(ga));function Da(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"PX":case"PY":return{type:t};default:var e=t.match(Sa);if(e){var a=e.length>=2?parseInt(e[1],10):null;return null===a||isNaN(a)?null:{type:"VARIABLE",index:a}}if(t.match(Aa)){var i=parseInt(t,10);return null===i||isNaN(i)?null:{type:"NUMBER",rawValue:i}}var s=t.match(va);if(s){var r=s.length>=2?Da(s[1]):null;return null!==r&&"RAND"!==r.type?{type:"RAND",argument:r}:null}return null}}function Ca(t,e){var a;switch(null===(a=Da(e))||void 0===a?void 0:a.type){case"VARIABLE":var i=e.match(/^v\[(\d+)\]$/),s=parseInt(i[1],10);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:s,rawValue:t};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"RAND":throw new Error("左辺値に乱数は入れられません")}}function Pa(t){return t.replace(/\s/g,"")}function Na(t,e){return bt(Da(t),e)}function Ma(t){var e=Pa(t).match(Oa);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var a=Da(e[1]),i=Da(e[3]);if(a&&i)return{left:a,right:i,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var ba,Ra=function(t,e,a,i){return new(a||(a=Promise))((function(s,r){function o(t){try{_(i.next(t))}catch(t){r(t)}}function n(t){try{_(i.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((i=i.apply(t,e||[])).next())}))},La=function(t,e){var a,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(6===r[0]&&o.label<s[1]){o.label=s[1],s=r;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(r);break}s[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],i=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},xa=function(t,e,a){if(a||2===arguments.length)for(var i,s=0,r=e.length;s<r;s++)!i&&s in e||(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))};function Ba(t,e,a){var i=new $;return i.current=t,i.total=e,i.stage=a,i}var Ua=function(){function a(a,s,n,c,p,d,y,m,A,S,v,T,I){void 0===s&&(s=!1),void 0===y&&(y=""),void 0===m&&(m=!1),void 0===A&&(A=null),void 0===T&&(T=!1),void 0===I&&(I=null);var O,D=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return D._main()},this.soundCheckCaller=function(){return D.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return D._keyStore.checkHitKey(e.KEY_ESC)||D._keyStore.checkHitKey(e.KEY_SHIFT)||D._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ra(pt("wwa-wrapper")),window.addEventListener("click",(function(t){D._isActive=!1})),pt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),D._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=pt("progress-panel"),(O=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?pt("version").textContent="WWA Wing Ver.3.11.6":this._setLoadingMessage(O,0)}catch(t){}this._dumpElement=A;var R=window.AudioContext||window.webkitAudioContext;R&&(this.audioContext=new R,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var L=new Audio;"no"!==L.canPlayType("audio/mpeg")&&""!==L.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=s,this._isClassicModeEnable=c,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),y?"/"!==y[y.length-1]&&(y+="/"):y="./audio/",this._audioDirectory=y,this._bottomButtonType=d?h.GOTO_WWA:h.BATTLE_REPORT;var x=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===P.GAME){if(this.userDevice.os===C.NINTENDO)q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===N.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case P.VR:case P.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(pt("cell-save").textContent=z.QUICK_SAVE,this._usePassword?pt("cell-load").textContent=z.PASSWORD:pt("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:pt("cell-gotowwa").textContent=z.GOTO_WWA;break;case h.BATTLE_REPORT:pt("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case h.GAME_END:pt("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(a){D._wwaData=a,D._wwaData.isItemEffectEnabled=p;try{D._hasTitleImg?pt("version").textContent+=" (Map data Ver. "+Math.floor(D._wwaData.version/10)+"."+ +D._wwaData.version%10+")":D._setLoadingMessage(O,1)}catch(t){}var s=pt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");s.pop(),s.push(D._wwaData.mapCGName),D._wwaData.mapCGName=s.join("/"),D._startTime=(new Date).getTime(),D._restartData=JSON.parse(JSON.stringify(D._wwaData)),D.checkOriginalMapString=D._generateMapDataHash(D._restartData),D.initCSSRule(),D._setProgressBar(Ba(0,4,j.GAME_INIT)),D._setLoadingMessage(O,2);var n=new Image;n.src=D._wwaData.mapCGName,n.addEventListener("error",(function(){D._setErrorMessage("画像ファイル「"+D._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",O)}));var c=D._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),h=function(t){t.style.backgroundImage="url("+c+")"};Array.prototype.forEach.call(ft("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(D._wwaData.imgItemboxX*q.CHIP_SIZE,"px -").concat(D._wwaData.imgItemboxY*q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ft("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ft(".item-cell>.item-disp"),h),Array.prototype.forEach.call(ft("div.wide-cell-row>.status-icon"),h),D.setStatusIconCoord(V.ENERGY,new f(D._wwaData.imgStatusEnergyX,D._wwaData.imgStatusEnergyY)),D.setStatusIconCoord(V.STRENGTH,new f(D._wwaData.imgStatusStrengthX,D._wwaData.imgStatusStrengthY)),D.setStatusIconCoord(V.DEFENCE,new f(D._wwaData.imgStatusDefenceX,D._wwaData.imgStatusDefenceY)),D.setStatusIconCoord(V.GOLD,new f(D._wwaData.imgStatusGoldX,D._wwaData.imgStatusGoldY)),D._setProgressBar(Ba(1,4,j.GAME_INIT)),D._setLoadingMessage(O,3),D._mapIDTableCreate(),D._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-x)+"ms"),D._cvs=pt("wwa-map");var y=D._cvs.getContext("2d",{alpha:!1});y.fillStyle="rgba( 255, 255, 255, 0.5)",y.fillRect(0,0,440,440);var A=new w(D,D._wwaData.playerX,D._wwaData.playerY);D._camera=new vt(A),D._itemMenu=new ie;var S=new E(D._wwaData.statusEnergy,D._wwaData.statusStrength,D._wwaData.statusDefence,D._wwaData.statusGold);D._player=new Dt(D,A,D._camera,S,D._wwaData.statusEnergyMax,D._wwaData.moves,D._wwaData.gameSpeedIndex),D._objectMovingDataManager=new Nt(D,D._player),D._camera.setPlayer(D._player),D._keyStore=new r,D._mouseStore=new _,T?(D._virtualPadButtonElements={BUTTON_ENTER:pt("wwa-enter-button"),BUTTON_ESC:pt("wwa-esc-button"),BUTTON_FAST:pt("wwa-fast-button"),BUTTON_SLOW:pt("wwa-slow-button"),BUTTON_LEFT:pt("wwa-left-button"),BUTTON_UP:pt("wwa-up-button"),BUTTON_RIGHT:pt("wwa-right-button"),BUTTON_DOWN:pt("wwa-down-button")},D._virtualPadStore=new ht(D._virtualPadButtonElements,ee(),pt("wwa-virtualpad-right"),pt("wwa-virtualpad-left"),D._setVirtualPadTouch.bind(D),D._setVirtualPadLeave.bind(D)),function(t,e){if(null===t)return;var a=document.createElement("button");a.classList.add("wwa-virtualpad-toggle-button"),a.textContent="仮想パッド表示切り替え",a.addEventListener("click",e),t.appendChild(a)}(I,(function(){D._virtualPadStore.toggleVisible()}))):(D._virtualPadButtonElements=null,D._virtualPadStore=new ht({})),D._gamePadStore=new l,D._pages=[],D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._yesNoChoiceCallInfo=M.NONE,D._prevFrameEventExected=!1,D._isLastPage=!1,D._reservedPartsAppearances=[],D._reservedJumpDestination=void 0,D._shouldSetNextPage=!1,D._passwordLoadExecInNextFrame=!1,D._messageWindow=new jt(D,50,180,340,0,D._wwaData.mapCGName,!1,!0,!1,pt("wwa-wrapper")),D._scoreWindow=new Kt(D,new f(50,50),!1,pt("wwa-wrapper")),D._wwaSave=new Re(ba,ba._wwaData.worldName,ba._wwaData.worldPassNumber,D._checkSaveDataCompatibility.bind(D),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Me.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Me.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Me.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),D._isDisallowLoadOldSave=m,D._messageWindow.setWWASave(D._wwaSave),pe.setRestartData(D._restartData,D._wwaData),D.clearFaces();var N=pt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof N&&(D._useSuspend=!0,N)){var R=pe.getStartWWAData(N);D._restartData!==R&&(D._applyQuickLoad(R),D._wwaSave.resumeStart())}var L=pt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==L&&D._wwaSave.setAutoSaveInterval(0|Number(L));var B=pt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(D._useLookingAround=!(B&&B.match(/false/i)),D._setProgressBar(Ba(2,4,j.GAME_INIT)),D._setLoadingMessage(O,4),window.addEventListener("keydown",(function(t){if(D._isActive){if(D.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();D._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?D._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():D._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(D._isActive){if(D.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();D._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||D._player.isWaitingMessage()||D._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){D._keyStore.allClear(),D._mouseStore.clear(),D._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){D._keyStore.allClear(),D._mouseStore.clear(),D._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){D._isActive&&t.preventDefault()})),D._mouseControllerElement=pt("wwa-controller"),D._mouseControllerElement.addEventListener("mousedown",(function(t){if(D._isActive&&1===t.which){if(D._mouseStore.getMouseState()!==i.NONE)return void t.preventDefault();var e=wt(t.clientX,t.clientY),a=D._player.getDrawingCenterPosition(),s=e.substract(a),r=Math.abs(s.x),o=Math.abs(s.y),n=void 0,_=!1;if(r<q.CHIP_SIZE&&o<q.CHIP_SIZE){switch(a.x/q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(a.y/q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(s.y>0&&o>r?n=u.DOWN:s.y<0&&o>r?n=u.UP:s.x>0&&o<r?n=u.RIGHT:s.x<0&&o<r&&(n=u.LEFT)),D._mouseStore.setPressInfo(n,0)}})),D._mouseControllerElement.addEventListener("mouseleave",(function(t){D._mouseStore.clear()})),D._mouseControllerElement.addEventListener("mouseup",(function(t){D._isActive&&1===t.which&&(D._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(D.audioContext){var U=function(){D.audioContext.createBufferSource().start(0),D._mouseControllerElement.removeEventListener("touchstart",U),U=null};D._mouseControllerElement.addEventListener("touchstart",U)}D._mouseControllerElement.addEventListener("touchstart",(function(t){if(D._isActive)if(D._mouseStore.getMouseState()===i.NONE){for(var e=t.changedTouches,a=e.length,s=0;s<a;s++){var r=e[s],o=wt(r.clientX,r.clientY),n=D._player.getDrawingCenterPosition(),_=o.substract(n),c=Math.abs(_.x),h=Math.abs(_.y),l=void 0,p=!1;if(c<q.CHIP_SIZE&&h<q.CHIP_SIZE){switch(n.x/q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&h>c?l=u.DOWN:_.y<0&&h>c?l=u.UP:_.x>0&&h<c?l=u.RIGHT:_.x<0&&h<c&&(l=u.LEFT)),D._mouseStore.setPressInfo(l,r.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var W=function(t){if(D._isActive)for(var e=0;e<t.changedTouches.length;e++)if(D._mouseStore.getTouchID()===t.changedTouches[e].identifier){D._mouseStore.setReleaseInfo(),t.preventDefault();break}};D._mouseControllerElement.addEventListener("touchend",W),D._mouseControllerElement.addEventListener("touchcancel",W)}pt("button-load").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.QUICK_LOAD)})),pt("button-save").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.QUICK_SAVE)})),pt("button-restart").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.RESTART_GAME)})),pt("button-gotowwa").addEventListener("click",(function(){(D._player.isControllable()||D._messageWindow.isItemMenuChoice())&&D.onselectbutton(b.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ft(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){D._displayHelp()}))})),D._frameCoord=new f(q.IMGPOS_DEFAULT_FRAME_X,q.IMGPOS_DEFAULT_YESNO_Y),D._battleEffectCoord=new f(q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),D._battleEstimateWindow=new Jt(D,D._wwaData.mapCGName,pt("wwa-wrapper")),D._passwordWindow=new te(D,pt("wwa-wrapper"),m),D._monsterWindow=new Ht(D,new f(50,180),340,60,!1,pt("wwa-wrapper"),D._wwaData.mapCGName),D._setProgressBar(Ba(3,4,j.GAME_INIT)),D._isLoadedSound=!1,D._temporaryInputDisable=!1,D._paintSkipByDoorOpen=!1,D._clearFacesInNextFrame=!1,D._useConsole=!1,D.wwaCustomEvent("wwa_startup"),D._cgManager=new St(y,D._wwaData.mapCGName,D._frameCoord,(function(){D._isSkippedSoundMessage=!0;var a=function(){switch(D.userDevice.device){case P.PC:D.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case P.SP:D.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===D._wwaData.systemMessage[Y.LOAD_SE])return D._isLoadedSound=!0,a(),D._setLoadingMessage(O,j.AUDIO),D.loadSound(),void window.requestAnimationFrame(D.soundCheckCaller);if("OFF"===D._wwaData.systemMessage[Y.LOAD_SE])return D._isLoadedSound=!1,a(),void D.openGameWindow();if(D._isSkippedSoundMessage=!1,D._hasTitleImg||O.clearRect(0,0,q.SCREEN_WIDTH,q.SCREEN_HEIGHT),D._usePassword){var i="効果音・BGMデータをロードしますか?";v&&(i+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),D._messageWindow.setMessage(""===D._wwaData.systemMessage[Y.LOAD_SE]?i:D._wwaData.systemMessage[Y.LOAD_SE]),D._messageWindow.show(),D._setProgressBar(Ba(4,4,j.GAME_INIT));var s=setInterval((function(){D._keyStore.update(),D._gamePadStore.update(),D._virtualPadStore.update(),D._yesNoJudgeInNextFrame===g.UNSELECTED&&(D._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||D._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||D._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||D._virtualPadStore.checkTouchButton("BUTTON_ENTER")?D._yesNoJudgeInNextFrame=g.YES:(D._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||D._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||D._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||D._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(D._yesNoJudgeInNextFrame=g.NO)),D._yesNoJudgeInNextFrame===g.YES?(clearInterval(s),D._messageWindow.update(),D._yesNoJudge=D._yesNoJudgeInNextFrame,D._messageWindow.setInputDisable(),setTimeout((function(){D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!0,D._setLoadingMessage(O,j.AUDIO),D.loadSound(),window.requestAnimationFrame(D.soundCheckCaller)}),q.YESNO_PRESS_DISP_FRAME_NUM*q.DEFAULT_FRAME_INTERVAL)):D._yesNoJudgeInNextFrame===g.NO&&(clearInterval(s),D._messageWindow.update(),D._yesNoJudge=D._yesNoJudgeInNextFrame,D._messageWindow.setInputDisable(),setTimeout((function(){D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!1,D.openGameWindow()}),q.YESNO_PRESS_DISP_FRAME_NUM*q.DEFAULT_FRAME_INTERVAL))}),q.DEFAULT_FRAME_INTERVAL)}else clearInterval(s),D._player.setDelayFrame(),D._messageWindow.hide(),D._yesNoJudge=g.UNSELECTED,D._yesNoJudgeInNextFrame=g.UNSELECTED,D._isLoadedSound=!0,D.loadSound(),window.requestAnimationFrame(D.soundCheckCaller)})),D.wwaCustomEvent("wwa_start")};var B=new ra;B.addListener("mapData",(function(t){return D._loadHandler(t)})),B.addListener("progress",(function(t){return D._setProgressBar(t)})),B.addListener("error",(function(t){return D._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,O)})),new sa(a,B).requestAndLoadMapData().then((function(){return Ra(D,void 0,void 0,(function(){return La(this,(function(t){return this._canDisplayUserVars=v,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,S?(e=S,oa(void 0,void 0,void 0,(function(){return na(this,(function(t){return[2,fetch(e).then((function(t){return 200===t.status||304===t.status?{kind:"data",data:t}:{kind:"httpError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。ステータスコード: ").concat(t.status)}})).catch((function(t){return{kind:"connectionError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return oa(void 0,void 0,void 0,(function(){var e,a;return na(this,(function(i){switch(i.label){case 0:return"data"!==t.kind?[3,2]:(a={kind:"data"},[4,t.data.json()]);case 1:return a.data=i.sent(),e=a,[3,3];case 2:e=t,i.label=3;case 3:return[2,e]}}))}))})).catch((function(t){return{kind:"brokenJson",errorMessage:"ファイル ".concat(e," が壊れています。")}}))]}))}))):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[2,void 0];var e}))}))})).then((function(t){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return D._userVarNameListRequestError=t,void D._updateVarDumpInformationArea(D._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return D._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(S," が正しい形式で書かれていません。")},void D._updateVarDumpInformationArea(D._userVarNameListRequestError.errorMessage,!0);if(D._userVarNameList=D.convertUserVariableNameListToArray(t.data),null!==D._dumpElement)for(var e=function(){var t=a.toString(10);if(!D._userVarNameList[a])return"continue";var e=".var-index".concat(t),i=D._dumpElement.querySelector(e),s=i.querySelector("".concat(e," > div"));s.textContent=D._userVarNameList[a],i.setAttribute("data-labelled-var-index","true"),i.addEventListener("mouseover",(function(){return s.removeAttribute("aria-hidden")})),i.addEventListener("mouseleave",(function(){return s.setAttribute("aria-hidden","true")}))},a=0;a<q.USER_VAR_NUM;a++)e()}else D._updateVarDumpInformationArea(t.errorMessage,!1)}))}return a.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(q.USER_VAR_NUM),a=0;a<q.USER_VAR_NUM;a++)e[a]=void 0;return Object.keys(t).forEach((function(a){var i=parseInt(a,10);"string"!=typeof t[a]||"string"!=typeof a||isNaN(i)||i<0||i>=q.USER_VAR_NUM||(e[i]=t[a])})),e},a.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(pt("progress-message-container").textContent=t.stage===q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:rt[t.stage],pt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*q.MAP_WINDOW_WIDTH+"px",pt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?pt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":pt("progress-message-container").textContent="ゲームデータを読み込んでいます。",pt("progress-bar-audio").style.width=t.current*q.MAP_WINDOW_WIDTH/t.total+"px",pt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},a.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+q.LOADING_FONT,t.fillText(ot[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+q.LOADING_FONT,t.fillText("WWA Wing Ver.3.11.6",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=ot.length)t.font=et.LOADING+"px "+q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(ot[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<ot.length&&t.fillText(ot[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var a;a=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(ot.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,a):(t.clearRect(tt.LOADING_X,a-tt.LINE,q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,a))}},a.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,q.SCREEN_WIDTH,q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+q.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*a)})))},a.prototype.createSoundInstance=function(t){if(0!==t&&t!==H.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ue(t,e,this.audioContext,this.audioGain)}},a.prototype.loadSound=function(){var t=this;this.sounds=new Array(q.SOUND_MAX+1),this.createSoundInstance(H.DECISION),this.createSoundInstance(H.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][q.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][q.ATR_TYPE]!==q.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][q.ATR_SOUND];this.createSoundInstance(a)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var a=e.match(/^\$sound=(\d+)/);if(a&&!(a.length<2)){var i=parseInt(a[1],10);!isNaN(i)&&0<i&&i<H.NO_SOUND&&t.createSoundInstance(i)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},a.prototype.checkAllSoundLoaded=function(){var a=0,i=0;if(!this._hasTitleImg)var s=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var r=1;r<=q.SOUND_MAX;r++){var o=this.sounds[r];void 0===o||o.isError()||(i++,o.hasData()&&a++)}if(a<i&&!this._soundLoadSkipFlag)return this._setProgressBar(Ba(a,i,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Ba(q.SOUND_MAX,q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(s,j.FINISH),this.openGameWindow()},a.prototype._setSoundLoadedCheckTimer=function(t){var e=this,a=this.sounds[t];a.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?a.hasData()?(a.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},a.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},a.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=H.BGM_LB&&this._wwaData.bgm===t))if((t===H.NO_SOUND||t>=H.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].hasData()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==H.NO_SOUND)this.sounds[t].hasData()?t>=H.BGM_LB?(this.sounds[t].play(),this._wwaData.bgm=t):this.sounds[t].play():t>=H.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===H.NO_SOUND?this._wwaData.bgm=0:t>=H.BGM_LB&&(this._wwaData.bgm=t)},a.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();pt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=pt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var i=pe.getStartWWAData(a);this._restartData!==i&&(this._applyQuickLoad(i),this._wwaSave.resumeStart())}setTimeout((function(){pt("wwa-wrapper").removeChild(pt("wwa-cover")),t._main()}),q.SPLASH_SCREEN_DISP_MILLS)},a.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(pt("item"+(t-1)).classList.add("onpress"),this.playSound(H.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),a=this.getObjectAttributeById(e,q.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(a),!1,!1,e,v.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},a.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var i=pt(k[t]);if(this.playSound(H.DECISION),this._itemMenu.close(),i.classList.add("onpress"),t===b.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case M.CALL_BY_QUICK_LOAD:case M.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case M.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case M.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case M.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case M.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case M.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case M.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===b.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=M.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_QUICK_SAVE));else if(t===b.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_RESTART_GAME;else if(t===b.GOTO_WWA)if(a)this._bottomButtonType!==h.GOTO_WWA&&pt(k[b.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=M.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=M.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},a.prototype.onpasswordloadcalled=function(){this._usePassword?(pt(k[b.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},a.prototype.onpasswordsavecalled=function(){pt(k[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_PASSWORD_SAVE)},a.prototype.onpasssuspendsavecalled=function(){pt(k[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=M.CALL_BY_SUSPEND)},a.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(H.DECISION),this._itemMenu.openView()},a.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,a;if(e=t===R.UP?this._player.speedUp():this._player.speedDown(),a="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)a+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else a+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.generatePageAndReserveExecution(a,!1,!0)}else this.generatePageAndReserveExecution("ここでは移動速度を\n変更できません。",!1,!0)},a.prototype.isBattleSpeedIndexForQuickBattle=function(t){return q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},a.prototype._executeNode=function(t){var e;if(t instanceof Wt)return null===(e=t.macro)||void 0===e||e.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),xa([t],this._executeNode(t.next),!0);if(t instanceof Ut){var a=t.evaluateAndGetNextNode(this._generateTokenValues.bind(this));return a?this._executeNode(a):[]}return[]},a.prototype._executeNodes=function(t){try{return{isError:!1,messages:this._executeNode(t)}}catch(t){return{isError:!0}}},a.prototype._main=function(){var a,s=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var r=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return s.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return r&&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 n=this._pages.shift(),_=this._executeNodes(n.firstNode);if(!0===_.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var c=_.messages.filter((function(t){return!t.isEmpty()}));if(n.scoreOptions&&0===c.length&&c.push(new Wt("スコアを表示します。")),c.length>0){var h=c.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(h),this._messageWindow.setYesNoChoice(n.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),n.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),n.scoreOptions&&(this._lastScoreOptions=n.scoreOptions,this.updateScore(n.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=n.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow();break}}this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount();this._player.getPosition();var l=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(M.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===i.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[l])?this._checkTurnKeyPressed()?this._player.setDir(l):(this._player.controll(l),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.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(o.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(o.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(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(R.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(R.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(H.DECISION),this.onselectbutton(b.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(H.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZR)?this.onselectbutton(b.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZL)?this.onselectbutton(b.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_R)?this.onselectbutton(b.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(b.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(e.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_Y))&&this._displayHelp()),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();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(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(H.DECISION),this._yesNoDispCounter=q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.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(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var p=0;p<k.length;p++){(w=pt(k[p])).classList.contains("onpress")&&w.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(H.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var d=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),E=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),f=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(d===t.KEYDOWN||d===t.KEYPRESS_MESSAGECHANGE||E===t.KEYDOWN||E===t.KEYPRESS_MESSAGECHANGE||f===t.KEYDOWN||f===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===i.MOUSEDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(p=0;p<k.length;p++){var w;(w=pt(k[p])).classList.contains("onpress")&&w.classList.remove("onpress")}this._setNextPage()}}if(null===(a=this._inlineUserVarViewer)||void 0===a?void 0:a.isVisible){var y=!1;this._keyStore.getKeyState(e.KEY_DOWN)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,y=!0),this._keyStore.getKeyState(e.KEY_UP)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,y=!0),this._keyStore.getKeyState(e.KEY_RIGHT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._keyStore.getKeyState(e.KEY_LEFT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=q.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>q.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=q.USER_VAR_NUM),y&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(e.KEY_V)===t.KEYDOWN&&this._setNextPage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.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.isWatingEstimateWindow()||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!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.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*q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&pt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&pt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&pt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&pt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){s._loadType===L.QUICK_LOAD?(s._quickLoad(),s.wwaCustomEvent("wwa_quickload")):s._loadType===L.RESTART_GAME?(s._restartGame(),s.wwaCustomEvent("wwa_restert")):s._loadType===L.PASSWORD&&(s._applyQuickLoad(s._passwordSaveExtractData),s._passwordSaveExtractData=void 0,s.wwaCustomEvent("wwa_passwordload")),setTimeout(s.mainCaller,q.DEFAULT_FRAME_INTERVAL,s)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(p=0;p<q.USER_VAR_NUM;p++){var A=p.toString(10);this._dumpElement.querySelector(".var".concat(A)).textContent=this._wwaData.userVar[p]+""}},a.prototype.vibration=function(t){this._gamePadStore.vibration(t)},a.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),i=this._camera.getPosition().getOffsetCoord(),s=q.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,q.MAP_WINDOW_WIDTH,q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,q.MAP_WINDOW_WIDTH,q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var o=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();s=this._camera.getTransitionStepNum()*q.CHIP_SIZE}var _=!1;if(s!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=s,_=!0),a.x===this._cgManager.cpPartsLog.x&&a.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=a.x,this._cgManager.cpPartsLog.y=a.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,n,s,!0),this._drawPlayer(o,n,s,!0),this._drawObjects(o,n,s,!0),this._camera.isFinalStep()))var c=255,h=setInterval((function(){var t=pt("wwa-fader");if((c-=3*q.FADEOUT_SPEED)<=0)return clearInterval(h),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=c/255+""}),20);this._drawMap(a,i,s,!1,_),this._drawPlayer(a,i,s),this._drawObjects(a,i,s,!1,_),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,q.CHIP_SIZE*(t-a.x)-i.x,q.CHIP_SIZE*(e-a.y)-i.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},a.prototype._drawMap=function(t,e,a,i,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),void 0!==t){var r,o=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW);if(r=0,i)for(var h=o;h<=n;h++)for(var u=_;u<=c;u++){var l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][q.ATR_X]/q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][q.ATR_Y]/q.CHIP_SIZE,E=q.CHIP_SIZE*(h-t.x)-e.x,f=q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,f,a)}else{for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,s=!0),r++}if(s){this._cgManager.clearBackCanvasWithLowerYLimit(a);for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][q.ATR_X]/q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][q.ATR_Y]/q.CHIP_SIZE,E=q.CHIP_SIZE*(h-t.x)-e.x,f=q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},a.prototype._drawPlayer=function(t,e,a,i){if(void 0===i&&(i=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var s,r=this._player.getPosition().getPartsCoord(),o=this._player.getPosition().getOffsetCoord(),n=O[this._player.getDir()],_=(r.x-t.x)*q.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*q.CHIP_SIZE+o.y-e.y;Math.abs(o.x),Math.abs(o.y),this._player.getDir();s=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,i?this._cgManager.drawCanvasWithLowerYLimit(s,this._wwaData.playerImgPosY,_,c,a):this._cgManager.drawCanvasWithUpperYLimit(s,this._wwaData.playerImgPosY,_,c,a)}},a.prototype._drawObjects=function(t,e,a,i,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),void 0!==t){var r,o,n,_,c,h,u,l,p,d,E,w,y,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),v=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW),I=0,O=this._animationCounter>q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(i)for(d=A;d<=S;d++)for(E=v;E<=T;E++)D&&new f(d,E).equals(this._monster.position)||(w=this._wwaData.mapObject[E][d],r=new f(0,0),this._wwaData.objectAttribute[w][q.ATR_MOVE]!==x.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(r=p),c=q.CHIP_SIZE*(d-t.x)+r.x-e.x,h=q.CHIP_SIZE*(E-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,u=this._wwaData.objectAttribute[w][q.ATR_TYPE],l=this._wwaData.objectAttribute[w][q.ATR_NUMBER],0===w||this._checkNoDrawObject(new f(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,P,N,M,b,R=[],L=[];for(d=A;d<=S;d++)for(E=v;E<=T;E++)y=w=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[w][q.ATR_TYPE],l=this._wwaData.objectAttribute[w][q.ATR_NUMBER],this._checkNoDrawObject(new f(d,E),u,l)&&(y=0),P=this._wwaData.objectAttribute[w][q.ATR_MOVE]===x.STATIC,0!==y&&(N=!(!D||!new f(d,E).equals(this._monster.position)),P?L.push(new m(w,d,E,P,N)):(R.push(new m(w,d,E,P,N)),y=0),N&&(y=0)),this._cgManager.mapObjectCache[I]!==y&&(this._cgManager.mapObjectCache[I]=y,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(R,L)),b=R.length,M=0;M<b;M++)if(d=(C=R[M]).x,E=C.y,w=C.partsIDObj,P=C.isStatic,N=C.isFighting,c=q.CHIP_SIZE*(d-t.x)-e.x,h=q.CHIP_SIZE*(E-t.y)-e.y,P){if(N)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(c+=p.x,h+=p.y),o=O||0===this._wwaData.objectAttribute[w][q.ATR_X2]&&0===this._wwaData.objectAttribute[w][q.ATR_Y2],n=this._wwaData.objectAttribute[w][o?q.ATR_X:q.ATR_X2]/q.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?q.ATR_Y:q.ATR_Y2]/q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},a.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)}},a.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)},a.prototype._drawFrame=function(){this._cgManager.drawFrame()},a.prototype._checkNoDrawObject=function(t,e,a){var i=this._player.getPosition(),s=i.getPartsCoord();return!(!i.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===q.OBJECT_DOOR&&0===a||(e===q.OBJECT_STATUS||e===q.OBJECT_MESSAGE||e===q.OBJECT_ITEM||e===q.OBJECT_SELL||e===q.OBJECT_BUY||e===q.OBJECT_SELL||e===q.OBJECT_LOCALGATE))},a.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},a.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},a.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},a.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][q.ATR_TYPE]},a.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][q.ATR_TYPE]},a.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[i][e]},a.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,q.ATR_STRING)},a.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[i][e]},a.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},a.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},a.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][q.ATR_X]},a.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][q.ATR_Y]},a.prototype.getMessageById=function(t){return this._wwaData.message[t]},a.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},a.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],i=this._wwaData.mapAttribute[a][q.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(v.MAP)!==a)&&(i===q.MAP_STREET?r=this._execMapStreetEvent(t,a,i):i===q.MAP_WALL?r=this._execMapWallEvent(t,a,i):i===q.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,i):i===q.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,i)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.MAP,a),r)},a.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.mapObject[t.y][t.x],i=this._wwaData.objectAttribute[a][q.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(v.OBJECT)===a||(i===q.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,i):i===q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,i):i===q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,i):i===q.OBJECT_ITEM?this._execObjectItemEvent(t,a,i):i===q.OBJECT_DOOR?this._execObjectDoorEvent(t,a,i):i===q.OBJECT_STATUS?this._execObjectStatusEvent(t,a,i):i===q.OBJECT_BUY?this._execObjectBuyEvent(t,a,i):i===q.OBJECT_SELL?this._execObjectSellEvent(t,a,i):i===q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,i):i===q.OBJECT_SCORE?this._execObjectScoreEvent(t,a,i):i===q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,i):i===q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,i),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(v.OBJECT,a))},a.prototype._execMapStreetEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][q.ATR_ITEM];if(0!==i&&!this._player.hasItem(i))return!1;this.reserveAppearPartsInNextFrame(t,A.MAP,e);var s=this._wwaData.mapAttribute[e][q.ATR_STRING],r=this._wwaData.message[s],o=this._wwaData.mapAttribute[e][q.ATR_NUMBER];return this._waitFrame+=o*q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==o},a.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Yt(e.firstNode)}),!1)},a.prototype._execMapWallEvent=function(t,e,a){var i=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(i,q.ATR_TYPE);if(0===i||s===q.OBJECT_NORMAL||s===q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(i,q.ATR_ITEM))||this.getObjectAttributeById(s,q.ATR_MODE)===q.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,A.MAP,e);var r=this._wwaData.mapAttribute[e][q.ATR_STRING],o=this._wwaData.message[r];return this.generatePageAndReserveExecution(o,!1,!1,e,v.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),!1}return!1},a.prototype._execMapLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][q.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][q.ATR_JUMP_Y];return s>q.RELATIVE_COORD_LOWER&&(s=t.x+s-q.RELATIVE_COORD_BIAS),r>q.RELATIVE_COORD_LOWER&&(r=t.y+r-q.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,A.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new w(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][q.ATR_SOUND]),!0)},a.prototype._execMapUrlGateEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.generatePageAndReserveExecution(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=M.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0],!0):void(location.href=yt(this._wwaData.message[i].split(/\s/g)[0])))},a.prototype._execObjectNormalEvent=function(t,e,a){},a.prototype._execObjectMessageEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][q.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][q.ATR_NUMBER]*q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),this.playSound(o)},a.prototype._execObjectStatusEvent=function(t,e,a){var i=new E(this._wwaData.objectAttribute[e][q.ATR_ENERGY],this._wwaData.objectAttribute[e][q.ATR_STRENGTH],this._wwaData.objectAttribute[e][q.ATR_DEFENCE],this._wwaData.objectAttribute[e][q.ATR_GOLD]),s=this._wwaData.objectAttribute[e][q.ATR_STRING],r=this._wwaData.message[s],o=this._player.getStatusWithoutEquipments();if(i.strength>q.STATUS_MINUS_BORDER&&o.strength<i.strength-q.STATUS_MINUS_BORDER||i.defence>q.STATUS_MINUS_BORDER&&o.defence<i.defence-q.STATUS_MINUS_BORDER||i.gold>q.STATUS_MINUS_BORDER&&o.gold<i.gold-q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(v.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();i.energy=i.energy>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.energy:i.energy,i.strength=i.strength>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.strength:i.strength,i.defence=i.defence>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.defence:i.defence,i.gold=i.gold>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-i.gold:i.gold,this._player.addStatusAll(i),this.setStatusChangedEffect(i),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][q.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,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]))},a.prototype._execObjectMonsterEvent=function(t,e,a){var i=this,s=new f(this._wwaData.objectAttribute[e][q.ATR_X],this._wwaData.objectAttribute[e][q.ATR_Y]),r=new E(this._wwaData.objectAttribute[e][q.ATR_ENERGY],this._wwaData.objectAttribute[e][q.ATR_STRENGTH],this._wwaData.objectAttribute[e][q.ATR_DEFENCE],this._wwaData.objectAttribute[e][q.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][q.ATR_STRING]],n=this._wwaData.objectAttribute[e][q.ATR_ITEM];this._monster=new Ct(e,t,s,r,o,n,(function(){i._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},a.prototype._execObjectBuyEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectSellEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectItemEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i];try{var r=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-r.x)*q.CHIP_SIZE,n=(t.y-r.y)*q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(o,n),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*q.CHIP_SIZE,this._wwaData.imgItemboxY*q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(v.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][q.ATR_MODE]||(this.generatePageAndReserveExecution(s,!1,!1,e,v.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.generatePageAndReserveExecution(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectDoorEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_ITEM],s=this._wwaData.objectAttribute[e][q.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(i)&&(0===this._wwaData.objectAttribute[e][q.ATR_MODE]&&this._player.removeItemByPartsID(i),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,v.OBJECT,t.clone()),this.setPartsOnPosition(v.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},a.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING],s=this._wwaData.message[i],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=M.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype._execObjectLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord();t.x!==i.x||t.y!==i.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(v.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][q.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][q.ATR_JUMP_Y];s>q.RELATIVE_COORD_LOWER&&(s=i.x+s-q.RELATIVE_COORD_BIAS),r>q.RELATIVE_COORD_LOWER&&(r=i.y+r-q.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,A.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new w(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND]))},a.prototype._execObjectUrlGateEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.generatePageAndReserveExecution(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=M.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0]):location.href=yt(this._wwaData.message[i].split(/\s/g)[0]))},a.prototype._execObjectScoreEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][q.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[i],!1,!1,e,v.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][q.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][q.ATR_SOUND])},a.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var a=this._player.getStatus().calculateScore(e);this._scoreWindow.update(a)}},a.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD]))return"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._pages.push(new xt(new Wt(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY]),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),a=(t.x-e.x)*q.CHIP_SIZE,i=(t.y-e.y)*q.CHIP_SIZE,s=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM],r=this._wwaData.objectAttribute[s][q.ATR_NUMBER];try{this._player.addItem(s,r,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(a,i),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*q.CHIP_SIZE,this._wwaData.imgItemboxY*q.CHIP_SIZE)}:void 0)}catch(t){return"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._pages.push(new xt(new Wt(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM]),!0,!1,!0)),{}}}var o=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD]);return o.energy=o.energy>q.STATUS_MINUS_BORDER?q.STATUS_MINUS_BORDER-o.energy:o.energy,this.setStatusChangedEffect(o),this._player.addStatusAll(o),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:A.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},a.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===M.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.MAP_URLGATE&&(location.href=yt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===M.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._pages.push(new xt(new Wt(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM]),!0,!1,!0));else if(t===q.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===q.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===q.OBJECT_URLGATE&&(location.href=yt(this._yesNoURL));else this._yesNoChoiceCallInfo===M.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===M.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),pt(k[b.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.QUICK_LOAD)):this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(M.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===M.CALL_BY_RESTART_GAME?(pt(k[b.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=L.RESTART_GAME):this._yesNoChoiceCallInfo===M.CALL_BY_END_GAME?(window.history.back(-1),pt(k[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===M.CALL_BY_GOTO_WWA?(location.href=yt(q.WWA_HOME),pt(k[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_LOAD?(pt(k[b.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Qt.LOAD)):this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_SAVE?(pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(M.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Qt.SAVE)):this._yesNoChoiceCallInfo===M.CALL_BY_SUSPEND&&(pt(k[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(M.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===M.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][q.ATR_TYPE],q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===M.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][q.ATR_TYPE])===q.OBJECT_BUY||t===q.OBJECT_SELL||(t===q.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===M.CALL_BY_ITEM_USE){pt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===M.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case M.NONE:pt(k[b.QUICK_LOAD]).classList.remove("onpress");break;case M.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case M.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var a=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,a){case M.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case M.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===M.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());pt(k[b.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===M.CALL_BY_RESTART_GAME)pt(k[b.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_END_GAME)pt(k[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_GOTO_WWA)pt(k[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_LOAD)pt(k[b.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_PASSWORD_SAVE)pt(k[b.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===M.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();pt(k[b.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.NONE,this._messageWindow.setYesNoChoice(!1)}},a.prototype.generatePageAndReserveExecution=function(t,e,a,i,s,r,o){void 0===i&&(i=0),void 0===s&&(s=v.OBJECT),void 0===r&&(r=new f(0,0)),void 0===o&&(o=void 0);var n=this.generatePagesByRawMessage(t,i,s,r,a,e,o);this._pages=this._pages.concat(n),this._shouldSetNextPage=!0},a.prototype.generatePagesByRawMessage=function(t,e,a,i,s,r,o){var n=this,_=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(/\/\//)?gt(gt(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//");if(""===_)return o?[new xt(void 0,!0,!1,!1,o,{partsId:e,partsType:a})]:[];var c=_.split(/\<p\>/gi);return c.map((function(t,_){var h=void 0,u=void 0,l=void 0,p=n.parseMessageLines(t,e,a,i),d=[];return p.forEach((function(t,e){try{var a=0===e?void 0:p[e-1].type,i=d[d.length-1],s=n.createNewNode(t,!h||!Ft(a)),r=n.processConditionalExecuteMacroLine(s,t,i,d);r&&(l=r),a?n.connectOrMergeToPreviousNode(t,a,u,s,i,l):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new xt(h,_===c.length-1,0===_&&r,s,0===_&&o,{partsId:e,partsType:a})}))},a.prototype.parseMessageLines=function(t,e,a,i){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 o=function(t,e,a,i,s){var r=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==r&&3===r.length||null!==(r=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===r.length))throw new Error("マクロではありません");var o=r[1],n="$".concat(o.toLowerCase()),_="$if"===n&&s.match(/,/)?F.LEGACY_IF:K[n],c=r[2]?r[2]:"";return void 0===_?new kt(t,e,a,i,F.UNDEFINED,c.split(",")):new kt(t,e,a,i,_,c.split(",").map((function(t){return t.trim()})))}(s,e,a,i,r[1]);switch(o.macroType){case F.IF:case F.ELSE_IF:case F.ELSE:case F.END_IF:case F.SHOW_STR:return{type:o.macroType,text:t,macro:o};default:return{type:"normalMacro",text:t,macro:o}}})).filter(Boolean)},a.prototype.createNewNode=function(t,e){switch(t.type){case F.IF:return new Ut([{descriminant:Ma(t.macro.macroArgs[0])}]);case F.SHOW_STR:return e?new Wt(this._generateShowStrString(t.macro.macroArgs)):void 0;case"text":return e?new Wt(t.text):void 0;case"normalMacro":return e?new Wt("",[t.macro]):void 0;default:return}},a.prototype.processConditionalExecuteMacroLine=function(t,e,a,i){var s=0===i.length;switch(e.type){case F.IF:return void i.push(t);case F.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void a.appendBranch({descriminant:Ma(e.macro.macroArgs[0])});case F.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void a.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case F.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return i.pop()}},a.prototype.connectOrMergeToPreviousNode=function(t,e,a,i,s,r){var o=Ft(e);switch(e){case F.IF:case F.ELSE_IF:case F.ELSE:if(!i||!s)return;var n=s.getLastUnconnectedBranch();if(!n)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(n.next=i);case F.END_IF:if(!(i&&r instanceof Ut))return;for(var _=0;_<r.branches.length;_++){var c=r.branches[_].next;c?this.connectToFinalNode(c,i):r.branches[_]=i}return void(r.hasElseBranch()||r.branches.push({next:i,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(o&&a instanceof Wt))return;var h=!a.isEmpty();t.type===F.SHOW_STR?a.appendMessage(this._generateShowStrString(t.macro.macroArgs),h):"text"===t.type?a.appendMessage(t.text,h):"normalMacro"===t.type?a.macro.push(t.macro):a.next=i}},a.prototype.connectToFinalNode=function(t,e){for(var a=t;;)if(a instanceof Ut&&(a=a.branches[0].next),a instanceof Wt){if(!a.next)return void(a.next=e);a=a.next}},a.prototype.appearParts=function(t){var e,a,i,s,r,o,n=t.pos,_=t.triggerType,c=t.triggerPartsId,h=_===A.CHOICE_NO?q.APPERANCE_PARTS_MIN_INDEX_NO:q.APPERANCE_PARTS_MIN_INDEX,u=_===A.CHOICE_YES?q.APPERANCE_PARTS_MAX_INDEX_YES:q.APPERANCE_PARTS_MAX_INDEX;for(_===A.MAP?(c=0===c?this._wwaData.map[n.y][n.x]:c,e=v.MAP):(c=0===c?this._wwaData.mapObject[n.y][n.x]:c,e=v.OBJECT),o=h;o<=u;o++){var l=q.ATR_APPERANCE_BASE+o*q.REL_ATR_APPERANCE_UNIT_LENGTH,p=l+q.REL_ATR_APPERANCE_ID,d=l+q.REL_ATR_APPERANCE_X,E=l+q.REL_ATR_APPERANCE_Y,y=l+q.REL_ATR_APPERANCE_TYPE;if(a=e===v.MAP?this._wwaData.mapAttribute[c][p]:this._wwaData.objectAttribute[c][p],i=e===v.MAP?this._wwaData.mapAttribute[c][y]:this._wwaData.objectAttribute[c][y],s=e===v.MAP?this._wwaData.mapAttribute[c][d]:this._wwaData.objectAttribute[c][d],r=e===v.MAP?this._wwaData.mapAttribute[c][E]:this._wwaData.objectAttribute[c][E],s===q.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>q.RELATIVE_COORD_LOWER&&(s=n.x+s-q.RELATIVE_COORD_BIAS),r===q.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>q.RELATIVE_COORD_LOWER&&(r=n.y+r-q.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new w(this,s,r,0,0),i===v.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var m=new f(s,r);this.setPartsOnPosition(v.MAP,a,m)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");m=new f(s,r);this.setPartsOnPosition(v.OBJECT,a,m),this._replaceRandomObject(new f(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},a.prototype.reserveAppearPartsInNextFrame=function(t,e,a){void 0===a&&(a=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:a})},a.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},a.prototype.appearPartsByDirection=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=T[s],o=I[s];this.appearPartsEval(i,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},a.prototype.appearPartsEval=function(t,e,a,i,s){var r,o,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=n.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"===a||"p"===a)o=n.y;else if("+"===a[0])o=t.y+parseInt(a.substr(1));else if("-"===a[0])o=t.y-parseInt(a.substr(1));else if(o=parseInt(a),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");try{new w(this,r,o,0,0);if(s===v.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new f(r,o);this.setPartsOnPosition(v.MAP,i,_)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new f(r,o);this.setPartsOnPosition(v.OBJECT,i,_),this._replaceRandomObject(new f(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},a.prototype._replaceRandomObject=function(t){var e,a,i=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[i][q.ATR_TYPE]===q.OBJECT_RANDOM){for(var s=0;s<q.RANDOM_ITERATION_MAX;s++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[i][q.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][q.ATR_TYPE]!==q.OBJECT_RANDOM)break;i=e}this.setPartsOnPosition(v.OBJECT,e,t)}},a.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),a=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW),i=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=i;o<=s;o++)this._replaceRandomObject(new f(r,o))},a.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new f(t,e))},a.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=g.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=M.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._player.jumpTo(new w(this,t,e,0,0))},a.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},a.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},a.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(pt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(pt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(pt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(pt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},a.prototype.setPartsOnPosition=function(t,e,a){var i,s,r=a.y<<st.BITSHIFT|a.x;t===v.MAP?(i=this._wwaData.map[a.y][a.x],e=this.loadMapPartsID(e),i=this.loadMapPartsID(i),this._wwaData.map[a.y][a.x]=e,-1!==(s=this._mapIDTable[i].indexOf(r))&&this._mapIDTable[i].splice(s,1),-1===(s=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(i=this._wwaData.mapObject[a.y][a.x],e=this.loadMapPartsObjectID(e),i=this.loadMapPartsObjectID(i),this._wwaData.mapObject[a.y][a.x]=e,-1!==(s=this._mapObjectIDTable[i].indexOf(r))&&this._mapObjectIDTable[i].splice(s,1),-1===(s=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},a.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},a.prototype._compressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[];for(var i=0;i<t[a].length;){var s=this._countSamePartsLength(t[a],i);e[a].push([t[a][i],s]),i+=s}}return e},a.prototype._decompressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[],0;for(var i=0;i<t[a].length;i++)for(var s=t[a][i][1],r=0;r<s;r++)e[a].push(t[a][i][0])}return e},a.prototype._generateMapDataHash=function(t){var e="A",a=0,i=0,s=0;for(s=0;s<t.map.length;s++){for(i=0;i<t.map[s].length;)a=this._countSamePartsLength(t.map[s],i),e+=t.map[s][i]+"|"+a+"/",i+=a;for(i=0;i<t.mapObject[s].length;)a=this._countSamePartsLength(t.mapObject[s],i),e+=t.mapObject[s][i]+"|"+a+"/",i+=a}for(var r=0;r<t.mapAttribute.length;r++)for(var o=0;o<t.mapAttribute[r].length;o++)e+=t.mapAttribute[r][o]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return oe(e+="Z")},a.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),a=[];for(var i in t)"map"!==i&&"mapObject"!==i&&"mapCompressed"!==i&&"mapObjectCompressed"!==i&&"mapAttribute"!==i&&"objectAttribute"!==i&&"checkString"!==i&&a.push(i);a.sort();for(var s=0;s<a.length;s++)e+=mt(t[a[s]]);return oe(e)},a.prototype.compressSystem=function(){return pe},a.prototype._quickSave=function(t){var e,a,i=JSON.parse(JSON.stringify(this._wwaData)),s=this._player.getPosition().getPartsCoord(),r=this._player.getStatusWithoutEquipments();switch(i.itemBox=this._player.getCopyOfItemBox(),i.playerX=s.x,i.playerY=s.y,i.statusEnergyMax=this._player.getEnergyMax(),i.statusEnergy=r.energy,i.statusStrength=r.strength,i.statusDefence=r.defence,i.statusGold=r.gold,i.moves=this._player.getMoveCount(),i.frameCount=this._player.getFrameCount(),i.gameSpeedIndex=this._player.getSpeedIndex(),t){case M.CALL_BY_LOG_QUICK_SAVE:case M.CALL_BY_QUICK_SAVE:case M.CALL_BY_SUSPEND:break;case M.CALL_BY_PASSWORD_SAVE:i.checkOriginalMapString=this.checkOriginalMapString,i.checkString=this._generateSaveDataHash(i)}switch(i.message=void 0,i.mapAttribute=void 0,i.objectAttribute=void 0,t){case M.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,i),this.wwaCustomEvent("wwa_quicksave",{data:i}),"";case M.CALL_BY_PASSWORD_SAVE:var o=pe.compress(i);o.isCompress=1;var n=JSON.stringify(o);return this.wwaCustomEvent("wwa_passwordsave",{data:i,compress:o}),e=n,a=this._wwaData.worldPassNumber,console.warn(se.enc.Utf8.parse(e)),se.AES.encrypt(se.enc.Utf8.parse(e),re(a)).toString();case M.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:i,compress:pe.compress(i)});break;case M.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:i}),this._wwaSave.autoSave(this._cvs,i)}},a.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},a.prototype._decodePassword=function(t){var e,a,i,s="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,s=se.AES.decrypt(e,re(a)).toString(se.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,a){return se.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(se.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!s){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var o=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+o)}try{i=JSON.parse(s)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(i.isCompress){delete i.isCompress;var n=pe.decompress(i),_=n[0],c=n[1];return[Se(_),c]}return[i,{isWorldNameEmpty:!1}]},a.prototype._quickLoad=function(t,e,a){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===a&&(a=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var i,s=!1;if(null!==e){var r=this._decodePassword(e);i=r[0],s=r[1].isWorldNameEmpty}else i=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(i.message=JSON.parse(JSON.stringify(this._restartData.message)),i.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),i.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===i.map&&(i.map=this._decompressMap(i.mapCompressed)),void 0===i.mapObject&&(i.mapObject=this._decompressMap(i.mapObjectCompressed)),delete i.mapCompressed,delete i.mapObjectCompressed,null!==e){if(!s&&i.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(i.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var o=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&i.checkOriginalMapString!==o)throw console.error("Invalid hash","(password)=".concat(i.checkOriginalMapString," (current map)=").concat(o)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return a&&this._applyQuickLoad(i),i},a.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 w(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(H.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new f(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(V.ENERGY,new f(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(V.STRENGTH,new f(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(V.DEFENCE,new f(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(V.GOLD,new f(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new f(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new f(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},a.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 a=0;a<this._wwaData.mapWidth;a++){var i=a<<st.BITSHIFT|e;t=this._wwaData.map[a][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(i),t=this._wwaData.mapObject[a][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(i)}},a.prototype._restartGame=function(){this._quickLoad(!0)},a.prototype._fadeout=function(t){var e=0,a=q.MAP_WINDOW_WIDTH,i=q.FADEOUT_SPEED,s=pt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=i,(a-=2*i)<=0||2*e>q.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=q.MAP_WINDOW_WIDTH+"px",s.style.height=q.MAP_WINDOW_HEIGHT+"px",s.style.backgroundColor="#808080",clearInterval(r),void t();s.style.width=a+"px",s.style.height=a+"px",s.style.borderWidth=e+"px"}),20)},a.prototype.moveObjects=function(t){var e,a,i,s=this._camera.getPosition(),r=(this._player.getPosition(),s.getPartsCoord(),s.getPartsCoord().x),o=s.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),q.ATR_TYPE)!==q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),q.ATR_TYPE)!==q.OBJECT_LOCALGATE){for(e=new Array(q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(q.V_PARTS_NUM_IN_WINDOW+2),i=-1;i<=q.V_PARTS_NUM_IN_WINDOW;i++)for(e[i+1]=new Array(q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[i+1]=new Array(q.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=q.H_PARTS_NUM_IN_WINDOW;a++)if(o+i<0||o+i>=this._wwaData.mapWidth||r+a<0||r+a>=this._wwaData.mapWidth)e[i+1][a+1]=0,this.hoge[i+1][a+1]=0;else{try{var n=(_=new w(this,r+a,o+i,0,0)).getPartsCoord()}catch(t){e[i+1][a+1]=0,this.hoge[i+1][a+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[i+1][a+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[i+1][a+1]=-this._wwaData.mapObject[n.y][n.x]}for(a=-1;a<=q.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(i=-1;i<=q.V_PARTS_NUM_IN_WINDOW;i++)if(!(o+i<0||o+i>=this._wwaData.mapWidth)){try{var _;n=(_=new w(this,r+a,o+i,0,0)).getPartsCoord()}catch(t){continue}var c=this._wwaData.mapObject[n.y][n.x];if(0!==c&&this._wwaData.objectAttribute[c][q.ATR_MOVE]!==x.STATIC&&this._wwaData.objectAttribute[c][q.ATR_TYPE]!==q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][q.ATR_TYPE]!==q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.CHASE_PLAYER||this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.RUN_OUT||this._wwaData.objectAttribute[c][q.ATR_MOVE]===x.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][q.ATR_MOVE];if(h!==x.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,h),p=new f(l.x,n.y),d=new f(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,r,o,e,c);else{var y=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[c][q.ATR_TYPE]===q.OBJECT_MONSTER,e);y===B.MODE_X?this._setObjectsInNextFrame(n,p,r,o,e,c):y===B.MODE_Y?this._setObjectsInNextFrame(n,d,r,o,e,c):null===(E=this._getThirdCandidate(t,_,l,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,E,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},a.prototype._getCandidateCoord=function(t,e,a){var i=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=i.clone(),o=0,n=0;return a===x.CHASE_PLAYER?(o=i.x>s.x?-1:i.x<s.x?1:0,n=i.y>s.y?-1:i.y<s.y?1:0):a===x.RUN_OUT&&(o=i.x>s.x?1:i.x<s.x?-1:0,n=i.y>s.y?1:i.y<s.y?-1:0),r.x+=o,r.y+=n,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},a.prototype._getSecondCandidateMoveMode=function(t,e,a,i,s,r,o){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,i,o)?B.MODE_X:this._objectCanMoveTo(t,s,o)?B.MODE_Y:B.UNDECIDED:this._objectCanMoveTo(t,s,o)?B.MODE_Y:this._objectCanMoveTo(t,i,o)?B.MODE_X:B.UNDECIDED},a.prototype._getThirdCandidate=function(t,e,a,i,s){var r,o=i===x.CHASE_PLAYER?1:i===x.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new f(a.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(a.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r}if(n.y!==_.y){if(r=new f(_.x+1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x-1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x+1*o,_.y),this._objectCanMoveTo(t,r,s))return r;if(r=new f(_.x-1*o,_.y),this._objectCanMoveTo(t,r,s))return r}return null},a.prototype._getRandomMoveCoord=function(t,e,a){for(var i=e.getPartsCoord(),s=i.clone(),r=this._wwaData.isOldMove?q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:q.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=Math.floor(8*Math.random());if(s.x=i.x+T[n],s.y=i.y+I[n],this._objectCanMoveTo(t,s,a))return s}return i},a.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},a.prototype._objectCanMoveTo=function(t,e,a){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var i=this._wwaData.map[e.y][e.x],s=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[i][q.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===i&&!this.isOldMap()||r===q.MAP_WALL)return!1;var c=e.x-n+1,h=e.y-_+1;if(0<=c&&0<=h&&c<a.length&&h<a.length){if(0!==a[h][c])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},a.prototype._setObjectsInNextFrame=function(t,e,a,i,s,r){var o=e.x-a+1,n=e.y-i+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=o&&o<s.length&&0<=n&&n<s.length&&(s[t.y-i+1][t.x-a+1]=0,s[e.y-i+1][e.x-a+1]=r,this.hoge[e.y-i+1][e.x-a+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},a.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+q.H_PARTS_NUM_IN_WINDOW-1),i=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+q.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(H.DECISION);for(var o=e;o<=a;o++)for(var n=i;n<=s;n++){var _=this._wwaData.mapObject[n][o];this._wwaData.objectAttribute[_][q.ATR_TYPE]===q.OBJECT_MONSTER&&-1===r.indexOf(_)&&r.push(_)}return this._bottomButtonType===h.BATTLE_REPORT&&pt(k[b.GOTO_WWA]).classList.add("onpress"),0===r.length?(pt(k[b.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},a.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),pt(k[b.GOTO_WWA]).classList.remove("onpress")},a.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Qt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},a.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){this.setNowPlayTime();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<q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%q.USER_VAR_NUM,i=this._userVarNameList&&this._userVarNameList[a]?this._userVarNameList[a]:"名無し",s="変数 ".concat(a,": ").concat(i);t+="".concat(s,": ").concat(this._wwaData.userVar[a],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.generatePageAndReserveExecution(t,!1,!0)}},a.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case P.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.11.6\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.6\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.6\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case P.SP:case P.VR:return;case P.PC:t=" 【操作方法】\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  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.11.6\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.generatePageAndReserveExecution(t,!1,!0)}},a.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():this._shouldSetNextPage=!0,this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},a.prototype._hideMessageWindow=function(){var t=0;this._player.isReadyToUseItem()&&(t=this._player.useItem());var e=this.getObjectAttributeById(t,q.ATR_STRING);this.clearFaces(),0===e?(this._messageWindow.isVisible()&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.generatePageAndReserveExecution(this.getMessageById(e),!1,!1,t,v.OBJECT,this._player.getPosition().getPartsCoord())},a.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},a.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},a.prototype.replaceParts=function(t,e,a,i){void 0===a&&(a=v.OBJECT),void 0===i&&(i=!1);var s,r,o,n,_,c,h,u,l=this._camera.getPosition().getPartsCoord(),p=i?Math.max(0,l.x):0,d=i?Math.min(this._wwaData.mapWidth-1,l.x+q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=i?Math.max(0,l.y):0,f=i?Math.min(this._wwaData.mapWidth-1,l.y+q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(i=0!==p||d!==this._wwaData.mapWidth-1||0!==E||f!==this._wwaData.mapWidth-1,a===v.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(h=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],r=n.length,i)for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.mapObject[c][_]=e,u.push(s)):h.push(s);else{for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,this._wwaData.mapObject[c][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(h=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],r=n.length,i)for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.map[c][_]=e,u.push(s)):h.push(s);else{for(o=0;o<r;o++)_=(s=n[o])&st.BITMASK,c=s>>>st.BITSHIFT&st.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},a.prototype.getYesNoImgCoord=function(){return new f(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},a.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},a.prototype.getPlayerImgCoord=function(){return new f(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},a.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},a.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},a.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},a.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},a.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},a.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},a.prototype.isOldMap=function(){return this._wwaData.isOldMap},a.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},a.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},a.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},a.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},a.prototype.setPlayerStatus=function(t,e,a){if(t===G.ENERGY){if(this._player.setEnergy(e),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a}))return this.gameover(),{isGameOver:!0}}else if(t===G.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===G.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===G.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},a.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},a.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},a.prototype.setStatusIconCoord=function(t,e){var a=e.x*q.CHIP_SIZE,i=e.y*q.CHIP_SIZE,s=function(t){Et("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(i,"px")};switch(t){case V.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case V.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case V.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case V.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},a.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*q.CHIP_SIZE,a=t.y*q.CHIP_SIZE;return Array.prototype.forEach.call(ft("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},a.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},a.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},a.prototype.canInput=function(){return!this._temporaryInputDisable},a.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},a.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},a.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},a.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new f(0,0)))Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ft(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*q.CHIP_SIZE+"px -"+t.y*q.CHIP_SIZE+"px"}))}},a.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())},a.prototype.clearFaces=function(){this._faces=[]},a.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},a.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},a.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}},a.prototype.initCSSRule=function(){this._styleElm=pt(q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},a.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",a=this._isClassicModeEnable?1:.9,i="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(a,");\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[it.MESSAGE_WINDOW]=this._sheet.addRule(e,i),this._stylePos[it.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[it.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(i," }"),0),this._stylePos[it.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},a.prototype.changeStyleRule=function(t,e,a,i){t===at.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=i):t===at.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=i):t===at.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=i):t===at.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=i),this.updateCSSRule()},a.prototype.showMonsterWindow=function(){this._monsterWindow.show()},a.prototype.isClassicMode=function(){return this._isClassicModeEnable},a.prototype.isConsoleOutputMode=function(){return this._useConsole},a.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new w(this,t,e,0,0))},a.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},a.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,q.USER_VAR_NUM_MAX_VALUE),q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},a.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<q.USER_VAR_NUM&&(0|t)===t},a.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},a.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},a.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},a.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},a.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},a.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},a.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},a.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)}},a.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)}},a.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},a.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}):{}},a.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},a.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},a.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},a.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},a.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},a.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},a.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},a.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},a.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},a.prototype._generateShowStrString=function(t){var e=this;return t.map((function(t){var a=parseInt(t,10);return isNaN(a)?Da(t)?function(){return Na(t,e._generateTokenValues())}:t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[a]}}))},a.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},a.prototype.execSetMacro=function(t){void 0===t&&(t="");var e=function(t,e){var a=Pa(t),i=a.match(Ta);if(null!==i){var s=Na(i[2],e),r=Na(i[4],e);return Ca(Rt(i[3],s,r),i[1])}var o=a.match(Ia);if(null!==o)return s=Na(o[1],e),r=Na(o[3],e),Ca(Rt(o[2],s,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this._generateTokenValues()),a=e.assignee,i=e.rawValue;switch(a){case"energy":if(this._player.setEnergy(this.toValidStatusValue(i)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(i));break;case"strength":this._player.setStrength(this.toValidStatusValue(i));break;case"defence":this._player.setDefence(this.toValidStatusValue(i));break;case"gold":this._player.setGold(this.toValidStatusValue(i));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(i));break;default:if(isNaN(a)||!this.isValidUserVarIndex(a))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a,this.toAssignableValue(i))}return this._player.updateStatusValueBox(),{}},a.prototype._generateTokenValues=function(){return this.setNowPlayTime(),{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._wwaData.playTime,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord()}},a.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var a=parseInt(e[0],10),i=parseInt(e[2],10);if(!this.isValidUserVarIndex(a)||!this.isValidUserVarIndex(i))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var s=this._wwaData.userVar[a],r=e[1],o=this._wwaData.userVar[i],n=function(t){return parseInt(t,10)?v.MAP:v.OBJECT};if(this.compareUserVar(s,r,o)){var _=parseInt(e[3],10),c=e[4],h=e[5],u=n(e[6]);this.appearPartsEval(t,c,h,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},a.prototype.compareUserVar=function(t,e,a){switch(e){case"==":return t===a;case"!=":return t!==a;case">=":return t>=a;case">":return t>a;case"<=":return t<=a;case"<":return t<a;default:throw new Error("未定義の演算子です: ".concat(e))}},a.prototype.setPlayerSpeedIndex=function(t){if(t<q.MIN_SPEED_INDEX||q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},a.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},a.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},a.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},a.prototype.varMap=function(t,e,a,i,s){if(!this.isValidUserVarIndex(i))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[i];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,a,r,s)},a.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ft("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*q.CHIP_SIZE,"px -").concat(t.y*q.CHIP_SIZE,"px")}))},a.prototype._getVirtualPadButton=function(t){if(!nt.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},a.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},a.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},a.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,i;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(i=!1,e){case o.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)&&(i=!0);break;case o.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)&&(i=!0);break;case o.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)&&(i=!0);break;case o.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)&&(i=!0)}if(this._gamePadStore.buttonTrigger(e)&&(i=!0),i&&this.onselectitem(a))return!0}return!1},a.prototype.setGamePadButtonItemTable=function(t,e){var a,i;if(!this._wwaData.gamePadButtonItemTable)for(i in this._wwaData.gamePadButtonItemTable=[],o)a=i,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},a.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?Me.UNMATCHED_WORLD_NAME:a&&a!==Ne(this._wwaData.worldName,this._wwaData.worldPassNumber)?Me.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Me.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},a.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("存在しないステータスが与えられました")}},a.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("存在しないステータスが与えられました")}},a.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},a.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},a}(),Wa=!1;function Ya(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(ft("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Wa=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Wa)return Wa=!1,t.returnValue=e,e}));var t=pt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),a=null!==e&&null!==e.match(/^true$/i);ae(pt("wwa-wrapper"),t,a);var i=pt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=pt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=pt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),o=null,n="true"===pt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),_=pt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");pt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&n&&(o=function(t){var e=dt(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var a=document.createElement("table"),i=document.createElement("tr"),s=document.createElement("th"),r=document.createElement("button"),o=document.createElement("td");r.textContent="隠す",s.textContent="変数一覧",s.setAttribute("colspan","10"),s.classList.add("varlist-header"),s.appendChild(r),i.appendChild(s),o.setAttribute("colspan","10"),o.classList.add("varlist-information"),o.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",a.appendChild(i),a.appendChild(o);for(var n=null,_=null,c=0;c<q.USER_VAR_NUM;c++){c%10==0&&(null!==n&&(a.appendChild(n),a.appendChild(_)),(n=document.createElement("tr")).classList.add("var-number"),(_=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),u=document.createElement("div");u.textContent="-",u.setAttribute("aria-hidden","true"),h.classList.add("var-index".concat(c));var l=document.createElement("td");h.textContent=c+"",h.appendChild(u),l.classList.add("var".concat(c)),l.textContent="-",n.appendChild(h),_.appendChild(l)}q.USER_VAR_NUM%10!=0&&(a.appendChild(n),a.appendChild(_)),e.appendChild(a);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",o.style.display="none",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",o.style.display="",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(r));var c=!0;pt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(c=!1);var h=pt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),u=!1;null!==h&&h.match(/^true$/i)&&(u=!0);var l=!0,p=pt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,E=pt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==E&&E.match(/^true$/i)&&(d=!0);var f,w,y=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");ee()&&null!==y&&y.match(/^true$/i)&&(f=document.getElementsByTagName("head")[0],(w=document.createElement("meta")).setAttribute("name","viewport"),f.appendChild(w),ut(),window.addEventListener("resize",ut));var m,g=pt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),A=a&&g?Et(g):null,S=!(null===(m=pt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!m.match(/^true$/i));ba=new Ua(i,c,t,u,l,d,s,S,o,_,n,a,A)}}"complete"===document.readyState?setTimeout(Ya):window.addEventListener("load",(function(){setTimeout(Ya)}))}()}();