@wwawing/engine 3.12.8 → 3.12.9

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 +10 -10
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,v,A,S,T,I,O,D,C=this._hash.words,N=u.words,P=l.words,M=n.words,b=_.words,R=c.words,L=h.words;for(A=r=C[0],S=o=C[1],T=p=C[2],I=g=C[3],O=v=C[4],a=0;a<80;a+=1)D=r+t[e+M[a]]|0,D+=a<16?d(o,p,g)+N[0]:a<32?E(o,p,g)+N[1]:a<48?f(o,p,g)+N[2]:a<64?y(o,p,g)+N[3]:w(o,p,g)+N[4],D=(D=m(D|=0,R[a]))+v|0,r=v,v=g,g=m(p,10),p=o,o=D,D=A+t[e+b[a]]|0,D+=a<16?w(S,T,I)+P[0]:a<32?y(S,T,I)+P[1]:a<48?f(S,T,I)+P[2]:a<64?E(S,T,I)+P[3]:d(S,T,I)+P[4],D=(D=m(D|=0,L[a]))+O|0,A=O,O=I,I=m(T,10),T=S,S=D;D=C[1]+p+I|0,C[1]=C[2]+g+O|0,C[2]=C[3]+v+A|0,C[3]=C[4]+r+S|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 y(t,e,a){return t&a|e&~a}function w(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],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+y+c[p-16]}var w=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+w)|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 y=u[(l+4)%5],w=u[(l+1)%5],m=w.high,g=w.low;for(p=y.high^(m<<1|g>>>31),d=y.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var v=1;v<25;v++){var A=(C=a[v]).high,S=C.low,T=_[v];T<32?(p=A<<T|S>>>32-T,d=S<<T|A>>>32-T):(p=S<<T-32|A>>>64-T,d=A<<T-32|S>>>64-T);var I=u[c[v]];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[v=l+5*E],N=u[v],P=u[(l+1)%5+5*E],M=u[(l+2)%5+5*E];C.high=N.high^~P.high&M.high,C.low=N.low^~P.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,y=r.high,w=r.low,m=o.high,g=o.low,v=n.high,A=n.low,S=h.high,T=h.low,I=u.high,O=u.low,D=l.high,C=l.low,N=p,P=d,M=E,b=f,R=y,L=w,x=m,B=g,U=v,W=A,Y=S,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,$=Z.low,Q=(q>>>1|$<<31)^(q>>>8|$<<24)^q>>>7,z=($>>>1|q<<31)^($>>>8|q<<24)^($>>>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=Q+ot+((j=z+nt)>>>0<z>>>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=N&M^N&R^M&R,Et=P&b^P&L^b&L,ft=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),wt=(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],vt=gt.high,At=gt.low,St=V+wt+((ut=H+mt)>>>0<H>>>0?1:0),Tt=yt+Et;V=k,H=G,k=Y,G=F,Y=U,F=W,U=x+(St=(St=(St=St+lt+((ut+=pt)>>>0<pt>>>0?1:0))+vt+((ut+=At)>>>0<At>>>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=N,b=P,N=St+(ft+dt+(Tt>>>0<yt>>>0?1:0))+((P=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=i.low=d+P,i.high=p+N+(d>>>0<P>>>0?1:0),f=s.low=f+b,s.high=E+M+(f>>>0<b>>>0?1:0),w=r.low=w+L,r.high=y+R+(w>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),A=n.low=A+W,n.high=v+U+(A>>>0<W>>>0?1:0),T=h.low=T+F,h.high=S+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=function(){return t=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},t.apply(this,arguments)},e=Object.freeze({CONFIRM_LOAD_SOUND:{code:1,defaultText:"効果音・BGMデータをロードしますか?",mapdataParams:{messageArea:"systemMessage",index:2}},NO_MONEY:{code:101,defaultText:"所持金がたりない。",mapdataParams:{messageArea:"message",index:6}},NO_ITEM:{code:201,mapdataParams:{messageArea:"message",index:7},defaultText:"アイテムを持っていない。"},ITEM_BOX_FULL:{code:202,defaultText:"これ以上、アイテムを持てません。",mapdataParams:{messageArea:"systemMessage",index:1}},ITEM_SELECT_TUTORIAL:{code:203,defaultText:"このアイテムは%HOW_TO_USE_ITEM%ことで使用できます。\n使用できるアイテムは色枠で囲まれます。",mapdataParams:{messageArea:"systemMessage",index:0}},CONFIRM_USE_ITEM:{code:204,defaultText:"このアイテムを使用します。\nよろしいですか?",mapdataParams:{messageArea:"message",index:8}},CANNOT_DAMAGE_MONSTER:{code:301,defaultText:"相手の防御能力が高すぎる!"},CONFIRM_ENTER_URL_GATE:{code:401,defaultText:"他のページにリンクします。\nよろしいですか?",mapdataParams:{messageArea:"message",index:5}},GAME_SPEED_CHANGED:{code:501,defaultText:"移動速度を【%GAME_SPEED_NAME%】に切り替えました。\n%HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)\n速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。"},GAME_SPEED_CHANGE_DISABLED:{code:502,defaultText:"ここでは移動速度を\n変更できません。"}}),i=Object.keys(e),s=i.reduce((function(e,a){var i;return t(t({},e),((i={})[a]=a,i))}),{}),r=e;var o,n,_,c=(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),h=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}(),u=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 c(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}(h),l=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 p(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?_.RIGHT_UP:this.y===t.y?_.RIGHT:_.RIGHT_DOWN:this.x===t.x?this.y>t.y?_.UP:this.y===t.y?_.NO_DIRECTION:_.DOWN:this.y>t.y?_.LEFT_UP:this.y===t.y?_.LEFT:_.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),p=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 l(e,a),this._offsetCoord=new l(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/(G.H_PARTS_NUM_IN_WINDOW-1))*(G.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(G.V_PARTS_NUM_IN_WINDOW-1))*(G.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+g[e],a.y+v[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+g[e]*a,n=this._offsetCoord.y+v[e]*i;if(o<0){var _=Math.floor(Math.abs(o)/G.CHIP_SIZE);s-=_,o=(o+_*G.CHIP_SIZE)%G.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/G.CHIP_SIZE);r-=c,n=(n+c*G.CHIP_SIZE)%G.CHIP_SIZE}return o>=G.CHIP_SIZE&&(s+=Math.floor(o/G.CHIP_SIZE),o=(o+G.CHIP_SIZE)%G.CHIP_SIZE),n>=G.CHIP_SIZE&&(r+=Math.floor(n/G.CHIP_SIZE),n=(n+G.CHIP_SIZE)%G.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+G.H_PARTS_NUM_IN_WINDOW-r&&a.y<=s&&s<a.y+G.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===G.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===G.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),d=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},E=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"}(n||(n={})),function(t){t[t.UNUSED=0]="UNUSED",t[t.LEFT=4]="LEFT",t[t.RIGHT=6]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=8]="UP",t[t.LEFT_DOWN=1]="LEFT_DOWN",t[t.LEFT_UP=7]="LEFT_UP",t[t.RIGHT_DOWN=3]="RIGHT_DOWN",t[t.RIGHT_UP=9]="RIGHT_UP",t[t.NO_DIRECTION=5]="NO_DIRECTION"}(_||(_={}));var f,y,w,m,g=[0,-1,0,1,-1,0,1,-1,0,1],v=[0,1,1,1,0,0,0,-1,-1,-1];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(f||(f={})),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"}(y||(y={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(w||(w={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(m||(m={}));var A,S,T,I,O,D,C,N,P,M=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?A.XBOX:t.match(/windows/i)?A.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?A.IOS:A.MACINTOSH:t.match(/iphone|ipad|ipod/i)?A.IOS:t.match(/oculus/i)?A.OCULUS:t.match(/android/i)?A.ANDROID:t.match(/nintendo/i)?A.NINTENDO:t.match(/playstation/i)?A.PLAY_STATION:t.match(/linux/i)?A.LINUX:A.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?T.CHROME:t.match(/firefox/i)?T.FIREFOX:t.match(/safari/i)?T.SAFARI:T.OTHERS},t.prototype.getDevice=function(){switch(this.os){case A.WINDOWS:case A.MACINTOSH:case A.LINUX:return S.PC;case A.IOS:case A.ANDROID:return S.SP;case A.OCULUS:return S.VR;case A.NINTENDO:case A.PLAY_STATION:case A.XBOX:return S.GAME}return S.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"}(A||(A={})),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"}(S||(S={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(T||(T={})),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"}(I||(I={})),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"}(O||(O={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(D||(D={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(C||(C={})),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"}(N||(N={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(P||(P={}));var b,R=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MONEY=37]="SET_MONEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.MAP2=61]="MAP2",t[t.SHOW_STR2=62]="SHOW_STR2",t[t.CONSOLE_LOG2=63]="CONSOLE_LOG2",t[t.DELAYBGM=64]="DELAYBGM",t[t.SYSMSG=65]="SYSMSG",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(b||(b={}));var L,x,B,U={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$map2:61,$show_str2:62,$console_log2:63,$delaybgm:64,$sysmsg:65,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(L||(L={})),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"}(x||(x={})),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"}(B||(B={}));var W,Y=[1,2,5,8,10,20],F=["超低速","低速","準低速","中速","高速","超高速"],k=["energy","strength","defence","gold"],G=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=Y.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[Y.length-2,Y.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}(),V=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}(),H=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}(),K=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"}(W||(W={}));var j,X,J,Z,q,$,Q,z=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],tt=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(j||(j={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(X||(X={})),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"}(J||(J={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(Z||(Z={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(q||(q={})),function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}($||($={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_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"}(Q||(Q={}));var et,at,it=function(){function t(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),this._keyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(t.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1,this._keyState[e]=!1,this._prevKeyState[e]=!1,this._prevKeyStateOnControllable[e]=!1,this._keyInputContinueFrameNum[e]=0}return t.prototype.checkHitKey=function(t){var e=this.getKeyState(t);return e===$.KEYDOWN||e===$.KEYPRESS},t.prototype.getKeyState=function(t){return this._prevKeyState[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForControllPlayer=function(t){return this._prevKeyStateOnControllable[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForMessageCheck=function(t){return this._prevKeyState[t]?this._keyState[t]?this._keyInputContinueFrameNum[t]>=G.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?$.KEYPRESS_MESSAGECHANGE:$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},t.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},t.prototype.update=function(){var e;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),e=0;e<t.KEY_BUFFER_MAX;e++)this._keyState[e]&&this._keyInputContinueFrameNum[e]++},t.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},t.prototype.allClear=function(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1},t.KEY_BUFFER_MAX=256,t}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(et||(et={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(at||(at={}));var st,rt,ot=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())===et.MOUSEDOWN||e===et.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?et.NONE:this._prevMouseState?this._mouseState?et.MOUSEPRESS:et.MOUSEUP:this._mouseState?et.MOUSEDOWN:et.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?et.NONE:this._prevMouseStateOnControllable?this._mouseState?et.MOUSEPRESS:et.MOUSEUP:this._mouseState?et.MOUSEDOWN:et.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===at.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"}(st||(st={})),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"}(rt||(rt={}));var nt=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 st.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[rt.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[rt.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_UP))return!0;break;case st.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[rt.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[rt.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_DOWN))return!0;break;case st.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[rt.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[rt.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_LEFT))return!0;break;case st.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[rt.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[rt.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.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}(),_t=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ct=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ht=new Set(ct),ut=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;ct.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 ht.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 lt(){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 pt,dt=function(t){return document.getElementById(t)},Et=function(t){return document.getElementsByTagName(t)},ft=function(t){return document.querySelector(t)},yt=function(t){return document.querySelector(t)},wt=function(t){return document.querySelectorAll(t)},mt=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-dt("wwa-wrapper").offsetLeft+s,i=e-dt("wwa-wrapper").offsetTop+r,new l(a,i)},gt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},vt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=vt(t[a])+"/";return e}return t+""},At=function(t){return t.split("").reverse().join("")},St=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,G.CHIP_SIZE*e,G.CHIP_SIZE*a,G.CHIP_SIZE,G.CHIP_SIZE,i,s,G.CHIP_SIZE,G.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}(),Tt=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 St(G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new St(G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new St(G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=i,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new l(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,G.MAP_WINDOW_WIDTH-G.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,G.MAP_WINDOW_HEIGHT-G.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,G.MAP_WINDOW_WIDTH-G.CHIP_SIZE,G.MAP_WINDOW_HEIGHT-G.CHIP_SIZE);for(var t=1;t<G.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,G.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,G.CHIP_SIZE*t,G.MAP_WINDOW_HEIGHT-G.CHIP_SIZE);for(t=1;t<G.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,G.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,G.MAP_WINDOW_WIDTH-G.CHIP_SIZE,G.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 St(G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<G.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<G.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,s.x,s.y,o*G.CHIP_SIZE,r*G.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-1),G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE,0,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-1),G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,G.CHIP_SIZE,G.CHIP_SIZE,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-2),0,G.CHIP_SIZE,G.CHIP_SIZE,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-1),G.CHIP_SIZE,G.CHIP_SIZE,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-2),G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-1),G.CHIP_SIZE,G.CHIP_SIZE,G.CHIP_SIZE*(G.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.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,G.CHIP_SIZE*t,G.CHIP_SIZE*e,G.CHIP_SIZE,G.CHIP_SIZE,a,i,G.CHIP_SIZE,G.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,G.CHIP_SIZE*t,G.CHIP_SIZE*e,G.CHIP_SIZE*a,G.CHIP_SIZE*i,s,r,G.CHIP_SIZE*a,G.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+G.CHIP_SIZE-s);r>=G.CHIP_SIZE||this._ctx.drawImage(this._image,G.CHIP_SIZE*t,G.CHIP_SIZE*e,G.CHIP_SIZE,G.CHIP_SIZE-r,a,i,G.CHIP_SIZE,G.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));_>=G.CHIP_SIZE||t.ctx.drawImage(a._image,G.CHIP_SIZE*i,G.CHIP_SIZE*s+_,G.CHIP_SIZE,G.CHIP_SIZE-_,r,o+_,G.CHIP_SIZE,G.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+G.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+G.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,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.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,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.H_PARTS_NUM_IN_WINDOW,0,0,G.CHIP_SIZE*G.V_PARTS_NUM_IN_WINDOW,G.CHIP_SIZE*G.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>=G.CHIP_SIZE||this._ctx.drawImage(this._image,G.CHIP_SIZE*t,G.CHIP_SIZE*e+r,G.CHIP_SIZE,G.CHIP_SIZE-r,a,i+r,G.CHIP_SIZE,G.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}(),It=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=Y[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(G.H_PARTS_NUM_IN_WINDOW-1),e*(G.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===G.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===G.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}(),Ot=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)}}(),Dt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),Ct=function(t){function e(e){return t.call(this,e)||this}return Ot(e,t),e}(Dt);!function(t){function e(e){return t.call(this,e)||this}Ot(e,t)}(Dt);!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"}(pt||(pt={}));var Nt=function(t){function e(e,a,i,s,r,o,n){var c=t.call(this,a)||this;c.itemTransitioningClassName="item-transitioning",c.overwittenItemClassName="item-overwritten",c.overwittenItemSelector=".".concat(c.overwittenItemClassName),c.itemEffectStartTimers=new Array(G.ITEMBOX_SIZE),c._status=s,c._equipStatus=new h(0,0),c._itemBox=new Array(G.ITEMBOX_SIZE),c._itemBoxElement=new Array(G.ITEMBOX_SIZE),c._itemUsingEvent=new Array(G.ITEMBOX_SIZE);for(var u=0;u<c._itemBox.length;u++)c._itemBox[u]=0,c._itemBoxElement[u]=yt("#item"+u+">.item-disp");return c.updateItemBox(),c._energyMax=r,c._dir=_.DOWN,c._isMovingImage=!1,c._wwa=e,c._state=pt.CONTROLLABLE,c._camera=i,c._isPartsEventExecuted=!1,c._energyValueElement=yt("#disp-energy>.status-value-box"),c._strengthValueElement=yt("#disp-strength>.status-value-box"),c._defenceValueElement=yt("#disp-defence>.status-value-box"),c._goldValueElement=yt("#disp-gold>.status-value-box"),c._isReadyToUseItem=!1,c._isClickableItemGot=!1,c._moves=o,c._frameCount=0,c._moveMacroWaitingRemainMoves=0,c._moveObjectAutoExecTimer=0,c.updateStatusValueBox(),c._partsAppeared=!1,c._afterMoveMacroFlag=!1,c._isPreparedForLookingAround=!0,c._lookingAroundTimer=G.PLAYER_LOOKING_AROUND_START_FRAME,c._speedIndex=n,c._messageDelayFrameCount=0,c}return Ot(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===pt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=pt.CONTROLLABLE)}else if(this._state===pt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,Y[this._speedIndex],Y[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=pt.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,Y[this._speedIndex],Y[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=pt.CAMERA_MOVING}catch(t){this._state=pt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===G.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=pt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),G.ATR_TYPE)!==G.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)!==G.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===G.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,G.ATR_MODE)===G.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===G.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,G.ATR_NUMBER)===G.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,G.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==pt.MOVING||this._state==pt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==G.H_PARTS_NUM_IN_WINDOW-1&&this._dir===_.RIGHT||e.x===t.x&&this._dir===_.LEFT||e.y-t.y==G.V_PARTS_NUM_IN_WINDOW-1&&this._dir===_.DOWN||e.y===t.y&&this._dir===_.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==G.H_PARTS_NUM_IN_WINDOW-1&&this._dir===_.LEFT||e.x===t.x&&this._dir===_.RIGHT||e.y-t.y==G.V_PARTS_NUM_IN_WINDOW-1&&this._dir===_.UP||e.y===t.y&&this._dir===_.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===pt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==G.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==G.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===pt.LOCALGATE_JUMPED||this._state===pt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=pt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===pt.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!==pt.MESSAGE_WAITING&&this._state!==pt.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===pt.MESSAGE_WAITING?this._state=pt.CONTROLLABLE:this._state===pt.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=pt.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=G.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=pt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===pt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===pt.ESTIMATE_WINDOW_WAITING&&(this._state=pt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=pt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===pt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===pt.PASSWORD_WINDOW_WAITING&&(this._state=pt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===m.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===m.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==pt.LOCALGATE_JUMPED&&this._state!==pt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===pt.LOCALGATE_JUMPED?pt.CONTROLLABLE:pt.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===pt.MESSAGE_WAITING?pt.LOCALGATE_JUMPED_WITH_MESSAGE:pt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=G.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=_.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(_.DOWN).hasLocalGate()?this._dir=_.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(_.UP).hasLocalGate()?this._dir=_.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(_.RIGHT).hasLocalGate()?this._dir=_.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(_.LEFT).hasLocalGate()?this._dir=_.RIGHT:this._dir=_.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=G.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=pt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=G.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=_.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=G.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 h(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new h(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=ft("#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=-_*G.DEFAULT_FRAME_INTERVAL/G.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)}),G.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,G.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((s=this._getBlankItemPos())===G.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,G.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,G.ATR_NUMBER)){if((r=this._getBlankItemPos())===G.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 l(G.MAP_WINDOW_WIDTH+(s-1)%3*G.CHIP_SIZE,G.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*G.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,i=yt("#item"+(t-1)+">.item-click-border"),r=this._wwa.getObjectAttributeById(e,G.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&r!==w.NORMAL){var o=this._wwa.resolveSystemMessage(s.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||("BLANK"!==o&&this._wwa.generatePageAndReserveExecution(o,!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 G.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new h(0,0);for(t=0;t<G.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],G.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],G.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<G.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,G.ATR_MODE)!==w.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,G.ATR_MODE)!==w.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=dt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),G.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==G.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],G.ATR_MODE)!==w.NORMAL&&((e=yt("#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<G.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],G.ATR_MODE)!==w.NORMAL&&((e=yt("#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<=G.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=G.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=pt.BATTLE},e.prototype.isFighting=function(){return this._state===pt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===G.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===G.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>G.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(B.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=G.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(B.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,G.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new u(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(m.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(m.OBJECT,0,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,y.OBJECT,this._enemy.partsID),this._state=pt.CONTROLLABLE,this._wwa.generatePageAndReserveExecution(this._enemy.message,!1,!1,this._enemy.partsID,m.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess();var a=this._wwa.resolveSystemMessage(s.CANNOT_DAMAGE_MONSTER);"BLANK"!==a&&this._wwa.generatePageAndReserveExecution(a,!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=pt.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,G.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),y.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)*G.CHIP_SIZE+e.x-s.x+G.CHIP_SIZE/2,o=(t.y-i.y)*G.CHIP_SIZE+e.y-s.y+G.CHIP_SIZE/2;return new l(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=G.CHIP_SIZE/Y[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(G.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(G.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<G.MIN_SPEED_INDEX||G.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(Ct),Pt=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}(),Mt=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,Y[t],Y[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}(),bt=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 Mt(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(m.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(m.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 Rt(t,e,a){if(void 0===a&&(a=0),"boolean"==typeof t)return t;var i=Lt(t.left,e,a),s=Lt(t.right,e,a);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,i,s)}function Lt(t,e,a){switch(void 0===a&&(a=0),t.type){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return e.userVars[t.index];case"MAP":return t.y<0||t.y>=e.map.length||t.x<0||t.x>=e.map[t.y].length?0:e.map[t.y][t.x];case"OBJECT":return t.y<0||t.y>=e.mapObject.length||t.x<0||t.x>=e.mapObject[t.y].length?0:e.mapObject[t.y][t.x];case"ITEM":return t.boxIndex1To12<1||t.boxIndex1To12>12?0:e.itemBox[t.boxIndex1To12-1];case"ITEM_COUNT_ALL":return e.itemBox.filter((function(t){return 0!==t})).length;case"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"X":return e.partsPosition.x;case"Y":return e.partsPosition.y;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"PDIR":return e.playerDirection;case"ID":return e.partsId;case"TYPE":return e.partsType;case"RAND":return Math.floor(Math.random()*Lt(t.argument,e));case"ITEM_COUNT":return e.itemBox.filter((function(a){return a===Lt(t.argument,e)})).length;default:return a}}function xt(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 Bt="-?\\d+",Ut="v\\[".concat(Bt,"\\]"),Wt="v\\[(".concat(Bt,")\\]"),Yt="m\\[".concat(Bt,"\\]\\[").concat(Bt,"\\]"),Ft="m\\[(".concat(Bt,")\\]\\[(").concat(Bt,")\\]"),kt="o\\[".concat(Bt,"\\]\\[").concat(Bt,"\\]"),Gt="o\\[(".concat(Bt,")\\]\\[(").concat(Bt,")\\]"),Vt="ITEM\\[".concat(Bt,"\\]"),Ht="ITEM\\[(".concat(Bt,")\\]"),Kt="".concat(Ut,"|").concat(Yt,"|").concat(kt,"|").concat(Vt),jt="HP|HPMAX|AT|DF|GD|STEP|PDIR",Xt="".concat(Kt,"|").concat(Yt,"|").concat(kt,"|").concat(Vt,"|").concat(jt),Jt="".concat(Bt,"|").concat(Kt,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|X|Y|PX|PY|ID|TYPE|ITEM_COUNT_ALL","|").concat(jt),Zt="RAND\\((?:".concat(Jt,")\\)"),qt="RAND\\((".concat(Jt,")\\)"),$t="ITEM_COUNT\\((?:".concat(Jt,")\\)"),Qt="ITEM_COUNT\\((".concat(Jt,")\\)"),zt="".concat(Zt,"|").concat($t),te="".concat(Jt,"|").concat(zt),ee="\\+|\\-|\\*|\\/|%",ae="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ie="^\\(",se="\\)$",re=new RegExp("^".concat(Bt,"$")),oe=new RegExp("^".concat(Wt,"$")),ne=new RegExp("^".concat(Ft,"$")),_e=new RegExp("^".concat(Gt,"$")),ce=new RegExp("^".concat(Ht,"$")),he=new RegExp("^".concat(qt,"$")),ue=new RegExp("".concat(Qt,"$")),le=new RegExp("".concat(ie,"(").concat(Xt,")").concat("=","(").concat(te,")(").concat(ee,")(").concat(te,")").concat(se)),pe=new RegExp("".concat(ie,"(").concat(Xt,")(").concat(ae,")(").concat(te,")").concat(se)),de=new RegExp("^(".concat(te,")(?:(").concat(ee,")(").concat(te,"))?$")),Ee=new RegExp("".concat(ie,"(").concat(te,")(").concat(">|<|<=|>=|==|!=",")(").concat(te,")").concat(se));function fe(t){return"RAND"!==t.type&&"ITEM_COUNT"!==t.type}function ye(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"X":case"Y":case"PX":case"PY":case"PDIR":case"ID":case"TYPE":case"ITEM_COUNT_ALL":return{type:t};default:var e=t.match(oe);if(e)return null===(r=we(e))?null:{type:"VARIABLE",index:r};var a=t.match(ne);if(a)return null===(i=me(a))?null:{type:"MAP",x:i[0],y:i[1]};var i,s=t.match(_e);if(s)return null===(i=me(s))?null:{type:"OBJECT",x:i[0],y:i[1]};var r,o=t.match(ce);if(o)return null===(r=we(o))?null:{type:"ITEM",boxIndex1To12:r};if(t.match(re)){var n=parseInt(t,10);return null===n||isNaN(n)?null:{type:"NUMBER",rawValue:n}}var _=t.match(he);if(_)return null!==(c=_.length>=2?ye(_[1]):null)&&fe(c)?{type:"RAND",argument:c}:null;var c,h=t.match(ue);return h&&(null!==(c=h.length>=2?ye(h[1]):null)&&fe(c))?{type:"ITEM_COUNT",argument:c}:null}}function we(t){var e=t.length>=2?Number(t[1]):null;return null===e||isNaN(e)?null:e}function me(t){if(t.length<3)return null;var e=Number(t[1]),a=Number(t[2]);return isNaN(e)||isNaN(a)?null:[e,a]}function ge(t,e){var a;switch(null===(a=ye(e))||void 0===a?void 0:a.type){case"VARIABLE":var i=e.match(/^v\[(\d+)\]$/),s=Number(i[1]);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:"variable",index:s,rawValue:t};case"MAP":var r=e.match(/^m\[(\d+)\]\[(\d+)\]$/),o=Number(r[1]),n=Number(r[2]);if(null===o||null===n||isNaN(o)||isNaN(n))throw new Error("背景パーツの添字のパースに失敗しました");return{assignee:"map",x:o,y:n,rawValue:t};case"OBJECT":var _=e.match(/^o\[(\d+)\]\[(\d+)\]$/);o=Number(_[1]),n=Number(_[2]);if(null===o||null===n||isNaN(o)||isNaN(n))throw new Error("物体パーツの添字のパースに失敗しました");return{assignee:"mapObject",x:o,y:n,rawValue:t};case"ITEM":var c=e.match(/^ITEM\[(\d+)\]$/),h=Number(c[1]);if(null===h||isNaN(h))throw new Error("アイテムの添字のパースに失敗しました");return{assignee:"item",boxIndex1to12:h,rawValue:t};case"ITEM_COUNT_ALL":case"ITEM_COUNT":throw new Error("左辺値に所持アイテム数は入れられません");case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":return{assignee:"moveCount",rawValue:t};case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"X":throw new Error("左辺値にパーツX座標は入れられません");case"Y":throw new Error("左辺値にパーツY座標は入れられません");case"ID":throw new Error("左辺値にパーツ番号座標は入れられません");case"TYPE":throw new Error("左辺値にパーツ種別は入れられません");case"PDIR":return{assignee:"playerDirection",rawValue:t};case"RAND":throw new Error("左辺値に乱数は入れられません");default:throw new Error("この文字列から代入操作オブジェクトは生成できません")}}function ve(t){return t.replace(/\s/g,"")}function Ae(t,e,a){return void 0===a&&(a=0),Lt(ye(t),e,a)}function Se(t,e,a){void 0===a&&(a=0);var i=ve(t).match(de);if(null!==i){var s=Ae(i[1],e,a),r=i[3]?Ae(i[3],e,a):void 0,o=i[2];return o&&r?xt(o,s,r):s}throw new Error("マクロ引数のフォーマットを満たしていません: "+t)}function Te(t){var e=ve(t).match(Ee);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var a=ye(e[1]),i=ye(e[3]);if(a&&i)return{left:a,right:i,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var 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,e,a,i,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=a,this.isSystemMessage=i,this.scoreOptions=s,this.extraInfo=r},De=function(){},Ce=function(t){function e(e){void 0===e&&(e=[]);var a=t.call(this)||this;return a.branches=e,a}return Ie(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||Rt(i.descriminant,t()))return i.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(De),Ne=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 Ie(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}(De);function Pe(t){return void 0===t||(t instanceof Ce?t.branches.reduce((function(t,e){return t&&Pe(e.next)}),!0):t instanceof Ne?t.isEmpty()&&Pe(t.next):void 0)}var Me=function(t){return t===b.SHOW_STR||t===b.SHOW_STR2||"text"===t||"normalMacro"===t},be=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[b.IF,b.ELSE_IF,b.ELSE,b.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case b.IMGPLAYER:return this._executeImgPlayerMacro(),{};case b.IMGYESNO:return this._executeImgYesNoMacro(),{};case b.HPMAX:return this._executeHPMaxMacro(),{};case b.SAVE:return this._executeSaveMacro(),{};case b.ITEM:return this._executeItemMacro(),{};case b.DEFAULT:return this._executeDefaultMacro(),{};case b.OLDMAP:return this._executeOldMapMacro(),{};case b.PARTS:return this._executePartsMacro(),{};case b.MOVE:return this._executeMoveMacro(),{};case b.MAP:return this._executeMapMacro(1),{};case b.DIRMAP:return this._executeDirMapMacro(),{};case b.IMGFRAME:return this._executeImgFrameMacro(),{};case b.IMGBOM:return this._executeImgBomMacro(),{};case b.DELPLAYER:return this._executeDelPlayerMacro(),{};case b.FACE:return this._executeFaceMacro(),{};case b.EFFECT:return this._executeEffectMacro(),{};case b.GAMEOVER:return this._executeGameOverMacro(),{};case b.IMGCLICK:return this._executeImgClickMacro(),{};case b.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case b.EFFITEM:return this._executeEffItemMacro(),{};case b.COLOR:return this._executeColorMacro(),{};case b.WAIT:return this._executeWaitMacro(),{};case b.SOUND:return this._executeSoundMacro(),{};case b.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case b.OLDMOVE:return this._executeOldMoveMacro(),{};case b.JUMPGATE:return this._executeJumpGateMacro(),{};case b.RECPOSITION:return this._executeRecPositionMacro(),{};case b.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case b.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case b.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case b.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case b.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case b.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case b.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case b.SET_AT:return this._executeSetAtMacro(),{};case b.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case b.SET_DF:return this._executeSetDfMacro(),{};case b.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case b.SET_MONEY:return this._executeSetMoneyMacro(),{};case b.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case b.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case b.VAR_SET:return this._executeVarSetMacro(),{};case b.VAR_ADD:return this._executeVarAddMacro(),{};case b.VAR_SUB:return this._executeVarSubMacro(),{};case b.VAR_MUL:return this._executeVarMulMacro(),{};case b.VAR_DIV:return this._executeVarDivMacro(),{};case b.VAR_MOD:return this._executeVarModMacro(),{};case b.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case b.GAME_SPEED:return this._executeGameSpeedMacro(),{};case b.SHOW_STR:case b.SHOW_STR2:case b.IF:return{};case b.LEGACY_IF:return this._executeLegacyIfMacro(),{};case b.ELSE_IF:case b.ELSE:case b.END_IF:return{};case b.SET_SPEED:return this._executeSetSpeedMacro(),{};case b.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case b.HIDE_STATUS:return this._executeHideStatusMacro(),{};case b.VAR_MAP:return this._executeVarMapMacro(),{};case b.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case b.SET:return{isGameOver:this._executeSetMacro().isGameOver};case b.MAP2:return this._executeMapMacro(2),{};case b.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case b.DELAYBGM:return this._executeDelayBgmMacro(),{};case b.SYSMSG:return this._executeSysMsgMacro(),{};default:return console.log("不明なマクロIDが実行されました:"+this.macroType),{}}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._evaluateIntValue=function(t,e){void 0===e&&(e=0);var a=this.macroArgs[t];if(""===a)return e;var i=Number(a),s=i>=0?Math.floor(i):Math.ceil(i);return isNaN(s)?Se(a,this._wwa.generateTokenValues({id:this._triggerPartsID,type:this._triggerPartsType,position:this._triggerPartsPosition}),e):s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(t){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);switch(t){case 1:return void this._wwa.outputUserVar(e);case 2:return void console.log("".concat(this.macroArgs[0]," = ").concat(e))}},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(t)},t.prototype._executeLegacyIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=0!==this._evaluateIntValue(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._evaluateIntValue(3,m.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._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new l(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new l(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,m.OBJECT),i=this._evaluateIntValue(3);if(a!==m.OBJECT&&a!==m.MAP)throw new Error("パーツ種別が不明です");if(0!==i&&1!==i&&(i=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===m.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._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(t){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),a=this._evaluateIntValue(3,m.OBJECT);if(e<0)throw new Error("パーツ番号が不正です");if(a===m.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");if(1===t){var i=this.macroArgs[1],s=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerPartsPosition,i,s,e,a)}else if(2===t){var r=this._evaluateIntValue(1),o=this._evaluateIntValue(2);if(isNaN(r)||isNaN(o))throw new Error("出現先座標が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,"".concat(r),"".concat(o),e,a)}},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,m.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===m.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._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===x.ENERGY||t===x.STRENGTH||t===x.DEFENCE||t===x.GOLD)this._wwa.setStatusIconCoord(t,new l(e,a));else if(t===x.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new l(e,a));else if(t===x.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==x.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new l(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new l(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._evaluateIntValue(0),a=this._evaluateIntValue(1),i=this._evaluateIntValue(2),s=this._evaluateIntValue(3),r=this._evaluateIntValue(4),o=this._evaluateIntValue(5);if(e<0||a<0||i<0||s<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new d(new l(e,a),new l(i,s),new l(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var i,s=this._evaluateIntValue(a);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((i=this._evaluateIntValue(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new l(s,i))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new l(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new l(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");return this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2),i=this._evaluateIntValue(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(2);var t=parseInt(this.macroArgs[0]),e=parseInt(this.macroArgs[1]);this._wwa.playSound(t,e)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>G.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:{position:this._triggerPartsPosition,id:this._triggerPartsID,type:this._triggerPartsType}})},t.prototype._executeDelayBgmMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setBgmDelay(t)},t.prototype._executeSysMsgMacro=function(){this._concatEmptyArgs(2);var t=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!t)throw new Error("該当するシステムメッセージの定義がありません");var e=""===this.macroArgs[1]?void 0:this.macroArgs[1].replaceAll("\\n","\n");this._wwa.overwriteSystemMessage(t,e)},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return function(t){return i.some((function(e){return e===t}))}(t)?t:function(t){for(var e=0,a=i;e<a.length;e++){var s=a[e];if(r[s].code===t)return s}}(this._evaluateIntValue(0))},t}();var Re,Le=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}(),xe=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,e,new l(a.x,a.y),i,s,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=G.CHIP_SIZE+"px",_._monsterBox.style.height=G.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 Ie(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}(Le),Be=function(t){function e(e,a,i,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new l(2*G.CHIP_SIZE,30),7*G.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 l(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 Ie(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}(Le);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Re||(Re={}));var Ue=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(f.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(f.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case S.SP:case S.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?Re.BOTTOM:e?Re.SCORE:a?Re.CENTER:o>=Math.ceil(G.V_PARTS_NUM_IN_WINDOW/2)?Re.TOP:Re.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Re.CENTER?(this._y=G.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Re.TOP?(this._y=Math.max(20,G.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Re.BOTTOM?(this._y=Math.min(G.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*G.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Re.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*G.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()===f.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_YESP_X)*G.CHIP_SIZE+"px -"+e.y*G.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_NO_X)*G.CHIP_SIZE+"px -"+e.y*G.CHIP_SIZE+"px"):this._wwa.getYesNoState()===f.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_YES_X)*G.CHIP_SIZE+"px -"+e.y*G.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_NOP_X)*G.CHIP_SIZE+"px -"+e.y*G.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_YES_X)*G.CHIP_SIZE+"px -"+e.y*G.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+G.IMGRELPOS_YESNO_NO_X)*G.CHIP_SIZE+"px -"+e.y*G.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=V.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=G.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case _.DOWN:this._save_select_id-=2,this.cursor_wait();break;case _.UP:this._save_select_id+=2,this.cursor_wait();break;case _.LEFT:this._save_select_id--,this.cursor_wait();break;case _.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+V.QUICK_SAVE_MAX)%V.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),We=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}(),Ye=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<G.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)i=new We(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<G.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var i=this._wwa.getObjectAttributeById(e[a],G.ATR_X),s=this._wwa.getObjectAttributeById(e[a],G.ATR_Y),r=new l(i,s),o=this._wwa.getObjectAttributeById(e[a],G.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],G.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],G.ATR_DEFENCE),c=new u(o,n,_,0),h=ke(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}(),Fe=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function ke(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 Fe(!0,!1,0);for(;;){if(r++,(a-=i)<=0)return new Fe(!1,!1,o);if(o+=s,r>1e4)return new Fe(!1,!0,0)}}var Ge,Ve=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())}))},He=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Ge||(Ge={}));var Ke=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 Ve(i,void 0,void 0,(function(){var t=this;return He(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=Ge.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===Ge.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===Ge.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 je(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function Xe(t,e,a){var i=document.createElement("style");i.type="text/css",i.setAttribute("id",G.WWA_STYLE_TAG_ID),Et("head")[0].appendChild(i),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(G.SCREEN_WIDTH,'" height="').concat(G.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&&(dt("wwa-cover").style.backgroundImage="url(".concat(e,")"),dt("wwa-cover").style.backgroundRepeat="no-repeat",dt("wwa-cover").style.backgroundPosition="0 0")}var Je=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=G.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 _.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case _.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case _.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case _.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=yt(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=dt(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&i.classList.remove("onpress")},t.prototype.openView=function(){this.close();dt(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Ze=a(23);function qe(t){return"^ /".concat(231*t+8310,"P+>A[]")}function $e(t){return(0,Ze.MD5)(t).toString()}var Qe="map",ze="mapObject",ta="systemMessage",ea="userVar",aa={mapAttribute:!0,objectAttribute:!0,message:!0},ia=function(){},sa=function(){function t(){}return t.compress=function(t){var e,a,i={};for(e in t)if(!aa[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 Qe:case ze:var n,_,c,h,u,l,p,d,E,f,y,w,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===(y=E[p])[u]&&(y[u]=[]),(m=y[u]).push(Number(h)));for(w in E)for(u in y=E[w],void 0===d[w]&&(d[w]={}),f=d[w],void 0===i[w]&&(i[w]=[]),_=-1,y)1===(m=y[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,i[w].push(this.getCompressArray(m),c));for(w in d)for(h in p=Number(w),_=-1,f=d[w])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?i[w].push(c,g[0]):i[w].push(c,this.getCompressArray(g));var v=[];for(w in _=-1,i)c=(n=Number(w))-_-1,_=n,v.push(c,i[w]);return this._usingByteFlag&&JSON.stringify(v).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):v;case ta:var A;for(t in i={},e)A=e[t],a[t]!==A&&(i[t]=A);break;case ea: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,y,w,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),v=-1;for(r=0,o=0,_=0,c=0,y=0,p=[],f={},u=[],l=[],s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(-1===v&&(v=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new ra(h,y++)),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(w=g.length,v=-1,_=0,o=0;o<w;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===v&&(v=o),_=o);-1===v&&(v=0,_=0)}return[v,g.subarray(v,_+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 Qe:case ze: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 y;for(y in r=-1,l)if(r=s=r+Number(l[y].y)+1,E=l[y].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(y in r=-1,p)if(r=s=r+Number(p[y].x)+1,f=p[y].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 ea: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(G.USER_VAR_NUM),e=0;e<G.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(y=E.length,u=0;u<y;u++)E[u]=E[u]|a[u];r=[];var y,w,m,g,v,A,S=o.length;for(y=s.length,w=0,m=0;w<y;w++){if((n=s[w])>=S)for(g=n-S,v=0;v<g;v++)r[m++]=A;else r[m++]=n;A=n}for(h=0,u=0,l=0,_=0,y=E.length,u=0;u<y;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[ze]=this.getChangedUint8Array(e[ze],t[ze])},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 ia,t}(),ra=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},oa=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=V.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=V.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){dt("cell-load").textContent=H.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}(),na=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)}}(),_a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return na(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}(oa),ca=_a,ha=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)}}(),ua=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return ha(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<V.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<V.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),la=function(){return la=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},la.apply(this,arguments)},pa=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?la(la({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?la(la({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},da=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)}}(),Ea=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<V.QUICK_SAVE_MAX;o++)r[o]=new ca(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=i,r.createDataBase(),r.selectSaveData(),r}return da(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(V.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(V.INDEXEDDB_TABLE_NAME)||i.createObjectStore(V.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(V.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(V.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,i){return{url:location.href,id:t,hash:Ta.checkOriginalMapString,image:e.toDataURL(),data:a,date:i,worldName:Ta.worldName,mapDataRevisionKey:Ta.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),_=sa.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 _=pa(sa.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}(ua),fa=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)}}(),ya=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fa(e,t),e}(oa),wa=ya,ma=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)}}(),ga=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=V.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var i=0;i<V.QUICK_SAVE_MAX;i++)a[i]=new wa(i,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return ma(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%V.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ua);function va(t,e){return(0,Ze.MD5)(t+e).toString()}var Aa,Sa=function(){function t(e,a,i,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=va(a,i),this._wwaDBSaveList=new Ea(s,r),this._wwaLogSaveList=new ga,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?I.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?I.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?I.CALL_BY_LOG_QUICK_LOAD:I.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?I.CALL_BY_LOG_QUICK_LOAD:t?I.CALL_BY_PASSWORD_LOAD:I.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?dt("cell-save").textContent=H.EMPTY_SAVE:dt("cell-save").textContent=H.QUICK_SAVE},t}(),Ta=Sa;!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"}(Aa||(Aa={}));var Ia,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())}))},Da=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Ca=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.delayBgmTimeoutId=null,this.load()}return t.prototype.fetchSoundFile=function(){return Oa(this,void 0,void 0,(function(){return Da(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 Oa(this,void 0,void 0,(function(){return Da(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),Oa(this,void 0,void 0,(function(){var e,a,i=this;return Da(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;window.setTimeout((function(){return Oa(e,void 0,void 0,(function(){return Da(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(t){var e=this;void 0===t&&(t=0);var a=this.audioContext.createBufferSource();this.bufferSources.push(a),a.buffer=this.audioBuffer,this.isBgm()&&(a.loop=!0),a.connect(this.audioGain);var i=a.duration;(!isFinite(i)||i<0||"number"!=typeof i)&&(i=0),a.onended=function(){var t=e.bufferSources.indexOf(a);-1!==t&&e.bufferSources.splice(t,1),e.disposeBufferSource(a)},this.delayBgmTimeoutId=window.setTimeout((function(){e.delayBgmTimeoutId=null,a.start()}),t),this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){null!==this.delayBgmTimeoutId&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=B.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isPlaying=function(){return this.hasData()||null!==this.delayBgmTimeoutId},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),Na=function(t,e){for(var a=new Array(t),i=0;i<a.length;i++)a[i]=new Array(e);return a},Pa=function(t){return(t%=256)>=128?t-256:t};function Ma(t,e){var a=function(t){return t[Ia.CHECK]+256*t[Ia.CHECK+1]}(t),i=function(t,e){var a=0;if(t[Ia.VERSION]>=29){for(var i=2;i<e;i++)a+=Pa(t[i])*(i%8+1);a=a%65536&65535}return a}(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"}(Ia||(Ia={}));var ba,Ra,La=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"}(ba||(ba={})),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"}(Ra||(Ra={}));var xa=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Ma(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default",bgmDelayDurationMs:void 0,customSystemMessages:{}}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Ia.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Ia.MAPDATA_TOP:this.currentPosition=Ia.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(ba.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(ba.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?La.MAP_ATR_MAX:La.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?La.OBJ_ATR_MAX:La.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(ba.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(ba.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(ba.MAP),this._convertAttributeV2toV3(ba.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,i;if(t==ba.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,i=La.MAP_LOCALGATE;else{if(t!=ba.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,i=La.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][La.ATR_TYPE]===i&&(a[s][La.ATR_JUMP_X]>100&&(a[s][La.ATR_JUMP_X]+=9840),a[s][La.ATR_JUMP_Y]>100&&(a[s][La.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(Ia.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Ia.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Ia.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Ia.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Ia.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Ia.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Ia.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Ia.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Ia.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Ia.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Ia.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Ia.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Ia.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Ia.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Ia.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Ia.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Ia.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Ia.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Ia.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?Ia.ITEMBOX_TOP:Ia.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(La.ITEMBOX_SIZE);for(var e=0;e<La.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,i,s;for(s=Na(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===ba.MAP?Ra.MAP_LOAD:Ra.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===ba.MAP?Ra.MAP_LOAD:Ra.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,a){var i,s,r;for(r=Na(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===ba.MAP?Ra.MAP_ATTR:Ra.OBJ_ATTR),s!==La.ATR_CROP1&&s!==La.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===ba.MAP?Ra.MAP_ATTR:Ra.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,Ra.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var Ba,Ua=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:Ra.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:Ra.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(La.SYSTEM_MESSAGE_NUM);for(e=0;e<La.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=La.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=La.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=La.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=La.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=La.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=La.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=La.DEFAULT_DISABLE_SAVE,t.isOldMap=La.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=La.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=La.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=La.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=La.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=La.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=La.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=La.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=La.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=La.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=La.DEFAULT_FRAME_COLOR_R,t.frameColorG=La.DEFAULT_FRAME_COLOR_G,t.frameColorB=La.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=La.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=La.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=La.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=La.DEFAULT_STR_COLOR_R,t.fontColorG=La.DEFAULT_STR_COLOR_G,t.fontColorB=La.DEFAULT_STR_COLOR_B,t.statusColorR=La.DEFAULT_STATUS_COLOR_R,t.statusColorG=La.DEFAULT_STATUS_COLOR_G,t.statusColorB=La.DEFAULT_STATUS_COLOR_B,t.moves=La.DEFAULT_MOVES,t.gameSpeedIndex=La.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(La.USER_VAR_NUM);for(e=0;e<La.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t.bgmDelayDurationMs=0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Wa=function(){},Ya=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)}}(),Fa=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())}))},ka=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Ga=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return Ya(e,t),e.fetch=function(t){return Fa(this,void 0,void 0,(function(){return ka(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 Fa(this,void 0,void 0,(function(){var t;return ka(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}(Wa),Va=a(106),Ha=a.n(Va),Ka=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)}}(),ja=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())}))},Xa=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Ja=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return Ka(e,t),e.prototype.request=function(){return ja(this,void 0,void 0,(function(){var t=this;return Xa(this,(function(e){return[2,new Promise((function(e,a){Ha().readFile(t.fileName,(function(t,i){t&&a(t),e(i.buffer)}))}))]}))}))},e}(Wa),Za=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())}))},qa=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},$a=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return Za(this,void 0,void 0,(function(){var t,e,a,i,s,r;return qa(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new Ga(n):new Ja(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 xa(i,s,this.eventEmitter).extractAllData();return new Ua(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),Qa=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}(),za=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())}))},ti=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},ei=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())}))},ai=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},ii=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 si(t,e,a){var i=new K;return i.current=t,i.total=e,i.stage=a,i}var ri=function(){function t(t,e,a,i,r,o,c,h,d,E,y,w,m){void 0===e&&(e=!1),void 0===c&&(c=""),void 0===h&&(h=!1),void 0===d&&(d=null),void 0===w&&(w=!1),void 0===m&&(m=null);var g,v=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return v._main()},this.soundCheckCaller=function(){return v.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return v._keyStore.checkHitKey(Q.KEY_ESC)||v._keyStore.checkHitKey(Q.KEY_SHIFT)||v._keyStore.checkHitKey(Q.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new Qa(dt("wwa-wrapper")),window.addEventListener("click",(function(t){v._isActive=!1})),dt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),v._isActive=!0})),this._isActive=!0,null===a?(this._hasTitleImg=!1,this._cvsCover=dt("progress-panel"),(g=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?dt("version").textContent="WWA Wing Ver.3.12.8":this._setLoadingMessage(g,0)}catch(t){}this._dumpElement=d;var D=window.AudioContext||window.webkitAudioContext;D&&(this.audioContext=new D,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var C=new Audio;"no"!==C.canPlayType("audio/mpeg")&&""!==C.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new M,this._isURLGateEnable=e,this._isClassicModeEnable=i,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new u(0,0,0,0),c?"/"!==c[c.length-1]&&(c+="/"):c="./audio/",this._audioDirectory=c,this._bottomButtonType=o?n.GOTO_WWA:n.BATTLE_REPORT;var N=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===S.GAME){if(this.userDevice.os===A.NINTENDO)G.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=n.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===T.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case S.VR:case S.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(dt("cell-save").textContent=H.QUICK_SAVE,this._usePassword?dt("cell-load").textContent=H.PASSWORD:dt("cell-load").textContent=H.EMPTY_LOAD,this._bottomButtonType){case n.GOTO_WWA:dt("cell-gotowwa").textContent=H.GOTO_WWA;break;case n.BATTLE_REPORT:dt("cell-gotowwa").textContent=H.BATTLE_REPORT;break;case n.GAME_END:dt("cell-gotowwa").textContent=H.GAME_END}this._loadHandler=function(t){v._wwaData=t,v._wwaData.isItemEffectEnabled=r;try{v._hasTitleImg?dt("version").textContent+=" (Map data Ver. "+Math.floor(v._wwaData.version/10)+"."+ +v._wwaData.version%10+")":v._setLoadingMessage(g,1)}catch(t){}var e=dt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");e.pop(),e.push(v._wwaData.mapCGName),v._wwaData.mapCGName=e.join("/"),v._startTime=(new Date).getTime(),v._restartData=JSON.parse(JSON.stringify(v._wwaData)),v.checkOriginalMapString=v._generateMapDataHash(v._restartData),v.initCSSRule(),v._setProgressBar(si(0,4,W.GAME_INIT)),v._setLoadingMessage(g,2);var a=new Image;a.src=v._wwaData.mapCGName,a.addEventListener("error",(function(){v._setErrorMessage("画像ファイル「"+v._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",g)}));var i=v._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),o=function(t){t.style.backgroundImage="url("+i+")"};Array.prototype.forEach.call(wt("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(v._wwaData.imgItemboxX*G.CHIP_SIZE,"px -").concat(v._wwaData.imgItemboxY*G.CHIP_SIZE,"px"),t.style.backgroundImage="url("+i+")"})),Array.prototype.forEach.call(wt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+i+")"})),Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+G.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(wt(".item-cell>.item-disp"),o),Array.prototype.forEach.call(wt("div.wide-cell-row>.status-icon"),o),v.setStatusIconCoord(x.ENERGY,new l(v._wwaData.imgStatusEnergyX,v._wwaData.imgStatusEnergyY)),v.setStatusIconCoord(x.STRENGTH,new l(v._wwaData.imgStatusStrengthX,v._wwaData.imgStatusStrengthY)),v.setStatusIconCoord(x.DEFENCE,new l(v._wwaData.imgStatusDefenceX,v._wwaData.imgStatusDefenceY)),v.setStatusIconCoord(x.GOLD,new l(v._wwaData.imgStatusGoldX,v._wwaData.imgStatusGoldY)),v._setProgressBar(si(1,4,W.GAME_INIT)),v._setLoadingMessage(g,3),v._mapIDTableCreate(),v._replaceAllRandomObjects();var n=(new Date).getTime();console.log("Loading Complete!"+(n-N)+"ms"),v._cvs=dt("wwa-map");var c=v._cvs.getContext("2d",{alpha:!1});c.fillStyle="rgba( 255, 255, 255, 0.5)",c.fillRect(0,0,440,440);var d=new p(v,v._wwaData.playerX,v._wwaData.playerY);v._camera=new It(d),v._itemMenu=new Je;var E=new u(v._wwaData.statusEnergy,v._wwaData.statusStrength,v._wwaData.statusDefence,v._wwaData.statusGold);v._player=new Nt(v,d,v._camera,E,v._wwaData.statusEnergyMax,v._wwaData.moves,v._wwaData.gameSpeedIndex),v._objectMovingDataManager=new bt(v,v._player),v._camera.setPlayer(v._player),v._keyStore=new it,v._mouseStore=new ot,w?(v._virtualPadButtonElements={BUTTON_ENTER:dt("wwa-enter-button"),BUTTON_ESC:dt("wwa-esc-button"),BUTTON_FAST:dt("wwa-fast-button"),BUTTON_SLOW:dt("wwa-slow-button"),BUTTON_LEFT:dt("wwa-left-button"),BUTTON_UP:dt("wwa-up-button"),BUTTON_RIGHT:dt("wwa-right-button"),BUTTON_DOWN:dt("wwa-down-button")},v._virtualPadStore=new ut(v._virtualPadButtonElements,je(),dt("wwa-virtualpad-right"),dt("wwa-virtualpad-left"),v._setVirtualPadTouch.bind(v),v._setVirtualPadLeave.bind(v)),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)}(m,(function(){v._virtualPadStore.toggleVisible()}))):(v._virtualPadButtonElements=null,v._virtualPadStore=new ut({})),v._gamePadStore=new nt,v._pages=[],v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._yesNoChoiceCallInfo=I.NONE,v._prevFrameEventExected=!1,v._isLastPage=!1,v._reservedPartsAppearances=[],v._reservedJumpDestination=void 0,v._shouldSetNextPage=!1,v._passwordLoadExecInNextFrame=!1,v._messageWindow=new Ue(v,50,180,340,0,v._wwaData.mapCGName,!1,!0,!1,dt("wwa-wrapper")),v._scoreWindow=new Be(v,new l(50,50),!1,dt("wwa-wrapper")),v._wwaSave=new Ta(Ba,Ba._wwaData.worldName,Ba._wwaData.worldPassNumber,v._checkSaveDataCompatibility.bind(v),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Aa.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Aa.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Aa.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),v._isDisallowLoadOldSave=h,v._messageWindow.setWWASave(v._wwaSave),sa.setRestartData(v._restartData,v._wwaData),v.clearFaces();var T=dt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof T&&(v._useSuspend=!0,T)){var D=sa.getStartWWAData(T);v._restartData!==D&&(v._applyQuickLoad(D),v._wwaSave.resumeStart())}var C=dt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==C&&v._wwaSave.setAutoSaveInterval(0|Number(C));var P=dt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(v._useLookingAround=!(P&&P.match(/false/i)),v._setProgressBar(si(2,4,W.GAME_INIT)),v._setLoadingMessage(g,4),window.addEventListener("keydown",(function(t){if(v._isActive){if(v.userDevice.os===A.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setPressInfo(t.keyCode),t.keyCode!==Q.KEY_F5?v._player.isWaitingMessage()?t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_SPACE||t.preventDefault():v._player.isWaitingPasswordWindow()||t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_1&&t.keyCode!==Q.KEY_2&&t.keyCode!==Q.KEY_3&&t.keyCode!==Q.KEY_A&&t.keyCode!==Q.KEY_C&&t.keyCode!==Q.KEY_D&&t.keyCode!==Q.KEY_E&&t.keyCode!==Q.KEY_M&&t.keyCode!==Q.KEY_N&&t.keyCode!==Q.KEY_Q&&t.keyCode!==Q.KEY_S&&t.keyCode!==Q.KEY_W&&t.keyCode!==Q.KEY_X&&t.keyCode!==Q.KEY_Y&&t.keyCode!==Q.KEY_Z&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_F1&&t.keyCode!==Q.KEY_F2&&t.keyCode!==Q.KEY_F3&&t.keyCode!==Q.KEY_F4&&t.keyCode!==Q.KEY_F6&&t.keyCode!==Q.KEY_F7&&t.keyCode!==Q.KEY_F8&&t.keyCode!==Q.KEY_F12&&t.keyCode!==Q.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(v._isActive){if(v.userDevice.os===A.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setReleaseInfo(t.keyCode),t.keyCode===Q.KEY_F5?t.preventDefault():t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_1&&t.keyCode!==Q.KEY_2&&t.keyCode!==Q.KEY_3&&t.keyCode!==Q.KEY_A&&t.keyCode!==Q.KEY_C&&t.keyCode!==Q.KEY_D&&t.keyCode!==Q.KEY_E&&t.keyCode!==Q.KEY_M&&t.keyCode!==Q.KEY_N&&t.keyCode!==Q.KEY_Q&&t.keyCode!==Q.KEY_S&&t.keyCode!==Q.KEY_W&&t.keyCode!==Q.KEY_X&&t.keyCode!==Q.KEY_Y&&t.keyCode!==Q.KEY_Z&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_F1&&t.keyCode!==Q.KEY_F3&&t.keyCode!==Q.KEY_F4&&t.keyCode!==Q.KEY_F6&&t.keyCode!==Q.KEY_F7&&t.keyCode!==Q.KEY_F8&&t.keyCode!==Q.KEY_F9&&t.keyCode!==Q.KEY_F12&&t.keyCode!==Q.KEY_SPACE||v._player.isWaitingMessage()||v._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){v._isActive&&t.preventDefault()})),v._mouseControllerElement=dt("wwa-controller"),v._mouseControllerElement.addEventListener("mousedown",(function(t){if(v._isActive&&1===t.which){if(v._mouseStore.getMouseState()!==et.NONE)return void t.preventDefault();var e=mt(t.clientX,t.clientY),a=v._player.getDrawingCenterPosition(),i=e.substract(a),s=Math.abs(i.x),r=Math.abs(i.y),o=void 0,n=!1;if(s<G.CHIP_SIZE&&r<G.CHIP_SIZE){switch(a.x/G.CHIP_SIZE|0){case 0:n=!0,o=_.LEFT;break;case G.H_PARTS_NUM_IN_WINDOW-1:n=!0,o=_.RIGHT}switch(a.y/G.CHIP_SIZE|0){case 0:n=!0,o=_.UP;break;case G.V_PARTS_NUM_IN_WINDOW-1:n=!0,o=_.DOWN}}n||(i.y>0&&r>s?o=_.DOWN:i.y<0&&r>s?o=_.UP:i.x>0&&r<s?o=_.RIGHT:i.x<0&&r<s&&(o=_.LEFT)),v._mouseStore.setPressInfo(o,0)}})),v._mouseControllerElement.addEventListener("mouseleave",(function(t){v._mouseStore.clear()})),v._mouseControllerElement.addEventListener("mouseup",(function(t){v._isActive&&1===t.which&&(v._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(v.audioContext){var M=function(){v.audioContext.createBufferSource().start(0),v._mouseControllerElement.removeEventListener("touchstart",M),M=null};v._mouseControllerElement.addEventListener("touchstart",M)}v._mouseControllerElement.addEventListener("touchstart",(function(t){if(v._isActive)if(v._mouseStore.getMouseState()===et.NONE){for(var e=t.changedTouches,a=e.length,i=0;i<a;i++){var s=e[i],r=mt(s.clientX,s.clientY),o=v._player.getDrawingCenterPosition(),n=r.substract(o),c=Math.abs(n.x),h=Math.abs(n.y),u=void 0,l=!1;if(c<G.CHIP_SIZE&&h<G.CHIP_SIZE){switch(o.x/G.CHIP_SIZE|0){case 0:l=!0,u=_.LEFT;break;case G.H_PARTS_NUM_IN_WINDOW-1:l=!0,u=_.RIGHT}switch(o.y/G.CHIP_SIZE|0){case 0:l=!0,u=_.UP;break;case G.V_PARTS_NUM_IN_WINDOW-1:l=!0,u=_.DOWN}}l||(n.y>0&&h>c?u=_.DOWN:n.y<0&&h>c?u=_.UP:n.x>0&&h<c?u=_.RIGHT:n.x<0&&h<c&&(u=_.LEFT)),v._mouseStore.setPressInfo(u,s.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var b=function(t){if(v._isActive)for(var e=0;e<t.changedTouches.length;e++)if(v._mouseStore.getTouchID()===t.changedTouches[e].identifier){v._mouseStore.setReleaseInfo(),t.preventDefault();break}};v._mouseControllerElement.addEventListener("touchend",b),v._mouseControllerElement.addEventListener("touchcancel",b)}dt("button-load").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.QUICK_LOAD)})),dt("button-save").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.QUICK_SAVE)})),dt("button-restart").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.RESTART_GAME)})),dt("button-gotowwa").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(wt(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){v._displayHelp()}))})),v._frameCoord=new l(G.IMGPOS_DEFAULT_FRAME_X,G.IMGPOS_DEFAULT_YESNO_Y),v._battleEffectCoord=new l(G.IMGPOS_DEFAULT_BATTLE_EFFECT_X,G.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),v._battleEstimateWindow=new Ye(v,v._wwaData.mapCGName,dt("wwa-wrapper")),v._passwordWindow=new Ke(v,dt("wwa-wrapper"),h),v._monsterWindow=new xe(v,new l(50,180),340,60,!1,dt("wwa-wrapper"),v._wwaData.mapCGName),v._setProgressBar(si(3,4,W.GAME_INIT)),v._isLoadedSound=!1,v._temporaryInputDisable=!1,v._paintSkipByDoorOpen=!1,v._clearFacesInNextFrame=!1,v._useConsole=!1,v.wwaCustomEvent("wwa_startup"),v._cgManager=new Tt(c,v._wwaData.mapCGName,v._frameCoord,(function(){v._isSkippedSoundMessage=!0;var t=function(){switch(v.userDevice.device){case S.PC:v.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case S.SP:v.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}},e=v.resolveSystemMessage(s.CONFIRM_LOAD_SOUND);if("ON"===e)return v._isLoadedSound=!0,t(),v._setLoadingMessage(g,W.AUDIO),v.loadSound(),void window.requestAnimationFrame(v.soundCheckCaller);if("OFF"===e)return v._isLoadedSound=!1,t(),void v.openGameWindow();if(v._isSkippedSoundMessage=!1,v._hasTitleImg||g.clearRect(0,0,G.SCREEN_WIDTH,G.SCREEN_HEIGHT),v._usePassword){var a=e;y&&(a+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),v._messageWindow.setMessage(a),v._messageWindow.show(),v._setProgressBar(si(4,4,W.GAME_INIT));var i=setInterval((function(){v._keyStore.update(),v._gamePadStore.update(),v._virtualPadStore.update(),v._yesNoJudgeInNextFrame===f.UNSELECTED&&(v._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||v._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||v._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||v._virtualPadStore.checkTouchButton("BUTTON_ENTER")?v._yesNoJudgeInNextFrame=f.YES:(v._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||v._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||v._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||v._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(v._yesNoJudgeInNextFrame=f.NO)),v._yesNoJudgeInNextFrame===f.YES?(clearInterval(i),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!0,v._setLoadingMessage(g,W.AUDIO),v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)}),G.YESNO_PRESS_DISP_FRAME_NUM*G.DEFAULT_FRAME_INTERVAL)):v._yesNoJudgeInNextFrame===f.NO&&(clearInterval(i),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!1,v.openGameWindow()}),G.YESNO_PRESS_DISP_FRAME_NUM*G.DEFAULT_FRAME_INTERVAL))}),G.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!0,v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)})),v.wwaCustomEvent("wwa_start")};var P=new Qa;P.addListener("mapData",(function(t){return v._loadHandler(t)})),P.addListener("progress",(function(t){return v._setProgressBar(t)})),P.addListener("error",(function(t){return v._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,g)})),new $a(t,P).requestAndLoadMapData().then((function(){return ei(v,void 0,void 0,(function(){return ai(this,(function(t){return this._canDisplayUserVars=y,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,E?(e=E,za(void 0,void 0,void 0,(function(){return ti(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 za(void 0,void 0,void 0,(function(){var e,a;return ti(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 v._userVarNameListRequestError=t,void v._updateVarDumpInformationArea(v._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return v._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(E," が正しい形式で書かれていません。")},void v._updateVarDumpInformationArea(v._userVarNameListRequestError.errorMessage,!0);if(v._userVarNameList=v.convertUserVariableNameListToArray(t.data),null!==v._dumpElement)for(var e=function(){var t=a.toString(10);if(!v._userVarNameList[a])return"continue";var e=".var-index".concat(t),i=v._dumpElement.querySelector(e),s=i.querySelector("".concat(e," > div"));s.textContent=v._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<G.USER_VAR_NUM;a++)e()}else v._updateVarDumpInformationArea(t.errorMessage,!1)}))}return t.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(G.USER_VAR_NUM),a=0;a<G.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>=G.USER_VAR_NUM||(e[i]=t[a])})),e},t.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=G.LOAD_STAGE_MAX_EXCEPT_AUDIO?(dt("progress-message-container").textContent=t.stage===G.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:z[t.stage],dt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(G.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*G.MAP_WINDOW_WIDTH+"px",dt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(G.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?dt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":dt("progress-message-container").textContent="ゲームデータを読み込んでいます。",dt("progress-bar-audio").style.width=t.current*G.MAP_WINDOW_WIDTH/t.total+"px",dt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},t.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=X.TITLE+"px "+G.LOADING_FONT,t.fillText(tt[0],j.TITLE_X,j.TITLE_Y),t.font=X.FOOTER+"px "+G.LOADING_FONT,t.fillText("WWA Wing Ver.3.12.8",j.FOOTER_X,j.COPYRIGHT_Y);else if(e<=tt.length)t.font=X.LOADING+"px "+G.LOADING_FONT,e>=2&&(t.clearRect(j.LOADING_X,j.LOADING_Y+j.LINE*(e-3),G.SCREEN_WIDTH-j.LOADING_X,j.LINE),t.fillText(tt[e-1]+" Complete!",j.LOADING_X,j.LOADING_Y+j.LINE*(e-2))),e<tt.length&&t.fillText(tt[e],j.LOADING_X,j.LOADING_Y+j.LINE*(e-1)),1==e&&(t.font=X.FOOTER+"px "+G.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,j.FOOTER_X,j.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",j.FOOTER_X,j.WORLD_Y+j.LINE));else{var a;a=this._isSkippedSoundMessage?j.LOADING_Y+j.LINE*(tt.length-1):j.FOOTER_Y,e<=W.AUDIO?t.fillText("Now Sound data Loading .....",j.LOADING_X,a):(t.clearRect(j.LOADING_X,a-j.LINE,G.SCREEN_WIDTH-j.LOADING_X,j.LINE),t.fillText("Now Sound data Loading ..... Complete!",j.LOADING_X,a))}},t.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,G.SCREEN_WIDTH,G.SCREEN_HEIGHT),e.font=X.ERRROR+"px "+G.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,j.ERROR_X,j.ERROR_Y+j.LINE*a)})))},t.prototype.createSoundInstance=function(t){if(0!==t&&t!==B.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ca(t,e,this.audioContext,this.audioGain)}},t.prototype.loadSound=function(){var t=this;this.sounds=new Array(G.SOUND_MAX+1),this.createSoundInstance(B.DECISION),this.createSoundInstance(B.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][G.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][G.ATR_TYPE]!==G.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][G.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<B.NO_SOUND&&t.createSoundInstance(i)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},t.prototype.checkAllSoundLoaded=function(){var t=0,e=0;if(!this._hasTitleImg)var a=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(Q.KEY_SPACE)===$.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var i=1;i<=G.SOUND_MAX;i++){var s=this.sounds[i];void 0===s||s.isError()||(e++,s.hasData()&&t++)}if(t<e&&!this._soundLoadSkipFlag)return this._setProgressBar(si(t,e,W.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(si(G.SOUND_MAX,G.SOUND_MAX,W.AUDIO)),this._setLoadingMessage(a,W.FINISH),this.openGameWindow()},t.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.bgmDelayDurationMs),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},t.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},t.prototype.playSound=function(t,e){this._isLoadedSound?t<0||t>=G.SOUND_MAX?console.warn("サウンド番号が範囲外です。"):t>=B.BGM_LB&&this._wwaData.bgm===t||((t===B.NO_SOUND||t>=B.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].isPlaying()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==B.NO_SOUND&&(this.sounds[t].hasData()?t>=B.BGM_LB?(this.sounds[t].play(null!=e?e:this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=t):this.sounds[t].play():t>=B.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t)))):t===B.NO_SOUND?this._wwaData.bgm=0:t>=B.BGM_LB&&(this._wwaData.bgm=t)},t.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();dt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=dt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var i=sa.getStartWWAData(a);this._restartData!==i&&(this._applyQuickLoad(i),this._wwaSave.resumeStart())}setTimeout((function(){dt("wwa-wrapper").removeChild(dt("wwa-cover")),t._main()}),G.SPLASH_SCREEN_DISP_MILLS)},t.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){dt("item"+(t-1)).classList.add("onpress"),this.playSound(B.DECISION);var e=this.resolveSystemMessage(s.CONFIRM_USE_ITEM);if("BLANK"===e){this._player.readyToUseItem(t);var a=this._player.useItem(),i=this.getObjectAttributeById(a,G.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(i),!1,!1,a,m.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(e,!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},t.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var i=dt(R[t]);if(this.playSound(B.DECISION),this._itemMenu.close(),i.classList.add("onpress"),t===O.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case I.CALL_BY_QUICK_LOAD:case I.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case I.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case I.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case I.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case I.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case I.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case I.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===O.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=I.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_QUICK_SAVE));else if(t===O.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_RESTART_GAME;else if(t===O.GOTO_WWA)if(a)this._bottomButtonType!==n.GOTO_WWA&&dt(R[O.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case n.GOTO_WWA:this._yesNoChoiceCallInfo=I.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case n.GAME_END:this._yesNoChoiceCallInfo=I.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case n.BATTLE_REPORT:this.launchBattleEstimateWindow()}},t.prototype.onpasswordloadcalled=function(){this._usePassword?(dt(R[O.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},t.prototype.onpasswordsavecalled=function(){dt(R[O.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_PASSWORD_SAVE)},t.prototype.onpasssuspendsavecalled=function(){dt(R[O.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_SUSPEND)},t.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(B.DECISION),this._itemMenu.openView()},t.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){switch(t){case D.UP:this._player.speedUp();break;case D.DOWN:this._player.speedDown()}var e=this.resolveSystemMessage(s.GAME_SPEED_CHANGED);"BLANK"!==e&&this.generatePageAndReserveExecution(e,!1,!0)}else{var a=this.resolveSystemMessage(s.GAME_SPEED_CHANGE_DISABLED);"BLANK"!==a&&this.generatePageAndReserveExecution(a,!1,!0)}},t.prototype.isBattleSpeedIndexForQuickBattle=function(t){return G.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},t.prototype._executeNode=function(t,e){var a,i=this;if(t instanceof Ne)return null===(a=t.macro)||void 0===a||a.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),ii([t],this._executeNode(t.next,e),!0);if(t instanceof Ce){if(!e)throw new Error("パーツ起因ページによる実行ではないため、Junctionノードの利用を想定していません。");var s=t.evaluateAndGetNextNode((function(){return i.generateTokenValues(e)}));return s?this._executeNode(s,e):[]}return[]},t.prototype._executeNodes=function(t,e){try{return{isError:!1,messages:this._executeNode(t,e)}}catch(t){return{isError:!0}}},t.prototype._main=function(){var t,e=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var a=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return e.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return a&&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 i=this._pages.shift(),s=this._executeNodes(i.firstNode,i.extraInfo?{position:i.extraInfo.partsPosition,type:i.extraInfo.partsType,id:i.extraInfo.partsId}:void 0);if(!0===s.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var r=s.messages.filter((function(t){return!t.isEmpty()})),o=Boolean(i.scoreOptions);if(o&&0===r.length&&r.push(new Ne("スコアを表示します。")),r.length>0){var n=r.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(n),this._messageWindow.setYesNoChoice(i.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,o,i.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),o&&(this._lastScoreOptions=i.scoreOptions,this.updateScore(i.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=i.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow();break}}if(this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(I.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{var c=this._player.getDir(),h=[NaN,NaN,Q.KEY_DOWN,NaN,Q.KEY_LEFT,NaN,Q.KEY_RIGHT,NaN,Q.KEY_UP,NaN][c];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(Q.KEY_LEFT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_UP)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_RIGHT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_DOWN)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.LEFT)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.UP)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.RIGHT)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.DOWN)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(h)?this._checkTurnKeyPressed()?this._player.setDir(c):(this._player.controll(c),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_DOWN")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(Q.KEY_1)===$.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(Q.KEY_2)===$.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(Q.KEY_3)===$.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(Q.KEY_Q)===$.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(Q.KEY_W)===$.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(Q.KEY_E)===$.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(Q.KEY_A)===$.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(Q.KEY_S)===$.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(Q.KEY_D)===$.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(Q.KEY_Z)===$.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(Q.KEY_X)===$.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(Q.KEY_C)===$.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(Q.KEY_I)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(D.DOWN):this._keyStore.getKeyState(Q.KEY_P)===$.KEYDOWN||this._keyStore.checkHitKey(Q.KEY_F2)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(D.UP):this._keyStore.getKeyState(Q.KEY_F1)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_M)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(Q.KEY_F3)?(this.playSound(B.DECISION),this.onselectbutton(O.QUICK_LOAD,!0)):this._keyStore.checkHitKey(Q.KEY_F4)?(this.playSound(B.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(Q.KEY_F5)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_ZR)?this.onselectbutton(O.QUICK_LOAD):this._keyStore.checkHitKey(Q.KEY_F6)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_ZL)?this.onselectbutton(O.QUICK_SAVE):this._keyStore.checkHitKey(Q.KEY_F7)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_R)?this.onselectbutton(O.RESTART_GAME):this._keyStore.checkHitKey(Q.KEY_F8)?this.onselectbutton(O.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(Q.KEY_F9)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(Q.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(Q.KEY_F12)||this._gamePadStore.buttonTrigger(st.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(Q.KEY_LEFT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(_.LEFT):this._keyStore.checkHitKey(Q.KEY_UP)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(_.UP):this._keyStore.checkHitKey(Q.KEY_RIGHT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(_.RIGHT):(this._keyStore.checkHitKey(Q.KEY_DOWN)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(_.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===f.UNSELECTED&&(this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=f.YES:(this._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=f.NO)),(this._yesNoJudge===f.YES||this._yesNoJudge===f.NO)&&(this.playSound(B.DECISION),this._yesNoDispCounter=G.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(Q.KEY_LEFT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(_.LEFT):this._keyStore.checkHitKey(Q.KEY_UP)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(_.UP):this._keyStore.checkHitKey(Q.KEY_RIGHT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(_.RIGHT):(this._keyStore.checkHitKey(Q.KEY_DOWN)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(_.DOWN),this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER"))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(_.LEFT)||this._mouseStore.checkClickMouse(_.UP)||this._mouseStore.checkClickMouse(_.RIGHT)||this._mouseStore.checkClickMouse(_.DOWN)||this._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var u=0;u<R.length;u++){(E=dt(R[u])).classList.contains("onpress")&&E.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(B.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var l=this._keyStore.getKeyStateForMessageCheck(Q.KEY_ENTER),p=this._keyStore.getKeyStateForMessageCheck(Q.KEY_SPACE),d=this._keyStore.getKeyStateForMessageCheck(Q.KEY_ESC);if(l===$.KEYDOWN||l===$.KEYPRESS_MESSAGECHANGE||p===$.KEYDOWN||p===$.KEYPRESS_MESSAGECHANGE||d===$.KEYDOWN||d===$.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===et.MOUSEDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(u=0;u<R.length;u++){var E;(E=dt(R[u])).classList.contains("onpress")&&E.classList.remove("onpress")}this._setNextPage()}}if(null===(t=this._inlineUserVarViewer)||void 0===t?void 0:t.isVisible){var y=!1;this._keyStore.getKeyState(Q.KEY_DOWN)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,y=!0),this._keyStore.getKeyState(Q.KEY_UP)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,y=!0),this._keyStore.getKeyState(Q.KEY_RIGHT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=G.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._keyStore.getKeyState(Q.KEY_LEFT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=G.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=G.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>G.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=G.USER_VAR_NUM),y&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(Q.KEY_V)===$.KEYDOWN&&this._setNextPage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_SPACE)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.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 w=this.checkMap();w||this.checkObject(),this._prevFrameEventExected=w}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==f.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=C.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*G.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&dt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&dt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&dt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&dt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){e._loadType===C.QUICK_LOAD?(e._quickLoad(),e.wwaCustomEvent("wwa_quickload")):e._loadType===C.RESTART_GAME?(e._restartGame(),e.wwaCustomEvent("wwa_restert")):e._loadType===C.PASSWORD&&(e._applyQuickLoad(e._passwordSaveExtractData),e._passwordSaveExtractData=void 0,e.wwaCustomEvent("wwa_passwordload")),setTimeout(e.mainCaller,G.DEFAULT_FRAME_INTERVAL,e)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(u=0;u<G.USER_VAR_NUM;u++){var m=u.toString(10);this._dumpElement.querySelector(".var".concat(m)).textContent=this._wwaData.userVar[u]+""}},t.prototype.vibration=function(t){this._gamePadStore.vibration(t)},t.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),i=this._camera.getPosition().getOffsetCoord(),s=G.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,G.MAP_WINDOW_WIDTH,G.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,G.MAP_WINDOW_WIDTH,G.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()*G.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=dt("wwa-fader");if((c-=3*G.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,G.CHIP_SIZE*(t-a.x)-i.x,G.CHIP_SIZE*(e-a.y)-i.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},t.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+G.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+G.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][G.ATR_X]/G.CHIP_SIZE,d=this._wwaData.mapAttribute[l][G.ATR_Y]/G.CHIP_SIZE,E=G.CHIP_SIZE*(h-t.x)-e.x,f=G.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][G.ATR_X]/G.CHIP_SIZE,d=this._wwaData.mapAttribute[l][G.ATR_Y]/G.CHIP_SIZE,E=G.CHIP_SIZE*(h-t.x)-e.x,f=G.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},t.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=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],_=(r.x-t.x)*G.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*G.CHIP_SIZE+o.y-e.y;if(this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()){s=this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]}else s=this._player.isMovingImage()?this._wwaData.playerImgPosX+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)}},t.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,p,d,f,y,w,m,g,v=Math.max(0,t.x-1),A=Math.min(this._wwaData.mapWidth-1,t.x+G.H_PARTS_NUM_IN_WINDOW),S=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+G.V_PARTS_NUM_IN_WINDOW),I=0,O=this._animationCounter>G.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(i)for(f=v;f<=A;f++)for(y=S;y<=T;y++)D&&new l(f,y).equals(this._monster.position)||(w=this._wwaData.mapObject[y][f],r=new l(0,0),this._wwaData.objectAttribute[w][G.ATR_MOVE]!==N.STATIC&&null!==(d=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new l(f,y)))&&(r=d),c=G.CHIP_SIZE*(f-t.x)+r.x-e.x,h=G.CHIP_SIZE*(y-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[w][G.ATR_X2]&&0===this._wwaData.objectAttribute[w][G.ATR_Y2],n=this._wwaData.objectAttribute[w][o?G.ATR_X:G.ATR_X2]/G.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?G.ATR_Y:G.ATR_Y2]/G.CHIP_SIZE,u=this._wwaData.objectAttribute[w][G.ATR_TYPE],p=this._wwaData.objectAttribute[w][G.ATR_NUMBER],0===w||this._checkNoDrawObject(new l(f,y),u,p)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,P,M,b,R,L=[],x=[];for(f=v;f<=A;f++)for(y=S;y<=T;y++)m=w=this._wwaData.mapObject[y][f],u=this._wwaData.objectAttribute[w][G.ATR_TYPE],p=this._wwaData.objectAttribute[w][G.ATR_NUMBER],this._checkNoDrawObject(new l(f,y),u,p)&&(m=0),P=this._wwaData.objectAttribute[w][G.ATR_MOVE]===N.STATIC,0!==m&&(M=!(!D||!new l(f,y).equals(this._monster.position)),P?x.push(new E(w,f,y,P,M)):(L.push(new E(w,f,y,P,M)),m=0),M&&(m=0)),this._cgManager.mapObjectCache[I]!==m&&(this._cgManager.mapObjectCache[I]=m,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(L,x)),R=L.length,b=0;b<R;b++)if(f=(C=L[b]).x,y=C.y,w=C.partsIDObj,P=C.isStatic,M=C.isFighting,c=G.CHIP_SIZE*(f-t.x)-e.x,h=G.CHIP_SIZE*(y-t.y)-e.y,P){if(M)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[w][G.ATR_X2]&&0===this._wwaData.objectAttribute[w][G.ATR_Y2],n=this._wwaData.objectAttribute[w][o?G.ATR_X:G.ATR_X2]/G.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?G.ATR_Y:G.ATR_Y2]/G.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(d=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new l(f,y)))&&(c+=d.x,h+=d.y),o=O||0===this._wwaData.objectAttribute[w][G.ATR_X2]&&0===this._wwaData.objectAttribute[w][G.ATR_Y2],n=this._wwaData.objectAttribute[w][o?G.ATR_X:G.ATR_X2]/G.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?G.ATR_Y:G.ATR_Y2]/G.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},t.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},t.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},t.prototype._drawFrame=function(){this._cgManager.drawFrame()},t.prototype._checkNoDrawObject=function(t,e,a){var i=this._player.getPosition(),s=i.getPartsCoord();return!(!i.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===G.OBJECT_DOOR&&0===a||(e===G.OBJECT_STATUS||e===G.OBJECT_MESSAGE||e===G.OBJECT_ITEM||e===G.OBJECT_SELL||e===G.OBJECT_BUY||e===G.OBJECT_SELL||e===G.OBJECT_LOCALGATE))},t.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},t.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},t.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},t.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][G.ATR_TYPE]},t.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][G.ATR_TYPE]},t.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[i][e]},t.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,G.ATR_STRING)},t.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[i][e]},t.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},t.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},t.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][G.ATR_X]},t.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][G.ATR_Y]},t.prototype.getMessageById=function(t){return this._wwaData.message[t]},t.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},t.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],i=this._wwaData.mapAttribute[a][G.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(m.MAP)!==a)&&(i===G.MAP_STREET?r=this._execMapStreetEvent(t,a,i):i===G.MAP_WALL?r=this._execMapWallEvent(t,a,i):i===G.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,i):i===G.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,i)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(m.MAP,a),r)},t.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][G.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(m.OBJECT)===a||(i===G.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,i):i===G.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,i):i===G.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,i):i===G.OBJECT_ITEM?this._execObjectItemEvent(t,a,i):i===G.OBJECT_DOOR?this._execObjectDoorEvent(t,a,i):i===G.OBJECT_STATUS?this._execObjectStatusEvent(t,a,i):i===G.OBJECT_BUY?this._execObjectBuyEvent(t,a,i):i===G.OBJECT_SELL?this._execObjectSellEvent(t,a,i):i===G.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,i):i===G.OBJECT_SCORE?this._execObjectScoreEvent(t,a,i):i===G.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,i):i===G.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,i),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(m.OBJECT,a))},t.prototype._execMapStreetEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][G.ATR_ITEM];if(0!==i&&!this._player.hasItem(i))return!1;this.reserveAppearPartsInNextFrame(t,y.MAP,e);var s=this._wwaData.mapAttribute[e][G.ATR_STRING],r=this._wwaData.message[s],o=this._wwaData.mapAttribute[e][G.ATR_NUMBER];return this._waitFrame+=o*G.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,m.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][G.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==o},t.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Pe(e.firstNode)}),!1)},t.prototype._execMapWallEvent=function(t,e,a){var i=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(i,G.ATR_TYPE);if(0===i||s===G.OBJECT_NORMAL||s===G.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(i,G.ATR_ITEM))||this.getObjectAttributeById(s,G.ATR_MODE)===G.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,y.MAP,e);var r=this._wwaData.mapAttribute[e][G.ATR_STRING],o=this._wwaData.message[r];return this.generatePageAndReserveExecution(o,!1,!1,e,m.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][G.ATR_SOUND]),!1}return!1},t.prototype._execMapLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][G.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][G.ATR_JUMP_Y];return s>G.RELATIVE_COORD_LOWER&&(s=t.x+s-G.RELATIVE_COORD_BIAS),r>G.RELATIVE_COORD_LOWER&&(r=t.y+r-G.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,y.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new p(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][G.ATR_SOUND]),!0)},t.prototype._execMapUrlGateEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][G.ATR_STRING];if(!this._isURLGateEnable)return!0;var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);if("BLANK"!==r)return this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0],!0;location.href=gt(this._wwaData.message[i].split(/\s/g)[0])},t.prototype._execObjectNormalEvent=function(t,e,a){},t.prototype._execObjectMessageEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.ATR_STRING],s=this._wwaData.message[i],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][G.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!1,!1,e,m.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][G.ATR_NUMBER]*G.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this.playSound(o)},t.prototype._execObjectStatusEvent=function(t,e,a){var i=new u(this._wwaData.objectAttribute[e][G.ATR_ENERGY],this._wwaData.objectAttribute[e][G.ATR_STRENGTH],this._wwaData.objectAttribute[e][G.ATR_DEFENCE],this._wwaData.objectAttribute[e][G.ATR_GOLD]),s=this._wwaData.objectAttribute[e][G.ATR_STRING],r=this._wwaData.message[s],o=this._player.getStatusWithoutEquipments();if(i.strength>G.STATUS_MINUS_BORDER&&o.strength<i.strength-G.STATUS_MINUS_BORDER||i.defence>G.STATUS_MINUS_BORDER&&o.defence<i.defence-G.STATUS_MINUS_BORDER||i.gold>G.STATUS_MINUS_BORDER&&o.gold<i.gold-G.STATUS_MINUS_BORDER)return this.setPartsOnPosition(m.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();i.energy=i.energy>G.STATUS_MINUS_BORDER?G.STATUS_MINUS_BORDER-i.energy:i.energy,i.strength=i.strength>G.STATUS_MINUS_BORDER?G.STATUS_MINUS_BORDER-i.strength:i.strength,i.defence=i.defence>G.STATUS_MINUS_BORDER?G.STATUS_MINUS_BORDER-i.defence:i.defence,i.gold=i.gold>G.STATUS_MINUS_BORDER?G.STATUS_MINUS_BORDER-i.gold:i.gold,this._player.addStatusAll(i),this.setStatusChangedEffect(i),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][G.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.setPartsOnPosition(m.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND]))},t.prototype._execObjectMonsterEvent=function(t,e,a){var i=this,s=new l(this._wwaData.objectAttribute[e][G.ATR_X],this._wwaData.objectAttribute[e][G.ATR_Y]),r=new u(this._wwaData.objectAttribute[e][G.ATR_ENERGY],this._wwaData.objectAttribute[e][G.ATR_STRENGTH],this._wwaData.objectAttribute[e][G.ATR_DEFENCE],this._wwaData.objectAttribute[e][G.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][G.ATR_STRING]],n=this._wwaData.objectAttribute[e][G.ATR_ITEM];this._monster=new Pt(e,t,s,r,o,n,(function(){i._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},t.prototype._execObjectBuyEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND])},t.prototype._execObjectSellEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND])},t.prototype._execObjectItemEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.ATR_STRING],r=this._wwaData.message[i];try{var o=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),n=(t.x-o.x)*G.CHIP_SIZE,_=(t.y-o.y)*G.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][G.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new l(n,_),itemBoxBackgroundImageCoord:new l(this._wwaData.imgItemboxX*G.CHIP_SIZE,this._wwaData.imgItemboxY*G.CHIP_SIZE)}:void 0),this.setPartsOnPosition(m.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][G.ATR_MODE]||(this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e))}catch(t){var c=this.resolveSystemMessage(s.ITEM_BOX_FULL);"BLANK"!==c&&this.generatePageAndReserveExecution(c,!1,!0)}this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND])},t.prototype._execObjectDoorEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.ATR_ITEM],s=this._wwaData.objectAttribute[e][G.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(i)&&(0===this._wwaData.objectAttribute[e][G.ATR_MODE]&&this._player.removeItemByPartsID(i),this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.setPartsOnPosition(m.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this._paintSkipByDoorOpen=!0)},t.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND])},t.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(m.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][G.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][G.ATR_JUMP_Y];s>G.RELATIVE_COORD_LOWER&&(s=i.x+s-G.RELATIVE_COORD_BIAS),r>G.RELATIVE_COORD_LOWER&&(r=i.y+r-G.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new p(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND]))},t.prototype._execObjectUrlGateEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.ATR_STRING];if(this._isURLGateEnable){var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);"BLANK"!==r?(this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0]):location.href=gt(this._wwaData.message[i].split(/\s/g)[0])}},t.prototype._execObjectScoreEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][G.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[i],!1,!1,e,m.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][G.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][G.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][G.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][G.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][G.ATR_SOUND])},t.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var a=this._player.getStatus().calculateScore(e);this._scoreWindow.update(a)}},t.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_GOLD]))return"BLANK"!==(n=this.resolveSystemMessage(s.NO_MONEY))&&this._pages.push(new Oe(new Ne(n),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),a=(t.x-e.x)*G.CHIP_SIZE,i=(t.y-e.y)*G.CHIP_SIZE,r=this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ITEM],o=this._wwaData.objectAttribute[r][G.ATR_NUMBER];try{this._player.addItem(r,o,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new l(a,i),itemBoxBackgroundImageCoord:new l(this._wwaData.imgItemboxX*G.CHIP_SIZE,this._wwaData.imgItemboxY*G.CHIP_SIZE)}:void 0)}catch(t){var n;return"BLANK"!==(n=this.resolveSystemMessage(s.ITEM_BOX_FULL))&&this._pages.push(new Oe(new Ne(n),!0,!1,!0)),{}}}var _=new u(this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_GOLD]);return _.energy=_.energy>G.STATUS_MINUS_BORDER?G.STATUS_MINUS_BORDER-_.energy:_.energy,this.setStatusChangedEffect(_),this._player.addStatusAll(_),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:y.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},t.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===f.YES){if(this._yesNoChoiceCallInfo===I.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][G.ATR_TYPE])===G.MAP_URLGATE&&(location.href=gt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===I.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_TYPE])===G.OBJECT_BUY)if(this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ITEM]))this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new u(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.OBJECT,this._yesNoChoicePartsID);else{var a=this.resolveSystemMessage(s.NO_ITEM);"BLANK"!==a&&this._pages.push(new Oe(new Ne(a),!0,!1,!0))}else if(t===G.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===G.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.CHOICE_YES,this._yesNoChoicePartsID):t===G.OBJECT_URLGATE&&(location.href=gt(this._yesNoURL));else this._yesNoChoiceCallInfo===I.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===I.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),dt(R[O.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=C.QUICK_LOAD)):this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(I.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===I.CALL_BY_RESTART_GAME?(dt(R[O.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=C.RESTART_GAME):this._yesNoChoiceCallInfo===I.CALL_BY_END_GAME?(window.history.back(-1),dt(R[O.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===I.CALL_BY_GOTO_WWA?(location.href=gt(G.WWA_HOME),dt(R[O.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_LOAD?(dt(R[O.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Ge.LOAD)):this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_SAVE?(dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(I.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Ge.SAVE)):this._yesNoChoiceCallInfo===I.CALL_BY_SUSPEND&&(dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(I.CALL_BY_SUSPEND));this._yesNoJudge=f.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===f.NO){if(this._yesNoChoiceCallInfo===I.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][G.ATR_TYPE],G.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===I.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][G.ATR_TYPE])===G.OBJECT_BUY||t===G.OBJECT_SELL||(t===G.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.CHOICE_NO,this._yesNoChoicePartsID):G.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===I.CALL_BY_ITEM_USE){dt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===I.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case I.NONE:dt(R[O.QUICK_LOAD]).classList.remove("onpress");break;case I.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=f.UNSELECTED,void this.onpasswordloadcalled();case I.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=f.UNSELECTED,i){case I.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case I.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=f.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());dt(R[O.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===I.CALL_BY_RESTART_GAME)dt(R[O.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_END_GAME)dt(R[O.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_GOTO_WWA)dt(R[O.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_LOAD)dt(R[O.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_SAVE)dt(R[O.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=f.UNSELECTED,void this.onpasswordsavecalled();dt(R[O.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=f.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.NONE,this._messageWindow.setYesNoChoice(!1)}},t.prototype.generatePageAndReserveExecution=function(t,e,a,i,s,r,o){void 0===i&&(i=0),void 0===s&&(s=m.OBJECT),void 0===r&&(r=new l(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},t.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(/\/\//)?At(At(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//");if(""===_)return o?[new Oe(void 0,!0,!1,!1,o,{partsId:e,partsType:a,partsPosition:i})]:[];var c=_.split(/\<p\>/gi);return c.map((function(t,_){var h=void 0,u=void 0,l=void 0,p={id:e,type:a,position:i},d=n.parseMessageLines(t,e,a,i),E=[];return d.forEach((function(t,e){try{var a=0===e?void 0:d[e-1].type,i=E[E.length-1],s=n.createNewNode(t,!h||!Me(a),{triggerParts:p}),r=n.processConditionalExecuteMacroLine(s,t,i,E);r&&(l=r),a?n.connectOrMergeToPreviousNode(t,a,u,s,i,l,{triggerParts:p}):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new Oe(h,_===c.length-1,0===_&&r,s,0===_&&o,{partsId:e,partsType:a,partsPosition:i})}))},t.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,o=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==o&&3===o.length||null!==(o=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===o.length))throw new Error("マクロではありません");var n=o[1],_="$".concat(n.toLowerCase()),c="$if"===_&&s.match(/,/)?b.LEGACY_IF:U[_],h=Boolean(c!==b.SHOW_STR&&c!==b.SHOW_STR2),u=(null!==(r=o[2])&&void 0!==r?r:"").split(",").map((function(t){return h?t.trim():t}));return new be(t,e,a,i,void 0===c?b.UNDEFINED:c,u)}(s,e,a,i,r[1]);switch(o.macroType){case b.IF:case b.ELSE_IF:case b.ELSE:case b.END_IF:case b.SHOW_STR:case b.SHOW_STR2:return{type:o.macroType,text:t,macro:o};default:return{type:"normalMacro",text:t,macro:o}}})).filter(Boolean)},t.prototype.createNewNode=function(t,e,a){switch(t.type){case b.IF:return new Ce([{descriminant:Te(t.macro.macroArgs[0])}]);case b.SHOW_STR:case b.SHOW_STR2:return e?new Ne(this._generateShowStrString(t.macro.macroArgs,{triggerParts:a.triggerParts,version:t.type===b.SHOW_STR2?2:1})):void 0;case"text":return e?new Ne(t.text):void 0;case"normalMacro":return e?new Ne("",[t.macro]):void 0;default:return}},t.prototype.processConditionalExecuteMacroLine=function(t,e,a,i){var s=0===i.length;switch(e.type){case b.IF:return void i.push(t);case b.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void a.appendBranch({descriminant:Te(e.macro.macroArgs[0])});case b.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void a.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case b.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return i.pop()}},t.prototype.connectOrMergeToPreviousNode=function(t,e,a,i,s,r,o){var n=Me(e);switch(e){case b.IF:case b.ELSE_IF:case b.ELSE:if(!i||!s)return;var _=s.getLastUnconnectedBranch();if(!_)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(_.next=i);case b.END_IF:if(!(i&&r instanceof Ce))return;for(var c=0;c<r.branches.length;c++){var h=r.branches[c].next;h?this.connectToFinalNode(h,i):r.branches[c]=i}return void(r.hasElseBranch()||r.branches.push({next:i,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(n&&a instanceof Ne))return;var u=!a.isEmpty();t.type===b.SHOW_STR||t.type===b.SHOW_STR2?a.appendMessage(this._generateShowStrString(t.macro.macroArgs,{triggerParts:o.triggerParts,version:t.type===b.SHOW_STR2?2:1}),u):"text"===t.type?a.appendMessage(t.text,u):"normalMacro"===t.type?a.macro.push(t.macro):a.next=i}},t.prototype.connectToFinalNode=function(t,e){for(var a=t;;)if(a instanceof Ce&&(a=a.branches[0].next),a instanceof Ne){if(!a.next)return void(a.next=e);a=a.next}},t.prototype.appearParts=function(t){var e,a,i,s,r,o,n=t.pos,_=t.triggerType,c=t.triggerPartsId,h=_===y.CHOICE_NO?G.APPERANCE_PARTS_MIN_INDEX_NO:G.APPERANCE_PARTS_MIN_INDEX,u=_===y.CHOICE_YES?G.APPERANCE_PARTS_MAX_INDEX_YES:G.APPERANCE_PARTS_MAX_INDEX;for(_===y.MAP?(c=0===c?this._wwaData.map[n.y][n.x]:c,e=m.MAP):(c=0===c?this._wwaData.mapObject[n.y][n.x]:c,e=m.OBJECT),o=h;o<=u;o++){var d=G.ATR_APPERANCE_BASE+o*G.REL_ATR_APPERANCE_UNIT_LENGTH,E=d+G.REL_ATR_APPERANCE_ID,f=d+G.REL_ATR_APPERANCE_X,w=d+G.REL_ATR_APPERANCE_Y,g=d+G.REL_ATR_APPERANCE_TYPE;if(a=e===m.MAP?this._wwaData.mapAttribute[c][E]:this._wwaData.objectAttribute[c][E],i=e===m.MAP?this._wwaData.mapAttribute[c][g]:this._wwaData.objectAttribute[c][g],s=e===m.MAP?this._wwaData.mapAttribute[c][f]:this._wwaData.objectAttribute[c][f],r=e===m.MAP?this._wwaData.mapAttribute[c][w]:this._wwaData.objectAttribute[c][w],s===G.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>G.RELATIVE_COORD_LOWER&&(s=n.x+s-G.RELATIVE_COORD_BIAS),r===G.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>G.RELATIVE_COORD_LOWER&&(r=n.y+r-G.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new p(this,s,r,0,0),i===m.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var v=new l(s,r);this.setPartsOnPosition(m.MAP,a,v)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");v=new l(s,r);this.setPartsOnPosition(m.OBJECT,a,v),this._replaceRandomObject(new l(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},t.prototype.reserveAppearPartsInNextFrame=function(t,e,a){void 0===a&&(a=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:a})},t.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},t.prototype.appearPartsByDirection=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=g[s],o=v[s];this.appearPartsEval(i,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},t.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 p(this,r,o,0,0);if(s===m.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new l(r,o);this.setPartsOnPosition(m.MAP,i,_)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new l(r,o);this.setPartsOnPosition(m.OBJECT,i,_),this._replaceRandomObject(new l(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},t.prototype._replaceRandomObject=function(t){var e,a,i=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[i][G.ATR_TYPE]===G.OBJECT_RANDOM){for(var s=0;s<G.RANDOM_ITERATION_MAX;s++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[i][G.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][G.ATR_TYPE]!==G.OBJECT_RANDOM)break;i=e}this.setPartsOnPosition(m.OBJECT,e,t)}},t.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+G.H_PARTS_NUM_IN_WINDOW),i=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+G.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=i;o<=s;o++)this._replaceRandomObject(new l(r,o))},t.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new l(t,e))},t.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=f.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.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 p(this,t,e,0,0))},t.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},t.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},t.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(dt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=G.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(dt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=G.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof u&&(0!==t.energy&&(dt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=G.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(dt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=G.STATUS_CHANGED_EFFECT_FRAME_NUM)))},t.prototype.setPartsOnPosition=function(t,e,a){var i,s,r=a.y<<q.BITSHIFT|a.x;t===m.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))},t.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},t.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},t.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},t.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 $e(e+="Z")},t.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+=vt(t[a[s]]);return $e(e)},t.prototype.compressSystem=function(){return sa},t.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 I.CALL_BY_LOG_QUICK_SAVE:case I.CALL_BY_QUICK_SAVE:case I.CALL_BY_SUSPEND:break;case I.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 I.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,i),this.wwaCustomEvent("wwa_quicksave",{data:i}),"";case I.CALL_BY_PASSWORD_SAVE:var o=sa.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(Ze.enc.Utf8.parse(e)),Ze.AES.encrypt(Ze.enc.Utf8.parse(e),qe(a)).toString();case I.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:i,compress:sa.compress(i)});break;case I.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:i}),this._wwaSave.autoSave(this._cvs,i)}},t.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},t.prototype._decodePassword=function(t){var e,a,i,s="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,s=Ze.AES.decrypt(e,qe(a)).toString(Ze.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,a){return Ze.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(Ze.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=sa.decompress(i),_=n[0],c=n[1];return[pa(_),c]}return[i,{isWorldNameEmpty:!1}]},t.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},t.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new p(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(B.NO_SOUND):this.playSound(t.bgm,t.bgmDelayDurationMs),this.setImgClick(new l(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(x.ENERGY,new l(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(x.STRENGTH,new l(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(x.DEFENCE,new l(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(x.GOLD,new l(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new l(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new l(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},t.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var a=0;a<this._wwaData.mapWidth;a++){var i=a<<q.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)}},t.prototype._restartGame=function(){this._quickLoad(!0)},t.prototype._fadeout=function(t){var e=0,a=G.MAP_WINDOW_WIDTH,i=G.FADEOUT_SPEED,s=dt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=i,(a-=2*i)<=0||2*e>G.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=G.MAP_WINDOW_WIDTH+"px",s.style.height=G.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)},t.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(),G.ATR_TYPE)!==G.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),G.ATR_TYPE)!==G.OBJECT_LOCALGATE){for(e=new Array(G.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(G.V_PARTS_NUM_IN_WINDOW+2),i=-1;i<=G.V_PARTS_NUM_IN_WINDOW;i++)for(e[i+1]=new Array(G.H_PARTS_NUM_IN_WINDOW+2),this.hoge[i+1]=new Array(G.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=G.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 p(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<=G.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(i=-1;i<=G.V_PARTS_NUM_IN_WINDOW;i++)if(!(o+i<0||o+i>=this._wwaData.mapWidth)){try{var _;n=(_=new p(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][G.ATR_MOVE]!==N.STATIC&&this._wwaData.objectAttribute[c][G.ATR_TYPE]!==G.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][G.ATR_TYPE]!==G.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][G.ATR_MOVE]===N.CHASE_PLAYER||this._wwaData.objectAttribute[c][G.ATR_MOVE]===N.RUN_OUT||this._wwaData.objectAttribute[c][G.ATR_MOVE]===N.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][G.ATR_MOVE];if(h!==N.HANG_AROUND){var u,d=this._getCandidateCoord(t,_,h),E=new l(d.x,n.y),f=new l(n.x,d.y),y=null;if(this._objectCanMoveTo(t,d,e))this._setObjectsInNextFrame(n,d,r,o,e,c);else{var w=this._getSecondCandidateMoveMode(t,n,d,E,f,this._wwaData.objectAttribute[c][G.ATR_TYPE]===G.OBJECT_MONSTER,e);w===P.MODE_X?this._setObjectsInNextFrame(n,E,r,o,e,c):w===P.MODE_Y?this._setObjectsInNextFrame(n,f,r,o,e,c):null===(y=this._getThirdCandidate(t,_,d,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,y,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},t.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===N.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===N.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},t.prototype._getSecondCandidateMoveMode=function(t,e,a,i,s,r,o){return!t||(this._player.getDir()!==_.UP&&this._player.getDir()!==_.DOWN||!r)&&(this._player.getDir()!==_.LEFT&&this._player.getDir()!==_.RIGHT||r)?this._objectCanMoveTo(t,i,o)?P.MODE_X:this._objectCanMoveTo(t,s,o)?P.MODE_Y:P.UNDECIDED:this._objectCanMoveTo(t,s,o)?P.MODE_Y:this._objectCanMoveTo(t,i,o)?P.MODE_X:P.UNDECIDED},t.prototype._getThirdCandidate=function(t,e,a,i,s){var r,o=i===N.CHASE_PLAYER?1:i===N.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new l(a.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(a.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r}if(n.y!==_.y){if(r=new l(_.x+1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x-1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x+1*o,_.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x-1*o,_.y),this._objectCanMoveTo(t,r,s))return r}return null},t.prototype._getRandomMoveCoord=function(t,e,a){for(var i=e.getPartsCoord(),s=i.clone(),r=this._wwaData.isOldMove?G.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:G.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=[-1,1,0,0,-1,-1,1,1],_=Math.floor(Math.random()*n.length);if(s.x=i.x+n[_],s.y=i.y+[0,0,1,-1,1,-1,1,-1][_],this._objectCanMoveTo(t,s,a))return s}return i},t.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},t.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][G.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===i&&!this.isOldMap()||r===G.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},t.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)))},t.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+G.H_PARTS_NUM_IN_WINDOW-1),i=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+G.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(B.DECISION);for(var o=e;o<=a;o++)for(var _=i;_<=s;_++){var c=this._wwaData.mapObject[_][o];this._wwaData.objectAttribute[c][G.ATR_TYPE]===G.OBJECT_MONSTER&&-1===r.indexOf(c)&&r.push(c)}return this._bottomButtonType===n.BATTLE_REPORT&&dt(R[O.GOTO_WWA]).classList.add("onpress"),0===r.length?(dt(R[O.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},t.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),dt(R[O.GOTO_WWA]).classList.remove("onpress")},t.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Ge.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}},t.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<G.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%G.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)}},t.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case S.GAME:switch(this.userDevice.os){case A.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.12.8\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case A.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.12.8\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case A.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.12.8\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case S.SP:case S.VR:return;case S.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.12.8\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.generatePageAndReserveExecution(t,!1,!0)}},t.prototype._setNextPage=function(){this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._pages.length?this._hideMessageWindow():this._shouldSetNextPage=!0,this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},t.prototype._hideMessageWindow=function(){var t=0;this._player.isReadyToUseItem()&&(t=this._player.useItem());var e=this.getObjectAttributeById(t,G.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,m.OBJECT,this._player.getPosition().getPartsCoord())},t.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},t.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},t.prototype.replaceParts=function(t,e,a,i){void 0===a&&(a=m.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+G.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+G.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===m.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},t.prototype.getYesNoImgCoord=function(){return new l(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},t.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},t.prototype.getPlayerImgCoord=function(){return new l(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},t.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},t.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},t.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},t.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},t.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},t.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},t.prototype.isOldMap=function(){return this._wwaData.isOldMap},t.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},t.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},t.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},t.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},t.prototype.setPlayerStatus=function(t,e,a){if(t===L.ENERGY){if(this._player.setEnergy(e),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a}))return this.gameover(),{isGameOver:!0}}else if(t===L.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===L.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===L.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==L.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},t.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},t.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},t.prototype.setStatusIconCoord=function(t,e){var a=e.x*G.CHIP_SIZE,i=e.y*G.CHIP_SIZE,s=function(t){yt("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(i,"px")};switch(t){case x.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case x.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case x.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case x.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},t.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*G.CHIP_SIZE,a=t.y*G.CHIP_SIZE;return Array.prototype.forEach.call(wt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},t.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},t.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},t.prototype.canInput=function(){return!this._temporaryInputDisable},t.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},t.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},t.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},t.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new l(0,0)))Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+G.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*G.CHIP_SIZE+"px -"+t.y*G.CHIP_SIZE+"px"}))}},t.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},t.prototype.clearFaces=function(){this._faces=[]},t.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},t.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},t.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},t.prototype.setBgmDelay=function(t){this._wwaData.bgmDelayDurationMs=t},t.prototype.initCSSRule=function(){this._styleElm=dt(G.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},t.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",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[Z.MESSAGE_WINDOW]=this._sheet.addRule(e,i),this._stylePos[Z.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[Z.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(i," }"),0),this._stylePos[Z.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},t.prototype.changeStyleRule=function(t,e,a,i){t===J.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=i):t===J.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=i):t===J.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=i):t===J.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=i),this.updateCSSRule()},t.prototype.showMonsterWindow=function(){this._monsterWindow.show()},t.prototype.isClassicMode=function(){return this._isClassicModeEnable},t.prototype.isConsoleOutputMode=function(){return this._useConsole},t.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new p(this,t,e,0,0))},t.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(G.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},t.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,G.USER_VAR_NUM_MAX_VALUE),G.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},t.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<G.USER_VAR_NUM&&(0|t)===t},t.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},t.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},t.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},t.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},t.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},t.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},t.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},t.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},t.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},t.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},t.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");return this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})?(this.gameover(),{isGameOver:!0}):{}},t.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},t.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},t.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},t.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},t.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},t.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},t.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},t.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},t.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},t.prototype._generateShowStrString=function(t,e){var a=this;return t.map((function(t){var i=Number(t);return isNaN(i)?null!==ve(t).match(de)?function(){return Se(t,a.generateTokenValues(e.triggerParts))}:t.replace(/\\n/g,"\n"):function(){return 1===e.version?a._wwaData.userVar[i]:i}}))},t.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},t.prototype.execSetMacro=function(t,e){void 0===t&&(t="");var a=function(t,e){var a=ve(t),i=a.match(le);if(null!==i){var s=Ae(i[2],e),r=Ae(i[4],e);return ge(xt(i[3],s,r),i[1])}var o=a.match(pe);if(null!==o)return s=Ae(o[1],e),r=Ae(o[3],e),ge(xt(o[2],s,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this.generateTokenValues(e.triggerParts)),i=a.assignee,s=a.rawValue;switch(i){case"energy":if(this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(s));break;case"variable":if(isNaN(a.index)||!this.isValidUserVarIndex(a.index))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a.index,this.toAssignableValue(s));break;case"map":this.appearPartsEval(e.triggerParts.position,"".concat(a.x),"".concat(a.y),a.rawValue,m.MAP);break;case"mapObject":this.appearPartsEval(e.triggerParts.position,"".concat(a.x),"".concat(a.y),a.rawValue,m.OBJECT);break;case"item":this.setPlayerGetItem(a.boxIndex1to12,s);break;case"playerDirection":this._player.setDir(s)}return this._player.updateStatusValueBox(),{}},t.prototype.generateTokenValues=function(t){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(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:t.id,partsType:t.type,partsPosition:t.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}},t.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var 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)?m.MAP:m.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)}},t.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))}},t.prototype.setPlayerSpeedIndex=function(t){if(t<G.MIN_SPEED_INDEX||G.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},t.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},t.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},t.prototype.hideStatus=function(t,e){if(t<0||t>k.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(k[t],!e),this._player.updateStatusValueBox()},t.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===m.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(s===m.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,a,r,s)},t.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(wt("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*G.CHIP_SIZE,"px -").concat(t.y*G.CHIP_SIZE,"px")}))},t.prototype._getVirtualPadButton=function(t){if(!_t.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},t.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},t.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},t.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,i;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(i=!1,e){case st.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)&&(i=!0);break;case st.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)&&(i=!0);break;case st.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)&&(i=!0);break;case st.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)&&(i=!0)}if(this._gamePadStore.buttonTrigger(e)&&(i=!0),i&&this.onselectitem(a))return!0}return!1},t.prototype.setGamePadButtonItemTable=function(t,e){var a,i;if(!this._wwaData.gamePadButtonItemTable)for(i in this._wwaData.gamePadButtonItemTable=[],st)a=i,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},t.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?Aa.UNMATCHED_WORLD_NAME:a&&a!==va(this._wwaData.worldName,this._wwaData.worldPassNumber)?Aa.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Aa.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},t.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},t.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},t.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},t.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},t.prototype._loadSystemMessage=function(t){if(this._wwaData.customSystemMessages[t])return this._wwaData.customSystemMessages[t];var e=r[t];if(e.mapdataParams)switch(e.mapdataParams.messageArea){case"message":return""===(a=this._wwaData.message[e.mapdataParams.index])?e.defaultText:a;case"systemMessage":var a;return""===(a=this._wwaData.systemMessage[e.mapdataParams.index])?e.defaultText:a;default:throw new Error("システムエラー: システムメッセージの設定がおかしいようです")}return e.defaultText},t.prototype.resolveSystemMessage=function(t){var e=this,a=this._loadSystemMessage(t);switch(t){case s.ITEM_SELECT_TUTORIAL:return a.replaceAll("%HOW_TO_USE_ITEM%",function(){switch(e.userDevice.device){case S.PC:return"右のボックスを選択する";case S.VR:return"右のボックスをクリックする";case S.SP:return"右のボックスをタップする";case S.GAME:switch(e.userDevice.os){case A.NINTENDO:return"Xボタンを押すか、右のボックスをタップする";case A.PLAY_STATION:return"△ボタンを押す";case A.XBOX:return"Yボタンを押す";default:return"右のボックスを選択する"}default:return"右のボックスを選択する"}}());case s.GAME_SPEED_CHANGED:var i=this._player.getSpeedIndex();return a.replaceAll("%GAME_SPEED_NAME%",F[i]).replaceAll("%HIGH_SPEED_MESSAGE%",this.isBattleSpeedIndexForQuickBattle(i)?"戦闘も速くなります。\n":"").replaceAll("%MAX_SPEED_INDEX%",String(G.MAX_SPEED_INDEX+1)).replaceAll("%GAME_SPEED_INDEX%",String(i+1)).replaceAll("%SPEED_UP_BUTTON%",this.userDevice.os===A.NINTENDO?"+ボタン":"Pキー").replaceAll("%SPEED_DOWN_BUTTON%",this.userDevice.os===A.NINTENDO?"-ボタン":"Iキー");default:return a}},t.prototype.overwriteSystemMessage=function(t,e){this._wwaData.customSystemMessages[t]=e},t}(),oi=!1;function ni(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(wt("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){oi=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(oi)return oi=!1,t.returnValue=e,e}));var t=dt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),a=null!==e&&null!==e.match(/^true$/i);Xe(dt("wwa-wrapper"),t,a);var i=dt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=dt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=dt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),o=null,n="true"===dt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),_=dt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");dt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&n&&(o=function(t){var e=ft(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<G.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)}G.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;dt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(c=!1);var h=dt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),u=!1;null!==h&&h.match(/^true$/i)&&(u=!0);var l=!0,p=dt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,E=dt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==E&&E.match(/^true$/i)&&(d=!0);var f,y,w=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");je()&&null!==w&&w.match(/^true$/i)&&(f=document.getElementsByTagName("head")[0],(y=document.createElement("meta")).setAttribute("name","viewport"),f.appendChild(y),lt(),window.addEventListener("resize",lt));var m,g=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),v=a&&g?yt(g):null,A=!(null===(m=dt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!m.match(/^true$/i));Ba=new ri(i,c,t,u,l,d,s,A,o,_,n,a,v)}}"complete"===document.readyState?setTimeout(ni):window.addEventListener("load",(function(){setTimeout(ni)}))}()}();
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,v,A,S,T,I,O,D,C=this._hash.words,N=u.words,P=l.words,M=n.words,b=_.words,R=c.words,L=h.words;for(A=r=C[0],S=o=C[1],T=p=C[2],I=g=C[3],O=v=C[4],a=0;a<80;a+=1)D=r+t[e+M[a]]|0,D+=a<16?d(o,p,g)+N[0]:a<32?E(o,p,g)+N[1]:a<48?f(o,p,g)+N[2]:a<64?y(o,p,g)+N[3]:w(o,p,g)+N[4],D=(D=m(D|=0,R[a]))+v|0,r=v,v=g,g=m(p,10),p=o,o=D,D=A+t[e+b[a]]|0,D+=a<16?w(S,T,I)+P[0]:a<32?y(S,T,I)+P[1]:a<48?f(S,T,I)+P[2]:a<64?E(S,T,I)+P[3]:d(S,T,I)+P[4],D=(D=m(D|=0,L[a]))+O|0,A=O,O=I,I=m(T,10),T=S,S=D;D=C[1]+p+I|0,C[1]=C[2]+g+O|0,C[2]=C[3]+v+A|0,C[3]=C[4]+r+S|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 y(t,e,a){return t&a|e&~a}function w(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],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+y+c[p-16]}var w=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+w)|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 y=u[(l+4)%5],w=u[(l+1)%5],m=w.high,g=w.low;for(p=y.high^(m<<1|g>>>31),d=y.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var v=1;v<25;v++){var A=(C=a[v]).high,S=C.low,T=_[v];T<32?(p=A<<T|S>>>32-T,d=S<<T|A>>>32-T):(p=S<<T-32|A>>>64-T,d=A<<T-32|S>>>64-T);var I=u[c[v]];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[v=l+5*E],N=u[v],P=u[(l+1)%5+5*E],M=u[(l+2)%5+5*E];C.high=N.high^~P.high&M.high,C.low=N.low^~P.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,y=r.high,w=r.low,m=o.high,g=o.low,v=n.high,A=n.low,S=h.high,T=h.low,I=u.high,O=u.low,D=l.high,C=l.low,N=p,P=d,M=E,b=f,R=y,L=w,x=m,B=g,U=v,W=A,Y=S,F=T,k=I,V=O,G=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,$=Z.low,Q=(q>>>1|$<<31)^(q>>>8|$<<24)^q>>>7,z=($>>>1|q<<31)^($>>>8|q<<24)^($>>>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=Q+ot+((j=z+nt)>>>0<z>>>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&V,dt=N&M^N&R^M&R,Et=P&b^P&L^b&L,ft=(N>>>28|P<<4)^(N<<30|P>>>2)^(N<<25|P>>>7),yt=(P>>>28|N<<4)^(P<<30|N>>>2)^(P<<25|N>>>7),wt=(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],vt=gt.high,At=gt.low,St=G+wt+((ut=H+mt)>>>0<H>>>0?1:0),Tt=yt+Et;G=k,H=V,k=Y,V=F,Y=U,F=W,U=x+(St=(St=(St=St+lt+((ut+=pt)>>>0<pt>>>0?1:0))+vt+((ut+=At)>>>0<At>>>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=N,b=P,N=St+(ft+dt+(Tt>>>0<yt>>>0?1:0))+((P=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=i.low=d+P,i.high=p+N+(d>>>0<P>>>0?1:0),f=s.low=f+b,s.high=E+M+(f>>>0<b>>>0?1:0),w=r.low=w+L,r.high=y+R+(w>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),A=n.low=A+W,n.high=v+U+(A>>>0<W>>>0?1:0),T=h.low=T+F,h.high=S+Y+(T>>>0<F>>>0?1:0),O=u.low=O+V,u.high=I+k+(O>>>0<V>>>0?1:0),C=l.low=C+H,l.high=D+G+(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=function(){return t=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},t.apply(this,arguments)},e=Object.freeze({CONFIRM_LOAD_SOUND:{code:1,defaultText:"効果音・BGMデータをロードしますか?",mapdataParams:{messageArea:"systemMessage",index:2}},NO_MONEY:{code:101,defaultText:"所持金がたりない。",mapdataParams:{messageArea:"message",index:6}},NO_ITEM:{code:201,mapdataParams:{messageArea:"message",index:7},defaultText:"アイテムを持っていない。"},ITEM_BOX_FULL:{code:202,defaultText:"これ以上、アイテムを持てません。",mapdataParams:{messageArea:"systemMessage",index:1}},ITEM_SELECT_TUTORIAL:{code:203,defaultText:"このアイテムは%HOW_TO_USE_ITEM%ことで使用できます。\n使用できるアイテムは色枠で囲まれます。",mapdataParams:{messageArea:"systemMessage",index:0}},CONFIRM_USE_ITEM:{code:204,defaultText:"このアイテムを使用します。\nよろしいですか?",mapdataParams:{messageArea:"message",index:8}},CANNOT_DAMAGE_MONSTER:{code:301,defaultText:"相手の防御能力が高すぎる!"},CONFIRM_ENTER_URL_GATE:{code:401,defaultText:"他のページにリンクします。\nよろしいですか?",mapdataParams:{messageArea:"message",index:5}},GAME_SPEED_CHANGED:{code:501,defaultText:"移動速度を【%GAME_SPEED_NAME%】に切り替えました。\n%HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)\n速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。"},GAME_SPEED_CHANGE_DISABLED:{code:502,defaultText:"ここでは移動速度を\n変更できません。"}}),i=Object.keys(e),s=i.reduce((function(e,a){var i;return t(t({},e),((i={})[a]=a,i))}),{}),r=e;var o,n,_,c=(o=function(t,e){return o=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])},o(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}o(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),h=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}(),u=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 c(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}(h),l=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 p(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?_.RIGHT_UP:this.y===t.y?_.RIGHT:_.RIGHT_DOWN:this.x===t.x?this.y>t.y?_.UP:this.y===t.y?_.NO_DIRECTION:_.DOWN:this.y>t.y?_.LEFT_UP:this.y===t.y?_.LEFT:_.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),p=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 l(e,a),this._offsetCoord=new l(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/(V.H_PARTS_NUM_IN_WINDOW-1))*(V.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(V.V_PARTS_NUM_IN_WINDOW-1))*(V.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+g[e],a.y+v[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+g[e]*a,n=this._offsetCoord.y+v[e]*i;if(o<0){var _=Math.floor(Math.abs(o)/V.CHIP_SIZE);s-=_,o=(o+_*V.CHIP_SIZE)%V.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/V.CHIP_SIZE);r-=c,n=(n+c*V.CHIP_SIZE)%V.CHIP_SIZE}return o>=V.CHIP_SIZE&&(s+=Math.floor(o/V.CHIP_SIZE),o=(o+V.CHIP_SIZE)%V.CHIP_SIZE),n>=V.CHIP_SIZE&&(r+=Math.floor(n/V.CHIP_SIZE),n=(n+V.CHIP_SIZE)%V.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+V.H_PARTS_NUM_IN_WINDOW-r&&a.y<=s&&s<a.y+V.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===V.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===V.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),d=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},E=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"}(n||(n={})),function(t){t[t.UNUSED=0]="UNUSED",t[t.LEFT=4]="LEFT",t[t.RIGHT=6]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=8]="UP",t[t.LEFT_DOWN=1]="LEFT_DOWN",t[t.LEFT_UP=7]="LEFT_UP",t[t.RIGHT_DOWN=3]="RIGHT_DOWN",t[t.RIGHT_UP=9]="RIGHT_UP",t[t.NO_DIRECTION=5]="NO_DIRECTION"}(_||(_={}));var f,y,w,m,g=[0,-1,0,1,-1,0,1,-1,0,1],v=[0,1,1,1,0,0,0,-1,-1,-1];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(f||(f={})),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"}(y||(y={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(w||(w={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(m||(m={}));var A,S,T,I,O,D,C,N,P,M=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?A.XBOX:t.match(/windows/i)?A.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?A.IOS:A.MACINTOSH:t.match(/iphone|ipad|ipod/i)?A.IOS:t.match(/oculus/i)?A.OCULUS:t.match(/android/i)?A.ANDROID:t.match(/nintendo/i)?A.NINTENDO:t.match(/playstation/i)?A.PLAY_STATION:t.match(/linux/i)?A.LINUX:A.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?T.CHROME:t.match(/firefox/i)?T.FIREFOX:t.match(/safari/i)?T.SAFARI:T.OTHERS},t.prototype.getDevice=function(){switch(this.os){case A.WINDOWS:case A.MACINTOSH:case A.LINUX:return S.PC;case A.IOS:case A.ANDROID:return S.SP;case A.OCULUS:return S.VR;case A.NINTENDO:case A.PLAY_STATION:case A.XBOX:return S.GAME}return S.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"}(A||(A={})),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"}(S||(S={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(T||(T={})),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"}(I||(I={})),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"}(O||(O={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(D||(D={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(C||(C={})),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"}(N||(N={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(P||(P={}));var b,R=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MONEY=37]="SET_MONEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.MAP2=61]="MAP2",t[t.SHOW_STR2=62]="SHOW_STR2",t[t.CONSOLE_LOG2=63]="CONSOLE_LOG2",t[t.DELAYBGM=64]="DELAYBGM",t[t.SYSMSG=65]="SYSMSG",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE",t[t.LEGACY_IF=10050]="LEGACY_IF"}(b||(b={}));var L,x,B,U={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$map2:61,$show_str2:62,$console_log2:63,$delaybgm:64,$sysmsg:65,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(L||(L={})),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"}(x||(x={})),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"}(B||(B={}));var W,Y=[1,2,5,8,10,20],F=["超低速","低速","準低速","中速","高速","超高速"],k=["energy","strength","defence","gold"],V=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=Y.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[Y.length-2,Y.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}(),G=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}(),H=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}(),K=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"}(W||(W={}));var j,X,J,Z,q,$,Q,z=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],tt=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(j||(j={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(X||(X={})),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"}(J||(J={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(Z||(Z={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(q||(q={})),function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}($||($={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_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"}(Q||(Q={}));var et,at,it=function(){function t(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),this._keyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyState=new Array(t.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(t.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1,this._keyState[e]=!1,this._prevKeyState[e]=!1,this._prevKeyStateOnControllable[e]=!1,this._keyInputContinueFrameNum[e]=0}return t.prototype.checkHitKey=function(t){var e=this.getKeyState(t);return e===$.KEYDOWN||e===$.KEYPRESS},t.prototype.getKeyState=function(t){return this._prevKeyState[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForControllPlayer=function(t){return this._prevKeyStateOnControllable[t]?this._keyState[t]?$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.getKeyStateForMessageCheck=function(t){return this._prevKeyState[t]?this._keyState[t]?this._keyInputContinueFrameNum[t]>=V.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?$.KEYPRESS_MESSAGECHANGE:$.KEYPRESS:$.KEYUP:this._keyState[t]?$.KEYDOWN:$.NONE},t.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},t.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},t.prototype.update=function(){var e;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),e=0;e<t.KEY_BUFFER_MAX;e++)this._keyState[e]&&this._keyInputContinueFrameNum[e]++},t.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},t.prototype.allClear=function(){var e;for(this._nextKeyState=new Array(t.KEY_BUFFER_MAX),e=0;e<t.KEY_BUFFER_MAX;e++)this._nextKeyState[e]=!1},t.KEY_BUFFER_MAX=256,t}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(et||(et={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(at||(at={}));var st,rt,ot=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())===et.MOUSEDOWN||e===et.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?et.NONE:this._prevMouseState?this._mouseState?et.MOUSEPRESS:et.MOUSEUP:this._mouseState?et.MOUSEDOWN:et.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?et.NONE:this._prevMouseStateOnControllable?this._mouseState?et.MOUSEPRESS:et.MOUSEUP:this._mouseState?et.MOUSEDOWN:et.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===at.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"}(st||(st={})),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"}(rt||(rt={}));var nt=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 st.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[rt.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[rt.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_UP))return!0;break;case st.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[rt.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[rt.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_DOWN))return!0;break;case st.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[rt.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[rt.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.BUTTON_CROSS_KEY_LEFT))return!0;break;case st.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[rt.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[rt.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(rt.AXES_CROSS_KEY)||this.buttonPressed(st.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}(),_t=["BUTTON_ENTER","BUTTON_ESC","BUTTON_SIDEBAR","BUTTON_FAST","BUTTON_SLOW","BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ct=["BUTTON_LEFT","BUTTON_UP","BUTTON_RIGHT","BUTTON_DOWN"],ht=new Set(ct),ut=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;ct.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 ht.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 lt(){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 pt,dt=function(t){return document.getElementById(t)},Et=function(t){return document.getElementsByTagName(t)},ft=function(t){return document.querySelector(t)},yt=function(t){return document.querySelector(t)},wt=function(t){return document.querySelectorAll(t)},mt=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-dt("wwa-wrapper").offsetLeft+s,i=e-dt("wwa-wrapper").offsetTop+r,new l(a,i)},gt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},vt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=vt(t[a])+"/";return e}return t+""},At=function(t){return t.split("").reverse().join("")},St=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,V.CHIP_SIZE*e,V.CHIP_SIZE*a,V.CHIP_SIZE,V.CHIP_SIZE,i,s,V.CHIP_SIZE,V.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}(),Tt=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 St(V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new St(V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],s=0;s<2;s++)this._objectCanvases[s]=new St(V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=i,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new l(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,V.MAP_WINDOW_WIDTH-V.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,V.MAP_WINDOW_HEIGHT-V.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,V.MAP_WINDOW_WIDTH-V.CHIP_SIZE,V.MAP_WINDOW_HEIGHT-V.CHIP_SIZE);for(var t=1;t<V.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,V.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,V.CHIP_SIZE*t,V.MAP_WINDOW_HEIGHT-V.CHIP_SIZE);for(t=1;t<V.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,V.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,V.MAP_WINDOW_WIDTH-V.CHIP_SIZE,V.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 St(V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<V.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<V.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,s.x,s.y,o*V.CHIP_SIZE,r*V.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-1),V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE,0,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-1),V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,V.CHIP_SIZE,V.CHIP_SIZE,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-2),0,V.CHIP_SIZE,V.CHIP_SIZE,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-1),V.CHIP_SIZE,V.CHIP_SIZE,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-2),V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-1),V.CHIP_SIZE,V.CHIP_SIZE,V.CHIP_SIZE*(V.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.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,V.CHIP_SIZE*t,V.CHIP_SIZE*e,V.CHIP_SIZE,V.CHIP_SIZE,a,i,V.CHIP_SIZE,V.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,V.CHIP_SIZE*t,V.CHIP_SIZE*e,V.CHIP_SIZE*a,V.CHIP_SIZE*i,s,r,V.CHIP_SIZE*a,V.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+V.CHIP_SIZE-s);r>=V.CHIP_SIZE||this._ctx.drawImage(this._image,V.CHIP_SIZE*t,V.CHIP_SIZE*e,V.CHIP_SIZE,V.CHIP_SIZE-r,a,i,V.CHIP_SIZE,V.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));_>=V.CHIP_SIZE||t.ctx.drawImage(a._image,V.CHIP_SIZE*i,V.CHIP_SIZE*s+_,V.CHIP_SIZE,V.CHIP_SIZE-_,r,o+_,V.CHIP_SIZE,V.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,i,s){this.copyCanvas(this._backCanvas,(function(t,e){return t+V.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+V.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,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.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,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.H_PARTS_NUM_IN_WINDOW,0,0,V.CHIP_SIZE*V.V_PARTS_NUM_IN_WINDOW,V.CHIP_SIZE*V.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>=V.CHIP_SIZE||this._ctx.drawImage(this._image,V.CHIP_SIZE*t,V.CHIP_SIZE*e+r,V.CHIP_SIZE,V.CHIP_SIZE-r,a,i+r,V.CHIP_SIZE,V.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}(),It=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=Y[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(V.H_PARTS_NUM_IN_WINDOW-1),e*(V.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===V.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===V.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}(),Ot=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)}}(),Dt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),Ct=function(t){function e(e){return t.call(this,e)||this}return Ot(e,t),e}(Dt);!function(t){function e(e){return t.call(this,e)||this}Ot(e,t)}(Dt);!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"}(pt||(pt={}));var Nt=function(t){function e(e,a,i,s,r,o,n){var c=t.call(this,a)||this;c.itemTransitioningClassName="item-transitioning",c.overwittenItemClassName="item-overwritten",c.overwittenItemSelector=".".concat(c.overwittenItemClassName),c.itemEffectStartTimers=new Array(V.ITEMBOX_SIZE),c._status=s,c._equipStatus=new h(0,0),c._itemBox=new Array(V.ITEMBOX_SIZE),c._itemBoxElement=new Array(V.ITEMBOX_SIZE),c._itemUsingEvent=new Array(V.ITEMBOX_SIZE);for(var u=0;u<c._itemBox.length;u++)c._itemBox[u]=0,c._itemBoxElement[u]=yt("#item"+u+">.item-disp");return c.updateItemBox(),c._energyMax=r,c._dir=_.DOWN,c._isMovingImage=!1,c._wwa=e,c._state=pt.CONTROLLABLE,c._camera=i,c._isPartsEventExecuted=!1,c._energyValueElement=yt("#disp-energy>.status-value-box"),c._strengthValueElement=yt("#disp-strength>.status-value-box"),c._defenceValueElement=yt("#disp-defence>.status-value-box"),c._goldValueElement=yt("#disp-gold>.status-value-box"),c._isReadyToUseItem=!1,c._isClickableItemGot=!1,c._moves=o,c._frameCount=0,c._moveMacroWaitingRemainMoves=0,c._moveObjectAutoExecTimer=0,c.updateStatusValueBox(),c._partsAppeared=!1,c._afterMoveMacroFlag=!1,c._isPreparedForLookingAround=!0,c._lookingAroundTimer=V.PLAYER_LOOKING_AROUND_START_FRAME,c._speedIndex=n,c._messageDelayFrameCount=0,c}return Ot(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===pt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=pt.CONTROLLABLE)}else if(this._state===pt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,Y[this._speedIndex],Y[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=pt.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,Y[this._speedIndex],Y[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=pt.CAMERA_MOVING}catch(t){this._state=pt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===V.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=pt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),V.ATR_TYPE)!==V.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)!==V.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===V.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,V.ATR_MODE)===V.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===V.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,V.ATR_NUMBER)===V.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,V.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==pt.MOVING||this._state==pt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==V.H_PARTS_NUM_IN_WINDOW-1&&this._dir===_.RIGHT||e.x===t.x&&this._dir===_.LEFT||e.y-t.y==V.V_PARTS_NUM_IN_WINDOW-1&&this._dir===_.DOWN||e.y===t.y&&this._dir===_.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==V.H_PARTS_NUM_IN_WINDOW-1&&this._dir===_.LEFT||e.x===t.x&&this._dir===_.RIGHT||e.y-t.y==V.V_PARTS_NUM_IN_WINDOW-1&&this._dir===_.UP||e.y===t.y&&this._dir===_.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===pt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==V.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==V.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===pt.LOCALGATE_JUMPED||this._state===pt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=pt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===pt.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!==pt.MESSAGE_WAITING&&this._state!==pt.LOCALGATE_JUMPED_WITH_MESSAGE||(this._state===pt.MESSAGE_WAITING?this._state=pt.CONTROLLABLE:this._state===pt.LOCALGATE_JUMPED_WITH_MESSAGE&&(this._state=pt.LOCALGATE_JUMPED),this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=V.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=pt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===pt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===pt.ESTIMATE_WINDOW_WAITING&&(this._state=pt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=pt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===pt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===pt.PASSWORD_WINDOW_WAITING&&(this._state=pt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===m.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===m.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==pt.LOCALGATE_JUMPED&&this._state!==pt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===pt.LOCALGATE_JUMPED?pt.CONTROLLABLE:pt.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===pt.MESSAGE_WAITING?pt.LOCALGATE_JUMPED_WITH_MESSAGE:pt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=V.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=_.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(_.DOWN).hasLocalGate()?this._dir=_.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(_.UP).hasLocalGate()?this._dir=_.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(_.RIGHT).hasLocalGate()?this._dir=_.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(_.LEFT).hasLocalGate()?this._dir=_.RIGHT:this._dir=_.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=V.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=pt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=V.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=_.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=V.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 h(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new h(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=ft("#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=-_*V.DEFAULT_FRAME_INTERVAL/V.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)}),V.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,V.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((s=this._getBlankItemPos())===V.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,V.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,V.ATR_NUMBER)){if((r=this._getBlankItemPos())===V.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 l(V.MAP_WINDOW_WIDTH+(s-1)%3*V.CHIP_SIZE,V.ITEMBOX_TOP_Y+Math.floor((s-1)/3)*V.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,i=yt("#item"+(t-1)+">.item-click-border"),r=this._wwa.getObjectAttributeById(e,V.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&r!==w.NORMAL){var o=this._wwa.resolveSystemMessage(s.ITEM_SELECT_TUTORIAL);this._isClickableItemGot||("BLANK"!==o&&this._wwa.generatePageAndReserveExecution(o,!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 V.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new h(0,0);for(t=0;t<V.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],V.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],V.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<V.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,V.ATR_MODE)!==w.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,V.ATR_MODE)!==w.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=dt("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),V.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==V.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],V.ATR_MODE)!==w.NORMAL&&((e=yt("#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<V.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],V.ATR_MODE)!==w.NORMAL&&((e=yt("#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<=V.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=V.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=pt.BATTLE},e.prototype.isFighting=function(){return this._state===pt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===V.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===V.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>V.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(B.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=V.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(B.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,V.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new u(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(m.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(m.OBJECT,0,this._enemy.position),this._wwa.reserveAppearPartsInNextFrame(this._enemy.position,y.OBJECT,this._enemy.partsID),this._state=pt.CONTROLLABLE,this._wwa.generatePageAndReserveExecution(this._enemy.message,!1,!1,this._enemy.partsID,m.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess();var a=this._wwa.resolveSystemMessage(s.CANNOT_DAMAGE_MONSTER);"BLANK"!==a&&this._wwa.generatePageAndReserveExecution(a,!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=pt.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,V.ATR_STRING),this._wwa.reserveAppearPartsInNextFrame(this._position.getPartsCoord(),y.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)*V.CHIP_SIZE+e.x-s.x+V.CHIP_SIZE/2,o=(t.y-i.y)*V.CHIP_SIZE+e.y-s.y+V.CHIP_SIZE/2;return new l(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=V.CHIP_SIZE/Y[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(V.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(V.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<V.MIN_SPEED_INDEX||V.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(Ct),Pt=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}(),Mt=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,Y[t],Y[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}(),bt=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 Mt(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(m.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(m.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 Rt(t,e,a){if(void 0===a&&(a=0),"boolean"==typeof t)return t;var i=Lt(t.left,e,a),s=Lt(t.right,e,a);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,i,s)}function Lt(t,e,a){switch(void 0===a&&(a=0),t.type){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return e.userVars[t.index];case"MAP":return t.y<0||t.y>=e.map.length||t.x<0||t.x>=e.map[t.y].length?0:e.map[t.y][t.x];case"OBJECT":return t.y<0||t.y>=e.mapObject.length||t.x<0||t.x>=e.mapObject[t.y].length?0:e.mapObject[t.y][t.x];case"ITEM":return t.boxIndex1To12<1||t.boxIndex1To12>12?0:e.itemBox[t.boxIndex1To12-1];case"ITEM_COUNT_ALL":return e.itemBox.filter((function(t){return 0!==t})).length;case"NUMBER":return t.rawValue;case"TIME":return e.playTime;case"X":return e.partsPosition.x;case"Y":return e.partsPosition.y;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"PDIR":return e.playerDirection;case"ID":return e.partsId;case"TYPE":return e.partsType;case"RAND":return Math.floor(Math.random()*Lt(t.argument,e));case"ITEM_COUNT":return e.itemBox.filter((function(a){return a===Lt(t.argument,e)})).length;default:return a}}function xt(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 Bt="-?\\d+",Ut="v\\[".concat(Bt,"\\]"),Wt="v\\[(".concat(Bt,")\\]"),Yt="m\\[".concat(Bt,"\\]\\[").concat(Bt,"\\]"),Ft="m\\[(".concat(Bt,")\\]\\[(").concat(Bt,")\\]"),kt="o\\[".concat(Bt,"\\]\\[").concat(Bt,"\\]"),Vt="o\\[(".concat(Bt,")\\]\\[(").concat(Bt,")\\]"),Gt="ITEM\\[".concat(Bt,"\\]"),Ht="ITEM\\[(".concat(Bt,")\\]"),Kt="".concat(Ut,"|").concat(Yt,"|").concat(kt,"|").concat(Gt),jt="HP|HPMAX|AT|DF|GD|STEP|PDIR",Xt="".concat(Kt,"|").concat(Yt,"|").concat(kt,"|").concat(Gt,"|").concat(jt),Jt="".concat(Bt,"|").concat(Kt,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|TIME|X|Y|PX|PY|ID|TYPE|ITEM_COUNT_ALL","|").concat(jt),Zt="RAND\\((?:".concat(Jt,")\\)"),qt="RAND\\((".concat(Jt,")\\)"),$t="ITEM_COUNT\\((?:".concat(Jt,")\\)"),Qt="ITEM_COUNT\\((".concat(Jt,")\\)"),zt="".concat(Zt,"|").concat($t),te="".concat(Jt,"|").concat(zt),ee="\\+|\\-|\\*|\\/|%",ae="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ie="^\\(",se="\\)$",re=new RegExp("^".concat(Bt,"$")),oe=new RegExp("^".concat(Wt,"$")),ne=new RegExp("^".concat(Ft,"$")),_e=new RegExp("^".concat(Vt,"$")),ce=new RegExp("^".concat(Ht,"$")),he=new RegExp("^".concat(qt,"$")),ue=new RegExp("".concat(Qt,"$")),le=new RegExp("".concat(ie,"(").concat(Xt,")").concat("=","(").concat(te,")(").concat(ee,")(").concat(te,")").concat(se)),pe=new RegExp("".concat(ie,"(").concat(Xt,")(").concat(ae,")(").concat(te,")").concat(se)),de=new RegExp("^(".concat(te,")(?:(").concat(ee,")(").concat(te,"))?$")),Ee=new RegExp("".concat(ie,"(").concat(te,")(").concat(">|<|<=|>=|==|!=",")(").concat(te,")").concat(se));function fe(t){return"RAND"!==t.type&&"ITEM_COUNT"!==t.type}function ye(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"X":case"Y":case"PX":case"PY":case"PDIR":case"ID":case"TYPE":case"ITEM_COUNT_ALL":return{type:t};default:var e=t.match(oe);if(e)return null===(r=we(e))?null:{type:"VARIABLE",index:r};var a=t.match(ne);if(a)return null===(i=me(a))?null:{type:"MAP",x:i[0],y:i[1]};var i,s=t.match(_e);if(s)return null===(i=me(s))?null:{type:"OBJECT",x:i[0],y:i[1]};var r,o=t.match(ce);if(o)return null===(r=we(o))?null:{type:"ITEM",boxIndex1To12:r};if(t.match(re)){var n=parseInt(t,10);return null===n||isNaN(n)?null:{type:"NUMBER",rawValue:n}}var _=t.match(he);if(_)return null!==(c=_.length>=2?ye(_[1]):null)&&fe(c)?{type:"RAND",argument:c}:null;var c,h=t.match(ue);return h&&(null!==(c=h.length>=2?ye(h[1]):null)&&fe(c))?{type:"ITEM_COUNT",argument:c}:null}}function we(t){var e=t.length>=2?Number(t[1]):null;return null===e||isNaN(e)?null:e}function me(t){if(t.length<3)return null;var e=Number(t[1]),a=Number(t[2]);return isNaN(e)||isNaN(a)?null:[e,a]}function ge(t,e){var a;switch(null===(a=ye(e))||void 0===a?void 0:a.type){case"VARIABLE":var i=e.match(/^v\[(\d+)\]$/),s=Number(i[1]);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:"variable",index:s,rawValue:t};case"MAP":var r=e.match(/^m\[(\d+)\]\[(\d+)\]$/),o=Number(r[1]),n=Number(r[2]);if(null===o||null===n||isNaN(o)||isNaN(n))throw new Error("背景パーツの添字のパースに失敗しました");return{assignee:"map",x:o,y:n,rawValue:t};case"OBJECT":var _=e.match(/^o\[(\d+)\]\[(\d+)\]$/);o=Number(_[1]),n=Number(_[2]);if(null===o||null===n||isNaN(o)||isNaN(n))throw new Error("物体パーツの添字のパースに失敗しました");return{assignee:"mapObject",x:o,y:n,rawValue:t};case"ITEM":var c=e.match(/^ITEM\[(\d+)\]$/),h=Number(c[1]);if(null===h||isNaN(h))throw new Error("アイテムの添字のパースに失敗しました");return{assignee:"item",boxIndex1to12:h,rawValue:t};case"ITEM_COUNT_ALL":case"ITEM_COUNT":throw new Error("左辺値に所持アイテム数は入れられません");case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":return{assignee:"moveCount",rawValue:t};case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"X":throw new Error("左辺値にパーツX座標は入れられません");case"Y":throw new Error("左辺値にパーツY座標は入れられません");case"ID":throw new Error("左辺値にパーツ番号座標は入れられません");case"TYPE":throw new Error("左辺値にパーツ種別は入れられません");case"PDIR":return{assignee:"playerDirection",rawValue:t};case"RAND":throw new Error("左辺値に乱数は入れられません");default:throw new Error("この文字列から代入操作オブジェクトは生成できません")}}function ve(t){return t.replace(/\s/g,"")}function Ae(t,e,a){return void 0===a&&(a=0),Lt(ye(t),e,a)}function Se(t,e,a){void 0===a&&(a=0);var i=ve(t).match(de);if(null!==i){var s=Ae(i[1],e,a),r=i[3]?Ae(i[3],e,a):void 0,o=i[2];return o&&r?xt(o,s,r):s}throw new Error("マクロ引数のフォーマットを満たしていません: "+t)}function Te(t){var e=ve(t).match(Ee);if(null===e||e.length<=3)console.error("判定式が異常です: ".concat(t));else{var a=ye(e[1]),i=ye(e[3]);if(a&&i)return{left:a,right:i,operator:e[2]};console.error("判定式が異常です: ".concat(t))}}var 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,e,a,i,s,r){this.firstNode=t,this.isLastPage=e,this.showChoice=a,this.isSystemMessage=i,this.scoreOptions=s,this.extraInfo=r},De=function(){},Ce=function(t){function e(e){void 0===e&&(e=[]);var a=t.call(this)||this;return a.branches=e,a}return Ie(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||Rt(i.descriminant,t()))return i.next}},e.prototype.hasElseBranch=function(){return this.branches.filter((function(t){return Boolean(t.elseBranch)})).length>=1},e}(De),Ne=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 Ie(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}(De);function Pe(t){return void 0===t||(t instanceof Ce?t.branches.reduce((function(t,e){return t&&Pe(e.next)}),!0):t instanceof Ne?t.isEmpty()&&Pe(t.next):void 0)}var Me=function(t){return t===b.SHOW_STR||t===b.SHOW_STR2||"text"===t||"normalMacro"===t},be=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[b.IF,b.ELSE_IF,b.ELSE,b.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case b.IMGPLAYER:return this._executeImgPlayerMacro(),{};case b.IMGYESNO:return this._executeImgYesNoMacro(),{};case b.HPMAX:return this._executeHPMaxMacro(),{};case b.SAVE:return this._executeSaveMacro(),{};case b.ITEM:return this._executeItemMacro(),{};case b.DEFAULT:return this._executeDefaultMacro(),{};case b.OLDMAP:return this._executeOldMapMacro(),{};case b.PARTS:return this._executePartsMacro(),{};case b.MOVE:return this._executeMoveMacro(),{};case b.MAP:return this._executeMapMacro(1),{};case b.DIRMAP:return this._executeDirMapMacro(),{};case b.IMGFRAME:return this._executeImgFrameMacro(),{};case b.IMGBOM:return this._executeImgBomMacro(),{};case b.DELPLAYER:return this._executeDelPlayerMacro(),{};case b.FACE:return this._executeFaceMacro(),{};case b.EFFECT:return this._executeEffectMacro(),{};case b.GAMEOVER:return this._executeGameOverMacro(),{};case b.IMGCLICK:return this._executeImgClickMacro(),{};case b.STATUS:return{isGameOver:this._executeStatusMacro().isGameOver};case b.EFFITEM:return this._executeEffItemMacro(),{};case b.COLOR:return this._executeColorMacro(),{};case b.WAIT:return this._executeWaitMacro(),{};case b.SOUND:return this._executeSoundMacro(),{};case b.GAMEPAD_BUTTON:return this._executeGamePadButtonMacro(),{};case b.OLDMOVE:return this._executeOldMoveMacro(),{};case b.JUMPGATE:return this._executeJumpGateMacro(),{};case b.RECPOSITION:return this._executeRecPositionMacro(),{};case b.JUMPRECPOSITION:return this._executeJumpRecPositionMacro(),{};case b.CONSOLE_LOG:return this._executeConsoleLogMacro(1),{};case b.COPY_HP_TO:return this._executeCopyHpToMacro(),{};case b.SET_HP:return{isGameOver:this._executeSetHPMacro().isGameOver};case b.COPY_HPMAX_TO:return this._executeCopyHpMaxToMacro(),{};case b.SET_HPMAX:return this._executeSetHpMaxMacro(),{};case b.COPY_AT_TO:return this._executeCopyAtToMacro(),{};case b.SET_AT:return this._executeSetAtMacro(),{};case b.COPY_DF_TO:return this._executeCopyDfToMacro(),{};case b.SET_DF:return this._executeSetDfMacro(),{};case b.COPY_MONEY_TO:return this._executeCopyMoneyToMacro(),{};case b.SET_MONEY:return this._executeSetMoneyMacro(),{};case b.COPY_STEP_COUNT_TO:return this._executeSetStepCountMacro(),{};case b.VAR_SET_VAL:return this._executeVarSetValMacro(),{};case b.VAR_SET:return this._executeVarSetMacro(),{};case b.VAR_ADD:return this._executeVarAddMacro(),{};case b.VAR_SUB:return this._executeVarSubMacro(),{};case b.VAR_MUL:return this._executeVarMulMacro(),{};case b.VAR_DIV:return this._executeVarDivMacro(),{};case b.VAR_MOD:return this._executeVarModMacro(),{};case b.VAR_SET_RAND:return this._executeVarSetRandMacro(),{};case b.GAME_SPEED:return this._executeGameSpeedMacro(),{};case b.SHOW_STR:case b.SHOW_STR2:case b.IF:return{};case b.LEGACY_IF:return this._executeLegacyIfMacro(),{};case b.ELSE_IF:case b.ELSE:case b.END_IF:return{};case b.SET_SPEED:return this._executeSetSpeedMacro(),{};case b.COPY_TIME_TO:return this._executeCopyTimeToMacro(),{};case b.HIDE_STATUS:return this._executeHideStatusMacro(),{};case b.VAR_MAP:return this._executeVarMapMacro(),{};case b.NO_GAMEOVER:return this._executeNoGameOverMacro(),{};case b.SET:return{isGameOver:this._executeSetMacro().isGameOver};case b.MAP2:return this._executeMapMacro(2),{};case b.CONSOLE_LOG2:return this._executeConsoleLogMacro(2),{};case b.DELAYBGM:return this._executeDelayBgmMacro(),{};case b.SYSMSG:return this._executeSysMsgMacro(),{};default:return console.log("不明なマクロIDが実行されました:"+this.macroType),{}}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._evaluateIntValue=function(t,e){void 0===e&&(e=0);var a=this.macroArgs[t];if(""===a)return e;var i=Number(a),s=i>=0?Math.floor(i):Math.ceil(i);return isNaN(s)?Se(a,this._wwa.generateTokenValues({id:this._triggerPartsID,type:this._triggerPartsType,position:this._triggerPartsPosition}),e):s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(t){this._concatEmptyArgs(1);var e=this._evaluateIntValue(0);switch(t){case 1:return void this._wwa.outputUserVar(e);case 2:return void console.log("".concat(this.macroArgs[0]," = ").concat(e))}},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._parseStatusKind(this._evaluateIntValue(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);return this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.speedChangeJudge(t)},t.prototype._executeLegacyIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=0!==this._evaluateIntValue(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this.macroArgs[1],a=this.macroArgs[2],i=this._evaluateIntValue(3,m.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._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerImgCoord(new l(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setYesNoImgCoord(new l(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._evaluateIntValue(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,m.OBJECT),i=this._evaluateIntValue(3);if(a!==m.OBJECT&&a!==m.MAP)throw new Error("パーツ種別が不明です");if(0!==i&&1!==i&&(i=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===m.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._evaluateIntValue(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(t){this._concatEmptyArgs(4);var e=this._evaluateIntValue(0),a=this._evaluateIntValue(3,m.OBJECT);if(e<0)throw new Error("パーツ番号が不正です");if(a===m.OBJECT){if(e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");if(1===t){var i=this.macroArgs[1],s=this.macroArgs[2];this._wwa.appearPartsEval(this._triggerPartsPosition,i,s,e,a)}else if(2===t){var r=this._evaluateIntValue(1),o=this._evaluateIntValue(2);if(isNaN(r)||isNaN(o))throw new Error("出現先座標が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,"".concat(r),"".concat(o),e,a)}},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2,m.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===m.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._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===x.ENERGY||t===x.STRENGTH||t===x.DEFENCE||t===x.GOLD)this._wwa.setStatusIconCoord(t,new l(e,a));else if(t===x.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new l(e,a));else if(t===x.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==x.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new l(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new l(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._evaluateIntValue(0),a=this._evaluateIntValue(1),i=this._evaluateIntValue(2),s=this._evaluateIntValue(3),r=this._evaluateIntValue(4),o=this._evaluateIntValue(5);if(e<0||a<0||i<0||s<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new d(new l(e,a),new l(i,s),new l(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var i,s=this._evaluateIntValue(a);if(s<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((i=this._evaluateIntValue(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new l(s,i))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new l(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new l(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._evaluateIntValue(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");return this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1),a=this._evaluateIntValue(2),i=this._evaluateIntValue(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(2);var t=parseInt(this.macroArgs[0]),e=parseInt(this.macroArgs[1]);this._wwa.playSound(t,e)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._evaluateIntValue(0),e=this._evaluateIntValue(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>V.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._evaluateIntValue(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){return this._wwa.execSetMacro(this.macroArgs[0],{triggerParts:{position:this._triggerPartsPosition,id:this._triggerPartsID,type:this._triggerPartsType}})},t.prototype._executeDelayBgmMacro=function(){this._concatEmptyArgs(1);var t=this._evaluateIntValue(0);this._wwa.setBgmDelay(t)},t.prototype._executeSysMsgMacro=function(){this._concatEmptyArgs(2);var t=this.resolveSystemMessageKeyFromMacroArg(this.macroArgs[0]);if(!t)throw new Error("該当するシステムメッセージの定義がありません");var e=""===this.macroArgs[1]?void 0:this.macroArgs[1].replaceAll("\\n","\n");this._wwa.overwriteSystemMessage(t,e)},t.prototype.resolveSystemMessageKeyFromMacroArg=function(t){return function(t){return i.some((function(e){return e===t}))}(t)?t:function(t){for(var e=0,a=i;e<a.length;e++){var s=a[e];if(r[s].code===t)return s}}(this._evaluateIntValue(0))},t}();var Re,Le=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}(),xe=function(t){function e(e,a,i,s,r,o,n){var _=t.call(this,e,new l(a.x,a.y),i,s,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=V.CHIP_SIZE+"px",_._monsterBox.style.height=V.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 Ie(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}(Le),Be=function(t){function e(e,a,i,s){var r=this;return e.isClassicMode()?((r=t.call(this,e,new l(2*V.CHIP_SIZE,30),7*V.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 l(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 Ie(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}(Le);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Re||(Re={}));var Ue=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(f.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(f.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case S.SP:case S.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?Re.BOTTOM:e?Re.SCORE:a?Re.CENTER:o>=Math.ceil(V.V_PARTS_NUM_IN_WINDOW/2)?Re.TOP:Re.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Re.CENTER?(this._y=V.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Re.TOP?(this._y=Math.max(20,V.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Re.BOTTOM?(this._y=Math.min(V.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*V.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Re.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*V.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()===f.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_YESP_X)*V.CHIP_SIZE+"px -"+e.y*V.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_NO_X)*V.CHIP_SIZE+"px -"+e.y*V.CHIP_SIZE+"px"):this._wwa.getYesNoState()===f.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_YES_X)*V.CHIP_SIZE+"px -"+e.y*V.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_NOP_X)*V.CHIP_SIZE+"px -"+e.y*V.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_YES_X)*V.CHIP_SIZE+"px -"+e.y*V.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+V.IMGRELPOS_YESNO_NO_X)*V.CHIP_SIZE+"px -"+e.y*V.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=G.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=V.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case _.DOWN:this._save_select_id-=2,this.cursor_wait();break;case _.UP:this._save_select_id+=2,this.cursor_wait();break;case _.LEFT:this._save_select_id--,this.cursor_wait();break;case _.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+G.QUICK_SAVE_MAX)%G.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),We=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}(),Ye=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<V.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)i=new We(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<V.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var i=this._wwa.getObjectAttributeById(e[a],V.ATR_X),s=this._wwa.getObjectAttributeById(e[a],V.ATR_Y),r=new l(i,s),o=this._wwa.getObjectAttributeById(e[a],V.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],V.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],V.ATR_DEFENCE),c=new u(o,n,_,0),h=ke(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}(),Fe=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function ke(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 Fe(!0,!1,0);for(;;){if(r++,(a-=i)<=0)return new Fe(!1,!1,o);if(o+=s,r>1e4)return new Fe(!1,!0,0)}}var Ve,Ge=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())}))},He=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Ve||(Ve={}));var Ke=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 Ge(i,void 0,void 0,(function(){var t=this;return He(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=Ve.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===Ve.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===Ve.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 je(){return"ontouchstart"in window&&"ontouchend"in window&&"ontouchmove"in window}function Xe(t,e,a){var i=document.createElement("style");i.type="text/css",i.setAttribute("id",V.WWA_STYLE_TAG_ID),Et("head")[0].appendChild(i),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(V.SCREEN_WIDTH,'" height="').concat(V.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&&(dt("wwa-cover").style.backgroundImage="url(".concat(e,")"),dt("wwa-cover").style.backgroundRepeat="no-repeat",dt("wwa-cover").style.backgroundPosition="0 0")}var Je=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=V.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 _.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case _.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case _.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case _.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=yt(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=dt(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&i.classList.remove("onpress")},t.prototype.openView=function(){this.close();dt(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Ze=a(23);function qe(t){return"^ /".concat(231*t+8310,"P+>A[]")}function $e(t){return(0,Ze.MD5)(t).toString()}var Qe="map",ze="mapObject",ta="systemMessage",ea="userVar",aa={mapAttribute:!0,objectAttribute:!0,message:!0},ia=function(){},sa=function(){function t(){}return t.compress=function(t){var e,a,i={};for(e in t)if(!aa[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 Qe:case ze:var n,_,c,h,u,l,p,d,E,f,y,w,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===(y=E[p])[u]&&(y[u]=[]),(m=y[u]).push(Number(h)));for(w in E)for(u in y=E[w],void 0===d[w]&&(d[w]={}),f=d[w],void 0===i[w]&&(i[w]=[]),_=-1,y)1===(m=y[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,i[w].push(this.getCompressArray(m),c));for(w in d)for(h in p=Number(w),_=-1,f=d[w])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?i[w].push(c,g[0]):i[w].push(c,this.getCompressArray(g));var v=[];for(w in _=-1,i)c=(n=Number(w))-_-1,_=n,v.push(c,i[w]);return this._usingByteFlag&&JSON.stringify(v).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):v;case ta:var A;for(t in i={},e)A=e[t],a[t]!==A&&(i[t]=A);break;case ea: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,y,w,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),v=-1;for(r=0,o=0,_=0,c=0,y=0,p=[],f={},u=[],l=[],s=0;s<m;s++)for(i=0;i<m;i++)(h=t[s][i])!==e[s][i]&&(-1===v&&(v=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new ra(h,y++)),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(w=g.length,v=-1,_=0,o=0;o<w;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===v&&(v=o),_=o);-1===v&&(v=0,_=0)}return[v,g.subarray(v,_+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 Qe:case ze: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 y;for(y in r=-1,l)if(r=s=r+Number(l[y].y)+1,E=l[y].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(y in r=-1,p)if(r=s=r+Number(p[y].x)+1,f=p[y].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 ea: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(V.USER_VAR_NUM),e=0;e<V.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(y=E.length,u=0;u<y;u++)E[u]=E[u]|a[u];r=[];var y,w,m,g,v,A,S=o.length;for(y=s.length,w=0,m=0;w<y;w++){if((n=s[w])>=S)for(g=n-S,v=0;v<g;v++)r[m++]=A;else r[m++]=n;A=n}for(h=0,u=0,l=0,_=0,y=E.length,u=0;u<y;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[ze]=this.getChangedUint8Array(e[ze],t[ze])},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 ia,t}(),ra=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},oa=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=G.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=G.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){dt("cell-load").textContent=H.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}(),na=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)}}(),_a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return na(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}(oa),ca=_a,ha=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)}}(),ua=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return ha(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<G.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<G.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),la=function(){return la=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},la.apply(this,arguments)},pa=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?la(la({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?la(la({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},da=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)}}(),Ea=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<G.QUICK_SAVE_MAX;o++)r[o]=new ca(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=i,r.createDataBase(),r.selectSaveData(),r}return da(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(G.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(G.INDEXEDDB_TABLE_NAME)||i.createObjectStore(G.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(G.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(G.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,i){return{url:location.href,id:t,hash:Ta.checkOriginalMapString,image:e.toDataURL(),data:a,date:i,worldName:Ta.worldName,mapDataRevisionKey:Ta.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),_=sa.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 _=pa(sa.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}(ua),fa=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)}}(),ya=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fa(e,t),e}(oa),wa=ya,ma=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)}}(),ga=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=G.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var i=0;i<G.QUICK_SAVE_MAX;i++)a[i]=new wa(i,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return ma(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%G.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ua);function va(t,e){return(0,Ze.MD5)(t+e).toString()}var Aa,Sa=function(){function t(e,a,i,s,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=va(a,i),this._wwaDBSaveList=new Ea(s,r),this._wwaLogSaveList=new ga,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?I.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?I.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?I.CALL_BY_LOG_QUICK_LOAD:I.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?I.CALL_BY_LOG_QUICK_LOAD:t?I.CALL_BY_PASSWORD_LOAD:I.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?dt("cell-save").textContent=H.EMPTY_SAVE:dt("cell-save").textContent=H.QUICK_SAVE},t}(),Ta=Sa;!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"}(Aa||(Aa={}));var Ia,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())}))},Da=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Ca=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.delayBgmTimeoutId=null,this.load()}return t.prototype.fetchSoundFile=function(){return Oa(this,void 0,void 0,(function(){return Da(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 Oa(this,void 0,void 0,(function(){return Da(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),Oa(this,void 0,void 0,(function(){var e,a,i=this;return Da(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;window.setTimeout((function(){return Oa(e,void 0,void 0,(function(){return Da(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(t){var e=this;void 0===t&&(t=0);var a=this.audioContext.createBufferSource();this.bufferSources.push(a),a.buffer=this.audioBuffer,this.isBgm()&&(a.loop=!0),a.connect(this.audioGain);var i=a.duration;(!isFinite(i)||i<0||"number"!=typeof i)&&(i=0),a.onended=function(){var t=e.bufferSources.indexOf(a);-1!==t&&e.bufferSources.splice(t,1),e.disposeBufferSource(a)},this.delayBgmTimeoutId=window.setTimeout((function(){e.delayBgmTimeoutId=null,a.start()}),t),this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){null!==this.delayBgmTimeoutId&&(window.clearTimeout(this.delayBgmTimeoutId),this.delayBgmTimeoutId=null),this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=B.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isPlaying=function(){return this.hasData()||null!==this.delayBgmTimeoutId},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),Na=function(t,e){for(var a=new Array(t),i=0;i<a.length;i++)a[i]=new Array(e);return a},Pa=function(t){return(t%=256)>=128?t-256:t};function Ma(t,e){var a=function(t){return t[Ia.CHECK]+256*t[Ia.CHECK+1]}(t),i=function(t,e){var a=0;if(t[Ia.VERSION]>=29){for(var i=2;i<e;i++)a+=Pa(t[i])*(i%8+1);a=a%65536&65535}return a}(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"}(Ia||(Ia={}));var ba,Ra,La=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"}(ba||(ba={})),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"}(Ra||(Ra={}));var xa=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Ma(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default",bgmDelayDurationMs:void 0,customSystemMessages:{}}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[Ia.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=Ia.MAPDATA_TOP:this.currentPosition=Ia.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(ba.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(ba.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?La.MAP_ATR_MAX:La.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?La.OBJ_ATR_MAX:La.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(ba.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(ba.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(ba.MAP),this._convertAttributeV2toV3(ba.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,i;if(t==ba.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,i=La.MAP_LOCALGATE;else{if(t!=ba.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,i=La.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][La.ATR_TYPE]===i&&(a[s][La.ATR_JUMP_X]>100&&(a[s][La.ATR_JUMP_X]+=9840),a[s][La.ATR_JUMP_Y]>100&&(a[s][La.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(Ia.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(Ia.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(Ia.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(Ia.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(Ia.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(Ia.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(Ia.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(Ia.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(Ia.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(Ia.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(Ia.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(Ia.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(Ia.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(Ia.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(Ia.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(Ia.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(Ia.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(Ia.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(Ia.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?Ia.ITEMBOX_TOP:Ia.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(La.ITEMBOX_SIZE);for(var e=0;e<La.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,i,s;for(s=Na(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===ba.MAP?Ra.MAP_LOAD:Ra.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===ba.MAP?Ra.MAP_LOAD:Ra.OBJ_LOAD),s},t.prototype._getPartsDataFromBits=function(t,e,a){var i,s,r;for(r=Na(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===ba.MAP?Ra.MAP_ATTR:Ra.OBJ_ATTR),s!==La.ATR_CROP1&&s!==La.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===ba.MAP?Ra.MAP_ATTR:Ra.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,Ra.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var Ba,Ua=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:Ra.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:Ra.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(La.SYSTEM_MESSAGE_NUM);for(e=0;e<La.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=La.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=La.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=La.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=La.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=La.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=La.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=La.DEFAULT_DISABLE_SAVE,t.isOldMap=La.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=La.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=La.IMGPOS_DEFAULT_STATUS_X+La.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=La.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=La.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=La.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=La.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=La.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=La.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=La.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=La.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=La.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=La.DEFAULT_FRAME_COLOR_R,t.frameColorG=La.DEFAULT_FRAME_COLOR_G,t.frameColorB=La.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=La.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=La.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=La.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=La.DEFAULT_STR_COLOR_R,t.fontColorG=La.DEFAULT_STR_COLOR_G,t.fontColorB=La.DEFAULT_STR_COLOR_B,t.statusColorR=La.DEFAULT_STATUS_COLOR_R,t.statusColorG=La.DEFAULT_STATUS_COLOR_G,t.statusColorB=La.DEFAULT_STATUS_COLOR_B,t.moves=La.DEFAULT_MOVES,t.gameSpeedIndex=La.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(La.USER_VAR_NUM);for(e=0;e<La.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t.bgmDelayDurationMs=0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Wa=function(){},Ya=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)}}(),Fa=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())}))},ka=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Va=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return Ya(e,t),e.fetch=function(t){return Fa(this,void 0,void 0,(function(){return ka(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 Fa(this,void 0,void 0,(function(){var t;return ka(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}(Wa),Ga=a(106),Ha=a.n(Ga),Ka=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)}}(),ja=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())}))},Xa=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},Ja=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return Ka(e,t),e.prototype.request=function(){return ja(this,void 0,void 0,(function(){var t=this;return Xa(this,(function(e){return[2,new Promise((function(e,a){Ha().readFile(t.fileName,(function(t,i){t&&a(t),e(i.buffer)}))}))]}))}))},e}(Wa),Za=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())}))},qa=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},$a=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return Za(this,void 0,void 0,(function(){var t,e,a,i,s,r;return qa(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new Va(n):new Ja(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 xa(i,s,this.eventEmitter).extractAllData();return new Ua(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),Qa=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}(),za=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())}))},ti=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},ei=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())}))},ai=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(n){return function(_){return function(n){if(a)throw new TypeError("Generator is already executing.");for(;r&&(r=0,n[0]&&(o=0)),o;)try{if(a=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=e.call(t,o)}catch(t){n=[6,t],i=0}finally{a=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,_])}}},ii=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 si(t,e,a){var i=new K;return i.current=t,i.total=e,i.stage=a,i}var ri=function(){function t(t,e,a,i,r,o,c,h,d,E,y,w,m){void 0===e&&(e=!1),void 0===c&&(c=""),void 0===h&&(h=!1),void 0===d&&(d=null),void 0===w&&(w=!1),void 0===m&&(m=null);var g,v=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return v._main()},this.soundCheckCaller=function(){return v.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return v._keyStore.checkHitKey(Q.KEY_ESC)||v._keyStore.checkHitKey(Q.KEY_SHIFT)||v._keyStore.checkHitKey(Q.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new Qa(dt("wwa-wrapper")),window.addEventListener("click",(function(t){v._isActive=!1})),dt("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),v._isActive=!0})),this._isActive=!0,null===a?(this._hasTitleImg=!1,this._cvsCover=dt("progress-panel"),(g=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?dt("version").textContent="WWA Wing Ver.3.12.9":this._setLoadingMessage(g,0)}catch(t){}this._dumpElement=d;var D=window.AudioContext||window.webkitAudioContext;D&&(this.audioContext=new D,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var C=new Audio;"no"!==C.canPlayType("audio/mpeg")&&""!==C.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new M,this._isURLGateEnable=e,this._isClassicModeEnable=i,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new u(0,0,0,0),c?"/"!==c[c.length-1]&&(c+="/"):c="./audio/",this._audioDirectory=c,this._bottomButtonType=o?n.GOTO_WWA:n.BATTLE_REPORT;var N=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===S.GAME){if(this.userDevice.os===A.NINTENDO)V.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=n.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===T.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case S.VR:case S.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(dt("cell-save").textContent=H.QUICK_SAVE,this._usePassword?dt("cell-load").textContent=H.PASSWORD:dt("cell-load").textContent=H.EMPTY_LOAD,this._bottomButtonType){case n.GOTO_WWA:dt("cell-gotowwa").textContent=H.GOTO_WWA;break;case n.BATTLE_REPORT:dt("cell-gotowwa").textContent=H.BATTLE_REPORT;break;case n.GAME_END:dt("cell-gotowwa").textContent=H.GAME_END}this._loadHandler=function(t){v._wwaData=t,v._wwaData.isItemEffectEnabled=r;try{v._hasTitleImg?dt("version").textContent+=" (Map data Ver. "+Math.floor(v._wwaData.version/10)+"."+ +v._wwaData.version%10+")":v._setLoadingMessage(g,1)}catch(t){}var e=dt("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");e.pop(),e.push(v._wwaData.mapCGName),v._wwaData.mapCGName=e.join("/"),v._startTime=(new Date).getTime(),v._restartData=JSON.parse(JSON.stringify(v._wwaData)),v.checkOriginalMapString=v._generateMapDataHash(v._restartData),v.initCSSRule(),v._setProgressBar(si(0,4,W.GAME_INIT)),v._setLoadingMessage(g,2);var a=new Image;a.src=v._wwaData.mapCGName,a.addEventListener("error",(function(){v._setErrorMessage("画像ファイル「"+v._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",g)}));var i=v._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),o=function(t){t.style.backgroundImage="url("+i+")"};Array.prototype.forEach.call(wt("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(v._wwaData.imgItemboxX*V.CHIP_SIZE,"px -").concat(v._wwaData.imgItemboxY*V.CHIP_SIZE,"px"),t.style.backgroundImage="url("+i+")"})),Array.prototype.forEach.call(wt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+i+")"})),Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+V.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(wt(".item-cell>.item-disp"),o),Array.prototype.forEach.call(wt("div.wide-cell-row>.status-icon"),o),v.setStatusIconCoord(x.ENERGY,new l(v._wwaData.imgStatusEnergyX,v._wwaData.imgStatusEnergyY)),v.setStatusIconCoord(x.STRENGTH,new l(v._wwaData.imgStatusStrengthX,v._wwaData.imgStatusStrengthY)),v.setStatusIconCoord(x.DEFENCE,new l(v._wwaData.imgStatusDefenceX,v._wwaData.imgStatusDefenceY)),v.setStatusIconCoord(x.GOLD,new l(v._wwaData.imgStatusGoldX,v._wwaData.imgStatusGoldY)),v._setProgressBar(si(1,4,W.GAME_INIT)),v._setLoadingMessage(g,3),v._mapIDTableCreate(),v._replaceAllRandomObjects();var n=(new Date).getTime();console.log("Loading Complete!"+(n-N)+"ms"),v._cvs=dt("wwa-map");var c=v._cvs.getContext("2d",{alpha:!1});c.fillStyle="rgba( 255, 255, 255, 0.5)",c.fillRect(0,0,440,440);var d=new p(v,v._wwaData.playerX,v._wwaData.playerY);v._camera=new It(d),v._itemMenu=new Je;var E=new u(v._wwaData.statusEnergy,v._wwaData.statusStrength,v._wwaData.statusDefence,v._wwaData.statusGold);v._player=new Nt(v,d,v._camera,E,v._wwaData.statusEnergyMax,v._wwaData.moves,v._wwaData.gameSpeedIndex),v._objectMovingDataManager=new bt(v,v._player),v._camera.setPlayer(v._player),v._keyStore=new it,v._mouseStore=new ot,w?(v._virtualPadButtonElements={BUTTON_ENTER:dt("wwa-enter-button"),BUTTON_ESC:dt("wwa-esc-button"),BUTTON_FAST:dt("wwa-fast-button"),BUTTON_SLOW:dt("wwa-slow-button"),BUTTON_LEFT:dt("wwa-left-button"),BUTTON_UP:dt("wwa-up-button"),BUTTON_RIGHT:dt("wwa-right-button"),BUTTON_DOWN:dt("wwa-down-button")},v._virtualPadStore=new ut(v._virtualPadButtonElements,je(),dt("wwa-virtualpad-right"),dt("wwa-virtualpad-left"),v._setVirtualPadTouch.bind(v),v._setVirtualPadLeave.bind(v)),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)}(m,(function(){v._virtualPadStore.toggleVisible()}))):(v._virtualPadButtonElements=null,v._virtualPadStore=new ut({})),v._gamePadStore=new nt,v._pages=[],v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._yesNoChoiceCallInfo=I.NONE,v._prevFrameEventExected=!1,v._isLastPage=!1,v._reservedPartsAppearances=[],v._reservedJumpDestination=void 0,v._shouldSetNextPage=!1,v._passwordLoadExecInNextFrame=!1,v._messageWindow=new Ue(v,50,180,340,0,v._wwaData.mapCGName,!1,!0,!1,dt("wwa-wrapper")),v._scoreWindow=new Be(v,new l(50,50),!1,dt("wwa-wrapper")),v._wwaSave=new Ta(Ba,Ba._wwaData.worldName,Ba._wwaData.worldPassNumber,v._checkSaveDataCompatibility.bind(v),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Aa.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Aa.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Aa.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),v._isDisallowLoadOldSave=h,v._messageWindow.setWWASave(v._wwaSave),sa.setRestartData(v._restartData,v._wwaData),v.clearFaces();var T=dt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof T&&(v._useSuspend=!0,T)){var D=sa.getStartWWAData(T);v._restartData!==D&&(v._applyQuickLoad(D),v._wwaSave.resumeStart())}var C=dt("wwa-wrapper").getAttribute("data-wwa-autosave");null!==C&&v._wwaSave.setAutoSaveInterval(0|Number(C));var P=dt("wwa-wrapper").getAttribute("data-wwa-looking-around");if(v._useLookingAround=!(P&&P.match(/false/i)),v._setProgressBar(si(2,4,W.GAME_INIT)),v._setLoadingMessage(g,4),window.addEventListener("keydown",(function(t){if(v._isActive){if(v.userDevice.os===A.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setPressInfo(t.keyCode),t.keyCode!==Q.KEY_F5?v._player.isWaitingMessage()?t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_SPACE||t.preventDefault():v._player.isWaitingPasswordWindow()||t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_1&&t.keyCode!==Q.KEY_2&&t.keyCode!==Q.KEY_3&&t.keyCode!==Q.KEY_A&&t.keyCode!==Q.KEY_C&&t.keyCode!==Q.KEY_D&&t.keyCode!==Q.KEY_E&&t.keyCode!==Q.KEY_M&&t.keyCode!==Q.KEY_N&&t.keyCode!==Q.KEY_Q&&t.keyCode!==Q.KEY_S&&t.keyCode!==Q.KEY_W&&t.keyCode!==Q.KEY_X&&t.keyCode!==Q.KEY_Y&&t.keyCode!==Q.KEY_Z&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_F1&&t.keyCode!==Q.KEY_F2&&t.keyCode!==Q.KEY_F3&&t.keyCode!==Q.KEY_F4&&t.keyCode!==Q.KEY_F6&&t.keyCode!==Q.KEY_F7&&t.keyCode!==Q.KEY_F8&&t.keyCode!==Q.KEY_F12&&t.keyCode!==Q.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(v._isActive){if(v.userDevice.os===A.NINTENDO)return t.preventDefault(),void t.stopPropagation();v._keyStore.setReleaseInfo(t.keyCode),t.keyCode===Q.KEY_F5?t.preventDefault():t.keyCode!==Q.KEY_DOWN&&t.keyCode!==Q.KEY_LEFT&&t.keyCode!==Q.KEY_RIGHT&&t.keyCode!==Q.KEY_UP&&t.keyCode!==Q.KEY_SHIFT&&t.keyCode!==Q.KEY_ENTER&&t.keyCode!==Q.KEY_1&&t.keyCode!==Q.KEY_2&&t.keyCode!==Q.KEY_3&&t.keyCode!==Q.KEY_A&&t.keyCode!==Q.KEY_C&&t.keyCode!==Q.KEY_D&&t.keyCode!==Q.KEY_E&&t.keyCode!==Q.KEY_M&&t.keyCode!==Q.KEY_N&&t.keyCode!==Q.KEY_Q&&t.keyCode!==Q.KEY_S&&t.keyCode!==Q.KEY_W&&t.keyCode!==Q.KEY_X&&t.keyCode!==Q.KEY_Y&&t.keyCode!==Q.KEY_Z&&t.keyCode!==Q.KEY_ESC&&t.keyCode!==Q.KEY_F1&&t.keyCode!==Q.KEY_F3&&t.keyCode!==Q.KEY_F4&&t.keyCode!==Q.KEY_F6&&t.keyCode!==Q.KEY_F7&&t.keyCode!==Q.KEY_F8&&t.keyCode!==Q.KEY_F9&&t.keyCode!==Q.KEY_F12&&t.keyCode!==Q.KEY_SPACE||v._player.isWaitingMessage()||v._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("contextmenu",(function(t){v._keyStore.allClear(),v._mouseStore.clear(),v._virtualPadStore.allClear()})),window.addEventListener("help",(function(t){v._isActive&&t.preventDefault()})),v._mouseControllerElement=dt("wwa-controller"),v._mouseControllerElement.addEventListener("mousedown",(function(t){if(v._isActive&&1===t.which){if(v._mouseStore.getMouseState()!==et.NONE)return void t.preventDefault();var e=mt(t.clientX,t.clientY),a=v._player.getDrawingCenterPosition(),i=e.substract(a),s=Math.abs(i.x),r=Math.abs(i.y),o=void 0,n=!1;if(s<V.CHIP_SIZE&&r<V.CHIP_SIZE){switch(a.x/V.CHIP_SIZE|0){case 0:n=!0,o=_.LEFT;break;case V.H_PARTS_NUM_IN_WINDOW-1:n=!0,o=_.RIGHT}switch(a.y/V.CHIP_SIZE|0){case 0:n=!0,o=_.UP;break;case V.V_PARTS_NUM_IN_WINDOW-1:n=!0,o=_.DOWN}}n||(i.y>0&&r>s?o=_.DOWN:i.y<0&&r>s?o=_.UP:i.x>0&&r<s?o=_.RIGHT:i.x<0&&r<s&&(o=_.LEFT)),v._mouseStore.setPressInfo(o,0)}})),v._mouseControllerElement.addEventListener("mouseleave",(function(t){v._mouseStore.clear()})),v._mouseControllerElement.addEventListener("mouseup",(function(t){v._isActive&&1===t.which&&(v._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(v.audioContext){var M=function(){v.audioContext.createBufferSource().start(0),v._mouseControllerElement.removeEventListener("touchstart",M),M=null};v._mouseControllerElement.addEventListener("touchstart",M)}v._mouseControllerElement.addEventListener("touchstart",(function(t){if(v._isActive)if(v._mouseStore.getMouseState()===et.NONE){for(var e=t.changedTouches,a=e.length,i=0;i<a;i++){var s=e[i],r=mt(s.clientX,s.clientY),o=v._player.getDrawingCenterPosition(),n=r.substract(o),c=Math.abs(n.x),h=Math.abs(n.y),u=void 0,l=!1;if(c<V.CHIP_SIZE&&h<V.CHIP_SIZE){switch(o.x/V.CHIP_SIZE|0){case 0:l=!0,u=_.LEFT;break;case V.H_PARTS_NUM_IN_WINDOW-1:l=!0,u=_.RIGHT}switch(o.y/V.CHIP_SIZE|0){case 0:l=!0,u=_.UP;break;case V.V_PARTS_NUM_IN_WINDOW-1:l=!0,u=_.DOWN}}l||(n.y>0&&h>c?u=_.DOWN:n.y<0&&h>c?u=_.UP:n.x>0&&h<c?u=_.RIGHT:n.x<0&&h<c&&(u=_.LEFT)),v._mouseStore.setPressInfo(u,s.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var b=function(t){if(v._isActive)for(var e=0;e<t.changedTouches.length;e++)if(v._mouseStore.getTouchID()===t.changedTouches[e].identifier){v._mouseStore.setReleaseInfo(),t.preventDefault();break}};v._mouseControllerElement.addEventListener("touchend",b),v._mouseControllerElement.addEventListener("touchcancel",b)}dt("button-load").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.QUICK_LOAD)})),dt("button-save").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.QUICK_SAVE)})),dt("button-restart").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.RESTART_GAME)})),dt("button-gotowwa").addEventListener("click",(function(){(v._player.isControllable()||v._messageWindow.isItemMenuChoice())&&v.onselectbutton(O.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(wt(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){v._displayHelp()}))})),v._frameCoord=new l(V.IMGPOS_DEFAULT_FRAME_X,V.IMGPOS_DEFAULT_YESNO_Y),v._battleEffectCoord=new l(V.IMGPOS_DEFAULT_BATTLE_EFFECT_X,V.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),v._battleEstimateWindow=new Ye(v,v._wwaData.mapCGName,dt("wwa-wrapper")),v._passwordWindow=new Ke(v,dt("wwa-wrapper"),h),v._monsterWindow=new xe(v,new l(50,180),340,60,!1,dt("wwa-wrapper"),v._wwaData.mapCGName),v._setProgressBar(si(3,4,W.GAME_INIT)),v._isLoadedSound=!1,v._temporaryInputDisable=!1,v._paintSkipByDoorOpen=!1,v._clearFacesInNextFrame=!1,v._useConsole=!1,v.wwaCustomEvent("wwa_startup"),v._cgManager=new Tt(c,v._wwaData.mapCGName,v._frameCoord,(function(){v._isSkippedSoundMessage=!0;var t=function(){switch(v.userDevice.device){case S.PC:v.generatePageAndReserveExecution("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case S.SP:v.generatePageAndReserveExecution("ゲームを開始します。\n画面にふれてください。",!1,!0)}},e=v.resolveSystemMessage(s.CONFIRM_LOAD_SOUND);if("ON"===e)return v._isLoadedSound=!0,t(),v._setLoadingMessage(g,W.AUDIO),v.loadSound(),void window.requestAnimationFrame(v.soundCheckCaller);if("OFF"===e)return v._isLoadedSound=!1,t(),void v.openGameWindow();if(v._isSkippedSoundMessage=!1,v._hasTitleImg||g.clearRect(0,0,V.SCREEN_WIDTH,V.SCREEN_HEIGHT),v._usePassword){var a=e;y&&(a+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),v._messageWindow.setMessage(a),v._messageWindow.show(),v._setProgressBar(si(4,4,W.GAME_INIT));var i=setInterval((function(){v._keyStore.update(),v._gamePadStore.update(),v._virtualPadStore.update(),v._yesNoJudgeInNextFrame===f.UNSELECTED&&(v._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||v._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||v._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||v._virtualPadStore.checkTouchButton("BUTTON_ENTER")?v._yesNoJudgeInNextFrame=f.YES:(v._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||v._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||v._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||v._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(v._yesNoJudgeInNextFrame=f.NO)),v._yesNoJudgeInNextFrame===f.YES?(clearInterval(i),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!0,v._setLoadingMessage(g,W.AUDIO),v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)}),V.YESNO_PRESS_DISP_FRAME_NUM*V.DEFAULT_FRAME_INTERVAL)):v._yesNoJudgeInNextFrame===f.NO&&(clearInterval(i),v._messageWindow.update(),v._yesNoJudge=v._yesNoJudgeInNextFrame,v._messageWindow.setInputDisable(),setTimeout((function(){v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!1,v.openGameWindow()}),V.YESNO_PRESS_DISP_FRAME_NUM*V.DEFAULT_FRAME_INTERVAL))}),V.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),v._player.setDelayFrame(),v._messageWindow.hide(),v._yesNoJudge=f.UNSELECTED,v._yesNoJudgeInNextFrame=f.UNSELECTED,v._isLoadedSound=!0,v.loadSound(),window.requestAnimationFrame(v.soundCheckCaller)})),v.wwaCustomEvent("wwa_start")};var P=new Qa;P.addListener("mapData",(function(t){return v._loadHandler(t)})),P.addListener("progress",(function(t){return v._setProgressBar(t)})),P.addListener("error",(function(t){return v._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,g)})),new $a(t,P).requestAndLoadMapData().then((function(){return ei(v,void 0,void 0,(function(){return ai(this,(function(t){return this._canDisplayUserVars=y,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,E?(e=E,za(void 0,void 0,void 0,(function(){return ti(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 za(void 0,void 0,void 0,(function(){var e,a;return ti(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 v._userVarNameListRequestError=t,void v._updateVarDumpInformationArea(v._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return v._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(E," が正しい形式で書かれていません。")},void v._updateVarDumpInformationArea(v._userVarNameListRequestError.errorMessage,!0);if(v._userVarNameList=v.convertUserVariableNameListToArray(t.data),null!==v._dumpElement)for(var e=function(){var t=a.toString(10);if(!v._userVarNameList[a])return"continue";var e=".var-index".concat(t),i=v._dumpElement.querySelector(e),s=i.querySelector("".concat(e," > div"));s.textContent=v._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<V.USER_VAR_NUM;a++)e()}else v._updateVarDumpInformationArea(t.errorMessage,!1)}))}return t.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(V.USER_VAR_NUM),a=0;a<V.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>=V.USER_VAR_NUM||(e[i]=t[a])})),e},t.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=V.LOAD_STAGE_MAX_EXCEPT_AUDIO?(dt("progress-message-container").textContent=t.stage===V.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:z[t.stage],dt("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(V.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*V.MAP_WINDOW_WIDTH+"px",dt("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(V.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?dt("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":dt("progress-message-container").textContent="ゲームデータを読み込んでいます。",dt("progress-bar-audio").style.width=t.current*V.MAP_WINDOW_WIDTH/t.total+"px",dt("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},t.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=X.TITLE+"px "+V.LOADING_FONT,t.fillText(tt[0],j.TITLE_X,j.TITLE_Y),t.font=X.FOOTER+"px "+V.LOADING_FONT,t.fillText("WWA Wing Ver.3.12.9",j.FOOTER_X,j.COPYRIGHT_Y);else if(e<=tt.length)t.font=X.LOADING+"px "+V.LOADING_FONT,e>=2&&(t.clearRect(j.LOADING_X,j.LOADING_Y+j.LINE*(e-3),V.SCREEN_WIDTH-j.LOADING_X,j.LINE),t.fillText(tt[e-1]+" Complete!",j.LOADING_X,j.LOADING_Y+j.LINE*(e-2))),e<tt.length&&t.fillText(tt[e],j.LOADING_X,j.LOADING_Y+j.LINE*(e-1)),1==e&&(t.font=X.FOOTER+"px "+V.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,j.FOOTER_X,j.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",j.FOOTER_X,j.WORLD_Y+j.LINE));else{var a;a=this._isSkippedSoundMessage?j.LOADING_Y+j.LINE*(tt.length-1):j.FOOTER_Y,e<=W.AUDIO?t.fillText("Now Sound data Loading .....",j.LOADING_X,a):(t.clearRect(j.LOADING_X,a-j.LINE,V.SCREEN_WIDTH-j.LOADING_X,j.LINE),t.fillText("Now Sound data Loading ..... Complete!",j.LOADING_X,a))}},t.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,V.SCREEN_WIDTH,V.SCREEN_HEIGHT),e.font=X.ERRROR+"px "+V.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,j.ERROR_X,j.ERROR_Y+j.LINE*a)})))},t.prototype.createSoundInstance=function(t){if(0!==t&&t!==B.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ca(t,e,this.audioContext,this.audioGain)}},t.prototype.loadSound=function(){var t=this;this.sounds=new Array(V.SOUND_MAX+1),this.createSoundInstance(B.DECISION),this.createSoundInstance(B.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][V.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][V.ATR_TYPE]!==V.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][V.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<B.NO_SOUND&&t.createSoundInstance(i)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},t.prototype.checkAllSoundLoaded=function(){var t=0,e=0;if(!this._hasTitleImg)var a=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(Q.KEY_SPACE)===$.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var i=1;i<=V.SOUND_MAX;i++){var s=this.sounds[i];void 0===s||s.isError()||(e++,s.hasData()&&t++)}if(t<e&&!this._soundLoadSkipFlag)return this._setProgressBar(si(t,e,W.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(si(V.SOUND_MAX,V.SOUND_MAX,W.AUDIO)),this._setLoadingMessage(a,W.FINISH),this.openGameWindow()},t.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.bgmDelayDurationMs),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},t.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},t.prototype.playSound=function(t,e){this._isLoadedSound?t<0||t>=V.SOUND_MAX?console.warn("サウンド番号が範囲外です。"):t>=B.BGM_LB&&this._wwaData.bgm===t||((t===B.NO_SOUND||t>=B.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].isPlaying()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==B.NO_SOUND&&(this.sounds[t].hasData()?t>=B.BGM_LB?(this.sounds[t].play(null!=e?e:this._wwaData.bgmDelayDurationMs),this._wwaData.bgm=t):this.sounds[t].play():t>=B.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t)))):t===B.NO_SOUND?this._wwaData.bgm=0:t>=B.BGM_LB&&(this._wwaData.bgm=t)},t.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();dt("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=dt("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var i=sa.getStartWWAData(a);this._restartData!==i&&(this._applyQuickLoad(i),this._wwaSave.resumeStart())}setTimeout((function(){dt("wwa-wrapper").removeChild(dt("wwa-cover")),t._main()}),V.SPLASH_SCREEN_DISP_MILLS)},t.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){dt("item"+(t-1)).classList.add("onpress"),this.playSound(B.DECISION);var e=this.resolveSystemMessage(s.CONFIRM_USE_ITEM);if("BLANK"===e){this._player.readyToUseItem(t);var a=this._player.useItem(),i=this.getObjectAttributeById(a,V.ATR_STRING);this.generatePageAndReserveExecution(this.getMessageById(i),!1,!1,a,m.OBJECT,this._player.getPosition().getPartsCoord())}else this.generatePageAndReserveExecution(e,!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},t.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var i=dt(R[t]);if(this.playSound(B.DECISION),this._itemMenu.close(),i.classList.add("onpress"),t===O.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case I.CALL_BY_QUICK_LOAD:case I.CALL_BY_LOG_QUICK_LOAD:var s,r="";switch(this._yesNoChoiceCallInfo){case I.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case I.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(s=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),s){case I.CALL_BY_LOG_QUICK_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case I.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case I.NONE:this.generatePageAndReserveExecution(r,!0,!0)}break;case I.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===O.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=I.CALL_BY_QUICK_SAVE):(this.generatePageAndReserveExecution("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_QUICK_SAVE));else if(t===O.RESTART_GAME)this.generatePageAndReserveExecution("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_RESTART_GAME;else if(t===O.GOTO_WWA)if(a)this._bottomButtonType!==n.GOTO_WWA&&dt(R[O.GOTO_WWA]).classList.remove("onpress"),this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case n.GOTO_WWA:this._yesNoChoiceCallInfo=I.CALL_BY_GOTO_WWA,this.generatePageAndReserveExecution("WWAの公式サイトを開きますか?",!0,!0);break;case n.GAME_END:this._yesNoChoiceCallInfo=I.CALL_BY_END_GAME,this.generatePageAndReserveExecution("WWAゲームを終了しますか?",!0,!0);break;case n.BATTLE_REPORT:this.launchBattleEstimateWindow()}},t.prototype.onpasswordloadcalled=function(){this._usePassword?(dt(R[O.QUICK_LOAD]).classList.add("onpress"),this.generatePageAndReserveExecution("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_PASSWORD_LOAD):this.generatePageAndReserveExecution("セーブデータがありません。",!1,!0)},t.prototype.onpasswordsavecalled=function(){dt(R[O.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_SUSPEND):this._usePassword&&(this.generatePageAndReserveExecution("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_PASSWORD_SAVE)},t.prototype.onpasssuspendsavecalled=function(){dt(R[O.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.generatePageAndReserveExecution("ここではセーブ機能は\n使用できません。",!1,!0):(this.generatePageAndReserveExecution("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=I.CALL_BY_SUSPEND)},t.prototype.onitemmenucalled=function(){this.generatePageAndReserveExecution("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(B.DECISION),this._itemMenu.openView()},t.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){switch(t){case D.UP:this._player.speedUp();break;case D.DOWN:this._player.speedDown()}var e=this.resolveSystemMessage(s.GAME_SPEED_CHANGED);"BLANK"!==e&&this.generatePageAndReserveExecution(e,!1,!0)}else{var a=this.resolveSystemMessage(s.GAME_SPEED_CHANGE_DISABLED);"BLANK"!==a&&this.generatePageAndReserveExecution(a,!1,!0)}},t.prototype.isBattleSpeedIndexForQuickBattle=function(t){return V.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},t.prototype._executeNode=function(t,e){var a,i=this;if(t instanceof Ne)return null===(a=t.macro)||void 0===a||a.forEach((function(t){if(t.execute().isGameOver)throw new Error("ゲームオーバーのため、メッセージ・マクロの実行を打ち切ります。")})),ii([t],this._executeNode(t.next,e),!0);if(t instanceof Ce){if(!e)throw new Error("パーツ起因ページによる実行ではないため、Junctionノードの利用を想定していません。");var s=t.evaluateAndGetNextNode((function(){return i.generateTokenValues(e)}));return s?this._executeNode(s,e):[]}return[]},t.prototype._executeNodes=function(t,e){try{return{isError:!1,messages:this._executeNode(t,e)}}catch(t){return{isError:!0}}},t.prototype._main=function(){var t,e=this;this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._virtualPadStore.update(),this._gamePadStore.update();var a=this._reservedPartsAppearances.length>0;if(this._reservedPartsAppearances.forEach((function(t){return e.appearParts(t)})),this._reservedPartsAppearances=[],this._waitFrame-- >0)return a&&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 i=this._pages.shift(),s=this._executeNodes(i.firstNode,i.extraInfo?{position:i.extraInfo.partsPosition,type:i.extraInfo.partsType,id:i.extraInfo.partsId}:void 0);if(!0===s.isError){this._isLastPage=!1;break}void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0);var r=s.messages.filter((function(t){return!t.isEmpty()})),o=Boolean(i.scoreOptions);if(o&&0===r.length&&r.push(new Ne("スコアを表示します。")),r.length>0){var n=r.map((function(t){return t.generatePrintableMessage()})).join("\n");this._messageWindow.setMessage(n),this._messageWindow.setYesNoChoice(i.showChoice),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,o,i.isSystemMessage,this._player.getPosition(),this._camera.getPosition()),o&&(this._lastScoreOptions=i.scoreOptions,this.updateScore(i.scoreOptions),this._scoreWindow.show()),this._player.setMessageWaiting(),this._isLastPage=i.isLastPage;break}if(0===this._pages.length){this._hideMessageWindow();break}}if(this._reservedJumpDestination&&(this._player.jumpTo(this._reservedJumpDestination),this._reservedJumpDestination=void 0),this._player.mainFrameCount(),this._player.isControllable()){if(this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(I.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame())this._player.updateDelayFrame();else{var c=this._player.getDir(),h=[NaN,NaN,Q.KEY_DOWN,NaN,Q.KEY_LEFT,NaN,Q.KEY_RIGHT,NaN,Q.KEY_UP,NaN][c];this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(Q.KEY_LEFT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_UP)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_RIGHT)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(Q.KEY_DOWN)===$.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.LEFT)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.UP)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.RIGHT)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(_.DOWN)===et.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(h)?this._checkTurnKeyPressed()?this._player.setDir(c):(this._player.controll(c),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(Q.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(_.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(st.BUTTON_INDEX_B)?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.LEFT):(this._player.controll(_.LEFT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.UP):(this._player.controll(_.UP),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.RIGHT):(this._player.controll(_.RIGHT),this._objectMovingDataManager.update()):this._virtualPadStore.checkTouchingButton("BUTTON_DOWN")?this._virtualPadStore.checkTouchingButton("BUTTON_ESC")?this._player.setDir(_.DOWN):(this._player.controll(_.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(Q.KEY_1)===$.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(Q.KEY_2)===$.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(Q.KEY_3)===$.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(Q.KEY_Q)===$.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(Q.KEY_W)===$.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(Q.KEY_E)===$.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(Q.KEY_A)===$.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(Q.KEY_S)===$.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(Q.KEY_D)===$.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(Q.KEY_Z)===$.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(Q.KEY_X)===$.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(Q.KEY_C)===$.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(Q.KEY_I)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_MINUS)||this._virtualPadStore.checkTouchButton("BUTTON_SLOW")?this.onchangespeed(D.DOWN):this._keyStore.getKeyState(Q.KEY_P)===$.KEYDOWN||this._keyStore.checkHitKey(Q.KEY_F2)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_PLUS)||this._virtualPadStore.checkTouchButton("BUTTON_FAST")?this.onchangespeed(D.UP):this._keyStore.getKeyState(Q.KEY_F1)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_M)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(Q.KEY_F3)?(this.playSound(B.DECISION),this.onselectbutton(O.QUICK_LOAD,!0)):this._keyStore.checkHitKey(Q.KEY_F4)?(this.playSound(B.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(Q.KEY_F5)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_ZR)?this.onselectbutton(O.QUICK_LOAD):this._keyStore.checkHitKey(Q.KEY_F6)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_ZL)?this.onselectbutton(O.QUICK_SAVE):this._keyStore.checkHitKey(Q.KEY_F7)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_R)?this.onselectbutton(O.RESTART_GAME):this._keyStore.checkHitKey(Q.KEY_F8)?this.onselectbutton(O.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(Q.KEY_F9)||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_X)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(Q.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(Q.KEY_F12)||this._gamePadStore.buttonTrigger(st.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(Q.KEY_LEFT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchButton("BUTTON_LEFT")?this._messageWindow.saveControll(_.LEFT):this._keyStore.checkHitKey(Q.KEY_UP)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchButton("BUTTON_UP")?this._messageWindow.saveControll(_.UP):this._keyStore.checkHitKey(Q.KEY_RIGHT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchButton("BUTTON_RIGHT")?this._messageWindow.saveControll(_.RIGHT):(this._keyStore.checkHitKey(Q.KEY_DOWN)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchButton("BUTTON_DOWN"))&&this._messageWindow.saveControll(_.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===f.UNSELECTED&&(this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")?this._yesNoJudge=f.YES:(this._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC"))&&(this._yesNoJudge=f.NO)),(this._yesNoJudge===f.YES||this._yesNoJudge===f.NO)&&(this.playSound(B.DECISION),this._yesNoDispCounter=V.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(Q.KEY_LEFT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)||this._virtualPadStore.checkTouchingButton("BUTTON_LEFT")?this._itemMenu.controll(_.LEFT):this._keyStore.checkHitKey(Q.KEY_UP)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)||this._virtualPadStore.checkTouchingButton("BUTTON_UP")?this._itemMenu.controll(_.UP):this._keyStore.checkHitKey(Q.KEY_RIGHT)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)||this._virtualPadStore.checkTouchingButton("BUTTON_RIGHT")?this._itemMenu.controll(_.RIGHT):(this._keyStore.checkHitKey(Q.KEY_DOWN)||this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)||this._virtualPadStore.checkTouchingButton("BUTTON_DOWN"))&&this._itemMenu.controll(_.DOWN),this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_Y)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER"))this._setNextPage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(_.LEFT)||this._mouseStore.checkClickMouse(_.UP)||this._mouseStore.checkClickMouse(_.RIGHT)||this._mouseStore.checkClickMouse(_.DOWN)||this._keyStore.getKeyState(Q.KEY_N)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_ESC)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(var u=0;u<R.length;u++){(E=dt(R[u])).classList.contains("onpress")&&E.classList.remove("onpress")}this._itemMenu.ng(),this._setNextPage(),this.playSound(B.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var l=this._keyStore.getKeyStateForMessageCheck(Q.KEY_ENTER),p=this._keyStore.getKeyStateForMessageCheck(Q.KEY_SPACE),d=this._keyStore.getKeyStateForMessageCheck(Q.KEY_ESC);if(l===$.KEYDOWN||l===$.KEYPRESS_MESSAGECHANGE||p===$.KEYDOWN||p===$.KEYPRESS_MESSAGECHANGE||d===$.KEYDOWN||d===$.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===et.MOUSEDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.BUTTON_INDEX_B)||this._virtualPadStore.checkTouchButton("BUTTON_ENTER")||this._virtualPadStore.checkTouchButton("BUTTON_ESC")){for(u=0;u<R.length;u++){var E;(E=dt(R[u])).classList.contains("onpress")&&E.classList.remove("onpress")}this._setNextPage()}}if(null===(t=this._inlineUserVarViewer)||void 0===t?void 0:t.isVisible){var y=!1;this._keyStore.getKeyState(Q.KEY_DOWN)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,y=!0),this._keyStore.getKeyState(Q.KEY_UP)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,y=!0),this._keyStore.getKeyState(Q.KEY_RIGHT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=V.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._keyStore.getKeyState(Q.KEY_LEFT)===$.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=V.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,y=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=V.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>V.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=V.USER_VAR_NUM),y&&(this._setNextPage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(Q.KEY_V)===$.KEYDOWN&&this._setNextPage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(Q.KEY_ENTER)===$.KEYDOWN||this._keyStore.getKeyState(Q.KEY_SPACE)===$.KEYDOWN||this._gamePadStore.buttonTrigger(st.BUTTON_INDEX_A,st.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 w=this.checkMap();w||this.checkObject(),this._prevFrameEventExected=w}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==f.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=C.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*V.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&dt("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&dt("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&dt("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&dt("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){e._loadType===C.QUICK_LOAD?(e._quickLoad(),e.wwaCustomEvent("wwa_quickload")):e._loadType===C.RESTART_GAME?(e._restartGame(),e.wwaCustomEvent("wwa_restert")):e._loadType===C.PASSWORD&&(e._applyQuickLoad(e._passwordSaveExtractData),e._passwordSaveExtractData=void 0,e.wwaCustomEvent("wwa_passwordload")),setTimeout(e.mainCaller,V.DEFAULT_FRAME_INTERVAL,e)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(u=0;u<V.USER_VAR_NUM;u++){var m=u.toString(10);this._dumpElement.querySelector(".var".concat(m)).textContent=this._wwaData.userVar[u]+""}},t.prototype.vibration=function(t){this._gamePadStore.vibration(t)},t.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),i=this._camera.getPosition().getOffsetCoord(),s=V.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,V.MAP_WINDOW_WIDTH,V.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,V.MAP_WINDOW_WIDTH,V.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()*V.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=dt("wwa-fader");if((c-=3*V.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,V.CHIP_SIZE*(t-a.x)-i.x,V.CHIP_SIZE*(e-a.y)-i.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},t.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+V.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+V.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][V.ATR_X]/V.CHIP_SIZE,d=this._wwaData.mapAttribute[l][V.ATR_Y]/V.CHIP_SIZE,E=V.CHIP_SIZE*(h-t.x)-e.x,f=V.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][V.ATR_X]/V.CHIP_SIZE,d=this._wwaData.mapAttribute[l][V.ATR_Y]/V.CHIP_SIZE,E=V.CHIP_SIZE*(h-t.x)-e.x,f=V.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},t.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=[NaN,NaN,2,NaN,4,NaN,6,NaN,0,NaN][this._player.getDir()],_=(r.x-t.x)*V.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*V.CHIP_SIZE+o.y-e.y;if(this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()){s=this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]}else s=this._player.isMovingImage()?this._wwaData.playerImgPosX+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)}},t.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,p,d,f,y,w,m,g,v=Math.max(0,t.x-1),A=Math.min(this._wwaData.mapWidth-1,t.x+V.H_PARTS_NUM_IN_WINDOW),S=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+V.V_PARTS_NUM_IN_WINDOW),I=0,O=this._animationCounter>V.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(i)for(f=v;f<=A;f++)for(y=S;y<=T;y++)D&&new l(f,y).equals(this._monster.position)||(w=this._wwaData.mapObject[y][f],r=new l(0,0),this._wwaData.objectAttribute[w][V.ATR_MOVE]!==N.STATIC&&null!==(d=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new l(f,y)))&&(r=d),c=V.CHIP_SIZE*(f-t.x)+r.x-e.x,h=V.CHIP_SIZE*(y-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[w][V.ATR_X2]&&0===this._wwaData.objectAttribute[w][V.ATR_Y2],n=this._wwaData.objectAttribute[w][o?V.ATR_X:V.ATR_X2]/V.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?V.ATR_Y:V.ATR_Y2]/V.CHIP_SIZE,u=this._wwaData.objectAttribute[w][V.ATR_TYPE],p=this._wwaData.objectAttribute[w][V.ATR_NUMBER],0===w||this._checkNoDrawObject(new l(f,y),u,p)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,P,M,b,R,L=[],x=[];for(f=v;f<=A;f++)for(y=S;y<=T;y++)m=w=this._wwaData.mapObject[y][f],u=this._wwaData.objectAttribute[w][V.ATR_TYPE],p=this._wwaData.objectAttribute[w][V.ATR_NUMBER],this._checkNoDrawObject(new l(f,y),u,p)&&(m=0),P=this._wwaData.objectAttribute[w][V.ATR_MOVE]===N.STATIC,0!==m&&(M=!(!D||!new l(f,y).equals(this._monster.position)),P?x.push(new E(w,f,y,P,M)):(L.push(new E(w,f,y,P,M)),m=0),M&&(m=0)),this._cgManager.mapObjectCache[I]!==m&&(this._cgManager.mapObjectCache[I]=m,s=!0),I++;for(s&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(L,x)),R=L.length,b=0;b<R;b++)if(f=(C=L[b]).x,y=C.y,w=C.partsIDObj,P=C.isStatic,M=C.isFighting,c=V.CHIP_SIZE*(f-t.x)-e.x,h=V.CHIP_SIZE*(y-t.y)-e.y,P){if(M)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[w][V.ATR_X2]&&0===this._wwaData.objectAttribute[w][V.ATR_Y2],n=this._wwaData.objectAttribute[w][o?V.ATR_X:V.ATR_X2]/V.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?V.ATR_Y:V.ATR_Y2]/V.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(d=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new l(f,y)))&&(c+=d.x,h+=d.y),o=O||0===this._wwaData.objectAttribute[w][V.ATR_X2]&&0===this._wwaData.objectAttribute[w][V.ATR_Y2],n=this._wwaData.objectAttribute[w][o?V.ATR_X:V.ATR_X2]/V.CHIP_SIZE,_=this._wwaData.objectAttribute[w][o?V.ATR_Y:V.ATR_Y2]/V.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},t.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},t.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},t.prototype._drawFrame=function(){this._cgManager.drawFrame()},t.prototype._checkNoDrawObject=function(t,e,a){var i=this._player.getPosition(),s=i.getPartsCoord();return!(!i.isJustPosition()||s.x!==t.x||s.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===V.OBJECT_DOOR&&0===a||(e===V.OBJECT_STATUS||e===V.OBJECT_MESSAGE||e===V.OBJECT_ITEM||e===V.OBJECT_SELL||e===V.OBJECT_BUY||e===V.OBJECT_SELL||e===V.OBJECT_LOCALGATE))},t.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},t.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},t.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},t.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][V.ATR_TYPE]},t.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][V.ATR_TYPE]},t.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[i][e]},t.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,V.ATR_STRING)},t.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),i=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[i][e]},t.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},t.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},t.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][V.ATR_X]},t.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][V.ATR_Y]},t.prototype.getMessageById=function(t){return this._wwaData.message[t]},t.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},t.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],i=this._wwaData.mapAttribute[a][V.ATR_TYPE],s=t.x===e.x&&t.y===e.y,r=!1;return(!s||this._player.getLastExecPartsIDOnSamePosition(m.MAP)!==a)&&(i===V.MAP_STREET?r=this._execMapStreetEvent(t,a,i):i===V.MAP_WALL?r=this._execMapWallEvent(t,a,i):i===V.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,i):i===V.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,i)),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(m.MAP,a),r)},t.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][V.ATR_TYPE],s=t.x===e.x&&t.y===e.y;s&&this._player.getLastExecPartsIDOnSamePosition(m.OBJECT)===a||(i===V.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,i):i===V.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,i):i===V.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,i):i===V.OBJECT_ITEM?this._execObjectItemEvent(t,a,i):i===V.OBJECT_DOOR?this._execObjectDoorEvent(t,a,i):i===V.OBJECT_STATUS?this._execObjectStatusEvent(t,a,i):i===V.OBJECT_BUY?this._execObjectBuyEvent(t,a,i):i===V.OBJECT_SELL?this._execObjectSellEvent(t,a,i):i===V.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,i):i===V.OBJECT_SCORE?this._execObjectScoreEvent(t,a,i):i===V.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,i):i===V.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,i),s&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(m.OBJECT,a))},t.prototype._execMapStreetEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][V.ATR_ITEM];if(0!==i&&!this._player.hasItem(i))return!1;this.reserveAppearPartsInNextFrame(t,y.MAP,e);var s=this._wwaData.mapAttribute[e][V.ATR_STRING],r=this._wwaData.message[s],o=this._wwaData.mapAttribute[e][V.ATR_NUMBER];return this._waitFrame+=o*V.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.generatePageAndReserveExecution(r,!1,!1,e,m.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][V.ATR_SOUND]),0!==s&&this._shouldTreatWillMessageDisplay(this._pages)||0!==o},t.prototype._shouldTreatWillMessageDisplay=function(t){return t.reduce((function(t,e){return t||!Pe(e.firstNode)}),!1)},t.prototype._execMapWallEvent=function(t,e,a){var i=this.getObjectIdByPosition(t.convertIntoPosition(this)),s=this.getObjectAttributeById(i,V.ATR_TYPE);if(0===i||s===V.OBJECT_NORMAL||s===V.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(i,V.ATR_ITEM))||this.getObjectAttributeById(s,V.ATR_MODE)===V.PASSABLE_OBJECT)){this.reserveAppearPartsInNextFrame(t,y.MAP,e);var r=this._wwaData.mapAttribute[e][V.ATR_STRING],o=this._wwaData.message[r];return this.generatePageAndReserveExecution(o,!1,!1,e,m.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][V.ATR_SOUND]),!1}return!1},t.prototype._execMapLocalGateEvent=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._wwaData.mapAttribute[e][V.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][V.ATR_JUMP_Y];return s>V.RELATIVE_COORD_LOWER&&(s=t.x+s-V.RELATIVE_COORD_BIAS),r>V.RELATIVE_COORD_LOWER&&(r=t.y+r-V.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,y.MAP,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new p(this,s,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][V.ATR_SOUND]),!0)},t.prototype._execMapUrlGateEvent=function(t,e,a){var i=this._wwaData.mapAttribute[e][V.ATR_STRING];if(!this._isURLGateEnable)return!0;var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);if("BLANK"!==r)return this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0],!0;location.href=gt(this._wwaData.message[i].split(/\s/g)[0])},t.prototype._execObjectNormalEvent=function(t,e,a){},t.prototype._execObjectMessageEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.ATR_STRING],s=this._wwaData.message[i],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][V.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!1,!1,e,m.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][V.ATR_NUMBER]*V.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this.playSound(o)},t.prototype._execObjectStatusEvent=function(t,e,a){var i=new u(this._wwaData.objectAttribute[e][V.ATR_ENERGY],this._wwaData.objectAttribute[e][V.ATR_STRENGTH],this._wwaData.objectAttribute[e][V.ATR_DEFENCE],this._wwaData.objectAttribute[e][V.ATR_GOLD]),s=this._wwaData.objectAttribute[e][V.ATR_STRING],r=this._wwaData.message[s],o=this._player.getStatusWithoutEquipments();if(i.strength>V.STATUS_MINUS_BORDER&&o.strength<i.strength-V.STATUS_MINUS_BORDER||i.defence>V.STATUS_MINUS_BORDER&&o.defence<i.defence-V.STATUS_MINUS_BORDER||i.gold>V.STATUS_MINUS_BORDER&&o.gold<i.gold-V.STATUS_MINUS_BORDER)return this.setPartsOnPosition(m.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();i.energy=i.energy>V.STATUS_MINUS_BORDER?V.STATUS_MINUS_BORDER-i.energy:i.energy,i.strength=i.strength>V.STATUS_MINUS_BORDER?V.STATUS_MINUS_BORDER-i.strength:i.strength,i.defence=i.defence>V.STATUS_MINUS_BORDER?V.STATUS_MINUS_BORDER-i.defence:i.defence,i.gold=i.gold>V.STATUS_MINUS_BORDER?V.STATUS_MINUS_BORDER-i.gold:i.gold,this._player.addStatusAll(i),this.setStatusChangedEffect(i),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][V.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.setPartsOnPosition(m.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND]))},t.prototype._execObjectMonsterEvent=function(t,e,a){var i=this,s=new l(this._wwaData.objectAttribute[e][V.ATR_X],this._wwaData.objectAttribute[e][V.ATR_Y]),r=new u(this._wwaData.objectAttribute[e][V.ATR_ENERGY],this._wwaData.objectAttribute[e][V.ATR_STRENGTH],this._wwaData.objectAttribute[e][V.ATR_DEFENCE],this._wwaData.objectAttribute[e][V.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][V.ATR_STRING]],n=this._wwaData.objectAttribute[e][V.ATR_ITEM];this._monster=new Pt(e,t,s,r,o,n,(function(){i._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},t.prototype._execObjectBuyEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND])},t.prototype._execObjectSellEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND])},t.prototype._execObjectItemEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.ATR_STRING],r=this._wwaData.message[i];try{var o=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),n=(t.x-o.x)*V.CHIP_SIZE,_=(t.y-o.y)*V.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][V.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new l(n,_),itemBoxBackgroundImageCoord:new l(this._wwaData.imgItemboxX*V.CHIP_SIZE,this._wwaData.imgItemboxY*V.CHIP_SIZE)}:void 0),this.setPartsOnPosition(m.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][V.ATR_MODE]||(this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e))}catch(t){var c=this.resolveSystemMessage(s.ITEM_BOX_FULL);"BLANK"!==c&&this.generatePageAndReserveExecution(c,!1,!0)}this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND])},t.prototype._execObjectDoorEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.ATR_ITEM],s=this._wwaData.objectAttribute[e][V.ATR_STRING],r=this._wwaData.message[s];this._player.hasItem(i)&&(0===this._wwaData.objectAttribute[e][V.ATR_MODE]&&this._player.removeItemByPartsID(i),this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND]),this.generatePageAndReserveExecution(r,!1,!1,e,m.OBJECT,t.clone()),this.setPartsOnPosition(m.OBJECT,0,t),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),this._paintSkipByDoorOpen=!0)},t.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.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(m.OBJECT,0,t),this.generatePageAndReserveExecution(s,!0,!1,e,m.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND])},t.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(m.OBJECT,0,t);var s=this._wwaData.objectAttribute[e][V.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][V.ATR_JUMP_Y];s>V.RELATIVE_COORD_LOWER&&(s=i.x+s-V.RELATIVE_COORD_BIAS),r>V.RELATIVE_COORD_LOWER&&(r=i.y+r-V.RELATIVE_COORD_BIAS),this.reserveAppearPartsInNextFrame(t,y.OBJECT,e),0<=s&&0<=r&&s<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(s!==i.x||r!==i.y)&&(this.reserveJumpInNextFrame(new p(this,s,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND]))},t.prototype._execObjectUrlGateEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.ATR_STRING];if(this._isURLGateEnable){var r=this.resolveSystemMessage(s.CONFIRM_ENTER_URL_GATE);"BLANK"!==r?(this.generatePageAndReserveExecution(r,!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=I.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[i].split(/\s/g)[0]):location.href=gt(this._wwaData.message[i].split(/\s/g)[0])}},t.prototype._execObjectScoreEvent=function(t,e,a){var i=this._wwaData.objectAttribute[e][V.ATR_STRING];this.generatePageAndReserveExecution(this._wwaData.message[i],!1,!1,e,m.OBJECT,t,{rates:{energy:this._wwaData.objectAttribute[e][V.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][V.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][V.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][V.ATR_GOLD]}}),this.playSound(this._wwaData.objectAttribute[e][V.ATR_SOUND])},t.prototype.updateScore=function(t){var e=t||this._lastScoreOptions;if(e){var a=this._player.getStatus().calculateScore(e);this._scoreWindow.update(a)}},t.prototype._execChoiceWindowObjectSellEvent=function(){if(!this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_GOLD]))return"BLANK"!==(n=this.resolveSystemMessage(s.NO_MONEY))&&this._pages.push(new Oe(new Ne(n),!0,!1,!0)),{};if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ITEM]){var t=this._yesNoChoicePartsCoord,e=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),a=(t.x-e.x)*V.CHIP_SIZE,i=(t.y-e.y)*V.CHIP_SIZE,r=this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ITEM],o=this._wwaData.objectAttribute[r][V.ATR_NUMBER];try{this._player.addItem(r,o,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new l(a,i),itemBoxBackgroundImageCoord:new l(this._wwaData.imgItemboxX*V.CHIP_SIZE,this._wwaData.imgItemboxY*V.CHIP_SIZE)}:void 0)}catch(t){var n;return"BLANK"!==(n=this.resolveSystemMessage(s.ITEM_BOX_FULL))&&this._pages.push(new Oe(new Ne(n),!0,!1,!0)),{}}}var _=new u(this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_GOLD]);return _.energy=_.energy>V.STATUS_MINUS_BORDER?V.STATUS_MINUS_BORDER-_.energy:_.energy,this.setStatusChangedEffect(_),this._player.addStatusAll(_),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?(this.gameover(),{isGameOver:!0}):(this.appearParts({pos:this._yesNoChoicePartsCoord,triggerType:y.OBJECT,triggerPartsId:this._yesNoChoicePartsID}),{})},t.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===f.YES){if(this._yesNoChoiceCallInfo===I.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][V.ATR_TYPE])===V.MAP_URLGATE&&(location.href=gt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===I.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_TYPE])===V.OBJECT_BUY)if(this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ITEM]))this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new u(0,0,0,e)),this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.OBJECT,this._yesNoChoicePartsID);else{var a=this.resolveSystemMessage(s.NO_ITEM);"BLANK"!==a&&this._pages.push(new Oe(new Ne(a),!0,!1,!0))}else if(t===V.OBJECT_SELL){if(this._execChoiceWindowObjectSellEvent().isGameOver)return}else t===V.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.CHOICE_YES,this._yesNoChoicePartsID):t===V.OBJECT_URLGATE&&(location.href=gt(this._yesNoURL));else this._yesNoChoiceCallInfo===I.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===I.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),dt(R[O.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=C.QUICK_LOAD)):this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(I.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===I.CALL_BY_RESTART_GAME?(dt(R[O.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=C.RESTART_GAME):this._yesNoChoiceCallInfo===I.CALL_BY_END_GAME?(window.history.back(-1),dt(R[O.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===I.CALL_BY_GOTO_WWA?(location.href=gt(V.WWA_HOME),dt(R[O.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_LOAD?(dt(R[O.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Ve.LOAD)):this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_SAVE?(dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(I.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Ve.SAVE)):this._yesNoChoiceCallInfo===I.CALL_BY_SUSPEND&&(dt(R[O.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(I.CALL_BY_SUSPEND));this._yesNoJudge=f.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===f.NO){if(this._yesNoChoiceCallInfo===I.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][V.ATR_TYPE],V.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===I.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][V.ATR_TYPE])===V.OBJECT_BUY||t===V.OBJECT_SELL||(t===V.OBJECT_SELECT?this.reserveAppearPartsInNextFrame(this._yesNoChoicePartsCoord,y.CHOICE_NO,this._yesNoChoicePartsID):V.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===I.CALL_BY_ITEM_USE){dt("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===I.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case I.NONE:dt(R[O.QUICK_LOAD]).classList.remove("onpress");break;case I.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=f.UNSELECTED,void this.onpasswordloadcalled();case I.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=f.UNSELECTED,i){case I.CALL_BY_PASSWORD_LOAD:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case I.NONE:this.generatePageAndReserveExecution("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===I.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=f.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());dt(R[O.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===I.CALL_BY_RESTART_GAME)dt(R[O.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_END_GAME)dt(R[O.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_GOTO_WWA)dt(R[O.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_LOAD)dt(R[O.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_PASSWORD_SAVE)dt(R[O.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===I.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=f.UNSELECTED,void this.onpasswordsavecalled();dt(R[O.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=f.UNSELECTED,this._setNextPage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.NONE,this._messageWindow.setYesNoChoice(!1)}},t.prototype.generatePageAndReserveExecution=function(t,e,a,i,s,r,o){void 0===i&&(i=0),void 0===s&&(s=m.OBJECT),void 0===r&&(r=new l(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},t.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(/\/\//)?At(At(t).replace(/^.*\/\/(?!:s?ptth)/gi,"")):t})).filter((function(t){return void 0!==t})).join("\n").replace(/\\\/\\\//gi,"//");if(""===_)return o?[new Oe(void 0,!0,!1,!1,o,{partsId:e,partsType:a,partsPosition:i})]:[];var c=_.split(/\<p\>/gi);return c.map((function(t,_){var h=void 0,u=void 0,l=void 0,p={id:e,type:a,position:i},d=n.parseMessageLines(t,e,a,i),E=[];return d.forEach((function(t,e){try{var a=0===e?void 0:d[e-1].type,i=E[E.length-1],s=n.createNewNode(t,!h||!Me(a),{triggerParts:p}),r=n.processConditionalExecuteMacroLine(s,t,i,E);r&&(l=r),a?n.connectOrMergeToPreviousNode(t,a,u,s,i,l,{triggerParts:p}):h=s,s&&(u=s)}catch(t){console.error("$if-$else_if-$else-$endif マクロの解析中にエラーが発生しました。ページ ".concat(e)),console.error(t)}})),new Oe(h,_===c.length-1,0===_&&r,s,0===_&&o,{partsId:e,partsType:a,partsPosition:i})}))},t.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,o=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==o&&3===o.length||null!==(o=s.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===o.length))throw new Error("マクロではありません");var n=o[1],_="$".concat(n.toLowerCase()),c="$if"===_&&s.match(/,/)?b.LEGACY_IF:U[_],h=Boolean(c!==b.SHOW_STR&&c!==b.SHOW_STR2),u=(null!==(r=o[2])&&void 0!==r?r:"").split(",").map((function(t){return h?t.trim():t}));return new be(t,e,a,i,void 0===c?b.UNDEFINED:c,u)}(s,e,a,i,r[1]);switch(o.macroType){case b.IF:case b.ELSE_IF:case b.ELSE:case b.END_IF:case b.SHOW_STR:case b.SHOW_STR2:return{type:o.macroType,text:t,macro:o};default:return{type:"normalMacro",text:t,macro:o}}})).filter(Boolean)},t.prototype.createNewNode=function(t,e,a){switch(t.type){case b.IF:return new Ce([{descriminant:Te(t.macro.macroArgs[0])}]);case b.SHOW_STR:case b.SHOW_STR2:return e?new Ne(this._generateShowStrString(t.macro.macroArgs,{triggerParts:a.triggerParts,version:t.type===b.SHOW_STR2?2:1})):void 0;case"text":return e?new Ne(t.text):void 0;case"normalMacro":return e?new Ne("",[t.macro]):void 0;default:return}},t.prototype.processConditionalExecuteMacroLine=function(t,e,a,i){var s=0===i.length;switch(e.type){case b.IF:return void i.push(t);case b.ELSE_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else_if は呼べません");return void a.appendBranch({descriminant:Te(e.macro.macroArgs[0])});case b.ELSE:if(s)throw new Error("構文エラー: $if を呼ぶ前に $else は呼べません");return void a.appendBranch({descriminant:!0,elseBranch:{type:"real"}});case b.END_IF:if(s)throw new Error("構文エラー: $if を呼ぶ前に $endif は呼べません");return i.pop()}},t.prototype.connectOrMergeToPreviousNode=function(t,e,a,i,s,r,o){var n=Me(e);switch(e){case b.IF:case b.ELSE_IF:case b.ELSE:if(!i||!s)return;var _=s.getLastUnconnectedBranch();if(!_)throw new Error("lastUnconnectedBranchが見つかりませんでした。");return void(_.next=i);case b.END_IF:if(!(i&&r instanceof Ce))return;for(var c=0;c<r.branches.length;c++){var h=r.branches[c].next;h?this.connectToFinalNode(h,i):r.branches[c]=i}return void(r.hasElseBranch()||r.branches.push({next:i,descriminant:!0,elseBranch:{type:"pesudo-else"}}));default:if(!(n&&a instanceof Ne))return;var u=!a.isEmpty();t.type===b.SHOW_STR||t.type===b.SHOW_STR2?a.appendMessage(this._generateShowStrString(t.macro.macroArgs,{triggerParts:o.triggerParts,version:t.type===b.SHOW_STR2?2:1}),u):"text"===t.type?a.appendMessage(t.text,u):"normalMacro"===t.type?a.macro.push(t.macro):a.next=i}},t.prototype.connectToFinalNode=function(t,e){for(var a=t;;)if(a instanceof Ce&&(a=a.branches[0].next),a instanceof Ne){if(!a.next)return void(a.next=e);a=a.next}},t.prototype.appearParts=function(t){var e,a,i,s,r,o,n=t.pos,_=t.triggerType,c=t.triggerPartsId,h=_===y.CHOICE_NO?V.APPERANCE_PARTS_MIN_INDEX_NO:V.APPERANCE_PARTS_MIN_INDEX,u=_===y.CHOICE_YES?V.APPERANCE_PARTS_MAX_INDEX_YES:V.APPERANCE_PARTS_MAX_INDEX;for(_===y.MAP?(c=0===c?this._wwaData.map[n.y][n.x]:c,e=m.MAP):(c=0===c?this._wwaData.mapObject[n.y][n.x]:c,e=m.OBJECT),o=h;o<=u;o++){var d=V.ATR_APPERANCE_BASE+o*V.REL_ATR_APPERANCE_UNIT_LENGTH,E=d+V.REL_ATR_APPERANCE_ID,f=d+V.REL_ATR_APPERANCE_X,w=d+V.REL_ATR_APPERANCE_Y,g=d+V.REL_ATR_APPERANCE_TYPE;if(a=e===m.MAP?this._wwaData.mapAttribute[c][E]:this._wwaData.objectAttribute[c][E],i=e===m.MAP?this._wwaData.mapAttribute[c][g]:this._wwaData.objectAttribute[c][g],s=e===m.MAP?this._wwaData.mapAttribute[c][f]:this._wwaData.objectAttribute[c][f],r=e===m.MAP?this._wwaData.mapAttribute[c][w]:this._wwaData.objectAttribute[c][w],s===V.PLAYER_COORD?(s=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):s>V.RELATIVE_COORD_LOWER&&(s=n.x+s-V.RELATIVE_COORD_BIAS),r===V.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):r>V.RELATIVE_COORD_LOWER&&(r=n.y+r-V.RELATIVE_COORD_BIAS),0!==s||0!==r)try{if(new p(this,s,r,0,0),i===m.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var v=new l(s,r);this.setPartsOnPosition(m.MAP,a,v)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");v=new l(s,r);this.setPartsOnPosition(m.OBJECT,a,v),this._replaceRandomObject(new l(s,r)),s===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},t.prototype.reserveAppearPartsInNextFrame=function(t,e,a){void 0===a&&(a=0),this._reservedPartsAppearances.push({pos:t,triggerType:e,triggerPartsId:a})},t.prototype.reserveJumpInNextFrame=function(t){this._reservedJumpDestination=t},t.prototype.appearPartsByDirection=function(t,e,a){var i=this._player.getPosition().getPartsCoord(),s=this._player.getDir(),r=g[s],o=v[s];this.appearPartsEval(i,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},t.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 p(this,r,o,0,0);if(s===m.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new l(r,o);this.setPartsOnPosition(m.MAP,i,_)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new l(r,o);this.setPartsOnPosition(m.OBJECT,i,_),this._replaceRandomObject(new l(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},t.prototype._replaceRandomObject=function(t){var e,a,i=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[i][V.ATR_TYPE]===V.OBJECT_RANDOM){for(var s=0;s<V.RANDOM_ITERATION_MAX;s++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[i][V.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][V.ATR_TYPE]!==V.OBJECT_RANDOM)break;i=e}this.setPartsOnPosition(m.OBJECT,e,t)}},t.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+V.H_PARTS_NUM_IN_WINDOW),i=Math.max(0,t.y-1),s=Math.min(this._wwaData.mapWidth-1,t.y+V.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=i;o<=s;o++)this._replaceRandomObject(new l(r,o))},t.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new l(t,e))},t.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=f.UNSELECTED,this._pages=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=I.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 p(this,t,e,0,0))},t.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},t.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},t.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(dt("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=V.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(dt("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=V.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof u&&(0!==t.energy&&(dt("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=V.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(dt("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=V.STATUS_CHANGED_EFFECT_FRAME_NUM)))},t.prototype.setPartsOnPosition=function(t,e,a){var i,s,r=a.y<<q.BITSHIFT|a.x;t===m.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))},t.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},t.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},t.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},t.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 $e(e+="Z")},t.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+=vt(t[a[s]]);return $e(e)},t.prototype.compressSystem=function(){return sa},t.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 I.CALL_BY_LOG_QUICK_SAVE:case I.CALL_BY_QUICK_SAVE:case I.CALL_BY_SUSPEND:break;case I.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 I.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,i),this.wwaCustomEvent("wwa_quicksave",{data:i}),"";case I.CALL_BY_PASSWORD_SAVE:var o=sa.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(Ze.enc.Utf8.parse(e)),Ze.AES.encrypt(Ze.enc.Utf8.parse(e),qe(a)).toString();case I.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:i,compress:sa.compress(i)});break;case I.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:i}),this._wwaSave.autoSave(this._cvs,i)}},t.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},t.prototype._decodePassword=function(t){var e,a,i,s="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,s=Ze.AES.decrypt(e,qe(a)).toString(Ze.enc.Utf8)}catch(t){r=t}if(!s){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{s=function(t,e,a){return Ze.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(Ze.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=sa.decompress(i),_=n[0],c=n[1];return[pa(_),c]}return[i,{isWorldNameEmpty:!1}]},t.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},t.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new p(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(B.NO_SOUND):this.playSound(t.bgm,t.bgmDelayDurationMs),this.setImgClick(new l(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(x.ENERGY,new l(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(x.STRENGTH,new l(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(x.DEFENCE,new l(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(x.GOLD,new l(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new l(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new l(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},t.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var a=0;a<this._wwaData.mapWidth;a++){var i=a<<q.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)}},t.prototype._restartGame=function(){this._quickLoad(!0)},t.prototype._fadeout=function(t){var e=0,a=V.MAP_WINDOW_WIDTH,i=V.FADEOUT_SPEED,s=dt("wwa-fader");s.style.display="block";var r=setInterval((function(){if(e+=i,(a-=2*i)<=0||2*e>V.MAP_WINDOW_WIDTH)return s.removeAttribute("style"),s.style.display="block",s.style.borderWidth="0",s.style.width=V.MAP_WINDOW_WIDTH+"px",s.style.height=V.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)},t.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(),V.ATR_TYPE)!==V.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),V.ATR_TYPE)!==V.OBJECT_LOCALGATE){for(e=new Array(V.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(V.V_PARTS_NUM_IN_WINDOW+2),i=-1;i<=V.V_PARTS_NUM_IN_WINDOW;i++)for(e[i+1]=new Array(V.H_PARTS_NUM_IN_WINDOW+2),this.hoge[i+1]=new Array(V.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=V.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 p(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<=V.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(i=-1;i<=V.V_PARTS_NUM_IN_WINDOW;i++)if(!(o+i<0||o+i>=this._wwaData.mapWidth)){try{var _;n=(_=new p(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][V.ATR_MOVE]!==N.STATIC&&this._wwaData.objectAttribute[c][V.ATR_TYPE]!==V.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][V.ATR_TYPE]!==V.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][V.ATR_MOVE]===N.CHASE_PLAYER||this._wwaData.objectAttribute[c][V.ATR_MOVE]===N.RUN_OUT||this._wwaData.objectAttribute[c][V.ATR_MOVE]===N.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][V.ATR_MOVE];if(h!==N.HANG_AROUND){var u,d=this._getCandidateCoord(t,_,h),E=new l(d.x,n.y),f=new l(n.x,d.y),y=null;if(this._objectCanMoveTo(t,d,e))this._setObjectsInNextFrame(n,d,r,o,e,c);else{var w=this._getSecondCandidateMoveMode(t,n,d,E,f,this._wwaData.objectAttribute[c][V.ATR_TYPE]===V.OBJECT_MONSTER,e);w===P.MODE_X?this._setObjectsInNextFrame(n,E,r,o,e,c):w===P.MODE_Y?this._setObjectsInNextFrame(n,f,r,o,e,c):null===(y=this._getThirdCandidate(t,_,d,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,y,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},t.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===N.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===N.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},t.prototype._getSecondCandidateMoveMode=function(t,e,a,i,s,r,o){return!t||(this._player.getDir()!==_.UP&&this._player.getDir()!==_.DOWN||!r)&&(this._player.getDir()!==_.LEFT&&this._player.getDir()!==_.RIGHT||r)?this._objectCanMoveTo(t,i,o)?P.MODE_X:this._objectCanMoveTo(t,s,o)?P.MODE_Y:P.UNDECIDED:this._objectCanMoveTo(t,s,o)?P.MODE_Y:this._objectCanMoveTo(t,i,o)?P.MODE_X:P.UNDECIDED},t.prototype._getThirdCandidate=function(t,e,a,i,s){var r,o=i===N.CHASE_PLAYER?1:i===N.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new l(a.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(a.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x,_.y+1*o),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x,_.y-1*o),this._objectCanMoveTo(t,r,s))return r}if(n.y!==_.y){if(r=new l(_.x+1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x-1*o,a.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x+1*o,_.y),this._objectCanMoveTo(t,r,s))return r;if(r=new l(_.x-1*o,_.y),this._objectCanMoveTo(t,r,s))return r}return null},t.prototype._getRandomMoveCoord=function(t,e,a){for(var i=e.getPartsCoord(),s=i.clone(),r=this._wwaData.isOldMove?V.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:V.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=[-1,1,0,0,-1,-1,1,1],_=Math.floor(Math.random()*n.length);if(s.x=i.x+n[_],s.y=i.y+[0,0,1,-1,1,-1,1,-1][_],this._objectCanMoveTo(t,s,a))return s}return i},t.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},t.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][V.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===i&&!this.isOldMap()||r===V.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},t.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)))},t.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+V.H_PARTS_NUM_IN_WINDOW-1),i=Math.max(0,t.y),s=Math.min(this._wwaData.mapWidth-1,t.y+V.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(B.DECISION);for(var o=e;o<=a;o++)for(var _=i;_<=s;_++){var c=this._wwaData.mapObject[_][o];this._wwaData.objectAttribute[c][V.ATR_TYPE]===V.OBJECT_MONSTER&&-1===r.indexOf(c)&&r.push(c)}return this._bottomButtonType===n.BATTLE_REPORT&&dt(R[O.GOTO_WWA]).classList.add("onpress"),0===r.length?(dt(R[O.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},t.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),dt(R[O.GOTO_WWA]).classList.remove("onpress")},t.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Ve.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}},t.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<V.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%V.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)}},t.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case S.GAME:switch(this.userDevice.os){case A.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.12.9\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case A.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.12.9\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case A.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.12.9\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case S.SP:case S.VR:return;case S.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.12.9\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.generatePageAndReserveExecution(t,!1,!0)}},t.prototype._setNextPage=function(){this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&this._scoreWindow.hide(),this._isLastPage&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._pages.length?this._hideMessageWindow():this._shouldSetNextPage=!0,this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},t.prototype._hideMessageWindow=function(){var t=0;this._player.isReadyToUseItem()&&(t=this._player.useItem());var e=this.getObjectAttributeById(t,V.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,m.OBJECT,this._player.getPosition().getPartsCoord())},t.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},t.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},t.prototype.replaceParts=function(t,e,a,i){void 0===a&&(a=m.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+V.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+V.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===m.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.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])&q.BITMASK,c=s>>>q.BITSHIFT&q.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},t.prototype.getYesNoImgCoord=function(){return new l(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},t.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},t.prototype.getPlayerImgCoord=function(){return new l(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},t.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},t.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(this.toValidStatusValue(t))},t.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},t.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},t.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},t.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},t.prototype.isOldMap=function(){return this._wwaData.isOldMap},t.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},t.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},t.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},t.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},t.prototype.setPlayerStatus=function(t,e,a){if(t===L.ENERGY){if(this._player.setEnergy(this.toValidStatusValue(e)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a}))return this.gameover(),{isGameOver:!0}}else if(t===L.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===L.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===L.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==L.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}return{}},t.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},t.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},t.prototype.setStatusIconCoord=function(t,e){var a=e.x*V.CHIP_SIZE,i=e.y*V.CHIP_SIZE,s=function(t){yt("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(i,"px")};switch(t){case x.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,s("#disp-energy");break;case x.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,s("#disp-strength");break;case x.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,s("#disp-defence");break;case x.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,s("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},t.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*V.CHIP_SIZE,a=t.y*V.CHIP_SIZE;return Array.prototype.forEach.call(wt("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},t.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},t.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},t.prototype.canInput=function(){return!this._temporaryInputDisable},t.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},t.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},t.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},t.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new l(0,0)))Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+V.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(wt(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*V.CHIP_SIZE+"px -"+t.y*V.CHIP_SIZE+"px"}))}},t.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},t.prototype.clearFaces=function(){this._faces=[]},t.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},t.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},t.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},t.prototype.setBgmDelay=function(t){this._wwaData.bgmDelayDurationMs=t},t.prototype.initCSSRule=function(){this._styleElm=dt(V.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},t.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",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[Z.MESSAGE_WINDOW]=this._sheet.addRule(e,i),this._stylePos[Z.SIDEBAR]=this._sheet.addRule(s,r)):(this._stylePos[Z.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(i," }"),0),this._stylePos[Z.SIDEBAR]=this._sheet.insertRule("".concat(s," { ").concat(r," }"),1))},t.prototype.changeStyleRule=function(t,e,a,i){t===J.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=i):t===J.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=i):t===J.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=i):t===J.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=i),this.updateCSSRule()},t.prototype.showMonsterWindow=function(){this._monsterWindow.show()},t.prototype.isClassicMode=function(){return this._isClassicModeEnable},t.prototype.isConsoleOutputMode=function(){return this._useConsole},t.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new p(this,t,e,0,0))},t.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(V.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},t.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,V.USER_VAR_NUM_MAX_VALUE),V.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},t.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<V.USER_VAR_NUM&&(0|t)===t},t.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},t.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},t.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},t.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},t.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},t.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},t.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},t.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},t.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},t.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},t.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");return this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox(),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})?(this.gameover(),{isGameOver:!0}):{}},t.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},t.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},t.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},t.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},t.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},t.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},t.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},t.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},t.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},t.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},t.prototype._generateShowStrString=function(t,e){var a=this;return t.map((function(t){var i=Number(t);return isNaN(i)?null!==ve(t).match(de)?function(){return Se(t,a.generateTokenValues(e.triggerParts))}:t.replace(/\\n/g,"\n"):function(){return 1===e.version?a._wwaData.userVar[i]:i}}))},t.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},t.prototype.execSetMacro=function(t,e){void 0===t&&(t="");var a=function(t,e){var a=ve(t),i=a.match(le);if(null!==i){var s=Ae(i[2],e),r=Ae(i[4],e);return ge(xt(i[3],s,r),i[1])}var o=a.match(pe);if(null!==o)return s=Ae(o[1],e),r=Ae(o[3],e),ge(xt(o[2],s,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this.generateTokenValues(e.triggerParts)),i=a.assignee,s=a.rawValue;switch(i){case"energy":if(this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0}))return this._player.updateStatusValueBox(),this.gameover(),{isGameOver:!0};break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;case"moveCount":this._player.setMoveCount(this.toValidStatusValue(s));break;case"variable":if(isNaN(a.index)||!this.isValidUserVarIndex(a.index))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a.index,this.toAssignableValue(s));break;case"map":this.appearPartsEval(e.triggerParts.position,"".concat(a.x),"".concat(a.y),a.rawValue,m.MAP);break;case"mapObject":this.appearPartsEval(e.triggerParts.position,"".concat(a.x),"".concat(a.y),a.rawValue,m.OBJECT);break;case"item":this.setPlayerGetItem(a.boxIndex1to12,s);break;case"playerDirection":this._player.setDir(s)}return this._player.updateStatusValueBox(),{}},t.prototype.generateTokenValues=function(t){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(),playerDirection:this._player.getDir(),itemBox:this._player.getCopyOfItemBox(),partsId:t.id,partsType:t.type,partsPosition:t.position,map:this._wwaData.map,mapObject:this._wwaData.mapObject}},t.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var 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)?m.MAP:m.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)}},t.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))}},t.prototype.setPlayerSpeedIndex=function(t){if(t<V.MIN_SPEED_INDEX||V.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},t.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},t.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},t.prototype.hideStatus=function(t,e){if(t<0||t>k.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(k[t],!e),this._player.updateStatusValueBox()},t.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===m.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(s===m.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,a,r,s)},t.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(wt("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*V.CHIP_SIZE,"px -").concat(t.y*V.CHIP_SIZE,"px")}))},t.prototype._getVirtualPadButton=function(t){if(!_t.includes(t))throw new ReferenceError("WWAの仮想パッド ".concat(t," は存在しません。"));return this._virtualPadButtonElements[t]},t.prototype._setVirtualPadTouch=function(t){this._getVirtualPadButton(t).classList.add("wwa-virtualpad__button--pressed")},t.prototype._setVirtualPadLeave=function(t){this._getVirtualPadButton(t).classList.remove("wwa-virtualpad__button--pressed")},t.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,i;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(i=!1,e){case st.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_LEFT)&&(i=!0);break;case st.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_RIGHT)&&(i=!0);break;case st.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_UP)&&(i=!0);break;case st.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(st.BUTTON_CROSS_KEY_DOWN)&&(i=!0)}if(this._gamePadStore.buttonTrigger(e)&&(i=!0),i&&this.onselectitem(a))return!0}return!1},t.prototype.setGamePadButtonItemTable=function(t,e){var a,i;if(!this._wwaData.gamePadButtonItemTable)for(i in this._wwaData.gamePadButtonItemTable=[],st)a=i,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},t.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?Aa.UNMATCHED_WORLD_NAME:a&&a!==va(this._wwaData.worldName,this._wwaData.worldPassNumber)?Aa.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Aa.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},t.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},t.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},t.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},t.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},t.prototype._loadSystemMessage=function(t){if(this._wwaData.customSystemMessages[t])return this._wwaData.customSystemMessages[t];var e=r[t];if(e.mapdataParams)switch(e.mapdataParams.messageArea){case"message":return""===(a=this._wwaData.message[e.mapdataParams.index])?e.defaultText:a;case"systemMessage":var a;return""===(a=this._wwaData.systemMessage[e.mapdataParams.index])?e.defaultText:a;default:throw new Error("システムエラー: システムメッセージの設定がおかしいようです")}return e.defaultText},t.prototype.resolveSystemMessage=function(t){var e=this,a=this._loadSystemMessage(t);switch(t){case s.ITEM_SELECT_TUTORIAL:return a.replaceAll("%HOW_TO_USE_ITEM%",function(){switch(e.userDevice.device){case S.PC:return"右のボックスを選択する";case S.VR:return"右のボックスをクリックする";case S.SP:return"右のボックスをタップする";case S.GAME:switch(e.userDevice.os){case A.NINTENDO:return"Xボタンを押すか、右のボックスをタップする";case A.PLAY_STATION:return"△ボタンを押す";case A.XBOX:return"Yボタンを押す";default:return"右のボックスを選択する"}default:return"右のボックスを選択する"}}());case s.GAME_SPEED_CHANGED:var i=this._player.getSpeedIndex();return a.replaceAll("%GAME_SPEED_NAME%",F[i]).replaceAll("%HIGH_SPEED_MESSAGE%",this.isBattleSpeedIndexForQuickBattle(i)?"戦闘も速くなります。\n":"").replaceAll("%MAX_SPEED_INDEX%",String(V.MAX_SPEED_INDEX+1)).replaceAll("%GAME_SPEED_INDEX%",String(i+1)).replaceAll("%SPEED_UP_BUTTON%",this.userDevice.os===A.NINTENDO?"+ボタン":"Pキー").replaceAll("%SPEED_DOWN_BUTTON%",this.userDevice.os===A.NINTENDO?"-ボタン":"Iキー");default:return a}},t.prototype.overwriteSystemMessage=function(t,e){this._wwaData.customSystemMessages[t]=e},t}(),oi=!1;function ni(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(wt("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){oi=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(oi)return oi=!1,t.returnValue=e,e}));var t=dt("wwa-wrapper").getAttribute("data-wwa-title-img"),e=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-enable"),a=null!==e&&null!==e.match(/^true$/i);Xe(dt("wwa-wrapper"),t,a);var i=dt("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=dt("wwa-wrapper").getAttribute("data-wwa-audio-dir"),r=dt("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),o=null,n="true"===dt("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),_=dt("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");dt("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&n&&(o=function(t){var e=ft(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<V.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)}V.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;dt("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(c=!1);var h=dt("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),u=!1;null!==h&&h.match(/^true$/i)&&(u=!0);var l=!0,p=dt("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==p&&p.match(/^false$/i)&&(l=!1);var d=!1,E=dt("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==E&&E.match(/^true$/i)&&(d=!0);var f,y,w=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-viewport-fit-enable");je()&&null!==w&&w.match(/^true$/i)&&(f=document.getElementsByTagName("head")[0],(y=document.createElement("meta")).setAttribute("name","viewport"),f.appendChild(y),lt(),window.addEventListener("resize",lt));var m,g=dt("wwa-wrapper").getAttribute("data-wwa-virtualpad-controller-elm"),v=a&&g?yt(g):null,A=!(null===(m=dt("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!m.match(/^true$/i));Ba=new ri(i,c,t,u,l,d,s,A,o,_,n,a,v)}}"complete"===document.readyState?setTimeout(ni):window.addEventListener("load",(function(){setTimeout(ni)}))}()}();